dsh-social-trace 0.1.2 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/THIRD_PARTY_NOTICES +2655 -0
- package/lib/agent.js +3 -2
- package/lib/author-index.js +17 -0
- package/lib/business.js +48 -0
- package/lib/chat-context.js +32 -0
- package/lib/chat-model.js +57 -0
- package/lib/chat.js +356 -0
- package/lib/client.js +219 -14
- package/lib/index.js +37 -20
- package/lib/worker.js +68 -3
- package/package.json +17 -6
package/lib/client.js
CHANGED
|
@@ -78,6 +78,20 @@
|
|
|
78
78
|
|
|
79
79
|
.st .st-version-entry{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:10px 0;margin-top:12px;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;font-size:11px;color:var(--muted)}.st-update-available{color:var(--accent);font-weight:600}.st .st-update-dialog{width:min(560px,94vw)}.st-version-compare{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--inset);margin:18px 0}.st-version-compare small{display:block;color:var(--muted);font-size:12px;margin-bottom:8px}.st-version-compare strong{font-size:24px;overflow-wrap:anywhere}.st-version-compare>span{color:var(--muted);font-size:22px}.st-version-compare>div:last-child strong{color:var(--accent)}.st-update-status{font-size:13px;line-height:1.8;overflow-wrap:anywhere}.st-update-dialog>.st-caption{font-size:11px;line-height:1.8;margin-top:18px}.st-update-command{font-size:12px;color:var(--muted);margin-top:18px}.st-update-command>summary{cursor:pointer}.st-update-command code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;margin-top:10px;background:var(--inset);border-radius:8px}.st-update-dialog .st-actions a{font-size:12px}
|
|
80
80
|
`;
|
|
81
|
+
const CHAT_CSS = `.st-aside{flex-basis:210px;padding:48px 12px 16px;gap:22px;background:color-mix(in srgb,var(--text) 3%,var(--bg))}.st-brand{display:flex;align-items:center;gap:9px;padding:0 8px;font-size:20px}.st-brand img{border-radius:8px}.st-nav{gap:5px}.st .st-nav>button,.st .st-follow-menu>summary{display:flex;align-items:center;gap:12px;min-height:42px;padding:9px 12px;border:0;border-radius:9px;font-size:13px}.st .st-nav .active{background:color-mix(in srgb,var(--text) 7%,var(--bg));color:var(--text);border-color:transparent}.st-follow-label{display:flex;align-items:center;gap:12px;min-width:0}.st-nav-icon{flex:none}.st .st-nav>button{justify-content:flex-start}.st .st-nav>button.active,.st .st-follow-menu>summary.active{background:color-mix(in srgb,var(--text) 7%,var(--bg));color:var(--text);border-color:transparent}.st-nav-badge{margin-left:auto}.st-chat-history{display:grid;gap:3px;min-height:0;overflow:auto}.st-chat-history-head{display:flex;align-items:center;justify-content:space-between;padding:0 12px;color:var(--muted);font-size:11px}.st .st-chat-history-head button{border:0;background:transparent;font-size:18px;padding:0 5px}.st .st-chat-history>button{border:0;background:transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-size:12px;padding:9px 12px}.st .st-chat-history>button.active{background:color-mix(in srgb,var(--text) 7%,var(--bg))}.st-chat-main{display:flex;flex-direction:column;background:color-mix(in srgb,var(--text) 1.5%,var(--bg))}.st-chat-main>.st-head{display:none}.st-chat{width:100%;max-width:900px;margin:0 auto;display:flex;flex-direction:column;gap:18px;min-width:0;flex:1}.st-chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px}.st .st-chat-toolbar button{border:0;background:transparent;font-size:12px;color:var(--muted)}.st-chat-welcome{display:flex;align-items:center;gap:12px;margin-top:clamp(40px,18vh,180px)}.st-chat-welcome h2{font-size:32px;letter-spacing:-1px;margin:0}.st-chat-welcome p{color:var(--muted);font-size:12px;margin-left:auto}.st-chat-log{display:grid;gap:24px;min-width:0}.st-chat.is-empty .st-chat-log{display:none}.st-chat-turn{min-width:0;padding-bottom:16px}.st-chat-question{font-weight:500;padding:12px 18px;background:color-mix(in srgb,var(--text) 5%,var(--bg));border-radius:18px 18px 4px 18px;margin-left:auto;max-width:85%;width:fit-content;white-space:pre-wrap;overflow-wrap:anywhere}.st-chat-answer{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:14px;padding:20px 0 8px}.st-chat-turn small{color:var(--muted);font-size:11px}.st-chat-sources{display:flex;flex-wrap:wrap;gap:8px;font-size:12px}.st-chat-turn details{font-size:12px;color:var(--muted);margin-top:12px}.st-chat-turn details>div{padding:5px 0}.st-chat-confirm{border:1px solid var(--accent);background:var(--card);border-radius:12px;padding:16px;margin-top:12px}.st-chat-compose{position:sticky;bottom:0;background:var(--card);padding:16px;border:1px solid var(--line);border-radius:18px;box-shadow:0 4px 20px #00000004;margin-top:auto}.st-chat.is-empty .st-chat-compose{margin-top:0;position:static}.st-chat-compose:focus-within{border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}.st-chat-compose textarea{display:block;width:100%;box-sizing:border-box;min-height:100px;max-height:260px;resize:vertical;border:0;padding:0;font:inherit;line-height:1.7;background:transparent;color:var(--text);outline:none}.st-chat-compose-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:12px}.st .st-chat-send{border-radius:50%;width:34px;height:34px;padding:0;font-size:23px;line-height:1}.st-chat-disclosure{font-size:10px;color:var(--muted);text-align:center;margin:0}.st-chat-examples{display:grid;gap:4px}.st .st-chat-examples button{border:0;background:transparent;display:flex;align-items:center;gap:13px;text-align:left;width:fit-content;padding:9px 12px;font-size:13px;color:var(--muted)}.st-chat-examples button span{font-size:18px;width:20px;text-align:center}
|
|
82
|
+
@container st-app (max-width:600px){.st-aside{flex:none;width:100%;padding:16px 12px;max-height:240px;gap:10px}.st-brand{font-size:17px}.st-chat-history,.st-aside .st-account,.st-aside .st-version-entry{display:none}.st .st-nav>button,.st .st-follow-menu>summary{padding:8px;gap:6px;font-size:12px}.st-follow-label{gap:6px}.st-nav-icon{width:15px;height:15px}.st-chat-welcome{margin-top:30px;flex-wrap:wrap}.st-chat-welcome h2{font-size:26px}.st-chat-welcome p{margin:0;flex-basis:100%}.st-chat-compose{padding:12px}.st-chat-examples button{max-width:100%}.st-chat-main{padding:16px 12px}}
|
|
83
|
+
|
|
84
|
+
.st-chat-answer{white-space:normal;font-size:15px;line-height:1.85;padding:12px 0}.st-chat-answer p{margin:0 0 16px;white-space:pre-wrap}.st-chat-answer h2{font-size:23px;line-height:1.45;margin:24px 0 16px;letter-spacing:-.4px}.st-chat-answer h3{font-size:18px;line-height:1.5;margin:24px 0 12px}.st-chat-answer h4,.st-chat-answer h5,.st-chat-answer h6{font-size:16px;margin:20px 0 10px}.st-chat-answer ul,.st-chat-answer ol{padding-left:24px;margin:12px 0 20px}.st-chat-answer li{padding-left:4px;margin:9px 0;white-space:pre-wrap}.st-chat-answer strong{font-weight:650}.st-chat-answer code{font-size:.88em;background:color-mix(in srgb,var(--text) 5%,var(--bg));border-radius:4px;padding:2px 5px}.st-chat-answer pre{overflow:auto;padding:16px;border-radius:10px;background:var(--inset);line-height:1.6}.st-chat-answer pre code{background:transparent;padding:0}.st-chat-answer blockquote{margin:16px 0;padding:8px 16px;border-left:3px solid var(--line);color:var(--muted);white-space:pre-wrap}.st-chat-answer hr{border:0;border-top:1px solid var(--line);margin:24px 0}.st-chat-table{overflow:auto;margin:16px 0}.st-chat-table table{border-collapse:collapse;width:100%;font-size:13px}.st-chat-table th,.st-chat-table td{padding:10px 14px;text-align:left;border-bottom:1px solid var(--line);min-width:100px}.st-chat-table th{background:var(--inset)}.st .st-chat-citation{font-size:11px;vertical-align:super;padding:1px 4px;border-radius:4px;background:color-mix(in srgb,var(--accent) 7%,var(--bg));white-space:nowrap}.st-chat-progress{margin-top:22px;color:var(--muted);font-size:12px}.st-chat-progress-head{display:flex;align-items:center;gap:8px}.st-chat-progress-head>small{margin-left:auto;font-variant-numeric:tabular-nums}.st .st-chat-progress-head button{border:0;background:transparent;padding:3px 8px;font-size:11px}.st-chat-spinner{width:12px;height:12px;border:1.5px solid var(--line);border-top-color:var(--muted);border-radius:50%;animation:st-chat-spin 1s linear infinite}.st-chat-trace{border-left:2px solid var(--line);padding-left:14px}.st-chat-live-steps{border-left:2px solid var(--line);padding:0 0 0 14px;list-style:none;margin:10px 0}.st-chat-live-steps li{display:flex;align-items:baseline;gap:10px;padding:5px 0}.st-chat-live-steps li small{margin-left:auto}.st-chat-live-steps .is-running{color:var(--accent)}.st-chat-trace ol{list-style:none;padding:0;margin:10px 0}.st-chat-trace li{display:flex;flex-wrap:wrap;gap:10px;padding:6px 0}.st-chat-trace li small{margin-left:auto}.st-chat-trace li p{flex-basis:100%;color:var(--amber)}.st-chat-source-list{border-top:1px solid var(--line);padding-top:12px}.st-chat-source-list summary,.st-chat-trace summary{cursor:pointer}.st-chat-sources{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;padding-top:10px}.st-chat-sources a,.st-chat-sources>span{padding:8px 10px;color:var(--muted);background:var(--inset);border-radius:6px;font-size:11px;overflow-wrap:anywhere}@keyframes st-chat-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.st-chat-spinner{animation:none}}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
.st .st-new-chat{display:flex;align-items:center;gap:12px;border:0;background:transparent;text-align:left;padding:10px 12px;font-size:13px;border-radius:9px}.st-aside{gap:16px}.st-chat-history{max-height:40vh;flex:1;align-content:start}.st-chat-history-head{margin:4px 0 8px}.st-utility-nav{margin-top:auto}.st-aside .st-account{margin-top:0}.st-chat-history>button.active{background:var(--inset)}@container st-app (max-width:600px){.st .st-new-chat{padding:6px 8px;position:absolute;right:14px;top:12px;font-size:12px}.st-aside .st-utility-nav{display:flex;margin:0}.st-chat-history{display:none}.st-aside{gap:8px}}
|
|
88
|
+
.st-chat-mobile-sessions{display:none}@container st-app (max-width:600px){.st-chat-mobile-sessions{display:block;max-width:140px;padding:5px;font-size:11px}.st-chat-toolbar{flex-wrap:wrap}}
|
|
89
|
+
|
|
90
|
+
.st-main.st-chat-main{padding:0;overflow:hidden}.st-main>.st-chat{height:100%;min-height:0;max-width:none;flex:1;gap:0;margin:0}.st-chat-toolbar{flex:none;min-height:64px;padding:12px 28px;border-bottom:1px solid var(--line);background:var(--bg);z-index:2}.st-chat-title{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.st-chat-title h1{font-size:15px;font-weight:600;margin:0;letter-spacing:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.st-chat-header-actions{display:flex;align-items:center;gap:12px;flex:none}.st-chat-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:24px 28px;scrollbar-gutter:stable}.st-chat-content{max-width:900px;margin:0 auto;display:flex;flex-direction:column;gap:18px;min-width:0}.st-chat-dock{flex:none;background:var(--bg);border-top:1px solid var(--line);padding:12px max(28px,calc((100% - 900px)/2)) 14px;position:relative}.st-chat-dock .st-chat-compose{position:static;margin:0}.st-chat-dock .st-chat-disclosure{padding-top:8px}.st-chat-dock textarea{min-height:64px;max-height:160px}.st .st-chat-jump{display:block;margin:0 auto 8px;font-size:11px;border-radius:20px;padding:4px 12px}.st-chat-scroll:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.st-aside>.st-new-chat{flex:none;order:0}.st-aside>.st-brand{flex:none;order:-1}@container st-app (max-width:600px){.st-chat-toolbar{padding:10px 12px;min-height:52px;flex-wrap:nowrap}.st-chat-title h1{font-size:13px}.st-chat-header-actions{gap:4px}.st-chat-mobile-sessions{max-width:100px}.st-chat-scroll{padding:16px 12px}.st-chat-dock{padding:10px 12px}.st .st-aside{flex-shrink:0}.st-chat-content .st-chat-welcome{margin-top:24px}}
|
|
91
|
+
.st .st-new-chat.active{background:color-mix(in srgb,var(--text) 7%,var(--bg));font-weight:550}
|
|
92
|
+
|
|
93
|
+
.st-chat-history-row{display:flex;position:relative;min-width:0;align-items:center}.st .st-chat-history-row>button:first-child{flex:1;min-width:0;border:0;background:transparent;text-align:left;padding:9px 34px 9px 12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.st .st-chat-history-row>button.active{background:color-mix(in srgb,var(--text) 7%,var(--bg))}.st .st-chat-delete{position:absolute;right:5px;display:grid;place-items:center;width:25px;height:25px;padding:0;border:0;background:var(--bg);opacity:0;pointer-events:none}.st-chat-history-row:hover .st-chat-delete,.st-chat-history-row:focus-within .st-chat-delete{opacity:1;pointer-events:auto}.st-chat-undo{font-size:11px;color:var(--muted);padding:8px 10px}.st .st-chat-undo button{border:0;background:transparent;color:var(--accent);padding:3px 0}.st-chat-run-error{font-size:12px;line-height:1.7;padding:10px 12px;border-left:2px solid var(--amber);color:var(--amber);background:var(--inset)}@media(hover:none){.st-chat-history-row .st-chat-delete{opacity:1;pointer-events:auto}}
|
|
94
|
+
`;
|
|
81
95
|
const labels = { ready: '已连接', cooling_down: '冷却中', needs_login: '需要登录', needs_verification: '需要验证', paused: '已暂停',
|
|
82
96
|
queued: '按计划执行', needs_review: '需要检查', complete: '已到可访问末尾' };
|
|
83
97
|
const channelNames = { weixin: '微信', qq: 'QQ', feishu: '飞书', dingtalk: '钉钉', telegram: 'Telegram', slack: 'Slack', discord: 'Discord', wecom: '企业微信' };
|
|
@@ -121,6 +135,7 @@
|
|
|
121
135
|
if (source?.stopped) return result('平台后台未就绪', 'blocked', '请检查插件后台状态', 'service');
|
|
122
136
|
if (source?.enabled === false) return result('平台已暂停', 'paused', '开启平台开关后继续');
|
|
123
137
|
if (target?.capture_mode === 'pending') return result('待确认记录方式', 'paused', '读取博主资料后,选择从现在记录或补存历史', 'archive');
|
|
138
|
+
if (source?.connectionRecovery) return result('自动恢复中', 'paused', '连接暂时不可用,后台会在冷却后自动检查;无需反复点击检查连接');
|
|
124
139
|
if (target?.enabled === false) return result('任务已暂停', 'paused', '在大屏单独开启新动态或历史缓存后继续');
|
|
125
140
|
if (account?.status !== 'ready') return result(account?.status === 'needs_login' ? '等待登录' : account?.status === 'needs_verification' ? '需要验证' : '连接待恢复', 'blocked', account?.reason || '请先确认' + (platformNames[platform] || platform) + '账号连接');
|
|
126
141
|
if (account.cooldown_until > Date.now()) return result(account.errors ? '采集异常 · 等待重试' : '冷却中', 'cooldown', (account.reason ? account.reason + ';' : '') + '不早于 ' + date(account.cooldown_until) + ' 继续');
|
|
@@ -358,7 +373,7 @@
|
|
|
358
373
|
h('p', { className: 'st-caption' }, '更新保留本地资料、账号授权和监控配置。需要重启时会提示,不会自动重启 Harness。'),
|
|
359
374
|
view.manualCommand ? h('details', { className: 'st-update-command' }, h('summary', null, '手动更新命令'), h('code', null, view.manualCommand)) : null);
|
|
360
375
|
}
|
|
361
|
-
function AgentSettings({ state, act, busy, error, close, initialTab = 'settings' }) {
|
|
376
|
+
function AgentSettings({ state, act, busy, error, close, openChat, initialTab = 'settings' }) {
|
|
362
377
|
const dialog = React.useRef(null), status = state.agent || {};
|
|
363
378
|
const saved = status.config || { enabled: false, botId: '', targetId: '', uids: [] };
|
|
364
379
|
const destinations = pushDestinations(saved);
|
|
@@ -429,7 +444,9 @@
|
|
|
429
444
|
if (!all && !value.uids.length) { setLocalError('请至少选择一位博主'); return; }
|
|
430
445
|
void save({ ...saved, uids: all ? [] : value.uids }, '推送博主范围已保存');
|
|
431
446
|
} }, '保存博主范围'))),
|
|
432
|
-
h('details', { className: 'st-setting-help' }, h('summary', null, '
|
|
447
|
+
h('details', { className: 'st-setting-help' }, h('summary', null, '业务 Chat · ', status.summaryAvailable ? '模型已连接' : '等待 DSH 模型'),
|
|
448
|
+
h('p', { className: 'st-caption' }, '在 Chat 中总结、提问、创建任务或控制监控。总结任务当前只保存本地报告;此处 IM 配置仍用于原文通知。'),
|
|
449
|
+
openChat ? h('button', { type: 'button', onClick: openChat }, '打开 Chat') : null))
|
|
433
450
|
: tab === 'add' ? h('section', { id: 'st-agent-panel-add', role: 'tabpanel', 'aria-labelledby': 'st-agent-tab-add', className: 'st-add-channel' },
|
|
434
451
|
h('p', { className: 'st-caption' }, '选择 dsh-im 中的机器人和接收目标,将它添加到 Social Trace。'),
|
|
435
452
|
h(SettingRow, { label: '机器人', htmlFor: 'st-agent-bot', description: status.transportAvailable ? '复用 dsh-im 已连接的机器人' : '尚未连接 dsh-im' },
|
|
@@ -934,10 +951,173 @@
|
|
|
934
951
|
h('button', { className: 'st-primary', disabled: !ready, onClick: () => openSettings({ scope: 'target', uid: target.uid, platform: target.platform, tab: 'history' }) }, '设置历史缓存'))),
|
|
935
952
|
h('p', { className: 'st-caption' }, '全量历史会慢慢读取;进度、剩余估计和暂停原因可随时查看,稍后也能调整缓存范围。')));
|
|
936
953
|
}
|
|
954
|
+
/* MARKDOWN_VENDOR_START */
|
|
955
|
+
function loadChatMarkdown(require) {
|
|
956
|
+
const module = { exports: {} };
|
|
957
|
+
var Cu=Object.create;var qt=Object.defineProperty;var Eu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Au=Object.prototype.hasOwnProperty;var Pu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),On=(e,t)=>{for(var n in t)qt(e,n,{get:t[n],enumerable:!0})},zi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Iu(t))!Au.call(e,i)&&i!==n&&qt(e,i,{get:()=>t[i],enumerable:!(r=Eu(t,i))||r.enumerable});return e};var Di=(e,t,n)=>(n=e!=null?Cu(Tu(e)):{},zi(t||!e||!e.__esModule?qt(n,"default",{value:e,enumerable:!0}):n,e)),Lu=e=>zi(qt({},"__esModule",{value:!0}),e);var yl=Pu((yy,kl)=>{"use strict";var wn=Object.prototype.hasOwnProperty,xl=Object.prototype.toString,fl=Object.defineProperty,pl=Object.getOwnPropertyDescriptor,ml=function(t){return typeof Array.isArray=="function"?Array.isArray(t):xl.call(t)==="[object Array]"},hl=function(t){if(!t||xl.call(t)!=="[object Object]")return!1;var n=wn.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wn.call(t,i)},dl=function(t,n){fl&&n.name==="__proto__"?fl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},gl=function(t,n){if(n==="__proto__")if(wn.call(t,n)){if(pl)return pl(t,n).value}else return;return t[n]};kl.exports=function e(){var t,n,r,i,l,o,a=arguments[0],u=1,c=arguments.length,s=!1;for(typeof a=="boolean"&&(s=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=gl(a,n),i=gl(t,n),a!==i&&(s&&i&&(hl(i)||(l=ml(i)))?(l?(l=!1,o=r&&ml(r)?r:[]):o=r&&hl(r)?r:{},dl(a,{name:n,newValue:e(s,o,i)})):typeof i<"u"&&dl(a,{name:n,newValue:i}));return a}});var vm={};On(vm,{createChatMarkdown:()=>Lm,streamingMarkdown:()=>hu});module.exports=Lu(vm);function Ri(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var vu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mu={};function Vt(e,t){return((t||Mu).jsx?Fu:vu).test(e)}var zu=/[ \t\n\f\r]/g;function Bn(e){return typeof e=="object"?e.type==="text"?Oi(e.value):!1:Oi(e)}function Oi(e){return e.replace(zu,"")===""}var Le=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Le.prototype.normal={};Le.prototype.property={};Le.prototype.space=void 0;function _n(e,t){let n={},r={};for(let i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Le(n,r,t)}function St(e){return e.toLowerCase()}var ee=class{constructor(t,n){this.attribute=n,this.property=t}};ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;var Ct={};On(Ct,{boolean:()=>M,booleanish:()=>$,commaOrSpaceSeparated:()=>le,commaSeparated:()=>ve,number:()=>I,overloadedBoolean:()=>Wt,spaceSeparated:()=>U});var Du=0,M=qe(),$=qe(),Wt=qe(),I=qe(),U=qe(),ve=qe(),le=qe();function qe(){return 2**++Du}var Nn=Object.keys(Ct),Ve=class extends ee{constructor(t,n,r,i){let l=-1;if(super(t,n),Bi(this,"space",i),typeof r=="number")for(;++l<Nn.length;){let o=Nn[l];Bi(this,Nn[l],(r&Ct[o])===Ct[o])}}};Ve.prototype.defined=!0;function Bi(e,t,n){n&&(e[t]=n)}function pe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let l=new Ve(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[St(r)]=r,n[St(l.attribute)]=r}return new Le(t,n,e.space)}var jn=pe({properties:{ariaActiveDescendant:null,ariaAtomic:$,ariaAutoComplete:null,ariaBusy:$,ariaChecked:$,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:$,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:$,ariaFlowTo:U,ariaGrabbed:$,ariaHasPopup:null,ariaHidden:$,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:I,ariaLive:null,ariaModal:$,ariaMultiLine:$,ariaMultiSelectable:$,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:$,ariaReadOnly:$,ariaRelevant:null,ariaRequired:$,ariaRoleDescription:U,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:$,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gt(e,t){return t in e?e[t]:t}function Qt(e,t){return Gt(e,t.toLowerCase())}var _i=pe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ve,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alpha:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:U,autoFocus:M,autoPlay:M,blocking:U,capture:null,charSet:null,checked:M,cite:null,className:U,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:$,controls:M,controlsList:U,coords:I|ve,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:Wt,draggable:$,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:U,height:I,hidden:Wt,high:I,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:U,itemRef:U,itemScope:M,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:M,muted:M,name:null,nonce:null,noModule:M,noValidate:M,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:M,optimum:I,pattern:null,ping:U,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:U,required:M,reversed:M,rows:I,rowSpan:I,sandbox:U,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootCustomElementRegistry:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shadowRootSerializable:M,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:$,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:$,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:M,declare:M,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:$,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:M,disablePictureInPicture:M,disableRemotePlayback:M,exportParts:ve,part:U,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:Qt});var Ni=pe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:le,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ve,g2:ve,glyphName:ve,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:le,rev:le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:le,requiredFeatures:le,requiredFonts:le,requiredFormats:le,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:le,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gt});var Hn=pe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Un=pe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qt});var qn=pe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Vn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Ru=/[A-Z]/g,ji=/-[a-z]/g,Ou=/^data[-\w.:]+$/i;function Wn(e,t){let n=St(t),r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ou.test(t)){if(t.charAt(4)==="-"){let l=t.slice(5).replace(ji,_u);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{let l=t.slice(4);if(!ji.test(l)){let o=l.replace(Ru,Bu);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ve}return new i(r,t)}function Bu(e){return"-"+e.toLowerCase()}function _u(e){return e.charAt(1).toUpperCase()}var Hi=_n([jn,_i,Hn,Un,qn],"html"),$t=_n([jn,Ni,Hn,Un,qn],"svg");function Ui(e){return e.join(" ").trim()}var qi=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Nu=/\n/g,ju=/^\s*/,Hu=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Uu=/^:\s*/,qu=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Vu=/^[;\s]*/,Wu=`
|
|
958
|
+
`,Vi="/",Wi="*",Et="",Gu="comment",Qu="declaration";function Gi(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(h){var x=h.match(Nu);x&&(n+=x.length);var S=h.lastIndexOf(Wu);r=~S?h.length-S:r+h.length}function l(){var h={line:n,column:r};return function(x){return x.position=new o(h),c(),x}}function o(h){this.start=h,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(h){var x=new Error(t.source+":"+n+":"+r+": "+h);if(x.reason=h,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(h){var x=h.exec(e);if(x){var S=x[0];return i(S),e=e.slice(S.length),x}}function c(){u(ju)}function s(h){for(var x;x=f();)h.push(x);return h}function f(){var h=l();if(!(Vi!=e.charAt(0)||Wi!=e.charAt(1))){for(var x=2;Et!=e.charAt(x)&&(Wi!=e.charAt(x)||Vi!=e.charAt(x+1));)++x;if(x+=2,Et===e.charAt(x-1))return a("End of comment missing");var S=e.slice(2,x-2);return r+=2,i(S),e=e.slice(x),r+=2,h({type:Gu,comment:S})}}function m(){var h=l(),x=u(Hu);if(x){if(f(),!u(Uu))return a("property missing ':'");var S=u(qu),k=h({type:Qu,property:x[0].replace(qi,Et).trim(),value:S?S[0].replace(qi,Et).trim():Et});return u(Vu),k}}function p(){var h=[];s(h);for(var x;x=m();)h.push(x),s(h);return h}return c(),p()}function Qi(e,t){let n=null;if(!e||typeof e!="string")return n;let r=Gi(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;let{property:o,value:a}=l;i?t(o,a,l):a&&(n=n??{},n[o]=a)}),n}var Xt=$i("end"),lt=$i("start");function $i(e){return t;function t(n){let r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Gn(e){let t=lt(e),n=Xt(e);if(t&&n)return{start:t,end:n}}function Oe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xi(e.position):"start"in e||"end"in e?Xi(e):"line"in e||"column"in e?Qn(e):""}function Qn(e){return Yi(e&&e.line)+":"+Yi(e&&e.column)}function Xi(e){return Qn(e&&e.start)+"-"+Qn(e&&e.end)}function Yi(e){return e&&typeof e=="number"?e:1}var Fe=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){let u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}let a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Oe(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(Fe.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var $n={}.hasOwnProperty,$u=new Map,Xu=/[A-Z]/g,Yu=/-([a-z])/g,Ju=new Set(["table","tbody","thead","tfoot","tr"]),Ku=new Set(["td","th"]),Ji="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xn(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ls(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=os(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?$t:Hi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Ki(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Ki(e,t,n){if(t.type==="element")return Zu(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return es(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ns(e,t,n);if(t.type==="mdxjsEsm")return ts(e,t);if(t.type==="root")return rs(e,t,n);if(t.type==="text")return is(e,t)}function Zu(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=$t,e.schema=i),e.ancestors.push(t);let l=eo(e,t.tagName,!1),o=as(e,t),a=Jn(e,t);return Ju.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Bn(u):!0})),Zi(e,o,l,t),Yn(o,a),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function es(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}It(e,t.position)}function ts(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);It(e,t.position)}function ns(e,t,n){let r=e.schema,i=r;t.name==="svg"&&r.space==="html"&&(i=$t,e.schema=i),e.ancestors.push(t);let l=t.name===null?e.Fragment:eo(e,t.name,!0),o=us(e,t),a=Jn(e,t);return Zi(e,o,l,t),Yn(o,a),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function rs(e,t,n){let r={};return Yn(r,Jn(e,t)),e.create(t,e.Fragment,r,n)}function is(e,t){return t.value}function Zi(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Yn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function os(e,t,n){return r;function r(i,l,o,a){let c=Array.isArray(o.children)?n:t;return a?c(l,o,a):c(l,o)}}function ls(e,t){return n;function n(r,i,l,o){let a=Array.isArray(l.children),u=lt(r);return t(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function as(e,t){let n={},r,i;for(i in t.properties)if(i!=="children"&&$n.call(t.properties,i)){let l=ss(e,i,t.properties[i]);if(l){let[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Ku.has(t.tagName)?r=a:n[o]=a}}if(r){let l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function us(e,t){let n={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let l=r.data.estree.body[0];l.type;let o=l.expression;o.type;let a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else It(e,t.position);else{let{name:i}=r,l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else It(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Jn(e,t){let n=[],r=-1,i=e.passKeys?new Map:$u;for(;++r<t.children.length;){let l=t.children[r],o;if(e.passKeys){let u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){let c=i.get(u)||0;o=u+"-"+c,i.set(u,c+1)}}let a=Ki(e,l,o);a!==void 0&&n.push(a)}return n}function ss(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;let r=Wn(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Ri(n):Ui(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:fs(n):cs(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?Vn[r.property]||r.property:r.attribute,n]}function cs(e,t){let n={};try{Qi(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(Yu,hs))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};let i=r,l=new Fe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Ji+"#cannot-parse-style-attribute",l}return n}function eo(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){let i=t.split("."),l=-1,o;for(;++l<i.length;){let a=Vt(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=Vt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){let i=r.value;return $n.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);It(e)}function It(e,t){let n=new Fe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ji+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fs(e){let t={},n;for(n in e)$n.call(e,n)&&(t[ps(n)]=e[n]);return t}function ps(e){if(e.slice(0,2)==="--")return e;let t=e.replace(Xu,ms);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ms(e){return"-"+e.toLowerCase()}function hs(e,t){return t.toUpperCase()}var Tt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var Kn=Di(require("react")),to=Kn.default.Fragment;function Zn(e,t,n){return Kn.default.createElement(e,n===void 0?t:{...t,key:n})}var no=Zn;var Ll=require("react");var ds={};function Me(e,t){let n=t||ds,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return io(e,r,i)}function io(e,t,n){if(gs(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ro(e.children,t,n)}return Array.isArray(e)?ro(e,t,n):""}function ro(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=io(e[i],t,n);return r.join("")}function gs(e){return!!(e&&typeof e=="object")}var oo=document.createElement("i");function at(e){let t="&"+e+";";oo.innerHTML=t;let n=oo.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function K(e,t,n,r){let i=e.length,l=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function J(e,t){return e.length>0?(K(e,e.length,0,t),e):t}var lo={}.hasOwnProperty;function Yt(e){let t={},n=-1;for(;++n<e.length;)xs(t,e[n]);return t}function xs(e,t){let n;for(n in t){let i=(lo.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n],o;if(l)for(o in l){lo.call(i,o)||(i[o]=[]);let a=l[o];ks(i[o],Array.isArray(a)?a:a?[a]:[])}}}function ks(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);K(e,0,0,r)}function Jt(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function ne(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var X=_e(/[A-Za-z]/),W=_e(/[\dA-Za-z]/),ao=_e(/[#-'*+\--9=?A-Z^-~]/);function We(e){return e!==null&&(e<32||e===127)}var At=_e(/\d/),uo=_e(/[\dA-Fa-f]/),Kt=_e(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function B(e){return e!==null&&(e<0||e===32)}function v(e){return e===-2||e===-1||e===32}var Be=_e(/\p{P}|\p{S}/u),we=_e(/\s/);function _e(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function me(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let l=e.charCodeAt(n),o="";if(l===37&&W(e.charCodeAt(n+1))&&W(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){let a=e.charCodeAt(n+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="\uFFFD"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function F(e,t,n,r){let i=r?r-1:1/0,l=0;return o;function o(u){return v(u)?(e.enter(n),a(u)):t(u)}function a(u){return v(u)&&l++<i?(e.consume(u),a):(e.exit(n),t(u))}}function er(e,t,n,r,i,l){let o=0;return a;function a(s){return l>0&&v(s)?(e.enter(r),u(s)):c(s)}function u(s){return v(s)&&o<l?(e.consume(s),o++,u):(e.exit(r),c(s))}function c(s){return o>=i?t(s):n(s)}}var so={tokenize:ys};function ys(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),F(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return A(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}var ze=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){co(this,t,n,r,!1)}addBefore(t,n,r){co(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function co(e,t,n,r,i){if(n===0&&r.length===0)return;let l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var po={tokenize:ws},fo={tokenize:bs};function ws(e){let t=this,n=[],r=0,i,l,o;return a;function a(C){if(r<n.length){let P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,u,c)(C)}return c(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();let P=t.events.length,z=P,b;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){b=t.events[z][1].end;break}k(r);let R=P;for(;R<t.events.length;)t.events[R][1].end={...b},R++;let j=new ze;return j.add(z+1,0,t.events.slice(P)),j.add(P,R-P,[]),j.consume(t.events),c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return m(C);if(i.currentConstruct&&i.currentConstruct.concrete)return h(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fo,s,f)(C)}function s(C){return i&&E(),k(r),m(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(C)}function m(C){return t.containerState={},e.attempt(fo,p,h)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),m(C)}function h(C){if(C===null){i&&E(),k(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),x(C)}function x(C){if(C===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return A(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),x)}function S(C,P){let z=t.sliceStream(C);if(P&&z.push(null),C.previous=l,l&&(l.next=C),l=C,i.defineSkip(C.start),i.write(z),t.parser.lazy[C.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<o&&(!i.events[b][1].end||i.events[b][1].end.offset>o))return;let R=t.events.length,j=R,G,y;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(G){y=t.events[j][1].end;break}G=!0}for(k(r),b=R;b<t.events.length;)t.events[b][1].end={...y},b++;let H=new ze;H.add(j+1,0,t.events.slice(R)),H.add(R,b-R,[]),H.consume(t.events)}}function k(C){let P=n.length;for(;P-- >C;){let z=n[P];t.containerState=z[1],z[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function bs(e,t,n){return F(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function he(e){if(e===null||B(e)||we(e))return 1;if(Be(e))return 2}function be(e,t,n){let r=[],i=-1;for(;++i<e.length;){let l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}var Pt={name:"attention",resolveAll:Ss,tokenize:Cs};function Ss(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},a={...e[n][1].start};mo(o,-l),mo(a,l);let u={type:l>1?"strongSequence":"emphasisSequence",start:o,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:a},s={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},f={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=J(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=J(r,[["enter",f,t],["enter",u,t],["exit",u,t],["enter",s,t]]),r=J(r,be(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=J(r,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",f,t]]);let m=0;e[n][1].end.offset-e[n][1].start.offset&&(m=2,r=J(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),K(e,i-1,n-i+3,r),n=i+r.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Cs(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=he(r),l;return o;function o(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;let c=e.exit("attentionSequence"),s=he(u),f=!s||s===2&&i||n.includes(u)&&u!==42&&u!==95,m=!i||i===2&&s||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?f:f&&(i||!m)),c._close=!!(l===42?m:m&&(s||!f)),t(u)}}function mo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var tr={name:"autolink",tokenize:Es};function Es(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return X(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||W(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||W(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||We(p)?n(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),s):ao(p)?(e.consume(p),c):n(p)}function s(p){return W(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,s):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||W(p))&&r++<63){let h=p===45?m:f;return e.consume(p),h}return n(p)}}var Se={partial:!0,tokenize:Is};function Is(e,t,n){return r;function r(l){return v(l)?F(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||A(l)?t(l):n(l)}}var Zt={continuation:{tokenize:As},exit:Ps,name:"blockQuote",tokenize:Ts};function Ts(e,t,n){let r=this;return i;function i(o){if(o===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return v(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function As(e,t,n){let r=this;return i;function i(o){return v(o)?F(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Zt,t,n)(o)}}function Ps(e){e.exit("blockQuote")}var en={name:"characterEscape",tokenize:Ls};function Ls(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Kt(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}var tn={name:"characterReference",tokenize:vs};function vs(e,t,n){let r=this,i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,o=W,s(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=uo,s):(e.enter("characterReferenceValue"),l=7,o=At,s(f))}function s(f){if(f===59&&i){let m=e.exit("characterReferenceValue");return o===W&&!at(r.sliceSerialize(m))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<l?(e.consume(f),s):n(f)}}var Lt={partial:!0,tokenize:Fs};function Fs(e,t,n){let r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}var nn={concrete:!0,name:"codeFenced",tokenize:Ms};function Ms(e,t,n){let r=this,i={partial:!0,tokenize:z},l=0,o=0,a;return u;function u(b){return c(b)}function c(b){let R=r.events[r.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(b)}function s(b){return b===a?(o++,e.consume(b),s):o<3?n(b):(e.exit("codeFencedFenceSequence"),v(b)?F(e,f,"whitespace")(b):f(b))}function f(b){return b===null||A(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(Lt,x,P)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||A(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(b)):v(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),F(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),m)}function p(b){return b===null||A(b)?f(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===null||A(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(b)):b===96&&b===a?n(b):(e.consume(b),h)}function x(b){return e.attempt(i,P,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),k}function k(b){return l>0&&v(b)?F(e,E,"linePrefix",l+1)(b):E(b)}function E(b){return b===null||A(b)?e.check(Lt,x,P)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||A(b)?(e.exit("codeFlowValue"),E(b)):(e.consume(b),C)}function P(b){return e.exit("codeFenced"),t(b)}function z(b,R,j){let G=0;return y;function y(_){return b.enter("lineEnding"),b.consume(_),b.exit("lineEnding"),H}function H(_){return b.enter("codeFencedFence"),v(_)?F(b,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):q(_)}function q(_){return _===a?(b.enter("codeFencedFenceSequence"),L(_)):j(_)}function L(_){return _===a?(G++,b.consume(_),L):G>=o?(b.exit("codeFencedFenceSequence"),v(_)?F(b,N,"whitespace")(_):N(_)):j(_)}function N(_){return _===null||A(_)?(b.exit("codeFencedFence"),R(_)):j(_)}}}var vt={name:"codeIndented",tokenize:Ds},zs={partial:!0,tokenize:Rs};function Ds(e,t,n){return r;function r(a){return e.enter("codeIndented"),er(e,i,n,"linePrefix",4,4)(a)}function i(a){return a===null?o(a):A(a)?e.attempt(zs,i,o)(a):(e.enter("codeFlowValue"),l(a))}function l(a){return a===null||A(a)?(e.exit("codeFlowValue"),i(a)):(e.consume(a),l)}function o(a){return e.exit("codeIndented"),t(a)}}function Rs(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):er(e,t,l,"linePrefix",4,4)(o)}function l(o){return A(o)?i(o):n(o)}}var nr={name:"codeText",previous:Bs,resolve:Os,tokenize:_s};function Os(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Bs(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _s(e,t,n){let r=this,i=0,l,o;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),i++,u):(e.exit("codeTextSequence"),c(m))}function c(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),c):m===96?(o=e.enter("codeTextSequence"),l=0,f(m)):A(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("codeTextData"),s(m))}function s(m){return m===null||m===32||m===96||A(m)?(e.exit("codeTextData"),c(m)):(e.consume(m),s)}function f(m){return m===96?(e.consume(m),l++,f):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(o.type="codeTextData",s(m))}}var rn=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ft(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ft(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ft(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Ft(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ft(this.left,n.reverse())}}};function Ft(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function on(e){let t={},n=-1,r,i,l,o,a,u,c,s=new rn(e);for(;++n<s.length;){for(;n in t;)n=t[n];if(r=s.get(n),n&&r[1].type==="chunkFlow"&&s.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ns(s,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=s.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(s.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...s.get(i)[1].start},a=s.slice(i,n),a.unshift(r),s.splice(i,n-i+1,a))}}return K(e,0,Number.POSITIVE_INFINITY,s.slice(0)),!c}function Ns(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,l=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let a=o.events,u=[],c={},s,f,m=-1,p=n,h=0,x=0,S=[x];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(s=r.sliceStream(p),p.next||s.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(s),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(x=m+1,S.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),m=S.length;m--;){let k=a.slice(S[m],S[m+1]),E=l.pop();u.push([E,E+k.length-1]),e.splice(E,2,k)}for(u.reverse(),m=-1;++m<u.length;)c[h+u[m][0]]=h+u[m][1],h+=u[m][1]-u[m][0]-1;return c}var rr={resolve:Hs,tokenize:Us},js={partial:!0,tokenize:qs};function Hs(e){return on(e),e}function Us(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):A(a)?e.check(js,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function qs(e,t,n){let r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),F(e,l,"linePrefix")}function l(o){if(o===null||A(o))return n(o);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function ln(e,t,n,r,i,l,o,a,u){let c=u||Number.POSITIVE_INFINITY,s=0;return f;function f(k){return k===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(k),e.exit(l),m):k===null||k===32||k===41||We(k)?n(k):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(k))}function m(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===62?(e.exit("chunkString"),e.exit(a),m(k)):k===null||k===60||A(k)?n(k):(e.consume(k),k===92?h:p)}function h(k){return k===60||k===62||k===92?(e.consume(k),p):p(k)}function x(k){return!s&&(k===null||k===41||B(k))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(k)):s<c&&k===40?(e.consume(k),s++,x):k===41?(e.consume(k),s--,x):k===null||k===32||k===40||We(k)?n(k):(e.consume(k),k===92?S:x)}function S(k){return k===40||k===41||k===92?(e.consume(k),x):x(k)}}function an(e,t,n,r,i,l){let o=this,a=0,u;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),s}function s(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),s(p)):(e.consume(p),u||(u=!v(p)),p===92?m:f)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function un(e,t,n,r,i,l){let o;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(l),c(m))}function c(m){return m===o?(e.exit(l),u(o)):m===null?n(m):A(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),F(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(m))}function s(m){return m===o||m===null||A(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?f:s)}function f(m){return m===o||m===92?(e.consume(m),s):s(m)}}function Ge(e,t){let n;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):v(i)?F(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var ir={name:"definition",tokenize:Ws},Vs={partial:!0,tokenize:Gs};function Ws(e,t,n){let r=this,i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return an.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ne(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return B(p)?Ge(e,c)(p):c(p)}function c(p){return ln(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function s(p){return e.attempt(Vs,f,f)(p)}function f(p){return v(p)?F(e,m,"whitespace")(p):m(p)}function m(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Gs(e,t,n){return r;function r(a){return B(a)?Ge(e,i)(a):n(a)}function i(a){return un(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return v(a)?F(e,o,"whitespace")(a):o(a)}function o(a){return a===null||A(a)?t(a):n(a)}}var or={name:"hardBreakEscape",tokenize:Qs};function Qs(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return A(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}var lr={name:"headingAtx",resolve:$s,tokenize:Xs};function $s(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){let i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};K(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function Xs(e,t,n){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||B(s)?(e.exit("atxHeadingSequence"),a(s)):n(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),u(s)):s===null||A(s)?(e.exit("atxHeading"),t(s)):v(s)?F(e,a,"whitespace")(s):(e.enter("atxHeadingText"),c(s))}function u(s){return s===35?(e.consume(s),u):(e.exit("atxHeadingSequence"),a(s))}function c(s){return s===null||s===35||B(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),c)}}var sn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mt=["pre","script","style","textarea"];var ar={concrete:!0,name:"htmlFlow",resolveTo:Js,tokenize:Ks},Ys={partial:!0,tokenize:Zs};function Js(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ks(e,t,n){let r=this,i,l,o,a,u;return c;function c(g){return s(g)}function s(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),f}function f(g){return g===33?(e.consume(g),m):g===47?(e.consume(g),l=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:d):X(g)?(e.consume(g),o=String.fromCharCode(g),S):n(g)}function m(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,h):X(g)?(e.consume(g),i=4,r.interrupt?t:d):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:d):n(g)}function h(g){let se="CDATA[";return g===se.charCodeAt(a++)?(e.consume(g),a===se.length?r.interrupt?t:q:h):n(g)}function x(g){return X(g)?(e.consume(g),o=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||B(g)){let se=g===47,rt=o.toLowerCase();return!se&&!l&&Mt.includes(rt)?(i=1,r.interrupt?t(g):q(g)):sn.includes(o.toLowerCase())?(i=6,se?(e.consume(g),k):r.interrupt?t(g):q(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):l?E(g):C(g))}return g===45||W(g)?(e.consume(g),o+=String.fromCharCode(g),S):n(g)}function k(g){return g===62?(e.consume(g),r.interrupt?t:q):n(g)}function E(g){return v(g)?(e.consume(g),E):y(g)}function C(g){return g===47?(e.consume(g),y):g===58||g===95||X(g)?(e.consume(g),P):v(g)?(e.consume(g),C):y(g)}function P(g){return g===45||g===46||g===58||g===95||W(g)?(e.consume(g),P):z(g)}function z(g){return g===61?(e.consume(g),b):v(g)?(e.consume(g),z):C(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,R):v(g)?(e.consume(g),b):j(g)}function R(g){return g===u?(e.consume(g),u=null,G):g===null||A(g)?n(g):(e.consume(g),R)}function j(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||B(g)?z(g):(e.consume(g),j)}function G(g){return g===47||g===62||v(g)?C(g):n(g)}function y(g){return g===62?(e.consume(g),H):n(g)}function H(g){return g===null||A(g)?q(g):v(g)?(e.consume(g),H):n(g)}function q(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Z):g===62&&i===4?(e.consume(g),fe):g===63&&i===3?(e.consume(g),d):g===93&&i===5?(e.consume(g),ke):A(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ys,Te,L)(g)):g===null||A(g)?(e.exit("htmlFlowData"),L(g)):(e.consume(g),q)}function L(g){return e.check(Lt,N,Te)(g)}function N(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_}function _(g){return g===null||A(g)?L(g):(e.enter("htmlFlowData"),q(g))}function Q(g){return g===45?(e.consume(g),d):q(g)}function Z(g){return g===47?(e.consume(g),o="",de):q(g)}function de(g){if(g===62){let se=o.toLowerCase();return Mt.includes(se)?(e.consume(g),fe):q(g)}return X(g)&&o.length<8?(e.consume(g),o+=String.fromCharCode(g),de):q(g)}function ke(g){return g===93?(e.consume(g),d):q(g)}function d(g){return g===62?(e.consume(g),fe):g===45&&i===2?(e.consume(g),d):q(g)}function fe(g){return g===null||A(g)?(e.exit("htmlFlowData"),Te(g)):(e.consume(g),fe)}function Te(g){return e.exit("htmlFlow"),t(g)}}function Zs(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Se,t,n)}}var ur={name:"htmlText",tokenize:ec};function ec(e,t,n){let r=this,i,l,o;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),u}function u(d){return d===33?(e.consume(d),c):d===47?(e.consume(d),z):d===63?(e.consume(d),C):X(d)?(e.consume(d),j):n(d)}function c(d){return d===45?(e.consume(d),s):d===91?(e.consume(d),l=0,h):X(d)?(e.consume(d),E):n(d)}function s(d){return d===45?(e.consume(d),p):n(d)}function f(d){return d===null?n(d):d===45?(e.consume(d),m):A(d)?(o=f,Z(d)):(e.consume(d),f)}function m(d){return d===45?(e.consume(d),p):f(d)}function p(d){return d===62?Q(d):d===45?m(d):f(d)}function h(d){let fe="CDATA[";return d===fe.charCodeAt(l++)?(e.consume(d),l===fe.length?x:h):n(d)}function x(d){return d===null?n(d):d===93?(e.consume(d),S):A(d)?(o=x,Z(d)):(e.consume(d),x)}function S(d){return d===93?(e.consume(d),k):x(d)}function k(d){return d===62?Q(d):d===93?(e.consume(d),k):x(d)}function E(d){return d===null||d===62?Q(d):A(d)?(o=E,Z(d)):(e.consume(d),E)}function C(d){return d===null?n(d):d===63?(e.consume(d),P):A(d)?(o=C,Z(d)):(e.consume(d),C)}function P(d){return d===62?Q(d):C(d)}function z(d){return X(d)?(e.consume(d),b):n(d)}function b(d){return d===45||W(d)?(e.consume(d),b):R(d)}function R(d){return A(d)?(o=R,Z(d)):v(d)?(e.consume(d),R):Q(d)}function j(d){return d===45||W(d)?(e.consume(d),j):d===47||d===62||B(d)?G(d):n(d)}function G(d){return d===47?(e.consume(d),Q):d===58||d===95||X(d)?(e.consume(d),y):A(d)?(o=G,Z(d)):v(d)?(e.consume(d),G):Q(d)}function y(d){return d===45||d===46||d===58||d===95||W(d)?(e.consume(d),y):H(d)}function H(d){return d===61?(e.consume(d),q):A(d)?(o=H,Z(d)):v(d)?(e.consume(d),H):G(d)}function q(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,L):A(d)?(o=q,Z(d)):v(d)?(e.consume(d),q):(e.consume(d),N)}function L(d){return d===i?(e.consume(d),i=void 0,_):d===null?n(d):A(d)?(o=L,Z(d)):(e.consume(d),L)}function N(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||B(d)?G(d):(e.consume(d),N)}function _(d){return d===47||d===62||B(d)?G(d):n(d)}function Q(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function Z(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),de}function de(d){return v(d)?F(e,ke,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):ke(d)}function ke(d){return e.enter("htmlTextData"),o(d)}}var Qe={name:"labelEnd",resolveAll:ic,resolveTo:oc,tokenize:lc},tc={tokenize:ac},nc={tokenize:uc},rc={tokenize:sc};function ic(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&K(e,0,e.length,n),e}function oc(e,t){let n=e.length,r=0,i,l,o;for(;n--;){let s=e[n][1];if(i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n)}let a={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",a,t],["enter",u,t]],o=J(o,e.slice(i+1,i+r+3)),o=J(o,[["enter",c,t]]),o=J(o,be(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=J(o,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),o=J(o,e.slice(l+1)),o=J(o,[["exit",a,t]]),K(e,i,e.length,o),e}function lc(e,t,n){let r=this,i=r._labelStarts,l,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return a;function a(m){return l?l._inactive?f(m):(o=r.parser.defined.includes(ne(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(tc,s,o?s:f)(m):m===91?e.attempt(nc,s,o?c:f)(m):o?s(m):f(m)}function c(m){return e.attempt(rc,s,f)(m)}function s(m){return i.pop(),t(m)}function f(m){return l._balanced=!0,n(m)}}function ac(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return B(f)?Ge(e,l)(f):l(f)}function l(f){return f===41?s(f):ln(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return B(f)?Ge(e,u)(f):s(f)}function a(f){return n(f)}function u(f){return f===34||f===39||f===40?un(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):s(f)}function c(f){return B(f)?Ge(e,s)(f):s(f)}function s(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function uc(e,t,n){let r=this;return i;function i(a){return an.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(ne(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function sc(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}var sr={name:"labelStartImage",resolveAll:Qe.resolveAll,tokenize:cc};function cc(e,t,n){let r=this,i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}var cr={name:"labelStartLink",resolveAll:Qe.resolveAll,tokenize:fc};function fc(e,t,n){let r=this,i;return l;function l(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),i=e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(a))}}var zt={name:"lineEnding",tokenize:pc};function pc(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),F(e,t,"linePrefix")}}var $e={name:"thematicBreak",tokenize:mc};function mc(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||A(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),v(c)?F(e,a,"whitespace")(c):a(c))}}var re={continuation:{tokenize:xc},exit:yc,name:"list",tokenize:gc},hc={partial:!0,tokenize:wc},dc={partial:!0,tokenize:kc};function gc(e,t,n){let r=this,i=r.events[r.events.length-1],l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){let h=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:At(p)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check($e,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return At(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Se,r.interrupt?n:s,e.attempt(hc,m,f))}function s(p){return r.containerState.initialBlankLine=!0,l++,m(p)}function f(p){return v(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function xc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Se,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,F(e,t,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!v(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dc,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,F(e,e.attempt(re,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function kc(e,t,n){let r=this;return F(e,i,"listItemIndent",r.containerState.size+1);function i(l){let o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function yc(e){e.exit(this.containerState.type)}function wc(e,t,n){let r=this;return F(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){let o=r.events[r.events.length-1];return!v(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}var cn={name:"setextUnderline",resolveTo:bc,tokenize:Sc};function bc(e,t){let n=new ze,r=e.length,i,l,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!o&&e[r][1].type==="definition"&&(o=r);let a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(n.add(l,0,[["enter",a,t]]),n.add(o+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=a,n.add(e.length,0,[["exit",a,t]]),n.consume(e),e}function Sc(e,t,n){let r=this,i;return l;function l(c){let s=r.events.length,f;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){f=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),v(c)?F(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||A(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}var ho={tokenize:Cc};function Cc(e){let t=this,n=e.attempt(Se,r,e.attempt(this.parser.constructs.flowInitial,i,F(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rr,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var go={resolveAll:wo()},xo=yo("string"),ko=yo("text");function yo(e){return{resolveAll:wo(e==="text"?Ec:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],l=n.attempt(i,o,a);return o;function o(s){return c(s)?l(s):a(s)}function a(s){if(s===null){n.consume(s);return}return n.enter("data"),n.consume(s),u}function u(s){return c(s)?(n.exit("data"),l(s)):(n.consume(s),u)}function c(s){if(s===null)return!0;let f=i[s],m=-1;if(f)for(;++m<f.length;){let p=f[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function wo(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function Ec(e,t){let n=new ze,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let i=e[r-1][1],l=t.sliceStream(i),o=l.length,a=-1,u=0,c;for(;o--;){let s=l[o];if(typeof s=="string"){for(a=s.length;s.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(s===-2)c=!0,u++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){let s={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:i.start._bufferIndex+a,_index:i.start._index+o,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...s.start},i.start.offset===i.end.offset?Object.assign(i,s):n.add(r,0,[["enter",s,t],["exit",s,t]])}r++}return n.consume(e),e}var fr={};On(fr,{attentionMarkers:()=>Mc,contentInitial:()=>Tc,disable:()=>zc,document:()=>Ic,flow:()=>Pc,flowInitial:()=>Ac,insideSpan:()=>Fc,string:()=>Lc,text:()=>vc});var Ic={42:re,43:re,45:re,48:re,49:re,50:re,51:re,52:re,53:re,54:re,55:re,56:re,57:re,62:Zt},Tc={91:ir},Ac={[-2]:vt,[-1]:vt,32:vt},Pc={35:lr,42:$e,45:[cn,$e],60:ar,61:cn,95:$e,96:nn,126:nn},Lc={38:tn,92:en},vc={[-5]:zt,[-4]:zt,[-3]:zt,33:sr,38:tn,42:Pt,60:[tr,ur],91:cr,92:[or,en],93:Qe,95:Pt,96:nr},Fc={null:[Pt,go]},Mc={null:[42,95]},zc={null:[]};function bo(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},l=[],o=[],a=[],u=!0,c={attempt:G(R),check:G(j),consume:P,enter:z,exit:b,interrupt:G(j,{interrupt:!0})},s={code:null,containerState:{},defineSkip:k,events:[],now:S,parser:e,previous:null,sliceSerialize:h,sliceStream:x,write:p},f=t.tokenize.call(s,c),m;return t.resolveAll&&l.push(t),s;function p(L){return o=J(o,L),E(),o[o.length-1]!==null?[]:(y(t,0),s.events=be(l,s.events,s),s.events)}function h(L,N){return Rc(x(L),N)}function x(L){return Dc(o,L)}function S(){let{_bufferIndex:L,_index:N,line:_,column:Q,offset:Z}=r;return{_bufferIndex:L,_index:N,line:_,column:Q,offset:Z}}function k(L){i[L.line]=L.column,q()}function E(){for(;r._index<o.length;){let L=o[r._index];if(typeof L=="string"){let N=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<L.length;)C(L.charCodeAt(r._bufferIndex))}else C(L)}}function C(L){u=void 0,m=L,f=f(L)}function P(L){A(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,q()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=L,u=!0}function z(L,N){let _=N||{};return _.type=L,_.start=S(),s.events.push(["enter",_,s]),a.push(_),_}function b(L){let N=a.pop();return N.end=S(),s.events.push(["exit",N,s]),N}function R(L,N){y(L,N.from)}function j(L,N){N.restore()}function G(L,N){return _;function _(Q,Z,de){let ke,d,fe,Te;return Array.isArray(Q)?se(Q):"tokenize"in Q?se([Q]):g(Q);function g(te){return kt;function kt(Ae){let it=Ae!==null&&te[Ae],Ue=Ae!==null&&te.null,Dn=[...Array.isArray(it)?it:it?[it]:[],...Array.isArray(Ue)?Ue:Ue?[Ue]:[]];return se(Dn)(Ae)}}function se(te){return ke=te,d=0,te.length===0?de:rt(te[d])}function rt(te){return kt;function kt(Ae){return Te=H(),fe=te,te.partial||(s.currentConstruct=te),te.name&&s.parser.constructs.disable.null.includes(te.name)?Ut(Ae):te.tokenize.call(N?Object.assign(Object.create(s),N):s,c,Ht,Ut)(Ae)}}function Ht(te){return u=!0,L(fe,Te),Z}function Ut(te){return u=!0,Te.restore(),++d<ke.length?rt(ke[d]):de}}}function y(L,N){L.resolveAll&&!l.includes(L)&&l.push(L),L.resolve&&K(s.events,N,s.events.length-N,L.resolve(s.events.slice(N),s)),L.resolveTo&&(s.events=L.resolveTo(s.events,s))}function H(){let L=S(),N=s.previous,_=s.currentConstruct,Q=s.events.length,Z=Array.from(a);return{from:Q,restore:de};function de(){r=L,s.previous=N,s.currentConstruct=_,s.events.length=Q,a=Z,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dc(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,l)];else{if(o=e.slice(n,i),r>-1){let a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Rc(e,t){let n=-1,r=[],i;for(;++n<e.length;){let l=e[n],o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
959
|
+
`;break}case-3:{o=`\r
|
|
960
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function pr(e){let r={constructs:Yt([fr,...(e||{}).extensions||[]]),content:i(so),defined:[],document:i(po),flow:i(ho),lazy:{},string:i(xo),text:i(ko)};return r;function i(l){return o;function o(a){return bo(r,l,a)}}}function mr(e){for(;!on(e););return e}var So=/[\0\t\n\r]/g;function hr(){let e=1,t="",n=!0,r;return i;function i(l,o,a){l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l));let u=[],c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){So.lastIndex=c;let s=So.exec(l),f=s&&s.index!==void 0?s.index:l.length,m=l.charCodeAt(f);if(!s){t=l.slice(c);break}if(m===10&&c===f&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<f&&(u.push(l.slice(c,f)),e+=f-c),m){case 0:{u.push(65533),e++;break}case 9:{let p=Math.ceil(e/4)*4;for(u.push(-2);e++<p;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=f+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var Oc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Co(e){return e.replace(Oc,Bc)}function Bc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),l=i===120||i===88;return Jt(n.slice(l?2:1),l?16:10)}return at(n)||e}var Io={}.hasOwnProperty;function dr(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_c(n)(mr(pr(n).document().write(hr()(e,t,!0))))}function _c(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(vi),autolinkProtocol:y,autolinkEmail:y,atxHeading:o(Ai),blockQuote:o(it),characterEscape:y,characterReference:y,codeFenced:o(Ue),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Ue,a),codeText:o(Dn,a),codeTextData:y,data:y,codeFlowValue:y,definition:o(du),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(gu),hardBreakEscape:o(Pi),hardBreakTrailing:o(Pi),htmlFlow:o(Li,a),htmlFlowData:y,htmlText:o(Li,a),htmlTextData:y,image:o(xu),label:a,link:o(vi),listItem:o(ku),listItemValue:p,listOrdered:o(Fi,m),listUnordered:o(Fi),paragraph:o(yu),reference:se,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ai),strong:o(wu),thematicBreak:o(Su)},exit:{atxHeading:c(),atxHeadingSequence:b,autolink:c(),autolinkEmail:Ae,autolinkProtocol:kt,blockQuote:c(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Ht,characterReferenceMarkerNumeric:Ht,characterReferenceValue:Ut,characterReference:te,codeFenced:c(k),codeFencedFence:S,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:H,codeIndented:c(E),codeText:c(Q),codeTextData:H,data:H,definition:c(),definitionDestinationString:z,definitionLabelString:C,definitionTitleString:P,emphasis:c(),hardBreakEscape:c(L),hardBreakTrailing:c(L),htmlFlow:c(N),htmlFlowData:H,htmlText:c(_),htmlTextData:H,image:c(de),label:d,labelText:ke,lineEnding:q,link:c(Z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:rt,resourceDestinationString:fe,resourceTitleString:Te,resource:g,setextHeading:c(G),setextHeadingLineSequence:j,setextHeadingText:R,strong:c(),thematicBreak:c()}};To(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(w){let T={type:"root",children:[],position:void 0},D={stack:[T],tokenStack:[],config:t,enter:u,exit:s,buffer:a,resume:f,data:n},O=[],ie=[],V=-1;for(;++V<w.length;)if(ie.push(w[V]),w[V][1].type==="listOrdered"||w[V][1].type==="listUnordered")if(w[V][0]==="enter")O.push(ie.length-1);else{let oe=O.pop();l(ie,oe)}for(w=ie,V=-1;++V<w.length;){let oe=t[w[V][0]];w[V][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...D,sliceSerialize:w[V][2].sliceSerialize},w[V][1]),Io.call(oe,w[V][1].type)&&oe[w[V][1].type].call({...D,sliceSerialize:w[V][2].sliceSerialize},w[V][1]),w[V][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...D,sliceSerialize:w[V][2].sliceSerialize},w[V][1])}if(D.tokenStack.length>0){let oe=D.tokenStack[D.tokenStack.length-1];(oe[1]||Eo).call(D,void 0,oe[0])}for(T.position={start:Ne(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:Ne(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)T=t.transforms[V](T)||T;return T}function i(w,T,D){let O=-1;for(;++O<w.length;)w[O].call(T,D)}function l(w,T){let D=w.length-1,O=T-1,ie=-1,V=!1,oe,ye,yt,wt,bt=[];for(;++O<=D;){let ce=w[O];switch(ce[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ce[0]==="enter"?ie++:ie--,wt=void 0;break}case"lineEndingBlank":{ce[0]==="enter"&&(oe&&!wt&&!ie&&!yt&&(yt=O),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!ie&&ce[0]==="enter"&&ce[1].type==="listItemPrefix"||ie===-1&&ce[0]==="exit"&&(ce[1].type==="listUnordered"||ce[1].type==="listOrdered")){if(oe){let ot=O;for(ye=void 0;ot--;){let Pe=w[ot];if(Pe[1].type==="lineEnding"||Pe[1].type==="lineEndingBlank"){if(Pe[0]==="exit")continue;ye&&(w[ye][1].type="lineEndingBlank",V=!0),Pe[1].type="lineEnding",ye=ot}else if(!(Pe[1].type==="linePrefix"||Pe[1].type==="blockQuotePrefix"||Pe[1].type==="blockQuotePrefixWhitespace"||Pe[1].type==="blockQuoteMarker"||Pe[1].type==="listItemIndent"))break}yt&&(!ye||yt<ye)&&(oe._spread=!0),oe.end=Object.assign({},ye?w[ye][1].start:ce[1].end),bt.push({at:ye||O,event:["exit",oe,ce[2]]})}if(ce[1].type==="listItemPrefix"){let ot={type:"listItem",_spread:!1,start:Object.assign({},ce[1].start),end:void 0};oe=ot,bt.push({at:O,event:["enter",ot,ce[2]]}),yt=void 0,wt=!0}}}let Mi=w.splice(T),Rn=0;for(O=-1;++O<Mi.length;){for(;Rn<bt.length&&bt[Rn].at===T+O;)w.push(bt[Rn++].event);w.push(Mi[O])}w[T][1]._spread=V}function o(w,T){return D;function D(O){u.call(this,w(O),O),T&&T.call(this,O)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(w,T,D){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([T,D||void 0]),w.position={start:Ne(T.start),end:void 0}}function c(w){return T;function T(D){w&&w.call(this,D),s.call(this,D)}}function s(w,T){let D=this.stack.pop(),O=this.tokenStack.pop();if(!O)throw new Error("Cannot close `"+w.type+"` ("+Oe({start:w.start,end:w.end})+"): it\u2019s not open");O[0].type!==w.type&&(T?T.call(this,w,O[0]):(O[1]||Eo).call(this,w,O[0])),D.position.end=Ne(w.end)}function f(){return Me(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){let T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){let w=this.resume(),T=this.stack[this.stack.length-1];T.lang=w}function x(){let w=this.resume(),T=this.stack[this.stack.length-1];T.meta=w}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){let w=this.resume(),T=this.stack[this.stack.length-1];T.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){let w=this.resume(),T=this.stack[this.stack.length-1];T.value=w.replace(/(\r?\n|\r)$/g,"")}function C(w){let T=this.resume(),D=this.stack[this.stack.length-1];D.label=T,D.identifier=ne(this.sliceSerialize(w)).toLowerCase()}function P(){let w=this.resume(),T=this.stack[this.stack.length-1];T.title=w}function z(){let w=this.resume(),T=this.stack[this.stack.length-1];T.url=w}function b(w){let T=this.stack[this.stack.length-1];if(!T.depth){let D=this.sliceSerialize(w).length;T.depth=D}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function j(w){let T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function y(w){let D=this.stack[this.stack.length-1].children,O=D[D.length-1];(!O||O.type!=="text")&&(O=bu(),O.position={start:Ne(w.start),end:void 0},D.push(O)),this.stack.push(O)}function H(w){let T=this.stack.pop();T.value+=this.sliceSerialize(w),T.position.end=Ne(w.end)}function q(w){let T=this.stack[this.stack.length-1];if(this.data.atHardBreak){let D=T.children[T.children.length-1];D.position.end=Ne(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(T.type)&&(y.call(this,w),H.call(this,w))}function L(){this.data.atHardBreak=!0}function N(){let w=this.resume(),T=this.stack[this.stack.length-1];T.value=w}function _(){let w=this.resume(),T=this.stack[this.stack.length-1];T.value=w}function Q(){let w=this.resume(),T=this.stack[this.stack.length-1];T.value=w}function Z(){let w=this.stack[this.stack.length-1];if(this.data.inReference){let T=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=T,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function de(){let w=this.stack[this.stack.length-1];if(this.data.inReference){let T=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=T,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function ke(w){let T=this.sliceSerialize(w),D=this.stack[this.stack.length-2];D.label=Co(T),D.identifier=ne(T).toLowerCase()}function d(){let w=this.stack[this.stack.length-1],T=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){let O=w.children;D.children=O}else D.alt=T}function fe(){let w=this.resume(),T=this.stack[this.stack.length-1];T.url=w}function Te(){let w=this.resume(),T=this.stack[this.stack.length-1];T.title=w}function g(){this.data.inReference=void 0}function se(){this.data.referenceType="collapsed"}function rt(w){let T=this.resume(),D=this.stack[this.stack.length-1];D.label=T,D.identifier=ne(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ht(w){this.data.characterReferenceType=w.type}function Ut(w){let T=this.sliceSerialize(w),D=this.data.characterReferenceType,O;D?(O=Jt(T,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):O=at(T);let ie=this.stack[this.stack.length-1];ie.value+=O}function te(w){let T=this.stack.pop();T.position.end=Ne(w.end)}function kt(w){H.call(this,w);let T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(w)}function Ae(w){H.call(this,w);let T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(w)}function it(){return{type:"blockquote",children:[],position:void 0}}function Ue(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Dn(){return{type:"inlineCode",value:"",position:void 0}}function du(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function gu(){return{type:"emphasis",children:[],position:void 0}}function Ai(){return{type:"heading",depth:0,children:[],position:void 0}}function Pi(){return{type:"break",position:void 0}}function Li(){return{type:"html",value:"",position:void 0}}function xu(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function vi(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Fi(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[],position:void 0}}function ku(w){return{type:"listItem",spread:w._spread,checked:null,children:[],position:void 0}}function yu(){return{type:"paragraph",children:[],position:void 0}}function wu(){return{type:"strong",children:[],position:void 0}}function bu(){return{type:"text",value:"",position:void 0}}function Su(){return{type:"thematicBreak",position:void 0}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function To(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?To(e,r):Nc(e,r)}}function Nc(e,t){let n;for(n in t)if(Io.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{let r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function Eo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Oe({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Oe({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Oe({start:t.start,end:t.end})+") is still open")}function fn(e){let t=this;t.parser=n;function n(r){return dr(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ao(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Po(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
961
|
+
`}]}function Lo(e,t){let n=t.value?t.value+`
|
|
962
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function vo(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fo(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mo(e,t){let n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=me(r.toLowerCase()),l=e.footnoteOrder.indexOf(r),o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);let u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);let c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function zo(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Do(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pn(e,t){let n=t.referenceType,r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});let o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Ro(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pn(e,t);let i={src:me(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function Oo(e,t){let n={src:me(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Bo(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _o(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pn(e,t);let i={href:me(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);let l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function No(e,t){let n={href:me(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jo(e,t,n){let r=e.all(t),i=n?jc(n):Ho(t),l={},o=[];if(typeof t.checked=="boolean"){let s=r[0],f;s&&s.type==="element"&&s.tagName==="p"?f=s:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){let s=r[a];(i||a!==0||s.type!=="element"||s.tagName!=="p")&&o.push({type:"text",value:`
|
|
963
|
+
`}),s.type==="element"&&s.tagName==="p"&&!i?o.push(...s.children):o.push(s)}let u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
964
|
+
`});let c={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,c),e.applyData(t,c)}function jc(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Ho(n[r])}return t}function Ho(e){let t=e.spread;return t??e.children.length>1}function Uo(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){let o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function qo(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vo(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Wo(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Go(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){let o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=lt(t.children[1]),u=Xt(t.children[t.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}let l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function Qo(e,t,n){let r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length,u=-1,c=[];for(;++u<a;){let f=t.children[u],m={},p=o?o[u]:void 0;p&&(m.align=p);let h={type:"element",tagName:l,properties:m,children:[]};f&&(h.children=e.all(f),e.patch(f,h),h=e.applyData(f,h)),c.push(h)}let s={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,s),e.applyData(t,s)}function $o(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yo(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,l=[];for(;r;)l.push(Xo(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(Xo(t.slice(i),i>0,!1)),l.join("")}function Xo(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===9||l===32;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===9||l===32;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Jo(e,t){let n={type:"text",value:Yo(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ko(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Zo={blockquote:Ao,break:Po,code:Lo,delete:vo,emphasis:Fo,footnoteReference:Mo,heading:zo,html:Do,imageReference:Ro,image:Oo,inlineCode:Bo,linkReference:_o,link:No,listItem:jo,list:Uo,paragraph:qo,root:Vo,strong:Wo,table:Go,tableCell:$o,tableRow:Qo,text:Jo,thematicBreak:Ko,toml:mn,yaml:mn,definition:mn,footnoteDefinition:mn};function mn(){}var{defineProperty:Vc}=Object,ol=typeof self=="object"?self:globalThis,el=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new ol[e](t)},Wc=(e,t)=>{let n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);let[l,o]=t[i];switch(l){case 0:case-1:return n(o,i);case 1:{let a=n([],i);for(let u of o)a.push(r(u));return a}case 2:{let a=n({},i);for(let[u,c]of o){let s=r(u),f=r(c);s==="__proto__"?Vc(a,s,{value:f,configurable:!0,enumerable:!0,writable:!0}):a[s]=f}return a}case 3:return n(new Date(o),i);case 4:{let{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case 5:{let a=n(new Map,i);for(let[u,c]of o)a.set(r(u),r(c));return a}case 6:{let a=n(new Set,i);for(let u of o)a.add(r(u));return a}case 7:{let{name:a,message:u}=o;return n(typeof ol[a]=="function"?el(a,u):new Error(u),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}case"-0":return-0}return n(el(l,o),i)};return r},kr=e=>Wc(new Map,e)(0);var Xe="",{toString:Gc}={},{keys:Qc,is:$c}=Object,Dt=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let n=Gc.call(e).slice(8,-1);switch(n){case"Array":return[1,Xe];case"Object":return[2,Xe];case"Date":return[3,Xe];case"RegExp":return[4,Xe];case"Map":return[5,Xe];case"Set":return[6,Xe];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:e instanceof Error?[7,e.name||"Error"]:[2,n]},dn=([e,t])=>e===0&&(t==="function"||t==="symbol"),Xc=(e,t,n,r)=>{let i=(o,a)=>{let u=r.push(o)-1;return n.set(a,u),u},l=o=>{if(n.has(o))return n.get(o);let[a,u]=Dt(o);switch(a){case 0:{let s=o;switch(u){case"bigint":a=8,s=o.toString();break;case"number":if(!o&&$c(o,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);s=null;break;case"undefined":return i([-1],o)}return i([a,s],o)}case 1:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),i([u,[...m]],o)}let s=[],f=i([a,s],o);for(let m of o)s.push(l(m));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());let s=[],f=i([a,s],o);for(let m of Qc(o))(e||!dn(Dt(o[m])))&&s.push([l(m),l(o[m])]);return f}case 3:return i([a,isNaN(o.getTime())?Xe:o.toISOString()],o);case 4:{let{source:s,flags:f}=o;return i([a,{source:s,flags:f}],o)}case 5:{let s=[],f=i([a,s],o);for(let[m,p]of o)(e||!(dn(Dt(m))||dn(Dt(p))))&&s.push([l(m),l(p)]);return f}case 6:{let s=[],f=i([a,s],o);for(let m of o)(e||!dn(Dt(m)))&&s.push(l(m));return f}}let{message:c}=o;return i([a,{name:u,message:c}],o)};return l},yr=(e,{json:t,lossy:n}={})=>{let r=[];return Xc(!(t||n),!!t,new Map,r)(e),r};var ut=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?kr(yr(e,t)):structuredClone(e):(e,t)=>kr(yr(e,t));function Yc(e,t){let n=[{type:"text",value:"\u21A9"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Jc(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ll(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Yc,r=e.options.footnoteBackLabel||Jc,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],u=-1;for(;++u<e.footnoteOrder.length;){let c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;let s=e.all(c),f=String(c.identifier).toUpperCase(),m=me(f.toLowerCase()),p=0,h=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++p<=x;){h.length>0&&h.push({type:"text",value:" "});let E=typeof n=="string"?n:n(u,p);typeof E=="string"&&(E={type:"text",value:E}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}let S=s[s.length-1];if(S&&S.type==="element"&&S.tagName==="p"){let E=S.children[S.children.length-1];E&&E.type==="text"?E.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...h)}else s.push(...h);let k={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(s,!0)};e.patch(c,k),a.push(k)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ut(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
965
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
966
|
+
`}]}}var je=(function(e){if(e==null)return tf;if(typeof e=="function")return gn(e);if(typeof e=="object")return Array.isArray(e)?Kc(e):Zc(e);if(typeof e=="string")return ef(e);throw new Error("Expected function, string, or object as test")});function Kc(e){let t=[],n=-1;for(;++n<e.length;)t[n]=je(e[n]);return gn(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function Zc(e){let t=e;return gn(n);function n(r){let i=r,l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function ef(e){return gn(t);function t(n){return n&&n.type===e}}function gn(e){return t;function t(n,r,i){return!!(nf(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function tf(){return!0}function nf(e){return e!==null&&typeof e=="object"&&"type"in e}var ul=[],xn=!0,Ce=!1,Ye="skip";function st(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,l,o,a,u;if(typeof n=="function"||n&&typeof n=="object"?(l=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o=="function")a=o;else if(o&&typeof o=="object"){if(!(o.enter===null||o.enter===void 0))if(typeof o.enter=="function")a=o.enter;else throw new Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor");if(typeof o.exit=="function")u=o.exit;else throw new Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let c=je(l),s=i?1:-1;f(e,void 0,[])();function f(m,p,h){let x=m&&typeof m=="object"?m:{};if(typeof x.type=="string"){let k=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(m.type+(k?"<"+k+">":""))+")"})}return S;function S(){let k=!l||c(m,p,h[h.length-1]||void 0),E=ul;if(a&&k&&(E=al(a(m,h,p)),E[0]===Ce))return E;if("children"in m&&m.children){let C=m;if(C.children&&E[0]!==Ye){let P=(i?-1:C.children.length)+s,z=[...h,C];for(;P>-1&&P<C.children.length;){let b=C.children[P],R=f(b,P,z)();if(R[0]===Ce)return R;P=typeof R[1]=="number"?R[1]:P+s}}}if(u&&k){let C=al(u(m,h,p));if(C[0]===Ye)throw new Error("Unexpected value `"+C[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(C[0]===Ce||typeof C[1]=="number")return C}return E}}}function al(e){return Array.isArray(e)?e:typeof e=="number"?[xn,e]:e==null?ul:[e]}function De(e,t,n,r){let i,l,o;typeof n=="function"||n&&typeof n=="object"?(i=t,l=n,o=r):(l=t,o=n),typeof l=="function"?st(e,i,wr(l),o):st(e,i,rf(l),o)}function rf(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?wr(e.enter):e.enter,exit:typeof e.exit=="function"?wr(e.exit):e.exit}}function wr(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}var br={}.hasOwnProperty,of={};function cl(e,t){let n=t||of,r=new Map,i=new Map,l=new Map,o={...Zo,...n.handlers},a={all:c,applyData:af,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:u,options:n,patch:lf,wrap:sf};return De(e,function(s){if(s.type==="definition"||s.type==="footnoteDefinition"){let f=s.type==="definition"?r:i,m=String(s.identifier).toUpperCase();f.has(m)||f.set(m,s)}}),a;function u(s,f){let m=s.type,p=a.handlers[m];if(br.call(a.handlers,m)&&p)return p(a,s,f);if(a.options.passThrough&&a.options.passThrough.includes(m)){if("children"in s){let{children:x,...S}=s,k=ut(S);return k.children=a.all(s),k}return ut(s)}return(a.options.unknownHandler||uf)(a,s,f)}function c(s){let f=[];if("children"in s){let m=s.children,p=-1;for(;++p<m.length;){let h=a.one(m[p],s);if(h){if(p&&m[p-1].type==="break"&&(!Array.isArray(h)&&h.type==="text"&&(h.value=sl(h.value)),!Array.isArray(h)&&h.type==="element")){let x=h.children[0];x&&x.type==="text"&&(x.value=sl(x.value))}Array.isArray(h)?f.push(...h):f.push(h)}}}return f}}function lf(e,t){e.position&&(t.position=Gn(e))}function af(e,t){let n=t;if(e&&e.data){let r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{let o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,ut(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function uf(e,t){let n=t.data||{},r="value"in t&&!(br.call(n,"hProperties")||br.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sf(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:`
|
|
967
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
968
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
969
|
+
`}),n}function sl(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kn(e,t){let n=cl(e,t),r=n.one(e,void 0),i=ll(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&("children"in l,l.children.push({type:"text",value:`
|
|
970
|
+
`},i)),l}function yn(e,t){return e&&"run"in e?async function(n,r){let i=kn(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kn(n,{file:r,...e||t})}}function Sr(e){if(e)throw e}var Sn=Di(yl(),1);function Rt(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Cr(){let e=[],t={run:n,use:r};return t;function n(...i){let l=-1,o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(u,...c){let s=e[++l],f=-1;if(u){o(u);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,s?wl(s,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function wl(e,t){let n;return r;function r(...o){let a=e.length>o.length,u;a&&o.push(i);try{u=e.apply(this,o)}catch(c){let s=c;if(a&&n)throw s;return i(s)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){n||(n=!0,t(o,...a))}function l(o){i(null,o)}}var ge={basename:cf,dirname:ff,extname:pf,join:mf,sep:"/"};function cf(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ot(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ff(e){if(Ot(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pf(e){Ot(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){let a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function mf(...e){let t=-1,n;for(;++t<e.length;)Ot(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hf(n)}function hf(e){Ot(e);let t=e.codePointAt(0)===47,n=df(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function df(e,t){let n="",r=0,i=-1,l=0,o=-1,a,u;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return n}function Ot(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var bl={cwd:gf};function gf(){return"/"}function ct(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Sl(e){if(typeof e=="string")e=new URL(e);else if(!ct(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xf(e)}function xf(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let r=t.codePointAt(n+2);if(r===70||r===102){let i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}var Er=["history","path","basename","stem","extname","dirname"],Je=class{constructor(t){let n;t?ct(t)?n={path:t}:typeof t=="string"||kf(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":bl.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Er.length;){let l=Er[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Er.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ge.basename(this.path):void 0}set basename(t){Tr(t,"basename"),Ir(t,"basename"),this.path=ge.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ge.dirname(this.path):void 0}set dirname(t){Cl(this.basename,"dirname"),this.path=ge.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ge.extname(this.path):void 0}set extname(t){if(Ir(t,"extname"),Cl(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ge.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ct(t)&&(t=Sl(t)),Tr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ge.basename(this.path,this.extname):void 0}set stem(t){Tr(t,"stem"),Ir(t,"stem"),this.path=ge.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){let i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){let i=new Fe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Ir(e,t){if(e&&e.includes(ge.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ge.sep+"`")}function Tr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Cl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kf(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var El=(function(e){let r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l});var yf={}.hasOwnProperty,vr=class e extends El{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Cr()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,Sn.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lr("data",this.frozen),this.namespace[t]=n,this):yf.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=bn(t),r=this.parser||this.Parser;return Ar("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),Ar("process",this.parser||this.Parser),Pr("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){let a=bn(t),u=r.parse(a);r.run(u,a,function(s,f,m){if(s||!f||!m)return c(s);let p=f,h=r.stringify(p,m);bf(h)?m.value=h:m.result=h,c(s,m)});function c(s,f){s||!f?o(s):l?l(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ar("processSync",this.parser||this.Parser),Pr("processSync",this.compiler||this.Compiler),this.process(t,i),Tl("processSync","process",n),r;function i(l,o){n=!0,Sr(l),r=o}}run(t,n,r){Il(t),this.freeze();let i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,a){let u=bn(n);i.run(t,u,c);function c(s,f,m){let p=f||t;s?a(s):o?o(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),Tl("runSync","run",r),i;function l(o,a){Sr(o),i=a,r=!0}}stringify(t,n){this.freeze();let r=bn(n),i=this.compiler||this.Compiler;return Pr("stringify",i),Il(t),i(t,r)}use(t,...n){let r=this.attachers,i=this.namespace;if(Lr("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){let[s,...f]=c;u(s,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=(0,Sn.default)(!0,i.settings,c.settings))}function a(c){let s=-1;if(c!=null)if(Array.isArray(c))for(;++s<c.length;){let f=c[s];l(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,s){let f=-1,m=-1;for(;++f<r.length;)if(r[f][0]===c){m=f;break}if(m===-1)r.push([c,...s]);else if(s.length>0){let[p,...h]=s,x=r[m][1];Rt(x)&&Rt(p)&&(p=(0,Sn.default)(!0,x,p)),r[m]=[c,p,...h]}}}},Fr=new vr().freeze();function Ar(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Il(e){if(!Rt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bn(e){return wf(e)?e:new Je(e)}function wf(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bf(e){return typeof e=="string"||Sf(e)}function Sf(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Cf="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Al=[],Pl={allowDangerousHtml:!0},Ef=/^(https?|ircs?|mailto|xmpp)$/i,If=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Mr(e){let t=Tf(e),n=Af(e);return Pf(t.runSync(t.parse(n),n),e)}function Tf(e){let t=e.rehypePlugins||Al,n=e.remarkPlugins||Al,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Pl}:Pl;return Fr().use(fn).use(n).use(yn,r).use(t)}function Af(e){let t=e.children||"",n=new Je;return typeof t=="string"?n.value=t:(""+t,void 0),n}function Pf(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||vl;for(let s of If)Object.hasOwn(t,s.from)&&(""+s.from+(s.to?"use `"+s.to+"` instead":"remove it")+Cf+s.id,void 0);return n&&l&&void 0,De(e,c),Xn(e,{Fragment:to,components:i,ignoreInvalidStyle:!0,jsx:Zn,jsxs:no,passKeys:!0,passNode:!0});function c(s,f,m){if(s.type==="raw"&&m&&typeof f=="number")return o?m.children.splice(f,1):m.children[f]={type:"text",value:s.value},f;if(s.type==="element"){let p;for(p in Tt)if(Object.hasOwn(Tt,p)&&Object.hasOwn(s.properties,p)){let h=s.properties[p],x=Tt[p];(x===null||x.includes(s.tagName))&&(s.properties[p]=u(String(h||""),p,s))}}if(s.type==="element"){let p=n?!n.includes(s.tagName):l?l.includes(s.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(s,f,m)),p&&m&&typeof f=="number")return a&&s.children?m.children.splice(f,1,...s.children):m.children.splice(f,1),f}}}function vl(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ef.test(e.slice(0,t))?e:""}function zr(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Dr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Rr(e,t,n){let i=je((n||{}).ignore||[]),l=Lf(t),o=-1;for(;++o<l.length;)st(e,a);function a(c,s,f){if(c.type==="text"&&typeof f=="number")return u(c,s,f);if(i(c,f,s[s.length-1]))return Ye}function u(c,s,f){let m=s[s.length-1],p=l[o][0],h=l[o][1],x=0,S=!1,k=[];p.lastIndex=0;let E=p.exec(c.value);for(;E;){let P=E.index,z={index:E.index,input:E.input,stack:[...s,c]},b=h(...E,z);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1)p.lastIndex=P+1;else{if(x!==P&&C({type:"text",value:c.value.slice(x,P)}),Array.isArray(b))for(let R of b)C(R);else b&&C(b);x=P+E[0].length,S=!0}if(!p.global)break;E=p.exec(c.value)}return S?(x<c.value.length&&C({type:"text",value:c.value.slice(x)}),m.children.splice(f,1,...k)):k=[c],f+k.length;function C(P){let z=k[k.length-1];z&&z.type==="text"&&P.type==="text"?z.value+=P.value:k.push(P)}}}function Lf(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([vf(i[0]),Ff(i[1])])}return t}function vf(e){return typeof e=="string"?new RegExp(Dr(e),"g"):e}function Ff(e){return typeof e=="function"?e:function(){return e}}var Or="phrasing",Br=["autolink","link","image","label"];function Nr(){return{transforms:[Bf],enter:{literalAutolink:Mf,literalAutolinkEmail:_r,literalAutolinkHttp:_r,literalAutolinkWww:_r},exit:{literalAutolink:Of,literalAutolinkEmail:Rf,literalAutolinkHttp:zf,literalAutolinkWww:Df}}}function jr(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Or,notInConstruct:Br},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Or,notInConstruct:Br},{character:":",before:"[ps]",after:"\\/",inConstruct:Or,notInConstruct:Br}]}}function Mf(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function _r(e){this.config.enter.autolinkProtocol.call(this,e)}function zf(e){this.config.exit.autolinkProtocol.call(this,e)}function Df(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Rf(e){this.config.exit.autolinkEmail.call(this,e)}function Of(e){this.exit(e)}function Bf(e){Rr(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,_f],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,Hf],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,jf],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Nf]],{ignore:["link","linkReference"]})}function _f(e,t,n,r,i){if(!Vf(i))return!1;let l="";if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),Be(n.charCodeAt(0))||!Uf(n))return!1;let o=qf(n+r),a={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0],position:void 0}],position:void 0};return o[1]?[a,{type:"text",value:o[1],position:void 0}]:a}function Nf(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function jf(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function Hf(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;let l="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:l,children:[{type:"text",value:l,position:void 0}],position:void 0}}function Uf(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function qf(e){let t=e.length;for(;t>0;){let o=e.charCodeAt(t-1);if(o===33||o===34||o===38||o===39||o===41||o===44||o===46||o===58||o===59||o===60||o===62||o===63||o===93||o===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")"),i=zr(e,"("),l=zr(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Vf(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||we(t)||Be(t)}Fl.peek=Zf;function Wf(){this.buffer()}function Gf(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Qf(){this.buffer()}function $f(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Xf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ne(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Yf(e){this.exit(e)}function Jf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ne(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kf(e){this.exit(e)}function Zf(){return"["}function Fl(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),o=n.enter("footnoteReference"),a=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),a(),o(),l+=i.move("]"),l}function Hr(){return{enter:{gfmFootnoteCallString:Wf,gfmFootnoteCall:Gf,gfmFootnoteDefinitionLabelString:Qf,gfmFootnoteDefinition:$f},exit:{gfmFootnoteCallString:Xf,gfmFootnoteCall:Yf,gfmFootnoteDefinitionLabelString:Jf,gfmFootnoteDefinition:Kf}}}function Ur(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fl},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){let a=l.createTracker(o),u=a.move("[^"),c=l.enter("footnoteDefinition"),s=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),s(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
|
|
971
|
+
`:" ")+l.indentLines(l.containerFlow(r,a.current()),t?Ml:ep))),c(),u}}function ep(e,t,n){return t===0?e:Ml(e,t,n)}function Ml(e,t,n){return(n?"":" ")+e}var tp=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wr.attention=ip;Wr.peek=op;function qr(){return{canContainEols:["delete"],enter:{strikethrough:np},exit:{strikethrough:rp}}}function Vr(){return{handlers:{delete:Wr},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tp}]}}function np(e){this.enter({type:"delete",children:[],position:void 0},e)}function rp(e){this.exit(e)}function Wr(e,t,n,r){let i=n.createTracker(r),l=n.stack.includes("strikethrough")?"~":"~~",o=n.enter("strikethrough"),a=i.move(l);return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move(l),o(),a}function ip(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function op(){return"~"}function lp(e){return e.length}function Dl(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||lp,l=[],o=[],a=[],u=[],c=0,s=-1;for(;++s<e.length;){let x=[],S=[],k=-1;for(e[s].length>c&&(c=e[s].length);++k<e[s].length;){let E=ap(e[s][k]);if(n.alignDelimiters!==!1){let C=i(E);S[k]=C,(u[k]===void 0||C>u[k])&&(u[k]=C)}x.push(E)}o[s]=x,a[s]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)l[f]=zl(r[f]);else{let x=zl(r);for(;++f<c;)l[f]=x}f=-1;let m=[],p=[];for(;++f<c;){let x=l[f],S="",k="";x===99?(S=":",k=":"):x===108?S=":":x===114&&(k=":");let E=n.alignDelimiters===!1?1:Math.max(1,u[f]-S.length-k.length),C=S+"-".repeat(E)+k;n.alignDelimiters!==!1&&(E=S.length+E+k.length,E>u[f]&&(u[f]=E),p[f]=E),m[f]=C}o.splice(1,0,m),a.splice(1,0,p),s=-1;let h=[];for(;++s<o.length;){let x=o[s],S=a[s],k=n.fillRows===!1?Math.max(1,o[s===1?0:s].length):c;f=-1;let E=[];for(;++f<k;){let C=x[f]||"",P="",z="";if(n.alignDelimiters!==!1){let b=u[f]-(S[f]||0),R=l[f];if(R===114)P=" ".repeat(b);else if(R===99){let j=b/2;b%2?(P=" ".repeat(j+.5),z=" ".repeat(j-.5)):(P=" ".repeat(j),z=P)}else z=" ".repeat(b)}n.delimiterStart!==!1&&!f&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||f)&&E.push(" "),n.alignDelimiters!==!1&&E.push(P),E.push(C),n.alignDelimiters!==!1&&E.push(z),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||f!==k-1)&&E.push("|")}h.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return h.join(`
|
|
972
|
+
`)}function ap(e){return e==null?"":String(e)}function zl(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var Gr=je(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Rl(e,t,n,r){let i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);let o=n.indentLines(n.containerFlow(e,l.current()),up);return i(),o}function up(e,t,n){return">"+(n?"":" ")+e}function Bl(e,t){return Ol(e,t.inConstruct,!0)&&!Ol(e,t.notInConstruct,!1)}function Ol(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qr(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let l=n.unsafe[i];if(l.character===`
|
|
973
|
+
`&&!l.before&&!l.after&&Bl(n.stack,l))return/[\t ]/.test(r.before)?"":" "}return`\\
|
|
974
|
+
`}function _l(e,t){let n=String(e),r=n.indexOf(t),i=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+t.length,r=n.indexOf(t,i);return o}function Nl(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function jl(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Hl(e,t,n,r){let i=jl(n),l=e.value||"";if(Nl(e,n)){let f=n.enter("codeIndented"),m=n.indentLines(l,sp);return f(),m}let o=n.createTracker(r),a=i.repeat(Math.max(_l(l,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde",s=o.move(a);if(e.lang){let f=n.enter(`codeFencedLang${c}`);s+=o.move(n.safe(e.lang,{before:s,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${c}`);s+=o.move(" "),s+=o.move(n.safe(e.meta,{before:s,after:`
|
|
975
|
+
`,encode:["`"],...o.current()})),f()}return s+=o.move(`
|
|
976
|
+
`),l&&(s+=o.move(l+`
|
|
977
|
+
`)),s+=o.move(a),u(),s}function sp(e,t,n){return(n?"":" ")+e}function ft(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ul(e,t,n,r){let i=ft(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition"),a=n.enter("label"),u=n.createTracker(r),c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
978
|
+
`,...u.current()}))),a(),e.title&&(a=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),o(),c}function ql(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Bt(e){let t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Ke(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Cn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $r(e,t,n){let r=he(e),i=he(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Vl(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let a=e.charCodeAt(2);return a===45?2:a===91?5:X(a)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,l=e.charCodeAt(i);if(!X(l))return;for(;l===45||W(l);)l=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&l!==47&&Mt.includes(o)?1:sn.includes(o)?6:7}var Gl=new Map([["*",!1],["_",!0]]);function cp(e,t,n){let r=new Set;for(let l of e){let o=n.get(l);if(o&&l.attention&&t.some(a=>a.attention===l.attention))for(let a of o.tokens)r.add(a.attention)}let i=[];for(let l of e)l.attention&&r.delete(l.attention)&&i.push(l.attention);return i.reverse(),i}function Ql(e,t,n){let r=[],i=new Map,l=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let a=e[o].value.charAt(0),u=Gl.get(a),c=o+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===a;)c++;let s=o?e[o-1].value:t,f=he(s.charCodeAt(s.length-1)),m=he((c<e.length?e[c].value:n).charCodeAt(0)),p=!m||m===2&&!!f,h=!f||f===2&&!!m,x={tokens:e.slice(o,c),markers:[],start:0,end:0,open:u?p&&(!!f||!h):p,close:u?h&&(!!m||!p):h,split:u!==void 0};for(let S of x.tokens){i.set(S,[...x.tokens]),l.set(S,x);let k=S.value.length;for(;k--;)x.markers.push(S)}x.end=x.markers.length,r.push(x),o=c}for(pp(r,i),o=-1;++o<e.length;){let a=i.get(e[o]);if(a)return{attention:cp(e,a,l),index:o}}}function En(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?Bt(n.value):Ke(n.value),i=Cn(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let l=n.value.slice(0,n.value.length-r.length),o=0;for(;l.charCodeAt(l.length-1-o)===92;)o++;o%2&&(l+="\\"),n.value=l+i}}function fp(e,t,n,r,i){for(let l of n.attention){let o=t.get(l)||l.sequences[0];for(let a of l.sequences){if(a===o)continue;let u=new Map(t);u.set(l,a);let c=In(e,u,r,i),s=Ql(c,r,i);if(!s||s.index>n.index)return{chosen:u,mistake:s,tokens:c}}}}function pp(e,t){let n=new Map;for(let r of e){let i=r.tokens[0].value.charAt(0),l=n.get(i);l||(l=[],n.set(i,l));let o=r.close?l.length:0;for(;o--&&r.start<r.end;){let a=l[o],u=a.end-a.start,c=r.end-r.start;if(r.split?(a.close||r.open)&&c%3&&!((u+c)%3):u!==a.markers.length||u!==c)continue;let s=r.split?u>1&&c>1?2:1:c,f=a.markers.slice(a.end-s,a.end),m=r.markers.slice(r.start,r.start+s),p=f[0],h=m[0];if(p===f[s-1]&&p.value.length===s&&h===m[s-1]&&h.value.length===s&&p.attention===h.attention)t.delete(p),t.delete(h);else{let x=[...new Set([...f,...m])];for(let S of x){let k=t.get(S);k&&k.push(...x)}}a.end-=s,r.start+=s,a.start===a.end&&l.splice(o,1),o=l.length}r.open&&r.start<r.end&&l.push(r)}}function mp(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!Kt(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let l of n)r.push(i.repeat(l))}return r}function hp(e,t,n){let r=t.indexStack,i=e.children||[],l=[],o=-1,a=n.before;r.push(-1);let u=t.createTracker(n);for(;++o<i.length;){let c=i[o],s;if(r[r.length-1]=o,o+1<i.length){let p=t.handle.handlers[i[o+1].type];p&&p.peek&&(p=p.peek),s=p?Bt(p(i[o+1],e,t,{before:"",after:"",...u.current()})):""}else s=n.after;let f=l[l.length-1];typeof f=="string"&&(a==="\r"||a===`
|
|
979
|
+
`)&&c.type==="html"&&Vl(c.value)!==7&&(l[l.length-1]=f.replace(/(\r?\n|\r)$/," "),a=" ",u=t.createTracker(n),u.move(pt(l,n.before,n.after)));let m=t.handle.handlers[c.type];if(m&&m.attention){let p=_t(c,m.attention,t,u);if(!p)continue;l.push(p),a=Ke(p.sequences[0])}else{let p=t.handle(c,e,t,{...u.current(),after:s,before:a});if(!p)continue;u.move(p),l.push(p),a=Ke(p)}}return r.pop(),l}function _t(e,t,n,r){let{construct:i,markers:l,sizes:o}=t(e,n),a=mp(e.type,l,o),u=a[0],c=n.enter(i),s=n.createTracker(r.current());s.move(u);let f=hp(e,n,{...s.current(),before:u,after:u});if(c(),f.length!==0)return r.move(u),r.move(pt(f,u,u)),r.move(u),{children:f,sequences:a}}function Wl(e,t,n,r){let i=In(e,t,n,r),l=Ql(i,n,r);for(;l;){let o=fp(e,t,l,n,r);if(!o)return;t=o.chosen,i=o.tokens,l=o.mistake}return i}function $l(e,t,n,r){let i=n,l=-1;for(;++l<e.length;){let o=e[l];if(typeof o=="string"){i="";continue}let a=l===e.length-1?r:"",u=o.sequences.find(function(c){let s=c.charAt(0);return s!==i.charAt(0)&&s!==a.charAt(0)||e.length===1&&Gl.has(s)&&c.length>n.length})||o.sequences[0];u!==o.sequences[0]&&t.set(o,u),$l(o.children,t,u,u),i=u}}function In(e,t,n,r){let i=[],l,o=Ke(n),a=-1;for(;++a<e.length;){let u=e[a];if(typeof u=="string"){let C={value:u,attention:void 0};l&&l===Bt(u)&&En([C],!0),l=void 0,i.push(C),C.value&&(o=Ke(C.value));continue}let c=t.get(u)||u.sequences[0],s=c.charAt(0),f=e[a+1],m=o,p=Bt(f===void 0?r:typeof f=="string"?f:t.get(f)||f.sequences[0]),h=In(u.children,t,c,c),x=h[0].value,S=$r(m.charCodeAt(m.length-1),x.charCodeAt(0),s);S.inside&&En(h,!0);let k=Ke(h[h.length-1].value),E=$r(p.charCodeAt(0),k.charCodeAt(k.length-1),s);E.inside&&En(h,!1),S.outside&&m!==`
|
|
980
|
+
`&&m!=="\r"&&En(i,!1),E.outside&&(l=p),i.push({value:c,attention:u},...h,{value:c,attention:u}),o=c.charAt(c.length-1)}return i}function pt(e,t,n){let r=new Map;$l(e,r,t,n);let i=(r.size>0?Wl(e,r,t,n):void 0)||Wl(e,new Map,t,n)||In(e,new Map,t,n),l="";for(let o of i)l+=o.value;return l}Tn.attention=Xl;Tn.peek=dp;function Tn(e,t,n,r){let i=n.enter("phrasing"),l=_t(e,Xl,n,n.createTracker(r)),o=l?pt([l],r.before,r.after):"";return i(),o}function Xl(e,t){return{construct:"emphasis",markers:ql(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function dp(e,t,n){return n.options.emphasis||"*"}function Yl(e,t){let n=!1;return De(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ce}),!!((!e.depth||e.depth<3)&&Me(e)&&(t.options.setext||n))}function Jl(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(Yl(e,n)){let f=n.enter("headingSetext"),m=n.enter("phrasing"),p=n.containerPhrasing(e,{...l.current(),before:`
|
|
981
|
+
`,after:`
|
|
982
|
+
`});return m(),f(),p+`
|
|
983
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
984
|
+
`))+1))}let o="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");l.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
985
|
+
`,...l.current()}),s=c.charCodeAt(0);return(s===9||s===32)&&(c=Cn(s)+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),u(),a(),c}Xr.peek=gp;function Xr(e){return e.value||""}function gp(){return"<"}Yr.peek=xp;function Yr(e,t,n,r){let i=ft(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image"),a=n.enter("label"),u=n.createTracker(r),c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),c+=u.move(")"),o(),c}function xp(){return"!"}Jr.peek=kp;function Jr(e,t,n,r){let i=e.referenceType,l=n.enter("imageReference"),o=n.enter("label"),a=n.createTracker(r),u=a.move("!["),c=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),o();let s=n.stack;n.stack=s.filter(function(m){return m!=="phrasing"}),o=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return o(),n.stack=s,l(),i==="full"||!c||c!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function kp(){return"!"}Kr.peek=yp;function Kr(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){let o=n.unsafe[l],a=n.compilePattern(o);if(!o.atBreak)continue;let u;for(;u=a.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function yp(){return"`"}function Zr(e,t){let n=Me(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ei.peek=wp;function ei(e,t,n,r){let i=ft(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);if(Zr(e,n)){let h=n.stack;n.stack=h.filter(function(k){return k!=="phrasing"});let x=n.enter("autolink"),S=o.move("<");return S+=o.move(n.containerPhrasing(e,{before:S,after:">",...o.current()})),S+=o.move(">"),x(),n.stack=h,S}let a=n.enter("link"),u=n.enter("label"),c=o.move("["),s=n.containerPhrasing(e,{before:c,after:"](",...o.current()});c+=o.move(s),u(),c+=o.move("](");let f=/[\0- \u007F]/.test(e.url),m=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!f&&(m===`
|
|
986
|
+
`||m==="\r")){let h=0;for(;h<s.length&&s.charCodeAt(h)!==93;)h+=s.charCodeAt(h)===92?2:1;s.charCodeAt(h+1)===58&&(p="")}return!e.url&&typeof p=="string"||f?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:typeof p=="string"?" ":")",...o.current()}))),u(),typeof p=="string"&&(u=n.enter(`title${l}`),c+=o.move(" "+i),c+=o.move(n.safe(p,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),a(),c}function wp(e,t,n){return Zr(e,n)?"<":"["}ti.peek=bp;function ti(e,t,n,r){let i=e.referenceType,l=n.enter("linkReference"),o=n.enter("label"),a=n.createTracker(r),u=a.move("["),c=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),o();let s=n.stack;n.stack=s.filter(function(m){return m!=="phrasing"}),o=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return o(),n.stack=s,l(),i==="full"||!c||c!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function bp(){return"["}function mt(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Kl(e){let t=mt(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Zl(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function An(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ea(e,t,n,r){let i=n.enter("list"),l=n.bulletCurrent,o=e.ordered?Zl(n):mt(n),a=e.ordered?o==="."?")":".":Kl(n),u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let s=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&s&&(!s.children||!s.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),An(n)===o&&s){let f=-1;for(;++f<e.children.length;){let m=e.children[f];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=a),n.bulletCurrent=o;let c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),c}function ta(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function na(e,t,n,r){let i=ta(n),l=n.bulletCurrent||mt(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let a=n.createTracker(r);a.move(l+" ".repeat(o-l.length)),a.shift(o);let u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),s);return u(),c;function s(f,m,p){return m?(p?"":" ".repeat(o))+f:(p?l:l+" ".repeat(o-l.length))+f}}function ra(e,t,n,r){let i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}function ia(e,t,n,r){if(!e.children.some(function(a){return Gr(a)}))return n.containerFlow(e,r);let l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),o}function oa(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Pn.attention=la;Pn.peek=Sp;function Pn(e,t,n,r){let i=n.enter("phrasing"),l=_t(e,la,n,n.createTracker(r)),o=l?pt([l],r.before,r.after):"";return i(),o}function la(e,t){return{construct:"strong",markers:oa(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Sp(e,t,n){return n.options.strong||"*"}function aa(e,t,n,r){let i=t?t.children:[],l=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[l+1],beforeNode:i[l-1]})}function ua(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sa(e,t,n){let r=(An(n)+(n.options.ruleSpaces?" ":"")).repeat(ua(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ht={blockquote:Rl,break:Qr,code:Hl,definition:Ul,emphasis:Tn,hardBreak:Qr,heading:Jl,html:Xr,image:Yr,imageReference:Jr,inlineCode:Kr,link:ei,linkReference:ti,list:ea,listItem:na,paragraph:ra,root:ia,strong:Pn,text:aa,thematicBreak:sa};function ri(){return{enter:{table:Cp,tableData:ca,tableHeader:ca,tableRow:Ip},exit:{codeText:Tp,table:Ep,tableData:ni,tableHeader:ni,tableRow:ni}}}function Cp(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function Ep(e){this.exit(e),this.data.inTable=void 0}function Ip(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function ni(e){this.exit(e)}function ca(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function Tp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ap));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ap(e,t){return t==="|"?t:e}function ii(e){let t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,l=n?" ":"|";return{handlers:{inlineCode:m,table:o,tableCell:u,tableRow:a},join:[Pp],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
987
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function o(p,h,x,S){let k=s(p,x,S),E=k[0];if(E){let C=p.align?p.align.length:0,P=-1;if(!C)for(;++P<k.length;)k[P].length>C&&(C=k[P].length);for(;E.length<C;)E.push("")}return c(k,p.align)}function a(p,h,x,S){let k=f(p,x,S),E=c([k]);return E.slice(0,E.indexOf(`
|
|
988
|
+
`))}function u(p,h,x,S){let k=x.enter("tableCell"),E=x.enter("phrasing"),C=x.containerPhrasing(p,{...S,before:l,after:l});return E(),k(),C}function c(p,h){return Dl(p,{align:h,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function s(p,h,x){let{children:S}=p,k=-1,E=[],C=h.enter("table");for(;++k<S.length;)E[k]=f(S[k],h,x);return C(),E}function f(p,h,x){let{children:S}=p,k=-1,E=[],C=h.enter("tableRow");for(;++k<S.length;)E[k]=u(S[k],p,h,x);return C(),E}function m(p,h,x){let S=ht.inlineCode(p,h,x);if(!x.stack.includes("tableCell"))return S;let k=[],E=0,C=S.indexOf("|");for(;C!==-1;){let P=C;for(;P>E&&S.charCodeAt(P-1)===92;)P--;k.push(S.slice(E,C)),(C-P)%2===0&&k.push("\\"),E=C,C=S.indexOf("|",C+1)}return k.push(S.slice(E)),k.join("")}}function Pp(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&Lp(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function Lp(e,t){let n=!1;return De(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,Ce}),!!((!e.depth||e.depth<3)&&Me(e)&&(t.options.setext||n))}function oi(){return{exit:{taskListCheckValueChecked:fa,taskListCheckValueUnchecked:fa,paragraph:vp}}}function li(){return{handlers:{paragraph:Fp},join:[Mp]}}function fa(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vp(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,l=-1,o;for(;++l<i.length;){let a=i[l];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function Fp(e,t,n,r){if(!t||t.type!=="listItem"||pa(t)!==e)return ht.paragraph(e,t,n,r);let i="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);l.move(i);let o=ht.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...l.current()});return i+o}function Mp(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;let r=pa(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function pa(e){if(typeof e.checked=="boolean")for(let t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function ai(){return[Nr(),Hr(),qr(),ri(),oi()]}function ui(e){return{extensions:[jr(),Ur(e),Vr(),ii(e),li()]}}var zp={tokenize:_p,partial:!0},ma={tokenize:Np,partial:!0},ha={tokenize:jp,partial:!0},da={tokenize:Hp,partial:!0},Dp={tokenize:Up,partial:!0},ga={name:"wwwAutolink",tokenize:Op,previous:ka},xa={name:"protocolAutolink",tokenize:Bp,previous:ya},Re={name:"emailAutolink",tokenize:Rp,previous:wa},Ee={};function ci(){return{text:Ee}}var Ze=48;for(;Ze<123;)Ee[Ze]=Re,Ze++,Ze===58?Ze=65:Ze===91&&(Ze=97);Ee[43]=Re;Ee[45]=Re;Ee[46]=Re;Ee[95]=Re;Ee[72]=[Re,xa];Ee[104]=[Re,xa];Ee[87]=[Re,ga];Ee[119]=[Re,ga];function Rp(e,t,n){let r=this,i,l;return o;function o(f){return!si(f)||!wa.call(r,r.previous)||fi(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return si(f)?(e.consume(f),a):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(Dp,s,c)(f):f===45||f===95||W(f)?(l=!0,e.consume(f),u):s(f)}function c(f){return e.consume(f),i=!0,u}function s(f){return l&&i&&X(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Op(e,t,n){let r=this;return i;function i(o){return o!==87&&o!==119||!ka.call(r,r.previous)||fi(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(zp,e.attempt(ma,e.attempt(ha,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Bp(e,t,n){let r=this,i="",l=!1;return o;function o(f){return(f===72||f===104)&&ya.call(r,r.previous)&&!fi(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(X(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){let m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),l?c:(l=!0,u)):n(f)}function c(f){return f===null||We(f)||B(f)||we(f)||Be(f)?n(f):e.attempt(ma,e.attempt(ha,s),n)(f)}function s(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function _p(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function Np(e,t,n){let r,i,l;return o;function o(c){return c===46||c===95?e.check(da,u,a)(c):c===null||B(c)||we(c)||c!==45&&Be(c)?u(c):(l=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function u(c){return i||r||!l?n(c):t(c)}}function jp(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(da,t,l)(o):o===null||B(o)||we(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function Hp(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),l):a===93?(e.consume(a),i):a===60||a===null||B(a)||we(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||B(a)||we(a)?t(a):r(a)}function l(a){return X(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):X(a)?(e.consume(a),o):n(a)}}function Up(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return W(l)?n(l):t(l)}}function ka(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||B(e)}function ya(e){return!X(e)}function wa(e){return!(e===47||si(e))}function si(e){return e===43||e===45||e===46||e===95||W(e)}function fi(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var qp={tokenize:Yp,partial:!0};function pi(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Qp,continuation:{tokenize:$p},exit:Xp}},text:{91:{name:"gfmFootnoteCall",tokenize:Gp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vp,resolveTo:Wp}}}}function Vp(e,t,n){let r=this,i=r.events.length,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!o||!o._balanced)return n(u);let c=ne(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Wp(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function Gp(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),l=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(l>999||f===93&&!o||f===null||f===91||B(f))return n(f);if(f===93){e.exit("chunkString");let m=e.exit("gfmFootnoteCallString");return i.includes(ne(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return B(f)||(o=!0),l++,e.consume(f),f===92?s:c}function s(f){return f===91||f===92||f===93?(e.consume(f),l++,c):c(f)}}function Qp(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),l,o=0,a;return u;function u(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",s):n(h)}function s(h){if(o>999||h===93&&!a||h===null||h===91||B(h))return n(h);if(h===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return l=ne(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return B(h)||(a=!0),o++,e.consume(h),h===92?f:s}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,s):s(h)}function m(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),i.includes(l)||i.push(l),F(e,p,"gfmFootnoteDefinitionWhitespace")):n(h)}function p(h){return t(h)}}function $p(e,t,n){return e.check(Se,t,e.attempt(qp,t,n))}function Xp(e){e.exit("gfmFootnoteDefinition")}function Yp(e,t,n){let r=this;return F(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){let o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function mi(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let c=u;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[u][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";let s={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[u][1].end)},f={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[u][1].start)},m=[["enter",s,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&K(m,m.length,0,be(p,o.slice(c+1,u),a)),K(m,m.length,0,[["exit",f,a],["enter",o[u][1],a],["exit",o[u][1],a],["exit",s,a]]),K(o,c-1,u-c+3,m),u=c+m.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function l(o,a,u){let c=this.previous,s=this.events,f=0;return m;function m(h){return c===126&&s[s.length-1][1].type!=="characterEscape"?u(h):(o.enter("strikethroughSequenceTemporary"),p(h))}function p(h){let x=he(c);if(h===126)return f>1?u(h):(o.consume(h),f++,p);if(f<2&&!n)return u(h);let S=o.exit("strikethroughSequenceTemporary"),k=he(h);return S._open=!k||k===2&&!!x,S._close=!x||x===2&&!!k,a(h)}}}var Ln=class{constructor(){this.map=[],this.index=new Map}add(t,n,r){Jp(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function Jp(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let l=[t,n,r];e.map.push(l),e.index.set(t,l)}function ba(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function hi(){return{flow:{null:{name:"table",tokenize:Kp,resolveAll:Zp}}}}function Kp(e,t,n){let r=this,i=0,l=0,o;return a;function a(y){let H=r.events.length-1;for(;H>-1;){let{type:N}=r.events[H][1];if(N==="lineEnding"||N==="linePrefix")H--;else break}let q=H>-1?r.events[H][1].type:null,L=q==="tableHead"||q==="tableRow"?b:u;return L===b&&r.parser.lazy[r.now().line]?n(y):L(y)}function u(y){return e.enter("tableHead"),e.enter("tableRow"),c(y)}function c(y){return y===124||(o=!0,l+=1),s(y)}function s(y){return y===null?n(y):A(y)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):n(y):v(y)?F(e,s,"whitespace")(y):(l+=1,o&&(o=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),o=!0,s):(e.enter("data"),f(y)))}function f(y){return y===null||y===124||B(y)?(e.exit("data"),s(y)):(e.consume(y),y===92?m:f)}function m(y){return y===92||y===124?(e.consume(y),f):f(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),o=!1,v(y)?F(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):h(y))}function h(y){return y===45||y===58?S(y):y===124?(o=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),x):z(y)}function x(y){return v(y)?F(e,S,"whitespace")(y):S(y)}function S(y){return y===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),k):y===45?(l+=1,k(y)):y===null||A(y)?P(y):z(y)}function k(y){return y===45?(e.enter("tableDelimiterFiller"),E(y)):z(y)}function E(y){return y===45?(e.consume(y),E):y===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(y))}function C(y){return v(y)?F(e,P,"whitespace")(y):P(y)}function P(y){return y===124?h(y):y===null||A(y)?!o||i!==l?z(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):z(y)}function z(y){return n(y)}function b(y){return e.enter("tableRow"),R(y)}function R(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),R):y===null||A(y)?(e.exit("tableRow"),t(y)):v(y)?F(e,R,"whitespace")(y):(e.enter("data"),j(y))}function j(y){return y===null||y===124||B(y)?(e.exit("data"),R(y)):(e.consume(y),y===92?G:j)}function G(y){return y===92||y===124?(e.consume(y),j):j(y)}}function Zp(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],a=!1,u=0,c,s,f,m=new Ln;for(;++n<e.length;){let p=e[n],h=p[1];p[0]==="enter"?h.type==="tableHead"?(a=!1,u!==0&&(Sa(m,t,u,c,s),s=void 0,u=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},m.add(n,0,[["enter",c,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(r=!0,f=void 0,l=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,s={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},m.add(n,0,[["enter",s,t]])),i=h.type==="tableDelimiterRow"?2:s?3:1):i&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],f=vn(m,t,l,i,void 0,f),l=[0,0,0,0]),o[2]=n)):h.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],f=vn(m,t,l,i,void 0,f)),l=o,o=[l[1],n,0,0])):h.type==="tableHead"?(a=!0,u=n):h.type==="tableRow"||h.type==="tableDelimiterRow"?(u=n,l[1]!==0?(o[0]=o[1],f=vn(m,t,l,i,n,f)):o[1]!==0&&(f=vn(m,t,o,i,n,f)),i=0):i&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(o[3]=n)}for(u!==0&&Sa(m,t,u,c,s),m.consume(t.events),n=-1;++n<t.events.length;){let p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=ba(t.events,n))}return e}function vn(e,t,n,r,i,l){let o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(l.end=Object.assign({},dt(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));let u=dt(t.events,n[1]);if(l={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){let c=dt(t.events,n[2]),s=dt(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},s)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){let m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){let h=n[2]+1,x=n[3]-n[2]-1;e.add(h,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(l.end=Object.assign({},dt(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Sa(e,t,n,r,i){let l=[],o=dt(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function dt(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var em={name:"tasklistCheck",tokenize:tm};function di(){return{text:{91:em}}}function tm(e,t,n){let r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return B(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return A(u)?t(u):v(u)?e.check({tokenize:nm},t,n)(u):n(u)}}function nm(e,t,n){return F(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Ca(e){return Yt([ci(),pi(),mi(e),hi(),di()])}var rm={};function Fn(e){let t=this,n=e||rm,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ca(n)),l.push(ai()),o.push(ui(n))}var Y={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var et={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var Ie={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var Ea=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ia=12288,Ta=65510,Aa=[12288,12288,65281,65376,65504,65510],Pa=8361,La=65518,va=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Fa=32,Ma=10630,za=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Da=4352,Ra=262141,gi=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141];var gt=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),l=i*2;if(t<e[l])r=i-1;else if(t>e[l+1])n=i+1;else return!0}return!1};var Oa=19968,[lm,am]=um(gi);function um(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],l=e[r+1];if(Oa>=i&&Oa<=l)return[i,l];l-i>n-t&&(t=i,n=l)}return[t,n]}var Ba=e=>e<161||e>1114109?!1:gt(Ea,e),_a=e=>e<Ia||e>Ta?!1:gt(Aa,e),sm=e=>e<Pa||e>La?!1:gt(va,e),cm=e=>e<Fa||e>Ma?!1:gt(za,e),Na=e=>e>=lm&&e<=am?!0:e<Da||e>Ra?!1:gt(gi,e);function ja(e){return Ba(e)?"ambiguous":_a(e)?"fullwidth":sm(e)?"halfwidth":cm(e)?"narrow":Na(e)?"wide":"neutral"}function fm(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Ha(e){return fm(e),ja(e)}function pm(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function Ua(e){if(!e||e<4352)return!1;switch(Ha(e)){case"fullwidth":case"halfwidth":return!0;case"wide":return!pm(e);case"narrow":return!1;case"ambiguous":return 917760<=e&&e<=917999?null:!1;case"neutral":return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function qa(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function Va(e){return e!==null&&e>=65024&&e<=65038}var Wa=Qa(/\p{P}|\p{S}/u),Ga=Qa(/\s/);function Qa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCodePoint(n))}}function ae(e){return!!(e&et.characterGroupWhitespace)}function He(e){return(e&ue.cjkPunctuation)===et.characterGroupPunctuation}function Nt(e){return!!(e&ue.cjk)}function tt(e){return!!(e&ue.cjkOrIvs)}function xt(e){return e===ue.nonEmojiGeneralUseVS}function nt(e){return!!(e&ue.spaceOrPunctuation)}var ue;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(ue||(ue={}));function xe(e){if(e===Y.eof||B(e)||Ga(e))return et.characterGroupWhitespace;let t=0;if(e>=4352){if(Va(e))return ue.nonEmojiGeneralUseVS;switch(Ua(e)){case null:return ue.ivs;case!0:t|=ue.cjk;break}}return Wa(e)&&(t|=et.characterGroupPunctuation),t}function jt(e,t,n){if(!xt(e))return e;let r=t(),i=xe(r);return!r||ae(i)?e:qa(r,n)?ue.cjkPunctuation:mm(i)}function mm(e){return e&~ue.ivs}function xi(e){return!!(e&&e>=55296&&e<=56319)}function ki(e){return!!(e&&e>=56320&&e<=57343)}function yi(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function $a(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,l=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=l.charCodeAt(l.length-1);if(Number.isNaN(o))return null;if(l.length<2||o<56320||57343<o)return o;let a=l.codePointAt(0);return a&&a>=65536?a:o}var wi=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=$a(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function bi(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var Mn={name:"attention",resolveAll:hm,tokenize:dm};function hm(e,t){let n=-1,r,i,l,o,a,u,c,s;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},m={...e[n][1].start};Xa(f,-u),Xa(m,u),o={type:u>1?Ie.strongSequence:Ie.emphasisSequence,start:f,end:{...e[r][1].end}},a={type:u>1?Ie.strongSequence:Ie.emphasisSequence,start:{...e[n][1].start},end:m},l={type:u>1?Ie.strongText:Ie.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?Ie.strong:Ie.emphasis,start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=J(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=J(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),t.parser.constructs.insideSpan.null,c=J(c,be(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=J(c,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(s=2,c=J(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):s=0,K(e,r-1,n-r+3,c),n=r+c.length-s-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dm(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:l}=this,o=ki(l)?yi(l,r(),i):l,a=xe(o),u=new wi(o,r(),i),c=jt(a,u.value.bind(u),o),s;return f;function f(p){return p===Y.asterisk||Y.underscore,s=p,e.enter("attentionSequence"),m(p)}function m(p){if(p===s)return e.consume(p),m;let h=e.exit("attentionSequence"),x=xe(xi(p)?bi(p,r(),i):p);let S=He(c),k=S||ae(c),E=He(x),C=E||ae(x),P=tt(c),z=!C||E&&(k||P)||n.includes(p),b=!k||S&&(C||Nt(x))||n.includes(o);return h._open=!!(s===Y.asterisk?z:z&&(nt(c)||!b)),h._close=!!(s===Y.asterisk?b:b&&(nt(x)||!z)),t(p)}}function Xa(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Ya(){return{text:{[Y.asterisk]:Mn,[Y.underscore]:Mn},insideSpan:{null:[Mn]}}}function Ja(){let e=this.data();(e.micromarkExtensions||(e.micromarkExtensions=[])).push(Ya())}var gm=";".codePointAt(0)??Y.eof,xm="&".codePointAt(0)??Y.eof;function nu(){return{handlers:{emphasis:ru,strong:iu,text:km}}}ru.peek=ou;iu.peek=lu;function ru(e,t,n,r){return au(e,t,n,r,ou(e,t,n),1)}function iu(e,t,n,r){return au(e,t,n,r,lu(e,t,n),2)}function ou(e,t,n){return n.options.emphasis||"*"}function lu(e,t,n){return n.options.strong||"*"}function au(e,t,n,r,i,l){let o=i.repeat(l),a=n.enter(l===1?"emphasis":"strong"),u=n.createTracker(r),c=u.move(o),s=u.move(n.containerPhrasing(e,{after:i,before:c,...u.current()})),f=bm(e,t,n,r.before),m=Sm(e,t,n,r.after),p=Ka(f,zn(s),i,"open");p.inside&&s&&(s=Am(s));let h=Ka({current:Ei(s),previous:Ci(s)},m,i,"close");h.inside&&s&&(s=Pm(s));let x=u.move(o);a();let S=h.outside&&Tm(t,n);return n.attentionEncodeSurroundingInfo={after:h.outside&&!S,before:p.outside},n.cjkFriendlyEncodeAfterSupplementaryText=S,c+s+x}function km(e,t,n,r){let i=n;if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[l=""]=[...e.value],o=e.value.slice(l.length);return`${Ti(l.codePointAt(0)??Y.eof)}${n.safe(o,{...r,before:";"})}`}function Ka(e,t,n,r){let i=Ii(e),l=xe(t);if(!tt(i)&&!tt(l))return r==="open"?Za(i,l,n):Za(l,i,n);let o={inside:!1,outside:!1},a={inside:!0,outside:!1},u={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let s of[o,a,u,c]){let f=r==="open"?s.outside?eu:e:s.inside?eu:e,m=r==="open"?s.inside?tu:t:s.outside?tu:t;if(r==="open"?ym(n,f,m):wm(n,f,m))return s}return c}function Za(e,t,n){return Si(e)?Si(t)?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:ae(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:ae(e)?Si(t)?{inside:!1,outside:!1}:ae(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:ae(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function ym(e,t,n){let r=Ii(t),{close:i,open:l}=uu(r,xe(n));return e==="_"?l&&(nt(r)||!i):l}function wm(e,t,n){let r=xe(n),{close:i,open:l}=uu(Ii(t),r);return e==="_"?i&&(nt(r)||!l):i}function uu(e,t){let n=He(e),r=n||ae(e),i=He(t),l=i||ae(t);return{open:!l||i&&(r||tt(e)),close:!r||n&&(l||Nt(t))}}function Si(e){return!ae(e)&&!He(e)}function Ii(e){let t=xe(e.current);return e.current===null||!xt(t)?t:jt(t,()=>e.previous,e.current)}function bm(e,t,n,r){let i=Ei(r),l=Ci(r);if(Cm(i)||Im(i,l)){let o=su(e,t,n,-1);o&&(i=Ei(o),l=Ci(o))}return{current:i,previous:l}}function Sm(e,t,n,r){let i=zn(r);if(!Em(i))return i;let l=su(e,t,n,1);return l?zn(l):i}function Cm(e){return e!==null&&56320<=e&&e<=57343}function Em(e){return e!==null&&55296<=e&&e<=56319}function Im(e,t){return xt(xe(e))&&(t===null||t===Y.eof)}function su(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),l=t.children,o=typeof i=="number"?i:l.indexOf(e);if(o<0)return;let a=l[o+r];return cu(a)||void 0}function Tm(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!="number")return!1;let r=e.children[n+1];return r?.type==="text"&&(zn(r.value)??0)>65535}function cu(e){return!e||typeof e!="object"?"":"value"in e&&typeof e.value=="string"?e.value:"alt"in e&&typeof e.alt=="string"?e.alt:"children"in e&&Array.isArray(e.children)?e.children.map(cu).join(""):""}function Ti(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Am(e){let[t=""]=[...e];return Ti(t.codePointAt(0)??Y.eof)+e.slice(t.length)}function Pm(e){let t=[...e],n=t.pop();return`${t.join("")}${Ti(n?.codePointAt(0)??Y.eof)}`}function Ci(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??Y.eof}function zn(e){return e.codePointAt(0)??Y.eof}function Ei(e){return[...e].at(-1)?.codePointAt(0)??Y.eof}var eu={current:gm,previous:Y.eof},tu=xm;function fu(){let e=this.data();(e.toMarkdownExtensions||(e.toMarkdownExtensions=[])).push(nu())}function pu(){Ja.call(this),fu.call(this)}var mu=pu;function hu(e){let t=null;for(let l of e.split(`
|
|
989
|
+
`)){let o=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(l);o&&(t?o[1][0]===t[0]&&o[1].length>=t.length&&!o[2].trim()&&(t=null):t=o[1])}if(t)return e+`
|
|
990
|
+
`+t;let n=e.slice(e.lastIndexOf(`
|
|
991
|
+
`)+1);if(n.includes("`")||n.includes("***"))return e;let r=[...n.matchAll(/(?<![\\*])\*\*(?!\*)/g)],i=r.at(-1);return r.length%2&&i&&/^\S/.test(n.slice(i.index+2))?e+"**":e}function Lm(e){let t=e.createElement,n=l=>/^https?:\/\//i.test(l)?l:"";function r(l){return()=>o=>{let a=u=>{!u.children||["link","code","inlineCode"].includes(u.type)||(u.children=u.children.flatMap(c=>{if(c.type!=="text")return a(c),[c];let s=[],f=0;for(let m of c.value.matchAll(/\[(S\d+)\]/g)){let p=l.find(h=>h.sourceId===m[1]);!p||!n(p.url)||(m.index>f&&s.push({type:"text",value:c.value.slice(f,m.index)}),s.push({type:"link",url:p.url,title:p.author,data:{hProperties:{className:"st-chat-citation"}},children:[{type:"text",value:m[0]}]}),f=m.index+m[0].length)}return f<c.value.length&&s.push({type:"text",value:c.value.slice(f)}),s}))};a(o)}}let i={a:({href:l,children:o,title:a,className:u})=>l?t("a",{href:l,title:a,className:u,target:"_blank",rel:"noreferrer"},o):t("span",null,o),img:({src:l,alt:o})=>l?t("a",{href:l,target:"_blank",rel:"noreferrer"},o||"\u67E5\u770B\u56FE\u7247"):null,table:({children:l})=>t("div",{className:"st-chat-table"},t("table",null,l))};return e.memo(function({text:o,sources:a,streaming:u}){let c=e.useMemo(()=>[[Fn,{singleTilde:!1}],mu,r(a)],[a]);return t("div",{className:"st-chat-answer"},t(Mr,{remarkPlugins:c,skipHtml:!0,urlTransform:n,components:i},u?hu(o):o))},(l,o)=>l.text===o.text&&l.streaming===o.streaming&&JSON.stringify(l.sources)===JSON.stringify(o.sources))}
|
|
992
|
+
|
|
993
|
+
return module.exports;
|
|
994
|
+
}
|
|
995
|
+
/* MARKDOWN_VENDOR_END */
|
|
996
|
+
let markdownRenderer;
|
|
997
|
+
function ChatMarkdown(props) {
|
|
998
|
+
markdownRenderer ||= loadChatMarkdown(require).createChatMarkdown(React);
|
|
999
|
+
return h(markdownRenderer, props);
|
|
1000
|
+
}
|
|
1001
|
+
function ChatProgress({ run, pending, cancel }) {
|
|
1002
|
+
const active = ['running', 'executing'].includes(run.status), [now, setNow] = React.useState(Date.now()), [expanded, setExpanded] = React.useState(false);
|
|
1003
|
+
React.useEffect(() => { if (!active) return; const timer = setInterval(() => setNow(Date.now()), 1000); return () => clearInterval(timer); }, [active]);
|
|
1004
|
+
const labels = { read_author_index: '查看博主资料索引', search_posts: '检索本地消息', read_posts: '读取消息原文', list_status: '查看监控状态', add_monitor: '添加博主', control_monitor: '调整监控开关', set_frequency: '修改监控频率', create_summary_task: '创建总结任务', control_summary_task: '调整总结任务', run_summary_task: '执行总结任务', validate_sources: '核对回答来源' };
|
|
1005
|
+
const phases = { requesting: '连接模型', thinking: '模型正在思考', answering: '正在生成回答', preparing_tools: '准备查询与操作' };
|
|
1006
|
+
const status = { completed: '已完成', failed: '执行失败', interrupted: '执行中断', cancelled: '已停止', awaiting_confirmation: '等待你确认', executing: '正在应用变更', running: '正在工作' };
|
|
1007
|
+
const seconds = Math.max(0, Math.floor(((active ? now : run.finished_at || run.created_at) - run.created_at) / 1000));
|
|
1008
|
+
const row = (step, index) => {
|
|
1009
|
+
const running = step.status === 'running' && active;
|
|
1010
|
+
const duration = step.startedAt && (step.finishedAt || running && now);
|
|
1011
|
+
return h('li', { key: index, className: running ? 'is-running' : '' }, h('span', { 'aria-hidden': true }, running ? '◌' : step.status === 'failed' ? '!' : '✓'),
|
|
1012
|
+
h('span', null, step.kind === 'model' ? running ? phases[step.phase] || '调用模型' : '模型处理' : labels[step.name] || '处理任务'),
|
|
1013
|
+
h('small', null, step.status === 'awaiting_confirmation' ? '待确认' : step.status === 'running' && !active ? status[run.status] : step.status === 'failed' ? '失败' : running ? '进行中' : '完成', duration ? ' · ' + Math.max(0, Math.floor((duration - step.startedAt) / 1000)) + ' 秒' : ''),
|
|
1014
|
+
step.result?.error ? h('p', null, step.result.error) : null);
|
|
1015
|
+
};
|
|
1016
|
+
return h('div', { className: 'st-chat-progress' }, h('div', { className: 'st-chat-progress-head', role: 'status' }, active ? h('i', { className: 'st-chat-spinner', 'aria-hidden': true }) : h('span', { 'aria-hidden': true }, run.status === 'completed' ? '✓' : '·'), h('span', null, status[run.status] || run.status), h('small', null, seconds + ' 秒'), active ? h('button', { disabled: pending, onClick: cancel }, '停止执行') : null),
|
|
1017
|
+
run.steps.length ? h('details', { className: 'st-chat-trace', onToggle: event => setExpanded(event.currentTarget.open) }, h('summary', null, '处理过程 · ', run.steps.length, ' 步'), h('ol', null, run.steps.map(row))) : null,
|
|
1018
|
+
active && !expanded && run.steps.length ? h('ol', { className: 'st-chat-live-steps', 'aria-label': '最近处理步骤' }, run.steps.slice(-5).map(row)) : null);
|
|
1019
|
+
}
|
|
1020
|
+
function BusinessChatPanel({ onChanged, sessionId, setSessionId, onSessions, drafts, onChooseSession }) {
|
|
1021
|
+
const [data, setData] = React.useState(null), [input, setInput] = React.useState(() => drafts.current.get(sessionId) || '');
|
|
1022
|
+
const [error, setError] = React.useState(''), [pending, setPending] = React.useState(false);
|
|
1023
|
+
const alive = React.useRef(true), composer = React.useRef(null), composing = React.useRef(false);
|
|
1024
|
+
React.useEffect(() => { alive.current = true; return () => { alive.current = false; }; }, []);
|
|
1025
|
+
React.useEffect(() => { setInput(drafts.current.get(sessionId) || ''); composer.current?.focus(); }, [sessionId]);
|
|
1026
|
+
const epoch = React.useRef(0), revision = React.useRef(0), mutating = React.useRef(false), bottom = React.useRef(null);
|
|
1027
|
+
React.useEffect(() => {
|
|
1028
|
+
const current = ++epoch.current; let active = true, inFlight = false, running = true, lastLoad = 0;
|
|
1029
|
+
setData(before => before ? { ...before, runs: [] } : before);
|
|
1030
|
+
const load = async () => {
|
|
1031
|
+
if (mutating.current || document.hidden || inFlight || Date.now() - lastLoad < (running ? 500 : 2000)) return;
|
|
1032
|
+
inFlight = true; lastLoad = Date.now();
|
|
1033
|
+
const version = revision.current;
|
|
1034
|
+
try {
|
|
1035
|
+
const next = await api('/chat?sessionId=' + encodeURIComponent(sessionId === 'new' ? '' : sessionId), undefined, AbortSignal.timeout(10000));
|
|
1036
|
+
if (!active || epoch.current !== current || revision.current !== version || mutating.current) return;
|
|
1037
|
+
running = !!next.busy;
|
|
1038
|
+
setData(next); onSessions(next.sessions);
|
|
1039
|
+
if (!sessionId && next.sessions.length) setSessionId(next.sessions[0].id);
|
|
1040
|
+
} catch (err) { if (active && epoch.current === current) setError(err.message); }
|
|
1041
|
+
finally { inFlight = false; }
|
|
1042
|
+
};
|
|
1043
|
+
void load(); const timer = setInterval(load, 500);
|
|
1044
|
+
return () => { active = false; clearInterval(timer); };
|
|
1045
|
+
}, [sessionId]);
|
|
1046
|
+
const scroller = React.useRef(null), followLatest = React.useRef(true);
|
|
1047
|
+
const [showJump, setShowJump] = React.useState(false);
|
|
1048
|
+
const latest = data?.runs.at(-1);
|
|
1049
|
+
React.useEffect(() => { if (followLatest.current && scroller.current) scroller.current.scrollTop = scroller.current.scrollHeight; }, [sessionId, data?.runs.length, latest?.answer, latest?.status]);
|
|
1050
|
+
const request = async (path, body) => {
|
|
1051
|
+
if (mutating.current) return;
|
|
1052
|
+
mutating.current = true; revision.current++;
|
|
1053
|
+
setPending(true); setError('');
|
|
1054
|
+
try {
|
|
1055
|
+
const result = await api(path, body);
|
|
1056
|
+
if (path === '/chat/message') drafts.current.delete(sessionId);
|
|
1057
|
+
if (!alive.current) return;
|
|
1058
|
+
if (result.sessionId) { setSessionId(result.sessionId); setInput(''); composer.current?.focus(); }
|
|
1059
|
+
if (path !== '/chat/message') {
|
|
1060
|
+
const next = await api('/chat?sessionId=' + encodeURIComponent(sessionId === 'new' ? '' : sessionId)); setData(next);
|
|
1061
|
+
await onChanged();
|
|
1062
|
+
}
|
|
1063
|
+
} catch (err) { if (alive.current) setError(err.message); }
|
|
1064
|
+
finally { revision.current++; mutating.current = false; if (alive.current) setPending(false); }
|
|
1065
|
+
};
|
|
1066
|
+
const canSend = !pending && !!data?.available && !data?.busy && !!input.trim();
|
|
1067
|
+
const submit = () => { if (canSend && !mutating.current) { followLatest.current = true; setShowJump(false); void request('/chat/message', { message: input, sessionId: sessionId === 'new' ? '' : sessionId }); } };
|
|
1068
|
+
const changeInput = value => { setInput(value); drafts.current.set(sessionId, value); };
|
|
1069
|
+
|
|
1070
|
+
const title = data?.sessions.find(session => session.id === sessionId)?.title || '新对话';
|
|
1071
|
+
const compose = h('form', { className: 'st-chat-compose', onSubmit: event => { event.preventDefault(); submit(); } },
|
|
1072
|
+
h('textarea', { ref: composer, 'aria-label': '告诉 Social Trace 你想做什么', 'aria-describedby': 'st-chat-keyboard-help', onCompositionStart: () => { composing.current = true; }, onCompositionEnd: () => { composing.current = false; }, onKeyDown: event => { if (event.key === 'Enter' && !event.shiftKey && !event.altKey && !event.repeat && !event.nativeEvent.isComposing && event.nativeEvent.keyCode !== 229 && !composing.current) { event.preventDefault(); submit(); } }, placeholder: '想了解谁的动态,或安排什么任务?', value: input, maxLength: 4000, onChange: event => changeInput(event.target.value) }),
|
|
1073
|
+
h('div', { className: 'st-chat-compose-footer' }, h('span', { className: 'st-caption' }, !data ? '正在连接模型服务…' : data.available ? 'DSH 默认模型 · 本地资料' : '请先在 DSH 配置默认模型'), h('button', { className: 'st-primary st-chat-send', 'aria-label': '发送', disabled: !canSend }, '↑')));
|
|
1074
|
+
const keyboardHelp = h('p', { id: 'st-chat-keyboard-help', className: 'st-chat-disclosure' }, 'Enter 发送 · Shift + Enter 换行。修改监控前需你确认。');
|
|
1075
|
+
return h('section', { className: 'st-chat' + (!data?.runs.length ? ' is-empty' : ''), 'aria-label': 'Social Trace 业务 Chat' },
|
|
1076
|
+
h('header', { className: 'st-chat-toolbar', 'aria-label': '对话标题栏' }, h('div', { className: 'st-chat-title' }, navIcon('chat'), h('h1', { title: title }, title)), h('div', { className: 'st-chat-header-actions' },
|
|
1077
|
+
h('select', { className: 'st-chat-mobile-sessions', 'aria-label': '选择对话', value: sessionId || 'new', onChange: event => onChooseSession(event.target.value) }, h('option', { value: 'new' }, '新对话'), data?.sessions.map(session => h('option', { key: session.id, value: session.id }, session.title))),
|
|
1078
|
+
null)),
|
|
1079
|
+
h('div', { className: 'st-chat-scroll', ref: scroller, role: 'region', 'aria-label': '消息内容', tabIndex: 0, onScroll: event => { const node = event.currentTarget; followLatest.current = node.scrollHeight - node.scrollTop - node.clientHeight < 80; setShowJump(!followLatest.current); } }, h('div', { className: 'st-chat-content' },
|
|
1080
|
+
error ? h('p', { role: 'alert', className: 'st-inline-error' }, error) : null,
|
|
1081
|
+
!data?.runs.length ? h('div', { className: 'st-chat-welcome' }, traceMark(44), h('h2', null, 'Social Trace'), h('p', null, '关注动态,发现观点。')) : null,
|
|
1082
|
+
h('div', { className: 'st-chat-log', role: 'log', 'aria-label': '对话记录' }, data?.runs.map(run => h('article', { className: 'st-chat-turn', key: run.id },
|
|
1083
|
+
h('div', { className: 'st-chat-question' }, run.input),
|
|
1084
|
+
h(ChatProgress, { run, pending, cancel: () => request('/chat/cancel', { id: run.id }) }),
|
|
1085
|
+
run.error ? h('p', { className: 'st-chat-run-error', role: 'alert' }, run.error, run.answer ? '(已保留生成内容,供你核对)' : '') : null,
|
|
1086
|
+
run.answer ? h(ChatMarkdown, { text: run.answer, sources: run.sources, streaming: run.status === 'running' }) : null,
|
|
1087
|
+
run.action && run.status === 'awaiting_confirmation' ? h('div', { className: 'st-chat-confirm', 'aria-label': '待确认的业务变更' }, h('p', null, run.action.label), run.action.actions ? h('ol', null, run.action.actions.map((action, index) => h('li', { key: index }, action.label))) : null,
|
|
1088
|
+
h('div', { className: 'st-actions' }, h('button', { className: 'st-primary', disabled: pending, onClick: () => request('/chat/confirm', { id: run.id }) }, '确认执行'),
|
|
1089
|
+
h('button', { disabled: pending, onClick: () => request('/chat/cancel', { id: run.id }) }, '取消变更'))) : null,
|
|
1090
|
+
run.sources.length ? h('details', { className: 'st-chat-source-list' }, h('summary', null, '参考来源 · ', run.sources.length, ' 条'), h('div', { className: 'st-chat-sources' }, run.sources.map(source => /^https:\/\/(?:www\.)?(?:weibo\.com|xueqiu\.com)\//.test(source.url)
|
|
1091
|
+
? h('a', { key: source.id, href: source.url, target: '_blank', rel: 'noreferrer' }, '[' + source.sourceId + '] ' + source.author + ' · ' + date(source.publishedAt))
|
|
1092
|
+
: h('span', { key: source.id }, '[' + source.sourceId + '] ' + source.author)))) : null,
|
|
1093
|
+
run.sources.some(source => source.truncated) ? h('small', null, '部分来源使用了摘录;可继续要求读取原文核对。') : null,
|
|
1094
|
+
null)), h('div', { ref: bottom })),
|
|
1095
|
+
data?.busy && !data.runs.some(run => run.id === data.busy) ? h('p', { role: 'status' }, '后台正在处理另一项任务,请稍候。') : null,
|
|
1096
|
+
!data?.runs.length ? compose : null,
|
|
1097
|
+
!data?.runs.length ? h('div', { className: 'st-chat-examples' }, ['总结今天我关注的人说了什么', '查看所有博主的监控状态', '创建一个工作日18点执行的总结任务', '暂停某位博主的历史缓存,新动态继续'].map((example, index) => h('button', { key: example, onClick: () => { changeInput(example); composer.current?.focus(); } }, h('span', { 'aria-hidden': true }, ['✧', '◎', '◷', 'Ⅱ'][index]), example))) : null,
|
|
1098
|
+
!data?.runs.length ? keyboardHelp : null,
|
|
1099
|
+
null)),
|
|
1100
|
+
data?.runs.length ? h('footer', { className: 'st-chat-dock', 'aria-label': '消息输入区' }, showJump ? h('button', { className: 'st-chat-jump', onClick: () => { followLatest.current = true; setShowJump(false); scroller.current.scrollTop = scroller.current.scrollHeight; } }, '回到最新消息 ↓') : null, compose, keyboardHelp) : null);
|
|
1101
|
+
}
|
|
1102
|
+
function traceMark(size) {
|
|
1103
|
+
return h('svg', { width: size, height: size, viewBox: '0 0 32 32', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, 'aria-hidden': true }, h('rect', { x: 2, y: 2, width: 28, height: 28, rx: 9, stroke: 'var(--line)' }), h('circle', { cx: 16, cy: 16, r: 8 }), h('circle', { cx: 16, cy: 16, r: 3 }), h('path', { d: 'M16 5v5M22 16h5M16 22v5M5 16h5' }));
|
|
1104
|
+
}
|
|
1105
|
+
function navIcon(key) {
|
|
1106
|
+
const paths = { new: 'M12 5v14M5 12h14', overview: 'M4 5h5v5H4zM15 14h5v5h-5zM9 7h8v7M7 10v7h8', chat: 'M4 4h16v12H9l-5 4z', archive: 'M4 6h6l2 2h8v12H4z', notices: 'M6 16V9a6 6 0 0 1 12 0v7l2 2H4zM10 21h4', settings: 'M4 7h16M4 17h16M9 4v6M15 14v6' };
|
|
1107
|
+
return h('svg', { className: 'st-nav-icon', width: 18, height: 18, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true }, h('path', { d: paths[key] }));
|
|
1108
|
+
}
|
|
937
1109
|
function Panel() {
|
|
938
1110
|
const [state, setState] = React.useState(null);
|
|
939
1111
|
const [tab, setTab] = React.useState('overview');
|
|
940
1112
|
const [followOpen, setFollowOpen] = React.useState(false);
|
|
1113
|
+
const [chatSession, setChatSession] = React.useState('');
|
|
1114
|
+
const [chatSessions, setChatSessions] = React.useState([]);
|
|
1115
|
+
const [chatView, setChatView] = React.useState(0);
|
|
1116
|
+
const [deletedChat, setDeletedChat] = React.useState(null), [deletingChat, setDeletingChat] = React.useState('');
|
|
1117
|
+
const hiddenChatIds = React.useRef(new Set());
|
|
1118
|
+
const receiveChatSessions = items => setChatSessions(items.filter(item => !hiddenChatIds.current.has(item.id)));
|
|
1119
|
+
const chatDrafts = React.useRef(new Map());
|
|
1120
|
+
React.useEffect(() => { let active = true; void api('/chat').then(data => { if (active) receiveChatSessions(data.sessions); }).catch(() => {}); return () => { active = false; }; }, []);
|
|
941
1121
|
const [readerTab, setReaderTab] = React.useState('content');
|
|
942
1122
|
const [adding, setAdding] = React.useState(false);
|
|
943
1123
|
const [nodeSettings, setNodeSettings] = React.useState(null);
|
|
@@ -1145,7 +1325,25 @@
|
|
|
1145
1325
|
const unread = unreadNotices(state);
|
|
1146
1326
|
const originals = (state?.archiveSummary || []).filter(item => !uid || item.uid === uid).reduce((n, row) => n + (row.original_count || 0), 0);
|
|
1147
1327
|
const reposts = (state?.archiveSummary || []).filter(item => !uid || item.uid === uid).reduce((n, row) => n + (row.repost_count || 0), 0);
|
|
1148
|
-
const titles = { overview: '监控流向', archive: '关注与档案', notices: '消息中心', settings: '连接与设置' };
|
|
1328
|
+
const titles = { chat: 'Chat', overview: '监控流向', archive: '关注与档案', notices: '消息中心', settings: '连接与设置' };
|
|
1329
|
+
const openChat = next => { if (next === 'new') chatDrafts.current.delete('new'); setChatSession(next); setChatView(value => value + 1); navigate('chat'); };
|
|
1330
|
+
const deleteChat = async session => {
|
|
1331
|
+
if (deletingChat) return;
|
|
1332
|
+
setDeletingChat(session.id);
|
|
1333
|
+
try {
|
|
1334
|
+
await api('/chat/session/delete', { id: session.id });
|
|
1335
|
+
hiddenChatIds.current.add(session.id);
|
|
1336
|
+
setChatSessions(before => before.filter(item => item.id !== session.id));
|
|
1337
|
+
setDeletedChat(session); chatDrafts.current.delete(session.id);
|
|
1338
|
+
if (chatSession === session.id) openChat('new');
|
|
1339
|
+
} catch (err) { setError(err.message); }
|
|
1340
|
+
finally { setDeletingChat(''); }
|
|
1341
|
+
};
|
|
1342
|
+
const restoreChat = async () => {
|
|
1343
|
+
if (!deletedChat) return;
|
|
1344
|
+
try { await api('/chat/session/restore', { id: deletedChat.id }); hiddenChatIds.current.delete(deletedChat.id); const data = await api('/chat'); receiveChatSessions(data.sessions); openChat(deletedChat.id); setDeletedChat(null); }
|
|
1345
|
+
catch (err) { setError(err.message); }
|
|
1346
|
+
};
|
|
1149
1347
|
const effective = tab === 'overview' ? overviewStatus(state, platform) : monitorStatus(state, platform, uid);
|
|
1150
1348
|
const effectivePlatform = effective.platform || platform;
|
|
1151
1349
|
const effectiveSource = state?.platforms?.find(source => source.id === effectivePlatform);
|
|
@@ -1154,7 +1352,8 @@
|
|
|
1154
1352
|
const firstUse = state && (!state.targets.length || state.targets.every(item => item.capture_mode === 'pending'));
|
|
1155
1353
|
const showPreview = !state || !state.targets.length;
|
|
1156
1354
|
let content;
|
|
1157
|
-
if (
|
|
1355
|
+
if (tab === 'chat') content = h(BusinessChatPanel, { key: chatView, drafts: chatDrafts, onChooseSession: openChat, onChanged: reload, sessionId: chatSession, setSessionId: setChatSession, onSessions: receiveChatSessions });
|
|
1356
|
+
else if (!state && tab !== 'overview') content = h('div', { className: 'st-empty' },
|
|
1158
1357
|
h('h3', null, error ? '后台尚未连接' : '正在打开本地档案库…'),
|
|
1159
1358
|
error ? h('p', null, '后台恢复连接后,账号、频率和信息保存位置会显示在这里。') : null,
|
|
1160
1359
|
!error ? button('重试连接', () => reload().then(() => setError('')).catch(err => setError(err.message))) : null);
|
|
@@ -1221,8 +1420,8 @@
|
|
|
1221
1420
|
h('div', { className: 'st-platform-tabs', role: 'tablist', 'aria-label': '平台配置' }, [['weibo', '微博'], ['xueqiu', '雪球'], ['x', 'X']].map(([id, title]) => h('button', { key: id, role: 'tab', 'aria-selected': platform === id, onClick: () => { setPlatform(id); setFocusSection(''); setError(''); setSavedMessage(''); } }, title))),
|
|
1222
1421
|
!['weibo', 'xueqiu'].includes(platform) ? h('div', { className: 'st-development' }, h('h3', null, platformName + ' · 开发中'), h('p', null, '暂未开放配置')) : h(React.Fragment, null,
|
|
1223
1422
|
h('section', { id: 'st-account', tabIndex: -1, 'aria-label': platformName + '账号连接', className: 'st-card st-connection' + (focusSection === 'account' ? ' st-focused' : '') },
|
|
1224
|
-
h(SettingRow, { label: platformName + '账号', description: loginOpened ? '保持登录窗口打开,完成后确认连接' : hasAuthorization ? account?.status === 'ready' ? '用于读取关注博主的内容' : '授权已保留,可检查连接状态' : '登录后才能监控与缓存消息' },
|
|
1225
|
-
h('div', { className: 'st-account-controls' }, h('span', { className: 'st-connection-state ' + accountState }, hasAuthorization ? account?.status === 'ready' ? '已登录' : '授权已保存' : loginOpened ? '等待确认' : labels[accountState] || '未连接'),
|
|
1423
|
+
h(SettingRow, { label: platformName + '账号', description: state.platforms?.find(source => source.id === platform)?.connectionRecovery ? '连接暂时不可用,后台会自动检查恢复,无需反复操作' : loginOpened ? '保持登录窗口打开,完成后确认连接' : hasAuthorization ? account?.status === 'ready' ? '用于读取关注博主的内容' : '授权已保留,可检查连接状态' : '登录后才能监控与缓存消息' },
|
|
1424
|
+
h('div', { className: 'st-account-controls' }, h('span', { className: 'st-connection-state ' + accountState }, state.platforms?.find(source => source.id === platform)?.connectionRecovery ? '自动恢复中' : hasAuthorization ? account?.status === 'ready' ? '已登录' : '授权已保存' : loginOpened ? '等待确认' : labels[accountState] || '未连接'),
|
|
1226
1425
|
!hasAuthorization ? button(loginOpened ? '我已登录,继续' : '登录' + platformName, () => act(loginOpened ? '/verify' : '/login'), 'st-primary') : null,
|
|
1227
1426
|
button('检查连接', () => act('/verify')))),
|
|
1228
1427
|
error && errorSection === 'account' ? h('p', { className: 'st-inline-error', role: 'alert' }, error) : !loginOpened && accountState !== 'ready' && account?.reason && !/请先登录|请在.*登录|请在.*验证/.test(account.reason) ? h('p', { className: 'st-caption' }, account.reason) : null),
|
|
@@ -1241,23 +1440,29 @@
|
|
|
1241
1440
|
h('p', { className: 'st-settings-footer' }, '电脑关闭或插件退出时停止采集;重新运行后会补查期间仍可见的动态。')));
|
|
1242
1441
|
|
|
1243
1442
|
return h('div', { className: 'st' + (tab === 'overview' ? ' overview' : '') + (showPreview && tab === 'overview' ? ' st-preview' : '') },
|
|
1244
|
-
h('div', { className: 'st-layout' }, h('aside', { className: 'st-aside' }, h('div', { className: 'st-brand' }, 'Social Trace'),
|
|
1245
|
-
h('
|
|
1443
|
+
h('div', { className: 'st-layout' }, h('aside', { className: 'st-aside' }, h('div', { className: 'st-brand' }, traceMark(28), 'Social Trace'),
|
|
1444
|
+
h('button', { className: 'st-new-chat' + (tab === 'chat' && (!chatSession || chatSession === 'new') ? ' active' : ''), 'aria-current': tab === 'chat' && (!chatSession || chatSession === 'new') ? 'page' : undefined, onClick: () => openChat('new') }, navIcon('new'), '新建对话'),
|
|
1445
|
+
h('nav', { className: 'st-nav', 'aria-label': 'Social Trace 导航' }, Object.entries(titles).filter(([key]) => !['chat', 'settings'].includes(key)).map(([key, title]) => {
|
|
1246
1446
|
const selected = tab === key;
|
|
1247
1447
|
return key === 'archive' ? h('details', { key, className: 'st-follow-menu', open: followOpen },
|
|
1248
|
-
h('summary', { className: selected ? 'active' : '', 'aria-controls': 'st-follow-authors', onClick: event => { event.preventDefault(); if (selected) setFollowOpen(!followOpen); else navigate('archive', { uid: '' }); } }, h('span', { className: 'st-follow-label' }, title),
|
|
1448
|
+
h('summary', { className: selected ? 'active' : '', 'aria-controls': 'st-follow-authors', onClick: event => { event.preventDefault(); if (selected) setFollowOpen(!followOpen); else navigate('archive', { uid: '' }); } }, h('span', { className: 'st-follow-label' }, navIcon(key), title),
|
|
1249
1449
|
h('span', { className: 'st-follow-fold', 'aria-hidden': true }, h('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: followOpen ? 'm6 9 6 6 6-6' : 'm9 6 6 6-6 6' })))),
|
|
1250
1450
|
h('div', { id: 'st-follow-authors', className: 'st-follow-children' }, h('button', { className: 'st-target', onClick: () => navigate('archive', { uid: '' }) }, '全部对象'),
|
|
1251
1451
|
state?.targets.map(item => h('button', { className: 'st-target', key: item.uid, 'aria-pressed': uid === item.uid,
|
|
1252
1452
|
onClick: () => navigate('archive', { uid: item.uid }) }, h(AuthorAvatar, { target: item, size: 'small' }), h('span', null, item.name))),
|
|
1253
1453
|
button('+ 添加博主', () => navigate('settings', { section: 'add-target' })))) : h('button', {
|
|
1254
1454
|
key, className: selected ? 'active' : '', onClick: () => navigate(key), 'aria-label': title, 'aria-current': selected ? 'page' : undefined,
|
|
1255
|
-
}, h('span', null, title), key === 'notices' && unread ? h('span', { className: 'st-nav-badge', 'aria-hidden': true, title: unread + ' 条未读消息' }, unread > 99 ? '99+' : unread) : null);
|
|
1455
|
+
}, navIcon(key), h('span', null, title), key === 'notices' && unread ? h('span', { className: 'st-nav-badge', 'aria-hidden': true, title: unread + ' 条未读消息' }, unread > 99 ? '99+' : unread) : null);
|
|
1256
1456
|
})),
|
|
1457
|
+
h('section', { className: 'st-chat-history', 'aria-label': '历史对话' }, h('div', { className: 'st-chat-history-head' }, h('span', null, '最近对话')),
|
|
1458
|
+
chatSessions.map(session => h('div', { key: session.id, className: 'st-chat-history-row' }, h('button', { className: tab === 'chat' && session.id === chatSession ? 'active' : '', 'aria-current': tab === 'chat' && session.id === chatSession ? 'page' : undefined, title: session.title, onClick: () => openChat(session.id) }, session.title),
|
|
1459
|
+
h('button', { className: 'st-chat-delete', 'aria-label': '删除对话:' + session.title, title: '删除对话', disabled: !!deletingChat, onClick: () => deleteChat(session) }, h('svg', { width: 14, height: 14, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.7, 'aria-hidden': true }, h('path', { d: 'M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 10v7M14 10v7' }))))),
|
|
1460
|
+
deletedChat ? h('div', { className: 'st-chat-undo', role: 'status' }, h('span', null, '已移除「' + deletedChat.title + '」'), h('button', { onClick: restoreChat }, '撤销删除')) : null),
|
|
1461
|
+
h('nav', { className: 'st-nav st-utility-nav', 'aria-label': '插件设置' }, h('button', { className: tab === 'settings' ? 'active' : '', onClick: () => navigate('settings'), 'aria-label': '连接与设置', 'aria-current': tab === 'settings' ? 'page' : undefined }, navIcon('settings'), h('span', null, '连接与设置'))),
|
|
1257
1462
|
h('div', { className: 'st-account' }, (state?.platforms || [{ id: 'weibo', name: '微博' }]).map(source =>
|
|
1258
1463
|
h('button', { key: source.id, className: 'st-sidebar-account', onClick: () => navigate('settings', { platform: source.id, section: 'account' }) }, h('span', { className: 'st-dot ' + (state && platformAccount(state, source.id)?.status === 'ready' ? 'ready' : '') }),
|
|
1259
|
-
source.name + ' · ' + (state ? labels[platformAccount(state, source.id)?.status] || '未连接' : '正在连接'))), h(IMSummary, { agent: state?.agent, compact: true, onClick: () => { setAgentTab('settings'); setAgentOpen(true); } })), h('button', { className: 'st-version-entry', onClick: () => setUpdateOpen(true), 'aria-label': '检查插件更新' }, h('span', null, state?.update?.currentVersion ? 'v' + state.update.currentVersion : '版本更新'), h('span', { className: state?.update?.updateAvailable ? 'st-update-available' : '' }, state?.update?.phase === 'applying' ? '更新中' : ['complete', 'restart-required'].includes(state?.update?.phase) ? '重启生效' : state?.update?.phase === 'overridden' ? '需确认版本' : state?.update?.updateAvailable ? '有新版本' : '检查更新'))),
|
|
1260
|
-
h('main', { className: 'st-main', ref: main },
|
|
1464
|
+
source.name + ' · ' + (source.connectionRecovery ? '自动恢复中' : state ? labels[platformAccount(state, source.id)?.status] || '未连接' : '正在连接'))), h(IMSummary, { agent: state?.agent, compact: true, onClick: () => { setAgentTab('settings'); setAgentOpen(true); } })), h('button', { className: 'st-version-entry', onClick: () => setUpdateOpen(true), 'aria-label': '检查插件更新' }, h('span', null, state?.update?.currentVersion ? 'v' + state.update.currentVersion : '版本更新'), h('span', { className: state?.update?.updateAvailable ? 'st-update-available' : '' }, state?.update?.phase === 'applying' ? '更新中' : ['complete', 'restart-required'].includes(state?.update?.phase) ? '重启生效' : state?.update?.phase === 'overridden' ? '需确认版本' : state?.update?.updateAvailable ? '有新版本' : '检查更新'))),
|
|
1465
|
+
h('main', { className: 'st-main' + (tab === 'chat' ? ' st-chat-main' : ''), ref: main },
|
|
1261
1466
|
h('header', { className: 'st-head' }, h('div', { className: 'st-page-title' }, tab === 'archive' && uid ? h('button', { className: 'st-back', 'aria-label': '返回博主列表', title: '返回博主列表', onClick: () => navigate('archive', { uid: '' }) }, h('svg', { width: 18, height: 18, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true }, h('path', { d: 'm15 6-6 6 6 6' }))) : null, h('h1', null, titles[tab])),
|
|
1262
1467
|
h('div', { className: 'st-head-tools' },
|
|
1263
1468
|
tab === 'overview' ? h('button', { className: 'st-flow-status ' + (showPreview ? 'preview' : effective.kind), title: effective.reason, onClick: () => effective.section === 'tasks' ? navigate('tasks', { uid: state.jobs.find(job => job.status === 'needs_review' && state.targets.find(target => target.uid === job.uid)?.platform === effectivePlatform)?.uid || '' }) : navigate('settings', { platform: effectivePlatform, section: effective.section }) }, h('i'), showPreview ? '未配置 · 效果预览' : effective.kind === 'ready' ? '监控中' : effective.label)
|
|
@@ -1281,7 +1486,7 @@
|
|
|
1281
1486
|
tab === 'archive' && target && readerTab === 'content' ? h('section', { id: 'st-reader-content', role: 'tabpanel', 'aria-labelledby': 'st-reader-tab-content' },
|
|
1282
1487
|
target.capture_mode !== 'pending' ? h(AuthorProgress, { state, target }) : null, content) : content,
|
|
1283
1488
|
updateOpen ? h(UpdateDialog, { initial: state?.update, onStatus: update => setState(before => ({ ...before, update })), close: () => setUpdateOpen(false) }) : null,
|
|
1284
|
-
agentOpen ? h(AgentSettings, { state, act, busy, error, initialTab: agentTab, close: () => setAgentOpen(false) }) : null,
|
|
1489
|
+
agentOpen ? h(AgentSettings, { state, act, busy, error, initialTab: agentTab, close: () => setAgentOpen(false), openChat: () => { setAgentOpen(false); navigate('chat'); } }) : null,
|
|
1285
1490
|
adding ? h(AddAuthorDialog, { state, act, busy, error, initialPlatform: tab === 'overview' ? effectivePlatform : platform, clearError: () => setError(''), close: () => setAdding(false), connect: nextPlatform => { setAdding(false); returnToAdd.current = true; navigate('settings', { platform: nextPlatform, section: 'account' }); } }) : null,
|
|
1286
1491
|
nodeSettings ? h(NodeSettings, { key: (nodeSettings.uid || nodeSettings.scope) + nodeSettings.platform, context: nodeSettings, state, act, busy, error, navigate, openSettings: openNodeSettings, close: () => setNodeSettings(null) }) : null)));
|
|
1287
1492
|
}
|
|
@@ -1307,7 +1512,7 @@
|
|
|
1307
1512
|
return { name: NAME, inject: ['slots'], apply(ctx) {
|
|
1308
1513
|
let style = document.getElementById(NAME + '-style');
|
|
1309
1514
|
if (!style) { style = document.createElement('style'); style.id = NAME + '-style'; document.head.appendChild(style); }
|
|
1310
|
-
style.textContent = CSS;
|
|
1515
|
+
style.textContent = CSS + CHAT_CSS;
|
|
1311
1516
|
ctx.slots.inject('main', function* () { yield ctx.slots.register({ name: 'main', key: NAME, order: 46 }, PanelGuard); });
|
|
1312
1517
|
ctx.slots.inject('sidebar.panellist', function* () {
|
|
1313
1518
|
yield ctx.slots.register({ name: 'sidebar.panellist', id: NAME, order: 46, label: () => 'Social Trace' },
|