omo-web 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +290 -7
- package/dist/server.js +489 -62
- package/native/web-send-file.mjs +28 -0
- package/package.json +2 -1
- package/public/licenses/entities.txt +11 -0
- package/public/licenses/highlight-js.txt +29 -0
- package/public/licenses/katex.txt +21 -0
- package/public/licenses/linkify-it.txt +22 -0
- package/public/licenses/markdown-it.txt +22 -0
- package/public/licenses/mdit-helper.txt +21 -0
- package/public/licenses/mdit-plugin-footnote.txt +22 -0
- package/public/licenses/mdit-plugin-tasklist.txt +23 -0
- package/public/licenses/mdit-plugin-tex.txt +22 -0
- package/public/licenses/mdurl.txt +45 -0
- package/public/licenses/punycode-js.txt +20 -0
- package/public/licenses/uc-micro.txt +20 -0
- package/public/styles.css +52 -2
- package/public/tool-ledger.css +20 -0
package/dist/app.js
CHANGED
|
@@ -1,7 +1,290 @@
|
|
|
1
|
-
function Dr(){if(typeof window>"u")return"zh-CN";try{return window.localStorage.getItem("omo-web-language")==="en"?"en":"zh-CN"}catch{return"zh-CN"}}var V=Dr();function n(e,t){return V==="en"?t:e}function Bs(e){try{return window.localStorage.setItem("omo-web-language",e),!0}catch{return!1}}function Ds(e=document){if(e.documentElement.lang=V,V!=="en")return;for(let t of e.querySelectorAll("[data-en]"))t.textContent=t.getAttribute("data-en");for(let t of["title","aria-label","placeholder","alt"]){let o=`data-en-${t}`;for(let s of e.querySelectorAll(`[${o}]`)){let r=s.getAttribute(o);if(r!==null)s.setAttribute(t,r)}}}function K(e,t){let o=document.getElementById(e);if(o instanceof t)return o;throw Error(n(`界面控件不存在:${e}`,`Missing interface control: ${e}`))}function u(e,t="",o=""){let s=document.createElement(e);if(t)s.className=t;if(o)s.textContent=o;return s}function fe(e,t,o=""){let s=u("button",`button ${o}`,e);return s.type="button",s.addEventListener("click",t),s}function D(e,t=""){if(e.textContent!==t)e.textContent=t;e.hidden=!t}function Tt(e,t){let o=u("label","field");return o.append(u("span","",e),t),o}function Se(e,t){let o=u("option","",e);return o.value=t,o}function Ue(e,...t){let o=u("details"),s=u("div","fold-body stack stack--tight");return s.append(...t),o.append(u("summary","",e),s),o}function Ke(e){let t=u("pre");return t.tabIndex=0,t.append(u("code","",e)),t}var Or=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),S=(e)=>Or(e)?e:{},z=(e)=>Array.isArray(e)?e:[],m=(e)=>typeof e==="string"?e:"",Y=(e)=>typeof e==="number"&&Number.isFinite(e)?e:void 0,Os=(e)=>typeof e==="string"?e:JSON.stringify(e,null,2)??"",ee=(e)=>e instanceof Error?e.message:n("发生未知错误","An unknown error occurred"),Pr=["image/png","image/jpeg","image/gif","image/webp"],zn=(e)=>Pr.some((t)=>t===e);function tt(e){let t=S(e),o=m(t.id);if(!o)return;return{id:o,name:m(t.name)||n("未命名会话","Untitled session"),cwd:m(t.cwd),updatedAt:Y(t.updatedAt)??0,archived:t.archived===!0,settled:t.settled===!0,active:t.active===!0,running:t.running===!0}}var Mo=(e)=>z(e.sessions).flatMap((t)=>{let o=tt(t);return o?[o]:[]});class ie extends Error{status;code;constructor(e,t,o){super(e);this.status=t;this.code=o}}var ye=(e)=>`/api/sessions/${encodeURIComponent(e)}`,Gn=(e)=>`/api/cli-history/${encodeURIComponent(e)}`,Zn=(e)=>`/api/cli-live/${encodeURIComponent(e)}`,$o=({kind:e,id:t})=>{switch(e){case"web":return ye(t);case"history":return Gn(t);case"live":return Zn(t)}};class Ro{token="";async request(e,t,o){let s=t!==void 0,r=await fetch(e,{method:s?"POST":"GET",signal:o,cache:"no-store",...s?{headers:{"Content-Type":"application/json","X-OmO-Token":this.token},body:JSON.stringify(t)}:{}}),l;try{let i=await r.json();l=S(i)}catch(i){if(!(i instanceof SyntaxError))throw i;throw new ie(n(`本机 Web 服务返回了无效响应(HTTP ${r.status})`,`The local Web server returned an invalid response (HTTP ${r.status}).`),r.status,"")}if(!r.ok)throw new ie(m(l.error)||n(`请求失败(HTTP ${r.status})`,`Request failed (HTTP ${r.status}).`),r.status,m(l.code));return l}action(e,t){return this.request(`${ye(e)}/actions`,t)}cliLiveAction(e,t){return this.request(`${Zn(e)}/actions`,t)}async resumeHistory(e){let t=await this.request(`${Gn(e)}/resume`,{}),o=tt(t.session);if(!o?.active)throw new ie(n("没有收到可继续的 Web 会话。请检查会话列表。","No active Web session was returned. Check the session list."),502,"");return o}async handoff(e){let t=await this.request(`${ye(e)}/handoff`,{}),o=tt(t.session),s=m(t.command);if(!o||o.id!==e||S(t.session).active!==!1||!s.trim())throw new ie(n("无法确认会话已释放,未显示启动命令。","Could not confirm that the session was released. The launch command was not shown."),502,"");return{session:o,command:s}}}var jr=new Set(["select","confirm","input","editor","question"]),yn=(e)=>m(e.id)||m(e.requestId),Qn=(e)=>Boolean(yn(e)&&jr.has(m(e.method)));function Fr(e,t){let o=[];for(let[r,l]of z(t.questions).entries()){let i=S(l),d=m(i.id);if(!d)continue;let a=u("fieldset","stack stack--tight"),c=(r+1).toLocaleString(V);if(a.append(u("legend","",m(i.header)||n(`问题 ${c}`,`Question ${c}`))),m(i.question))a.append(u("p","plain",m(i.question)));let p=[];for(let g of z(i.options)){let k=S(g),C=m(k.label);if(!C)continue;let b=u("input");b.name=`question-${r}`,b.type=i.multiSelect===!0?"checkbox":"radio",b.value=C;let y=u("label","interaction-option"),H=u("span","break",C);if(m(k.description))H.append(u("small","muted",` · ${m(k.description)}`));y.append(b,H),p.push(b),a.append(y)}let f=u("input");f.type="text",f.maxLength=12000,f.autocomplete="off",a.append(Tt(n("自填回答(选填)","Your own answer (optional)"),f)),e.append(a),o.push(()=>{let g=p.filter((C)=>C.checked).map((C)=>C.value),k=f.value.trim();return g.length||k?[d,{selected:g,...k?{text:k}:{}}]:void 0})}let s=u("textarea");return s.rows=2,s.maxLength=12000,e.append(Tt(n("补充说明(选填)","Comment (optional)"),s)),e.append(u("p","small muted",n("至少回答一题或填写补充说明。","Answer at least one question or leave a comment."))),()=>{let r=o.flatMap((i)=>{let d=i();return d?[d]:[]}),l=s.value.trim();return r.length||l?{answers:Object.fromEntries(r),...l?{comment:l}:{}}:void 0}}function js(e,t){let o=e.querySelector("[data-question-metadata]");if(!o)return;let s=[];if(t.waitForAnswer===!0)s.push(n("等待回答","Waiting for your answer"));else if(t.waitForAnswer===!1)s.push(n("异步提问","Not waiting for an answer"));let r=m(t.raisedBy);if(r)s.push(n(`提问人:${r}`,`Asked by: ${r}`));let l=Y(t.remainingMs);if(l!==void 0){let d=Math.ceil(Math.max(0,l)/1000),a=d.toLocaleString(V);s.push(n(`更新时剩余 ${a} 秒`,`${a} ${d===1?"second":"seconds"} left at last update`))}let i=Y(t.deadlineAtMs);if(i!==void 0){let d=new Date(i);if(!Number.isNaN(d.getTime())){let a=d.toLocaleString(V);s.push(n(`截止:${a}`,`Deadline: ${a}`))}}o.textContent=s.join(" · "),o.hidden=s.length===0}var Ps={Allow:n("允许","Allow"),"Allow once":n("仅允许这次","Allow once"),"Allow always":n("始终允许","Always allow"),"Allow for session":n("本会话始终允许","Allow for this session"),Deny:n("拒绝","Deny"),Block:n("阻止","Block"),"Deny with feedback":n("拒绝并说明原因","Deny with feedback")};function Vr(e,t){let o=m(e.method),s=m(e.title),r=Boolean(e.toolCallId)&&o!=="question",l=u("form","request-form"),i=o==="question"?n("待回答问题","Pending question"):r?n("工具批准","Tool approval"):n("等待你的决定","Your response is needed");l.setAttribute("aria-label",i),l.dataset.method=o;let d=u(s?"p":"h2","request-kind",o==="question"?n("Agent 提问","Agent question"):i),a=u("div","request-copy");if(s)a.append(u("h2","plain request-title",s));if(m(e.message))a.append(u("p","plain",m(e.message)));if(o==="question"){let T=u("p","small muted");T.dataset.questionMetadata="",a.append(T)}let c=S(e.remoteOrigin),p=m(c.deviceName)||m(c.deviceId);if(p)a.append(u("p","small muted break",n(`请求设备:${p}`,`Requesting device: ${p}`)));if(r){let T=m(e.toolCallId);a.append(u("p","small muted path",n(`工具调用:${T}`,`Tool call: ${T}`)))}let f=u("div","stack stack--tight request-fields"),g=u("p","notice error small");g.setAttribute("role","alert"),g.hidden=!0;let k=u("div","row request-actions"),C=!1,b=async(T)=>{if(C||l.dataset.offline==="true")return;C=!0,l.setAttribute("aria-busy","true"),D(g);for(let _ of k.querySelectorAll("button"))_.disabled=!0;try{await t(yn(e),T)}catch(_){let E=_ instanceof Error?_.message:n("发生未知错误","Unknown error");D(g,n(`未能提交:${E}`,`Could not submit: ${E}`))}finally{C=!1,l.removeAttribute("aria-busy");for(let _ of k.querySelectorAll("button"))_.disabled=l.dataset.offline==="true"}},y,H=e.secret===!0||Boolean(e.privateInput);switch(o){case"question":y=Fr(f,e);break;case"confirm":k.append(fe(n("不批准",r?"Deny":"No"),()=>void b({confirmed:!1})),fe(n("确认","Confirm"),()=>void b({confirmed:!0})));break;case"select":{let T=u("select"),_=Se(n("请选择,不会自动批准","Choose an option. Nothing is approved automatically."),"");_.disabled=!0,T.append(_);for(let E of z(e.options))if(typeof E==="string"&&E)T.append(Se(Object.hasOwn(Ps,E)?Ps[E]??E:E,E));T.value="",f.append(Tt(n("可选操作","Options"),T)),y=()=>T.value?{value:T.value}:void 0;break}case"input":case"editor":{if(H){f.append(u("p","muted",n("此输入需要在原生客户端中处理。","Respond in the native client.")));break}let T=o==="editor"?u("textarea"):u("input");if(T instanceof HTMLTextAreaElement)T.rows=5,T.value=m(e.prefill);else T.autocomplete="off";T.placeholder=m(e.placeholder),f.append(Tt(n("输入内容","Response"),T)),y=()=>({value:T.value});break}}if(!H)k.append(fe(n("取消请求","Cancel request"),()=>void b({cancelled:!0}),"button--quiet"));if(y){let T=u("button","button",n("提交回答","Submit response"));T.type="submit",k.append(T)}l.addEventListener("submit",(T)=>{if(T.preventDefault(),!y)return;let _=y();if(_)b(_);else D(g,n("请至少填写一项回答或选择一个操作。","Enter a response or choose an option."))});let R=u("div",o==="select"?"request-controls request-controls--choice":"request-controls");R.append(f,k);let M=u("div","request-body");if(M.append(a,R,g),l.append(d,M),o==="question")js(l,e);return l}class qo{root;nodes=new Map;constructor(e){this.root=e}get first(){return this.nodes.values().next().value}get firstQuestion(){return[...this.nodes.values()].find((e)=>e.dataset.method==="question")}render(e,t,o){for(let[s,r]of this.nodes)if(!e.has(s))r.remove(),this.nodes.delete(s);for(let[s,r]of e){let l=this.nodes.get(s);if(!l)l=Vr(r,o),this.nodes.set(s,l),this.root.append(l);if(r.method==="question")js(l,r);if(l.dataset.offline=String(!t),l.getAttribute("aria-busy")!=="true")for(let i of l.querySelectorAll("button"))i.disabled=!t}}reset(){this.nodes.clear(),this.root.replaceChildren()}}var Ur=new Map([["init",n("初始化","Set up list")],["start",n("请求开始","Request to start")],["done",n("请求完成","Request to complete")],["drop",n("请求放弃","Request to drop")],["rm",n("请求移除","Request to remove")],["append",n("追加","Append")],["view",n("查看","View")]]),Fs=24,Ho=(e,t)=>typeof e==="string"&&e.length<=t&&Boolean(e.trim())&&!/[\p{Cc}\p{Cf}]/u.test(e);function Kr(e){if(e.op!=="init"&&e.op!=="append")return;let t=e.list!==void 0;if(t&&(e.op!=="init"||e.items!==void 0))return;let o=t?e.list:[{items:e.items,phase:e.op==="append"?e.phase:void 0}];if(!Array.isArray(o)||o.length>Fs)return;let s=[],r=0;for(let l of o){let{phase:i,items:d}=S(l);if((t||i!==void 0)&&!Ho(i,96))return;if(!Array.isArray(d)||r+d.length>Fs||!d.every((a)=>Ho(a,240)))return;if(r+=d.length,d.length)s.push({phase:m(i)||void 0,items:d})}return s}function Vs(e){return e.length<=48&&/^[\p{L}][\p{L}\p{M}\p{N}]*(?: [\p{L}\p{N}][\p{L}\p{M}\p{N}]*)*$/u.test(e)&&(e.includes(" ")||/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(e))&&!/[a-z0-9]{21,}|\d{6,}|\b(?:password|passwd|secret|credential|token|authorization|bearer|api key|private key)\b|凭据|密钥|口令|令牌|密码/iu.test(e)&&!/^(?:bash|sh|zsh|fish|pwsh|powershell|sudo|env|git|cd|ls|cat|printf|echo|rm|cp|mv|mkdir|touch|curl|wget|ssh|scp|chmod|chown|find|grep|rg|node|bun|npm|npx|python3?|pip|uv|docker|kubectl|kubectx|systemctl|make|sed|awk|head|tail|dd|export|set)\b/iu.test(e)}function Us(e){let t=m(e.op),o=Ur.get(t),s=Kr(e),r=s?.flatMap((g)=>g.items)??[],l=r.map((g)=>g.trim()).filter(Vs),d=(t==="start"||t==="done"||t==="drop"||t==="rm")&&e.phase===void 0&&e.list===void 0&&e.items===void 0&&Ho(e.task,240)?e.task.trim():void 0,a=d&&Vs(d)?d:void 0,c=a??l[0],p=r.length.toLocaleString(V),f=(r.length-1).toLocaleString(V);return{operation:o&&s!==void 0?n(`${o} · ${p} 项`,`${o} · ${p} ${r.length===1?"task":"tasks"}`):o,preview:c&&r.length>1?n(`${c} · 另 ${f} 项`,`${c} · ${f} more`):c,batches:s??[],card:a?{heading:n("待办变更","Task changes"),titles:[a],total:1}:l.length?{heading:t==="append"?n("新增待办","Add tasks"):n("提交的待办","Tasks submitted"),titles:l,total:r.length}:void 0}}var _o={inspect:"M7 3h6l4 4v6l-4 4H7l-4-4V7Zm8 12 6 6",modify:"m3 15 12-12h3l3 3v3L9 21H3Zm10-10 6 6",terminal:"M3 5h14l4 4v10H7l-4-4Zm4 4 3 3-3 3m6 0h4",memory:"M8 5V3m8 2V3M8 21v-2m8 2v-2M5 5h11l3 3v11H8l-3-3Zm4 4h4m-4 5h6",todo:"M6 3h10l3 3v12l-3 3H5V4Zm2 6 2 2 4-4m-6 9h7",execution:"m8 6-6 6 6 6m8-12 6 6-6 6m-3-14-2 16",context:"M8 4H6L3 7v10l3 3h2m8-16h2l3 3v10l-3 3h-2M8 9h8m-8 6h8",agent:"M8 3h4l3 3v4l-3 3H8l-3-3V6ZM2 21v-3l3-3h10l3 3v3m0-18 4 4v5",web:"M8 3h8l5 5v8l-5 5H8l-5-5V8Zm-5 9h18m-9-9-3 5v8l3 5 3-5V8Z",unknown:"M7 3h10l4 4v10l-4 4H7l-4-4V7Zm2 5 2-1h2l2 2v2l-3 2v1m0 3v.1"},zr=new Map([["create",[n("新建","Create"),n("记忆条目","Memory entry")]],["str_replace",[n("替换","Replace"),n("正文","Content")]],["insert",[n("插入","Insert"),n("正文","Content")]],["delete",[n("删除","Delete"),n("记忆条目","Memory entry")]],["rename",[n("重命名","Rename"),n("名称","Name")]],["update_description",[n("更新描述","Update description"),n("描述","Description")]],["apply_patch",[n("应用补丁","Apply patch"),n("记忆补丁","Memory patch")]]]),Gr=new Map([["js","JavaScript"],["javascript","JavaScript"],["ts","TypeScript"],["typescript","TypeScript"],["py","Python"],["python","Python"],["shell","Shell"],["bash","Bash"],["powershell","PowerShell"]]);function Ks(e,t){if(e==="eval"&&t.action!==void 0&&t.action!=="run")return{};let o=e==="eval"?t.language==="js"?"JavaScript":t.language==="py"?"Python":void 0:Gr.get(m(t.language).toLowerCase());return{preview:o,source:m(t.code)||void 0,facts:o?[[n("语言","Language"),o]]:void 0}}var Jn=/^(?:sk-|gh[pousr]_|github_pat_|xox[baprs]-|AKIA[A-Z0-9]{16}$)/iu,Io=(e)=>typeof e==="string"&&/^[a-z][a-z0-9_-]{0,47}$/u.test(e)&&!Jn.test(e);function Zr(e){let t=[];for(let[o,s]of[[n("类别","Category"),e.category],[n("角色","Role"),e.subagent_type]])if(Io(s))t.push(`${o} ${s}`);if(typeof e.run_in_background==="boolean")t.push(e.run_in_background?n("后台","Background"):n("前台","Foreground"));return t}var Zs=24,Qr=16384,_t=(e)=>typeof e==="string"&&e.length<=Qr&&/\S/u.test(e);function Yn(e,t){if(Array.isArray(e)&&e.length>0&&e.length<=Zs&&e.every(t))return e.length}function Qs(e,t){if(e===void 0&&Io(t))return n(`角色 ${t}`,`Role ${t}`);if(t===void 0&&Io(e))return n(`类别 ${e}`,`Category ${e}`)}function Yr(e){if(e.prompt!==void 0||!Array.isArray(e.tasks)||!e.tasks.length||e.tasks.length>Zs)return;let t=[];for(let o of e.tasks){let s=S(o),r=s.category===void 0?e.category:s.category,l=s.subagent_type===void 0?e.subagent_type:s.subagent_type,i=Qs(r,l);if(!i||!_t(s.prompt))return;t.push({route:i,prompt:s.prompt})}return t}var Jr=new Map([["status",n("状态","Status")],["tail",n("最近输出","Recent output")],["full",n("完整输出","Full output")]]);function Wt(e){if(typeof e!=="string"||e.length>65536)return;if(!e.length)return 0;return(e.match(/\r\n|[\n\r]/gu)?.length??0)+(e.endsWith(`
|
|
2
|
-
`)||e.endsWith("\r")?0:1)}function bn(e){let t=e.toLocaleString(V);return n(`${t} 行`,`${t} ${e===1?"line":"lines"}`)}function zs(e,t,o){if(e==="apply_patch"){let i=(m(o)||m(t.patch)||m(t.patchText)).trim();if(i.length>65536||!/^\*\*\* Begin Patch\r?\n/u.test(i)||!/\n\*\*\* End Patch$/u.test(i))return[];let d=[];for(let[a,c]of[["Add",n("提交新增","Add")],["Update",n("提交更新","Update")],["Delete",n("提交删除","Delete")]]){let p=[...i.matchAll(new RegExp(`^\\*\\*\\* ${a} File: [^\\r\\n]+`,"gmu"))].length,f=p.toLocaleString(V);if(p)d.push([c,n(`${f} 个文件`,`${f} ${p===1?"file":"files"}`)])}return d}if(e==="write"||e==="write_file"){let i=Wt(t.content);return i===void 0?[]:[[n("提交文本","Submitted text"),bn(i)]]}let s=Wt(t.oldText??t.old_string),r=Wt(t.newText??t.new_string),l=[];if(s!==void 0)l.push([n("替换前","Before replacement"),bn(s)]);if(r!==void 0)l.push([s===void 0?n("提交文本","Submitted text"):n("替换后","After replacement"),bn(r)]);return l}function Gs(e){let t=m(e),o=/^https?:\/\/([^/?#\\]+)/iu.exec(t)?.[1];if(!o||o.includes("@")||/[\s\\\p{Cc}\p{Cf}]/u.test(t))return;let s=URL.parse(t);if(!s||s.username||s.password)return;let r=s.hostname.replace(/\.$/u,"");if(r.length>253||!/[a-z]/iu.test(r))return;if(!r.split(".").every((l)=>/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/iu.test(l)&&!Jn.test(l)))return;return r}function Lt(e){let t=m(e);if(!t||t.length>512||!/^[\p{L}\p{M}\p{N}_.~ /\\-]+$/u.test(t)||t.startsWith("-"))return"";if(t==="."||t===".."||t==="~")return t;let o=t.split(/[/\\]/).filter(Boolean);if(o.some((s)=>Jn.test(s)))return"";if(!/[/\\]/.test(t)&&!/^(?:[\p{L}_][\p{L}\p{M}\p{N}_-]{0,23}|[\p{L}\p{N}_-]*\.[\p{L}\p{N}]{1,10})$/u.test(t))return"";return o.length>3?`…/${o.slice(-3).join("/")}`:`${t.startsWith("/")?"/":""}${o.join("/")}`}function Wo(e,t){let o=S(t),{path:s,file_path:r,filePath:l}=o,i=e.toLowerCase();switch(i){case"read":case"read_file":return{kind:"inspect",label:n("读取文件","Read file"),group:"Read",target:Lt(s??r??l)};case"grep":return{kind:"inspect",label:n("搜索内容","Search contents"),group:"Grep",target:Lt(s)};case"search":return{kind:"inspect",label:n("搜索内容","Search contents"),target:Lt(s)};case"find":return{kind:"inspect",label:n("查找文件","Find files"),group:"Find",target:Lt(s)};case"glob":return{kind:"inspect",label:n("查找文件","Find files"),group:"Glob",target:Lt(s)};case"ls":case"list":case"list_dir":case"list_directory":case"list_files":return{kind:"inspect",label:n("列出目录","List directory"),group:"List",target:Lt(s)};case"tool_search":return{kind:"inspect",label:n("查找工具","Find tools"),group:"Tool Search"};case"edit":case"edit_file":case"multiedit":case"apply_patch":return{kind:"modify",label:n("编辑文件","Edit file"),target:Lt(s??r??l),facts:zs(i,o,t)};case"write":case"write_file":return{kind:"modify",label:n("写入文件","Write file"),target:Lt(s??r??l),facts:zs(i,o,t)};case"bash":case"shell":case"powershell":return{kind:"terminal",label:i==="powershell"?"PowerShell":i==="shell"?"Shell":"Bash",operation:n("运行命令","Run command"),command:m(o.command)};case"bash_output":return{kind:"terminal",label:"Bash",operation:n("读取输出","Read output")};case"kill_bash":return{kind:"terminal",label:"Bash",operation:n("终止命令","Stop command")};case"memory":{let[d,a]=zr.get(m(o.command))??[];return{kind:"memory",label:"Memory",operation:d,facts:a?[[n("变更对象","Change target"),a]]:void 0}}case"todo":case"todowrite":{let d=Us(o);return{kind:"todo",label:"Todo",operation:d.operation,preview:d.preview,todo:d}}case"eval":{let d=m(o.action),a=d==="peek"?n("查看执行","View run"):d==="list"?n("列出执行","List runs"):d==="stop"?n("停止执行","Stop run"):d==="run"||o.action===void 0?n("执行脚本","Run script"):void 0;return{kind:"execution",label:"Eval",operation:a,...Ks(i,o),group:a&&d!=="stop"&&(o.reset===void 0||o.reset===!1)?"Eval":void 0}}case"ctx_execute":case"ctx_execute_file":return{kind:"context",label:"Ctx Execute",operation:n("执行脚本","Run script"),group:"Ctx Execute",...Ks(i,o)};case"ctx_search":{let d=Yn(o.queries,_t);return{kind:"context",label:"Ctx Search",operation:n("搜索上下文","Search context"),group:"Ctx Search",facts:d===void 0?void 0:[[n("查询","Queries"),n(`${d.toLocaleString(V)} 条`,d.toLocaleString(V))]]}}case"ctx_batch":{let d=Yn(o.commands,_t),a=Yn(o.queries,_t),c=d!==void 0&&a!==void 0?{preview:n(`提交 ${d.toLocaleString(V)} 条命令 · ${a.toLocaleString(V)} 条查询`,`Submitted ${d.toLocaleString(V)} ${d===1?"command":"commands"} · ${a.toLocaleString(V)} ${a===1?"query":"queries"}`),facts:[[n("命令","Commands"),n(`${d.toLocaleString(V)} 条`,d.toLocaleString(V))],[n("查询","Queries"),n(`${a.toLocaleString(V)} 条`,a.toLocaleString(V))]]}:void 0;return{kind:"context",label:"Ctx Batch",operation:n("批量查询","Batch search"),group:"Ctx Batch",...c}}case"ctx_index":{let d=[[o.path,n("本机文件","Local file")],[o.content,n("提交文本","Submitted text")],[o.url,n("网页地址","Web address")]].filter(([c])=>_t(c)),a=d.length===1?m(d[0]?.[1]):"";return{kind:"context",label:"Ctx Index",operation:n("收录上下文","Index context"),facts:a?[[n("来源类型","Source type"),a]]:void 0}}case"ctx_purge":{let d=[o.project===!0&&n("项目","Project"),m(o.session)&&n("指定会话","Selected session"),m(o.source)&&n("指定来源","Selected source")].filter(Boolean),a=d.length===1?m(d[0]):"";return{kind:"context",label:"Ctx Purge",operation:n("清除上下文","Clear context"),facts:a?[[n("清除范围","Scope"),a]]:void 0}}case"task":{let d=Yr(o),a=d?.map((g)=>g.route),c=o.tasks===void 0?Zr(o):void 0,p=o.tasks===void 0&&Qs(o.category,o.subagent_type)?m(o.prompt):"",f=a?.length.toLocaleString(V);return{kind:"agent",label:"Agent",operation:n("派发任务","Dispatch tasks"),preview:c?.join(" · ")??(a&&n(`提交 ${f} 项任务`,`Submitted ${f} ${a.length===1?"task":"tasks"}`)),dispatchRoutes:a,agentRouting:c,agentPrompts:d?.map((g)=>g.prompt)??(p.trim()?[p]:void 0)}}case"task_output":return{kind:"agent",label:"Agent",operation:n("查看任务","View task"),scope:Jr.get(m(o.mode))};case"task_send":return{kind:"agent",label:"Agent",operation:n("发送消息","Send message")};case"web_search":case"mcp_tinyfish_search":return{kind:"web",label:"Web",operation:n("网页搜索","Search the web"),group:"Web Search",facts:_t(o.query)?[[n("查询","Queries"),n("1 条","1")]]:void 0};case"webfetch":case"mcp_tinyfish_fetch_content":{let d=Gs(o.url),a=Yn(o.urls,_t),c=a===1&&Array.isArray(o.urls)?Gs(o.urls[0]):void 0,p=d??c;return{kind:"web",label:"Web",operation:n("读取网页","Read webpage"),group:"Web Fetch",preview:p,facts:[...p?[[n("主机","Host"),p]]:[],...a===void 0?[]:[[n("地址","Addresses"),n(`${a.toLocaleString(V)} 个`,a.toLocaleString(V))]]]}}default:return{kind:"unknown",label:/^[\p{L}\p{N}_.:-]{1,80}$/u.test(e)&&/\p{L}/u.test(e)&&!e.split(/[.:]/u).some((a)=>Jn.test(a)||/^(?:token|password|authorization|bearer|api[_-]?key)$/iu.test(a))?e:n("工具调用","Tool call")}}}var Xr=4;function Ys(e,t,o=t.length,s){let r=t.slice(0,Xr),l=o-r.length,i=l.toLocaleString(V);return{heading:e,rows:r,note:[s,l>0&&n(`其余 ${i} 项见详情`,`${i} more in details`)].filter(Boolean).join(" · ")}}function Js(e,t){if(!t)return[];let o=Wt(t);return[[e,o===void 0?n("已附","Included"):bn(o)]]}function Xs(e){let t=e.toLocaleString(V);return n(`${t} 行文本`,`${t} ${e===1?"line":"lines"} of text`)}function No(e){let t=n("可见输出","Visible output"),o=n("已收到文本","Text received");if(typeof e==="string"){let d=Wt(e);return e.length?[[t,d===void 0?o:Xs(d)]]:[]}let s=0,r=0;for(let d of z(e)){let a=S(d);if(a.type==="text"&&typeof a.text==="string"){let c=Wt(a.text);if(c===void 0)return[[t,o]];s+=c}else if(a.type==="image"||a.type==="image_placeholder"||a.type==="imagePlaceholder")r++}let l=r.toLocaleString(V),i=[s&&Xs(s),r&&n(`${l} 项图片`,`${l} ${r===1?"image":"images"}`)].filter(Boolean).join(" · ");return i?[[t,i]]:[]}function Qt(e,t,o){if(t.length)return{heading:e,facts:t,note:o}}function ea(e){let t=e.trim().replace(/\s+/gu," "),o=/^[\s\S]{1,140}/u.exec(t)?.[0]??"";return o.length<t.length?`${o}…`:o}function ei(e,t){let o=e.facts??[];switch(e.kind){case"todo":{let s=e.todo?.card;if(s)return Ys(s.heading,s.titles,s.total);return}case"agent":{let s=e.dispatchRoutes??e.agentRouting;if(s?.length){let r=e.agentPrompts;return{...Ys(n("派发配置","Dispatch settings"),s),prompts:r&&{previews:r.slice(0,2).map(ea),count:r.length}}}if(e.scope)return Qt(n("任务读取","Task lookup"),[[n("范围","Scope"),e.scope]]);return}case"terminal":return Qt(n("终端记录","Terminal log"),[...Js(n("命令","Command"),e.command),...No(t)]);case"execution":case"context":return Qt(e.kind==="execution"?n("脚本记录","Script run"):n("上下文请求","Context request"),[...o,...Js(n("源码","Source code"),e.source),...No(t)]);case"modify":return Qt(n("提交内容","Submitted changes"),o);case"memory":return Qt(n("记忆变更","Memory changes"),o,n("路径与内容按需查看","Open details to inspect paths and content"));case"web":return Qt(n("网页请求","Web request"),[...o,...No(t)]);case"inspect":case"unknown":return;default:return e.kind}}function Bo(e){let t=u("ul","tool-card-rows");return t.append(...e.map((o)=>u("li","",o))),t}function Do(e,t){let o=(e+1).toLocaleString(V);return t>1?n(`任务 ${o} · 提示词`,`Task ${o} prompt`):n("提示词","Prompt")}function ti(e){let t=u("div","tool-card-content");if(t.append(u("p","tool-card-heading",e.heading)),"rows"in e)t.append(Bo(e.rows));else{let o=u("dl","tool-card-facts");for(let[s,r]of e.facts){let l=u("div","tool-card-fact");l.append(u("dt","",s),u("dd","",r)),o.append(l)}t.append(o)}if(e.prompts){let{previews:o,count:s}=e.prompts,r=u("div","tool-card-prompts");if(o.forEach((l,i)=>{let d=u("div");d.append(u("p","tool-card-note",Do(i,s)),u("p","tool-card-prompt",l)),r.append(d)}),s>o.length){let l=s-o.length,i=l.toLocaleString(V);r.append(u("p","tool-card-note",n(`其余 ${i} 条提示词见详情`,`${i} more ${l===1?"prompt":"prompts"} in details`)))}t.append(r)}if(e.note)t.append(u("p","tool-card-note",e.note));return t}class Oo{node=u("details","tool-group");body=u("ol","tool-group-body");count=u("span","tool-group-count");kinds=u("span","tool-group-kinds");paths=u("span","tool-group-paths");rows=new WeakMap;constructor(){let e=u("summary","tool-group-summary");e.append(this.count," ",this.kinds," ",this.paths),this.node.append(e,this.body)}update(e){let t=new Map,o=new Set,s=!0,r=this.body.firstElementChild;for(let c of e){let p=c.firstElementChild;if(p instanceof HTMLDetailsElement){let g=p.dataset.groupTool;if(g)t.set(g,(t.get(g)??0)+1);s&&=p.dataset.toolKind==="inspect";let k=p.querySelector(":scope > .tool-summary .tool-target:not([hidden])")?.textContent;if(k&&o.size<2)o.add(k)}let f=this.rows.get(c);if(!f)f=u("li","tool-group-row"),this.rows.set(c,f);if(c.parentElement!==f||f.parentElement!==this.body){if(c.contains(document.activeElement)||p instanceof HTMLDetailsElement&&p.open)this.node.open=!0}if(c.parentElement!==f)f.append(c);if(f!==r)this.body.insertBefore(f,r);r=f.nextElementSibling}while(r){let c=r.nextElementSibling;r.remove(),r=c}let l=s?n("探查工具","File and tool lookups"):n("工具调用","Tool calls"),i=e.length.toLocaleString(V),d=n(`${l} · ${i} 项成功`,`${l} · ${i} succeeded`);if(this.count.textContent!==d)this.count.textContent=d;let a=[...t].map(([c,p])=>`${c} ×${p.toLocaleString(V)}`);if(this.kinds.textContent!==a.join(" "))this.kinds.replaceChildren(...a.flatMap((c,p)=>[...p?[" "]:[],u("span","tool-group-kind",c)]));if(this.paths.textContent!==[...o].join(" "))this.paths.replaceChildren(...[...o].flatMap((c,p)=>[...p?[" "]:[],u("code","tool-group-path path",c)]));return this.paths.hidden=!o.size,this.node}}var Po={inspect:n("探查结果","Inspection results"),modify:n("文件变更回执","File change receipt"),terminal:n("终端输出","Terminal output"),todo:n("待办工具回执","Todo receipt"),memory:n("记忆工具回执","Memory receipt"),execution:n("执行结果","Execution results"),context:n("上下文结果","Context results"),agent:n("任务工具输出","Agent tool output"),web:n("网页输出","Web output"),unknown:n("输出","Output")};function ta(e){let t=u("div","tool-scene tool-terminal"),o=Ke(""),s=o.querySelector("code"),r=u("div","tool-terminal-input");return o.classList.add("tool-command-preview"),o.setAttribute("aria-label",n("提交的命令","Submitted command")),r.append(u("span","tool-scene-key",n("命令","Command")),o),t.append(r,e),{node:t,update(l){if(r.hidden=!l.command,s)D(s,l.command)}}}function oi(e,t){let o=u("details",`tool-receipt tool-${e}-receipt`);return o.append(u("summary","",n("查看原始回执","View raw receipt")),t),o}function na(e){let t=u("div","tool-scene tool-todo"),o=u("div","tool-todo-list"),s=u("div","tool-todo-board");return o.append(u("p","tool-scene-key",n("提交的待办","Tasks submitted")),s),t.append(o,oi("todo",e)),{node:t,update(r){let l=r.todo?.batches??[];o.hidden=!l.length;let i=1;s.replaceChildren(...l.map((d)=>{let a=u("div","tool-todo-lane stack stack--tight"),c=u("ol");if(c.start=i,i+=d.items.length,c.append(...d.items.map((p)=>u("li","",p))),d.phase)a.append(u("p","small",d.phase));return a.append(c),a}))}}}function ni(e,t){let o=u("div",`tool-scene tool-code-desk tool-code-desk--${t?"context":"execution"}`),s=u("details","tool-source"),r=Ke(""),l=r.querySelector("code");return s.append(u("summary","",n("查看原始代码","View source code")),r),o.append(s,e),{node:o,update(i){if(s.hidden=!i.source,l)D(l,i.source)}}}function si(e,t){switch(e){case"terminal":return ta(t);case"todo":return na(t);case"memory":{let o=u("div","tool-scene tool-memory-audit");return o.append(u("p","tool-memory-note small muted",n("记忆路径与内容默认隐藏。","Memory paths and content are hidden by default.")),oi("memory",t)),{node:o}}case"execution":return ni(t,!1);case"context":return ni(t,!0);case"inspect":case"modify":{let o=u("div",`tool-scene tool-file tool-file--${e}`);return o.append(t),{node:o}}case"agent":{let o=u("div","tool-scene tool-agent"),s=u("p","tool-agent-scope small muted"),r=u("div","stack stack--tight"),l=u("div","stack stack--tight"),i=[];return l.hidden=!0,o.append(s,r,l,t),{node:o,update(d){if(D(s,d.scope&&n(`范围:${d.scope}`,`Scope: ${d.scope}`)),r.hidden=!d.dispatchRoutes,d.dispatchRoutes)r.replaceChildren(u("p","tool-scene-key",n("派发配置","Dispatch settings")),Bo(d.dispatchRoutes));let a=d.agentPrompts??[];if(a.length===i.length&&a.every((c,p)=>c===i[p]))return;i=a,l.hidden=!a.length,l.replaceChildren(...a.flatMap((c,p)=>{let f=Do(p,a.length),g=Ke(c);return g.classList.add("tool-agent-prompt"),g.setAttribute("aria-label",f),[u("p","tool-scene-key",f),g]}))}}}case"web":{let o=u("div","tool-scene tool-web");return o.append(t),{node:o}}case"unknown":return;default:return e}}var ii={running:{label:n("运行中","Running"),icon:"M12 4a8 8 0 1 0 8 8"},success:{label:n("成功","Succeeded"),icon:"m5 12 4 4L19 6"},error:{label:n("失败","Failed"),icon:"m6 6 12 12M18 6 6 18"},unknown:{label:n("未见结果","No result"),icon:"M6 12h12"},incomplete:{label:n("结果不完整","Incomplete result"),icon:"M12 4v10m0 5v1"}},ri=n("工具输出","Tool output"),Yt=(e)=>e?.truncated===!0||e?.partial===!0,ai=(e)=>typeof e.content==="string"||Array.isArray(e.content);function oa(e,t,o){if(o?.isError===!0||m(o?.errorMessage)||t?.stage==="error")return"error";if(Yt(e)||Yt(o)||o?.isError===!1&&!ai(o))return"incomplete";if(o?.isError===!1||t?.stage==="done")return"success";return!o&&t?.stage==="running"?"running":"unknown"}function jo(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.append(e),t}class Fo{renderOutputPart;node=u("article","message message--tool");details=u("details","tool-details");label=u("span","tool-label");target=u("span","tool-target path");operation=u("span","tool-operation small muted");preview=u("span","tool-preview small muted");compactFacts=u("span","tool-card-inline small muted");status=u("span","tool-state-text");icon=document.createElementNS("http://www.w3.org/2000/svg","path");kindIcon=document.createElementNS("http://www.w3.org/2000/svg","path");identity=u("p","tool-name small muted",n("工具名:","Tool name: "));name=u("code");args=Ke("");argsSection=u("div","stack stack--tight");rawArgs=u("details","tool-raw-args");output=u("div","tool-output stack stack--tight");outputLabel=u("p","small muted",Po.unknown);empty=u("p","muted small");outputSection=u("div","tool-result stack stack--tight");body=u("div","fold-body stack stack--tight");card;cardKey;scene;lastName;lastArgs;lastOutput;group;constructor(e){this.renderOutputPart=e;let t=u("summary","tool-summary"),o=u("span","tool-chevron");o.setAttribute("aria-hidden","true");let s=u("span","tool-subject"),r=jo(this.kindIcon);r.classList.add("tool-kind-icon"),this.compactFacts.hidden=!0,s.append(r,this.label,this.operation,this.target,this.preview,this.compactFacts);let l=u("span","tool-state");l.append(jo(this.icon),this.status),t.append(o,s,l),this.identity.append(this.name),this.rawArgs.append(u("summary","",n("原始参数","Raw arguments"))),this.argsSection.append(u("p","small muted",n("调用参数","Call arguments"))),this.output.tabIndex=0,this.output.setAttribute("role","region"),this.output.setAttribute("aria-label",ri),this.outputSection.append(this.outputLabel,this.output,this.empty),this.body.append(this.identity),this.details.append(t,this.body),this.node.append(this.details)}get open(){return this.details.open}set open(e){this.details.open=e}groupWith(e){return this.group??=new Oo,this.group.update(e)}updateCard(e,t){let o=ei(e,t),s=Boolean(e.preview&&!e.dispatchRoutes),r=o&&JSON.stringify([e.kind,o,s]);if(this.cardKey===r)return;if(this.cardKey=r,this.card?.remove(),this.card=void 0,D(this.compactFacts,o&&"facts"in o?o.facts.map(([a,c])=>`${a} ${c}`).join(" · "):""),!o)return;let l=u("div","tool-card-preview");if(s)l.dataset.repeatRecap="";let i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",e.kind==="todo"?"m3 12 6 6L21 6":_o[e.kind]);let d=jo(i);d.classList.add("tool-card-emblem"),l.append(d,ti(o)),this.node.append(l),this.card=l}update(e,t,o){let s=m(e?.name)||t?.name||m(o?.toolName),r=e?.arguments===void 0?t?.args:e.arguments,l=o?.content??t?.output,i=oa(e,t,o),d=i==="unknown"&&o?n("状态未知","Unknown status"):ii[i].label,a=Wo(s,r),{kind:c,label:p,operation:f,target:g,preview:k,group:C}=a,b=this.details.dataset.toolKind!==c;if(b){this.details.dataset.toolKind=c,this.kindIcon.setAttribute("d",_o[c]);let M=Po[c];if(this.outputLabel.textContent=M,this.output.setAttribute("aria-label",c==="unknown"?ri:M),this.scene?.node.remove(),this.outputSection.remove(),this.argsSection.remove(),this.rawArgs.remove(),this.scene=si(c,this.outputSection),this.body.classList.toggle("tool-generic",!this.scene),this.scene)this.rawArgs.append(this.args),this.body.append(this.scene.node,this.rawArgs);else this.argsSection.append(this.args),this.body.append(this.argsSection,this.outputSection)}if(this.details.dataset.groupTool!==C)if(C)this.details.dataset.groupTool=C;else delete this.details.dataset.groupTool;let y=this.details.dataset.state;if(y!==i)if(this.details.dataset.state=i,this.icon.setAttribute("d",ii[i].icon),i==="running"&&this.scene)this.details.dataset.toolMotion="entry";else if(y==="running"&&(i==="success"||i==="error"))this.details.dataset.toolMotion="settlement";else delete this.details.dataset.toolMotion;if(this.status.textContent!==d)this.status.textContent=d;if(this.label.textContent!==p)this.label.textContent=p;D(this.operation,f),D(this.target,g),D(this.preview,k),D(this.name,c==="unknown"||s.toLowerCase()===p.toLowerCase()?"":s),this.identity.hidden=this.name.hidden;let H=b||this.lastArgs!==r||this.lastName!==s;if(H||this.lastOutput!==l)this.updateCard(a,l);if(H){this.scene?.update?.(a),this.argsSection.hidden=this.rawArgs.hidden=r===void 0;let M=this.args.firstElementChild,T=Os(r);if(M&&M.textContent!==T)M.textContent=T;this.lastArgs=r,this.lastName=s}if(this.lastOutput!==l){let M=typeof l==="string"?[{type:"text",text:l}]:z(l),T=this.output.scrollTop,_=this.output.scrollLeft;this.output.replaceChildren(...M.flatMap((E)=>{let x=this.renderOutputPart(S(E));if(x?.tagName==="PRE")x.removeAttribute("tabindex");return x??[]})),this.output.scrollTop=T,this.output.scrollLeft=_,this.lastOutput=l}this.output.hidden=!this.output.childElementCount,this.outputLabel.hidden=this.output.hidden,this.empty.hidden=!this.output.hidden;let R=i==="running"?n("等待工具输出…","Waiting for tool output…"):i==="unknown"&&!o?n("没有可见的工具结果。","No tool result is available."):n("无可显示的输出。","No output to display.");if(this.empty.textContent!==R)this.empty.textContent=R}}function li({entries:e,start:t,liveKey:o,tools:s,calls:r,results:l}){let i=new Map,d=!1,a=[],c=()=>{if(a.length>1)for(let p of a)i.set(m(p.id),a);a=[]};for(let p=t;p<e.length;p++){let f=e[p],g=f?.message;if(!f||!g||g.role!=="assistant"||!d||f.key===o||g.streaming===!0||Yt(g)||m(g.errorMessage)||g.stopReason!==void 0&&g.stopReason!=="toolUse"&&g.stopReason!=="stop"){if(c(),g?.role==="user")d=!Yt(g);continue}let k=z(g.content).map(S);if(!k.length){c();continue}let C=new Set(k.flatMap((y)=>y.type==="toolCall"?m(y.id)||[]:[])),b=new Map;for(let y=e[p+1]?.message;y?.role==="toolResult";y=e[p+1]?.message){let H=m(y.toolCallId);if(!C.has(H)||b.has(H)||l.get(H)!==p+1)break;b.set(H,y),p++}for(let y of k){let H=m(y.id),R=m(y.name).toLowerCase(),M=b.get(H),T=s.get(H),_=T?.stage,E=y.arguments===void 0?T?.args:y.arguments;if(y.type==="toolCall"&&r.get(H)===1&&Wo(R,E).group&&!Yt(y)&&M?.isError===!1&&ai(M)&&!Yt(M)&&!m(M.errorMessage)&&(!m(M.toolName)||m(M.toolName).toLowerCase()===R)&&(_===void 0||_==="done"))a.push(y);else c()}}return c(),i}function Xn(e){if(!e)return;return e.closest(".tool-group:not([open])")?.querySelector(":scope > summary")??e}function Vo(e,t){let o=/`([^`\n]+)`|\*\*([^*\n]+)\*\*/g,s=0;for(let r of t.matchAll(o)){let l=r.index??0;e.append(t.slice(s,l),r[1]?u("code","",r[1]):u("strong","",r[2])),s=l+r[0].length}e.append(t.slice(s))}var di=new WeakMap;function sa(e,t=u("div","prose")){let o=di.get(t);if(o?.text===e)return t;let s=o&&e.startsWith(o.text.slice(0,o.end))?o:void 0,r=document.createDocumentFragment(),l=s?.end??0,i=l,d=s?.children??0,a=[],c=null,p="",f=null,g=()=>{if(a.length){let C=u("p");Vo(C,a.join(`
|
|
3
|
-
`)),r.append(C),a=[]}f=null},k=()=>{if(l<=e.length)i=l,d=(s?.children??0)+r.childElementCount};for(let C of e.slice(l).split(`
|
|
4
|
-
`))if(l+=C.length+1,c)if(C.trim()===p)r.append(Ke(c.join(`
|
|
5
|
-
`
|
|
6
|
-
`)));g();while(t.childElementCount>(s?.children??0))t.lastElementChild?.remove();return t.append(r),di.set(t,{text:e,end:i,children:d}),t}function fi(e){return typeof e==="string"?[{type:"text",text:e}]:z(e)}function hi(e,t,o){if(t==="tool"&&e.type!=="text"&&e.type!=="image"&&e.type!=="image_placeholder"&&e.type!=="imagePlaceholder")return;switch(e.type){case"text":{let s=m(e.text);if(!s)return;return t==="markdown"?sa(s,o):t==="tool"?Ke(s):u("p","plain",s)}case"thinking":{let s=m(e.thinking);if(!s)return;let r=o?.querySelector(".plain");if(o&&r)return r.textContent=s,o;return Ue(n("思考过程","Thinking"),u("p","plain muted",s))}case"image":{let s=m(e.data);if(!zn(e.mimeType)||!/^[A-Za-z0-9+/]+={0,2}$/.test(s))return u("p","small muted",n("图片内容不可用","Image unavailable"));let r=u("img");return r.alt=t==="tool"?n("工具输出图片","Tool output image"):n("消息图片","Image attached to message"),r.loading="lazy",r.src=`data:${e.mimeType};base64,${s}`,r}case"image_placeholder":case"imagePlaceholder":return u("p","small muted",n("此图片未包含在会话快照中","This image is not included in the session snapshot."));default:{let s=m(e.type)||n("未知类型","Unknown type");return Object.keys(e).length?u("p","small muted",n(`未展开的内容 · ${s}`,`Content not displayed · ${s}`)):void 0}}}var ze=(e)=>m(e.role),Nt=(e)=>{if(ze(e)==="toolResult"&&m(e.toolCallId))return`result:${m(e.toolCallId)}`;if(m(e.id))return`id:${m(e.id)}`;let t=Y(e.timestamp);return t===void 0?"":`${ze(e)}:${t}`};function ia(e){let t=Y(e);if(t===void 0)return;let o=new Date(t);if(!Number.isFinite(o.getTime()))return;let s=u("time","numerical",o.toLocaleTimeString(V,{hour:"2-digit",minute:"2-digit"}));return s.dateTime=o.toISOString(),s.title=o.toLocaleString(V),s}function ra(e,t,o,s){let r=ze(e),l=s?.role===r?s:void 0,i=r==="user"||r==="assistant",d=l?.node??u("article",i?`message message--${r}`:"message"),a=l?.speaker??u("span","speaker"),c=r==="assistant"?t?n("助手 · 正在生成","Assistant · Writing"):n("助手","Assistant"):r==="user"?n("你","You"):r==="bashExecution"?n("命令输出","Command output"):n("会话记录","Session record");if(a.textContent!==c)a.textContent=c;let p=l?.body??u("div","message-body"),f=l?.timestamp===e.timestamp?l?.time:ia(e.timestamp),g=l?.header??u("header");if(!l){if(i){let N=document.createElementNS("http://www.w3.org/2000/svg","svg"),O=document.createElementNS("http://www.w3.org/2000/svg","path");N.setAttribute("viewBox","0 0 24 24"),N.setAttribute("fill","currentColor"),N.setAttribute("aria-hidden","true"),N.setAttribute("focusable","false"),O.setAttribute("fill-rule","evenodd"),O.setAttribute("d",r==="user"?"M3 6 6 3h15v15l-3 3H3V6Zm9 1-1.4 1.4 2.6 2.6H7v2h6.2l-2.6 2.6L12 17l5-5-5-5Z":"M12 2 22 12 12 22 2 12 12 2Zm0 3-7 7 7 7 7-7-7-7Zm0 4 3 3-3 3-3-3 3-3Z"),N.append(O);let P=u("span","message-identity");a.style.overflowWrap="normal",P.append(N,a),g.append(P)}else g.append(a);d.append(p)}if(l?.time!==f){if(l?.time?.remove(),f)g.append(f)}let k=fi(e.content).map((x,N)=>{let O=S(x);if(O.type==="toolCall")return{part:O,node:o(O,N)};let P=l?.parts[N];if(P){let X=Object.keys(O);if(P.part===O||X.length===Object.keys(P.part).length&&X.every((G)=>Object.hasOwn(P.part,G)&&O[G]===P.part[G]))return P}let Z=P?.part.type===O.type?P?.node:void 0,j=hi(O,r==="assistant"?"markdown":"plain",Z);if(j instanceof HTMLDetailsElement&&Z instanceof HTMLDetailsElement)j.open=Z.open;return{part:O,node:j}}),C=m(e.errorMessage),b=r==="bashExecution"?m(e.output):"",y=m(e.stopReason),H=JSON.stringify([b,C,y]),R=l?.metadata===H?l.notices:[...b?[Ke(b)]:[],...C||y==="error"?[u("p","notice error small",C||n("生成失败","Could not generate a response."))]:[],...y==="aborted"?[u("p","muted small",n("已停止生成","Response stopped."))]:[],...y==="length"?[u("p","muted small",n("已达到输出长度限制","Response reached the length limit."))]:[]],M=r==="assistant"&&!R.length&&k.some(({part:x})=>x.type==="toolCall")&&k.every(({part:x,node:N})=>x.type==="toolCall"||!N||x.type==="text"&&!m(x.text).trim());if(d.classList.toggle("message--tool-only",M),M)g.remove();else if(g.parentNode!==d)d.prepend(g);let T=(M?k.filter(({part:x})=>x.type==="toolCall"):k).flatMap((x)=>x.node??[]),_=new Set(T);for(let x of l?.parts??[])if(x.node?.parentNode===p&&!_.has(x.node))x.node.remove();if(l&&l.notices!==R)for(let x of l.notices)x.remove();let E=p.firstElementChild;for(let x of[...T,...R]){if(x!==E)p.insertBefore(x,E);E=x.nextElementSibling}return{node:d,body:p,header:g,speaker:a,time:f,timestamp:e.timestamp,role:r,parts:k,notices:R,metadata:H}}var Uo=80,ci=n("加载更早消息","Load older messages"),ui=n("重新加载记录","Reload transcript");function pi(e,t,o){if(e.textContent!==o)e.textContent=o;e.toggleAttribute("data-reload",t?.reload===!0),e.setAttribute("aria-disabled",String(Boolean(t?.busy||t?.disabled))),e.setAttribute("aria-busy",String(t?.busy===!0))}function mi(e){if(e&&!e.busy&&!e.disabled)e.activate()}class dt{root;scroller;empty;cache=new Map;openFolds=new Map;toolViews=new Map;openTools=new Set;results=new Map;contentViews=new WeakMap;older=fe(ci,()=>{if(this.start)this.flush(!0);else mi(this.latest?.history?.older)},"transcript-load");status=u("span","sr-only");olderError=u("p","notice small");latest;frame;forceBottom=!1;prepended;limit=Uo;start=0;first;displayed;indexed;indexedLength=0;trace;constructor(e,t,o){this.root=e;this.scroller=t;this.empty=o;this.status.setAttribute("role","status"),this.olderError.setAttribute("role","status")}observeTrace(e){this.trace=e}reset(){if(this.frame!==void 0)cancelAnimationFrame(this.frame);this.frame=void 0,this.latest=this.displayed=this.indexed=void 0,this.first=void 0,this.forceBottom=!1,this.prepended=void 0,this.limit=Uo,this.start=this.indexedLength=0,this.cache.clear(),this.openFolds.clear(),this.toolViews.clear(),this.openTools.clear(),this.results.clear(),this.root.replaceChildren(),this.status.textContent="",this.empty.hidden=!1,this.scroller.scrollTop=0,this.trace?.({})}render(e,t,o,s=!1,r,l){if(this.latest={entries:e,liveKey:t,tools:o,history:r},this.forceBottom||=s,l!==void 0)this.prepended=(this.prepended??0)+l;this.frame??=requestAnimationFrame(()=>{this.frame=void 0,this.flush()})}indexResults(e){if(this.indexed!==e||this.indexedLength>e.length)this.indexed=e,this.indexedLength=0,this.results.clear();for(;this.indexedLength<e.length;this.indexedLength++){let t=e[this.indexedLength]?.message,o=m(t?.toolCallId);if(t?.role==="toolResult"&&o)this.results.set(o,this.indexedLength)}}flush(e=!1){if(!this.latest||e&&!this.start)return;if(this.frame!==void 0)cancelAnimationFrame(this.frame);this.frame=void 0;let{entries:t,liveKey:o,tools:s,history:r}=this.latest,l=this.prepended;this.prepended=void 0;let i=e||l!==void 0,{scrollTop:d,scrollHeight:a,clientHeight:c}=this.scroller,p=document.activeElement,f=p instanceof HTMLElement&&this.root.contains(p)&&(p.closest(".tool-details, .tool-group, .transcript-content")||this.trace&&p.matches(".message[tabindex='-1']"))?p:void 0,g=f?.matches(".tool-group-summary")?f.parentElement?.querySelector(".tool-summary"):f?.querySelector(".tool-summary"),k=a-c-d<72,C=this.forceBottom||k&&!f&&p!==this.older;this.forceBottom=!1;let b=this.olderError.nextElementSibling,y=i&&b instanceof HTMLElement?b:void 0,H=y?.querySelector(".tool-summary")??void 0,R=i&&f?.closest(".tool-details, .tool-group")&&y?.contains(f)?f:y,M=R?.getBoundingClientRect().top,T=i&&document.activeElement===this.older;this.indexResults(t);let _=[];for(let[A,v]of s)if(!this.results.has(A))_.push({key:`result:${A}`,tool:v});let E=t.length+_.length;if(l!==void 0)this.limit+=l;let x=Math.max(0,E-this.limit);if(!this.displayed||C&&!i)this.start=x;else{if(t!==this.displayed&&this.first){let A=t.findIndex((v)=>v.key===this.first);if(A>=0)this.start=A}this.start=Math.min(this.start,x)}let N=l??0;if(e)N=Math.min(this.start,Uo),this.start-=N,this.limit=Math.max(this.limit,E-this.start);else if(l!==void 0)this.start=Math.max(0,this.start-l);this.displayed=t,this.first=t[this.start]?.key;let O=[],P=new Map;for(let A=this.start;A<t.length;A++){let v=t[A];if(!v)continue;let{message:B}=v;if(B.role==="toolResult"){let F=m(B.toolCallId);if(!F||this.results.get(F)===A)O.push({...v,tool:s.get(F)})}else{let F=!1;if(B.role==="assistant")for(let oe of fi(B.content)){let de=S(oe);if(de.type!=="toolCall")continue;F=!0;let ce=m(de.id);if(ce)P.set(ce,(P.get(ce)??0)+1)}O.push({...v,live:v.key===o,hasCalls:F})}}for(let A=Math.max(0,this.start-t.length);A<_.length;A++)O.push(_[A]);let Z=li({entries:t,start:this.start,liveKey:o,tools:s,calls:P,results:this.results}),j=new Set(O.filter((A)=>A.message&&A.message.role!=="toolResult").map((A)=>A.key));for(let[A,v]of this.cache)if(!j.has(A)){let B=[...v.view.body.querySelectorAll(":scope > details:not(.tool-group)")].flatMap((F,oe)=>F.open?[oe]:[]);if(B.length)this.openFolds.set(A,B);v.view.node.remove(),this.cache.delete(A)}let X=new Set,G,se=(A,v,B,F)=>{if(X.has(A))return;X.add(A);let oe=this.toolViews.get(A);if(!oe)oe=new Fo((ce)=>hi(ce,"tool")),oe.open=this.openTools.delete(A),this.toolViews.set(A,oe);oe.update(v,B,F);let de=oe.node.querySelector(":scope > .tool-details > .fold-body");if(de)this.renderHistoryContent(de,F&&r?.content(F));if(this.trace&&(B?.id||m(v?.id)||m(v?.name)||m(F?.toolCallId)||m(F?.toolName)))G=oe.node;return oe.node};if(this.older.parentNode!==this.root)this.root.prepend(this.status,this.older,this.olderError);let U=this.start?void 0:r?.older;this.older.hidden=!this.start&&!U;let re=this.start.toLocaleString(V),le=this.start?n(`加载更早消息(${re} 条)`,`Load older messages (${re})`):U?.reload?ui:U?.busy?n("正在读取…","Loading…"):ci;if(pi(this.older,U,le),this.olderError.hidden=!U?.error,this.olderError.textContent!==(U?.error??""))this.olderError.textContent=U?.error??"";let Q=(A,v)=>{let B=m(v.id),F=this.results.get(B);return se(B?`id:${B}`:A,v,s.get(B),F===void 0?void 0:t[F]?.message)},ne=this.olderError,q,L;for(let A of O){let{message:v}=A,B;if(!v||v.role==="toolResult"){let oe=m(v?.toolCallId)||A.tool?.id;if(oe&&P.has(oe))continue;B=se(oe?`id:${oe}`:`row:${A.key}`,void 0,A.tool,v)}else{let oe=!1;B=this.updateMessage(A,v,(ce,ve)=>{let Me=m(ce.id),Ve=Z.get(Me),lt=`part:${A.key}:${ve}`;if(!Ve)return Q(lt,ce);if(Ve[0]!==ce){oe=!0;return}let Ao=Ve.flatMap((Ns)=>Q(lt,Ns)??[]);return this.toolViews.get(`id:${Me}`)?.groupWith(Ao)});let de=this.cache.get(A.key)?.view;if(de){let ce=r?.content(v),ve=de.parts.filter(({part:Me})=>Me.type==="text");if(ve.length===1&&ve[0]?.node)ve[0].node.hidden=Boolean(ce?.chunks.length);this.renderHistoryContent(de.body,ce)}if(oe&&B.classList.contains("message--tool-only")&&!this.cache.get(A.key)?.view.body.childElementCount){B.remove();continue}if(this.trace&&(v.role==="user"||v.role==="assistant")){if(this.cache.get(A.key)?.view.parts?.some(({part:ve,node:Me})=>Me&&ve.type!=="toolCall"&&ve.type!=="thinking"&&(ve.type!=="text"||m(ve.text).trim())))if(v.role==="user")q=B;else L=B}}if(!B)continue;let F=ne.nextElementSibling;if(B!==F)this.root.insertBefore(B,F);ne=B}for(let[A,v]of this.toolViews)if(!X.has(A)){if(v.open)this.openTools.add(A);v.node.remove(),this.toolViews.delete(A)}if(f&&document.activeElement===document.body){let A=this.root.contains(f)?f:g;if(A&&this.root.contains(A))Xn(A)?.focus({preventScroll:!0})}this.empty.hidden=E>0;let I=G?.closest(".tool-group")??G;if(this.trace?.({user:q,assistant:L,tool:I?.querySelector("summary")??void 0}),i){if(N){let v=N.toLocaleString(V);this.status.textContent=n(`已加载 ${v} 条更早消息。`,`Loaded ${v} older ${N===1?"message":"messages"}.`)}let A=R&&this.root.contains(R)?Xn(R):Xn(H);if(A&&this.root.contains(A)&&M!==void 0){if(T&&(N||this.older.hidden)){if(A.tagName!=="SUMMARY")A.tabIndex=-1;A.focus({preventScroll:!0})}this.scroller.scrollTop+=A.getBoundingClientRect().top-M}else if(T&&this.older.hidden)this.scroller.focus({preventScroll:!0})}else if(C)this.scroller.scrollTop=this.scroller.scrollHeight;if(!i&&p===this.older&&this.older.hidden)this.scroller.focus({preventScroll:!0})}renderHistoryContent(e,t){let o=this.contentViews.get(e);if(o&&(!t||o.key!==t.key)){let a=o.node.contains(document.activeElement);if(o.node.remove(),this.contentViews.delete(e),o=void 0,a)this.scroller.focus({preventScroll:!0})}if(!t)return;if(!o){let a=u("div","transcript-content stack stack--tight"),c=u("div","plain break"),p=u("p","small muted");p.setAttribute("role","status");let f=fe("",()=>mi(this.contentViews.get(e)?.control),"button--quiet");a.append(c,p,f),e.append(a),o={key:t.key,node:a,output:c,status:p,button:f,count:0},this.contentViews.set(e,o)}if(o.control=t.control,t.chunks.length<o.count)o.count=0,o.output.replaceChildren();let s=t.chunks.slice(o.count).map((a)=>u("span","",a));o.output.append(...s),o.count=t.chunks.length,o.output.hidden=!o.count;let r=t.control?.reload?ui:t.control?.busy?n("正在读取…","Loading…"):o.count?n("加载下一段正文","Load next content chunk"):n("加载正文","Load message content");pi(o.button,t.control,r);let l=t.control?.reload?n("记录版本已失效。","This transcript page expired."):t.control?.error??(s.length?n("已加载正文。","Message content loaded."):t.control?.busy||!o.count?"":o.status.textContent);if(o.status.textContent!==l)o.status.textContent=l;o.status.hidden=!l;let i=s.find((a)=>a.textContent);if(i&&document.activeElement===o.button)i.tabIndex=-1,i.focus({preventScroll:!0});let d=!t.control&&document.activeElement===o.button;if(o.button.hidden=!t.control,d)this.scroller.focus({preventScroll:!0})}updateMessage(e,t,o){let{key:s,hasCalls:r}=e,l=Boolean(e.live),i=this.cache.get(s);if(!r&&i&&i.message===t&&i.live===l)return i.view.node;let d=ra(t,l,o,i?.view);if(i&&d.node!==i.view.node)i.view.node.remove();if(!i){let a=this.openFolds.get(s);if(a){let c=d.body.querySelectorAll(":scope > details:not(.tool-group)");for(let p of a)if(c[p])c[p].open=!0;this.openFolds.delete(s)}}return this.cache.set(s,{message:t,live:l,view:d}),d.node}}function Ko(e){let t=S(e),o=m(t.id);if(o)return{id:o,olderCursor:m(t.olderCursor)}}function zo(e){let t=S(e).status;if(t==="truncated"||t==="unavailable")return t}class Go{api;sessionId;current;enabled;tail;changed;reload;id;entries=[];status;stale=!1;reloading=!1;olderCursor;olderError;requests=new Map;contents=new Map;constructor(e,t,o,s,r,l,i,d){this.api=t;this.sessionId=o;this.current=s;this.enabled=r;this.tail=l;this.changed=i;this.reload=d;this.id=e.id,this.olderCursor=e.olderCursor}invalidate(){for(let e of this.requests.values())e.abort();this.requests.clear()}clearExpansion(){this.invalidate(),this.entries=[],this.status=void 0,this.contents.clear()}render(){let e=(t,o,s)=>({activate:this.stale?this.reload:t,disabled:!this.enabled(),busy:this.reloading||this.requests.has(o),reload:this.stale,error:s});return{older:this.olderCursor||this.stale?e(()=>{this.loadOlder()},this.olderCursor,this.olderError):void 0,content:(t)=>{let o=m(S(t.historyContent).cursor);if(!o)return;let s=this.contents.get(o),r=s?.next??o;return{key:o,chunks:s?.chunks??[],control:r?e(()=>{this.loadContent(o,r)},r,s?.error):void 0}}}}async read(e,t,o,s){if(!e||this.stale||!this.current()||!this.enabled()||this.requests.has(e))return;let r=new AbortController,l=()=>this.current()&&this.requests.get(e)===r&&!r.signal.aborted;this.requests.set(e,r),this.changed();let i;try{let d=`${ye(this.sessionId)}/transcript${t?"/content":""}`,a=await this.api.request(`${d}?${new URLSearchParams({cursor:e})}`,void 0,AbortSignal.any([r.signal,AbortSignal.timeout(20000)]));if(l())i=o(a)}catch(d){if(!l())return;if(d instanceof ie&&(d.code.includes("cursor")||[400,401,403,404,409,410].includes(d.status)))this.expire();else s(n("读取失败,请重试。","Couldn't load this part. Try again."))}finally{if(l())this.requests.delete(e),this.changed(i)}}expire(){this.stale=!0,this.olderError=n("记录版本已失效,请重新加载。","This transcript page expired. Reload the transcript."),this.invalidate(),this.changed()}async loadOlder(){let e=this.olderCursor;await this.read(e,!1,(t)=>{let o=Ko(t.page);if(!o||o.id!==this.id||o.olderCursor===e||!Array.isArray(t.messages)){this.expire();return}let s=new Set([...this.entries,...this.tail()].map((l)=>l.key)),r=z(t.messages).map(S).filter((l)=>Boolean(ze(l))).flatMap((l,i)=>{let d=Nt(l),a=s.has(d);if(a&&(d.startsWith("id:")||d.startsWith("result:")))return[];let c=d&&!a?d:`older:${this.entries.length}:${i}`;return s.add(c),[{key:c,message:l}]});return this.entries=[...r,...this.entries],this.olderCursor=o.olderCursor,this.olderError=void 0,this.status=zo(t.transcript)??this.status,r.length},(t)=>{this.olderError=t})}async loadContent(e,t){let o=this.contents.get(e)??{next:e,chunks:[]};if(this.contents.set(e,o),o.next!==t)return;await this.read(t,!0,(s)=>{let r=m(s.nextCursor);if(typeof s.text!=="string"||r===t||r&&r===e){this.expire();return}o.chunks.push(s.text),o.next=r,o.error=void 0;return},(s)=>{o.error=s})}}var gi={pending:n("等待中","Pending"),queued:n("排队中","Queued"),scheduled:n("已调度","Scheduled"),blocked:n("被依赖阻塞","Blocked by dependencies"),paused:n("已暂停","Paused"),running:n("运行中","Running"),completed:n("已完成","Completed"),done:n("已完成","Completed"),success:n("成功","Succeeded"),failed:n("失败","Failed"),error:n("出错","Error"),cancelled:n("已取消","Canceled"),skipped:n("已跳过","Skipped"),interrupted:n("已中断","Interrupted"),lost:n("已失联","Lost contact")},Zo=n("未知时间","Unknown time"),He=new Intl.NumberFormat(V),Bt=(e)=>Object.hasOwn(gi,e)?gi[e]:void 0,eo=(e)=>Bt(e)??e;function Ie(e){let t=Y(e);if(t===void 0)return Zo;let o=new Date(t);return Number.isNaN(o.getTime())?Zo:o.toLocaleString(V,{hour12:!1})}function aa(e,t){let o=Y(e),s=Y(t);if(o===void 0||s===void 0||s<o)return"";let r=Math.round((s-o)/1000);if(r<60)return n(`${He.format(r)} 秒`,`${He.format(r)} sec`);let l=Math.floor(r/60);if(l<60)return n(`${He.format(l)} 分钟`,`${He.format(l)} min`);let i=He.format(Math.floor(l/60)),d=He.format(l%60);return n(`${i} 小时 ${d} 分钟`,`${i} hr ${d} min`)}function la(e){let t=u("dl","details-list small numerical");for(let[o,s]of e)if(s)t.append(u("dt","",o),u("dd","",s));return t.childElementCount?t:u("p","small muted",n("当前没有可用数据。","No data available."))}function da(e,t){let o=z(e.nodes).map(S),s=z(e.edges).map(S),r=(i)=>{if(!i)return"";let d=t.get(i),a=d?m(d.description):"";return a?n(`${a}(${i})`,`${a} (${i})`):n(`子任务 ${i}`,`Subtask ${i}`)},l=[];if(o.length)l.push(la(o.map((i)=>{let d=m(S(i).taskId),a=z(S(i).upstream).map(m).filter(Boolean),c=He.format(Y(S(i).attempt)??0);return[m(S(i).label)||m(S(i).id)||n("节点","Node"),[`${eo(m(S(i).state))}`,n(`尝试 ${c} 次`,`Attempts: ${c}`),d?n(`关联:${r(d)}`,`Task: ${r(d)}`):"",a.length?n(`上游:${a.join("、")}`,`Upstream: ${a.join(", ")}`):""].filter(Boolean).join(" · ")]})));else l.push(u("p","small muted",n("这次运行还没有节点记录。","No nodes were recorded for this run.")));if(s.length){let i=u("ul","inline-list");for(let d of s){let a=m(d.fromLabel)||m(d.from),c=m(d.toLabel)||m(d.to);if(a&&c){let p=u("li","stack stack--tight");p.append(u("p","plain",`${a} → ${c}`)),i.append(p)}}if(i.childElementCount)l.push(Ue(n(`依赖边(${He.format(i.childElementCount)})`,`Dependencies (${He.format(i.childElementCount)})`),i))}return Ue(`${m(e.name)||n("运行","Run")} · ${eo(m(e.status))}`,...l)}function ca(e){let t=u("ul","inline-list");for(let o of e){let s=S(o),r=[Ie(s.startedAt),s.completedAt===void 0?"":Ie(s.completedAt)].filter((c)=>c&&c!==Zo),l=aa(s.startedAt,s.completedAt),i=Y(s.turns),d=Y(s.toolCalls),a=u("li","stack stack--tight");a.append(u("p","plain",m(s.description)||n("子任务","Subtask"))),a.append(u("p","small muted break",[m(s.id)?n(`任务 ID:${m(s.id)}`,`Task ID: ${m(s.id)}`):"",m(s.parentTaskId)?n(`父任务:${m(s.parentTaskId)}`,`Parent task: ${m(s.parentTaskId)}`):"",m(s.agent)?n(`智能体:${m(s.agent)}`,`Agent: ${m(s.agent)}`):"",m(s.model)?n(`模型:${m(s.model)}`,`Model: ${m(s.model)}`):"",m(s.status)?n(`状态:${eo(m(s.status))}`,`Status: ${eo(m(s.status))}`):"",r.length?n(`时间:${r.join(" → ")}${l?`(耗时 ${l})`:""}`,`Time: ${r.join(" → ")}${l?` (${l} elapsed)`:""}`):"",i!==void 0?n(`轮次:${He.format(i)}`,`Turns: ${He.format(i)}`):"",d!==void 0?n(`工具调用:${He.format(d)}`,`Tool calls: ${He.format(d)}`):""].filter(Boolean).join(" · "))),t.append(a)}return Ue(n(`子任务(${He.format(t.childElementCount)})`,`Subtasks (${He.format(t.childElementCount)})`),t)}var ua={"no-agent-dir":n("原生任务快照不可用:未配置原生配置目录,快照入口已关闭。","Native task snapshots are disabled because no native configuration directory is set."),"invalid-id":n("原生任务快照不可用:会话标识无效,无法定位快照。","Could not locate the native task snapshot: the session ID is invalid."),"session-unavailable":n("原生任务快照不可用:会话尚未接入引擎,请先恢复会话。","Resume the session to connect it to the engine before reading its native task snapshot."),"missing-projection":n("原生任务快照不可用:原生暂无此会话的任务快照,并非读取失败。","The native host has no task snapshot for this session. The read did not fail.")};function yi(e){let t=u("div","stack stack--tight"),o=u("section","subpanel stack stack--tight"),s=u("section","subpanel stack stack--tight");if(o.id="runtime-dag",o.tabIndex=-1,s.id="runtime-subagent",s.tabIndex=-1,o.append(u("h3","",n("DAG 快照","DAG snapshot"))),s.append(u("h3","",n("子代理","Subagents"))),t.append(s,o),m(e.status)!=="ok"){let a=m(e.reason),c=ua[a]??n("原生任务快照不可用。","Native task snapshot unavailable.");return o.append(u("p","small muted",c)),s.append(u("p","small muted",c)),t}let r=[n(`快照时间:${Ie(e.updatedAt)}`,`Snapshot time: ${Ie(e.updatedAt)}`),e.connected===void 0?n("工作区记录,非实时","Workspace record · Not live"):n(`Herdr 快照,记录时${e.connected===!0?"已连接":"未连接"},非实时`,`Herdr snapshot · ${e.connected===!0?"Connected":"Not connected"} at capture · Not live`)].join(" · ");o.append(u("p","small muted",r)),s.append(u("p","small muted",r));let l=z(e.runs).map(S),i=z(e.tasks).map(S);if(!l.length)o.append(u("p","small muted",n("快照中没有 DAG 记录。","No DAG runs in this snapshot.")));let d=new Map(i.map((a)=>[m(a.id),a]));for(let a of l)o.append(da(a,d));if(i.length)s.append(ca(i));else s.append(u("p","small muted",n("快照中没有子代理记录。","No subagents in this snapshot.")));return t}function bi(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)?e:{}}function vi(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function Jt(e){let t=vi(e);return t===void 0||t<0?void 0:t}function Xt(e){let t=bi(e),o=Jt(t.tokens),s=Jt(t.contextWindow??t.window??t.context_window),r=Jt(t.percent??t.percentUsed??t.usagePercent);if(o===void 0&&s===void 0&&r===void 0)return{status:"unavailable",reason:"no-data"};return{status:"ok",...o===void 0?{}:{tokens:o},...s===void 0?{}:{window:s},...r===void 0?{}:{percent:r}}}function to(e){let t=bi(e),o=vi(t.latestCacheHitRate),s=Jt(t.input),r=Jt(t.cacheRead),l=Jt(t.cacheWrite);if(!((r??0)>0||(l??0)>0||(o??0)>0))return{status:"unavailable",reason:"no-data"};let d=o===void 0||o<0||o>100?void 0:o/100,a;if(s!==void 0&&r!==void 0&&l!==void 0){let c=s+l+r;if(c>0&&Number.isFinite(c))a=r/c}if(d===void 0&&a===void 0)return{status:"unavailable",reason:"no-data"};return{status:"ok",...d===void 0?{}:{latest:d},...a===void 0?{}:{cumulative:a}}}var vn={off:n("关闭","Off"),minimal:n("极低","Minimal"),low:n("低","Low"),medium:n("中","Medium"),high:n("高","High"),xhigh:n("极高","Extra high"),max:n("最高","Maximum")};function ki(e){let t=S(e),o=Y(t.tokensPerSecond),s=Y(t.measuredAt);return o!==void 0&&o>0&&s!==void 0&&s>=0?{tokensPerSecond:o,measuredAt:s}:void 0}function wi(e,t){let o=K("runtime-instructions",HTMLDetailsElement),s=K("runtime-instructions-status",HTMLElement),r=K("runtime-instructions-text",HTMLPreElement),l=n("当前无法读取 AGENTS.md。关闭后可展开重试。","Could not read AGENTS.md. Close and reopen this section to try again."),i;function d(){i?.abort(),i=void 0,r.hidden=!0,r.textContent="",s.textContent=""}return o.addEventListener("toggle",async()=>{d();let a=t();if(!o.open||!a)return;let c=i=new AbortController,p=()=>i===c&&o.open&&t()===a;s.textContent=n("正在读取工作目录中的 AGENTS.md…","Reading AGENTS.md in the working directory…");try{let f=await e.request(`${ye(a)}/instructions`,void 0,AbortSignal.any([c.signal,AbortSignal.timeout(18000)]));if(!p())return;switch(f.status){case"ok":if(f.file!=="AGENTS.md"||typeof f.content!=="string"){s.textContent=n("未能验证 AGENTS.md 原文。","Could not verify the contents of AGENTS.md.");break}r.textContent=f.content,r.hidden=!f.content,s.textContent=f.content?n("已读取 AGENTS.md 原文。","Showing AGENTS.md as written."):n("AGENTS.md 是空文件。","AGENTS.md is empty.");break;case"missing":s.textContent=n("当前工作目录没有 AGENTS.md。","There is no AGENTS.md in the working directory.");break;case"unsupported":s.textContent=n("当前宿主或连接方式不支持读取项目规则。","The current host or connection does not support reading project rules.");break;case"refused":s.textContent=n("宿主拒绝读取,或无法确认文件属于当前会话。","The host refused the read or could not verify that the file belongs to this session.");break;case"too_large":s.textContent=n("AGENTS.md 超过读取上限,未显示内容。","AGENTS.md exceeds the read limit. Its contents are not shown.");break;case"unavailable":default:s.textContent=l}}catch(f){if(!p())return;s.textContent=f instanceof ie&&[401,403,409].includes(f.status)?n("读取被拒绝,或当前会话连接已变化。","The read was refused or the session connection changed."):f instanceof ie&&f.status===404&&f.code==="not_found"?n("当前 Web 服务不支持读取项目规则。","This Web server does not support reading project rules."):l}finally{if(i===c)i=void 0}}),()=>{o.open=!1,d()}}var Be=new Intl.NumberFormat(V,{maximumFractionDigits:2}),pa=new Intl.NumberFormat(V,{style:"currency",currency:"USD",maximumFractionDigits:5}),ke=(e)=>{let t=Y(e);return t===void 0?"":Be.format(t)},Ci=(e)=>typeof e==="boolean"?e?n("开启","On"):n("关闭","Off"):"";function Ei(e){let t=u("span","","—");t.setAttribute("aria-hidden","true"),e.append(t,u("span","sr-only",Re))}function Ai(e,t=!1){let o=u("dl","details-list small numerical");for(let[s,r]of e)if(r){let i=u("dd",r===Re||r===Qo||r===Yo?"metric-unreported":"");if(t&&r===Re)Ei(i);else i.textContent=r;o.append(u("dt","",s),i)}return o.childElementCount?o:u("p","small muted",n("当前没有可用数据。","No data available."))}function Mi(e,...t){let o=u("section","subpanel stack stack--tight");return o.append(u("h3","",e),...t),o}function Jo(e,t,...o){let s=Ue(t,...o);return s.dataset.overviewDisclosure=e,s.querySelector("summary")?.setAttribute("data-overview-focus",e),s}function kn(e,t){let o=u("div","metric-group stack");return o.append(u("p","metric-label small",e),Ai(t,!0)),o}var Re=n("尚无数据(原生未报告)","Not reported by the native host"),Qo=n("未报告","Not reported"),Yo=n("已报告,无数值","Reported without a value"),Ti=n("— 表示原生未报告","— means the native host did not report a value");function Li(e){let t=Y(e);if(t===void 0)return"";if(t>=1048576)return`${Be.format(t/1048576)} MB`;if(t>=1024)return`${Be.format(t/1024)} KB`;return`${Be.format(t)} B`}function Si(e){return e===void 0?"":`${Be.format(e*100)}%`}function Dt(e){let t=Y(e);if(t===void 0)return"";let o=new Date(t);return Number.isNaN(o.getTime())?"":o.toLocaleString(V,{hour12:!1})}function ma(e,t,o){let s=Xt(e.contextUsage);if(s.status==="ok"&&(s.tokens!==void 0||s.window!==void 0||s.percent===0))return s;if(s.status!=="ok"&&Object.hasOwn(e,"contextUsage"))return s;let r=Xt(t.contextUsage);if(r.status==="ok")return r;let l=Xt(o.contextUsage);if(l.status==="ok"&&(!Object.hasOwn(e,"contextUsage")||s.status==="ok"&&l.tokens!==void 0&&l.window!==void 0))return l;return s}function $i(e,t,o){let s=S(e.stats),r=S(e.state),l={...r,...t},i=S(e.sessionMemory),d=S(l.model),a=S(s.tokens??l.usageTotals),c=ma(t,r,s),p=c.status==="ok"?ke(c.tokens):"",f=c.status==="ok"?ke(c.window):"",g=c.status==="ok"?ke(c.percent):"",k=to(l.usageTotals),C=k.status==="ok"?k.latest:void 0,b=k.status==="ok"?k.cumulative:void 0,y=Y(a.input),H=Y(a.cacheRead),R=Y(a.cacheWrite),M=(q)=>q!==void 0&&q>=0,T=M(y)&&M(H)&&M(R),_=Y(s.cost),E=S(s.failures),x=Y(i.mainHeapBytes),N=Y(i.kernelHeapBytes),O=Y(i.kernelCount),P=x!==void 0||N!==void 0||O!==void 0,Z=g?p?`${p} (${g}%)`:`${g}%`:p,j=Si(C),X=ke(s.toolCalls),G=_===void 0?"":pa.format(_),se=u("dl","metric-highlights numerical");for(let[q,L,I]of[["context",n("上下文已用","Context used"),g?`${g}%`:p?n(`${p} token`,`${p} tokens`):""],["cache",n("最新缓存命中率","Latest cache hit rate"),j],["tools",n("工具调用","Tool calls"),X],["cost",n("估算费用","Estimated cost"),G]]){let A=u("div","metric-tile");A.dataset.tone=q;let v=u("dd",I?"":"metric-unreported",I);if(!I)Ei(v);A.append(u("dt","",L),v),se.append(A)}let U=m(l.thinkingLevel),re=u("div","row row--between"),le=u("button","button button--quiet small",n("规则与记忆","Rules and memory"));le.type="button",le.id="runtime-open-resources",le.dataset.overviewFocus="resources",le.setAttribute("aria-controls","runtime-resources"),re.append(u("h3","",n("运行状态与用量","Runtime and usage")),le);let Q=u("section","subpanel stack stack--tight runtime-metrics");Q.append(re,se,kn(n("会话设置","Session settings"),[[n("模型","Model"),[m(d.provider),m(d.name)||m(d.id)].filter(Boolean).join(" · ")||Re],[n("生效思考档","Active thinking level"),(Object.hasOwn(vn,U)?vn[U]:U)||Re],[n("快速模式","Fast mode"),Ci(l.fastMode)||Re],[n("最近流式 · Web 观测","Latest streaming speed (Web)"),o?`${o.tokensPerSecond<0.01?`<${Be.format(0.01)}`:Be.format(o.tokensPerSecond)} token/s`:n("未测得","Not measured")]]));let ne=Jo("metrics",n("完整运行明细","Full runtime details"),kn(n("上下文与缓存","Context and cache"),[[n("上下文已用(原生)","Context used (native)"),Z||Re],[n("上下文窗口","Context window"),f?n(`${f} token`,`${f} tokens`):Re],[n("缓存命中率(原生最新)","Latest cache hit rate (native)"),j||(k.status==="ok"?Yo:Re)],[n("缓存累计命中率","Cumulative cache hit rate"),Si(b)||(k.status==="ok"?Yo:Re)]]),kn(n("其他设置","Other settings"),[[n("权限预设","Permission preset"),m(l.effectivePermissionPreset)||m(l.permissionPreset)||Re],[n("自动压缩","Auto-compaction"),Ci(l.autoCompactionEnabled)||Re]]),kn(n("流量与费用","Usage and cost"),[[n("用户消息","User messages"),ke(s.userMessages)],[n("助手消息","Assistant messages"),ke(s.assistantMessages)],[n("工具调用","Tool calls"),X],[n("输入 token(含缓存)","Input tokens (including cache)"),T?ke(y+H+R):Re],[n("未缓存输入 token","Uncached input tokens"),T?ke(y+R):ke(y)],[n("输出 token","Output tokens"),ke(a.output)],[n("缓存读取 token","Cache read tokens"),ke(a.cacheRead)],[n("缓存写入 token","Cache write tokens"),ke(a.cacheWrite)],[n("总 token","Total tokens"),ke(a.total??a.totalTokens)],[n("估算费用","Estimated cost"),G],[n("失败请求","Failed requests"),ke(E.erroredRequests)]]),kn(n("原生内存","Native memory"),[[n("OmO 宿主主堆(引擎共享)","OmO host heap (shared by the engine)"),x!==void 0?Li(x):Re],[n("本会话内核堆","Session kernel heap"),N!==void 0?Li(N):P?Qo:Re],[n("本会话内核数","Session kernel count"),O!==void 0?ke(O):P?Qo:Re]]));if(ne.classList.add("metric-breakdown"),Q.append(ne),se.querySelector(".metric-unreported"))se.after(u("p","metric-key small",Ti));else if(ne.querySelector(".metric-unreported [aria-hidden='true']"))ne.querySelector(".fold-body")?.append(u("p","metric-key small",Ti));return Q}function fa(e){let t=u("ul","inline-list");for(let o of e){let s=S(o),r=m(s.requestedMode),l={queued:n("排队中","Queued"),sending:n("正在发送","Sending"),held:n("等待中","Waiting"),pending:n("等待中","Waiting"),accepted:n("已接收","Accepted")}[m(s.state)]||"",i=[r==="steer"?n("引导","Steer"):r==="followUp"||r==="follow_up"?n("后续","Follow-up"):"",l].filter(Boolean).join(" · "),d=u("li","stack stack--tight");if(i)d.append(u("span","small muted",i));d.append(u("p","plain",m(s.text)||n("(无文本)","(No text)"))),t.append(d)}return t}function Ri(e,t,o,s,r){let l=u("p","small muted"),i=u("p","small muted");i.setAttribute("role","status");let d=u("div","stack stack--tight"),a=Jo("queue",n("预览待处理输入","Preview pending inputs"),i,d),c=fe(n("清空队列","Clear queue"),r,"button--danger");c.dataset.overviewFocus="queue:clear",c.dataset.write="";let p=u("div","row");p.append(c);let f=Mi(n("输入队列","Input queue"),l,p,a),g,k,C=!1,b=!1,y=()=>{let _=!(g!==void 0&&g>0)&&!b;c.toggleAttribute("data-unavailable",_),c.disabled=_||!s()},H=(_="",...E)=>{if(d.contains(document.activeElement))a.querySelector("summary")?.focus({preventScroll:!0});D(i,_),d.replaceChildren(...E)},R=()=>{if(!C)return;k?.abort(),k=void 0,C=b=!1,H(),y()},M=()=>f.isConnected&&a.open&&o(),T=(_=!1)=>{if(!M())return;if(C&&!_)return;k?.abort();let E=k=new AbortController;C=!0,b=!1,y(),H(n("正在读取待处理输入…","Loading pending inputs…"));let x=()=>k===E&&M(),N=(O=!1)=>{H(O?n("队列响应超出读取上限。","The queue response exceeded the read limit."):n("无法读取待处理输入。","Couldn't load pending inputs."),fe(n("重试队列预览","Retry queue preview"),()=>T(!0),"button--quiet"))};e.request(`${t}/queue`,void 0,E.signal).then((O)=>{if(!x())return;if(!Array.isArray(O.inputs)){N();return}b=O.inputs.length>0,y(),H(O.truncated===!0?n("预览已截断,仅显示部分队列内容。","Preview truncated. Only part of the queue is shown."):b?"":n("没有可预览的待处理输入。","No pending inputs to preview."),...b?[fa(O.inputs)]:[])},(O)=>{if(x())N(O instanceof ie&&O.code==="queue_too_large")}).finally(()=>{if(k===E)k=void 0})};return a.addEventListener("toggle",()=>{if(a.open)T();else R()}),{root:f,activate:T,deactivate:R,update(_){g=_,l.textContent=_===void 0?n("待处理输入数量未知。","Pending input count unknown."):_>0?n(`${Be.format(_)} 条待处理输入`,`${Be.format(_)} pending ${_===1?"input":"inputs"}`):n("没有排队的输入。","No queued inputs."),y()}}}function ha(e,t){let o=z(e.commands).map(S).filter((l)=>Boolean(m(l.invocation))),s=Mi(n("可用命令","Available commands"));if(!o.length)return s.append(u("p","muted small",n("未读取到可用命令。","No commands were returned."))),s;let r=u("ul","command-list");for(let l of o){let i=m(l.invocation),d=fe(i,()=>t.insertCommand(i),"button--quiet path");d.title=n("插入输入框,不会立即发送","Insert in the input box without sending"),d.setAttribute("aria-label",n(`插入命令:${i}`,`Insert command: ${i}`)),d.dataset.overviewFocus=`command:${i}`;let a=u("li","stack stack--tight");if(a.append(d),m(l.description))a.append(u("p","small muted break",m(l.description)));r.append(a)}return s.append(Jo("commands",n(`${Be.format(o.length)} 项 · 展开后可插入输入框`,`${Be.format(o.length)} ${o.length===1?"command":"commands"} · Expand to insert`),r)),s}var ga={pending:n("待办","Pending"),in_progress:n("进行中","In progress"),completed:n("已完成","Completed"),abandoned:n("已放弃","Abandoned")},xi={"missing-tree":n("快照缺少会话树","The snapshot has no session tree."),"invalid-leaf":n("活动分支标识无效","The active branch ID is invalid."),"unknown-leaf":n("活动分支不在会话树中","The active branch is not in the session tree."),"duplicate-id":n("会话树有重复标识","The session tree contains duplicate IDs."),"broken-ancestry":n("分支链断裂或指向其他分支","The branch chain is broken or points to another branch."),"tree-budget":n("会话树超出读取上限,可能不完整","The session tree exceeds the read limit and may be incomplete."),incomplete:n("历史超出分支读取上限","The branch history exceeds the read limit."),ownership_changed:n("会话或活动分支已变化","The session or active branch changed."),binding_unverified:n("无法确认会话归属","The session binding could not be verified."),unsupported:n("当前宿主不支持有界分支读取","The current host does not support bounded branch reads."),malformed:n("原生返回的分支数据格式无效","The native host returned invalid branch data.")};function ya(e){let t=u("section","subpanel stack stack--tight");if(t.append(u("h3","",n("待办 · 当前活动分支","Todo · Active branch"))),e.status==="loading"){let r=u("p","small muted",n("正在读取当前分支…","Loading the active branch…"));return r.setAttribute("role","status"),t.append(r),t}if(m(e.status)==="invalid"){let r=xi[m(e.reason)]??n("未知原因","Unknown reason.");return t.append(u("p","small muted",n(`无法确认活动分支(${r}),不显示待办,以免混入其他分支。`,`Could not verify the active branch. ${r} Todo is hidden to avoid showing another branch’s tasks.`))),t}if(m(e.status)!=="ok"){let r=xi[m(e.reason)];return t.append(u("p","small muted",r?n(`分支数据不可用(${r}),待办数量未知。`,`Branch data is unavailable. ${r} The Todo count is unknown.`):n("分支数据不可用,待办数量未知。可刷新重试。","Branch data is unavailable. The Todo count is unknown. Refresh to try again."))),t}let o=m(e.leafId);t.append(u("p","small muted",o?n(`活动分支:${o}`,`Active branch: ${o}`):n("当前没有活动分支。","No branch is active.")));let s=S(e.todo);if(m(s.status)==="ok"){let r=z(s.phases).map(S),l=e.incomplete===!0;if(!r.length)t.append(u("p","small muted",n("当前活动分支待办为空(原生明确返回空列表)。","The native host returned an empty Todo list for the active branch.")));else{let i=u("ul","inline-list");for(let a of r){let c=u("li","stack stack--tight");c.append(u("p","plain",m(a.name)||n("待办","Todo")));let p=u("ul","inline-list");for(let f of z(a.tasks).map(S)){let g=u("li");g.append(u("p","small break",`${ga[m(f.status)]??m(f.status)} · ${m(f.content)}`)),p.append(g)}if(p.childElementCount)c.append(p);i.append(c)}let d=i.childElementCount;t.append(Ue(n(`待办(${Be.format(d)} 组)${l?" · 内容已截断":""}`,`Todo (${Be.format(d)} ${d===1?"group":"groups"})${l?" · Truncated":""}`),u("p","small muted",n("只读:来自所选活动分支的最新原生记录;其他分支与原始自定义内容不在此显示。","Read-only. Shows the latest native record for the selected branch. Other branches and raw custom entries are not shown.")),i))}if(l&&r.length)t.append(u("p","small muted",n("待办内容超出显示上限,仅显示前面的记录。","The Todo list exceeds the display limit. Only the first entries are shown.")))}else t.append(u("p","small muted",n("当前分支未报告待办,数量未知。","No Todo record was reported for the active branch. The task count is unknown.")));return t}function ba(e){if(e.status==="loading")return[u("p","small muted",n("正在读取当前分支…","Loading the active branch…"))];if(e.status!=="ok")return[u("p","small muted",n("无法确认当前分支,未显示长期记忆计数。","Could not verify the active branch, so long-term memory counts are hidden."))];let t=S(e.memory);if(m(t.status)!=="ok")return[u("p","small muted",n("当前分支没有召回记录;不代表未启用长期记忆。","No recall record for this branch. Long-term memory may still be enabled."))];let o=Y(t.recalledCount),s=Dt(t.recentRecalledAt),r=S(t.gate),l=S(t.unavailable),i=r.status==="failed"||r.status==="skipped"?n(`${r.status==="failed"?"失败":"跳过"} · 连续 ${ke(r.consecutiveFailures)} 次 · 候选 ${ke(r.candidateCount)}${Dt(r.at)?` · ${Dt(r.at)}`:""}`,`${r.status==="failed"?"Failed":"Skipped"} · Consecutive failures: ${ke(r.consecutiveFailures)} · Candidates: ${ke(r.candidateCount)}${Dt(r.at)?` · ${Dt(r.at)}`:""}`):"",d=Y(l.count),c=[[n("长期记忆召回条目(累计,仅计数)","Long-term memory recalls (total count)"),o!==void 0?ke(o):""],[n("最近召回时间","Last recall"),s],[n("召回门控","Recall gate"),i],[n("记忆不可用记录(仅计数)","Memory unavailability records (count only)"),d!==void 0?`${ke(d)}${Dt(l.at)?` · ${Dt(l.at)}`:""}`:""]].filter(([,p])=>Boolean(p));return[u("p","small muted",n("仅活动分支的召回计数与状态,不含个人记忆原文、路径、提示词或宿主堆内存。","Recall counts and status for the active branch only. Personal memory text, paths, prompts, and host heap data are not shown.")),c.length?Ai(c):u("p","small muted",n("有记忆聚合记录,但暂无可显示的数值。","Memory records exist, but there are no values to show."))]}function qi(e,t,o){let s=K("runtime-metrics",HTMLElement).querySelector(".runtime-metrics");if(!s)return;let r=$i(e,t,o),l=s.querySelector("details"),i=r.querySelector("details"),d=document.activeElement,a=d instanceof HTMLElement&&s.contains(d)?d.dataset.overviewFocus:void 0;if(l&&i)i.open=l.open;if(s.replaceWith(r),a)r.querySelector(`[data-overview-focus="${CSS.escape(a)}"]`)?.focus({preventScroll:!0})}function Hi(e,t,o,s,r,l,i){let d=K("runtime-metrics",HTMLElement),a=document.activeElement,c=a instanceof HTMLElement&&d.contains(a)?a.dataset.overviewFocus:void 0,p=new Set([...d.querySelectorAll("details[open]")].map((f)=>f.dataset.overviewDisclosure));for(let f of[...d.children])if(f!==r&&f!==l)f.remove();if(l.parentElement!==d)d.prepend(l);if(d.prepend($i(e,t,i)),l.after(ha(o,s)),d.querySelectorAll("details[data-overview-disclosure]").forEach((f)=>{f.open=p.has(f.dataset.overviewDisclosure)}),c!==void 0&&document.activeElement!==a){let f=d.querySelector(`[data-overview-focus="${CSS.escape(c)}"]:not(:disabled)`);((f?.getClientRects().length)?f:d).focus({preventScroll:!0})}}function Xo(e){let t=K("runtime-todo",HTMLElement),o=document.activeElement,s=ya(e),r=t.querySelector("[data-runtime-branch]"),l=r?.querySelector("details"),i=s.querySelector("details");if(l&&i)i.open=l.open;let d=l?.querySelector("summary")===o;if(s.dataset.runtimeBranch="",r)r.replaceWith(s);else t.prepend(s);if(K("runtime-memory-branch-content",HTMLElement).replaceChildren(...ba(e)),d)(i?.querySelector("summary")??t).focus({preventScroll:!0})}function Ii(e,t){let o=new Set([...e.querySelectorAll("details[open]")].map((l)=>l.firstElementChild?.textContent)),s=yi(t);s.querySelectorAll("details").forEach((l)=>{l.open=o.has(l.firstElementChild?.textContent)});let r=e.querySelectorAll('[role="tabpanel"]');if(!r.length){for(let l of s.children)l.removeAttribute("id");e.replaceChildren(s)}for(let l of r){let i=[...s.children].find((d)=>d.id===l.id);if(!i)continue;i.removeAttribute("id"),i.removeAttribute("tabindex"),l.replaceChildren(i)}}function _i(e,t){let o=K("branch-dialog",HTMLDialogElement),s=K("branch-message",HTMLSelectElement),r=(b)=>K(b,HTMLElement),l=(b)=>K(b,HTMLButtonElement),i={web:n("来源:Web 会话。新会话和原会话可分别继续。","Source: Web session. You can continue the original and the new session separately."),history:n("来源:CLI 最后保存的上下文,不修改 CLI 记录。","Source: Last saved CLI context. The CLI record will not change."),live:n("来源:CLI 当前上下文。无法校验实时位置时不会改用历史记录。","Source: Current CLI context. If the live position cannot be verified, history will not be used instead.")},d,a,c=!1,p=!1,f=new Map;function g(){let b=c||Boolean(a),y=f.get(s.value);s.disabled=b||!f.size,l("branch-fork").disabled=b||y===void 0,l("branch-clone").disabled=b||!p,l("branch-refresh").disabled=b,l("branch-close").disabled=c,D(r("branch-message-preview"),y)}async function k(b){if(c||a)return;let y=a=new AbortController,H=r("branch-status");D(H,n("正在读取可用分支与复制选项…","Loading branch and clone options…")),D(r("branch-error")),g();try{let R=await e.request(`${$o(b)}/branch-options`,void 0,y.signal);if(y.signal.aborted||!o.open||d!==b)return;p=R.canClone===!0,f=new Map(z(R.forkMessages).map(S).flatMap((T)=>{let _=m(T.entryId);return _&&typeof T.text==="string"?[[_,T.text]]:[]}));let M=s.value;if(s.replaceChildren(Se(n("选择一条用户消息","Choose a user message"),""),...Array.from(f,([T,_],E)=>{let x=_.trim().replace(/\s+/g," ");return Se(`${Be.format(E+1)} · ${x.slice(0,100)}${x.length>100?"…":""}`,T)})),f.has(M))s.value=M;D(H,!p&&!f.size?n("此来源没有可分支或复制的上下文。","This source has no context to branch or clone."):"")}catch(R){if(!y.signal.aborted&&o.open&&d===b)p=!1,f.clear(),s.replaceChildren(Se(n("未读取到选项","No options loaded"),"")),D(H),D(r("branch-error"),n(`无法读取分支选项:${ee(R)}`,`Could not load branch options: ${ee(R)}`))}finally{if(a===y)a=void 0;g()}}async function C(b){let y=d;if(!y||c||a)return;c=!0,D(r("branch-error")),D(r("branch-status"),n("正在创建独立的 Web 会话…","Creating a separate Web session…")),g();try{let H=await e.request(`${$o(y)}/branches`,b);if(H.cancelled===!0){D(r("branch-status"),n("已取消,原会话没有修改。","Canceled. The original session did not change."));return}let R=tt(H.session);if(!R?.active)throw new ie(n("没有收到可继续的 Web 会话。请检查会话列表。","No active Web session was returned. Check the session list."),502,"");o.close(),t(R,m(H.editorText),y)}catch(H){D(r("branch-status")),D(r("branch-error"),n(`无法确认新会话:${ee(H)}`,`Could not confirm the new session: ${ee(H)}`))}finally{c=!1,g()}}return s.addEventListener("change",g),K("branch-form",HTMLFormElement).addEventListener("submit",(b)=>{if(b.preventDefault(),!l("branch-fork").disabled)C({kind:"fork",entryId:s.value})}),l("branch-clone").addEventListener("click",()=>void C({kind:"clone"})),l("branch-close").addEventListener("click",()=>o.close()),l("branch-refresh").addEventListener("click",()=>{if(d)k(d)}),o.addEventListener("cancel",(b)=>{if(c)b.preventDefault()}),o.addEventListener("close",()=>{if(o.open)return;a?.abort(),a=void 0,d=void 0}),(b)=>{if(o.open)return;d=b,p=!1,f.clear(),s.replaceChildren(Se(n("选择一条用户消息","Choose a user message"),"")),r("branch-source").textContent=b.name,r("branch-context").textContent=i[b.kind],o.showModal(),k(b)}}var es=(e)=>e instanceof ie&&e.status===409&&(e.code==="tree_stale"||e.code==="session_changed"||e.code==="stale_leaf");function va(e){let{leafId:t,nextCursor:o}=e,s=(d)=>typeof d==="string"&&d.length>0,r=(d)=>d===void 0||typeof d==="string";if(!Array.isArray(e.nodes)||e.nodes.length>40||t!==null&&!s(t)||o!==void 0&&(!s(o)||!e.nodes.length))throw Error("Invalid tree page");let l=new Set;return{nodes:e.nodes.map((d)=>{let{id:a,parentId:c,type:p,role:f,label:g,summary:k}=S(d);if(!s(a)||l.has(a)||c!==null&&!s(c)||!s(p)||!r(f)||!r(g)||!r(k))throw Error("Invalid tree node");return l.add(a),{id:a,parentId:c,type:p,role:f,label:g,summary:k}}),leafId:t,nextCursor:o}}var Wi={user:n("你","You"),assistant:n("助手","Assistant"),toolResult:n("工具结果","Tool result"),bashExecution:n("命令输出","Command output"),message:n("消息","Message"),compaction:n("上下文压缩","Context compaction"),branch_summary:n("分支摘要","Branch summary"),model_change:n("模型变更","Model change"),thinking_level_change:n("思考档变更","Thinking level change"),custom:n("会话记录","Session entry"),session_info:n("会话信息","Session info")},Ni=n("会话位置已变化,请重新读取会话树。","The session position changed. Reload the session tree.");function Bi(e,t,o,s,r){let l=u("section","subpanel stack stack--tight");l.id="runtime-tree";let i=u("p","small muted");i.setAttribute("role","status");let d=u("p","small muted",n("仅显示已加载的节点(最新记录在前),不代表完整的分支结构。选择历史用户消息可将其载入输入框;不会自动发送。","Shows loaded entries (newest first), not the complete branch structure. Select a past user message to load it into the input box without sending it.")),a=u("ul","tree"),c=u("div","row"),p=fe(n("加载更早节点","Load older"),()=>{if(H)X(H)});p.dataset.treeOlder="";let f=fe(n("重新读取会话树","Reload session tree"),()=>{X()});f.dataset.treeReload="";let g=fe(n("切换到空上下文","Switch to an empty context"),()=>O(null));c.append(p,f,g);let k=Ue(n("查看会话节点","View session nodes"),i,d,a,c),C=k.querySelector("summary");l.append(u("h3","",n("会话树","Session tree")),k);let b,y,H,R=[],M=!1,T=!1,_="",E=new Map,x=()=>o()&&k.open;function N(){let U=!s();g.disabled=U;for(let re of E.values())re.disabled=U}function O(U){if(x()&&!M&&y!==void 0&&s())r(U,y)}function P(){let U=document.activeElement;if(i.textContent=_||(y!==void 0&&!E.size?y===null?n("没有可导航的会话节点。","No session nodes to navigate."):n("这一页没有列出活动节点。","This page does not include the active node."):E.size&&y!==null&&y!==void 0&&!E.has(y)?n("活动节点不在已加载的记录中。","The active node is not among the loaded entries."):""),i.classList.toggle("error",M||T),i.hidden=!i.textContent,d.hidden=!E.size,a.hidden=!E.size,p.hidden=M||!H&&U!==p,p.textContent=H?n("加载更早节点","Load older"):n("没有更早的可加载节点","No older entries to load"),f.hidden=!M&&!T&&U!==f,g.hidden=y===void 0||y===null||M,c.hidden=p.hidden&&f.hidden&&g.hidden,p.setAttribute("aria-disabled",String(Boolean(b)||!H)),f.setAttribute("aria-disabled",String(Boolean(b))),N(),x()&&(U===p&&p.hidden||U===g&&g.hidden))(M?f:C).focus({preventScroll:!0})}function Z(U,re){let le=U.nodes.map((q)=>q.id),Q=!re&&y===U.leafId&&le.length===R.length&&le.every((q,L)=>q===R[L]);if(!re&&!Q){let q=new Set(le);for(let[L,I]of E)if(!q.has(L)){if(document.activeElement===I)C.focus({preventScroll:!0});I.parentElement?.remove(),E.delete(L)}}if(y=U.leafId,!Q||E.size===R.length)H=U.nextCursor;if(!re)R=le;let ne=[];for(let q of[...U.nodes].reverse()){let L=E.get(q.id);if(!L){L=fe("",()=>O(q.id),"button--quiet break"),E.set(q.id,L);let v=u("li");v.append(L),a.append(v)}let I=q.role||q.type,A=q.label||(Object.hasOwn(Wi,I)?Wi[I]:I);if(L.textContent=`${A} · ${m(q.summary)||q.id.slice(0,12)}`,q.id===y)L.setAttribute("aria-current","true");else L.removeAttribute("aria-current");ne.push(L.parentElement)}if(!re&&!Q){let q=null;for(let L of ne.reverse()){if(L.nextElementSibling!==q&&!L.contains(document.activeElement))a.insertBefore(L,q);q=L}}}function j(){if(G(),!k.open&&y===void 0)return;if(a.contains(document.activeElement))C.focus({preventScroll:!0});a.replaceChildren(),E.clear(),y=void 0,H=void 0,R=[],M=!0,T=!1,_=Ni,P()}async function X(U){if(!x()||b||U!==void 0&&M)return;let re=b=new AbortController,le=()=>b===re&&x(),Q=U===void 0?"":`?${new URLSearchParams({cursor:U})}`;T=!1,_=U===void 0?n("正在读取会话节点…","Loading session entries…"):n("正在读取更早的节点…","Loading older entries…");let ne=!1;P();try{let q=AbortSignal.any([re.signal,AbortSignal.timeout(12000)]),L=await e.request(`${t}/tree${Q}`,void 0,q);if(!le())return;let I=va(L);if(U!==void 0&&I.leafId!==y){j();return}if(U!==void 0&&(I.nextCursor===U||I.nodes.some((A)=>E.has(A.id))))throw Error("Overlapping tree page");if(M=!1,_="",Z(I,U!==void 0),ne=U!==void 0,document.activeElement===f)C.focus({preventScroll:!0})}catch(q){if(!le())return;if(es(q)){j();return}T=!0,_=U===void 0?n("读取会话树失败。请重试。","Could not load the session tree. Try again."):n("读取更早的节点失败。已保留之前的节点。","Could not load older entries. The loaded entries are kept.")}finally{if(b===re){if(b=void 0,x()){if(P(),ne&&document.activeElement===p)p.scrollIntoView({block:"nearest",behavior:"instant"})}}}}function G(){if(!b)return;b.abort(),b=void 0,_=M?Ni:"",P()}let se=()=>{if(y===void 0&&!M&&!T)X()};return k.addEventListener("toggle",()=>{if(x())se();else G()}),P(),{root:l,activate:se,abort:G,invalidate:j,syncWrites:N,checkLeaf:(U)=>{if(y!==void 0&&y!==U)j()},refresh:()=>{X()}}}function wn(e){return!(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)}function Cn(e,t,o,s){let r=o.length-1;if(r<0)return;switch(e){case"ArrowDown":return t===r?0:t+1;case"ArrowUp":return t<=0?r:t-1;case"PageUp":case"PageDown":{let l=e==="PageUp"?-1:1;if(t<0)return l<0?r:0;let i=l<0?0:r;if(t===i)return t;let d=o[t].getBoundingClientRect().top,a=t+l;while(a!==i&&Math.abs(o[a+l].getBoundingClientRect().top-d)<=s.clientHeight)a+=l;return a}}}function Tn(e,t){let o=e.getBoundingClientRect().top+e.clientTop,s=o+e.clientHeight,r=t.getBoundingClientRect();if(r.top<o)e.scrollTop-=o-r.top;else if(r.bottom>s)e.scrollTop+=Math.min(r.bottom-s,r.top-o)}function Di(e,t,o){let s=!1;t.addEventListener("compositionstart",()=>{s=!0}),t.addEventListener("compositionend",()=>{s=!1}),t.addEventListener("blur",()=>{s=!1}),e.addEventListener("keydown",(r)=>{if(!e.open||s||!wn(r)||o.hidden)return;let l=r.target===t;if(!l&&!(r.target instanceof Element&&o.contains(r.target)))return;let i=Array.from(o.querySelectorAll("button[data-invocation]:enabled")),d=i.findIndex((c)=>c===r.target);if(!l&&d<0)return;if(l&&r.key==="Enter"&&i[0]){r.preventDefault(),i[0].click();return}let a=Cn(r.key,d,i,e);if(a===void 0)return;r.preventDefault(),i[a].focus({preventScroll:!0}),Tn(e,i[a])})}var Pi=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,ka=new Map([["extension",n("扩展","Extension")],["prompt",n("提示模板","Prompt template")],["skill",n("技能","Skill")]]),wa=new Map([["enabled",n("已启用","Enabled")],["disabled",n("已停用","Disabled")],["untrusted",n("不受信任","Untrusted")],["idle",n("空闲","Idle")],["connecting",n("连接中","Connecting")],["connected",n("已连接","Connected")],["degraded",n("降级","Degraded")],["suspended",n("已挂起","Suspended")],["needs_auth",n("需要认证","Authentication required")],["needs_client_registration",n("需要注册客户端","Client registration required")]]),Oi=new Intl.NumberFormat(V);function Ca(e){let t=m(e.invocation),o=m(e.source),s=ka.get(o);if(!s)return;if(o==="skill"?/^\$[A-Za-z0-9-]{1,64}$/.test(t):/^\/[A-Za-z0-9_-]{1,64}$/.test(t))return{name:t,detail:s}}function Ta({name:e,enabled:t,origin:o}){if(typeof e!=="string"||!Pi.test(e)||typeof t!=="boolean")return;let s=o==="package"?n(" · 包来源"," · From package"):o==="top-level"?n(" · 顶层来源"," · Top-level"):"";return{name:e,detail:(t?n("已启用","Enabled"):n("已停用","Disabled"))+s}}function La({name:e,status:t,toolCount:o}){let s=wa.get(m(t));if(!s||typeof e!=="string"||!Pi.test(e)||typeof o!=="number"||!Number.isSafeInteger(o)||o<0)return;return{name:e,detail:n(`${s} · ${Oi.format(o)} 个工具`,`${s} · ${Oi.format(o)} ${o===1?"tool":"tools"}`)}}function ts(e,t){let o=S(e);if(o.status!=="ok"||!Array.isArray(o.rows)||typeof o.incomplete!=="boolean")return{status:"unavailable",reason:o.status==="unavailable"&&o.reason==="rpc-failed"?"rpc-failed":"invalid-response"};let s=o.rows.slice(0,128).flatMap((r)=>t(S(r))??[]);return{status:"ok",rows:s,incomplete:o.incomplete||s.length!==o.rows.length}}function ns(e,t,o){let s=u("section","subpanel stack stack--tight");if(s.append(u("h3","",e)),o.status==="unavailable")return s.append(u("p","small muted",o.reason==="rpc-failed"?n("当前不可用:未能从当前宿主读取。","Unavailable: Could not read from the current host."):n("当前不可用:原生响应格式无效。","Unavailable: The native response was invalid."))),s;if(t)s.append(u("p","small muted",t));if(o.rows.length){let r=u("dl","capability-list small numerical");r.tabIndex=0,r.setAttribute("aria-label",n(`${e} · 只读列表`,`${e} · Read-only list`));for(let l of o.rows){let i=u("div");i.tabIndex=-1;let d=u("dt");d.append(u("code","",l.name)),i.append(d,u("dd","muted",l.detail)),r.append(i)}r.addEventListener("keydown",(l)=>{if(!wn(l))return;let i=r.closest(".details-scroll");if(!i)return;let d=Array.from(r.children),a=d.findIndex((p)=>p===l.target),c=Cn(l.key,a,d,i);if(c===void 0)return;l.preventDefault(),d[c].focus({preventScroll:!0}),Tn(i,d[c])}),s.append(r)}if(o.incomplete)s.append(u("p","small muted",o.rows.length?n("清单不完整,部分项目未显示。","This list is incomplete. Some entries are not shown."):n("清单不完整,没有可显示的项目。","This list is incomplete. No entries can be shown.")));else if(!o.rows.length)s.append(u("p","small muted",n("原生未报告任何条目。","The native host did not report any entries.")));return s}function ji(e){return[ns(n("已加载扩展","Loaded extensions"),n("这里只显示当前会话的原生报告,不是安装清单。","Shows only what the native host reports for this session, not everything installed."),ts(e.extensions,Ta)),ns(n("MCP 服务","MCP servers"),n("状态与工具数由原生报告,不代表工具可立即调用。","The native host reports status and tool counts. Tools may not be ready to use."),ts(e.mcpServers,La)),os(),ns(n("注册命令与技能","Registered commands and skills"),n("已注册不代表当前可执行。","Registered commands and skills may not be available to run."),ts(e.commands,Ca))]}function os(){let e=u("section","subpanel stack stack--tight");return e.id="runtime-compatibility",e.append(u("h3","",n("浏览器原生兼容未启用","Native terminal features are unavailable in the browser")),u("p","small muted",n("尚未验证浏览器终端能在各模式下可靠隔离私密交互。","The browser terminal has not been verified to keep private interactions isolated in every mode.")),u("p","small muted",n("账户登录、凭据、私密授权(含 MCP)、直接 shell 或外部编辑器,请在本机 OmO 终端完成。","Use the local OmO terminal for sign-in, credentials, private approvals (including MCP), direct shell access, and external editors.")),u("p","small muted",n("请自行打开本机 OmO,选择对应的工作目录和会话,再手动操作。此提示不会启动终端、执行或重放命令,也不会传送私密内容。","Open OmO locally and select the working directory and session. This notice does not launch a terminal, run or replay commands, or transmit private content.")),u("p","small muted",n("如果要继续同一会话,符合条件的空闲会话可用「会话管理 → 转到 CLI」先释放,再按回执在本机继续。","To continue an eligible idle session, release it with “Manage session → Move to CLI”, then follow the instructions to continue locally."))),e}var Sn=64,Ln="http://www.w3.org/2000/svg",Sa=0;function xa(e){if(!Array.isArray(e.nodes)||!e.nodes.length||e.nodes.length>Sn||!Array.isArray(e.waves)||!e.waves.length||e.waves.length>e.nodes.length)return;let t=e.nodes.length,o=new Map,s=(i)=>typeof i==="number"&&Number.isInteger(i)&&i>=0&&i<t;for(let i of e.nodes){let{id:d,state:a,upstream:c}=S(i);if(!s(d)||o.has(d)||!Array.isArray(c)||c.length>=t||!c.every(s)||new Set(c).size!==c.length)return;o.set(d,{id:d,state:m(a),upstream:c})}let r=new Map,l=[];for(let[i,d]of e.waves.entries()){let a=S(d);if(a.index!==i||!Array.isArray(a.nodes)||!a.nodes.length||a.nodes.length>o.size)return;let c=[];for(let p of a.nodes){if(!s(p)||r.has(p))return;let f=o.get(p);if(!f)return;r.set(p,i),c.push(f)}l.push(c)}if(r.size!==o.size)return;for(let[i,d]of l.entries())for(let a of d)if(!a.upstream.every((c)=>(r.get(c)??1/0)<i))return;return l}function Fi(e){let t=xa(e);if(!t)return;let o=88,s=46,r=16,l=12,i=96,d=21,a=(x)=>x*(o+r)-r,c=a(Math.max(...t.map((x)=>x.length))),p=Math.min(c,a(2)),f=new Map,g=new Map,k=u("div","dag-graph-map");k.tabIndex=0,k.setAttribute("role","region"),k.setAttribute("aria-label",n("有向依赖图;可滚动,完整依赖见下方文字列表","Scrollable directed dependency graph. See the text list below for all dependencies."));let C=u("div","dag-graph-canvas"),b=(x)=>`${x/16}rem`;for(let[x,N]of t.entries()){let O=l+x*i,P=u("div","dag-graph-wave",n(`第 ${x+1} 波`,`Wave ${x+1}`));P.style.top=b(O),C.append(P);for(let[Z,j]of N.entries()){let X=l+Math.max(0,(p-a(N.length))/2)+Z*(o+r);f.set(j.id,{x:X+o/2,y:O+d,wave:x});let G=u("div","dag-graph-node");G.dataset.node=String(j.id);let se=Bt(j.state);if(se)G.dataset.state=j.state;G.style.left=b(X),G.style.top=b(O+d),G.style.width=b(o),G.style.height=b(s),G.append(u("strong","",n(`节点 ${j.id+1}`,`Node ${j.id+1}`)),u("span","",j.state==="blocked"?n("被依赖阻塞","Blocked"):se??n("状态未知","Unknown"))),C.append(G)}}let y=document.createElementNS(Ln,"svg");y.setAttribute("class","dag-graph-edges"),y.setAttribute("aria-hidden","true"),y.setAttribute("focusable","false");let H=document.createElementNS(Ln,"defs"),R=document.createElementNS(Ln,"marker"),M=`dag-arrow-${++Sa}`;R.setAttribute("id",M),R.setAttribute("viewBox","0 0 6 8"),R.setAttribute("markerWidth","6"),R.setAttribute("markerHeight","8"),R.setAttribute("markerUnits","userSpaceOnUse"),R.setAttribute("refX","6"),R.setAttribute("refY","4"),R.setAttribute("orient","auto");let T=document.createElementNS(Ln,"path");T.setAttribute("d","M0 0 L6 4 L0 8 Z"),R.append(T),H.append(R),y.append(H);for(let x of t)for(let N of x){let O=f.get(N.id);for(let P of N.upstream){let Z=f.get(P),j=Z.y+s,X=O.y-2,G=document.createElementNS(Ln,"path");if(G.dataset.from=String(P),G.dataset.to=String(N.id),G.setAttribute("marker-end",`url(#${M})`),O.wave===Z.wave+1){let se=(j+X)/2;G.setAttribute("d",`M${Z.x} ${j} C${Z.x} ${se} ${O.x} ${se} ${O.x} ${X}`)}else{let se=g.get(P)??g.size;g.set(P,se);let U=l+c+8+5*se;G.setAttribute("d",`M${Z.x} ${j} V${j+6} H${U} V${X-9} H${O.x} V${X}`)}y.append(G)}}let _=2*l+c+g.size*5,E=2*l+(t.length-1)*i+d+s;return C.style.width=b(_),C.style.height=b(E),y.setAttribute("viewBox",`0 0 ${_} ${E}`),C.prepend(y),k.append(C),k}var Ea=new Map([["inactive",n("会话尚未接入,或正在交接。","The session is not connected or is being handed off.")],["binding_unverified",n("无法验证当前会话的宿主绑定。","Could not verify which host owns the current session.")],["unsupported",n("当前宿主或连接方式不支持此读取。","The current host or connection does not support this read.")],["native_unavailable",n("宿主未能提供摘要。","The host could not provide a summary.")],["engine_unavailable",n("宿主连接忙碌、已断开或读取超时。","The host is busy, disconnected, or did not respond in time.")],["web_unsupported",n("当前 Web 服务没有实时摘要入口。","This Web server does not support live summaries.")],["read_refused",n("Web 服务未允许此读取,请确认当前会话仍可用。","The Web server refused this read. Check that the session is still available.")],["read_failed",n("读取失败或超时,可手动刷新。","The read failed or timed out. Refresh to try again.")]]),$e=new Intl.NumberFormat(V);function Ge(e){let t=Y(e);return t!==void 0&&Number.isSafeInteger(t)&&t>=0?t:void 0}function xn(e){switch(e.status){case"unavailable":{let t=Ea.get(m(e.reason))??n("没有可用的读取结果。","No results are available.");return n(`不可用:${t}`,`Unavailable: ${t}`)}case"ownership_changed":return n("会话归属已变化,未显示任何宿主数据。","Session ownership changed. No host data is shown.");default:return n("摘要格式无效,未显示宿主数据。","The summary is invalid. No host data is shown.")}}function no(e){return e.status==="unavailable"&&e.reason==="unsupported"}var Aa=/^[a-f0-9]{64}$/u;function ss(e,t=!1){let o=u("div","dag-readout stack stack--tight");if(e.status!=="ok")return o.append(u("p","small muted",e.status==="not_found"?n("该运行不在当前列表中,请刷新。","This run is no longer in the list. Refresh to try again."):xn(e))),o;let s=new Map(z(e.nodes).slice(0,Sn).map(S).flatMap((r)=>{let l=Ge(r.id);return l===void 0?[]:[[l,r]]}));for(let r of z(e.waves).slice(0,Sn)){let l=S(r),i=Ge(l.index);if(i===void 0)continue;let d=u("section","dag-wave stack stack--tight"),a=u("ol","inline-list numerical");for(let c of z(l.nodes).slice(0,Sn)){let p=Ge(c),f=p===void 0?void 0:s.get(p);if(p===void 0||!f)continue;s.delete(p);let g=t?z(f.upstream).map(Ge).filter((H)=>H!==void 0):[],k=t?m(f.agent)||m(f.category):"",C=Bt(m(f.state))??n("状态未知","Unknown status"),b=Ge(f.attempt),y=u("li","stack stack--tight");if(y.append(u("p","small",[n(`节点 ${$e.format(p+1)}`,`Node ${$e.format(p+1)}`),C,k,b?n(`尝试 ${$e.format(b)} 次`,`Attempts: ${$e.format(b)}`):""].filter(Boolean).join(" · "))),g.length)y.append(u("p","small muted",n(`依赖:${g.map((H)=>`节点 ${$e.format(H+1)}`).join("、")}`,`Depends on: ${g.map((H)=>`Node ${$e.format(H+1)}`).join(", ")}`)));a.append(y)}if(a.childElementCount)d.append(u("h4","",n(`第 ${$e.format(i+1)} 波`,`Wave ${$e.format(i+1)}`)),a),o.append(d)}if(!o.childElementCount)o.append(u("p","small muted",n("运行未提供可显示的波次。","This run did not report any waves to display.")));return o}function Ma(e){if(e.status!=="ok")return ss(e);let t=Fi(e),o=u("div","dag-graph-view stack stack--tight");if(t)o.append(t);else o.append(u("p","small muted",n("无法验证完整拓扑;仅显示可识别的节点,不显示依赖连线。","Could not verify the full graph. Only recognized nodes are shown, without dependency lines.")));let s=u("details","dag-graph-text");return s.open=!t,s.append(u("summary","small",n("文字列表 · 波次与依赖","Text list · Waves and dependencies")),ss(e,!!t)),o.append(s),o}function Vi(e,t,o,s){let r=u("ol","inline-list numerical");for(let[l,i]of t.entries()){let d=u("li","stack stack--tight"),a=e==="dag"?o?z(i.nodes).length:Ge(i.nodeCount):void 0,c=o&&e==="tasks"?i.startedAt:i.createdAt,p=o&&e==="tasks"?i.completedAt:i.updatedAt,f=Bt(m(i.status))??n("状态未知","Unknown status"),g=`${e==="tasks"?n("任务","Task"):n("运行","Run")} ${$e.format(l+1)} · ${f}`,k=m(i.key),C=S(i.counts),b=[["completed",n("完成","Completed")],["running",n("运行中","Running")],["failed",n("失败","Failed")],["blocked",n("阻塞","Blocked")]].flatMap(([R,M])=>{let T=Ge(C[R]);return T?[`${M} ${$e.format(T)}`]:[]}),y=a===void 0?"":[n(`${$e.format(a)} 个节点`,`${$e.format(a)} ${a===1?"node":"nodes"}`),...b].join(" · ");if(s&&e==="dag"&&!o&&Aa.test(k)){let R=u("details","dag-run");R.dataset.dagKey=k;let M=u("div","dag-content"),T=u("p","small muted",n("正在读取波次与依赖…","Loading waves and dependencies…"));T.setAttribute("role","status"),R.append(u("summary","",[g,y].filter(Boolean).join(" · ")),M);let _=!1,E=!1;R.addEventListener("toggle",()=>{if(!R.open||_||E)return;_=!0,M.replaceChildren(T),s(k).then((x)=>{if(R.isConnected)M.replaceChildren(Ma(x));E=x.status==="ok"},(x)=>{if(x instanceof DOMException&&x.name==="AbortError")return;if(R.isConnected)M.replaceChildren(ss({status:"unavailable",reason:"read_failed"}))}).finally(()=>{_=!1})}),d.append(R)}else if(d.append(u("p","metric-label small",g)),y)d.append(u("p","small muted",y));let H=e==="tasks"&&!o&&[m(i.agent),m(i.category),m(i.executionMode)].filter(Boolean).join(" · ");if(H)d.append(u("p","small muted",H));if(Y(c)!==void 0)d.append(u("p","small muted",o&&e==="tasks"?n(`开始:${Ie(c)}`,`Started: ${Ie(c)}`):n(`创建:${Ie(c)}`,`Created: ${Ie(c)}`)));if(Y(p)!==void 0&&p!==c)d.append(u("p","small muted",o&&e==="tasks"?n(`结束:${Ie(p)}`,`Ended: ${Ie(p)}`):n(`更新:${Ie(p)}`,`Updated: ${Ie(p)}`)));r.append(d)}return r}function $a(e,t){let o=u("section","subpanel stack stack--tight");if(o.append(u("h4","",n("磁盘快照 · 只读","Saved snapshot · Read-only"))),t==="waiting"){let s=u("p","small muted",n("正在查找已保存的快照…","Looking for a saved snapshot…"));s.setAttribute("role","status"),o.append(s)}else if(t.status==="ok"){let s=z(e==="tasks"?t.tasks:t.runs).map(S);o.append(u("p","small muted",n(`保存时间:${Ie(t.updatedAt)} · 非实时`,`Saved: ${Ie(t.updatedAt)} · Not live`))),o.append(s.length?Vi(e,s,!0):u("p","small muted",n("快照没有此类记录,不代表当前没有。","No matching records in the snapshot. There may still be live activity.")))}else o.append(u("p","small muted",n("没有可读取的快照。","No readable snapshot.")));return o}function is(e,t,o,s){let r=u("section","subpanel stack stack--tight");r.append(u("h3","",e==="tasks"?n("子代理任务","Subagent tasks"):n("DAG 运行","DAG runs")),u("p","metric-label small",n("实时宿主 · 只读","Live host · Read-only")));let l=u("p","small muted");if(l.setAttribute("role","status"),r.append(l),!t)l.textContent=n("正在读取宿主摘要…","Loading host summary…");else if(t.status==="empty")l.textContent=e==="tasks"?n("宿主报告当前没有子代理任务。","The host reports no current subagent tasks."):n("宿主报告当前没有 DAG 运行。","The host reports no current DAG runs.");else if(t.status==="ok"){let i=z(t.rows).map(S),d=Ge(t.omittedCount);if(i.length&&i.length<=256&&i.every((a)=>Bt(m(a.status))&&Y(a.createdAt)!==void 0&&Y(a.updatedAt)!==void 0&&(e!=="dag"||Ge(a.nodeCount)!==void 0))&&(e==="tasks"?d!==void 0:typeof t.limitReached==="boolean")){if(l.textContent=n(`读到 ${$e.format(i.length)} 条摘要。`,`${$e.format(i.length)} ${i.length===1?"summary":"summaries"} loaded.`),r.append(Vi(e,i,!1,s)),e==="tasks"&&d)r.append(u("p","small muted",n(`宿主另有 ${$e.format(d)} 条未返回。`,`The host omitted ${$e.format(d)} ${d===1?"additional entry":"additional entries"}.`)));if(e==="dag"&&t.limitReached)r.append(u("p","small muted",n("本次读取已达上限,不代表还有下一页。","The read limit was reached. It is not known whether there are more runs.")))}else l.textContent=xn({})}else l.textContent=xn(t);return[r,...t&&o&&no(t)?[$a(e,o)]:[]]}function Ui(e){let t=u("section","subpanel stack stack--tight");t.id="runtime-journal",t.append(u("h3","",n("本会话记忆计数","Session memory counts")));let o=u("p","small muted");if(o.setAttribute("role","status"),t.append(o),!e)o.textContent=n("正在读取会话记忆…","Loading session memory…");else if(e.status==="ok"){let s=Ge(e.totalSteps),r=Ge(e.reflectedSteps);if(s!==void 0&&r!==void 0){o.textContent=n("仅当前会话的原生日志计数,不含共享记忆或原文。","Native journal counts for this session only. Shared memory and original text are not shown.");let l=u("dl","capability-list small numerical");for(let[i,d]of[[n("记录步数","Recorded steps"),s],[n("已反思步数","Reflected steps"),r]]){let a=u("div");a.append(u("dt","",i),u("dd","",$e.format(d))),l.append(a)}t.append(l)}else o.textContent=xn({})}else o.textContent=xn(e);return t}var Ce=(e)=>K(e,HTMLElement),En=(e)=>K(e,HTMLButtonElement),Ra=new Intl.DateTimeFormat(V,{dateStyle:"medium",timeStyle:"short"}),Ki=(e)=>Number.isFinite(new Date(e).getTime())?Ra.format(e):"";function zi(e,t,o,s,r,l){let i=K("cli-history-dialog",HTMLDialogElement),d=K("cli-history-search",HTMLInputElement),a=Ce("cli-history-list"),c=Ce("cli-history-index"),p=Ce("cli-history-record"),f=Ce("cli-history-record-title"),g=Ce("cli-history-activity"),k=En("cli-history-refresh"),C=En("cli-history-refresh-activity"),b=En("cli-history-branch"),y=En("cli-history-resume"),H=Ce("cli-history-resume-status"),R=Ce("cli-history-resume-error"),M=new dt(Ce("cli-history-messages"),i,Ce("cli-history-empty")),T=[],_,E,x,N,O,P=!1,Z=!1,j;function X(){let L=s();b.disabled=!P||j!==void 0,y.disabled=!P&&!Z||j!==void 0||Boolean(L),C.disabled=Z||O!==void 0,D(H,j?n("正在尝试打开同一会话…","Opening the same session in Web…"):P||Z?L:"")}function G(){let L=d.value.trim().toLocaleLowerCase(),I=T.filter((A)=>l(A.cwd)&&`${A.name} ${A.cwd}`.toLocaleLowerCase().includes(L));a.replaceChildren();for(let A of I){let v=u("li"),B=fe("",()=>ne(A),"button--quiet session-link");B.dataset.history=A.id,B.append(u("span","",A.name),u("span","small muted path",A.cwd),u("small","",Ki(A.updatedAt)),...A.adopted?[u("small","muted",n("已在 Web 打开","Open in Web"))]:[]),v.append(B),a.append(v)}a.hidden=!I.length,D(Ce("cli-history-list-status"),x?n("正在读取 CLI 历史…","Loading CLI history…"):_===!1?n("CLI 历史不可用:未启用或未找到本地历史记录。","CLI history is disabled or no local history records were found."):_&&!I.length?L?n("没有匹配的 CLI 历史。","No matching CLI history."):n("没有可显示的 CLI 历史。","No CLI history to show."):"")}async function se(){x?.abort();let L=x=new AbortController;k.disabled=!0,D(Ce("cli-history-list-error")),G();try{let I=await e.request("/api/cli-history",void 0,L.signal);if(L.signal.aborted||!i.open)return;_=I.available===!0,T=z(I.sessions).map(S).flatMap((A)=>{let v=m(A.id);return v?[{id:v,name:m(A.name)||n("未命名 CLI 会话","Untitled CLI session"),cwd:m(A.cwd),updatedAt:Y(A.updatedAt)??0,adopted:A.adopted===!0}]:[]})}catch(I){if(!L.signal.aborted&&i.open)D(Ce("cli-history-list-error"),n(`无法读取 CLI 历史:${ee(I)}`,`Could not load CLI history: ${ee(I)}`))}finally{if(x===L)x=void 0,k.disabled=!1,G()}}let U=(L)=>Gn(L.id);async function re(L){O?.abort();let I=O=new AbortController;X(),g.querySelector("[data-activity-status]")?.remove();let v=u("p","small muted",n("正在读取原生快照…","Loading native snapshot…"));v.dataset.activityStatus="",v.setAttribute("role","status"),g.append(v);try{let B=await e.request(`${U(L)}/activity`,void 0,I.signal);if(I.signal.aborted||!i.open||E!==L)return;Ii(g,B)}catch(B){if(!I.signal.aborted&&i.open&&E===L)v.textContent=n(`无法读取原生快照:${ee(B)}`,`Could not load the native snapshot: ${ee(B)}`),v.className="notice error small",v.setAttribute("role","alert")}finally{if(O===I)O=void 0,X()}}async function le(L){N?.abort();let I=N=new AbortController,A=Ce("cli-history-record-status");D(A,n("正在读取对话记录…","Loading conversation…")),D(Ce("cli-history-record-error"));try{let v=await e.request(U(L),void 0,I.signal);if(I.signal.aborted||!i.open||E!==L)return;let B=S(v.session);f.textContent=m(B.name)||L.name,Z=!1,P=!0,X();let F=Ki(Y(B.updatedAt)??L.updatedAt);Ce("cli-history-record-meta").textContent=[L.cwd,F&&n(`记录更新:${F}`,`Record updated: ${F}`)].filter(Boolean).join(" · ");let oe=z(v.messages).map(S).map((de,ce)=>{let ve=ze(de)==="toolResult"&&m(de.toolCallId);return{key:ve?`result:${ve}`:`history-${ce}`,message:de}});M.render(oe,"",new Map),requestAnimationFrame(()=>{if(!I.signal.aborted&&i.open&&E===L)i.scrollTop=0})}catch(v){if(I.signal.aborted||!i.open||E!==L)return;if(v instanceof ie&&v.code==="history_too_large"){Z=!0,X(),f.textContent=L.name,Ce("cli-history-record-meta").textContent=L.cwd,D(Ce("cli-history-record-error"),n("这条 CLI 历史记录过大,仅显示基本信息,无法预览完整对话。","This CLI history is too large to preview; only basic info is shown."));return}D(Ce("cli-history-record-error"),n(`无法读取这条记录:${ee(v)}`,`Could not load this record: ${ee(v)}`))}finally{if(N===I)N=void 0,D(A)}}function Q(){N?.abort(),N=void 0,O?.abort(),O=void 0,E=void 0,P=!1,Z=!1,j=void 0,D(R),X(),M.reset(),g.replaceChildren()}function ne(L){if(!l(L.cwd))return;Q(),E=L,c.hidden=!0,p.hidden=!1,f.textContent=L.name,Ce("cli-history-record-meta").textContent=L.cwd,Ce("cli-history-empty").hidden=!0,f.focus({preventScroll:!0}),i.scrollTop=0,le(L).then(()=>{if(E===L&&!Z)re(L)})}d.addEventListener("input",G),k.addEventListener("click",()=>void se()),C.addEventListener("click",()=>{if(E&&!Z)re(E)}),b.addEventListener("click",()=>{if(E)o({kind:"history",id:E.id,name:E.name})}),y.addEventListener("click",async()=>{let L=E;if(!L||y.disabled)return;let I=j=Symbol(),A=()=>j===I&&i.open&&E===L;D(R),X(),H.focus();try{let v=await e.resumeHistory(L.id);r(v,A())}catch(v){if(A()){if(D(R,n(`无法在 Web 继续:${ee(v)}`,`Could not continue in Web: ${ee(v)}`)),document.activeElement===H)R.focus()}}finally{if(j===I)j=void 0,X()}}),En("cli-history-back").addEventListener("click",()=>{let L=E?.id;Q(),p.hidden=!0,c.hidden=!1,([...a.querySelectorAll("button")].find((I)=>I.dataset.history===L)??d).focus()}),i.querySelector("[data-close]")?.addEventListener("click",()=>i.close()),i.addEventListener("close",()=>{if(i.open)return;x?.abort(),x=void 0,Q(),t()});function q(L){if(!i.open)Q(),p.hidden=!0,c.hidden=!1,d.value="",i.showModal();se().then(()=>{if(!i.open||L===void 0)return;let I=T.find((A)=>A.id===L);if(I)ne(I)})}return{open:q,update:X}}var Te=(e)=>K(e,HTMLElement),xe=(e)=>K(e,HTMLButtonElement),rs=n("仅普通文字。命令、权限审批及私密交互请回到 CLI 处理。","Plain text only. Use the CLI for commands, permission approvals, and private interactions."),Gi=new Set(["terminal_not_attached","terminal_not_found","terminal_offline"]);function Zi(e,t,o,s){let r=K("cli-live-dialog",HTMLDialogElement),l=K("cli-live-session",HTMLSelectElement),i=K("cli-live-input",HTMLTextAreaElement),d=new dt(Te("cli-live-messages"),Te("cli-live-transcript"),Te("cli-live-empty")),a=new Map,c=new Map,p=new Map,f=[],g=[],k,C="",b="",y,H,R,M,T=!1,_=500,E="waiting",x=!1,N={},O=[],P,Z=!0;function j(){let q=g.find((ve)=>ve.id===l.value),L=q!==void 0&&C===q.id,I=L&&x&&E==="open"&&!R,A=N.running===!0||N.compacting===!0,v=L||Boolean(q&&b===q.id),B=Boolean(q&&p.get(q.id)===i.value);l.disabled=Boolean(C||R||y||!g.length),xe("cli-live-close").disabled=Boolean(R),xe("cli-live-connect").hidden=L,xe("cli-live-connect").disabled=!q||!k||!e.token||E!=="open"||Boolean(R||y),xe("cli-live-disconnect").hidden=!L,xe("cli-live-disconnect").disabled=Boolean(R),xe("cli-live-refresh").disabled=Boolean(R||y),xe("cli-live-branch").hidden=!L,xe("cli-live-branch").disabled=!I||A,xe("cli-live-send").disabled=!I||A||B||!i.value.trim();let F=xe("cli-live-stop"),oe=L&&N.running===!0&&Boolean(m(N.turnId));if(!oe&&document.activeElement===F)i.focus({preventScroll:!0});F.hidden=!oe,F.disabled=!I,i.readOnly=R==="input",Te("cli-live-conversation").hidden=!v&&!i.value,D(Te("cli-live-workspace"),q?.cwd);let de=R==="connect"?n("正在连接 CLI…","Connecting to CLI…"):R==="disconnect"?n("正在释放 Web 连接…","Disconnecting Web…"):E==="lost"?n("实时更新已离线,草稿会保留。连接恢复后只刷新消息,不会重发。","Live updates are offline. Your draft is kept. Reconnecting refreshes messages without resending them."):y?n("正在查找本地 CLI 会话…","Looking for local CLI sessions…"):L?!x?n("正在同步 CLI 对话…","Syncing the CLI conversation…"):N.compacting===!0?n("CLI 正在压缩上下文。","CLI is compacting context."):N.running===!0?n("已连接 · CLI 正在运行","Connected · CLI is running"):n("已连接 · 等待输入","Connected · Waiting for input"):k===!1?n("CLI 实时不可用:未启用或找不到本地终端控制服务。","Live CLI is unavailable. The local terminal service is disabled or could not be found."):!g.length?n("没有发现可连接的 CLI 会话。","No CLI sessions are available to connect."):E==="waiting"?n("正在等待 Web 实时连接…","Waiting for the Web connection…"):b===q?.id?O.length?n("已断开;显示最后一次同步的消息。","Disconnected. Showing the last synced messages."):n("已断开。","Disconnected."):n("选择会话后,点击「连接」读取对话。","Select a session and choose “Connect” to read the conversation."),ce=b===q?.id&&(L?x:!R)?P==="unavailable"?n(" · 对话记录暂不可读"," · Conversation history is unavailable"):P==="truncated"?n(" · 仅显示部分近期消息"," · Showing a limited set of recent messages"):"":"";D(Te("cli-live-status"),de+ce),Te("cli-live-hint").textContent=B?n(`上一次发送的结果未知,请先核对 CLI,不要重发这条消息。${rs}`,`Delivery of your last message is unknown. Check the CLI before trying again. Do not resend this message. ${rs}`):rs}function X(){b="",N={},O=[],P=void 0,d.reset(),i.value=c.get(l.value)??"",D(Te("cli-live-error")),D(Te("cli-live-receipt")),j()}function G(){let q=l.value,L=C||(R==="connect"?q:"");if(g=f.filter((I)=>I.id===L||s(I.cwd)),l.replaceChildren(Se(n("选择可用会话","Choose a session"),""),...g.map((I)=>Se(I.name,I.id))),l.value=g.some((I)=>I.id===q)?q:g.length===1?g[0]?.id??"":"",l.value!==q)X()}async function se(){if(C||y||!r.open)return;let q=y=new AbortController;D(Te("cli-live-error")),j();try{let L=await e.request("/api/cli-live",void 0,q.signal);if(!r.open||q.signal.aborted)return;k=L.available===!0,f=z(L.sessions).map(S).flatMap((I)=>{let A=m(I.id);return A?[{id:A,name:m(I.name)||n("未命名 CLI 会话","Untitled CLI session"),cwd:m(I.cwd)}]:[]}),G()}catch(L){if(!q.signal.aborted&&r.open)k=!1,D(Te("cli-live-error"),n(`无法发现 CLI 会话:${ee(L)}`,`Could not find CLI sessions: ${ee(L)}`))}finally{if(y===q)y=void 0;j()}}function U(q,L){N=S(L.state);let I=S(L.transcript).status;P=I==="truncated"||I==="unavailable"?I:void 0;let A=O;O=z(L.messages).map(S).map((B,F)=>({key:`cli-live:${F}`,message:JSON.stringify(A[F]?.message)===JSON.stringify(B)?A[F]?.message??B:B}));let v=O.at(-1);if(!v&&P)d.reset();else d.render(O,v?.message.streaming===!0?v.key:"",a,b!==q);Te("cli-live-empty").hidden=Boolean(P)||O.length>0,b=q,x=!0,_=500}function re(){clearTimeout(M),M=void 0,H?.abort(),H=void 0,T=!1}function le(q=50){if(!r.open||!C||E!=="open")return;if(H||R){T=!0;return}if(M!==void 0&&q!==0)return;clearTimeout(M),M=window.setTimeout(()=>{M=void 0,Q()},q)}async function Q(){let q=C;if(!q||H||!r.open||E!=="open")return;if(R){T=!0;return}let L=H=new AbortController,I=()=>C===q&&r.open&&!L.signal.aborted,A=0;T=!1;try{let v=await e.request(Zn(q),void 0,AbortSignal.any([L.signal,AbortSignal.timeout(1e4)]));if(I()){if(U(q,v),Te("cli-live-error").dataset.read==="true")D(Te("cli-live-error"))}}catch(v){if(I()){if(x=!1,v instanceof ie&&Gi.has(v.code))C="";else A=_,_=Math.min(_*2,5000);let B=Te("cli-live-error");if(B.hidden||B.dataset.read==="true")B.dataset.read="true",D(B,n(`无法同步 CLI 对话:${ee(v)}`,`Could not sync the CLI conversation: ${ee(v)}`))}}finally{if(H===L)H=void 0;if(I()&&(A||T))le(A||50);j()}}async function ne(q,L){if(!q||R)return;R=L.action;let I=Te("cli-live-error");if(delete I.dataset.read,D(I),L.action!=="disconnect")D(Te("cli-live-receipt"));if(L.action==="disconnect")re();j();let A;try{let v=await e.cliLiveAction(q,L);switch(L.action){case"connect":C=q,U(q,v),A=i;break;case"disconnect":C="",x=!1,A=xe("cli-live-connect");break;case"input":c.delete(q),p.delete(q),i.value="",D(Te("cli-live-receipt"),v.disposition==="held"?n("CLI 已暂存消息;请在 CLI 查看,勿重发。","The CLI is holding the message. Check the CLI and do not resend it."):v.disposition==="queued"?n("CLI 已将消息加入队列。","The CLI queued the message."):n("CLI 已接收消息。","The CLI accepted the message."));break;case"stop":D(Te("cli-live-receipt"),n("当前回合已停止。","The current turn stopped.")),A=i;break}}catch(v){if(L.action==="input"&&(!(v instanceof ie)||v.status>=500||v.code==="terminal_outcome_unknown"))p.set(q,L.message);if(v instanceof ie&&Gi.has(v.code))C="",x=!1;D(I,ee(v))}finally{if(R=void 0,!C&&(L.action==="disconnect"||L.action==="connect"))G();if(j(),r.open)A?.focus({preventScroll:!0});if(C)le(0)}}return l.addEventListener("change",X),i.addEventListener("input",()=>{c.set(l.value,i.value),j()}),xe("cli-live-connect").addEventListener("click",()=>void ne(l.value,{action:"connect"})),xe("cli-live-disconnect").addEventListener("click",()=>void ne(C,{action:"disconnect"})),xe("cli-live-refresh").addEventListener("click",()=>{if(C)le(0);else se()}),xe("cli-live-stop").addEventListener("click",()=>{let q=m(N.turnId);if(q)ne(C,{action:"stop",expectedTurnId:q})}),xe("cli-live-branch").addEventListener("click",()=>{let q=g.find((L)=>L.id===C);if(q)o({...q,kind:"live"})}),K("cli-live-form",HTMLFormElement).addEventListener("submit",(q)=>{if(q.preventDefault(),!xe("cli-live-send").disabled)ne(C,{action:"input",mode:"prompt",clientMessageId:crypto.randomUUID(),message:i.value})}),xe("cli-live-close").addEventListener("click",()=>r.close()),r.addEventListener("cancel",(q)=>{if(R)q.preventDefault()}),r.addEventListener("close",()=>{if(r.open)return;if(y?.abort(),y=void 0,re(),C)ne(C,{action:"disconnect"});if(Z)t();Z=!0}),{open(){if(r.open)return;if(r.showModal(),j(),!C)se()},scopeChanged(){G(),j()},closeAfterBranch(){Z=!1,r.close()},invalidate(q){if(C&&C===q)le()},setTransport(q){if(q===E)return;if(E=q,q!=="open")x=!1,re();else if(C)le(0);else if(!k)se();j()}}}var qa=2000,Qi=8000,Ha={pending:n("正在查找 CLI 会话…","Looking for a CLI session…"),none:n("未发现可跟随的 CLI 会话。","No CLI session to follow."),ambiguous:n("有多个 CLI 会话,无法确认跟随哪一个。","Multiple CLI sessions were found. Could not determine which one to follow."),unavailable:n("无法核验 CLI 会话,暂不显示对话。","Could not verify the CLI session. The conversation is hidden.")};function Ia(e,t){switch(e.status){case"none":return{status:"none"};case"ambiguous":return{status:"ambiguous"};case"ok":{let o=S(e.session),s=m(o.id),r=m(o.cwd),l=m(o.name);if(!s||!r||!t(r)||typeof o.name!=="string"||typeof o.running!=="boolean"||!Array.isArray(e.messages))return{status:"unavailable"};let i=S(e.transcript).status,d=[];for(let a of i==="unavailable"?[]:e.messages){let{role:c,content:p,timestamp:f,streaming:g}=S(a);if(c!=="user"&&c!=="assistant"&&c!=="custom"||typeof p!=="string")return{status:"unavailable"};d.push({role:c,content:p,timestamp:Y(f),streaming:c==="assistant"&&g===!0})}return{status:"ok",target:{id:s,name:l||n("未命名 CLI 会话","Untitled CLI session"),cwd:r,running:o.running},messages:d,...i==="truncated"||i==="unavailable"?{history:i}:{}}}default:return{status:"unavailable"}}}function Yi(e,t,o){let s=K("cli-follow-view",HTMLElement),r=K("cli-follow-status",HTMLElement),l=K("cli-follow-empty",HTMLElement),i=new dt(K("cli-follow-messages",HTMLElement),s,l),d=new Map,a=!1,c,p="",f,g,k=[];function C(){k=[],i.reset(),l.hidden=!0}function b(T,_=!1,E){let x=T==="ok"?n(`只读跟随 · ${_?"CLI 正在运行":"CLI 未在运行"}`,`Following · Read-only · ${_?"CLI is running":"CLI is idle"}`):Ha[T],N=E==="unavailable"?n(" · 对话记录暂不可读"," · Conversation history is unavailable"):E==="truncated"?n(" · 仅显示部分近期消息"," · Showing a limited set of recent messages"):"";if(r.dataset.state!==T)r.dataset.state=T;if(r.textContent!==x+N)r.textContent=x+N}function y(T){let _=c;if(T.status!=="ok"){if(c)C();if(c=void 0,b(T.status),_)o();return}c=T.target,p=c.cwd;let E=!_||_.id!==c.id||_.cwd!==c.cwd;if(E)C();b("ok",c.running,T.history);let x=new Map(k.map((P)=>[P.key,P])),N=new Set,O=T.messages.map((P,Z)=>{let j=Nt(P)||`follow:${Z}`,X=N.has(j)?`${j}:${Z}`:j;N.add(X);let G=x.get(X);return G&&JSON.stringify(G.message)===JSON.stringify(P)?G:{key:X,message:P}});if(T.history&&O.length===0)C();else if(E||k.length!==O.length||O.some((P,Z)=>P!==k[Z])){k=O;let P=k.at(-1);i.render(k,P?.message.streaming===!0?P.key:"",d,E)}if(l.hidden=Boolean(T.history)||k.length>0,E||_?.name!==c.name)o()}function H(){clearTimeout(g),g=void 0,f?.abort(),f=void 0}async function R(){if(!a||document.hidden||f)return;let T=f=new AbortController,_=AbortSignal.any([T.signal,AbortSignal.timeout(Qi)]),E=performance.now()+Qi,x=()=>a&&!document.hidden&&f===T;try{let N=await e.request("/api/cli-follow",void 0,_).catch(()=>{return});if(x())y(!N||_.aborted||performance.now()>=E?{status:"unavailable"}:Ia(N,t))}finally{if(f===T){if(f=void 0,a&&!document.hidden)g=window.setTimeout(()=>{g=void 0,R()},qa)}}}function M(){if(!a)return;a=!1,H(),c=void 0,p="",C(),o()}return document.addEventListener("visibilitychange",()=>{if(!a)return;if(document.hidden){if(H(),c)C(),c=void 0,o();b("pending")}else R()}),window.addEventListener("pagehide",M),{get active(){return a},get target(){return c},get workspace(){return p},start(){if(a)return;a=!0,b("pending"),o(),R()},stop:M,recheckWorkspace(){if(!p||t(p))return;p="",y({status:"unavailable"})}}}var Ji=1e4,Xi=(e)=>e instanceof DOMException&&e.name==="TimeoutError";function as(e){return Array.isArray(e)?[...new Set(e.filter((t)=>typeof t==="string"&&Boolean(t)))]:[]}function er(e,t,o,s){let r=K("workspace-browser-button",HTMLButtonElement),l=K("workspace-browser-dialog",HTMLDialogElement),i=K("workspace-browser-close",HTMLButtonElement),d=K("workspace-browser-form",HTMLFormElement),a=K("workspace-browser-path",HTMLInputElement),c=K("workspace-browser-use",HTMLButtonElement),p=K("workspace-browser-navigation",HTMLElement),f=K("workspace-browser-root-field",HTMLElement),g=K("workspace-browser-root",HTMLSelectElement),k=K("workspace-browser-up",HTMLButtonElement),C=K("workspace-browser-current",HTMLElement),b=K("workspace-browser-status",HTMLElement),y=K("workspace-browser-entries",HTMLUListElement),H=K("workspace-browser-feedback",HTMLElement),R=K("workspace-browser-approval",HTMLElement),M=K("workspace-browser-approval-title",HTMLElement),T=K("workspace-browser-approval-path",HTMLElement),_=K("workspace-browser-confirm",HTMLButtonElement),E=K("workspace-browser-deny",HTMLButtonElement),x,N,O,P=0,Z="";function j(v="",B=!1){H.classList.toggle("error",B),D(H,v)}function X(){let v=N?.kind==="decision",B=N?.kind==="prepare";p.hidden=Boolean(O),R.hidden=!O,T.textContent=O?.path??"",c.disabled=!a.value||B||v,g.disabled=B,k.disabled=!Z||B,i.setAttribute("aria-disabled",String(v)),_.setAttribute("aria-disabled",String(v)),E.setAttribute("aria-disabled",String(v))}function G(v){if(clearTimeout(P),O=v,v)P=window.setTimeout(()=>{if(O===v&&N?.kind!=="decision")se()},v.expiresAt-Date.now());X()}function se(){G(),j(n("审批已过期。请重新选择「使用此目录」,发起新的审批。","Approval expired. Choose “Use this directory” to request approval again."),!0),c.focus()}function U(){let v=N;N=void 0,v?.controller.abort()}async function re(v,B,F,oe,de){if(!l.open||N?.kind==="decision"||!x)return;U();let ce={kind:v,controller:new AbortController};N=ce,X();let ve=performance.now()+Ji,Me=AbortSignal.any([ce.controller.signal,AbortSignal.timeout(Ji)]),Ve;try{let lt=new Promise((Ns,Br)=>{Ve=()=>Br(Me.reason),Me.addEventListener("abort",Ve,{once:!0})}),Ao=await Promise.race([e.request(`/api/workspaces/${B}`,F,Me),lt]);if(N!==ce||!l.open||ce.controller.signal.aborted)return;if(Me.throwIfAborted(),performance.now()>=ve)throw new DOMException("Workspace request timed out","TimeoutError");N=void 0,X(),oe(Ao)}catch(lt){if(N!==ce&&N!==void 0||!l.open||ce.controller.signal.aborted)return;N=void 0,X(),de(lt)}finally{if(Ve)Me.removeEventListener("abort",Ve)}}function le(v=""){Z="",C.textContent=v,C.hidden=!v,y.replaceChildren(),y.hidden=!0}function Q(v,B=!0){if(!v||O||N?.kind==="prepare"||!l.open)return;if(a.value=v,B)C.textContent=v,C.hidden=!1,C.focus({preventScroll:!0});le(v),j(),b.textContent=n("正在读取目录…","Reading directory…"),re("browse","browse",{path:v},(F)=>{let oe=m(F.path);if(!oe||!Array.isArray(F.entries))throw Error("Invalid browse response");Z=m(F.parent),C.textContent=oe,a.value=oe,g.value=t().roots.includes(oe)?oe:"";for(let de of F.entries){let{name:ce,path:ve,kind:Me}=S(de);if(typeof ce!=="string"||!ce||typeof ve!=="string"||!ve)continue;if(Me!=="directory"&&Me!=="file")continue;let Ve=u("li"),lt=Me==="directory"?fe("",()=>Q(ve),"button--quiet workspace-entry"):u("div","workspace-entry");lt.append(u("bdi","break",ce),u("span","small muted",Me==="directory"?n("目录 ›","Folder ›"):n("文件","File"))),Ve.append(lt),y.append(Ve)}y.hidden=!y.childElementCount,b.textContent=F.truncated===!0?n("目录条目太多,仅显示部分名称。","This directory has too many entries to show them all."):y.hidden?n("没有可显示的条目。","No entries to show."):"",X()},(F)=>{b.textContent="",g.value="",j(Xi(F)?n("读取目录超时。请重新选择一个已授权工作区。","Reading the directory timed out. Choose an authorized directory and try again."):n("无法读取该目录。只能浏览已授权范围内仍可访问的目录。","Could not read this directory. You can only browse accessible directories within authorized locations."),!0)})}function ne(v){let B=m(v.path),F=as(v.workspaces);if(!B||!F.includes(B))throw Error("Invalid workspace selection receipt");l.close(),o(B,F)}function q(v){if(!v||O||N?.kind==="prepare")return;if(N?.kind==="browse")b.textContent=n("目录读取已取消。","Directory read canceled.");j(n("正在核验目录…","Verifying directory…")),re("prepare","prepare",{path:v},(B)=>{if(B.status==="authorized"){ne(B);return}let F=m(B.path),oe=m(B.confirmation),de=Y(B.expiresAt);if(B.status!=="confirmation_required"||!F||!oe||de===void 0)throw Error("Invalid approval response");if(a.value=F,de<=Date.now()){se();return}j(),G({token:oe,path:F,expiresAt:de}),M.focus()},(B)=>{j(Xi(B)?n("核验目录超时。路径已保留,请重试。","Directory verification timed out. The path is still in the field. Try again."):n("无法核验目录。请检查绝对路径、目录是否仍存在及本机 Web 服务是否可用。","Could not verify the directory. Check the absolute path, whether the directory still exists, and whether the local Web server is running."),!0)})}function L(v,B=!1){if(!O||N?.kind==="decision")return;let{token:F,expiresAt:oe}=O;if(oe<=Date.now()){se();return}clearTimeout(P),j(v?n("正在提交允许决定…","Granting access…"):n("正在提交拒绝决定…","Denying access…")),re("decision","confirm",{confirmation:F,allow:v},(de)=>{if(v){ne(de);return}if(de.status!=="cancelled")throw Error("Invalid denial receipt");if(G(),B)l.close();else j(n("已拒绝。工作区未切换。","Access denied. The selected directory did not change.")),c.focus()},(de)=>{G();let ce=de instanceof ie&&(de.code==="workspace_confirmation_stale"||de.status===410);j(ce?n("审批已失效:可能已过期或目录已变更。请重新核验路径。","Approval expired or the directory changed. Verify the path again."):n("未能确认审批结果,未切换工作区。请重新核验路径。","Could not confirm the approval result. The selected directory did not change. Verify the path again."),!0),c.focus()})}function I(){if(N?.kind==="decision")return;if(O)L(!1,!0);else U(),l.close()}function A(){let{roots:v}=t(),B=g.value;g.replaceChildren(Se(n("选择已授权工作区","Choose an authorized directory"),""),...v.map((F)=>Se(F,F))),g.value=v.includes(B)?B:"",f.hidden=!v.length}return r.addEventListener("click",()=>{if(!x||document.querySelector("dialog:modal"))return;U(),G(),j();let{roots:v,selected:B}=t(),F=v.includes(B)?B:v[0]??"";if(A(),g.value=F,a.value=F,b.textContent=F?"":n("没有已授权目录。可手动输入目录的绝对路径。","No directories are authorized. Enter an absolute directory path."),le(),X(),l.showModal(),F)Q(F,!1)}),d.addEventListener("submit",(v)=>{v.preventDefault(),q(a.value)}),a.addEventListener("input",()=>{if(N?.kind==="browse"||N?.kind==="prepare"){if(N.kind==="browse")b.textContent=n("目录读取已取消。","Directory read canceled.");U()}j(),X()}),g.addEventListener("change",()=>Q(g.value)),k.addEventListener("click",()=>Q(Z)),_.addEventListener("click",()=>L(!0)),E.addEventListener("click",()=>L(!1)),i.addEventListener("click",I),l.addEventListener("cancel",(v)=>{v.preventDefault(),I()}),l.addEventListener("close",()=>{if(l.open)return;if(U(),G(),j(),le(),!document.querySelector("dialog:modal"))s()}),{update(v,B){let F=S(v).platform,oe=F==="win32"||F==="posix"?F:void 0,de=x!==oe||B;if(x=oe,r.hidden=!x,a.placeholder=x==="win32"?"C:\\Projects\\OmO":"/home/me/projects/OmO",!l.open)return;if(!x)U(),l.close();else{if(A(),!de)return;U(),G(),le(),b.textContent="",j(n("本机 Web 服务连接已更新。请重新选择或核验目录。","The local Web server connection changed. Choose a directory or verify the path again."),!0),a.focus()}}}}var tr=["scoped-models","favorite-models","task-kill","login","logout","trust","export","import","share","reload","keybindings","changelog","quit","exit","bug","debug"];var sr=120,ir=6000,oo=sr.toLocaleString(V),so=ir.toLocaleString(V),ls=[{name:"new",invocation:"/new",label:n("新会话","New session"),description:n("开始一个新会话。","Start a new session.")},{name:"resume",invocation:"/resume",label:n("继续会话","Resume session"),description:n("从历史会话中选择一个继续。","Choose a past session to resume.")},{name:"sessions",invocation:"/sessions",label:n("会话列表","Session list"),description:n("列出历史会话并继续其中一个。","Browse and resume past sessions.")},{name:"rename",invocation:"/rename",label:n("重命名","Rename"),description:n(`重命名当前会话(名称可选,最长 ${oo} 字)。`,`Rename the current session. The name is optional and can be up to ${oo} characters.`)},{name:"name",invocation:"/name",label:n("重命名(别名)","Rename (alias)"),description:n("与 /rename 相同:设置会话显示名。","Alias for /rename. Set the session's display name.")},{name:"session",invocation:"/session",label:n("会话信息","Session info"),description:n("查看当前会话的信息与统计。","View details and statistics for this session.")},{name:"tree",invocation:"/tree",label:n("会话树","Session tree"),description:n("查看会话分支树并跳到任意点继续。","Browse session branches and resume from any point.")},{name:"todo",invocation:"/todo",label:n("本会话待办","Session Todo"),description:n("查看当前分支的待办。","View the Todo list for the current branch.")},{name:"tasks",invocation:"/tasks",label:n("本会话任务","Session tasks"),description:n("查看当前会话的原生子代理任务。","View native subagent tasks for this session.")},{name:"dag",invocation:"/dag",label:n("本会话 DAG","Session DAG"),description:n("查看本会话的运行,展开读取波次和依赖。","View workflow runs and expand them to inspect execution waves and dependencies.")},{name:"help",invocation:"/help",label:n("命令帮助","Command help"),description:n("查看 Web 可用的命令和快捷键。","See which commands and keyboard shortcuts are available on the web.")},{name:"hotkeys",invocation:"/hotkeys",label:n("快捷键","Keyboard shortcuts"),description:n("查看此工作台的键盘操作。","View keyboard shortcuts for the workbench.")},{name:"fork",invocation:"/fork",label:n("分支","Fork"),description:n("选择一条用户消息,从该消息之前创建分支。","Choose a user message and start a branch from just before it.")},{name:"clone",invocation:"/clone",label:n("副本","Clone"),description:n("复制当前会话为新会话并切换过去。","Copy the current session and switch to the copy.")},{name:"compact",invocation:"/compact",label:n("压缩上下文","Compact context"),description:n(`手动压缩上下文(指示可选,最长 ${so} 字)。`,`Compact context manually. Optional instructions can be up to ${so} characters.`)},{name:"settings",invocation:"/settings",label:n("会话设置","Session settings"),description:n("打开当前会话的运行设置;全局配置请在本机终端修改。","Open this session's run settings. Change global configuration in the local terminal.")},{name:"setting",invocation:"/setting",label:n("会话设置(别名)","Session settings (alias)"),description:n("与 /settings 相同。","Alias for /settings.")},{name:"model",invocation:"/model",label:n("模型","Model"),description:n("切换本会话的模型(只对当前会话有效)。","Change the model for this session only.")},{name:"thinking",invocation:"/thinking",label:n("思考档位","Thinking level"),description:n("设置思考档位(可选;档位按实际可选值校验)。","Set a thinking level. If specified, it must be one of the available levels.")},{name:"reasoning",invocation:"/reasoning",label:n("推理状态","Reasoning status"),description:n("查看当前模型是否启用推理。持久设置在本机修改。","Check whether reasoning is enabled for the current model. Change persistent settings in the native client.")},{name:"efforts",invocation:"/efforts",label:n("原生推理档位","Native reasoning levels"),description:n("查看当前档和原生可用档位。持久设置在本机修改。","View the current level and available native levels. Change persistent settings in the native client.")},{name:"fast",invocation:"/fast",label:n("极速模式","Fast mode"),description:n("切换极速模式(开、关或不带参数切换;只影响当前模型)。","Set fast mode to on or off, or omit the argument to toggle it. Applies only to the current model.")},{name:"copy",invocation:"/copy",label:n("复制","Copy"),description:n("复制上一条助手消息。","Copy the last assistant message.")}],_a=ls.map((e)=>e.name);function rr(e){let t=en(e);return t.kind==="builtin"&&["session","tree","todo","tasks","dag","help","hotkeys","reasoning","efforts","settings","setting"].includes(t.command.name)}var Wa=/^\/[A-Za-z][A-Za-z0-9_-]*/,nr=/[\0-\b\v\f\x0e-\x1f\x7f]/,Na=/^[A-Za-z0-9_./:@+-]+$/,or=n("命令只能是单行文本,不能包含换行或控制字符。","Commands must be on one line and cannot contain control characters."),ct=(e)=>({kind:"malformed",message:e});function en(e){let t=Wa.exec(e)?.[0];if(t===void 0)return{kind:"plain"};let o=e.slice(t.length),s=t.slice(1),r=_a.find((d)=>d===s),l=tr.find((d)=>d===s);if(r===void 0&&l===void 0)return{kind:"plain"};if(o!==""&&!/^[ \t\r\n]/.test(o))return nr.test(o[0])?ct(or):{kind:"plain"};if(nr.test(e)||e.includes("\r")||e.includes(`
|
|
7
|
-
`))return ct(or);if(l!==void 0)return{kind:"tui-only",name:l};let i=o.trim();switch(r){case"new":case"resume":case"sessions":case"session":case"tree":case"todo":case"tasks":case"dag":case"help":case"hotkeys":case"fork":case"clone":case"copy":case"settings":case"setting":if(i!=="")return ct(n(`“/${r}”不带参数。`,`/${r} does not take arguments.`));return{kind:"builtin",command:{name:r}};case"reasoning":case"efforts":return i===""?{kind:"builtin",command:{name:r}}:{kind:"tui-only",name:r};case"rename":case"name":if(i.length>sr)return ct(n(`会话名称不能超过 ${oo} 字。`,`Session names can be up to ${oo} characters.`));return{kind:"builtin",command:{name:r,...i===""?{}:{value:i}}};case"compact":if(i.length>ir)return ct(n(`压缩指示不能超过 ${so} 字。`,`Compaction instructions can be up to ${so} characters.`));if(i==="")return{kind:"builtin",command:{name:"compact"}};return{kind:"builtin",command:{name:"compact",instructions:i}};case"model":if(i==="")return{kind:"builtin",command:{name:"model"}};if(/(^|\s)--\S/.test(i))return ct(n("Web 只接受精确模型引用,不支持 --default 等持久化参数。","The web app accepts exact model references only. Persistent flags such as --default are not supported."));if(!Na.test(i))return ct(n("模型引用只能是单个精确引用(如 provider/model)。","Enter one exact model reference, such as provider/model."));return{kind:"builtin",command:{name:"model",reference:i}};case"thinking":if(i==="")return{kind:"builtin",command:{name:"thinking"}};if(!/^[^\s]+$/.test(i))return ct(n("请输入单个思考档位,例如 high。","Enter a single thinking level, such as high."));return{kind:"builtin",command:{name:"thinking",level:i.toLowerCase()}};case"fast":{if(i==="")return{kind:"builtin",command:{name:"fast"}};let d=i.toLowerCase();return d==="on"||d==="off"?{kind:"builtin",command:{name:r,mode:d}}:ct(n("“/fast”只接受 on、off 或无参数(切换)。","Use /fast on, /fast off, or /fast to toggle."))}default:return{kind:"plain"}}}var Ot=/^(?:\/(?:[A-Za-z0-9_-]{1,64}|skill:[A-Za-z0-9-]{1,64})|\$[A-Za-z0-9-]{1,64})$/,Ba=/^(?:\/(?:[A-Za-z0-9_-]{0,64}|skill:[A-Za-z0-9-]{0,64})|\$[A-Za-z0-9-]{0,64})$/;function io(e){return[...ls.map((t)=>({...t,source:"builtin"})),...z(e).map(S).filter((t)=>en(m(t.invocation)).kind==="plain")]}function ar(e,t){let o=[],s=-1,r,l=!1;function i(){o=[],s=-1,t.hidden=!0,e.removeAttribute("aria-activedescendant")}function d(a){let c=o[a];if(!c)return;e.value=`${c.invocation} `,e.focus(),e.setSelectionRange(e.value.length,e.value.length),i(),e.dispatchEvent(new Event("input",{bubbles:!0}))}return e.addEventListener("compositionstart",()=>{l=!0,i()}),e.addEventListener("compositionend",()=>{l=!1}),e.addEventListener("blur",i),t.addEventListener("mousedown",(a)=>a.preventDefault()),t.addEventListener("click",(a)=>{let c=a.target;if(!(c instanceof Element))return;let p=Array.from(t.children).findIndex((f)=>f.contains(c));d(p)}),{get composing(){return l},reset(){r=void 0,i()},render(a,c){let p=e.value;if(r!==p)r=void 0;if(!c||l||r===p||document.activeElement!==e||!Ba.test(p)||e.selectionStart!==p.length||e.selectionEnd!==p.length){i();return}let f=p.startsWith("$")||p.startsWith("/skill:"),g=p.toLowerCase().replace(/^\/skill:/,"$"),k=new Map;for(let b of io(a)){let y=m(b.invocation);if(!Ot.test(y)||y.startsWith("$")!==f)continue;if(y.toLowerCase().startsWith(g)&&!k.has(y))k.set(y,{invocation:y,description:m(b.description)})}let C=[...k.values()].sort((b,y)=>Number(y.invocation===g)-Number(b.invocation===g)||b.invocation.localeCompare(y.invocation));if(!C.length){i();return}if(C.length===o.length&&C.every((b,y)=>b.invocation===o[y]?.invocation&&b.description===o[y]?.description))return;o=C,s=-1,e.removeAttribute("aria-activedescendant"),t.replaceChildren(...C.map((b,y)=>{let H=u("li");return H.id=`inline-command-${y}`,H.setAttribute("role","option"),H.setAttribute("aria-selected","false"),H.append(u("code","",b.invocation),u("span","small muted",b.description)),H})),t.hidden=!1,t.scrollTop=0},key(a){if(l||t.hidden||!wn(a))return!1;switch(a.key){case"Escape":r=e.value,i();break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":{let c=Cn(a.key,s,t.children,t);if(c===void 0)return!1;t.children[s]?.setAttribute("aria-selected","false"),s=c;let p=t.children[s];p.setAttribute("aria-selected","true"),e.setAttribute("aria-activedescendant",p.id),Tn(t,p);break}case"Enter":case"Tab":if(s<0)return!1;d(s);break;default:return!1}return a.preventDefault(),!0}}}Ds();var w=(e)=>K(e,HTMLElement),W=(e)=>K(e,HTMLButtonElement),pe=(e)=>K(e,HTMLSelectElement),_e=(e)=>K(e,HTMLInputElement),ao=(e)=>K(e,HTMLFormElement),at=(e)=>K(e,HTMLDialogElement),ue=new Ro,mn=new dt(w("messages"),w("transcript"),w("no-messages")),St=u("p","notice small");St.id="transcript-status";St.setAttribute("role","status");St.hidden=!0;ao("composer").prepend(St);var Nn=new qo(w("interactions")),fo=w("session-trace"),tn={user:W("trace-jump-user"),assistant:W("trace-jump-assistant"),tool:W("trace-jump-tool"),request:W("jump-to-request")},nn=new Map,he=K("prompt",HTMLTextAreaElement),$n=ar(he,w("inline-commands")),pt=pe("prompt-mode"),mt=pe("model"),lo=pe("thinking"),yt=u("button","button button--quiet",n("应用模型","Apply model"));yt.id="apply-model";yt.type="button";yt.hidden=!0;var rt=u("p","small muted sr-only");rt.id="model-preview";rt.setAttribute("role","status");rt.hidden=!0;mt.setAttribute("aria-describedby",rt.id);lo.setAttribute("aria-describedby",rt.id);mt.parentElement?.after(yt);var rn=w("compose-options"),gs=rn.parentElement,xt=W("compose-options-button"),yr=u("div","row compose-selectors");yr.append(...rn.children);var br=u("div","stack stack--tight");br.append(yr,rt);rn.append(br);var an=at("new-dialog"),ge=at("manage-dialog"),J=at("details-dialog"),Oe=at("command-dialog"),Rn=at("branch-dialog"),Ze=vn,ds={explicit:n("显式指定","Selected"),session:n("会话内记录","Session"),global:n("设备记忆","Saved on this device"),"model-default":n("模型默认","Model default"),default:n("默认设置","Default"),fallback:n("回退档位","Fallback"),clamped:n("按模型能力调整","Adjusted for this model")},cs={ask:n("审批:询问","Ask first"),auto:n("审批:Auto","Auto"),"full-access":n("审批:无审批","No approval")},lr=[["ask",cs.ask],["auto",cs.auto],["full-access",cs["full-access"]]],h,Es=wi(ue,()=>J.open&&h?.status==="ready"?h.session.id:void 0),Ee={},Bn={},be="connecting",Pe="waiting",qe=!1,Kt=!1,ho=!1,Ft="",Dn="",zt=new Map,vr=[],go="",dr=Number.NEGATIVE_INFINITY,us=0,kr=30000,Da=new Intl.DateTimeFormat(V,{dateStyle:"medium",timeStyle:"short"}),Ae=[],ys=0,co=!1,je="",Vt="",Fe=(e)=>Ae.includes(e),wr=(e)=>Fe(e)&&(!je||e===je),qn="omo-web-language-return-session",et=!1,nt,Hn=0,Oa=2000,Pa=2000,jt=0,Mt,ps=0,On=0,bs=0,st,In=!1,ot=!1,cr="omo-web-navigation-collapsed",As="omo-web-desktop-inspector",Et=!1,Pn=!0,We=new Set,kt=new Set,vs=new Map,ae=new Map,ln=matchMedia("(max-width: 760px)"),dn=matchMedia("(max-width: 1000px)"),ur=matchMedia("(prefers-color-scheme: dark)"),ms=new Intl.NumberFormat(V),ja=new Intl.NumberFormat(V,{maximumFractionDigits:2}),Ms=(e)=>W(ln.matches?"open-navigation":Et?"rail-toggle":e).focus(),Fa=_i(ue,Lr),$s=(e)=>{if(Rn.open)return;Rn.dataset.sourceKind=e.kind,Fa(e)},we=Yi(ue,Fe,()=>{if(we.active)h?.history?.invalidate();if(vt(),Ut(),te(),h?.history)cn(h)}),fn=Zi(ue,()=>Ms("cli-live-button"),$s,Fe),Va=er(ue,()=>({roots:Ae,selected:Vt||h?.session.cwd||je}),Qa,()=>{if(ln.matches&&!ot)W("open-navigation").focus();else if(W("workspace-browser-button").hidden)_e("search").focus();else W("workspace-browser-button").focus()}),uo=!1,Cr=zi(ue,()=>{if(!uo&&!document.querySelector("dialog:modal"))Ms("cli-history-button");uo=!1},$s,Ua,(e,t)=>{if(hn(!0),!t){$t();return}if(uo=!0,at("cli-history-dialog").close(),et=e.archived,ae.get(e.id)?.status==="pending"&&h?.session.id===e.id)Co(h);ae.delete(e.id),Ct(e),Un(e.id,!0)},Fe);function An(e){switch(e){case"engine_offline":return n("本机引擎未连接。","The local engine is offline.");case"shared_transport":return n("切换到 CLI 需要私有本机连接。","Switching to the CLI requires a private local connection.");case"missing_capability":return n("此 OmO 版本不支持换端。","This version of OmO does not support handoff.");case"profile_mismatch":return n("本机引擎与 CLI 会话使用不同配置。","The local engine and the CLI session use different profiles.");case"session_busy":return n("等本轮结束后再换端。","Wait for this turn to finish before switching.");case"dialog_pending":return n("先处理会话中的待答事项。","Answer the pending request before switching.");default:return n("这个会话暂时无法换端。","This session cannot be switched right now.")}}function Ua(){if(be!=="online")return n("连接断开,只能浏览记录。","Offline. You can still browse the history.");return Bn.supported===!0?"":An(Bn.reason)}function Tr(e){if(!e.session.active||e.status!=="ready")return n("先恢复此会话。","Resume this session first.");if(be!=="online")return n("连接断开,无法换端。","Reconnect before switching.");if(Bn.supported!==!0)return An(Bn.reason);if(e.running||e.compacting)return An("session_busy");if(e.requests.size)return An("dialog_pending");if(e.queue)return n("等队列里的消息发送后再换端。","Wait for queued messages to finish before switching.");if(e.handoff.eligible!==!0)return An(e.handoff.reason);if(We.has(e.session.id)||kt.has(e.session.id))return n("正在提交,请稍候。","Submitting…");return""}function Co(e){if(jn(e),e.optionSync++,e.snapshotRequestChanges=void 0,e.status="inactive",e.running=!1,e.compacting=!1,e.workbench=void 0,e.generationSpeed=void 0,e===h)st?.abort()}function jn(e){if(To(e),e.sync++,e.revision++,e.transcriptRefresh=e.stateRefresh=void 0,e.pendingStateUnknown=e.refreshScheduled=void 0,e.messages=[],e.liveKey="",e.liveMessageKeys.clear(),e.tools.clear(),e.transcript="unavailable",e===h)mn.reset()}function To(e){e.historyEpoch++,e.history?.invalidate(),e.history=void 0}function Lo(e){let t=Boolean(e.history);if(To(e),t)e.messages=[],e.liveMessageKeys.clear(),e.transcript="unavailable",mn.reset()}function Lr(e,t,o){if(!Ae.includes(e.cwd))return;if(o.kind==="live")fn.closeAfterBranch();if(o.kind==="history")uo=!0,at("cli-history-dialog").close();et=!1,me(e.id).text=t,Ct(e),hn(!0),Un(e.id,!0)}function me(e){let t=vs.get(e);if(!t)t={text:"",mode:"prompt",images:[],reading:0,error:"",commandMode:!1,commandText:"",commandError:""},vs.set(e,t);return t}function Sr(e){return en(e).kind!=="plain"||Ot.test(e.split(/\s/,1)[0]??"")}function Ka(){let e=pe("theme");try{let o=localStorage.getItem("omo-web-theme");if(o==="dark"||o==="light")e.value=o}catch(o){if(!(o instanceof DOMException))throw o}let t=()=>{document.documentElement.dataset.theme=e.value==="system"?ur.matches?"dark":"light":e.value};e.addEventListener("change",()=>{t();try{localStorage.setItem("omo-web-theme",e.value)}catch(o){if(!(o instanceof DOMException))throw o}}),ur.addEventListener("change",t),t()}function za(){let e=pe("language-select"),t=w("language-feedback");e.value=V,e.addEventListener("change",()=>{let o=e.value;if(o!=="en"&&o!=="zh-CN"||o===V)return;let s=(l)=>{e.value=V,D(t,l)};if([...vs.values()].some((l)=>l.text||l.commandText||l.images.length||l.reading)){s(n("发送或清空草稿后,再切换语言。","Send or clear your drafts before changing the language."));return}if(In||kt.size||We.size||h?.requests.size){s(n("先完成当前操作,再切换语言。","Finish the current action before changing the language."));return}if(we.active){s(n("退出 CLI 跟随后,再切换语言。","Stop following the CLI before changing the language."));return}let r=h?.session.id;try{if(r)sessionStorage.setItem(qn,r);else sessionStorage.removeItem(qn)}catch{if(r){s(n("浏览器无法保留当前会话。关闭此会话页面后再切换语言。","The browser could not preserve this session. Change the language from the start screen."));return}}if(!Bs(o)){try{sessionStorage.removeItem(qn)}catch{}s(n("浏览器无法保存语言设置。","The browser could not save your language setting."));return}location.reload()})}function Ga(){let e;try{e=sessionStorage.getItem(qn),sessionStorage.removeItem(qn)}catch{return}let t=e?zt.get(e):void 0;if(!t||!Fe(t.cwd))return;et=t.archived,Un(t.id,!1,!1)}function pr(e){try{return localStorage.getItem(e)}catch(t){if(!(t instanceof DOMException))throw t;return null}}function Rs(e,t){try{localStorage.setItem(e,t)}catch(o){if(!(o instanceof DOMException))throw o}}function mr(){w("workspace-shell").toggleAttribute("data-rail-collapsed",Et);let e=W("rail-toggle");e.setAttribute("aria-expanded",String(!Et));let t=Et?n("展开会话导航","Expand sessions"):n("收起会话导航","Collapse sessions");e.setAttribute("aria-label",t),e.title=t}function Qe(e,t=!1){if(ot=e&&ln.matches,w("navigation").classList.toggle("is-open",ot),w("nav-scrim").hidden=!ot,w("conversation").inert=ot,w("skip-link").inert=ot,W("open-navigation").setAttribute("aria-expanded",String(ot)),ot)_e("search").focus();else if(t&&ln.matches)W("open-navigation").focus()}function wt(){fn.setTransport(Pe);let e=be==="online";be=Ft||Ee.online===!1||Pe==="lost"?"offline":Kt&&Pe==="open"&&!qe&&Ee.online===!0?"online":"connecting",w("connection").dataset.state=be,w("connection-label").textContent={online:n("本机已连接","Connected"),offline:n("连接不可用","Offline"),connecting:n("正在连接","Connecting")}[be];let t=m(Ee.version);D(w("engine-version"),t&&n(`引擎 ${t}`,`Engine ${t}`));let o=Ft||(Ee.online===!1?m(Ee.error)||n("Senpi 引擎未连接。检查引擎后再重连。","The Senpi engine is offline. Check it and reconnect."):Pe==="lost"?n("实时连接已断开。正在重连,草稿会保留。","Connection lost. Reconnecting; your drafts are kept."):Dn);w("banner").toggleAttribute("data-unprotected",ho),w("access-warning").hidden=!ho,W("retry").hidden=!o,D(w("banner-text"),o);let s=be==="online"&&Boolean(Ae.length);if(W("new-sidebar").disabled=!s,W("new-welcome").disabled=!s,w("welcome-copy").textContent=Kt&&!Ae.length?W("workspace-browser-button").hidden?n("没有可用目录。请检查 OmO Web 的启动配置。","No directories are available. Check your OmO Web startup settings."):n("还没有可用目录。打开侧栏的「目录」添加。","No directories yet. Open Directories in the sidebar to add one."):n("从列表打开会话,或选个目录开始新会话。","Open a session from the list, or choose a directory to start a new one."),W("create").disabled=!s||In,Cr.update(),vt(),hn(),Ut(),te(),h?.history)cn(h);if(!e&&be==="online"&&h&&(h.stateRefresh||h.transcriptRefresh))Le(h)}async function hn(e=!1){if(!Kt)return;if(!e&&performance.now()-dr<kr)return;let t=++us;dr=performance.now();try{let o=await ue.request("/api/cli-history");if(t!==us)return;go=o.available===!0?"":n("没有可读取的 CLI 历史。","No CLI history is available."),vr=o.available===!0?z(o.sessions).map(S).flatMap((s)=>{let r=m(s.id);return r&&s.adopted!==!0?[{id:r,name:m(s.name)||n("未命名 CLI 会话","Untitled CLI session"),cwd:m(s.cwd),updatedAt:Y(s.updatedAt)??0}]:[]}):[]}catch(o){if(t!==us)return;go=n(`无法读取 CLI 历史:${ee(o)}`,`Couldn't load CLI history: ${ee(o)}`)}Ut()}function Ut(){let e=w("cli-sessions"),t=w("cli-session-list"),o=document.activeElement instanceof HTMLButtonElement&&t.contains(document.activeElement)?document.activeElement.dataset.cliSession:void 0,s=_e("search").value.trim().toLocaleLowerCase(),r=et?[]:vr.filter((l)=>wr(l.cwd)&&(!s||`${l.name} ${l.cwd}`.toLocaleLowerCase().includes(s))).sort((l,i)=>i.updatedAt-l.updatedAt);e.hidden=r.length===0&&!go,t.replaceChildren();for(let l of r){let i=u("li"),d=fe("",()=>Nr(l.id),"button--quiet session-link");d.dataset.cliSession=l.id;let a=Number.isFinite(new Date(l.updatedAt).getTime())?Da.format(l.updatedAt):"",c=u("span","small muted path",Fn(l.cwd));c.title=l.cwd,d.append(u("span","",l.name),c,u("small","",a)),i.append(d),t.append(i)}if(t.hidden=!r.length,D(w("cli-list-empty"),r.length?"":go||(Kt?n("没有本机 CLI 会话。","No local CLI sessions."):"")),o)[...t.querySelectorAll("button")].find((l)=>l.dataset.cliSession===o)?.focus({preventScroll:!0})}function xr(e){if(zt=new Map(e.map((t)=>[t.id,t])),h){let t=zt.get(h.session.id);if(t&&t.cwd!==h.session.cwd)jn(h);if(h.session=t??h.session,!Ae.includes(h.session.cwd))Hs();else if(!h.session.active&&h.status==="ready"&&ae.get(h.session.id)?.status!=="pending"){if(Co(h),ge.open)ge.close()}}vt(),te()}function Ct(e){if(On++,zt.set(e.id,e),h?.session.id===e.id)h.session=e;vt()}async function $t(){let e=++ps,t=On;try{let o=await ue.request("/api/sessions");if(e!==ps||t!==On)return;Dn="",xr(Mo(o))}catch(o){if(e===ps)Dn=n(`无法读取会话列表:${ee(o)}`,`Couldn't load sessions: ${ee(o)}`)}wt()}function Fn(e){let t=(s)=>co?s.replaceAll("\\","/"):s,o=t(e).split("/").filter(Boolean);if(co&&o.length===1)return e;for(let s=1;s<=o.length;s++){let r=o.slice(-s).join("/");if(!Ae.some((l)=>l!==e&&t(l).endsWith(`/${r}`)))return co?r.replaceAll("/","\\"):r}return e}function qs(){let e=pe("workspace-select"),t=n("所有目录","All directories");yo(e,Ae.map((o)=>[o,Fn(o)]),je,t),e.title=je||t,w("workspace-field").hidden=Ae.length<2}function Hs(){if(h)To(h);if(h=void 0,Mt?.(),clearTimeout(bs),mn.reset(),Nn.reset(),he.value="",gn(),ge.open)ge.close();if(It(!1),gt(!1),Oe.open)At?.abort(),Oe.close();if(Rn.open&&Rn.dataset.sourceKind==="web")Rn.close()}function Za(e){if(e&&!Fe(e))return;je=e,qs(),vt(),Ut()}function Qa(e,t){if(ys++,Ae=t,Vt=Fe(e)?e:"",je&&!Fe(je))je="";if(h&&!Fe(h.session.cwd))Hs();we.recheckWorkspace(),qs(),fn.scopeChanged(),Qe(!1),$t(),hn(!0),wt()}async function bt(e=!1){let t=++jt;Mt?.();let o=On,s=ys;try{let r=await ue.request("/api/bootstrap");if(t!==jt)return;let l=m(r.token),i=l!==ue.token;if(i&&h)Lo(h);ue.token=l,Ee=S(r.engine),ho=r.unprotected===!0,Bn=S(r.handoff);let d=S(r.fileBrowser);if(co=d.platform==="win32",s===ys||i)Ae=as(r.workspaces);let a=!Kt;if(je&&!Fe(je))je="";if(Vt&&!Fe(Vt))Vt="";if(Va.update(d,i),h&&!Ae.includes(h.session.cwd))Hs();if(we.recheckWorkspace(),qs(),fn.scopeChanged(),Kt=!0,Ft="",Dn="",o===On)xr(Mo(r));if(!nt)Ar();if(a)Ga();let c=h&&ae.get(h.session.id);if(e&&qe==="transport"){if(be==="offline"&&Pe==="open"&&Ee.online===!0)wt();await Ya(t)}else if(e&&h&&(!c||c.status==="failed")){if(!h.session.active&&h.status!=="loading"&&Ee.online===!0)h.status="inactive",h.error="";else if(h.session.active&&Ee.online===!0){let p=h;if(await Zt(p),p===h)Rt(p)}}}catch(r){if(t===jt)Ft=n(`无法连接本机 Web 服务:${ee(r)}`,`Couldn't connect to OmO Web: ${ee(r)}`)}if(t!==jt)return;if(qe!=="transport"||Pe==="open"&&Ee.online===!0&&!Ft)qe=!1;wt()}async function Ya(e){let t=()=>e===jt&&qe==="transport"&&Pe==="open"&&Ee.online===!0;while(t()){let o=h;if(!o?.session.active)return;let s=ae.get(o.session.id);if(s&&s.status!=="failed")return;let r=Promise.withResolvers();Mt=r.resolve;let l;try{let i=await Promise.race([o.pendingSnapshot??Zt(o,!1,!0),r.promise]);if(t()&&o===h&&ae.get(o.session.id)===s&&i===o.sync){Rt(o);return}}catch(i){if(!(i instanceof ie||i instanceof TypeError))throw i;if(t()&&o===h&&ae.get(o.session.id)===s)l=window.setTimeout(r.resolve,Pa),await r.promise}finally{if(clearTimeout(l),Mt===r.resolve)Mt=void 0}}}function vt(){let e=_e("search").value.trim().toLocaleLowerCase(),t=w("session-list"),o=document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)?document.activeElement.dataset.session:void 0,s=[...zt.values()].filter((i)=>wr(i.cwd)&&i.archived===et&&(!e||`${i.name} ${i.cwd}`.toLocaleLowerCase().includes(e))).sort((i,d)=>d.updatedAt-i.updatedAt),r=new Map([...t.children].flatMap((i)=>i instanceof HTMLLIElement&&i.dataset.session?[[i.dataset.session,i]]:[])),l=t.firstElementChild;for(let i of s){let d=r.get(i.id);if(!d){d=u("li"),d.dataset.session=i.id;let c=fe("",()=>Un(i.id),"button--quiet session-link");c.dataset.session=i.id,c.append(u("span"),u("span","small muted path"),u("small")),d.append(c)}let a=d.firstElementChild;if(a instanceof HTMLButtonElement){a.firstElementChild&&(a.firstElementChild.textContent=i.name);let c=a.children.item(1);if(c instanceof HTMLElement)c.textContent=Fn(i.cwd),c.title=i.cwd,c.hidden=!i.cwd;let p=a.lastElementChild;if(p)p.textContent=ae.get(i.id)?.status==="released"?n("已释放","Released"):i.running?n("运行中","Running"):i.settled?n("已结清","Done"):i.active?n("已打开","Open"):n("待恢复","Resume");if(!we.active&&i.id===h?.session.id)a.setAttribute("aria-current","true");else a.removeAttribute("aria-current")}if(d!==l)t.insertBefore(d,l);l=d.nextElementSibling,r.delete(i.id)}for(let i of r.values())i.remove();if(o&&!s.some((i)=>i.id===o))_e("search").focus();D(w("list-empty"),s.length?"":e?n("没有匹配的会话","No matching sessions"):!Kt?Ft?n("暂时无法读取会话","Couldn't load sessions"):n("正在读取会话…","Loading sessions…"):et?n("没有已归档的会话","No archived sessions"):n("还没有最近会话","No recent sessions")),W("recent").setAttribute("aria-pressed",String(!et)),W("archived").setAttribute("aria-pressed",String(et))}function Un(e,t=!1,o=!0){let s=zt.get(e);if(!s||!Ae.includes(s.cwd))return;if(we.stop(),o)Qe(!1),w("conversation").focus();if(e===h?.session.id){if(!t)return;if(h.status==="ready"){he.focus();return}}if(h)To(h);if(ge.open)ge.close();if(It(!1),gt(!1),Oe.open)At?.abort(),Oe.close();if(st?.abort(),o)w("conversation").focus({preventScroll:!0});let r=ae.get(e),l=s.active&&r?.status!=="released"&&r?.status!=="uncertain",i={session:s,status:l?"loading":"inactive",error:"",state:{},messages:[],liveKey:"",liveMessageKeys:new Set,tools:new Map,requests:new Map,options:{},optionsError:"",handoff:{},queue:void 0,revision:0,serial:0,sync:0,optionSync:0,historyEpoch:0,running:s.running,compacting:!1};h=i,Mt?.(),mn.reset(),Nn.reset();let d=me(e);if(he.value=d.commandMode?d.commandText:d.text,pt.value=d.mode,gn(),vt(),te(),l)Zt(i,!0).then(()=>{if(t&&i===h&&i.status==="ready"&&document.activeElement===w("conversation"))he.focus()}),Rt(i);else if(o&&r?.status==="released"&&!document.querySelector("dialog:modal"))w("handoff-title").focus()}function De(e){return m(e.id)?JSON.stringify([m(e.provider),m(e.id)]):""}function Ja(e){let t=m(e.name)||m(e.id);return t?[m(e.provider),t].filter(Boolean).join(" · "):""}function yo(e,t,o,s){let r=JSON.stringify(t);if(e.dataset.options!==r)e.replaceChildren(Se(s,""),...t.map(([l,i])=>Se(i,l))),e.dataset.options=r;if(e.value=o,e.selectedIndex<0)e.value=""}function Xa(e,t,o){let s=S(e.state.model),r=De(s),l=z(e.options.models).map(S).filter((b)=>Boolean(De(b))),i=e.state.pendingModelSwitch!=null;if(!o||i||e.modelSelection===r)e.modelSelection=void 0;let d=l.find((b)=>De(b)===e.modelSelection),a=d??l.find((b)=>De(b)===r);if(r&&!l.some((b)=>De(b)===r))l.unshift(s);yo(mt,l.map((b)=>[De(b),Ja(b)]),De(d??s),n("模型","Model")),mt.disabled=t||i||!z(e.options.models).length,yt.hidden=!d,yt.disabled=t||i;let c=i?n("正在切换模型。","Changing model…"):"",p;if(o&&!i&&a){let b=JSON.stringify([r,De(a),e.state.thinkingLevel]);if(e.modelPreview?.key!==b&&!We.has(e.session.id)){let M={key:b,result:void 0};e.modelPreview=M;let T=new URLSearchParams({provider:m(a.provider),modelId:m(a.id)});ue.request(`${ye(e.session.id)}/model-preview?${T}`).catch(()=>({})).then((_)=>{if(h!==e||e.modelPreview!==M)return;M.result=_,te()})}let y=e.modelPreview?.key===b?e.modelPreview.result:void 0,H=m(y?.source),R=m(y?.level);if(y?.status==="ok"&&Object.hasOwn(ds,H)&&Object.hasOwn(Ze,R)){p=y;let M=z(p.availableLevels).map(m).filter((E)=>Object.hasOwn(Ze,E)),T=d?n("切换后","After switching"):n("当前","Current"),_=M.map((E)=>Ze[E]).join(n("、",", "));c=n(`${T}:${Ze[R]}(来源:${ds[H]}) · 可用:${_}`,`${T}: ${Ze[R]} (${ds[H]}) · Available: ${_}`)}else c=y?n("无法预览此模型的思考档。","Thinking preview is unavailable for this model."):n("正在读取模型档位…","Loading thinking levels…")}else if(e.modelPreview=void 0,o&&!i&&r&&!e.optionsError&&z(e.options.models).length)c=n("此模型不在可用列表里。","The current model is not available.");if(rt.textContent!==c)rt.textContent=c;rt.classList.toggle("sr-only",!d),rt.hidden=!c,mt.title=!d&&c?c:n("模型","Model"),lo.title=!d&&c?c:n("思考档","Thinking level");let f=d?void 0:p,g=m(f?.level??e.state.thinkingLevel),k=z(f?.availableLevels??e.options.levels).map(m).filter((b)=>Object.hasOwn(Ze,b)),C=k.length>0;if(Object.hasOwn(Ze,g)&&!k.includes(g))k.unshift(g);yo(lo,k.map((b)=>[b,n(`思考:${Ze[b]}`,`Thinking: ${Ze[b]}`)]),g,n("思考档","Thinking")),lo.disabled=t||i||Boolean(d)||!C}function Er(e,t){if(!t||t===De(S(e.state.model)))return;e.modelSelection=void 0,e.modelPreview=void 0,e.options={...e.options,levels:[]},Rt(e)}function _n(e,t){let o=nn.get(e);if(o===t)return;if(o?.removeAttribute("id"),t){let s=e.getAttribute("aria-controls");if(s)t.id=s;nn.set(e,t)}else nn.delete(e);e.hidden=!t,fo.hidden=w("active-session").hidden||!nn.size}function el(e){let t=W("sidebar-question"),o=0;for(let l of e.values())if(l.method==="question"&&++o===100)break;if(!o){if(t===document.activeElement)J.querySelector('[aria-selected="true"]')?.focus();t.hidden=!0;return}let s=o===100?"99+":String(o),r=n(`Agent 提问 · ${s}`,`Agent questions · ${s}`);if(t.textContent!==r)t.textContent=r,t.setAttribute("aria-label",n(`跳至首个 Agent 提问(${o===100?"超过 99":s} 个待答)`,`Jump to first Agent question (${o===100?"over 99":s} pending)`));t.hidden=!1}function te(){let e=we.active;if(w("cli-follow-view").hidden=!e,w("transcript").hidden=e,W("cli-follow-stop").hidden=!e,W("cli-follow-button").setAttribute("aria-pressed",String(e)),w("banner").hidden=!ho&&(e||!w("banner-text").textContent),e){if(h)h.consideredDesktopDock=!1;$n.reset(),fo.hidden=!0,w("composer-shell").hidden=!0,W("details-button").hidden=!0,W("web-branch-button").hidden=!0,W("manage-button").hidden=!0,fr(we.target?.name??n("跟随 CLI","Follow CLI"),we.target?.cwd??"");return}let t=h,o=t?.session,s=o&&ae.get(o.id),r=s?.status==="pending",l=s?.status==="released"?s:void 0,i=Boolean(t&&t.status==="ready"),d=i?t?.transcript??t?.history?.status:void 0;if(d)St.dataset.status=d,w("transcript").setAttribute("aria-describedby",St.id);else delete St.dataset.status,w("transcript").removeAttribute("aria-describedby");if(w("no-messages").style.display=d?"none":"",D(St,d==="truncated"?n("部分聊天记录未包含在快照中。","Some chat history was omitted from this snapshot."):d==="unavailable"?n("暂时无法读取聊天记录。新消息仍会显示在这里。","Chat history is unavailable. New messages will still appear here."):""),w("welcome").hidden=Boolean(t),w("inactive-session").hidden=!t||i,w("active-session").hidden=!i,fo.hidden=!i||!nn.size,!i){$n.reset();for(let v of Object.values(tn))_n(v)}if(w("composer-shell").hidden=!i,he.disabled=!i||o?.active!==!0,fr(o?.name??n("会话工作台","Workbench"),o?.cwd??""),W("details-button").hidden=!i,!i)It(!1);if(W("web-branch-button").hidden=!o,W("web-branch-button").disabled=r,W("manage-button").hidden=!i,!t)return;let a=me(t.session.id);if(ge.open){let v=r?n("正在释放会话…","Releasing session…"):Tr(t);W("manage-handoff").disabled=Boolean(v),D(w("manage-handoff-status"),v),D(w("manage-handoff-error"),s?.status==="failed"?s.error:"")}for(let v of[ge,J])if(v.open)v.querySelectorAll("[data-write]").forEach((B)=>{B.disabled=be!=="online"||r||We.has(t.session.id)||B.hasAttribute("data-unavailable")||B.hasAttribute("data-idle")&&(t.running||t.compacting||kt.has(t.session.id))});Ne?.syncWrites();let c=t.status!=="inactive";w("inactive-title").textContent=t.status==="loading"?n("正在读取会话…","Loading session…"):t.status==="failed"?n("无法读取会话","Couldn't load session"):n("继续此会话","Continue this session");let p=Boolean(l&&t.status!=="loading");w("inactive-title").hidden=p,w("inactive-copy").hidden=p,w("inactive-copy").textContent=r?n("等本机引擎确认释放。","Waiting for the local engine to release the session."):t.status==="loading"?"":t.status==="failed"?n("检查连接后重试。","Check the connection and try again."):t.session.archived?n("恢复已归档的会话,继续之前的对话。","Restore this archived session to continue the conversation."):n("恢复后可继续之前的对话。","Resume to pick up where you left off."),w("handoff-receipt").hidden=!p;let f=w("handoff-command").firstElementChild;if(f&&f.textContent!==(l?.command??""))f.textContent=l?.command??"";D(w("handoff-copy-status"),l?.copyStatus),D(w("handoff-draft-note"),!i&&(l||r||s?.status==="uncertain")&&(a.text||a.commandText||a.images.length||a.reading)?n("草稿仍在这页。","Your draft is still on this page."):""),D(w("session-error"),t.error||(s?.status==="uncertain"&&t.status!=="loading"?s.error:""));let g=W("resume");if(g.hidden=i||t.status==="loading",g.disabled=be!=="online"||r||We.has(t.session.id),g.classList.toggle("button--primary",!l),g.textContent=!l&&s?.status!=="uncertain"&&c&&t.session.active?n("重试读取","Retry"):n("恢复会话","Resume session"),!i){t.modelSelection=void 0,t.modelPreview=void 0;return}let k=be==="online",C=r||We.has(t.session.id),b=kt.has(t.session.id),y=t.session.archived,H=k&&t.session.active&&!y&&!t.compacting,R=pt.value,M=a.commandMode,T=M||Sr(a.text),_=t.running&&(R==="prompt"||y||T);W("stop").hidden=!t.running,W("stop").disabled=!k||C,W("stop").classList.toggle("button--primary",_),W("stop").classList.toggle("button--danger",!_);let E=W("send");E.hidden=T||t.running&&(R==="prompt"||y),E.disabled=!H||C||b||a.reading>0||!a.text.trim()&&!a.images.length;let x=R==="follow_up"?n("排队","Queue"):R==="steer"?n("发送引导","Steer"):n("发送","Send");w("send-label").textContent=E.title=x;let N=W("send-command");N.hidden=!T;let O=M?a.commandText:a.text,P=rr(O);N.disabled=!k||!t.session.active||C||y&&!P||!P&&(t.running||t.compacting||Boolean(t.queue)||b)||!O.trim(),W("command-mode").setAttribute("aria-pressed",String(M)),W("command-picker").hidden=!M,W("command-picker").disabled=!k||y,w("prompt-label").textContent=M?n("命令及参数","Command and arguments"):n("消息","Message"),he.placeholder=M?n("输入 /命令 或 $技能,可加参数…","Enter a /command or $skill…"):n("输入消息…","Write a message…"),W("attach").disabled=M||y||a.images.length+a.reading>=4||C,W("attach").hidden=M,(pt.closest("label")??pt).hidden=M,pt.disabled=y||C,Xa(t,!H||t.running||C||b,k&&c&&!r);let Z=m(t.state.effectivePermissionPreset)||m(t.state.permissionPreset)||"ask";yo(pe("approval"),[...lr],lr.some(([v])=>v===Z)?Z:"ask",n("审批","Approval")),pe("approval").dataset.preset=pe("approval").value,pe("approval").disabled=!H||C||b,pe("approval").title=Z==="full-access"?n("无审批:工具默认放行。原生权限规则仍有效,用户问题仍需回答。","Off: Tools are allowed by default. Native permission rules and user questions still apply."):Z==="auto"?n("Auto:原生确认安全的项目内操作自动放行,其余询问。","Auto: OmO allows safe project operations and asks about the rest."):n("询问:未被原生权限规则处理的工具操作需要批准。恢复会话会回到此模式。","Ask: Approve tool calls not covered by native rules. Resuming a session returns to Ask.");let j=Xt(t.state.contextUsage),X=n("上下文","Context");D(w("context-usage"),j.status!=="ok"?"":j.percent!==void 0?`${X} ${ms.format(j.percent)}%`:j.tokens!==void 0&&j.window?`${X} ${ms.format(j.tokens)} / ${ms.format(j.window)}`:"");let G=to(t.state.usageTotals),se=G.status==="ok"&&G.latest!==void 0?ja.format(G.latest*100):"";D(w("cache-usage"),k&&se?n(`最新缓存 ${se}%`,`Latest cache ${se}%`):"");let U=r?n("正在换端,草稿不会发送。","Switching clients. Your draft won't be sent."):!k?n("离线时可以编辑,重连后再发送。","You can edit offline and send when reconnected."):y?n("先在会话管理里取消归档。","Unarchive this session in Manage session."):a.commandStatus||(T?!P&&(t.running||t.compacting||t.queue)?n("等本轮和队列结束后再执行命令。","Wait for this turn and queue to finish before running a command."):n("Ctrl / ⌘ + Enter 执行命令;开头加空格就按文字发送。","Ctrl / ⌘ + Enter runs the command. Add a leading space to send it as text."):t.compacting?n("等压缩完成后再发送。","Send after compaction finishes."):a.reading?n("正在读取图片…","Loading images…"):t.running&&R==="prompt"?n("停止本轮,或选引导或排队。","Stop this turn, or choose Steer or Queue."):!t.running&&R!=="prompt"?n("当前空闲,这条消息会在下一轮处理。","No turn is running. This message will be handled in the next turn."):n("Ctrl / ⌘ + Enter 发送","Ctrl / ⌘ + Enter to send"));w("composer-hint").textContent=U,w("composer-hint").classList.toggle("sr-only",!a.commandStatus&&k&&!r&&!y&&!a.reading&&!t.compacting&&!T&&(R==="prompt"||t.running));let re=[t.requests.size?n(`待答 ${t.requests.size}`,`Pending ${t.requests.size}`):"",t.running?n("生成中","Generating"):"",t.compacting?n("压缩中","Compacting"):"",t.queue?n(`排队 ${t.queue}`,`Queued ${t.queue}`):""].filter(Boolean).join(" · ");if(w("activity-row").hidden=!re,w("activity-row").dataset.pending=String(t.requests.size>0),w("activity").textContent!==re)w("activity").textContent=re;let le=W("current-todo"),Q=t.workbench,ne=Q?.status==="ok"?m(Q.currentTodo):"",q=Q?.status==="ok"?Y(Q.pendingTodo):void 0,L=n("待办","Todo"),I=ne?`${L} · ${ne}`:q?`${L} ${q}`:"";le.hidden=!k||!I;let A=w("current-todo-label");if(A.textContent!==I)A.textContent=I;le.title=ne&&q?n(`${I};另有 ${q} 项待处理`,`${I} · ${q} more pending`):I,D(w("compose-error"),(M?a.commandError:a.error)||t.optionsError||(!ge.open&&s?.status==="failed"?s.error:"")),Nn.render(t.requests,k&&!r,(v,B)=>il(t,v,B)),el(t.requests),_n(tn.request,Nn.first),$n.render(t.options.commands,k&&!y&&!r),Wr(t)}function fr(e,t){let o=w("session-title");if(o.textContent!==e)o.textContent=e;o.title=e;let s=w("session-path");if(D(s,t),s.title=t,D(w("session-path-short"),t?Fn(t):""),W("session-path-trigger").hidden=!t,we.active&&t)s.dataset.workspaceLabel=Fn(t);else delete s.dataset.workspaceLabel}function tl(e){let t=new Map;for(let o of[...z(e.pendingDialogs),...z(e.pendingQuestions)]){let s=S(o);if(Qn(s))t.set(yn(s),s)}return t}function cn(e,t=!1){if(e!==h||e.status!=="ready")return;po(e,t)}function po(e,t=!1,o){let s=e.history,r=s?.entries.length?[...s.entries,...e.messages]:e.messages;mn.render(r,e.liveKey,e.tools,t,s?.render(),o)}function nl(e,t){let o=e.history;if(t&&o?.id===t.id&&!o.reloading)return;if(o?.invalidate(),e.history=void 0,!t)return;let{id:s,cwd:r}=e.session,l=()=>e===h&&e.history===d&&e.session.id===s&&e.session.cwd===r&&Fe(r)&&e.session.active&&!we.active&&(!ae.has(s)||ae.get(s)?.status==="failed"),i=()=>l()&&e.status==="ready"&&be==="online"&&!we.active,d=new Go(t,ue,s,l,i,()=>e.messages,(a)=>{if(!l())return;te(),po(e,!1,a)},()=>{if(!i()||d.reloading)return;d.reloading=!0,d.clearExpansion(),te(),po(e),Zt(e).finally(()=>{if(d.reloading=!1,l())po(e)})});e.history=d}async function Zt(e,t=!1,o=!1){let s=ae.get(e.session.id),r=s?.status==="released"||s?.status==="uncertain";if(r&&(e.status!=="loading"||!We.has(e.session.id)))return;let l=++e.sync,{historyEpoch:i,session:d,transcriptRefresh:a,stateRefresh:c}=e,p=e.status==="ready"&&e.running&&Boolean(a||c),f=Promise.withResolvers();e.pendingSnapshot=f.promise;let g=e.revision,k=new Set(e.messages),{state:C,generationSpeed:b}=e,y=[];e.snapshotRequestChanges=y;let H=e.liveKey,R=new Set([...e.tools].filter(([,M])=>M.stage==="running").map(([M])=>M));try{let M=await ue.request(ye(e.session.id));if(h!==e||l!==e.sync||ae.get(e.session.id)!==s)return;let T=tt(M.session),_=Ko(M.page);if(_&&!T||T&&(T.id!==d.id||T.cwd!==d.cwd))throw new ie(n("会话读取响应已失效。","The session read no longer matches this conversation."),409,"stale_session_read");if(e.historyEpoch!==i&&_)return;if(r&&!T?.active)throw Error(n("本机服务未确认已恢复此会话。","The local engine did not confirm the session resumed."));let E=T??e.session;if(r)ae.delete(E.id);Ct(E);let x=S(M.state),N=e.pendingStateUnknown?{...e.state,...x}:x;if(Ee.online!==!1)if(M.generationSpeed===void 0&&e.generationSpeed===b)e.generationSpeed=void 0;else Is(e,M.generationSpeed);let O=De(S(e.state.model));e.handoff=S(M.handoff);let P=o||!p&&(!e.transcriptRefresh||e.transcriptRefresh===a&&!e.running),Z=zo(M.transcript);if(P){if(e.transcript=Z,nl(e,Z==="unavailable"?void 0:_),e.transcriptRefresh===a)e.transcriptRefresh=void 0}let j=Z==="unavailable"?[]:z(M.messages).map(S),X=g!==e.revision,G=new Map(e.messages.map((Q)=>[Q.key,Q.message])),se=new Set,U=j.filter((Q)=>Boolean(ze(Q))).map((Q,ne)=>{let q=Nt(Q)||`snapshot:${ne}`,L=se.has(q)?`${q}:${ne}`:q;se.add(L);let I=G.get(L);return{key:L,message:I&&JSON.stringify(I)===JSON.stringify(Q)?I:Q}});if(P&&Z==="unavailable")e.messages=e.messages.filter((Q)=>e.liveMessageKeys.has(Q.key));if(X){if(P&&Z!=="unavailable"){let ne=Z==="truncated"||Boolean(a),q=e.messages.filter((I)=>e.liveMessageKeys.has(I.key)&&(!ne||!k.has(I)||e.running&&I.key===e.liveKey)),L=new Map(q.map((I)=>[I.key,I]));e.messages=[...U.map((I)=>L.get(I.key)??I),...q.filter((I)=>!se.has(I.key))]}if(e.state={...N,...Object.fromEntries(Object.entries(e.state).filter(([ne,q])=>q!==C[ne]))},!(E.running||N.isStreaming===!0)&&!e.running){if(e.liveKey="",P&&Z!=="unavailable"&&H&&!se.has(H))e.messages=e.messages.filter((ne)=>ne.key!==H);for(let ne of R)if(e.tools.get(ne)?.stage==="running")e.tools.delete(ne)}}else{if(P&&Z!=="unavailable")e.messages=U;if(e.state=N,!e.pendingStateUnknown||typeof x.isStreaming==="boolean"||E.running)e.running=E.running||N.isStreaming===!0;if(!e.pendingStateUnknown||typeof x.isCompacting==="boolean")e.compacting=N.isCompacting===!0;if(!e.pendingStateUnknown||Y(x.pendingMessageCount)!==void 0)e.queue=Y(N.pendingMessageCount);if(!e.running){e.liveKey="";for(let[Q,ne]of e.tools)if(ne.stage==="running")e.tools.delete(Q)}else if(P&&Z!=="unavailable"&&e.liveKey&&!se.has(e.liveKey)){let Q=G.get(e.liveKey);if(Q)e.messages.push({key:e.liveKey,message:Q})}}e.liveMessageKeys=new Set(e.messages.flatMap((Q)=>e.liveMessageKeys.has(Q.key)?[Q.key]:[]));let re=tl(x);if(e.pendingStateUnknown){let Q=Array.isArray(x.pendingDialogs),ne=Array.isArray(x.pendingQuestions);for(let[q,L]of e.requests)if(!(L.method==="question"?ne:Q)&&!re.has(q))re.set(q,L);if(Q&&ne&&e.stateRefresh===c)e.pendingStateUnknown=void 0}if(e.stateRefresh===c)e.stateRefresh=void 0;if(!P&&!e.running&&e.transcriptRefresh)Le(e);for(let Q of y)Mr(re,Q);e.requests=re,Er(e,O);let le=e.status!=="ready";if(e.status="ready",e.error="",te(),cn(e,t),Mn(e),le||!e.workbench)bo(e);return l}catch(M){if(h!==e||l!==e.sync||ae.get(e.session.id)!==s)return;if(ae.get(e.session.id)?.status==="pending")return;if(o)throw M;if(e.status!=="ready"||!e.session.active)e.status="failed",e.error=ee(M);else me(e.session.id).error=n(`无法刷新会话:${ee(M)}`,`Couldn't refresh the session: ${ee(M)}`);te()}finally{if(e.pendingSnapshot===f.promise)e.pendingSnapshot=void 0;if(f.resolve(),e.snapshotRequestChanges===y)e.snapshotRequestChanges=void 0;if(e===h&&!e.pendingSnapshot&&e.refreshScheduled)e.refreshScheduled=void 0,Le(e)}}async function bo(e){if(e!==h||e.status!=="ready"||!e.session.active||e.session.archived||be!=="online"||we.active||ae.get(e.session.id)?.status==="pending")return;st?.abort();let t=st=new AbortController,o=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);try{let s=await ue.request(`${ye(e.session.id)}/workbench-status`,void 0,o);if(t.signal.aborted||st!==t||e!==h||e.status!=="ready")return;e.workbench=s}catch(s){if(!(s instanceof Error))throw s;if(t.signal.aborted||st!==t||e!==h)return;e.workbench={status:"unavailable"}}finally{if(st===t)st=void 0}te()}async function Rt(e){let t=++e.optionSync;try{let o=await ue.request(`${ye(e.session.id)}/options`);if(h!==e||t!==e.optionSync)return;e.options=o,e.optionsError=""}catch(o){if(h!==e||t!==e.optionSync)return;e.optionsError=n(`无法读取模型和运行选项:${ee(o)}`,`Couldn't load models and settings: ${ee(o)}`)}te()}function Ar(){if(nt)return;let e=new EventSource("/api/events");nt=e,e.addEventListener("open",()=>{if(e!==nt)return;let t=Pe==="lost";if(t)qe="transport";if(Pe="open",wt(),t)if(Ee.online===!1)$t();else bt(!0)}),e.addEventListener("error",()=>{if(e!==nt)return;if(Pe!=="lost"&&h)Lo(h),h.liveMessageKeys.clear(),h.liveKey="",h.tools.clear();if(Pe="lost",qe==="transport")jt++,Mt?.();if(wt(),e.readyState!==EventSource.CLOSED||Hn)return;Hn=window.setTimeout(()=>{if(Hn=0,e!==nt)return;nt=void 0,Ar()},Oa)}),e.addEventListener("omo",(t)=>{if(!(t instanceof MessageEvent)||typeof t.data!=="string"||e!==nt)return;try{let o=JSON.parse(t.data);sl(S(o))}catch(o){if(!(o instanceof SyntaxError))throw o;if(h?.session.active)Le(h)}})}function ol(e,t,o){let s=S(t.message),r=ze(s);if(!r)return;let l=e.messages[e.messages.length-1],i=Nt(s),d=r==="assistant"&&e.liveKey,a=o!=="message_start"&&d||i||"";if(!a&&o!=="message_start"&&l&&r===ze(l.message))a=l.key;if(!a)a=`live:${++e.serial}`;let c=e.messages.findIndex((p)=>p.key===a);if(c<0)e.messages.push({key:a,message:s});else e.messages[c]={key:a,message:s};if(e.liveMessageKeys.add(a),r==="assistant"){if(e.liveKey=o==="message_end"?"":a,o!=="message_end")e.running=!0}}function Le(e){clearTimeout(bs),bs=window.setTimeout(()=>{if(h!==e||!e.session.active||Pe!=="open"||qe==="transport"||ae.get(e.session.id)?.status==="pending")return;if(e.transcriptRefresh&&e.running&&!e.stateRefresh)return;if(e.pendingSnapshot){e.refreshScheduled=!0;return}Zt(e)},120)}function Mr(e,t){if(t.type==="upsert"){e.set(yn(t.request),t.request);return}for(let[o,s]of e){if(!t.ids.includes(o)&&!t.ids.includes(m(s.requestId)))continue;if(t.type==="resolve")e.delete(o);else if(s.method==="question")e.set(o,{...s,...t.timing})}}function vo(e,t){Mr(e.requests,t),e.snapshotRequestChanges?.push(t)}function fs(e,t){let o=S(t);if(Qn(o))vo(e,{type:"upsert",request:o})}function Is(e,t){let o=ki(t);if(!o||e.generationSpeed&&e.generationSpeed.measuredAt>=o.measuredAt)return!1;return e.generationSpeed=o,!0}function Mn(e){if(J.open&&e.detailData)qi(e.detailData,e.state,e.generationSpeed)}function sl(e){let t=m(e.type);if(t==="cli-live"){fn.invalidate(m(e.id));return}if(t==="ready"||t==="engine"){if(t==="engine"){let s=S(e.engine);if(typeof s.online!=="boolean")return;if(qe!=="transport")qe=s.online&&Ee.online===!1?"engine":!1;if(Ee=s,!s.online&&qe==="transport")jt++,Mt?.();if(!s.online&&h)Lo(h),h.liveMessageKeys.clear(),h.liveKey="",h.tools.clear(),h.generationSpeed=void 0,Mn(h);if(wt(),s.online)bt(!0);else $t()}else if(qe==="transport"){if(Ee.online===!1&&S(e.engine).online===!0)bt(!0)}else if(qe)return;else if(h&&Ee.online!==!1)bt(!0);else $t();return}if(t==="sessions"){$t();return}let o=h;if(!o||e.sessionId!==o.session.id)return;if(o.status!=="ready"&&o.status!=="loading")return;if(t==="generation_speed"){if(Is(o,e.generationSpeed))Mn(o);return}switch(o.revision++,t){case"transcript_refresh_required":if(o.transcriptRefresh={},!o.running)Le(o);return;case"state_refresh_required":o.stateRefresh={},o.pendingStateUnknown=!0,Le(o);return;case"agent_start":o.running=!0;break;case"turn_start":{let s=m(e.turnId);if(s)o.state={...o.state,currentTurnId:s};break}case"agent_end":if(e.willRetry===!0)break;o.liveKey="",Le(o);break;case"agent_settled":if(o.running=!1,o.liveKey="",o.state={...o.state,currentTurnId:void 0},Le(o),bo(o),o.status==="ready"&&J.open)Ne?.invalidate(),mo(o);break;case"agent_idle":if(o.transcriptRefresh)o.running=!1,o.liveKey="";Le(o);break;case"message_start":case"message_update":case"message_end":ol(o,e,t);break;case"tool_execution_start":case"tool_execution_update":case"tool_execution_end":{let s=m(e.toolCallId);if(!s)break;let r=o.tools.get(s),l=S(e.result??e.partialResult);if(o.tools.set(s,{id:s,name:m(e.toolName)||r?.name||"",args:e.args??r?.args,output:l.content??r?.output,stage:e.isError===!0?"error":t==="tool_execution_end"?"done":"running"}),t==="tool_execution_end"&&e.isError!==!0&&/^(?:todo|todowrite)$/u.test(m(e.toolName)||r?.name||""))bo(o);break}case"extension_ui_request":fs(o,e);break;case"ui_request_pending":fs(o,e.request);break;case"question_updated":{if(Qn(e))fs(o,e);else{let s=[m(e.id),m(e.requestId)].filter(Boolean),r=Y(e.deadlineAtMs),l=Y(e.remainingMs);if(!s.length||r===void 0&&l===void 0)return;vo(o,{type:"timing",ids:s,timing:{...r===void 0?{}:{deadlineAtMs:r},...l===void 0?{}:{remainingMs:l}}})}break}case"question_resolved":case"ui_request_resolved":case"extension_ui_resolved":case"extension_ui_request_resolved":{let s=[e.id,e.requestId,e.uiRequestId].map(m).filter(Boolean);if(s.length)vo(o,{type:"resolve",ids:s});Le(o);break}case"compaction_start":o.compacting=!0;break;case"compaction_end":if(o.compacting=!1,e.aborted!==!0&&m(e.errorMessage))me(o.session.id).error=m(e.errorMessage);if(e.aborted!==!0&&e.success!==!1&&!e.errorMessage&&!e.error)jn(o);if(e.aborted!==!0&&!m(e.errorMessage)&&J.open)Ne?.invalidate(),mo(o);Le(o);break;case"queue_update":if(o.queue=z(e.steering).length+z(e.followUp).length,J.open&&Gt())xs(o);else un=!0;Ht?.activate(!0);break;case"pending_input_update":if(Le(o),J.open&&Gt())xs(o);else un=!0;Ht?.activate(!0);break;case"model_changed":case"service_tier_changed":{let s=De(S(o.state.model));if(e.model)o.state={...o.state,model:e.model};if(typeof e.thinkingLevel==="string")o.state={...o.state,thinkingLevel:e.thinkingLevel};if(typeof e.fastMode==="boolean")o.state={...o.state,fastMode:e.fastMode};if(Mn(o),!s||s===De(S(o.state.model)))o.modelPreview=void 0,Rt(o);else Er(o,s);Le(o);break}case"commands_changed":case"loaded_surfaces_changed":Rt(o);break;case"auto_retry_start":o.running=!0;break;case"auto_retry_end":Le(o);break;case"session_replaced":if(jn(o),o.status="loading",o.running=!1,o.compacting=!1,o.state={},o.requests.clear(),o.queue=void 0,st?.abort(),o.workbench=void 0,o.generationSpeed=void 0,Es(),Mn(o),J.open)Ne?.invalidate(),mo(o);Le(o);break;case"transcript_write_failed":case"extension_error":case"retry_fallback_exhausted":me(o.session.id).error=m(e.errorMessage)||m(e.error)||m(e.lastError)||n("本机引擎报告会话错误","The local engine reported a session error.");break;case"session_closed":case"session_parked":case"session_released":if(ae.get(o.session.id)?.status!=="pending")Co(o);Ct({...o.session,active:!1,running:!1});break;default:return}te(),cn(o)}async function So(e,t){if(be!=="online")throw Error(n("连接断开。重连后重试。","Offline. Reconnect and try again."));if(t.action!=="resume"&&(e!==h||e.status!=="ready"||!e.session.active||ae.get(e.session.id)?.status==="pending"))throw Error(n("恢复会话后再试。","Resume the session and try again."));try{let o=await ue.action(e.session.id,t),s=tt(o.session);if(s)Ct(s);return o}catch(o){if(o instanceof ie&&(o.status===401||o.status===403))bt(!0);throw o}}async function il(e,t,o){let s=[t,m(e.requests.get(t)?.requestId)].filter(Boolean);if(await So(e,{action:"answer",requestId:t,...o}),vo(e,{type:"resolve",ids:s}),e===h)te();Le(e)}function gn(){let e=h,t=w("attachments"),o=e&&me(e.session.id);if(t.hidden=!o?.images.length||o.commandMode,t.replaceChildren(),!o)return;for(let s of o.images){let r=u("div","attachment"),l=u("img");l.alt=s.name,l.src=s.url;let i=fe(n("移除","Remove"),()=>{o.images=o.images.filter((d)=>d!==s),gn(),te(),(t.querySelector("button")??W("attach")).focus()},"button--quiet");i.setAttribute("aria-label",n(`移除图片:${s.name}`,`Remove image: ${s.name}`)),r.append(l,i),t.append(r)}}async function hr(e){let t=h;if(!t||t.status!=="ready"||t.session.archived||me(t.session.id).commandMode)return;let o=me(t.session.id),s=[],r=[];for(let i of e){let d=i.type;if(!zn(d)){s.push(n(`不支持图片格式:${i.name}`,`Unsupported image format: ${i.name}`));continue}if(!i.size||i.size>2100000){s.push(n(`图片为空或超过 2.1 MB:${i.name}`,`Image is empty or larger than 2.1 MB: ${i.name}`));continue}if(o.images.length+o.reading>=4){s.push(n("最多可添加 4 张图片。","You can attach up to 4 images."));break}o.reading++,r.push(new Promise((a,c)=>{let p=new FileReader;p.addEventListener("error",()=>c(Error(n(`无法读取图片:${i.name}`,`Couldn't read image: ${i.name}`))),{once:!0}),p.addEventListener("load",()=>{let f=typeof p.result==="string"?p.result:"",g=f.slice(f.indexOf(",")+1);if(!g||!f.startsWith(`data:${d};base64,`)){c(Error(n(`图片编码无效:${i.name}`,`Invalid image data: ${i.name}`)));return}a({type:"image",mimeType:d,data:g,name:i.name||n("粘贴的图片","Pasted image"),url:f})},{once:!0}),p.readAsDataURL(i)}))}if(t===h)te();let l=await Promise.allSettled(r);o.reading-=r.length;for(let i of l)if(i.status==="fulfilled")o.images=[...o.images,i.value];else s.push(ee(i.reason));if(o.error=[...new Set(s)].join(" "),t===h)gn(),te()}async function rl(){let e=h;if(!e||W("send").disabled||W("send").hidden)return;let t=e.session.id,o=me(t),{text:s,mode:r,images:l}=o,i=r==="prompt"?"":m(e.state.currentTurnId),d=o.admission,a=d&&d.text===s&&d.mode===r&&d.turn===i&&d.imageList===l?d.id:crypto.randomUUID();o.admission={id:a,text:s,mode:r,turn:i,imageList:l},o.error="",kt.add(t),te();try{if(await So(e,{action:"prompt",message:s,mode:r,clientMessageId:a,...i?{expectedTurnId:i}:{},...l.length?{images:l.map(({type:c,mimeType:p,data:f})=>({type:c,mimeType:p,data:f}))}:{}}),o.admission=void 0,o.text===s){if(o.text="",e===h&&!o.commandMode)he.value=""}if(o.images=o.images.filter((c)=>!l.includes(c)),e===h)gn();Le(e)}catch(c){if(o.error=n(`未能发送:${ee(c)}`,`Couldn't send: ${ee(c)}`),c instanceof ie&&c.status>=400&&c.status<500)o.admission=void 0;Le(e)}finally{if(kt.delete(t),e===h)te()}}async function al(e){if(W("send-command").disabled||W("send-command").hidden)return;let t=e.session.id,o=me(t),s=o.commandMode?"commandText":"text",r=o.commandMode?"commandError":"error",l=o[s],i=(g)=>{o[r]=g},d=()=>{if(o[s]!==l)return;if(o[s]="",h?.session.id===t&&o.commandMode===(s==="commandText"))he.value=""};o.commandStatus=void 0;let a=en(l);if(a.kind==="malformed"||a.kind==="tui-only"){i(a.kind==="malformed"?a.message:n(`“/${a.name}”请在本机 OmO 终端重新发起。Web 没有转交输入,也没有发送给模型。`,`Run /${a.name} in the local OmO terminal. The Web app did not forward your input or send it to the model.`)),te();return}if(a.kind==="builtin"){i("");try{if(await ll(e,a.command,i))d()}catch(g){i(n(`命令失败:${ee(g)}`,`Command failed: ${ee(g)}`))}if(h?.session.id===t)te();return}let[,c,p]=/^(\S+)(?:[ \t]+([^\r\n]*))?$/.exec(l)??[];if(!c||!Ot.test(c)||/[\r\n]/.test(l)){i(n("请输入单行 /命令 或 $技能,可附加参数。","Enter a /command or $skill on one line. Arguments are optional.")),te();return}let f=o.commandAdmission?.text===l?o.commandAdmission.id:crypto.randomUUID();o.commandAdmission={text:l,id:f},i(""),kt.add(t),te();try{await So(e,{action:"command",invocation:c,...p?{arguments:p}:{},clientMessageId:f}),o.commandAdmission=void 0,d()}catch(g){if(g instanceof ie&&g.status>=400&&g.status<500)o.commandAdmission=void 0;let k=g instanceof ie?g.code:"",C=k==="unknown_command"?n("未知命令","Unknown command"):k==="session_busy"||k==="bridge_busy"?n("会话忙","Session is busy"):k==="invalid_arguments"||k==="invalid_request"?n("命令输入无效","Invalid command input"):n("原生命令失败","Native command failed");i(n(`${C}:${ee(g)}`,`${C}: ${ee(g)}`))}finally{if(kt.delete(t),h?.session.id===t)te(),Le(h)}}async function ll(e,t,o){let s=e.session.id,r=(l,i)=>Ye(e,l,i,o);switch(t.name){case"new":return ks(),an.open;case"resume":case"sessions":return W("cli-history-button").click(),at("cli-history-dialog").open;case"name":case"rename":if(t.value!==void 0)return r({action:"rename",name:t.value},n("重命名","Rename"));return W("manage-button").click(),ge.querySelector('[data-key="name"]')?.focus(),ge.open;case"session":return Pt(),J.open;case"settings":case"setting":return W("manage-button").click(),ge.querySelector('[data-key="run-settings"]')?.focus(),ge.open;case"tree":return Pt("overview",he,"tree"),J.open;case"todo":return Pt("todo",he,"todo"),J.open;case"tasks":return Pt("subagents",he),J.open;case"dag":return Pt("dag",he),J.open;case"help":case"hotkeys":return await Hr(e,!0),Oe.open;case"reasoning":case"efforts":{let l=S(e.state.model),i=m(e.state.thinkingLevel);if(!De(l))return o(n("没有已确认的模型。","No model is selected yet.")),!1;if(!i||!Object.hasOwn(Ze,i))return o(n("当前思考档未知。","The current thinking level is unknown.")),!1;if(t.name==="reasoning")return me(s).commandStatus=i==="off"?n("当前模型推理:关闭。","Model reasoning: off."):n(`当前模型推理:开启(${i})。`,`Model reasoning: on (${i}).`),!0;let d=z(e.options.levels).map(m).filter((c)=>Object.hasOwn(Ze,c)),a=d.filter((c)=>c!=="off");if(!d.length)return o(n("暂时无法读取可用思考档。","Thinking levels are unavailable.")),!1;if(l.reasoning===!1||!a.length)return o(n("当前模型不支持推理。","This model does not support reasoning.")),!1;if(d.includes("off")&&a.length===1)return o(n("此模型只能开启或关闭推理。","This model can only turn reasoning on or off.")),!1;return me(s).commandStatus=n(`当前档位:${i}。可用推理档:${a.join("、")}。`,`Thinking: ${i}. Available levels: ${a.join(", ")}.`),!0}case"fork":return W("web-branch-button").click(),at("branch-dialog").open;case"compact":{let l=await r({action:"compact",...t.instructions?{instructions:t.instructions}:{}},n("压缩上下文","Compact context"));if(l)me(s).commandStatus=n("上下文已压缩。","Context compaction completed.");return l}case"model":{if(!t.reference){if(Ss()&&!pe("model").disabled)gt(!0);if(pe("model").focus(),document.activeElement===pe("model")){try{pe("model").showPicker?.()}catch(i){if(!(i instanceof DOMException))throw i}return!0}return o(n("没有可选模型。","No models available.")),!1}let l=z(e.options.models).map(S).filter((i)=>[m(i.id),`${m(i.provider)}/${m(i.id)}`].includes(t.reference??""));if(l.length===1)return r({action:"model",provider:m(l[0].provider),modelId:m(l[0].id)},n("切换模型","Change model"));return o(l.length?n("多个模型同名,请用 provider/model。","Multiple models have that name. Use provider/model."):n("找不到此模型。用 /model 查看列表。","Model not found. Use /model to list available models.")),!1}case"thinking":{if(!t.level){if(Ss()&&!pe("thinking").disabled)gt(!0);if(pe("thinking").focus(),document.activeElement===pe("thinking")){try{pe("thinking").showPicker?.()}catch(l){if(!(l instanceof DOMException))throw l}return!0}return o(n("没有可选思考档。","No thinking levels available.")),!1}if(!z(e.options.levels).includes(t.level))return o(n("此模型不支持这个思考档。","This model does not support that thinking level.")),!1;return r({action:"thinking",level:t.level},n("切换思考档","Change thinking level"))}case"fast":if(typeof e.state.fastMode!=="boolean")return o(n("此模型没有快速模式。","Fast mode is unavailable for this model.")),!1;return r({action:"fast",enabled:t.mode?t.mode==="on":!e.state.fastMode},n("切换快速模式","Change fast mode"));case"clone":case"copy":We.add(s),te();try{if(t.name==="copy"){let{text:d}=await ue.request(`${ye(s)}/last-assistant`);if(typeof d!=="string"||!d)return o(n("没有可复制的助手消息。","No assistant message to copy.")),!1;if(!navigator.clipboard)return o(n("浏览器无法访问剪贴板。","The browser can't access the clipboard.")),!1;return await navigator.clipboard.writeText(d),me(s).commandStatus=n("已复制上一条助手消息。","Copied the last assistant message."),!0}let l=await ue.request(`${ye(s)}/branches`,{kind:"clone"});if(l.cancelled===!0)return o(n("原生引擎取消了复制。","OmO cancelled the clone.")),!1;let i=tt(l.session);if(!i)throw Error(n("本机服务没有返回新会话。","The local service did not return a new session."));if(e===h)Lr(i,"",{kind:"web",id:s,name:e.session.name});else Ct(i);return!0}finally{We.delete(s)}}}function gr(){if(!h||h.status!=="ready"||!h.session.active||ae.get(h.session.id)?.status==="pending")return;let e=me(h.session.id);if(e.commandMode||Sr(e.text))al(h);else rl()}async function Ye(e,t,o,s,r){let l=e.session.id;if(We.has(l)||ae.get(l)?.status==="pending")return!1;We.add(l),s(""),te(),ge.setAttribute("aria-busy","true"),J.setAttribute("aria-busy","true");try{let i=await So(e,t);if(e!==h)return!0;if(r?.(i),t.action==="navigate"){if(S(i.result).cancelled===!0)return!1;Ne?.invalidate(),jn(e),st?.abort(),e.workbench=void 0;let d=m(S(i.result).editorText);if(d){let a=me(l);if(a.text=d,!a.commandMode)he.value=d}}if(t.action==="resume")e.status="loading";if(t.action==="model"||t.action==="thinking")e.modelPreview=void 0;if(await Zt(e,t.action==="resume"||t.action==="navigate"),e!==h)return!0;if(t.action==="resume")Rt(e);if(ge.open)$r(e);if(J.open&&t.action!=="abort")mo(e);return!0}catch(i){if(e===h)s(n(`${o}失败:${ee(i)}`,`${o} failed: ${ee(i)}`),i);return!1}finally{if(We.delete(l),ge.removeAttribute("aria-busy"),J.removeAttribute("aria-busy"),e===h)te()}}function ks(){if(be!=="online"||!Ae.length||an.open)return;we.stop();let e=pe("new-cwd");e.replaceChildren(...Ae.map((o)=>Se(o,o))),e.value=Vt||h?.session.cwd||Ae[0]||"";let t=Ae.length>1;if(w("new-cwd-field").hidden=!t,w("new-cwd-fixed").hidden=t,w("new-cwd-path").textContent=e.value,_e("new-name").value="",D(w("new-error")),an.showModal(),!t)_e("new-name").focus()}async function dl(){if(In||be!=="online")return;let e=pe("new-cwd").value;if(!Ae.includes(e))return;let t=_e("new-name").value.trim();if(t.length>120){D(w("new-error"),n("会话名称不能超过 120 个字符。","Keep the session name to 120 characters or fewer."));return}In=!0,W("create").disabled=!0,D(w("new-error"));try{let o=await ue.request("/api/sessions",{cwd:e,...t?{name:t}:{}}),s=tt(o.session);if(!s)throw Error(n("本机服务没有返回会话。","The local service did not return a session."));if(Vt="",Ct(s),!we.active){if(et=s.archived,an.open)an.close();Un(s.id)}}catch(o){if(D(w("new-error"),n(`创建失败:${ee(o)}`,`Couldn't create session: ${ee(o)}`)),o instanceof ie&&(o.status===401||o.status===403))bt(!0)}finally{In=!1,wt()}}async function cl(e){let t=e.session.id;if(e!==h||!ge.open||ae.get(t)?.status==="pending"||Tr(e))return;let o={status:"pending"};ae.set(t,o),e.history?.invalidate(),te(),cn(e),w("manage-handoff-status").focus();let s=()=>h?.session.id===t?h:void 0,r=()=>ge.open||document.activeElement===W("manage-button")||w("composer-shell").contains(document.activeElement),l=(i,d)=>{let a=r();if(Co(i),i.error="",ge.open)ge.close();if(te(),a&&!document.querySelector("dialog:modal"))w(d).focus()};try{let{session:i,command:d}=await ue.handoff(t);if(ae.get(t)!==o)return;ae.set(t,{status:"released",command:d}),Ct(i),hn(!0);let a=s();if(a)l(a,"handoff-title")}catch(i){if(ae.get(t)!==o)return;let d=!(i instanceof ie)||i.status>=500||i.code==="session_not_open",a=n(`无法转到 CLI:${ee(i)}`,`Couldn't switch to the CLI: ${ee(i)}`),c=s();if(d||c&&!c.session.active){ae.set(t,{status:"uncertain",error:a});let p=c?.session??zt.get(t);if(p)Ct({...p,active:!1,running:!1});if(c)l(c,"session-error");$t()}else if(ae.set(t,{status:"failed",error:a}),c){if(te(),cn(c),ge.open&&document.activeElement===w("manage-handoff-status"))w("manage-handoff-error").focus()}if(i instanceof ie&&(i.status===401||i.status===403))bt(!0)}}function $r(e){let t=w("manage-body"),o=document.activeElement,s=o instanceof HTMLElement&&t.contains(o)?o.dataset.key:void 0,r=e.session.id,l=(E)=>D(w("manage-error"),E),i=u("input");i.type="text",i.required=!0,i.maxLength=120,i.value=e.session.name,i.dataset.key="name";let d=u("form","stack stack--tight"),a=u("button","button",n("保存名称","Save name"));a.type="submit",a.dataset.write="",a.dataset.key="save";let c=u("div","row");c.append(a),d.append(Tt(n("会话名称","Session name"),i),c),d.addEventListener("submit",(E)=>{E.preventDefault();let x=i.value.trim();if(!x){l(n("请输入会话名称。","Enter a session name."));return}if(x!==e.session.name)Ye(e,{action:"rename",name:x},n("重命名","Rename"),l)});let p=(E,x,N,O=!1)=>{let P=fe(E,()=>void Ye(e,N,E,l));return P.dataset.key=x,P.dataset.write="",P.disabled=O||be!=="online",P},f=u("section","subpanel stack stack--tight"),g=u("div","row");g.append(p(e.session.archived?n("取消归档","Unarchive"):n("归档","Archive"),"archive",{action:"archive",enabled:!e.session.archived}),p(e.session.settled?n("重新标为未结清","Mark as open"):n("标为已结清","Mark as done"),"settle",{action:"settle",enabled:!e.session.settled})),f.append(u("h3","",n("会话状态","Session status")),u("p","small muted",e.session.archived?n("已归档","Archived"):n("未归档","Not archived")),g);let k=u("section","subpanel stack stack--tight"),C=u("div","row"),b=e.state.fastMode,y=e.state.autoCompactionEnabled;if(typeof b==="boolean")C.append(p(b?n("关闭快速模式","Turn off fast mode"):n("开启快速模式","Turn on fast mode"),"fast",{action:"fast",enabled:!b}));if(typeof y==="boolean")C.append(p(y?n("关闭自动压缩","Turn off auto-compaction"):n("开启自动压缩","Turn on auto-compaction"),"auto",{action:"autoCompaction",enabled:!y}));let H=u("h3","",n("运行设置","Run settings"));if(H.dataset.key="run-settings",H.tabIndex=-1,k.append(H),C.childElementCount)k.append(C);let R=u("form","stack stack--tight"),M=u("input");M.type="text",M.maxLength=6000,M.dataset.key="instructions";let T=u("button","button",n("压缩上下文","Compact context"));T.type="submit",T.dataset.write="",T.dataset.idle="",T.dataset.key="compact",T.disabled=be!=="online"||e.running||e.compacting;let _=u("div","row");if(_.append(T),R.append(Tt(n("压缩说明(选填)","Compaction instructions (optional)"),M),_),R.addEventListener("submit",(E)=>{if(E.preventDefault(),e.running||e.compacting||We.has(r)){l(n("等本轮结束后再压缩。","Wait for this turn to finish before compacting."));return}let x=M.value.trim();Ye(e,{action:"compact",...x?{instructions:x}:{}},n("压缩上下文","Compact context"),l)}),k.append(R),a.disabled=be!=="online",t.replaceChildren(d,f,k),s)[...t.querySelectorAll("[data-key]")].find((E)=>E.dataset.key===s)?.focus()}var At,ws=[];function Rr(e,t){if(e!==h)return;let o=me(e.session.id);o.commandMode=t,he.value=t?o.commandText:o.text,gn(),te(),he.focus()}function qr(e,t){if(e!==h||!Ot.test(t))return;let o=me(e.session.id),[s=""]=o.commandText.split(/\s/,1),r=Ot.test(s)?o.commandText.slice(s.length):"";if(o.commandText=`${t}${r||" "}`,o.commandError="",Oe.open)Oe.close();if(J.matches(":modal"))It(!1);Rr(e,!0),he.setSelectionRange(t.length+1,t.length+1)}function Cs(e){let t=w("command-list"),o=document.activeElement,s=o instanceof HTMLButtonElement&&t.contains(o)?o.dataset.invocation:void 0,r,l=_e("command-search").value.trim().toLocaleLowerCase(),i=ws.flatMap((d)=>{let a=m(d.invocation),c=m(d.description),p=m(d.source),f=p==="builtin"?n("内置命令","Built-in"):p==="skill"?n("技能","Skill"):p==="prompt"?n("提示模板","Prompt template"):n("扩展","Extension");if(!Ot.test(a)||!`${a} ${c} ${f} ${p}`.toLocaleLowerCase().includes(l))return[];let g=u("li","stack stack--tight"),k=fe(a,()=>qr(e,a),"button--quiet path");if(k.dataset.invocation=a,a===s)r=k;return k.setAttribute("aria-label",n(`插入命令:${a}`,`Insert command: ${a}`)),g.append(k,u("p","small muted break",[f,c].filter(Boolean).join(" · "))),[g]});t.replaceChildren(...i),t.hidden=!i.length,r?.focus({preventScroll:!0}),D(w("command-status"),i.length?"":l?n("没有匹配的命令。","No matching commands."):n("此会话没有可用命令。","This session has no listed commands."))}async function Hr(e,t=!1){if(Oe.open||W("command-picker").disabled)return;At?.abort();let o=At=new AbortController;ws=io([]);let s=_e("command-search"),r=K("command-shortcuts",HTMLDetailsElement);if(r.open=t,s.value="",w("command-list").replaceChildren(),w("command-list").hidden=!0,D(w("command-error")),Oe.showModal(),Cs(e),t)r.querySelector("summary")?.focus();let l=()=>!o.signal.aborted&&Oe.open&&e===h;try{let i=await ue.request(`${ye(e.session.id)}/options`,void 0,o.signal);if(!l())return;ws=io(i.commands),Cs(e)}catch(i){if(!l())return;D(w("command-error"),n(`无法读取扩展命令:${ee(i)}。内置命令仍可用。`,`Couldn't load extension commands: ${ee(i)}. Built-in commands remain available.`))}finally{if(At===o)At=void 0}}var ft,Je,it,qt,Xe,Ne,Ht,un=!1,Vn,ht,Ts,on,ut,xo=!1,Ls=()=>[...J.querySelectorAll('[role="tab"]')],_s=()=>!w("runtime-capabilities").hidden,Gt=()=>!w("runtime-metrics").hidden,Kn=()=>!w("runtime-todo").hidden,ko=()=>K("runtime-memory-branch",HTMLDetailsElement),pn=()=>!w("runtime-subagent").hidden?"tasks":!w("runtime-dag").hidden?"dag":Kn()&&ko().open?"memory":void 0;function wo(){let e=W("details-refresh");if(_s()&&ut)e.setAttribute("aria-disabled","true");else e.removeAttribute("aria-disabled")}function Ir(){ut?.abort(),ut=void 0,xo=!1;let e=w("capabilities-status");e.textContent="",e.className="sr-only",w("capabilities-content").replaceChildren(),wo()}function ul(e){if(ut)return;let t=ut=new AbortController,o=()=>ut===t&&J.open&&h===e,s=w("capabilities-status"),r=w("capabilities-content"),l=os();xo=!0,r.replaceChildren(l),s.className="small muted",s.textContent=n("正在读取能力清单…","Loading capabilities…"),wo();let i=AbortSignal.any([t.signal,AbortSignal.timeout(1e4)]);ue.request(`${ye(e.session.id)}/capabilities`,void 0,i).then((d)=>{if(!o())return;r.replaceChildren(...ji(d)),s.className="sr-only",s.textContent=n("能力清单已加载。","Capabilities loaded.")},(d)=>{if(!o())return;if(s.className="notice error small",d instanceof ie&&d.status===404&&d.code==="not_found")s.textContent=n("此版本的 Web 服务不提供能力清单。","This Web server does not list capabilities.");else if(d instanceof ie&&(d.code==="session_changed"||d.code==="session_not_open"||d.code==="session_not_found"))s.textContent=n("会话已断开。打开会话后重试。","Session disconnected. Open it and try again.");else s.textContent=n("无法读取能力清单。刷新重试。","Couldn't load capabilities. Refresh to try again.")}).finally(()=>{if(ut!==t)return;ut=void 0,wo()})}function Wn(e){if(e.getAttribute("aria-selected")==="true")return;for(let t of Ls()){let o=t===e;t.setAttribute("aria-selected",String(o)),t.tabIndex=o?0:-1;let s=t.getAttribute("aria-controls");if(s)w(s).hidden=!o;if(s==="runtime-todo"&&!o)Es()}if(w("details-scroll").scrollTop=0,on=void 0,J.open&&h?.status==="ready")sn(h);wo()}function Eo(){if(!on)return;let e=on==="todo"?"#runtime-todo [data-runtime-branch]":"#runtime-tree",t=J.querySelector(`${e} details`);if(!t)return;on=void 0,t.open=!0;let o=t.querySelector("summary");if(document.activeElement===W(e==="#runtime-tree"?"runtime-open-overview":"runtime-open-todo"))o?.focus({preventScroll:!0}),o?.scrollIntoView({block:"start"})}function Pt(e="overview",t=W("details-button"),o){if(h?.status!=="ready")return;let s=W(`runtime-open-${e}`);if(Wn(s),Ts=t,on=o,!dn.matches&&!Pn)Pn=!0,Rs(As,"open");if(!J.open)_r(h);s.focus({preventScroll:!0}),Eo()}function _r(e){D(w("details-error")),un=!1;for(let r of J.querySelectorAll('[role="tabpanel"]:not(#runtime-capabilities, #runtime-todo)'))r.replaceChildren();w("runtime-todo").querySelector("[data-runtime-branch]")?.remove(),w("runtime-memory-journal").replaceChildren(),w("runtime-memory-branch-content").replaceChildren(),ko().open=!1;let t=()=>h===e&&J.open&&Gt();Ht=Ri(ue,ye(e.session.id),()=>t()&&e.status==="ready",()=>e.session.active&&be==="online"&&!We.has(e.session.id)&&ae.get(e.session.id)?.status!=="pending",()=>{if(window.confirm(n("清空所有尚未发送的排队输入?","Remove all unsent messages from the queue?")))Ye(e,{action:"clearQueue"},n("清空队列","Clear queue"),(r)=>D(w("details-error"),r))});let o=()=>e.session.active&&be==="online"&&!e.running&&!e.compacting&&!e.requests.size&&!(e.queue&&e.queue>0)&&!kt.has(e.session.id)&&!We.has(e.session.id)&&ae.get(e.session.id)?.status!=="pending",s=Bi(ue,ye(e.session.id),t,o,(r,l)=>{let d=me(e.session.id).text.trim()?n("切换上下文位置?选中的消息可能替换当前草稿。","Switch context? The selected message may replace your draft."):n("切换上下文位置?原有分支仍会保留。","Switch context? Existing branches are kept."),a=(c,p)=>{if(Ne!==s)return;let f=es(p);if(f)s.invalidate();D(w("details-error"),f?"":c)};if(window.confirm(d))Ye(e,{action:"navigate",targetId:r,expectedLeafId:l},n("切换上下文","Switch context"),a,(p)=>{if(S(p.result).cancelled===!0)a(n("本次切换已取消。","Context switch cancelled."))})});if(Ne=s,w("runtime-metrics").append(Ne.root),dn.matches)J.showModal();else J.open=!0;W("details-button").setAttribute("aria-expanded","true"),w("details-scroll").scrollTop=0,sn(e)}function Wr(e,t=!1){if(!e||e.status!=="ready"||we.active||e.consideredDesktopDock&&!t)return;if(e.consideredDesktopDock=!0,!Pn||dn.matches||J.open)return;Wn(W("runtime-open-overview")),_r(e)}function It(e=!0){if(!J.open)return;if(J.close(),ft?.abort(),ft=void 0,Je?.abort(),Je=void 0,it?.abort(),it=void 0,qt?.abort(),qt=void 0,Xe?.abort(),Xe=void 0,Ne?.abort(),Ne=void 0,Ht?.deactivate(),Ht=void 0,Vn=void 0,ht=void 0,Es(),h)h.detailData=void 0;on=void 0,Ir();let t=W("details-button");t.setAttribute("aria-expanded","false");let o=Ts??t;if(Ts=void 0,e)(o.getClientRects().length?o:t.hidden?w("conversation"):t).focus({preventScroll:!0})}function ro(){if(!J.matches(":modal"))Pn=!1,Rs(As,"closed");It()}function hs(){let e=W("details-button");if(dn.matches){if(e.setAttribute("aria-haspopup","dialog"),J.open&&!J.matches(":modal"))It(J.contains(document.activeElement));return}if(e.removeAttribute("aria-haspopup"),!J.matches(":modal")||document.querySelector("dialog:modal:not(#details-dialog)"))return;let t=w("details-scroll"),o=t.scrollTop,s=document.activeElement;if(J.close(),J.open=!0,s instanceof HTMLElement&&J.contains(s))s.focus({preventScroll:!0});t.scrollTop=o}function gt(e){xt.setAttribute("aria-expanded",String(e))}function Ss(){return getComputedStyle(gs).getPropertyValue("--compact-options").trim()==="1"}function pl(){let e=Ss();if(e===gs.hasAttribute("data-compact"))return;let t=document.activeElement;if(!e)gt(!1);if(gs.toggleAttribute("data-compact",e),e&&rn.contains(t)&&xt.getAttribute("aria-expanded")!=="true")xt.focus({preventScroll:!0});else if(!e&&t===xt)(rn.querySelector("select:enabled:not([hidden] *)")??he).focus({preventScroll:!0})}function xs(e){ft?.abort();let t=ft=new AbortController,o=Ne?.root,s=Ht,r=()=>!t.signal.aborted&&J.open&&Gt()&&e===h,l=w("runtime-metrics"),i=(a)=>D(w("details-error"),a),d=!l.querySelector(".runtime-metrics")&&!l.querySelector(":scope > p")?u("p","muted",n("正在读取运行详情…","Loading run details…")):void 0;if(d)l.prepend(d);i(""),ue.request(`${ye(e.session.id)}/details`,void 0,t.signal).then((a)=>{if(!r()||!o||!s)return;if(e.detailData=a,un=!1,Ee.online!==!1)Is(e,a.generationSpeed);s.update(Y(S(a.state).pendingMessageCount)),Hi(a,e.state,e.options,{insertCommand:(c)=>qr(e,c)},o,s.root,e.generationSpeed),Eo()}).catch((a)=>{if(!r())return;l.querySelector(":scope > p")?.remove(),i(n(`无法读取运行详情:${ee(a)}`,`Couldn't load run details: ${ee(a)}`))}).finally(()=>{if(ft===t)ft=void 0})}function ml(e){it?.abort();let t=it=new AbortController,o=()=>t===it&&J.open&&Kn()&&h===e;if(!Vn)Xo({status:"loading"});let s=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);ue.request(`${ye(e.session.id)}/branch-runtime`,void 0,s).catch(()=>({status:"unavailable",reason:"read_failed"})).then((r)=>{if(!o())return;if(Vn=r,r.status==="ok"&&(typeof r.leafId==="string"||r.leafId===null))Ne?.checkLeaf(r.leafId);Xo(r),Eo()}).finally(()=>{if(it===t)it=void 0})}function Ws(e){let t=pn();if(!t||!ht)return;if(t==="memory"){w("runtime-memory-journal").replaceChildren(Ui(ht.memory));return}let o=ht,s=no(o[t]),r=s?o.snapshot??"waiting":void 0;if(t==="tasks")w("runtime-subagent").replaceChildren(...is("tasks",o.tasks,r));else{let d=w("runtime-dag"),a=d.querySelector(".dag-run[open]")?.dataset.dagKey,c=document.activeElement?.closest(".dag-run")?.dataset.dagKey;qt?.abort();let p=qt=new AbortController;d.replaceChildren(...is("dag",o.dag,r,(f)=>{let g=AbortSignal.any([p.signal,AbortSignal.timeout(28000)]);return ue.request(`${ye(e.session.id)}/native-runtime/dag/${f}`,void 0,g)}));for(let f of d.querySelectorAll(".dag-run")){if(f.dataset.dagKey===a)f.open=!0;if(c&&f.dataset.dagKey===c&&document.activeElement===document.body)f.querySelector("summary")?.focus({preventScroll:!0})}}if(!s||o.snapshot||Xe)return;let l=Xe=new AbortController,i=AbortSignal.any([l.signal,AbortSignal.timeout(8000)]);ue.request(`${ye(e.session.id)}/activity`,void 0,i).catch(()=>({status:"unavailable"})).then((d)=>{if(Xe!==l||!J.open||h!==e||ht!==o)return;o.snapshot=d;let a=pn();if((a==="tasks"||a==="dag")&&no(o[a]))Ws(e)}).finally(()=>{if(Xe===l)Xe=void 0})}function fl(e){Je?.abort(),Xe?.abort(),Xe=void 0;let t=Je=new AbortController,o=()=>Je===t&&J.open&&h===e&&Boolean(pn()),s=pn();if(s==="dag")qt?.abort(),qt=void 0;let r=w(s==="memory"?"runtime-memory-journal":s==="dag"?"runtime-dag":"runtime-subagent");if(!r.childElementCount){let i=u("p","small muted",n("正在读取原生运行信息…","Loading native runtime…"));i.setAttribute("role","status"),r.append(i)}let l=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);ue.request(`${ye(e.session.id)}/native-runtime`,void 0,l).catch((i)=>{let a={status:"unavailable",reason:i instanceof ie&&i.status===404&&i.code==="not_found"?"web_unsupported":i instanceof ie&&i.status>=400&&i.status<500?"read_refused":"read_failed"};return{tasks:a,dag:a,memory:a}}).then((i)=>{if(!o())return;ht={tasks:S(i.tasks),dag:S(i.dag),memory:S(i.memory)},Ws(e)}).finally(()=>{if(Je===t)Je=void 0})}function sn(e,t=!1){if(e!==h||e.status!=="ready"||!J.open)return;if(Gt()){if(t||!ft&&(un||!e.detailData))xs(e);Ne?.activate(),Ht?.activate(t)}else ft?.abort(),ft=void 0,Ne?.abort(),Ht?.deactivate();if(Kn())if(t||!Vn&&!it)ml(e);else Eo();else it?.abort(),it=void 0;let o=pn();if(o){if(t||!ht&&!Je)fl(e);else if(ht&&!Je)Ws(e)}else Je?.abort(),Je=void 0;if(o!=="dag")qt?.abort(),qt=void 0;if(!o||o==="memory")Xe?.abort(),Xe=void 0;if(_s()){if(t||!xo)ul(e)}else if(ut)Ir()}function mo(e){if(!Gt())un=!0;if(!Kn())Vn=void 0;if(!pn())ht=void 0;if(!_s())xo=!1;sn(e,!0)}function Nr(e){we.stop(),Qe(!1),Cr.open(e)}function hl(){let e=()=>{we.stop(),Qe(!1),Ms("cli-follow-button")};W("cli-follow-button").addEventListener("click",()=>{if(we.active){e();return}Qe(!1),It(!1),gt(!1),we.start(),W("cli-follow-stop").focus({preventScroll:!0})}),W("cli-follow-stop").addEventListener("click",e),W("cli-history-button").addEventListener("click",()=>Nr()),W("cli-live-button").addEventListener("click",()=>{we.stop(),Qe(!1),fn.open()}),W("web-branch-button").addEventListener("click",()=>{if(h&&ae.get(h.session.id)?.status!=="pending")$s({kind:"web",id:h.session.id,name:h.session.name})}),W("open-navigation").addEventListener("click",()=>Qe(!0)),W("close-navigation").addEventListener("click",()=>Qe(!1,!0)),W("nav-scrim").addEventListener("click",()=>Qe(!1,!0)),Et=pr(cr)==="true",Pn=pr(As)!=="closed",mr(),W("rail-toggle").addEventListener("click",()=>{Et=!Et,Rs(cr,String(Et)),mr()}),ln.addEventListener("change",()=>{let a=document.activeElement,c=ot||a===W("open-navigation")||a===W("rail-toggle")||w("navigation").contains(a);if(Qe(!1),c&&!document.querySelector("dialog:modal"))W(ln.matches?"open-navigation":"rail-toggle").focus({preventScroll:!0})}),hs(),dn.addEventListener("change",()=>{if(hs(),!dn.matches)Wr(h,!0)}),document.addEventListener("close",(a)=>{if(a.target!==J)hs()},!0),new ResizeObserver(pl).observe(ao("composer"));let t=()=>xt.getAttribute("aria-expanded")==="true";xt.addEventListener("click",()=>gt(!t()));let o=(a)=>{if(t()&&a.target instanceof Node&&!xt.contains(a.target)&&!rn.contains(a.target))gt(!1)};document.addEventListener("click",o),document.addEventListener("focusin",o),document.addEventListener("keydown",(a)=>{if(a.key!=="Escape"||a.defaultPrevented||a.isComposing||document.querySelector("dialog:modal"))return;if(ot)Qe(!1,!0);else if(t())gt(!1),xt.focus({preventScroll:!0});else if(J.open)ro()}),_e("search").addEventListener("input",()=>{vt(),Ut()}),pe("workspace-select").addEventListener("change",()=>Za(pe("workspace-select").value)),W("recent").addEventListener("click",()=>{et=!1,vt(),Ut()}),W("archived").addEventListener("click",()=>{et=!0,vt(),Ut()}),document.addEventListener("visibilitychange",()=>{if(document.hidden)return;if($t(),h)bo(h);if(h&&J.open)sn(h,!0)}),window.setInterval(()=>{if(!document.hidden&&be==="online")hn(!0)},kr),W("new-welcome").addEventListener("click",ks),W("new-sidebar").addEventListener("click",ks),ao("new-form").addEventListener("submit",(a)=>{a.preventDefault(),dl()});let s=at("session-path-dialog");for(let a of[an,ge,Oe,s])for(let c of a.querySelectorAll("[data-close]"))c.addEventListener("click",()=>a.close());W("session-path-trigger").addEventListener("click",()=>{let a=w("session-path").textContent;if(!a||s.open)return;w("session-path-full").textContent=a,D(w("session-path-status")),s.showModal()}),W("session-path-copy").addEventListener("click",async()=>{let a=w("session-path-full"),c=a.textContent;if(!c)return;let p=n("已复制路径。","Path copied.");try{await navigator.clipboard.writeText(c)}catch{p=n("剪贴板不可用。可选中路径手动复制。","Clipboard unavailable. Select and copy the path.")}if(s.open&&a.textContent===c)D(w("session-path-status"),p)}),W("manage-button").addEventListener("click",()=>{if(!h||ge.open)return;D(w("manage-error")),$r(h),ge.showModal(),te()}),ge.addEventListener("close",te),W("manage-handoff").addEventListener("click",()=>{if(h)cl(h)}),W("handoff-copy").addEventListener("click",async()=>{let a=h;if(!a)return;let c=ae.get(a.session.id);if(c?.status!=="released")return;try{await navigator.clipboard.writeText(c.command),c.copyStatus=n("已复制命令。","Command copied.")}catch{c.copyStatus=n("剪贴板不可用。可选中命令手动复制。","Clipboard unavailable. Select and copy the command.")}if(h?.session.id===a.session.id&&ae.get(a.session.id)===c)te()}),W("details-button").addEventListener("click",()=>{if(J.open)ro();else Pt()}),W("current-todo").addEventListener("click",()=>Pt("todo",W("current-todo"),"todo"));let r=w("runtime-memory-journal");r.classList.add("fold-body"),w("runtime-memory-branch-content").before(r),ko().addEventListener("toggle",()=>{if(h&&J.open&&Kn())sn(h)}),w("runtime-metrics").addEventListener("click",(a)=>{if(!(a.target instanceof Element)||!a.target.closest("#runtime-open-resources"))return;Wn(W("runtime-open-todo")),ko().open=!0;let c=w("runtime-resources-title");c.focus({preventScroll:!0}),c.scrollIntoView({block:"start"})});for(let a of Ls())a.addEventListener("click",()=>Wn(a));w("runtime-shortcuts").addEventListener("keydown",(a)=>{let c=Ls(),p=c.findIndex((g)=>g===a.target);if(p<0)return;let f=a.key==="Home"?c[0]:a.key==="End"?c.at(-1):a.key==="ArrowLeft"?c[(p+c.length-1)%c.length]:a.key==="ArrowRight"?c[(p+1)%c.length]:void 0;if(!f)return;a.preventDefault(),Wn(f),f.focus({preventScroll:!0})}),W("details-refresh").addEventListener("click",()=>{if(!h||!J.open)return;if(sn(h,!0),Gt())Ne?.refresh()}),J.querySelector("[data-close]")?.addEventListener("click",ro),J.addEventListener("cancel",(a)=>{a.preventDefault(),ro()}),W("command-mode").addEventListener("click",()=>{if(h)Rr(h,!me(h.session.id).commandMode)}),W("command-picker").addEventListener("click",()=>{if(h)Hr(h)}),Di(Oe,_e("command-search"),w("command-list")),Oe.addEventListener("close",()=>{if(!Oe.open)At?.abort()}),_e("command-search").addEventListener("input",()=>{if(h&&!At&&w("command-error").hidden)Cs(h)}),W("retry").addEventListener("click",()=>{if(clearTimeout(Hn),Hn=0,nt?.close(),nt=void 0,h)Lo(h);if(Pe=qe==="transport"?"lost":"waiting",qe!=="transport")qe=!1;Ft="",Dn="",wt(),bt(!0)}),W("resume").addEventListener("click",()=>{let a=h;if(!a||W("resume").disabled)return;let c=ae.get(a.session.id),p=c?.status==="released"||c?.status==="uncertain";if(a.session.active&&!p){a.status="loading",a.error="",te(),Zt(a,!0),Rt(a);return}let f=w("conversation");f.focus(),Ye(a,{action:"resume"},n("恢复会话","Resume session"),(g)=>{a.error=g,te()}).then(()=>{if(a!==h||document.activeElement!==f||document.querySelector("dialog:modal"))return;if(a.status==="ready")he.focus();else if(!w("session-error").hidden)w("session-error").focus()})}),ao("composer").addEventListener("submit",(a)=>{a.preventDefault(),gr()}),he.addEventListener("input",()=>{if(!h)return;let a=me(h.session.id);if(a.commandStatus=void 0,a.commandMode)a.commandText=he.value,a.commandError="";else a.text=he.value,a.error="";te()}),he.addEventListener("keydown",(a)=>{if($n.key(a))return;if(a.key==="Enter"&&!a.isComposing&&!$n.composing&&(a.ctrlKey||a.metaKey))a.preventDefault(),gr()}),he.addEventListener("focus",te),he.maxLength=200000,he.addEventListener("paste",(a)=>{let c=[...a.clipboardData?.files??[]].filter((p)=>p.type.startsWith("image/"));if(c.length)hr(c)}),W("attach").addEventListener("click",()=>_e("files").click()),_e("files").addEventListener("change",(a)=>{let c=a.currentTarget;if(c instanceof HTMLInputElement)hr([...c.files??[]]),c.value=""}),pt.addEventListener("change",()=>{if(!h)return;me(h.session.id).mode=pt.value==="steer"||pt.value==="follow_up"?pt.value:"prompt",te()}),W("stop").addEventListener("click",()=>{let a=h;if(a)Ye(a,{action:"abort"},n("停止","Stop"),(c)=>{me(a.session.id).error=c,te()})}),mn.observeTrace(({user:a,assistant:c,tool:p})=>{_n(tn.user,a),_n(tn.assistant,c),_n(tn.tool,p)});let l=matchMedia("(prefers-reduced-motion: no-preference) and (forced-colors: none)"),i;l.addEventListener("change",()=>i?.cancel());let d=(a)=>{if(a.tagName!=="SUMMARY")a.tabIndex=-1;if(a.focus({preventScroll:!0}),a.scrollIntoView({block:"nearest",inline:"nearest"}),i?.cancel(),!l.matches)return;let c=a.animate([{backgroundColor:"var(--trace-arrival)"},{}],{duration:460,easing:"ease-out"});i=c,c.onfinish=c.oncancel=()=>{if(i===c)i=void 0}};for(let a of Object.values(tn))a.addEventListener("click",()=>{let c=nn.get(a);if(!fo.hidden&&c?.isConnected)d(c)});W("sidebar-question").addEventListener("click",()=>{let a=Nn.firstQuestion;if(!a?.isConnected)return;if(J.matches(":modal"))It(!1);d(a)}),mt.addEventListener("change",()=>{let a=h;if(!a||mt.disabled)return;a.modelSelection=mt.value||void 0,te()}),yt.addEventListener("click",async()=>{let a=h,c=z(a?.options.models).map(S).find((p)=>De(p)===a?.modelSelection);if(!a||!c||yt.disabled)return;if(await Ye(a,{action:"model",provider:m(c.provider),modelId:m(c.id)},n("切换模型","Change model"),(p)=>{me(a.session.id).error=p,te()}),h!==a)return;if(a.modelSelection=void 0,te(),document.activeElement===document.body||document.activeElement===yt)mt.focus()}),pe("thinking").addEventListener("change",()=>{let a=h,c=pe("thinking").value;if(a&&c&&!pe("thinking").disabled)Ye(a,{action:"thinking",level:c},n("切换思考档","Change thinking level"),(p)=>{me(a.session.id).error=p,te()});else te()}),pe("approval").addEventListener("change",()=>{let a=h,c=pe("approval").value;if(!a||c!=="ask"&&c!=="auto"&&c!=="full-access"){te();return}if(c==="full-access"&&!window.confirm(n("关闭此会话的审批?工具默认放行,包括删除文件或对外发送数据。原生权限规则仍有效,用户问题仍需回答。","Turn off approval for this session? Tools can delete files or send data without asking. Native rules and user questions still apply."))){te();return}Ye(a,{action:"preset",preset:c},n("切换审批模式","Change approval mode"),(p)=>{me(a.session.id).error=p,te()})})}Ka();za();hl();bt();
|
|
1
|
+
var Im=Object.create;var{getPrototypeOf:Nm,defineProperty:Qa,getOwnPropertyNames:Bm}=Object;var S0=Object.prototype.hasOwnProperty;function Om(e){return this[e]}var zm,Fm,$m=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var s=t?zm??=new WeakMap:Fm??=new WeakMap,i=s.get(e);if(i)return i}n=e!=null?Im(Nm(e)):{};let a=t||!e||!e.__esModule||!S0.call(e,"default")?Qa(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let o of Bm(e))if(!S0.call(a,o))Qa(a,o,{get:Om.bind(e,o),enumerable:!0})}if(r)s.set(e,a);return a};var qm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hm=(e)=>e;function Pm(e,t){this[e]=Hm.bind(null,t)}var R0=(e,t)=>{for(var n in t)Qa(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Pm.bind(t,n)})};var Zd=qm(function(z6,Jd){function Nd(e){if(e instanceof Map)e.clear=e.delete=e.set=function(){throw Error("map is read-only")};else if(e instanceof Set)e.add=e.clear=e.delete=function(){throw Error("set is read-only")};return Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t)=>{let n=e[t],r=typeof n;if((r==="object"||r==="function")&&!Object.isFrozen(n))Nd(n)}),e}class yl{constructor(e){if(e.data===void 0)e.data={};this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Bd(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function or(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let s in r)n[s]=r[s]}),n}var j2="</span>",Sd=(e)=>!!e.scope,G2=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Od{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Bd(e)}openNode(e){if(!Sd(e))return;let t=G2(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){if(!Sd(e))return;this.buffer+=j2}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}var Rd=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class wl{constructor(){this.rootNode=Rd(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=Rd({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){if(typeof t==="string")e.addText(t);else if(t.children)e.openNode(t),t.children.forEach((n)=>this._walk(e,n)),e.closeNode(t);return e}static _collapse(e){if(typeof e==="string")return;if(!e.children)return;if(e.children.every((t)=>typeof t==="string"))e.children=[e.children.join("")];else e.children.forEach((t)=>{wl._collapse(t)})}}class zd extends wl{constructor(e){super();this.options=e}addText(e){if(e==="")return;this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;if(t)n.scope=`language:${t}`;this.add(n)}toHTML(){return new Od(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ti(e){if(!e)return null;if(typeof e==="string")return e;return e.source}function Fd(e){return Sr("(?=",e,")")}function K2(e){return Sr("(?:",e,")*")}function V2(e){return Sr("(?:",e,")?")}function Sr(...e){return e.map((n)=>ti(n)).join("")}function J2(e){let t=e[e.length-1];if(typeof t==="object"&&t.constructor===Object)return e.splice(e.length-1,1),t;else return{}}function va(...e){return"("+(J2(e).capture?"":"?:")+e.map((r)=>ti(r)).join("|")+")"}function $d(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z2(e,t){let n=e&&e.exec(t);return n&&n.index===0}var Y2=new RegExp(va(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function kl(e,{joinWith:t}){let n=0;return e.map((r)=>{n+=1;let s=n,i=ti(r),a="";while(i.length>0){let o=Y2.exec(i);if(!o){a+=i;break}if(a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1])a+="\\"+String(Number(o[1])+s);else if(a+=o[0],o[0]==="("||/^\(\?[<']/.test(o[0]))n++}return a}).map((r)=>`(${r})`).join(t)}var X2=/\b\B/,qd="[a-zA-Z]\\w*",xl="[a-zA-Z_]\\w*",Hd="\\b\\d+(\\.\\d+)?",Pd="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ud="\\b(0b[01]+)",Q2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e3=(e={})=>{let t=/^#![ ]*\//;if(e.binary)e.begin=Sr(t,/.*\b/,e.binary,/\b.*/);return or({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{if(n.index!==0)r.ignoreMatch()}},e)},ni={begin:"\\\\[\\s\\S]",relevance:0},t3={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ni]},n3={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ni]},r3={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ya=function(e,t,n={}){let r=or({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let s=va("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Sr(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},s3=ya("//","$"),i3=ya("/\\*","\\*/"),a3=ya("#","$"),o3={scope:"number",begin:Hd,relevance:0},l3={scope:"number",begin:Pd,relevance:0},c3={scope:"number",begin:Ud,relevance:0},u3={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ni,{begin:/\[/,end:/\]/,relevance:0,contains:[ni]}]},d3={scope:"title",begin:qd,relevance:0},h3={scope:"title",begin:xl,relevance:0},f3={begin:"\\.\\s*"+xl,relevance:0},m3=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{if(n.data._beginMatch!==t[1])n.ignoreMatch()}})},ga=Object.freeze({__proto__:null,APOS_STRING_MODE:t3,BACKSLASH_ESCAPE:ni,BINARY_NUMBER_MODE:c3,BINARY_NUMBER_RE:Ud,COMMENT:ya,C_BLOCK_COMMENT_MODE:i3,C_LINE_COMMENT_MODE:s3,C_NUMBER_MODE:l3,C_NUMBER_RE:Pd,END_SAME_AS_BEGIN:m3,HASH_COMMENT_MODE:a3,IDENT_RE:qd,MATCH_NOTHING_RE:X2,METHOD_GUARD:f3,NUMBER_MODE:o3,NUMBER_RE:Hd,PHRASAL_WORDS_MODE:r3,QUOTE_STRING_MODE:n3,REGEXP_MODE:u3,RE_STARTERS_RE:Q2,SHEBANG:e3,TITLE_MODE:d3,UNDERSCORE_IDENT_RE:xl,UNDERSCORE_TITLE_MODE:h3});function p3(e,t){if(e.input[e.index-1]===".")t.ignoreMatch()}function g3(e,t){if(e.className!==void 0)e.scope=e.className,delete e.className}function b3(e,t){if(!t)return;if(!e.beginKeywords)return;if(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=p3,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0)e.relevance=0}function v3(e,t){if(!Array.isArray(e.illegal))return;e.illegal=va(...e.illegal)}function y3(e,t){if(!e.match)return;if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}function w3(e,t){if(e.relevance===void 0)e.relevance=1}var k3=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach((r)=>{delete e[r]}),e.keywords=n.keywords,e.begin=Sr(n.beforeMatch,Fd(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},x3=["of","and","for","in","not","or","if","then","parent","list","value"],E3="keyword";function Wd(e,t,n=E3){let r=Object.create(null);if(typeof e==="string")s(n,e.split(" "));else if(Array.isArray(e))s(n,e);else Object.keys(e).forEach(function(i){Object.assign(r,Wd(e[i],t,i))});return r;function s(i,a){if(t)a=a.map((o)=>o.toLowerCase());a.forEach(function(o){let l=o.split("|");r[l[0]]=[i,A3(l[0],l[1])]})}}function A3(e,t){if(t)return Number(t);return C3(e)?0:1}function C3(e){return x3.includes(e.toLowerCase())}var Md={},Tr=(e)=>{console.error(e)},Dd=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ss=(e,t)=>{if(Md[`${e}/${t}`])return;console.log(`Deprecated as of ${e}. ${t}`),Md[`${e}/${t}`]=!0},ba=Error();function jd(e,t,{key:n}){let r=0,s=e[n],i={},a={};for(let o=1;o<=t.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=$d(t[o-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function _3(e){if(!Array.isArray(e.begin))return;if(e.skip||e.excludeBegin||e.returnBegin)throw Tr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ba;if(typeof e.beginScope!=="object"||e.beginScope===null)throw Tr("beginScope must be object"),ba;jd(e,e.begin,{key:"beginScope"}),e.begin=kl(e.begin,{joinWith:""})}function T3(e){if(!Array.isArray(e.end))return;if(e.skip||e.excludeEnd||e.returnEnd)throw Tr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ba;if(typeof e.endScope!=="object"||e.endScope===null)throw Tr("endScope must be object"),ba;jd(e,e.end,{key:"endScope"}),e.end=kl(e.end,{joinWith:""})}function S3(e){if(e.scope&&typeof e.scope==="object"&&e.scope!==null)e.beginScope=e.scope,delete e.scope}function R3(e){if(S3(e),typeof e.beginScope==="string")e.beginScope={_wrap:e.beginScope};if(typeof e.endScope==="string")e.endScope={_wrap:e.endScope};_3(e),T3(e)}function M3(e){function t(a,o){return new RegExp(ti(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,o){o.position=this.position++,this.matchIndexes[this.matchAt]=o,this.regexes.push([o,a]),this.matchAt+=$d(a)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let a=this.regexes.map((o)=>o[1]);this.matcherRe=t(kl(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let o=this.matcherRe.exec(a);if(!o)return null;let l=o.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[l];return o.splice(0,l),Object.assign(o,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let o=new n;return this.rules.slice(a).forEach(([l,u])=>o.addRule(l,u)),o.compile(),this.multiRegexes[a]=o,o}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,o){if(this.rules.push([a,o]),o.type==="begin")this.count++}exec(a){let o=this.getMatcher(this.regexIndex);o.lastIndex=this.lastIndex;let l=o.exec(a);if(this.resumingScanAtSamePosition())if(l&&l.index===this.lastIndex);else{let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,l=u.exec(a)}if(l){if(this.regexIndex+=l.position+1,this.regexIndex===this.count)this.considerAll()}return l}}function s(a){let o=new r;if(a.contains.forEach((l)=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd)o.addRule(a.terminatorEnd,{type:"end"});if(a.illegal)o.addRule(a.illegal,{type:"illegal"});return o}function i(a,o){let l=a;if(a.isCompiled)return l;[g3,y3,R3,k3].forEach((d)=>d(a,o)),e.compilerExtensions.forEach((d)=>d(a,o)),a.__beforeBegin=null,[b3,v3,w3].forEach((d)=>d(a,o)),a.isCompiled=!0;let u=null;if(typeof a.keywords==="object"&&a.keywords.$pattern)a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern;if(u=u||/\w+/,a.keywords)a.keywords=Wd(a.keywords,e.case_insensitive);if(l.keywordPatternRe=t(u,!0),o){if(!a.begin)a.begin=/\B|\b/;if(l.beginRe=t(l.begin),!a.end&&!a.endsWithParent)a.end=/\B|\b/;if(a.end)l.endRe=t(l.end);if(l.terminatorEnd=ti(l.end)||"",a.endsWithParent&&o.terminatorEnd)l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd}if(a.illegal)l.illegalRe=t(a.illegal);if(!a.contains)a.contains=[];if(a.contains=[].concat(...a.contains.map(function(d){return D3(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,l)}),a.starts)i(a.starts,o);return l.matcher=s(l),l}if(!e.compilerExtensions)e.compilerExtensions=[];if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=or(e.classNameAliases||{}),i(e)}function Gd(e){if(!e)return!1;return e.endsWithParent||Gd(e.starts)}function D3(e){if(e.variants&&!e.cachedVariants)e.cachedVariants=e.variants.map(function(t){return or(e,{variants:null},t)});if(e.cachedVariants)return e.cachedVariants;if(Gd(e))return or(e,{starts:e.starts?or(e.starts):null});if(Object.isFrozen(e))return or(e);return e}var L3="11.12.0";class Kd extends Error{constructor(e,t){super(e);this.name="HTMLInjectionError",this.html=t}}var vl=Bd,Ld=or,Id=Symbol("nomatch"),I3=7,Vd=function(e){let t=Object.create(null),n=Object.create(null),r=[],s=!0,i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:zd};function l(F){return o.noHighlightRe.test(F)}function u(F){let K=F.className+" ";K+=F.parentNode?F.parentNode.className:"";let Y=o.languageDetectRe.exec(K);if(Y){let ee=z(Y[1]);if(!ee)Dd(i.replace("{}",Y[1])),Dd("Falling back to no-highlight mode for this block.",F);return ee?Y[1]:"no-highlight"}return K.split(/\s+/).find((ee)=>l(ee)||z(ee))}function d(F,K,Y){let ee="",ie="";if(typeof K==="object")ee=F,Y=K.ignoreIllegals,ie=K.language;else ss("10.7.0","highlight(lang, code, ...args) has been deprecated."),ss("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),ie=F,ee=K;if(Y===void 0)Y=!0;let H={code:ee,language:ie};re("before:highlight",H);let q=H.result?H.result:f(H.language,H.code,Y);return q.code=H.code,re("after:highlight",q),q}function f(F,K,Y,ee){let ie=Object.create(null);function H(ue,be){return ue.keywords[be]}function q(){if(!Te.keywords){nt.addText($e);return}let ue=0;Te.keywordPatternRe.lastIndex=0;let be=Te.keywordPatternRe.exec($e),Re="";while(be){Re+=$e.substring(ue,be.index);let Ie=yt.case_insensitive?be[0].toLowerCase():be[0],Et=H(Te,Ie);if(Et){let[_n,Dm]=Et;if(nt.addText(Re),Re="",ie[Ie]=(ie[Ie]||0)+1,ie[Ie]<=I3)jr+=Dm;if(_n.startsWith("_"))Re+=be[0];else{let Lm=yt.classNameAliases[_n]||_n;N(be[0],Lm)}}else Re+=be[0];ue=Te.keywordPatternRe.lastIndex,be=Te.keywordPatternRe.exec($e)}Re+=$e.substring(ue),nt.addText(Re)}function W(){if($e==="")return;let ue=null;if(typeof Te.subLanguage==="string"){if(!t[Te.subLanguage]){nt.addText($e);return}ue=f(Te.subLanguage,$e,!0,Ss[Te.subLanguage]),Ss[Te.subLanguage]=ue._top}else ue=g($e,Te.subLanguage.length?Te.subLanguage:null);if(Te.relevance>0)jr+=ue.relevance;nt.__addSublanguage(ue._emitter,ue.language)}function le(){if(Te.subLanguage!=null)W();else q();$e=""}function N(ue,be){if(ue==="")return;nt.startScope(be),nt.addText(ue),nt.endScope()}function J(ue,be){let Re=1,Ie=be.length-1;while(Re<=Ie){if(!ue._emit[Re]){Re++;continue}let Et=yt.classNameAliases[ue[Re]]||ue[Re],_n=be[Re];if(Et)N(_n,Et);else $e=_n,q(),$e="";Re++}}function oe(ue,be){if(ue.scope&&typeof ue.scope==="string")nt.openNode(yt.classNameAliases[ue.scope]||ue.scope);if(ue.beginScope){if(ue.beginScope._wrap)N($e,yt.classNameAliases[ue.beginScope._wrap]||ue.beginScope._wrap),$e="";else if(ue.beginScope._multi)J(ue.beginScope,be),$e=""}return Te=Object.create(ue,{parent:{value:Te}}),Te}function Ce(ue,be,Re){let Ie=Z2(ue.endRe,Re);if(Ie){if(ue["on:end"]){let Et=new yl(ue);if(ue["on:end"](be,Et),Et.isMatchIgnored)Ie=!1}if(Ie){while(ue.endsParent&&ue.parent)ue=ue.parent;return ue}}if(ue.endsWithParent)return Ce(ue.parent,be,Re)}function ye(ue){if(Te.matcher.regexIndex===0)return $e+=ue[0],1;else return Kr=!0,0}function Be(ue){let be=ue[0],Re=ue.rule,Ie=new yl(Re),Et=[Re.__beforeBegin,Re["on:begin"]];for(let _n of Et){if(!_n)continue;if(_n(ue,Ie),Ie.isMatchIgnored)return ye(be)}if(Re.skip)$e+=be;else{if(Re.excludeBegin)$e+=be;if(le(),!Re.returnBegin&&!Re.excludeBegin)$e=be}return oe(Re,ue),Re.returnBegin?0:be.length}function Fe(ue){let be=ue[0],Re=K.substring(ue.index),Ie=Ce(Te,ue,Re);if(!Ie)return Id;let Et=Te;if(Te.endScope&&Te.endScope._wrap)le(),N(be,Te.endScope._wrap);else if(Te.endScope&&Te.endScope._multi)le(),J(Te.endScope,ue);else if(Et.skip)$e+=be;else{if(!(Et.returnEnd||Et.excludeEnd))$e+=be;if(le(),Et.excludeEnd)$e=be}do{if(Te.scope)nt.closeNode();if(!Te.skip&&!Te.subLanguage)jr+=Te.relevance;Te=Te.parent}while(Te!==Ie.parent);if(Ie.starts)oe(Ie.starts,ue);return Et.returnEnd?0:be.length}function Pe(){let ue=[];for(let be=Te;be!==yt;be=be.parent)if(be.scope)ue.unshift(be.scope);ue.forEach((be)=>nt.openNode(be))}let Ve={};function mt(ue,be){let Re=be&&be[0];if($e+=ue,Re==null)return le(),0;if(Ve.type==="begin"&&be.type==="end"&&Ve.index===be.index&&Re===""){if($e+=K.slice(be.index,be.index+1),!s){let Ie=Error(`0 width match regex (${F})`);throw Ie.languageName=F,Ie.badRule=Ve.rule,Ie}return 1}if(Ve=be,be.type==="begin")return Be(be);else if(be.type==="illegal"&&!Y){let Ie=Error('Illegal lexeme "'+Re+'" for mode "'+(Te.scope||"<unnamed>")+'"');throw Ie.mode=Te,Ie}else if(be.type==="end"){let Ie=Fe(be);if(Ie!==Id)return Ie}if(be.type==="illegal"&&Re===""){if(be.index===K.length);else $e+=`
|
|
3
|
+
`;return 1}if(Gr>1e5&&Gr>be.index*3)throw Error("potential infinite loop, way more iterations than matches");return $e+=Re,Re.length}let yt=z(F);if(!yt)throw Tr(i.replace("{}",F)),Error('Unknown language: "'+F+'"');let Wr=M3(yt),Cn="",Te=ee||Wr,Ss={},nt=new o.__emitter(o);Pe();let $e="",jr=0,Zt=0,Gr=0,Kr=!1;try{if(!yt.__emitTokens){Te.matcher.considerAll();for(;;){if(Gr++,Kr)Kr=!1;else Te.matcher.considerAll();Te.matcher.lastIndex=Zt;let ue=Te.matcher.exec(K);if(!ue)break;let be=K.substring(Zt,ue.index),Re=mt(be,ue);Zt=ue.index+Re}mt(K.substring(Zt))}else yt.__emitTokens(K,nt);return nt.finalize(),Cn=nt.toHTML(),{language:F,value:Cn,relevance:jr,illegal:!1,_emitter:nt,_top:Te}}catch(ue){if(ue.message&&ue.message.includes("Illegal"))return{language:F,value:vl(K),illegal:!0,relevance:0,_illegalBy:{message:ue.message,index:Zt,context:K.slice(Zt-100,Zt+100),mode:ue.mode,resultSoFar:Cn},_emitter:nt};else if(s)return{language:F,value:vl(K),illegal:!1,relevance:0,errorRaised:ue,_emitter:nt,_top:Te};else throw ue}}function p(F){let K={value:vl(F),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return K._emitter.addText(F),K}function g(F,K){K=K||o.languages||Object.keys(t);let Y=p(F),ee=K.filter(z).filter(P).map((le)=>f(le,F,!1));ee.unshift(Y);let ie=ee.sort((le,N)=>{if(le.relevance!==N.relevance)return N.relevance-le.relevance;if(le.language&&N.language){if(z(le.language).supersetOf===N.language)return 1;else if(z(N.language).supersetOf===le.language)return-1}return 0}),[H,q]=ie,W=H;return W.secondBest=q,W}function b(F,K,Y){let ee=K&&n[K]||Y;F.classList.add("hljs"),F.classList.add(`language-${ee}`)}function x(F){let K=null,Y=u(F);if(l(Y))return;if(re("before:highlightElement",{el:F,language:Y}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0){if(!o.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F);if(o.throwUnescapedHTML)throw new Kd("One of your code blocks includes unescaped HTML.",F.innerHTML)}K=F;let ee=K.textContent,ie=Y?d(ee,{language:Y,ignoreIllegals:!0}):g(ee);if(F.innerHTML=ie.value,F.dataset.highlighted="yes",b(F,Y,ie.language),F.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest)F.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance};re("after:highlightElement",{el:F,result:ie,text:ee})}function k(F){o=Ld(o,F)}let A=()=>{E(),ss("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){E(),ss("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function E(){function F(){E()}if(document.readyState==="loading"){if(!S)window.addEventListener("DOMContentLoaded",F,!1);S=!0;return}document.querySelectorAll(o.cssSelector).forEach(x)}function D(F,K){let Y=null;try{Y=K(e)}catch(ee){if(Tr("Language definition for '{}' could not be registered.".replace("{}",F)),!s)throw ee;else Tr(ee);Y=a}if(!Y.name)Y.name=F;if(t[F]=Y,Y.rawDefinition=K.bind(null,e),Y.aliases)O(Y.aliases,{languageName:F})}function M(F){delete t[F];for(let K of Object.keys(n))if(n[K]===F)delete n[K]}function L(){return Object.keys(t)}function z(F){return F=(F||"").toLowerCase(),t[F]||t[n[F]]}function O(F,{languageName:K}){if(typeof F==="string")F=[F];F.forEach((Y)=>{n[Y.toLowerCase()]=K})}function P(F){let K=z(F);return K&&!K.disableAutodetect}function V(F){if(F["before:highlightBlock"]&&!F["before:highlightElement"])F["before:highlightElement"]=(K)=>{F["before:highlightBlock"](Object.assign({block:K.el},K))};if(F["after:highlightBlock"]&&!F["after:highlightElement"])F["after:highlightElement"]=(K)=>{F["after:highlightBlock"](Object.assign({block:K.el},K))}}function G(F){V(F),r.push(F)}function ce(F){let K=r.indexOf(F);if(K!==-1)r.splice(K,1)}function re(F,K){let Y=F;r.forEach(function(ee){if(ee[Y])ee[Y](K)})}function de(F){return ss("10.7.0","highlightBlock will be removed entirely in v12.0"),ss("10.7.0","Please use highlightElement now."),x(F)}Object.assign(e,{highlight:d,highlightAuto:g,highlightAll:E,highlightElement:x,highlightBlock:de,configure:k,initHighlighting:A,initHighlightingOnLoad:T,registerLanguage:D,unregisterLanguage:M,listLanguages:L,getLanguage:z,registerAliases:O,autoDetection:P,inherit:Ld,addPlugin:G,removePlugin:ce}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=L3,e.regex={concat:Sr,lookahead:Fd,either:va,optional:V2,anyNumberOfTimes:K2};for(let F in ga)if(typeof ga[F]==="object")Nd(ga[F]);return Object.assign(e,ga),e},is=Vd({});is.newInstance=()=>Vd({});Jd.exports=is;is.HighlightJS=is;is.default=is});var so={};R0(so,{decode:()=>Ms,encode:()=>Qn,format:()=>Vr,parse:()=>Ds});var co={};R0(co,{Any:()=>io,Cc:()=>ao,Cf:()=>ap,P:()=>Ls,S:()=>oo,Z:()=>lo});function Um(){if(typeof window>"u")return"zh-CN";try{return window.localStorage.getItem("omo-web-language")==="en"?"en":"zh-CN"}catch{return"zh-CN"}}var me=Um();function c(e,t){return me==="en"?t:e}function M0(e){try{return window.localStorage.setItem("omo-web-language",e),!0}catch{return!1}}function D0(e=document){if(e.documentElement.lang=me,me!=="en")return;for(let t of e.querySelectorAll("[data-en]"))t.textContent=t.getAttribute("data-en");for(let t of["title","aria-label","placeholder","alt"]){let n=`data-en-${t}`;for(let r of e.querySelectorAll(`[${n}]`)){let s=r.getAttribute(n);if(s!==null)r.setAttribute(t,s)}}}function ge(e,t){let n=document.getElementById(e);if(n instanceof t)return n;throw Error(c(`界面控件不存在:${e}`,`Missing interface control: ${e}`))}function y(e,t="",n=""){let r=document.createElement(e);if(t)r.className=t;if(n)r.textContent=n;return r}function We(e,t,n=""){let r=y("button",`button ${n}`,e);return r.type="button",r.addEventListener("click",t),r}function se(e,t=""){if(e.textContent!==t)e.textContent=t;e.hidden=!t}function Xn(e,t){let n=y("label","field");return n.append(y("span","",e),t),n}function pt(e,t){let n=y("option","",e);return n.value=t,n}function Yt(e,...t){let n=y("details"),r=y("div","fold-body stack stack--tight");return r.append(...t),n.append(y("summary","",e),r),n}function Tn(e){let t=y("pre");return t.tabIndex=0,t.append(y("code","",e)),t}var Wm=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),j=(e)=>Wm(e)?e:{},ve=(e)=>Array.isArray(e)?e:[],C=(e)=>typeof e==="string"?e:"",we=(e)=>typeof e==="number"&&Number.isFinite(e)?e:void 0,L0=(e)=>typeof e==="string"?e:JSON.stringify(e,null,2)??"",Ee=(e)=>e instanceof Error?e.message:c("发生未知错误","An unknown error occurred"),jm=["image/png","image/jpeg","image/gif","image/webp"],Li=(e)=>jm.some((t)=>t===e);function ln(e){let t=j(e),n=C(t.id);if(!n)return;return{id:n,name:C(t.name)||c("未命名会话","Untitled session"),cwd:C(t.cwd),updatedAt:we(t.updatedAt)??0,archived:t.archived===!0,settled:t.settled===!0,active:t.active===!0,running:t.running===!0}}var eo=(e)=>ve(e.sessions).flatMap((t)=>{let n=ln(t);return n?[n]:[]});class De extends Error{status;code;constructor(e,t,n){super(e);this.status=t;this.code=n}}var Xe=(e)=>`/api/sessions/${encodeURIComponent(e)}`,Ii=(e)=>`/api/cli-history/${encodeURIComponent(e)}`,Ni=(e)=>`/api/cli-live/${encodeURIComponent(e)}`,to=({kind:e,id:t})=>{switch(e){case"web":return Xe(t);case"history":return Ii(t);case"live":return Ni(t)}};class no{token="";async request(e,t,n){let r=t!==void 0,s=await fetch(e,{method:r?"POST":"GET",signal:n,cache:"no-store",...r?{headers:{"Content-Type":"application/json","X-OmO-Token":this.token},body:JSON.stringify(t)}:{}}),i;try{let a=await s.json();i=j(a)}catch(a){if(!(a instanceof SyntaxError))throw a;throw new De(c(`本机 Web 服务返回了无效响应(HTTP ${s.status})`,`The local Web server returned an invalid response (HTTP ${s.status}).`),s.status,"")}if(!s.ok)throw new De(C(i.error)||c(`请求失败(HTTP ${s.status})`,`Request failed (HTTP ${s.status}).`),s.status,C(i.code));return i}action(e,t){return this.request(`${Xe(e)}/actions`,t)}cliLiveAction(e,t){return this.request(`${Ni(e)}/actions`,t)}async resumeHistory(e){let t=await this.request(`${Ii(e)}/resume`,{}),n=ln(t.session);if(!n?.active)throw new De(c("没有收到可继续的 Web 会话。请检查会话列表。","No active Web session was returned. Check the session list."),502,"");return n}async handoff(e){let t=await this.request(`${Xe(e)}/handoff`,{}),n=ln(t.session),r=C(t.command);if(!n||n.id!==e||j(t.session).active!==!1||!r.trim())throw new De(c("无法确认会话已释放,未显示启动命令。","Could not confirm that the session was released. The launch command was not shown."),502,"");return{session:n,command:r}}}var Gm=new Set(["select","confirm","input","editor","question"]),Rs=(e)=>C(e.id)||C(e.requestId),Bi=(e)=>Boolean(Rs(e)&&Gm.has(C(e.method)));function Km(e,t){let n=[];for(let[s,i]of ve(t.questions).entries()){let a=j(i),o=C(a.id);if(!o)continue;let l=y("fieldset","stack stack--tight"),u=(s+1).toLocaleString(me);if(l.append(y("legend","",C(a.header)||c(`问题 ${u}`,`Question ${u}`))),C(a.question))l.append(y("p","plain",C(a.question)));let d=[];for(let p of ve(a.options)){let g=j(p),b=C(g.label);if(!b)continue;let x=y("input");x.name=`question-${s}`,x.type=a.multiSelect===!0?"checkbox":"radio",x.value=b;let k=y("label","interaction-option"),A=y("span","break",b);if(C(g.description))A.append(y("small","muted",` · ${C(g.description)}`));k.append(x,A),d.push(x),l.append(k)}let f=y("input");f.type="text",f.maxLength=12000,f.autocomplete="off",l.append(Xn(c("自填回答(选填)","Your own answer (optional)"),f)),e.append(l),n.push(()=>{let p=d.filter((b)=>b.checked).map((b)=>b.value),g=f.value.trim();return p.length||g?[o,{selected:p,...g?{text:g}:{}}]:void 0})}let r=y("textarea");return r.rows=2,r.maxLength=12000,e.append(Xn(c("补充说明(选填)","Comment (optional)"),r)),e.append(y("p","small muted",c("至少回答一题或填写补充说明。","Answer at least one question or leave a comment."))),()=>{let s=n.flatMap((a)=>{let o=a();return o?[o]:[]}),i=r.value.trim();return s.length||i?{answers:Object.fromEntries(s),...i?{comment:i}:{}}:void 0}}function N0(e,t){let n=e.querySelector("[data-question-metadata]");if(!n)return;let r=[];if(t.waitForAnswer===!0)r.push(c("等待回答","Waiting for your answer"));else if(t.waitForAnswer===!1)r.push(c("异步提问","Not waiting for an answer"));let s=C(t.raisedBy);if(s)r.push(c(`提问人:${s}`,`Asked by: ${s}`));let i=we(t.remainingMs);if(i!==void 0){let o=Math.ceil(Math.max(0,i)/1000),l=o.toLocaleString(me);r.push(c(`更新时剩余 ${l} 秒`,`${l} ${o===1?"second":"seconds"} left at last update`))}let a=we(t.deadlineAtMs);if(a!==void 0){let o=new Date(a);if(!Number.isNaN(o.getTime())){let l=o.toLocaleString(me);r.push(c(`截止:${l}`,`Deadline: ${l}`))}}n.textContent=r.join(" · "),n.hidden=r.length===0}var I0={Allow:c("允许","Allow"),"Allow once":c("仅允许这次","Allow once"),"Allow always":c("始终允许","Always allow"),"Allow for session":c("本会话始终允许","Allow for this session"),Deny:c("拒绝","Deny"),Block:c("阻止","Block"),"Deny with feedback":c("拒绝并说明原因","Deny with feedback")};function Vm(e,t){let n=C(e.method),r=C(e.title),s=Boolean(e.toolCallId)&&n!=="question",i=y("form","request-form"),a=n==="question"?c("待回答问题","Pending question"):s?c("工具批准","Tool approval"):c("等待你的决定","Your response is needed");i.setAttribute("aria-label",a),i.dataset.method=n;let o=y(r?"p":"h2","request-kind",n==="question"?c("Agent 提问","Agent question"):a),l=y("div","request-copy");if(r)l.append(y("h2","plain request-title",r));if(C(e.message))l.append(y("p","plain",C(e.message)));if(n==="question"){let E=y("p","small muted");E.dataset.questionMetadata="",l.append(E)}let u=j(e.remoteOrigin),d=C(u.deviceName)||C(u.deviceId);if(d)l.append(y("p","small muted break",c(`请求设备:${d}`,`Requesting device: ${d}`)));if(s){let E=C(e.toolCallId);l.append(y("p","small muted path",c(`工具调用:${E}`,`Tool call: ${E}`)))}let f=y("div","stack stack--tight request-fields"),p=y("p","notice error small");p.setAttribute("role","alert"),p.hidden=!0;let g=y("div","row request-actions"),b=!1,x=async(E)=>{if(b||i.dataset.offline==="true")return;b=!0,i.setAttribute("aria-busy","true"),se(p);for(let D of g.querySelectorAll("button"))D.disabled=!0;try{await t(Rs(e),E)}catch(D){let M=D instanceof Error?D.message:c("发生未知错误","Unknown error");se(p,c(`未能提交:${M}`,`Could not submit: ${M}`))}finally{b=!1,i.removeAttribute("aria-busy");for(let D of g.querySelectorAll("button"))D.disabled=i.dataset.offline==="true"}},k,A=e.secret===!0||Boolean(e.privateInput);switch(n){case"question":k=Km(f,e);break;case"confirm":g.append(We(c("不批准",s?"Deny":"No"),()=>void x({confirmed:!1})),We(c("确认","Confirm"),()=>void x({confirmed:!0})));break;case"select":{let E=y("select"),D=pt(c("请选择,不会自动批准","Choose an option. Nothing is approved automatically."),"");D.disabled=!0,E.append(D);for(let M of ve(e.options))if(typeof M==="string"&&M)E.append(pt(Object.hasOwn(I0,M)?I0[M]??M:M,M));E.value="",f.append(Xn(c("可选操作","Options"),E)),k=()=>E.value?{value:E.value}:void 0;break}case"input":case"editor":{if(A){f.append(y("p","muted",c("此输入需要在原生客户端中处理。","Respond in the native client.")));break}let E=n==="editor"?y("textarea"):y("input");if(E instanceof HTMLTextAreaElement)E.rows=5,E.value=C(e.prefill);else E.autocomplete="off";E.placeholder=C(e.placeholder),f.append(Xn(c("输入内容","Response"),E)),k=()=>({value:E.value});break}}if(!A)g.append(We(c("取消请求","Cancel request"),()=>void x({cancelled:!0}),"button--quiet"));if(k){let E=y("button","button",c("提交回答","Submit response"));E.type="submit",g.append(E)}i.addEventListener("submit",(E)=>{if(E.preventDefault(),!k)return;let D=k();if(D)x(D);else se(p,c("请至少填写一项回答或选择一个操作。","Enter a response or choose an option."))});let T=y("div",n==="select"?"request-controls request-controls--choice":"request-controls");T.append(f,g);let S=y("div","request-body");if(S.append(l,T,p),i.append(o,S),n==="question")N0(i,e);return i}class ro{root;nodes=new Map;constructor(e){this.root=e}get first(){return this.nodes.values().next().value}get firstQuestion(){return[...this.nodes.values()].find((e)=>e.dataset.method==="question")}render(e,t,n){for(let[r,s]of this.nodes)if(!e.has(r))s.remove(),this.nodes.delete(r);for(let[r,s]of e){let i=this.nodes.get(r);if(!i)i=Vm(s,n),this.nodes.set(r,i),this.root.append(i);if(s.method==="question")N0(i,s);if(i.dataset.offline=String(!t),i.getAttribute("aria-busy")!=="true")for(let a of i.querySelectorAll("button"))a.disabled=!t}}reset(){this.nodes.clear(),this.root.replaceChildren()}}var B0={};function Jm(e){let t=B0[e];if(t)return t;t=B0[e]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Oi(e,t){if(typeof t!=="string")t=Oi.defaultChars;let n=Jm(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let s="";for(let i=0,a=r.length;i<a;i+=3){let o=parseInt(r.slice(i+1,i+3),16);if(o<128){s+=n[o];continue}if((o&224)===192&&i+3<a){let l=parseInt(r.slice(i+4,i+6),16);if((l&192)===128){let u=o<<6&1984|l&63;if(u<128)s+="��";else s+=String.fromCharCode(u);i+=3;continue}}if((o&240)===224&&i+6<a){let l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16);if((l&192)===128&&(u&192)===128){let d=o<<12&61440|l<<6&4032|u&63;if(d<2048||d>=55296&&d<=57343)s+="���";else s+=String.fromCharCode(d);i+=6;continue}}if((o&248)===240&&i+9<a){let l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16),d=parseInt(r.slice(i+10,i+12),16);if((l&192)===128&&(u&192)===128&&(d&192)===128){let f=o<<18&1835008|l<<12&258048|u<<6&4032|d&63;if(f<65536||f>1114111)s+="����";else f-=65536,s+=String.fromCharCode(55296+(f>>10),56320+(f&1023));i+=9;continue}}s+="�"}return s})}Oi.defaultChars=";/?:@&=+$,#";Oi.componentChars="";var Ms=Oi;var O0={};function Zm(e){let t=O0[e];if(t)return t;t=O0[e]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);if(/^[0-9a-z]$/i.test(r))t.push(r);else t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function zi(e,t,n){if(typeof t!=="string")n=t,t=zi.defaultChars;if(typeof n>"u")n=!0;let r=Zm(t),s="";for(let i=0,a=e.length;i<a;i++){let o=e.charCodeAt(i);if(n&&o===37&&i+2<a){if(/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}}if(o<128){s+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&i+1<a){let l=e.charCodeAt(i+1);if(l>=56320&&l<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}zi.defaultChars=";/?:@&=+$,-_.!~*'()#";zi.componentChars="-_.!~*'()";var Qn=zi;function Vr(e){let t="";if(t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1)t+="["+e.hostname+"]";else t+=e.hostname||"";return t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Fi(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Ym=/^([a-z0-9.+-]+:)/i,Xm=/:[0-9]*$/,Qm=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ep=["<",">",'"',"`"," ","\r",`
|
|
4
|
+
`,"\t"],tp=["{","}","|","\\","^","`"].concat(ep),np=["'"].concat(tp),z0=["%","/","?",";","#"].concat(np),F0=["/","?","#"],rp=255,$0=/^[+a-z0-9A-Z_-]{0,63}$/,sp=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,q0={javascript:!0,"javascript:":!0},H0={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ip(e,t){if(e&&e instanceof Fi)return e;let n=new Fi;return n.parse(e,t),n}Fi.prototype.parse=function(e,t){let n,r,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){let u=Qm.exec(i);if(u){if(this.pathname=u[1],u[2])this.search=u[2];return this}}let a=Ym.exec(i);if(a)a=a[0],n=a.toLowerCase(),this.protocol=a,i=i.substr(a.length);if(t||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){if(s=i.substr(0,2)==="//",s&&!(a&&q0[a]))i=i.substr(2),this.slashes=!0}if(!q0[a]&&(s||a&&!H0[a])){let u=-1;for(let b=0;b<F0.length;b++)if(r=i.indexOf(F0[b]),r!==-1&&(u===-1||r<u))u=r;let d,f;if(u===-1)f=i.lastIndexOf("@");else f=i.lastIndexOf("@",u);if(f!==-1)d=i.slice(0,f),i=i.slice(f+1),this.auth=d;u=-1;for(let b=0;b<z0.length;b++)if(r=i.indexOf(z0[b]),r!==-1&&(u===-1||r<u))u=r;if(u===-1)u=i.length;if(i[u-1]===":")u--;let p=i.slice(0,u);i=i.slice(u),this.parseHost(p),this.hostname=this.hostname||"";let g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){let b=this.hostname.split(/\./);for(let x=0,k=b.length;x<k;x++){let A=b[x];if(!A)continue;if(!A.match($0)){let T="";for(let S=0,E=A.length;S<E;S++)if(A.charCodeAt(S)>127)T+="x";else T+=A[S];if(!T.match($0)){let S=b.slice(0,x),E=b.slice(x+1),D=A.match(sp);if(D)S.push(D[1]),E.unshift(D[2]);if(E.length)i=E.join(".")+i;this.hostname=S.join(".");break}}}}if(this.hostname.length>rp)this.hostname="";if(g)this.hostname=this.hostname.substr(1,this.hostname.length-2)}let o=i.indexOf("#");if(o!==-1)this.hash=i.substr(o),i=i.slice(0,o);let l=i.indexOf("?");if(l!==-1)this.search=i.substr(l),i=i.slice(0,l);if(i)this.pathname=i;if(H0[n]&&this.hostname&&!this.pathname)this.pathname="";return this};Fi.prototype.parseHost=function(e){let t=Xm.exec(e);if(t){if(t=t[0],t!==":")this.port=t.substr(1);e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};var Ds=ip;var io=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ao=/[\0-\x1F\x7F-\x9F]/,ap=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ls=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,oo=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,lo=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var op=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function lp(e){return e===0||e>=55296&&e<=57343||e>1114111}function P0(e){if(lp(e))return 65533;if(e>=128&&e<=159)return op[e-128]||e;return e}function U0(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(P0(e))}var Xt=(()=>{let e=new Uint8Array(127),t=0;for(let n=33;n<=126;n++)if(n!==34&&n!==36&&n!==92)e[n]=t++;return e})();function W0(e,t,n,r,s,i){let o=e.length,l=i*90,u=0,d=()=>{let O=Xt[e.charCodeAt(u++)];return O<i?O:O*91-l+Xt[e.charCodeAt(u++)]},f=n-r,p=n+s,g=new Int32Array(p);g.fill(-1,r,i),g.fill(-1,i+f,p);let b=new Int32Array(p),x=new Int32Array(p);function k(O,P){let V=0,G=P,ce=P+O;while(G<ce){let re=Xt[e.charCodeAt(u++)];if(re<89)V+=re,g[G++]=V;else if(re===89){let de=Xt[e.charCodeAt(u++)]+2;while(de--)g[G++]=++V}else{let de=Xt[e.charCodeAt(u++)];V+=89+(de<90?de*91+Xt[e.charCodeAt(u++)]:Xt[e.charCodeAt(u++)]*8281+Xt[e.charCodeAt(u++)]*91+Xt[e.charCodeAt(u++)]),g[G++]=V}}}k(r,0),k(f,i);let A=new Int32Array(s*2),T=0,S=0;function E(O,P){for(let V=0;V<O;V++){let G=P+V,ce=d(),re=d();A[S*2]=ce,A[S*2+1]=re,S+=1,b[G]=T;let de=(g[ce]<0?x[ce]:1)+(g[re]<0?x[re]:1);x[G]=de,T+=de}}E(s-i+r,i+f),E(i-r,r);let D=new Uint16Array(T),M=0;for(let O=0;O<S;O++)for(let P=0;P<2;P++){let V=A[O*2+P],G=g[V];if(G<0){let ce=b[V],re=ce+x[V];while(ce<re)D[M++]=D[ce++]}else D[M++]=G}let L=new Uint16Array(t),z=0;while(u<o){let O=Xt[e.charCodeAt(u++)];if(O>=i)O=O*91-l+Xt[e.charCodeAt(u++)];let P=g[O];if(P<0){let V=b[O],G=V+x[O];while(V<G)L[z++]=D[V++]}else L[z++]=P}return L}var j0=W0("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var rt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(rt||(rt={}));var wt;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(wt||(wt={}));var $i=32,V0=21,cp=2097151,uo=2047,J0=0;function up(e){let t=e>>>V0;return t===uo?J0:t}function Z0(e){return e-wt.ZERO>>>0<=9}function dp(e){return(e|$i)-wt.LOWER_A>>>0<=5}function Y0(e){return(e|$i)-wt.LOWER_A>>>0<=25}function hp(e){return e===wt.EQUALS||Y0(e)||Z0(e)}var G0;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(G0||(G0={}));var ho;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ho||(ho={}));function fp(e,t,n,r){let s=(t&rt.BRANCH_LENGTH)>>7,i=t&rt.JUMP_TABLE;if(i){if(s===0)return r===i?n:-1;let l=r-i;if(l>>>0>=s)return-1;let u=e[n+l];return u===0?-1:n+s+u-1&65535}if(s===0)return-1;let a=s+1>>1,o=n+a+s;for(let l=0;l<s;l++){let d=e[n+(l>>1)]>>((l&1)<<3)&255;if(d===r){let f=n+a+l;return o+e[f]&65535}if(d>r)return-1}return-1}function K0(e,t,n){if(n===1)return String.fromCharCode(e[t]&rt.VALUE_MASK);if(n===2)return String.fromCharCode(e[t+1]);return String.fromCharCode(e[t+1],e[t+2])}function mp(e,t,n){let r=t+1,s=0,i=r;if(r<n&&(e.charCodeAt(r)|$i)===wt.LOWER_X){r+=1,i=r;while(r<n){let o=e.charCodeAt(r);if(Z0(o))s=s*16+(o-wt.ZERO);else if(dp(o))s=s*16+((o|$i)-wt.LOWER_A+10);else break;r+=1}}else while(r<n){let o=e.charCodeAt(r)-wt.ZERO;if(o>>>0>9)break;s=s*10+o,r+=1}if(r===i)return 0;if(r<n&&e.charCodeAt(r)===wt.SEMI)r+=1;if(s>1114111)s=1114112;let a=r-t;if(a>=uo)J0=a,a=uo;return a<<V0|s}function pp(e,t,n){let r=j0,s=e.indexOf("&");if(s<0)return e;let i=e.length,a=0,o="",l=r[0],u=l&rt.JUMP_TABLE,d=(l&rt.BRANCH_LENGTH)>>7;do{let f=s+1,p=e.charCodeAt(f),g,b;if(p===wt.NUM){let x=mp(e,f,i);if(g=up(x),t&&g>0&&e.charCodeAt(f+g-1)!==wt.SEMI)g=0;b=g===0?"":U0(x&cp)}else if(Y0(p)){g=0,b="";let x=p-u,k;if(x>>>0<d){let D=r[1+x];k=D===0?-1:d+D&65535}else k=-1;let A=0,T=0,S=k<0?0:r[k],E=f+1;e:while(E<i){while((S&(rt.VALUE_LENGTH|rt.FLAG13))===0&&(S&rt.JUMP_TABLE)!==0){let z=S&rt.JUMP_TABLE,O=(S&rt.BRANCH_LENGTH)>>7;if(O===0){if(e.charCodeAt(E)!==z)break e;k+=1}else{let P=e.charCodeAt(E)-z;if(P>>>0>=O)break e;let V=r[k+1+P];if(V===0)break e;k=k+O+V&65535}if(S=r[k],E+=1,E>=i)break e}if((S&(rt.VALUE_LENGTH|rt.FLAG13))===rt.FLAG13){let z=(S&rt.BRANCH_LENGTH)>>7;if(e.charCodeAt(E)!==(S&rt.JUMP_TABLE))break;E+=1;let O=z-1,P=k+1,V=0;for(;V+1<O;V+=2){let G=r[P];if(e.charCodeAt(E)!==(G&255))break e;if(E+=1,e.charCodeAt(E)!==(G>>8&255))break e;E+=1,P+=1}if(V<O){if(e.charCodeAt(E)!==(r[P]&255))break;E+=1}k+=1+(z>>1),S=r[k];continue}let D=S>>>14,M=e.charCodeAt(E);if(D!==0){if(M===wt.SEMI){g=E-f+1,b=D===1?String.fromCharCode(S&rt.VALUE_MASK):K0(r,k,D);break}if(!t&&(S&rt.FLAG13)===0)g=E-f,A=k,T=D;if(D===1)break}let L=fp(r,S,k+(D||1),M);if(L<0)break;k=L,S=r[k],E+=1}if(b===""){let D=S>>>14;if(D!==0&&!t&&(S&rt.FLAG13)===0)g=E-f,A=k,T=D;if(g>0)b=K0(r,A,T)}}else g=0,b="";if(g===0||n&&p!==wt.NUM&&e.charCodeAt(f+g-1)!==wt.SEMI&&f+g<i&&hp(e.charCodeAt(f+g)))s=f;else{if(a<s)o+=e.slice(a,s);o+=b,s=a=f+g}if(e.charCodeAt(s)!==wt.AMP)s=e.indexOf("&",s)}while(s>=0);return o+e.slice(a)}function qi(e){return pp(e,!0,!1)}var X0;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(X0||(X0={}));var Q0;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(Q0||(Q0={}));var bp=class{src_Any=io.source;src_Cc=ao.source;src_Z=lo.source;src_P=Ls.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){let r=this.escapeRE(e),s=this.escapeRE(t),i=`(?:(?!${this.src_ZCc}|${r}|${s}).)`,a=`${r}${i}{0,1000}${s}`;for(let o=2;o<=n;o++)a=`${r}(?:${i}|${a}){0,1000}${s}`;return a}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){let t=`(?:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:[0-9A-Fa-f]{1,4}:){6}${t}|::(?:[0-9A-Fa-f]{1,4}:){5}${t}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}${t}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}${t}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}${t}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:${t}|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::${t}|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map((e)=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},fo={validate:(e,t,n)=>{let r=n.re.get_http_validator();r.lastIndex=t;let s=r.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)},vp={"http:":fo,"https:":fo,"ftp:":fo,"//":{validate:function(e,t,n){let r=n.re.get_relative_proto_validator();r.lastIndex=t;let s=r.exec(e);if(s){if(t>=3&&e[t-3]===":")return 0;if(t>=3&&e[t-3]==="/")return 0;return s[0].length}return 0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){let r=n.re.get_mailto_validator();r.lastIndex=t;let s=r.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)}},yp="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",wp="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function kp(){let e=wp.split("|");return yp.split("|").forEach((t)=>{let n=t.indexOf(":"),r=t.slice(0,n);for(let s of t.slice(n+1))e.push(r+s)}),e}var xp={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:kp(),urlAuth:!1,maxLength:1e4},ec=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){let s=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=s,this.text=s,this.url=s}},tc=class{__opts__;__schemas__;re;constructor(e={}){let{rebuilder:t,...n}=e;this.__opts__={...xp,...n},this.__schemas__={...vp},this.re=t||new bp,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{let n={normalize:(r,s)=>s.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;n=this.re.get_schema_search(),n.lastIndex=0;while((t=n.exec(e))!==null)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]){if(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null)return!0}if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]){if(e.indexOf("@")>=0){let r=this.re.get_fuzzy_mail_host_search(),s=this.re.get_mail_name_validator();r.lastIndex=0;while((t=r.exec(e))!==null){let i=e.slice(Math.max(0,t.index-65),t.index);if(s.test(i))return!0}}}return!1}testSchemaAt(e,t,n){if(!this.__schemas__[t.toLowerCase()])return 0;return this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this)}match(e){let t=[],n=this.re.get_schema_search(),r,s,i,a,o,l,u=!1,d=!1,f=!1,p=0;if(!e.length)return null;if(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"])r=this.re.get_fuzzy_link_search(),r.lastIndex=0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"])s=this.re.get_fuzzy_mail_host_search(),s.lastIndex=0,i=this.re.get_mail_name_validator();for(;;){let g=Math.max(p-1,0);if(s&&i&&!f&&(!o||o.index<p)){if(s.lastIndex<g)s.lastIndex=g;for(;;){let T=s.exec(e);if(!T){f=!0,o=void 0;break}let S=i.exec(e.slice(Math.max(0,T.index-65),T.index));if(!S)continue;if(o={schema:"mailto:",index:T.index-S[1].length,lastIndex:T.index+T[0].length},o.index>=p)break;if(s.lastIndex<g)s.lastIndex=g}}if(r&&!d&&(!a||a.index<p)){if(r.lastIndex<g)r.lastIndex=g;for(;;){let T=r.exec(e);if(!T){d=!0,a=void 0;break}if(a={schema:"",index:T.index+T[1].length,lastIndex:T.index+T[0].length},a.index>=p)break;if(r.lastIndex<g)r.lastIndex=g}}let b=o;if(!b||a&&(a.index<b.index||a.index===b.index&&a.lastIndex>b.lastIndex))b=a;let x;if(!u)for(;;){if(!l){if(n.lastIndex<g)n.lastIndex=g;let E=n.exec(e);if(!E){u=!0;break}l={schema:E[2],index:E.index+E[1].length,lastIndex:E.index+E[0].length}}if(l.index<p){l=void 0;continue}if(b&&l.index>b.index)break;let T=l;l=void 0;let S=this.testSchemaAt(e,T.schema,T.lastIndex);if(S){x={schema:T.schema,index:T.index,lastIndex:T.lastIndex+S};break}}let k=x;if(!k||o&&(o.index<k.index||o.index===k.index&&o.lastIndex>k.lastIndex))k=o;if(!k||a&&(a.index<k.index||a.index===k.index&&a.lastIndex>k.lastIndex))k=a;if(!k)break;if(k===o)o=void 0;else if(k===a)a=void 0;let A=new ec(e,k.schema,k.index,k.lastIndex);if(A.schema)this.__schemas__[A.schema].normalize(A,this);else this.normalize(A);t.push(A),p=k.lastIndex}if(t.length)return t;return null}matchAtStart(e){if(!e.length)return null;let t=this.re.get_schema_at_start().exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new ec(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){if(e=Array.isArray(e)?e:[e],!t)this.__opts__.tlds=e;else this.__opts__.tlds=this.__opts__.tlds.concat(e);return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){if(!e.schema)e.url=`http://${e.url}`;if(e.schema==="mailto:"&&!/^mailto:/i.test(e.url))e.url=`mailto:${e.url}`}};var Ep=/^xn--/,Ap=/[^\0-\x7F]/,Cp=/[\x2E\u3002\uFF0E\uFF61]/g,_p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var cn=Math.floor,mo=String.fromCharCode;function er(e){throw RangeError(_p[e])}function Tp(e,t){let n=[],r=e.length;while(r--)n[r]=t(e[r]);return n}function rc(e,t){let n=e.split("@"),r="";if(n.length>1)r=n[0]+"@",e=n[1];e=e.replace(Cp,".");let s=e.split("."),i=Tp(s,t).join(".");return r+i}function sc(e){let t=[],n=0,r=e.length;while(n<r){let s=e.charCodeAt(n++);if(s>=55296&&s<=56319&&n<r){let i=e.charCodeAt(n++);if((i&64512)==56320)t.push(((s&1023)<<10)+(i&1023)+65536);else t.push(s),n--}else t.push(s)}return t}var Sp=(e)=>String.fromCodePoint(...e),Rp=function(e){if(e>=48&&e<58)return 26+(e-48);if(e>=65&&e<91)return e-65;if(e>=97&&e<123)return e-97;return 36},nc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},ic=function(e,t,n){let r=0;e=n?cn(e/700):e>>1,e+=cn(e/t);for(;e>455;r+=36)e=cn(e/35);return cn(r+36*e/(e+38))},ac=function(e){let t=[],n=e.length,r=0,s=128,i=72,a=e.lastIndexOf("-");if(a<0)a=0;for(let o=0;o<a;++o){if(e.charCodeAt(o)>=128)er("not-basic");t.push(e.charCodeAt(o))}for(let o=a>0?a+1:0;o<n;){let l=r;for(let d=1,f=36;;f+=36){if(o>=n)er("invalid-input");let p=Rp(e.charCodeAt(o++));if(p>=36)er("invalid-input");if(p>cn((2147483647-r)/d))er("overflow");r+=p*d;let g=f<=i?1:f>=i+26?26:f-i;if(p<g)break;let b=36-g;if(d>cn(2147483647/b))er("overflow");d*=b}let u=t.length+1;if(i=ic(r-l,u,l==0),cn(r/u)>2147483647-s)er("overflow");s+=cn(r/u),r%=u,t.splice(r++,0,s)}return String.fromCodePoint(...t)},oc=function(e){let t=[];e=sc(e);let n=e.length,r=128,s=0,i=72;for(let l of e)if(l<128)t.push(mo(l));let a=t.length,o=a;if(a)t.push("-");while(o<n){let l=2147483647;for(let d of e)if(d>=r&&d<l)l=d;let u=o+1;if(l-r>cn((2147483647-s)/u))er("overflow");s+=(l-r)*u,r=l;for(let d of e){if(d<r&&++s>2147483647)er("overflow");if(d===r){let f=s;for(let p=36;;p+=36){let g=p<=i?1:p>=i+26?26:p-i;if(f<g)break;let b=f-g,x=36-g;t.push(mo(nc(g+b%x,0))),f=cn(b/x)}t.push(mo(nc(f,0))),i=ic(s,u,o===a),s=0,++o}}++s,++r}return t.join("")},Mp=function(e){return rc(e,function(t){return Ep.test(t)?ac(t.slice(4).toLowerCase()):t})},Dp=function(e){return rc(e,function(t){return Ap.test(t)?"xn--"+oc(t):t})},Lp={version:"2.3.1",ucs2:{decode:sc,encode:Sp},decode:ac,encode:oc,toASCII:Dp,toUnicode:Mp};var po=Lp;/*! markdown-it 15.0.3 https://github.com/markdown-it/markdown-it @license MIT */var lc=Object.defineProperty,wc=(e,t)=>{let n={};for(var r in e)lc(n,r,{get:e[r],enumerable:!0});if(!t)lc(n,Symbol.toStringTag,{value:"Module"});return n},Ip=wc({arrayReplaceAt:()=>Np,asciiTrim:()=>ji,callable:()=>kc,escapeHtml:()=>tr,escapeRE:()=>Wp,fromCodePoint:()=>Ns,isMdAsciiPunct:()=>zs,isPunctChar:()=>Ec,isPunctCharCode:()=>Os,isSpace:()=>je,isValidEntityCode:()=>ko,isWhiteSpace:()=>Bs,lib:()=>jp,normalizeReference:()=>Wi,unescapeAll:()=>Jr,unescapeMd:()=>Fp});function kc(e){let t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Np(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function ko(e){if(e>=55296&&e<=57343)return!1;if(e>=64976&&e<=65007)return!1;if((e&65535)===65535||(e&65535)===65534)return!1;if(e>=0&&e<=8)return!1;if(e===11)return!1;if(e>=14&&e<=31)return!1;if(e>=127&&e<=159)return!1;if(e>1114111)return!1;return!0}function Ns(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var xc=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Bp=new RegExp(`${xc.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Op=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zp(e,t){if(t.charCodeAt(0)===35&&Op.test(t)){let r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);if(ko(r))return Ns(r);return e}let n=qi(e);if(n!==e)return n;return e}function Fp(e){if(e.indexOf("\\")<0)return e;return e.replace(xc,"$1")}function Jr(e){if(e.indexOf("\\")<0&&e.indexOf("&")<0)return e;return e.replace(Bp,function(t,n,r){if(n)return n;return zp(t,r)})}var $p=/[&<>"]/,qp=/[&<>"]/g,Hp={"&":"&","<":"<",">":">",'"':"""};function Pp(e){return Hp[e]}function tr(e){if($p.test(e))return e.replace(qp,Pp);return e}var Up=/[.?*+^$[\]\\(){}|-]/g;function Wp(e){return e.replace(Up,"\\$&")}function je(e){switch(e){case 9:case 32:return!0}return!1}function Bs(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ec(e){return Ls.test(e)||oo.test(e)}function Os(e){return Ec(Ns(e))}function zs(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Wi(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function cc(e){return e===32||e===9||e===10||e===13}function ji(e){let t=0;for(;t<e.length;t++)if(!cc(e.charCodeAt(t)))break;let n=e.length-1;for(;n>=t;n--)if(!cc(e.charCodeAt(n)))break;return e.slice(t,n+1)}var jp={mdurl:so,ucmicro:co};function Gp(e,t,n){let r,s,i,a,{posMax:o,pos:l}=e;e.pos=t+1,r=1;while(e.pos<o){if(i=e.src.charCodeAt(e.pos),i===93){if(r--,r===0){s=!0;break}}if(a=e.pos,e.md.inline.skipToken(e),i===91){if(a===e.pos-1)r++;else if(n)return e.pos=l,-1}}let u=-1;if(s)u=e.pos;return e.pos=l,u}function Kp(e,t,n){let r,s=t,i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){s++;while(s<n){if(r=e.charCodeAt(s),r===10)return i;if(r===60)return i;if(r===62)return i.pos=s+1,i.str=Jr(e.slice(t+1,s)),i.ok=!0,i;if(r===92&&s+1<n){s+=2;continue}s++}return i}let a=0;while(s<n){if(r=e.charCodeAt(s),r===32)break;if(r<32||r===127)break;if(r===92&&s+1<n){if(e.charCodeAt(s+1)===32){s++;continue}s+=2;continue}if(r===40){if(a++,a>32)return i}if(r===41){if(a===0)break;a--}s++}if(t===s)return i;if(a!==0)return i;return i.str=Jr(e.slice(t,s)),i.pos=s,i.ok=!0,i}function Vp(e,t,n,r){let s,i=t,a={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)a.str=r.str,a.marker=r.marker;else{if(i>=n)return a;let o=e.charCodeAt(i);if(o!==34&&o!==39&&o!==40)return a;if(t++,i++,o===40)o=41;a.marker=o}while(i<n){if(s=e.charCodeAt(i),s===a.marker)return a.pos=i+1,a.str+=Jr(e.slice(t,i)),a.ok=!0,a;else if(s===40&&a.marker===41)return a;else if(s===92&&i+1<n)i++;i++}return a.can_continue=!0,a.str+=Jr(e.slice(t,i)),a}var Jp=wc({parseLinkDestination:()=>Kp,parseLinkLabel:()=>Gp,parseLinkTitle:()=>Vp});function Fs(e){return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(e)}function Zp(e,t){if(Fs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fs(r)!="object")return r;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yp(e){var t=Zp(e,"string");return Fs(t)=="symbol"?t:t+""}function pe(e,t,n){return(t=Yp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kr=class{constructor(e,t,n){pe(this,"map",null),pe(this,"level",0),pe(this,"children",null),pe(this,"content",""),pe(this,"markup",""),pe(this,"info",""),pe(this,"block",!1),pe(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){if(this.attrs)this.attrs.push(e);else this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];if(n<0)this.attrPush(r);else this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;if(t>=0)n=this.attrs[t][1];return n}attrJoin(e,t){let n=this.attrIndex(e);if(n<0)this.attrPush([e,t]);else this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},$s=class{constructor(){pe(this,"__rules__",[]),pe(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){let e=new Set;this.__rules__.forEach((t)=>{if(!t.enabled)return;t.alt.forEach((n)=>{if(n)e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach((t)=>{if(t.enabled)this.__cache__[""].push(t.fn)}),e.forEach((t)=>{this.__cache__[t]=[],this.__rules__.forEach((n)=>{if(n.enabled&&n.alt.indexOf(t)>=0)this.__cache__[t].push(n.fn)})})}at(e,t,n={}){let r=this.__find__(e);if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){let s=this.__find__(e);if(s===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(s,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){let s=this.__find__(e);if(s===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){if(!Array.isArray(e))e=[e];let n=[];return e.forEach((r)=>{let s=this.__find__(r);if(s<0){if(t)return;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[s].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){if(!Array.isArray(e))e=[e];this.__rules__.forEach((n)=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){if(!Array.isArray(e))e=[e];let n=[];return e.forEach((r)=>{let s=this.__find__(r);if(s<0){if(t)return;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[s].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){if(!this.__cache__)this.__compile__();return this.__cache__[e]||[]}},un={};un.code_inline=function(e,t,n,r,s){let i=e[t];return`<code${s.renderAttrs(i)}>${tr(i.content)}</code>`};un.code_block=function(e,t,n,r,s){let i=e[t];return`<pre${s.renderAttrs(i)}><code>${tr(e[t].content)}</code></pre>
|
|
5
|
+
`};un.fence=function(e,t,n,r,s){let i=e[t],a=i.info?Jr(i.info).trim():"",o="",l="";if(a){let d=a.split(/(\s+)/g);o=d[0],l=d.slice(2).join("")}let u;if(n.highlight)u=n.highlight(i.content,o,l)||tr(i.content);else u=tr(i.content);if(u.indexOf("<pre")===0)return u+`
|
|
6
|
+
`;if(a){let d=i.attrIndex("class"),f=i.attrs?i.attrs.slice():[];if(d<0)f.push(["class",`${n.langPrefix}${o}`]);else f[d]=[f[d][0],f[d][1]],f[d][1]+=` ${n.langPrefix}${o}`;let p={attrs:f};return`<pre><code${s.renderAttrs(p)}>${u}</code></pre>
|
|
7
|
+
`}return`<pre><code${s.renderAttrs(i)}>${u}</code></pre>
|
|
8
|
+
`};un.image=function(e,t,n,r,s){let i=e[t];return i.attrs[i.attrIndex("alt")][1]=s.renderInlineAsText(i.children,n,r),s.renderToken(e,t,n)};un.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
9
|
+
`:`<br>
|
|
10
|
+
`};un.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
11
|
+
`:`<br>
|
|
12
|
+
`:`
|
|
13
|
+
`};un.text=function(e,t){return tr(e[t].content)};un.html_block=function(e,t){return e[t].content};un.html_inline=function(e,t){return e[t].content};var Ac=class{constructor(){pe(this,"rules",Object.assign({},un))}renderAttrs(e){let t,n,r;if(!e.attrs)return"";r="";for(t=0,n=e.attrs.length;t<n;t++)r+=` ${tr(e.attrs[t][0])}="${tr(String(e.attrs[t][1]))}"`;return r}renderToken(e,t,n){let r=e[t],s="";if(r.hidden)return"";let i=t-1;while(i>=0&&e[i].hidden&&e[i].nesting===0)i--;if(r.block&&r.nesting!==-1&&i>=0&&e[i].hidden&&e[i].nesting===-1)s+=`
|
|
14
|
+
`;if(s+=(r.nesting===-1?"</":"<")+r.tag,s+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut)s+=" /";let a=!1;if(r.block){if(a=!0,r.nesting===1){let o=t+1;while(o<e.length&&e[o].hidden&&e[o].nesting===0)o++;if(o<e.length){let l=e[o];if(l.type==="inline"||l.hidden)a=!1;else if(l.nesting===-1&&l.tag===r.tag)a=!1}}}return s+=a?`>
|
|
15
|
+
`:">",s}renderInline(e,t,n){let r="",s=this.rules;for(let i=0,a=e.length;i<a;i++){let o=e[i].type;if(typeof s[o]<"u")r+=s[o](e,i,t,n,this);else r+=this.renderToken(e,i,t)}return r}renderInlineAsText(e,t,n){let r="";for(let s=0,i=e.length;s<i;s++)switch(e[s].type){case"text":case"code_inline":r+=e[s].content;break;case"image":r+=this.renderInlineAsText(e[s].children,t,n);break;case"html_inline":case"html_block":r+=e[s].content;break;case"softbreak":case"hardbreak":r+=`
|
|
16
|
+
`}return r}render(e,t,n){let r="",s=this.rules;for(let i=0,a=e.length;i<a;i++){let o=e[i].type;if(o==="inline")r+=this.renderInline(e[i].children,t,n);else if(typeof s[o]<"u")r+=s[o](e,i,t,n,this);else r+=this.renderToken(e,i,t)}return r}},Cc=class{constructor(e,t,n){pe(this,"tokens",[]),pe(this,"inlineMode",!1),pe(this,"Token",kr),this.src=e,this.env=n,this.md=t}},Xp=/\r\n?/g,Qp=/\0/g;function e1(e){let t;t=e.src.replace(Xp,`
|
|
17
|
+
`),t=t.replace(Qp,"�"),e.src=t}function t1(e){let t;if(e.inlineMode)t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t);else e.md.block.parse(e.src,e.md,e.env,e.tokens)}function n1(e){let t=e.tokens,n=0;for(let r=0;r<t.length;r++){if(t[r].type==="reference_definition")continue;if(r!==n)t[n]=t[r];n++}if(t.length!==n)t.length=n}function r1(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let s=t[n];if(s.type==="inline")e.md.inline.parse(s.content,e.md,e.env,s.children)}}function s1(e){return/^<a[>\s]/i.test(e)}function i1(e){return/^<\/a\s*>/i.test(e)}function a1(e){let t=e.tokens;if(!e.md.options.linkify)return;for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let s=t[n].children,i=[],a=0;for(let o=s.length-1;o>=0;o--){let l=s[o];if(l.type==="link_close"){o--;while(s[o].level!==l.level&&s[o].type!=="link_open")o--;continue}if(l.type==="html_inline"){if(s1(l.content)&&a>0)a--;if(i1(l.content))a++}if(a>0)continue;if(l.type==="text"&&e.md.linkify.test(l.content)){let u=l.content,d=e.md.linkify.match(u),f=[],p=l.level,g=0;if(d.length>0&&d[0].index===0&&o>0&&s[o-1].type==="text_special")d=d.slice(1);for(let b=0;b<d.length;b++){let x=d[b].url,k=e.md.normalizeLink(x);if(!e.md.validateLink(k))continue;let A=d[b].text;if(!d[b].schema)A=e.md.normalizeLinkText(`http://${A}`).replace(/^http:\/\//,"");else if(d[b].schema==="mailto:"&&!/^mailto:/i.test(A))A=e.md.normalizeLinkText(`mailto:${A}`).replace(/^mailto:/,"");else A=e.md.normalizeLinkText(A);let T=d[b].index;if(T>g){let M=new e.Token("text","",0);M.content=u.slice(g,T),M.level=p,f.push(M)}let S=new e.Token("link_open","a",1);S.attrs=[["href",k]],S.level=p++,S.markup="linkify",S.info="auto",f.push(S);let E=new e.Token("text","",0);E.content=A,E.level=p,f.push(E);let D=new e.Token("link_close","a",-1);D.level=--p,D.markup="linkify",D.info="auto",f.push(D),g=d[b].lastIndex}if(g<u.length){let b=new e.Token("text","",0);b.content=u.slice(g),b.level=p,f.push(b)}i.push({index:o,nodes:f})}}if(i.length>0){let o=s.length;for(let f of i)o+=f.nodes.length-1;let l=Array(o),u=0,d=0;i.reverse();for(let f=0;f<s.length;f++){let p=i[u];if((p===null||p===void 0?void 0:p.index)===f){for(let g of p.nodes)l[d++]=g;u++}else l[d++]=s[f]}t[n].children=l}}}var _c=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o1=/\((c|tm|r)\)/i,l1=/\((c|tm|r)\)/gi,c1={c:"©",r:"®",tm:"™"};function u1(e,t){return c1[t.toLowerCase()]}function d1(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type==="text"&&!t)r.content=r.content.replace(l1,u1);if(r.type==="link_open"&&r.info==="auto")t--;if(r.type==="link_close"&&r.info==="auto")t++}}function h1(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type==="text"&&!t){if(_c.test(r.content))r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")}if(r.type==="link_open"&&r.info==="auto")t--;if(r.type==="link_close"&&r.info==="auto")t++}}function f1(e){let t;if(!e.md.options.typographer)return;for(t=e.tokens.length-1;t>=0;t--){if(e.tokens[t].type!=="inline")continue;if(o1.test(e.tokens[t].content))d1(e.tokens[t].children);if(_c.test(e.tokens[t].content))h1(e.tokens[t].children)}}var m1=/['"]/,uc=/['"]/g,dc="’",p1=1000;function hc(e,t,n){while(e.length>n){let r=e.pop();if(r.isSingleQuote)t.single=r.prevSameQuoteIdx;else t.double=r.prevSameQuoteIdx}}function Hi(e,t,n,r){if(!e[t])e[t]=[];e[t].push({pos:n,ch:r})}function g1(e,t){let n="",r=0;t.sort((s,i)=>s.pos-i.pos);for(let s=0;s<t.length;s++){let i=t[s];n+=e.slice(r,i.pos)+i.ch,r=i.pos+1}return n+e.slice(r)}function b1(e,t){let n,r=[],s={single:-1,double:-1},i={};for(let a=0;a<e.length;a++){let o=e[a],l=e[a].level;for(n=r.length-1;n>=0;n--)if(r[n].level<=l)break;if(hc(r,s,n+1),o.type!=="text")continue;let u=o.content,d=0,f=u.length;e:while(d<f){uc.lastIndex=d;let p=uc.exec(u);if(!p)break;let g=!0,b=!0;d=p.index+1;let x=p[0]==="'",k=32;if(p.index-1>=0)k=u.charCodeAt(p.index-1);else for(n=a-1;n>=0;n--){if(e[n].type==="softbreak"||e[n].type==="hardbreak")break;if(!e[n].content)continue;k=e[n].content.charCodeAt(e[n].content.length-1);break}let A=32;if(d<f)A=u.charCodeAt(d);else for(n=a+1;n<e.length;n++){if(e[n].type==="softbreak"||e[n].type==="hardbreak")break;if(!e[n].content)continue;A=e[n].content.charCodeAt(0);break}let T=zs(k)||Os(k),S=zs(A)||Os(A),E=Bs(k),D=Bs(A);if(D)g=!1;else if(S){if(!(E||T))g=!1}if(E)b=!1;else if(T){if(!(D||S))b=!1}if(A===34&&p[0]==='"'){if(k>=48&&k<=57)b=g=!1}if(g&&b)g=T,b=S;if(!g&&!b){if(x)Hi(i,a,p.index,dc);continue}if(b){if(n=x?s.single:s.double,n>=0&&r[n].level===l){let M=r[n],L,z;if(x)L=t.md.options.quotes[2],z=t.md.options.quotes[3];else L=t.md.options.quotes[0],z=t.md.options.quotes[1];Hi(i,a,p.index,z),Hi(i,M.tokenIdx,M.contentPos,L),hc(r,s,n);continue e}}if(g){if(r.length>=p1)return;if(r.push({tokenIdx:a,contentPos:p.index,isSingleQuote:x,level:l,prevSameQuoteIdx:x?s.single:s.double}),x)s.single=r.length-1;else s.double=r.length-1}else if(b&&x)Hi(i,a,p.index,dc)}}Object.keys(i).forEach(function(a){let o=Number(a);e[o].content=g1(e[o].content,i[a])})}function v1(e){if(!e.md.options.typographer)return;for(let t=e.tokens.length-1;t>=0;t--){if(e.tokens[t].type!=="inline"||!m1.test(e.tokens[t].content))continue;b1(e.tokens[t].children,e)}}function y1(e){let t,n,r=e.length;for(t=0;t<r;t++)if(e[t].type==="text_special")e[t].type="text";for(t=n=0;t<r;t++)if(e[t].type==="text"&&t+1<r&&e[t+1].type==="text")e[t+1].content=e[t].content+e[t+1].content;else{if(t!==n)e[n]=e[t];n++}if(t!==n)e.length=n}function w1(e){let t,n,r=e.tokens,s=r.length;for(let i=0;i<s;i++){if(r[i].type!=="inline")continue;let a=r[i].children,o=a.length;for(t=0;t<o;t++){if(a[t].type==="text_special")a[t].type="text";if(a[t].children)y1(a[t].children)}for(t=n=0;t<o;t++)if(a[t].type==="text"&&t+1<o&&a[t+1].type==="text")a[t+1].content=a[t].content+a[t+1].content;else{if(t!==n)a[n]=a[t];n++}if(t!==n)a.length=n}}var go=[["normalize",e1],["block",t1],["strip_references",n1],["inline",r1],["linkify",a1],["replacements",f1],["smartquotes",v1],["text_join",w1]],Tc=class{constructor(){pe(this,"ruler",new $s),pe(this,"State",Cc);for(let e=0;e<go.length;e++)this.ruler.push(go[e][0],go[e][1])}process(e){let t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Sc=class{constructor(e,t,n,r){pe(this,"bMarks",[]),pe(this,"eMarks",[]),pe(this,"tShift",[]),pe(this,"sCount",[]),pe(this,"bsCount",[]),pe(this,"blkIndent",0),pe(this,"line",0),pe(this,"lineMax",0),pe(this,"tight",!1),pe(this,"listIndent",-1),pe(this,"parentType","root"),pe(this,"level",0),pe(this,"Token",kr),this.src=e,this.md=t,this.env=n,this.tokens=r;let s=this.src;for(let i=0,a=0,o=0,l=0,u=s.length,d=!1;a<u;a++){let f=s.charCodeAt(a);if(!d)if(je(f)){if(o++,f===9)l+=4-l%4;else l++;continue}else d=!0;if(f===10||a===u-1){if(f!==10)a++;this.bMarks.push(i),this.eMarks.push(a),this.tShift.push(o),this.sCount.push(l),this.bsCount.push(0),d=!1,o=0,l=0,i=a+1}}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new kr(e,t,n);if(r.block=!0,n<0)this.level--;if(r.level=this.level,n>0)this.level++;return this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t;e++)if(this.bMarks[e]+this.tShift[e]<this.eMarks[e])break;return e}skipSpaces(e){for(let t=this.src.length;e<t;e++)if(!je(this.src.charCodeAt(e)))break;return e}skipSpacesBack(e,t){if(e<=t)return e;while(e>t)if(!je(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n;e++)if(this.src.charCodeAt(e)!==t)break;return e}skipCharsBack(e,t,n){if(e<=n)return e;while(e>n)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";let s=Array(t-e);for(let i=0,a=e;a<t;a++,i++){let o=0,l=this.bMarks[a],u=l,d;if(a+1<t||r)d=this.eMarks[a]+1;else d=this.eMarks[a];while(u<d&&o<n){let f=this.src.charCodeAt(u);if(je(f))if(f===9)o+=4-(o+this.bsCount[a])%4;else o++;else if(u-l<this.tShift[a])o++;else break;u++}if(o>n)s[i]=Array(o-n+1).join(" ")+this.src.slice(u,d);else s[i]=this.src.slice(u,d)}return s.join("")}},k1=65536;function bo(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function fc(e){let t=[],n=e.length,r=0,s=e.charCodeAt(r),i=!1,a=0,o="";while(r<n){if(s===124)if(!i)t.push(o+e.substring(a,r)),o="",a=r+1;else o+=e.substring(a,r-1),a=r;i=s===92,r++,s=e.charCodeAt(r)}return t.push(o+e.substring(a)),t}function x1(e,t,n,r){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent)return!1;if(e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;let a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58)return!1;if(i>=e.eMarks[s])return!1;let o=e.src.charCodeAt(i++);if(o!==124&&o!==45&&o!==58&&!je(o))return!1;if(a===45&&je(o))return!1;while(i<e.eMarks[s]){let E=e.src.charCodeAt(i);if(E!==124&&E!==45&&E!==58&&!je(E))return!1;i++}let l=bo(e,t+1),u=l.split("|"),d=[];for(let E=0;E<u.length;E++){let D=u[E].trim();if(!D)if(E===0||E===u.length-1)continue;else return!1;if(!/^:?-+:?$/.test(D))return!1;if(D.charCodeAt(D.length-1)===58)d.push(D.charCodeAt(0)===58?"center":"right");else if(D.charCodeAt(0)===58)d.push("left");else d.push("")}if(l=bo(e,t).trim(),l.indexOf("|")===-1)return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(u=fc(l),u.length&&u[0]==="")u.shift();if(u.length&&u[u.length-1]==="")u.pop();let f=u.length;if(f===0||f!==d.length)return!1;if(r)return!0;let p=e.parentType;e.parentType="table";let g=e.md.block.ruler.getRules("blockquote"),b=e.push("table_open","table",1),x=[t,0];b.map=x;let k=e.push("thead_open","thead",1);k.map=[t,t+1];let A=e.push("tr_open","tr",1);A.map=[t,t+1];for(let E=0;E<u.length;E++){let D=e.push("th_open","th",1);if(d[E])D.attrs=[["style",`text-align:${d[E]}`]];let M=e.push("inline","",0);M.content=u[E].trim(),M.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let T,S=0;for(s=t+2;s<n;s++){if(e.sCount[s]<e.blkIndent)break;let E=!1;for(let M=0,L=g.length;M<L;M++)if(g[M](e,s,n,!0)){E=!0;break}if(E)break;if(l=bo(e,s).trim(),!l)break;if(e.sCount[s]-e.blkIndent>=4)break;if(u=fc(l),u.length&&u[0]==="")u.shift();if(u.length&&u[u.length-1]==="")u.pop();if(S+=f-u.length,S>k1)break;if(s===t+2){let M=e.push("tbody_open","tbody",1);M.map=T=[t+2,0]}let D=e.push("tr_open","tr",1);D.map=[s,s+1];for(let M=0;M<f;M++){let L=e.push("td_open","td",1);if(d[M])L.attrs=[["style",`text-align:${d[M]}`]];let z=e.push("inline","",0);z.content=u[M]?u[M].trim():"",z.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}if(T)e.push("tbody_close","tbody",-1),T[1]=s;return e.push("table_close","table",-1),x[1]=s,e.parentType=p,e.line=s,!0}function E1(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,s=r;while(r<n){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,s=r;continue}break}e.line=s;let i=e.push("code_block","code",0);return i.content=e.getLines(t,s,4+e.blkIndent,!1)+`
|
|
18
|
+
`,i.map=[t,e.line],!0}function A1(e,t,n,r){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(s+3>i)return!1;let a=e.src.charCodeAt(s);if(a!==126&&a!==96)return!1;let o=s;s=e.skipChars(s,a);let l=s-o;if(l<3)return!1;let u=e.src.slice(o,s),d=e.src.slice(s,i);if(a===96){if(d.indexOf(String.fromCharCode(a))>=0)return!1}if(r)return!0;let f=t,p=!1;for(;;){if(f++,f>=n)break;if(s=o=e.bMarks[f]+e.tShift[f],i=e.eMarks[f],s<i&&e.sCount[f]<e.blkIndent)break;if(e.src.charCodeAt(s)!==a)continue;if(e.sCount[f]-e.blkIndent>=4)continue;if(s=e.skipChars(s,a),s-o<l)continue;if(s=e.skipSpaces(s),s<i)continue;p=!0;break}l=e.sCount[t],e.line=f+(p?1:0);let g=e.push("fence","code",0);return g.info=d,g.content=e.getLines(t+1,f,l,!0),g.markup=u,g.map=[t,e.line],!0}function C1(e,t,n,r){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4)return!1;if(e.src.charCodeAt(s)!==62)return!1;if(r)return!0;let o=[],l=[],u=[],d=[],f=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let g=!1,b;for(b=t;b<n;b++){let S=e.sCount[b]<e.blkIndent;if(s=e.bMarks[b]+e.tShift[b],i=e.eMarks[b],s>=i)break;if(e.src.charCodeAt(s++)===62&&!S){let D=e.sCount[b]+1,M,L;if(e.src.charCodeAt(s)===32)s++,D++,L=!1,M=!0;else if(e.src.charCodeAt(s)===9)if(M=!0,(e.bsCount[b]+D)%4===3)s++,D++,L=!1;else L=!0;else M=!1;let z=D;o.push(e.bMarks[b]),e.bMarks[b]=s;while(s<i){let O=e.src.charCodeAt(s);if(je(O))if(O===9)z+=4-(z+e.bsCount[b]+(L?1:0))%4;else z++;else break;s++}g=s>=i,l.push(e.bsCount[b]),e.bsCount[b]=e.sCount[b]+1+(M?1:0),u.push(e.sCount[b]),e.sCount[b]=z-D,d.push(e.tShift[b]),e.tShift[b]=s-e.bMarks[b];continue}if(g)break;let E=!1;for(let D=0,M=f.length;D<M;D++)if(f[D](e,b,n,!0)){E=!0;break}if(E){if(e.lineMax=b,e.blkIndent!==0)o.push(e.bMarks[b]),l.push(e.bsCount[b]),d.push(e.tShift[b]),u.push(e.sCount[b]),e.sCount[b]-=e.blkIndent;break}o.push(e.bMarks[b]),l.push(e.bsCount[b]),d.push(e.tShift[b]),u.push(e.sCount[b]),e.sCount[b]=-1}let x=e.blkIndent;e.blkIndent=0;let k=e.push("blockquote_open","blockquote",1);k.markup=">";let A=[t,0];k.map=A,e.md.block.tokenize(e,t,b);let T=e.push("blockquote_close","blockquote",-1);T.markup=">",e.lineMax=a,e.parentType=p,A[1]=e.line;for(let S=0;S<d.length;S++)e.bMarks[S+t]=o[S],e.tShift[S+t]=d[S],e.sCount[S+t]=u[S],e.bsCount[S+t]=l[S];return e.blkIndent=x,!0}function _1(e,t,n,r){let s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t],a=e.src.charCodeAt(i++);if(a!==42&&a!==45&&a!==95)return!1;let o=1;while(i<s){let u=e.src.charCodeAt(i++);if(u!==a&&!je(u))return!1;if(u===a)o++}if(o<3)return!1;if(r)return!0;e.line=t+1;let l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(o+1).join(String.fromCharCode(a)),!0}function mc(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],s=e.src.charCodeAt(r++);if(s!==42&&s!==45&&s!==43)return-1;if(r<n){if(!je(e.src.charCodeAt(r)))return-1}return r}function pc(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],s=n;if(s+1>=r)return-1;let i=e.src.charCodeAt(s++);if(i<48||i>57)return-1;for(;;){if(s>=r)return-1;if(i=e.src.charCodeAt(s++),i>=48&&i<=57){if(s-n>=10)return-1;continue}if(i===41||i===46)break;return-1}if(s<r){if(i=e.src.charCodeAt(s),!je(i))return-1}return s}function T1(e,t){let n=e.level+2;for(let r=t+2,s=e.tokens.length-2;r<s;r++)if(e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open")e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2}function S1(e,t,n,r){let s,i,a,o,l=t,u=!0;if(e.sCount[l]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let d=!1;if(r&&e.parentType==="paragraph"){if(e.sCount[l]>=e.blkIndent)d=!0}let f,p,g;if((g=pc(e,l))>=0){if(f=!0,a=e.bMarks[l]+e.tShift[l],p=Number(e.src.slice(a,g-1)),d&&p!==1)return!1}else if((g=mc(e,l))>=0)f=!1;else return!1;if(d){if(e.skipSpaces(g)>=e.eMarks[l])return!1}if(r)return!0;let b=e.src.charCodeAt(g-1),x=e.tokens.length;if(f){if(o=e.push("ordered_list_open","ol",1),p!==1)o.attrs=[["start",p]]}else o=e.push("bullet_list_open","ul",1);let k=[l,0];o.map=k,o.markup=String.fromCharCode(b);let A=!1,T=e.md.block.ruler.getRules("list"),S=e.parentType;e.parentType="list";while(l<n){i=g,s=e.eMarks[l];let E=e.sCount[l]+g-(e.bMarks[l]+e.tShift[l]),D=E;while(i<s){let de=e.src.charCodeAt(i);if(de===9)D+=4-(D+e.bsCount[l])%4;else if(de===32)D++;else break;i++}let M=i,L;if(M>=s)L=1;else L=D-E;if(L>4)L=1;let z=E+L;o=e.push("list_item_open","li",1),o.markup=String.fromCharCode(b);let O=[l,0];if(o.map=O,f)o.info=e.src.slice(a,g-1);let P=e.tight,V=e.tShift[l],G=e.sCount[l],ce=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=z,e.tight=!0,e.tShift[l]=M-e.bMarks[l],e.sCount[l]=D,M>=s&&e.isEmpty(l+1))e.line=Math.min(e.line+2,n);else e.md.block.tokenize(e,l,n);if(!e.tight||A)u=!1;if(A=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ce,e.tShift[l]=V,e.sCount[l]=G,e.tight=P,o=e.push("list_item_close","li",-1),o.markup=String.fromCharCode(b),l=e.line,O[1]=l,l>=n)break;if(e.sCount[l]<e.blkIndent)break;if(e.sCount[l]-e.blkIndent>=4)break;let re=!1;for(let de=0,F=T.length;de<F;de++)if(T[de](e,l,n,!0)){re=!0;break}if(re)break;if(f){if(g=pc(e,l),g<0)break;a=e.bMarks[l]+e.tShift[l]}else if(g=mc(e,l),g<0)break;if(b!==e.src.charCodeAt(g-1))break}if(f)o=e.push("ordered_list_close","ol",-1);else o=e.push("bullet_list_close","ul",-1);if(o.markup=String.fromCharCode(b),k[1]=l,e.line=l,e.parentType=S,u)T1(e,x);return!0}var vo=999;function R1(e){let t=e.length;for(let n=0;n<e.length-1;n++){let r=e.charCodeAt(n);if(r<55296||r>56319)continue;let s=e.charCodeAt(n+1);if(s>=56320&&s<=57343)t--,n++}return t}function Is(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Pi(e,t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let r=!1;if(e.sCount[t]-e.blkIndent>3)r=!0;if(e.sCount[t]<0)r=!0;if(!r){let s=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let a=!1;for(let o=0,l=s.length;o<l;o++)if(s[o](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return-1}return e.bMarks[t]+e.tShift[t]}function M1(e,t,n,r){let s=e.src,i=e.bMarks[t]+e.tShift[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(s.charCodeAt(i)!==91)return!1;let o=Is(e,t),l="",u=-1,d=++i;while(i<o){if(l.length+i-d>vo*2)return!1;let M=s.charCodeAt(i);if(M===91)return!1;if(M===93){u=i;break}if(M===92)M=s.charCodeAt(++i);if(M===10&&i<o){let L=Pi(e,a);if(L<0)return!1;l+=s.slice(d,o),i=d=L,o=Is(e,a++);continue}i++}if(u<0||s.charCodeAt(u+1)!==58)return!1;if(l+=s.slice(d,u),l.length>vo&&R1(l)>vo)return!1;i=u+2;while(i<o){let M=s.charCodeAt(i);if(M===10){let L=Pi(e,a);if(L<0)break;i=L,o=Is(e,a++)}else if(je(M))i++;else break}let f=e.md.helpers.parseLinkDestination(s,i,o);if(!f.ok)return!1;let p=e.md.normalizeLink(f.str);if(!e.md.validateLink(p))return!1;i=f.pos;let g=i,b=o,x=a;while(i<o){let M=s.charCodeAt(i);if(M===10){let L=Pi(e,a);if(L<0)break;i=L,o=Is(e,a++)}else if(je(M))i++;else break}let k=i,A=e.md.helpers.parseLinkTitle(s,i,o);while(A.can_continue){let M=Pi(e,a);if(M<0)break;i=M,o=Is(e,a++),A=e.md.helpers.parseLinkTitle(s,i,o,A)}let T;if(k!==g&&A.ok)T=A.str,i=A.pos;else T="",i=g,o=b,a=x;while(i<o){if(!je(s.charCodeAt(i)))break;i++}if(i<o&&s.charCodeAt(i)!==10){if(T){T="",i=g,o=b,a=x;while(i<o){if(!je(s.charCodeAt(i)))break;i++}}}if(i<o&&s.charCodeAt(i)!==10)return!1;let S=Wi(l);if(!S)return!1;if(r)return!0;if(typeof e.env.references>"u")e.env.references={};if(typeof e.env.references[S]>"u")e.env.references[S]={title:T,href:p};let E=e.push("reference_definition","",0);E.map=[t,a],E.hidden=!0;let D=Object.create(null);return D.label=S,E.meta=D,e.line=a,!0}var D1=["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"],Rc=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Mc="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";new RegExp(`^(?:${Rc}|${Mc}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);var Dc=new RegExp(`^(?:${Rc}|${Mc})`),wr=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${D1.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Dc.source}\\s*$`),/^$/,!1]];function L1(e,t,n,r){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(e.src.charCodeAt(s)!==60)return!1;let a=e.src.slice(s,i),o=0;for(;o<wr.length;o++)if(wr[o][0].test(a))break;if(o===wr.length)return!1;if(r)return wr[o][2];let l=t+1,u=wr[o][1].test("");if(!wr[o][1].test(a))for(;l<n;l++){if(e.sCount[l]<e.blkIndent){if(u||!e.isEmpty(l))break}if(s=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],a=e.src.slice(s,i),wr[o][1].test(a)){if(a.length!==0)l++;break}}e.line=l;let d=e.push("html_block","",0);return d.map=[t,l],d.content=e.getLines(t,l,e.blkIndent,!0),!0}function I1(e,t,n,r){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(s);if(a!==35||s>=i)return!1;let o=1;a=e.src.charCodeAt(++s);while(a===35&&s<i&&o<=6)o++,a=e.src.charCodeAt(++s);if(o>6||s<i&&!je(a))return!1;if(r)return!0;i=e.skipSpacesBack(i,s);let l=e.skipCharsBack(i,35,s);if(l>s&&je(e.src.charCodeAt(l-1)))i=l;e.line=t+1;let u=e.push("heading_open",`h${o}`,1);u.markup="########".slice(0,o),u.map=[t,e.line];let d=e.push("inline","",0);d.content=ji(e.src.slice(s,i)),d.map=[t,e.line],d.children=[];let f=e.push("heading_close",`h${o}`,-1);return f.markup="########".slice(0,o),!0}function N1(e,t,n){let r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.parentType;e.parentType="paragraph";let i=0,a,o=t+1;for(;o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]>=e.blkIndent){let g=e.bMarks[o]+e.tShift[o],b=e.eMarks[o];if(g<b){if(a=e.src.charCodeAt(g),a===45||a===61){if(g=e.skipChars(g,a),g=e.skipSpaces(g),g>=b){i=a===61?1:2;break}}}}if(e.sCount[o]<0)continue;let p=!1;for(let g=0,b=r.length;g<b;g++)if(r[g](e,o,n,!0)){p=!0;break}if(p)break}if(!i)return e.parentType=s,!1;let l=ji(e.getLines(t,o,e.blkIndent,!1));e.line=o+1;let u=e.push("heading_open",`h${i}`,1);u.markup=String.fromCharCode(a),u.map=[t,e.line];let d=e.push("inline","",0);d.content=l,d.map=[t,e.line-1],d.children=[];let f=e.push("heading_close",`h${i}`,-1);return f.markup=String.fromCharCode(a),e.parentType=s,!0}function B1(e,t,n){let r=e.md.block.ruler.getRules("paragraph"),s=e.parentType,i=t+1;e.parentType="paragraph";for(;i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3)continue;if(e.sCount[i]<0)continue;let u=!1;for(let d=0,f=r.length;d<f;d++)if(r[d](e,i,n,!0)){u=!0;break}if(u)break}let a=ji(e.getLines(t,i,e.blkIndent,!1));e.line=i;let o=e.push("paragraph_open","p",1);o.map=[t,e.line];let l=e.push("inline","",0);return l.content=a,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}var Ui=[["table",x1,["paragraph","reference"]],["code",E1],["fence",A1,["paragraph","reference","blockquote","list"]],["blockquote",C1,["paragraph","reference","blockquote","list"]],["hr",_1,["paragraph","reference","blockquote","list"]],["list",S1,["paragraph","reference","blockquote"]],["reference",M1],["html_block",L1,["paragraph","reference","blockquote"]],["heading",I1,["paragraph","reference","blockquote"]],["lheading",N1],["paragraph",B1]],Lc=class{constructor(){pe(this,"ruler",new $s),pe(this,"State",Sc);for(let e=0;e<Ui.length;e++)this.ruler.push(Ui[e][0],Ui[e][1],{alt:(Ui[e][2]||[]).slice()})}tokenize(e,t,n){let r=this.ruler.getRules(""),s=r.length,i=e.md.options.maxNesting,a=t,o=!1;while(a<n){if(e.line=a=e.skipEmptyLines(a),a>=n)break;if(e.sCount[a]<e.blkIndent)break;if(e.level>=i){e.line=n;break}let l=e.line,u=!1;for(let d=0;d<s;d++)if(u=r[d](e,a,n,!1),u){if(l>=e.line)throw Error("block rule didn't increment state.line");break}if(!u)throw Error("none of the block rules matched");if(e.tight=!o,e.isEmpty(e.line-1))o=!0;if(a=e.line,a<n&&e.isEmpty(a))o=!0,a++,e.line=a}}parse(e,t,n,r){if(!e)return;let s=new this.State(e,t,n,r);this.tokenize(s,s.line,s.lineMax)}},Ic=class{constructor(e,t,n,r){pe(this,"pos",0),pe(this,"level",0),pe(this,"pending",""),pe(this,"pendingLevel",0),pe(this,"cache",{}),pe(this,"backticks",{}),pe(this,"backticksScanned",!1),pe(this,"skipHtmlSpecial",!1),pe(this,"linkLevel",0),pe(this,"delimiters",[]),pe(this,"_prev_delimiters",[]),pe(this,"Token",kr),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new kr("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){if(this.pending)this.pushPending();let r=new kr(e,t,n),s=void 0;if(n<0)this.level--,this.delimiters=this._prev_delimiters.pop();if(r.level=this.level,n>0)this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters};return this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(s),r}scanDelims(e,t){let n=this.posMax,r=this.src.charCodeAt(e),s;if(e===0)s=32;else if(e===1){if(s=this.src.charCodeAt(0),(s&63488)===55296)s=65533}else if(s=this.src.charCodeAt(e-1),(s&64512)===56320){let b=this.src.charCodeAt(e-2);s=(b&64512)===55296?65536+(b-55296<<10)+(s-56320):65533}else if((s&64512)===55296)s=65533;let i=e;while(i<n&&this.src.charCodeAt(i)===r)i++;let a=i-e,o=i<n?this.src.charCodeAt(i):32;if((o&64512)===55296){let b=this.src.charCodeAt(i+1);o=(b&64512)===56320?65536+(o-55296<<10)+(b-56320):65533}else if((o&64512)===56320)o=65533;let l=zs(s)||Os(s),u=zs(o)||Os(o),d=Bs(s),f=Bs(o),p=!f&&(!u||d||l),g=!d&&(!l||f||u);return{can_open:p&&(t||!g||l),can_close:g&&(t||!p||u),length:a}}};function O1(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function z1(e,t){let n=e.pos;while(n<e.posMax&&!O1(e.src.charCodeAt(n)))n++;if(n===e.pos)return!1;if(!t)e.pending+=e.src.slice(e.pos,n);return e.pos=n,!0}function F1(e){return e>=65&&e<=90||e>=97&&e<=122}function $1(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function q1(e,t){if(!e.md.options.linkify)return!1;if(e.linkLevel>0)return!1;let{pos:n,posMax:r}=e;if(n+3>r)return!1;if(e.src.charCodeAt(n)!==58)return!1;if(e.src.charCodeAt(n+1)!==47)return!1;if(e.src.charCodeAt(n+2)!==47)return!1;let s=n-Math.min(10,e.pending.length,n),i=n;while(i>s&&$1(e.src.charCodeAt(i-1)))i--;if(i===n||!F1(e.src.charCodeAt(i)))return!1;let a=n-i,o=e.md.linkify.matchAtStart(e.src.slice(i));if(!o)return!1;let l=o.url;if(l.length<=a)return!1;let u=l.length;while(u>0&&l.charCodeAt(u-1)===42)u--;if(u!==l.length)l=l.slice(0,u);let d=e.md.normalizeLink(l);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-a);let f=e.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let p=e.push("text","",0);p.content=e.md.normalizeLinkText(l);let g=e.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return e.pos+=l.length-a,!0}function H1(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,s=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let i=r-1;while(i>=1&&e.pending.charCodeAt(i-1)===32)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);n++;while(n<s&&je(e.src.charCodeAt(n)))n++;return e.pos=n,!0}var xo=[];for(let e=0;e<256;e++)xo.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){xo[e.charCodeAt(0)]=1});function P1(e,t){let{pos:n,posMax:r}=e;if(e.src.charCodeAt(n)!==92)return!1;if(n++,n>=r)return!1;let s=e.src.charCodeAt(n);if(s===10){if(!t)e.push("hardbreak","br",0);n++;while(n<r){if(s=e.src.charCodeAt(n),!je(s))break;n++}return e.pos=n,!0}if(s===32){if(!t){let o=e.push("text_special","",0);o.content="\\",o.markup="\\",o.info="escape"}return e.pos=n,!0}let i=e.src[n];if(s>=55296&&s<=56319&&n+1<r){let o=e.src.charCodeAt(n+1);if(o>=56320&&o<=57343)i+=e.src[n+1],n++}let a="\\"+i;if(!t){let o=e.push("text_special","",0);if(s<256&&xo[s]!==0)o.content=i;else o.content=a;o.markup=a,o.info="escape"}return e.pos=n+1,!0}function U1(e){let t={},n=0;while((n=e.indexOf("`",n))!==-1){let r=n;while(e.charCodeAt(++n)===96);t[n-r]=r}return t}function W1(e,t){var n;let r=e.pos;if(e.src.charCodeAt(r)!==96)return!1;let s=e.posMax,i=r+1;while(i<s&&e.src.charCodeAt(i)===96)i++;let a=e.src.slice(r,i),o=a.length;if(!e.backticksScanned)e.backticks=U1(e.src),e.backticksScanned=!0;if(((n=e.backticks[o])!==null&&n!==void 0?n:-1)>=i){let l=i,u;while((u=e.src.indexOf("`",l))!==-1&&u<s){l=u+1;while(e.src.charCodeAt(l)===96)l++;if(l>s)break;if(l-u===o){if(!t){let d=e.push("code_inline","code",0);d.markup=a;let f=e.src.slice(i,u).replace(/\n/g," ");if(f.startsWith(" ")&&f.endsWith(" ")&&/[^ ]/.test(f))f=f.slice(1,-1);d.content=f}return e.pos=l,!0}}}if(!t)e.pending+=a;return e.pos=i,!0}function j1(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(r!==126)return!1;let s=e.scanDelims(e.pos,!0),i=s.length,a=String.fromCharCode(r);if(i<2)return!1;let o;if(i%2)o=e.push("text","",0),o.content=a,i--;for(let l=0;l<i;l+=2)o=e.push("text","",0),o.content=a+a,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function gc(e,t){let n,r=[],s=t.length;for(let i=0;i<s;i++){let a=t[i];if(a.marker!==126)continue;if(a.end===-1)continue;let o=t[a.end];if(n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[o.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[o.token-1].type==="text"&&e.tokens[o.token-1].content==="~")r.push(o.token-1)}while(r.length){let i=r.pop(),a=i+1;while(a<e.tokens.length&&e.tokens[a].type==="s_close")a++;if(a--,i!==a)n=e.tokens[a],e.tokens[a]=e.tokens[i],e.tokens[i]=n}}function G1(e){let t=e.tokens_meta,n=e.tokens_meta.length;gc(e,e.delimiters);for(let s=0;s<n;s++){var r;let i=(r=t[s])===null||r===void 0?void 0:r.delimiters;if(i)gc(e,i)}}var Nc={tokenize:j1,postProcess:G1};function K1(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(r!==95&&r!==42)return!1;let s=e.scanDelims(e.pos,r===42);for(let i=0;i<s.length;i++){let a=e.push("text","",0);a.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function bc(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let s=t[r];if(s.marker!==95&&s.marker!==42)continue;if(s.end===-1)continue;let i=t[s.end],a=r>0&&t[r-1].end===s.end+1&&t[r-1].marker===s.marker&&t[r-1].token===s.token-1&&t[s.end+1].token===i.token+1,o=String.fromCharCode(s.marker),l=e.tokens[s.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?o+o:o,l.content="";let u=e.tokens[i.token];if(u.type=a?"strong_close":"em_close",u.tag=a?"strong":"em",u.nesting=-1,u.markup=a?o+o:o,u.content="",a)e.tokens[t[r-1].token].content="",e.tokens[t[s.end+1].token].content="",r--}}function V1(e){let t=e.tokens_meta,n=e.tokens_meta.length;bc(e,e.delimiters);for(let s=0;s<n;s++){var r;let i=(r=t[s])===null||r===void 0?void 0:r.delimiters;if(i)bc(e,i)}}var Bc={tokenize:K1,postProcess:V1};function J1(e,t){let n,r,s,i,a="",o="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let{pos:d,posMax:f}=e,p=e.pos+1,g=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(g<0)return!1;let b=g+1;if(b<f&&e.src.charCodeAt(b)===40){u=!1,b++;for(;b<f;b++)if(n=e.src.charCodeAt(b),!je(n)&&n!==10)break;if(b>=f)return!1;if(l=b,s=e.md.helpers.parseLinkDestination(e.src,b,e.posMax),s.ok){if(a=e.md.normalizeLink(s.str),e.md.validateLink(a))b=s.pos;else a="";l=b;for(;b<f;b++)if(n=e.src.charCodeAt(b),!je(n)&&n!==10)break;if(s=e.md.helpers.parseLinkTitle(e.src,b,e.posMax),b<f&&l!==b&&s.ok){o=s.str,b=s.pos;for(;b<f;b++)if(n=e.src.charCodeAt(b),!je(n)&&n!==10)break}}if(b>=f||e.src.charCodeAt(b)!==41)u=!0;b++}if(u){if(typeof e.env.references>"u")return!1;if(b<f&&e.src.charCodeAt(b)===91)if(l=b+1,b=e.md.helpers.parseLinkLabel(e,b),b>=0)r=e.src.slice(l,b++);else b=g+1;else b=g+1;if(!r)r=e.src.slice(p,g);if(r=Wi(r),i=e.env.references[r],!i)return e.pos=d,!1;a=i.href,o=i.title}if(!t){e.pos=p,e.posMax=g;let x=e.push("link_open","a",1),k=[["href",a]];if(x.attrs=k,o)k.push(["title",o]);if(r){let A=Object.create(null);A.label=r,x.meta=A}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=b,e.posMax=f,!0}function Z1(e,t){let n,r,s,i,a,o,l,u,d="",{pos:f,posMax:p}=e;if(e.src.charCodeAt(e.pos)!==33)return!1;if(e.src.charCodeAt(e.pos+1)!==91)return!1;let g=e.pos+2,b=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(b<0)return!1;if(i=b+1,i<p&&e.src.charCodeAt(i)===40){i++;for(;i<p;i++)if(n=e.src.charCodeAt(i),!je(n)&&n!==10)break;if(i>=p)return!1;if(u=i,o=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),o.ok)if(d=e.md.normalizeLink(o.str),e.md.validateLink(d))i=o.pos;else d="";u=i;for(;i<p;i++)if(n=e.src.charCodeAt(i),!je(n)&&n!==10)break;if(o=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<p&&u!==i&&o.ok){l=o.str,i=o.pos;for(;i<p;i++)if(n=e.src.charCodeAt(i),!je(n)&&n!==10)break}else l="";if(i>=p||e.src.charCodeAt(i)!==41)return e.pos=f,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<p&&e.src.charCodeAt(i)===91)if(u=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0)s=e.src.slice(u,i++);else i=b+1;else i=b+1;if(!s)s=e.src.slice(g,b);if(s=Wi(s),a=e.env.references[s],!a)return e.pos=f,!1;d=a.href,l=a.title}if(!t){r=e.src.slice(g,b);let x=[];e.md.inline.parse(r,e.md,e.env,x);let k=e.push("image","img",0),A=[["src",d],["alt",""]];if(k.attrs=A,k.children=x,k.content=r,l)A.push(["title",l]);if(s){let T=Object.create(null);T.label=s,k.meta=T}}return e.pos=i,e.posMax=p,!0}var Y1=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,X1=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Q1(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let{pos:r,posMax:s}=e;for(;;){if(++n>=s)return!1;let a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}let i=e.src.slice(r+1,n);if(X1.test(i)){let a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){let o=e.push("link_open","a",1);o.attrs=[["href",a]],o.markup="autolink",o.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}if(Y1.test(i)){let a=e.md.normalizeLink(`mailto:${i}`);if(!e.md.validateLink(a))return!1;if(!t){let o=e.push("link_open","a",1);o.attrs=[["href",a]],o.markup="autolink",o.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}return!1}function eg(e){return/^<a[>\s]/i.test(e)}function tg(e){return/^<\/a\s*>/i.test(e)}function Oc(e){let t=e|32;return t>=97&&t<=122}function ng(e,t){let n=e.src,r,s;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;r=t+4,s="-->"}else if(n.startsWith("<![CDATA[",t))r=t+9,s="]]>";else if(n.charCodeAt(t+1)===63)r=t+2,s="?>";else if(Oc(n.charCodeAt(t+2)))r=t+3,s=">";else return-1;if(e.skipHtmlSpecial)return-1;let i=n.indexOf(s,r);if(i<0)return e.skipHtmlSpecial=!0,-1;return i+s.length}function rg(e,t){if(!e.md.options.html)return!1;let{posMax:n,pos:r}=e;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let s,i=e.src.charCodeAt(r+1);if(i===33||i===63)s=ng(e,r);else if(i===47||Oc(i)){let a=e.src.slice(r).match(Dc);s=a?r+a[0].length:-1}else return!1;if(s<0)return!1;if(!t){let a=e.push("html_inline","",0);if(a.content=e.src.slice(r,s),eg(a.content))e.linkLevel++;if(tg(a.content))e.linkLevel--}return e.pos=s,!0}var sg=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,ig=/^&([a-z][a-z0-9]{1,31});/i;function ag(e,t){let{pos:n,posMax:r}=e;if(e.src.charCodeAt(n)!==38)return!1;if(n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let s=e.src.slice(n).match(sg);if(s){if(!t){let i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=e.push("text_special","",0);a.content=ko(i)?Ns(i):Ns(65533),a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}else{let s=e.src.slice(n).match(ig);if(s){let i=qi(s[0]);if(i!==s[0]){if(!t){let a=e.push("text_special","",0);a.content=i,a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}}return!1}function vc(e){let t={},n=e.length;if(!n)return;let r=0,s=-2,i=[];for(let a=0;a<n;a++){let o=e[a];if(i.push(0),e[r].marker!==o.marker||s!==o.token-1)r=a;if(s=o.token,o.length=o.length||0,!o.close)continue;if(!t.hasOwnProperty(o.marker))t[o.marker]=[-1,-1,-1,-1,-1,-1];let l=t[o.marker][(o.open?3:0)+o.length%3],u=r-i[r]-1,d=u;for(;u>l;u-=i[u]+1){let f=e[u];if(f.marker!==o.marker)continue;if(f.open&&f.end<0){let p=!1;if(f.close||o.open){if((f.length+o.length)%3===0){if(f.length%3!==0||o.length%3!==0)p=!0}}if(!p){let g=u>0&&!e[u-1].open?i[u-1]+1:0;i[a]=a-u+g,i[u]=g,o.open=!1,f.end=a,f.close=!1,d=-1,s=-2;break}}}if(d!==-1)t[o.marker][(o.open?3:0)+(o.length||0)%3]=d}}function og(e){let t=e.tokens_meta,n=e.tokens_meta.length;vc(e.delimiters);for(let s=0;s<n;s++){var r;let i=(r=t[s])===null||r===void 0?void 0:r.delimiters;if(i)vc(i)}}function lg(e){let t,n,r=0,s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){if(s[t].nesting<0)r--;if(s[t].level=r,s[t].nesting>0)r++;if(s[t].type==="text"&&t+1<i&&s[t+1].type==="text")s[t+1].content=s[t].content+s[t+1].content;else{if(t!==n)s[n]=s[t];n++}}if(t!==n)s.length=n}var yo=[["text",z1],["linkify",q1],["newline",H1],["escape",P1],["backticks",W1],["strikethrough",Nc.tokenize],["emphasis",Bc.tokenize],["link",J1],["image",Z1],["autolink",Q1],["html_inline",rg],["entity",ag]],wo=[["balance_pairs",og],["strikethrough",Nc.postProcess],["emphasis",Bc.postProcess],["fragments_join",lg]],zc=class{constructor(){pe(this,"ruler",new $s),pe(this,"ruler2",new $s),pe(this,"State",Ic);for(let e=0;e<yo.length;e++)this.ruler.push(yo[e][0],yo[e][1]);for(let e=0;e<wo.length;e++)this.ruler2.push(wo[e][0],wo[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(""),r=n.length,s=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let a=!1;if(e.level<s){for(let o=0;o<r;o++)if(e.level++,a=n[o](e,!0),e.level--,a){if(t>=e.pos)throw Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;if(!a)e.pos++;i[t]=e.pos}tokenize(e){let t=this.ruler.getRules(""),n=t.length,r=e.posMax,s=e.md.options.maxNesting;while(e.pos<r){let i=e.pos,a=!1;if(e.level<s){for(let o=0;o<n;o++)if(a=t[o](e,!1),a){if(i>=e.pos)throw Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}if(e.pending)e.pushPending()}parse(e,t,n,r){let s=new this.State(e,t,n,r);this.tokenize(s);let i=this.ruler2.getRules(""),a=i.length;for(let o=0;o<a;o++)i[o](s)}},cg={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},ug=/^(vbscript|javascript|file|data):/,dg=/^data:image\/(gif|png|jpeg|webp);/,yc=["http:","https:","mailto:"],dn=class{validateLink(e){let t=e.trim().toLowerCase();return ug.test(t)?dg.test(t):!0}normalizeLink(e){let t=Ds(e,!0);if(t.hostname){if(!t.protocol||yc.indexOf(t.protocol)>=0)try{t.hostname=po.toASCII(t.hostname)}catch(n){}}if(t.auth)t.auth=Qn(t.auth);if(t.hostname)t.hostname=Qn(t.hostname);if(t.pathname)t.pathname=Qn(t.pathname);if(t.search)t.search=Qn(t.search);if(t.hash)t.hash=Qn(t.hash);return Vr(t)}normalizeLinkText(e){let t=Ds(e,!0);if(t.hostname){if(!t.protocol||yc.indexOf(t.protocol)>=0)try{t.hostname=po.toUnicode(t.hostname)}catch(n){}}return Ms(Vr(t),Ms.defaultChars+"%")}constructor(...e){pe(this,"inline",new zc),pe(this,"block",new Lc),pe(this,"core",new Tc),pe(this,"renderer",new Ac),pe(this,"linkify",new tc),pe(this,"utils",Ip),pe(this,"helpers",Object.assign({},Jp));let[t,n]=e;if(typeof t==="string"){if(this.configure(t),n)this.set(n)}else this.configure("default"),this.set(t||{})}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e==="string"){let s=e;if(t=cg[s],!t)throw Error(`Wrong 'markdown-it' preset "${s}", check name`)}else t=e;if(!t)throw Error("Wrong `markdown-it` preset, can't be empty");if(t.options)this.options={...t.options};let n=t.components;if(n){var r;["core","block","inline"].forEach((i)=>{var a;let o=(a=n[i])===null||a===void 0?void 0:a.rules;if(o)this[i].ruler.enableOnly(o)});let s=(r=n.inline)===null||r===void 0?void 0:r.rules2;if(s)this.inline.ruler2.enableOnly(s)}return this}enable(e,t=!1){let n=[];if(!Array.isArray(e))e=[e];["core","block","inline"].forEach((s)=>{n=n.concat(this[s].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter((s)=>n.indexOf(s)<0);if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];if(!Array.isArray(e))e=[e];["core","block","inline"].forEach((s)=>{n=n.concat(this[s].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter((s)=>n.indexOf(s)<0);if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!=="string")throw Error("Input data should be a String");let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};pe(dn,"Token",kr);pe(dn,"Ruler",$s);pe(dn,"Renderer",Ac);pe(dn,"ParserCore",Tc);pe(dn,"StateCore",Cc);pe(dn,"ParserBlock",Lc);pe(dn,"StateBlock",Sc);pe(dn,"ParserInline",zc);pe(dn,"StateInline",Ic);var Fc=kc(dn);var T6=String.raw`\$&`,$c=(e)=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'");var Sn=(e,t,n)=>(n?[e[n].ruler]:[e.core.ruler,e.block.ruler,e.inline.ruler]).some((r)=>r.__rules__.some(({name:s})=>s===t)),S6=String.raw`\^$.*+?()[]{}|`;var hg=(e)=>{if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=32||n===34||n===39||n===47||n===60||n===61||n===62)return!1}return!0},qs=(e)=>{let t="",n=0;for(let r=0;r<e.length;r++){let s="";switch(e.charCodeAt(r)){case 34:s=""";break;case 38:s="&";break;case 60:s="<";break;case 62:s=">"}s&&(t+=e.slice(n,r)+s,n=r+1)}return n===0?e:t+e.slice(n)},Gi=(e,t)=>{if(t){for(let[n,r]of Object.entries(t))if(hg(n))if(n==="class"){let s=String(r).trim();s&&e.attrJoin("class",s)}else e.attrSet(n,r)}},Eo=(e)=>(e??0)>0?`:${e}`:"",qc=(e,t)=>`${typeof e=="string"?`-${e}-`:""}${t+1}`,fg=(e,t)=>`[${e+1}${Eo(t)}]`,mg=(e,t)=>{let{id:n,subId:r}=e[t].meta;return fg(n,r)},pg=(e,t,n,r,s)=>{let{href:i,anchorId:a,anchorClass:o}=e[t].meta,l=s.rules.footnote_caption(e,t,n,r,s);return`<sup${s.renderAttrs(e[t])}><a href="${qs(i)}">${l}</a><a class="${qs(o)}" id="${qs(a)}"></a></sup>`},gg=(e,t,n,r,s)=>{let{separatorClass:i,listClass:a}=e[t].meta;return`<hr class="${qs(i)}"${n.xhtmlOut?" /":""}>
|
|
19
|
+
<section${s.renderAttrs(e[t])}>
|
|
20
|
+
<ol class="${qs(a)}">
|
|
21
|
+
`},bg=()=>`</ol>
|
|
22
|
+
</section>
|
|
23
|
+
`,vg=(e,t,n,r,s)=>`<li${s.renderAttrs(e[t])}>`,yg=()=>`</li>
|
|
24
|
+
`,wg=(e,t,n,r,s)=>{let{text:i}=e[t].meta;return` <a${s.renderAttrs(e[t])}>${$c(i)}</a>`},kg=(e,t,n,r)=>{let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],a;if(s+4>i||e.src.charCodeAt(s)!==91||e.src.charCodeAt(s+1)!==94)return!1;let o=s+2;for(;o<i;){if(a=e.src.charCodeAt(o),a===32)return!1;if(a===93)break;o++}if(o===s+2||o+1>=i||e.src.charCodeAt(++o)!==58)return!1;if(r)return!0;o++,(e.env.footnotes??={}).refs??={};let l=e.src.slice(s+2,o-2);e.env.footnotes.refs[`:${l}`]=-1;let u=e.push("footnote_reference_open","",1);u.meta={label:l},u.level=e.level++;let d=e.bMarks[t],f=e.tShift[t],p=e.sCount[t],g=e.parentType,b=o,x=e.sCount[t]+o-(e.bMarks[t]+e.tShift[t]),k=x;for(;o<i;){if(a=e.src.charCodeAt(o),a===9)k+=4-k%4;else if(a===32)k++;else break;o++}e.tShift[t]=o-b,e.sCount[t]=k-x,e.bMarks[t]=b,e.blkIndent+=4,e.parentType="footnote",e.sCount[t]<e.blkIndent&&(e.sCount[t]+=e.blkIndent),e.md.block.tokenize(e,t,n),e.parentType=g,e.blkIndent-=4,e.tShift[t]=f,e.sCount[t]=p,e.bMarks[t]=d;let A=e.push("footnote_reference_close","",-1);return A.level=--e.level,!0},Hc=(e,t,n,r,s)=>{let i=e.push("footnote_ref","",0),a=qc(e.env.docId,n),o=Eo(r);i.meta={id:n,subId:r,label:s,href:`#footnote${a}`,anchorId:`footnote-ref${a}${o}`,anchorClass:"footnote-anchor"},i.attrJoin("class","footnote-ref"),Gi(i,t.refAttrs)},xg=(e)=>(t,n)=>{let{posMax:r,pos:s}=t;if(s+2>=r||t.src.charCodeAt(s)!==94||t.src.charCodeAt(s+1)!==91)return!1;let i=t.md.helpers.parseLinkLabel(t,s+1);if(i<0)return!1;let a=s+2;if(!n){let o=((t.env.footnotes??={}).list??=[]).length,l=[];t.md.inline.parse(t.src.slice(a,i),t.md,t.env,l),t.env.footnotes.list[o]={content:t.src.slice(a,i),tokens:l},Hc(t,e,o)}return t.pos=i+1,t.posMax=r,!0},Eg=(e)=>(t,n)=>{let{pos:r,posMax:s}=t;if(r+3>s||!t.env.footnotes?.refs||t.src.charCodeAt(r)!==91||t.src.charCodeAt(r+1)!==94)return!1;let i=r+2,a;for(;i<s;){if(a=t.src.charCodeAt(i),a===32||a===10)return!1;if(a===93)break;i++}if(i===r+2||i>=s)return!1;i++;let o=t.src.slice(r+2,i-1);if(typeof t.env.footnotes.refs[`:${o}`]!="number")return!1;if(!n){let l=t.env.footnotes.list??=[],{refs:u}=t.env.footnotes,d;u[`:${o}`]<0?(d=l.length,l[d]={label:o,count:0},u[`:${o}`]=d):d=u[`:${o}`];let f=l[d].count;l[d].count+=1,Hc(t,e,d,f,o)}return t.pos=i,t.posMax=s,!0},Ag=(e)=>(t)=>{let n={},r=[];if(!t.env.footnotes?.list){let o=0;t.tokens=t.tokens.filter((l)=>l.type==="footnote_reference_open"?(o++,!1):l.type==="footnote_reference_close"?(o--,!1):o===0);return}let{list:s}=t.env.footnotes;t.tokens=t.tokens.filter((o)=>{if(o.type==="footnote_reference_open")return r.push({label:o.meta.label,tokens:[]}),!1;if(o.type==="footnote_reference_close"){let{label:l,tokens:u}=r.pop();return n[`:${l}`]=u,!1}return r.length===0||(r[r.length-1].tokens.push(o),!1)});let i=new t.Token("footnote_block_open","",1);i.meta={separatorClass:"footnotes-sep",listClass:"footnotes-list"},i.attrJoin("class","footnotes"),Gi(i,e.containerAttrs),t.tokens.push(i);let a=s.length;for(let o=0;o<a;o++){let l=new t.Token("footnote_open","",1),u=qc(t.env.docId,o);if(l.meta={id:o,label:s[o].label},l.attrSet("id",`footnote${u}`),l.attrJoin("class","footnote-item"),Gi(l,e.itemAttrs),t.tokens.push(l),s[o].tokens){let f=new t.Token("paragraph_open","p",1);f.block=!0;let p=new t.Token("inline","",0);p.children=s[o].tokens,p.content=s[o].content;let g=new t.Token("paragraph_close","p",-1);g.block=!0,t.tokens.push(f,p,g)}else{let f=n[`:${s[o].label}`];f&&t.tokens.push(...f)}let d=t.tokens[t.tokens.length-1].type==="paragraph_close"?t.tokens.pop():null;for(let f=0;f<(Number(s[o].count)>0?s[o].count:1);f++){let p=new t.Token("footnote_anchor","",0);p.meta={id:o,subId:f,label:s[o].label,text:"↩︎"},p.attrSet("href",`#footnote-ref${u}${Eo(f)}`),p.attrJoin("class","footnote-backref"),Gi(p,e.backrefAttrs),t.tokens.push(p)}d&&t.tokens.push(d),t.tokens.push(new t.Token("footnote_close","",-1))}t.tokens.push(new t.Token("footnote_block_close","",-1))},Pc=(e,t)=>{Sn(e,"footnoteTail","core")||(e.renderer.rules.footnote_ref=pg,e.renderer.rules.footnote_block_open=gg,e.renderer.rules.footnote_block_close=bg,e.renderer.rules.footnote_open=vg,e.renderer.rules.footnote_close=yg,e.renderer.rules.footnote_anchor=wg,e.renderer.rules.footnote_caption=mg,e.block.ruler.before("reference","footnoteDef",kg,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnoteInline",xg(t??{})),e.inline.ruler.after("footnoteInline","footnote_ref",Eg(t??{})),e.core.ruler.after("inline","footnoteTail",Ag(t??{})))};var Uc=(e,t,n)=>{let r=e.attrIndex(t),s=[t,n];r<0?e.attrPush(s):e.attrs[r]=s},Cg=(e)=>e.type==="inline",_g=(e)=>e.type==="paragraph_open",Tg=(e)=>e.type==="list_item_open",Sg=(e)=>{let t=e.content;if(t.length<4||t.charCodeAt(0)!==91||t.charCodeAt(2)!==93)return!1;let n=t.charCodeAt(3);if(n!==32&&n!==160)return!1;let r=t.charCodeAt(1);return r===120||r===88?"checked":r===32||r===160},Rg=(e)=>{e[0].type==="text"?e[0].content=e[0].content.slice(4):(e.splice(0,3),e[0].content=e[0].content.slice(1))},Wc=(e,t={})=>{if(Sn(e,"task_list","core"))return;let{disabled:n=!0,label:r=!0,containerClass:s="task-list-container",itemClass:i="task-list-item",checkboxClass:a="task-list-item-checkbox",labelClass:o="task-list-item-label"}=t;e.core.ruler.after("inline","task_list",(l)=>{let u=l.tokens,d=[];for(let f=0;f<u.length;f++){let p=u[f];if(d[p.level]=f,f<2||!Cg(p)||!_g(u[f-1])||!Tg(u[f-2]))continue;let g=Sg(p);if(g===!1)continue;p.children??=[],Rg(p.children);let b=new l.Token("checkbox_input","input",0);if(b.attrs=[["type","checkbox"],["class",a]],g==="checked"&&b.attrs.push(["checked","checked"]),n&&b.attrs.push(["disabled","disabled"]),p.children.unshift(b),r){let x=new l.Token("label_open","label",1);x.attrs=[["class",o]],p.children.unshift(x),p.children.push(new l.Token("label_close","label",-1))}Uc(u[f-2],"class",i),Uc(u[d[u[f-2].level-1]],"class",s)}})};var Mg=String.raw`\[`,Dg=String.raw`\(`,jc=(e,t,n=0)=>{let r=0,s=t-1;for(;s>=n&&e.charCodeAt(s)===92;)r++,s--;return r},Vc=(e)=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95,Lg=(e,t,n)=>{let r=e.src.charCodeAt(t-1),s=e.src.charCodeAt(t+1),i=e.md.utils.isSpace;return r!==36&&(t===0||i(r)||!Vc(r))&&(n||!i(s))},Ig=(e,t,n)=>{let r=e.src.charCodeAt(t-1),s=e.src.charCodeAt(t+1),i=e.md.utils.isSpace;return s!==36&&(s==null||i(s)||!Vc(s))&&(n||!i(r))},Ng=(e)=>(t,n)=>{if(n||t.src[t.pos]!=="$")return!1;if(!Lg(t,t.pos,e))return t.pending+="$",t.pos++,!0;let r=t.pos+1,s,i=t.md.utils.isSpace;for(;(r=t.src.indexOf("$",r))!==-1;){if(r>=t.posMax){r=-1;break}for(s=r-1;t.src.charCodeAt(s)===92;)s--;if((r-s)%2==0){r++;continue}if(Ig(t,r,e))break;let o=t.src.charCodeAt(r-1),l=t.src.charCodeAt(r+1);if(!e&&i(o)&&(r+1>=t.posMax||i(l)))r++;else{r=-1;break}}if(r===-1)return t.pending+="$",t.pos+=1,!0;if(r-(t.pos+1)===0)return t.pending+="$$",t.pos+=2,!0;let a=t.push("math_inline","math",0);return a.markup="$",a.content=t.src.slice(t.pos+1,r),t.pos=r+1,!0},Bg=()=>(e,t)=>{let{pos:n,posMax:r}=e;if(t||n+1>=r||e.src.charCodeAt(n)!==92||e.src.charCodeAt(n+1)!==40)return!1;let s=n+2,i=!1;for(;s+1<r;){if(e.src.charCodeAt(s)===92&&e.src.charCodeAt(s+1)===41){if(jc(e.src,n)%2==1)return!1;if(jc(e.src,s,n+2)%2==0){i=!0;break}}s++}if(!i)return!1;let a=e.push("math_inline","math",0);return a.markup=Dg,a.content=e.src.slice(n+2,s),e.pos=s+2,!0},Hs=(e,t,n)=>{let r=e.md.utils.isWhiteSpace,s=t;for(;s>n&&r(e.src.charCodeAt(s-1));)s--;return s},Ao=(e,t,n,r,s)=>n-t>=2&&e.charCodeAt(n-1)===s&&e.charCodeAt(n-2)===r,Gc=new WeakMap,Jc=(e,t,n,r,s)=>{let i=Gc.get(e);if(i&&i.endLine===n&&i.blkIndent===e.blkIndent&&i.close1===r&&i.close2===s&&t>=i.from&&t<i.stop)return-1;let{src:a}=e,o=n;for(let l=t+1;l<n;l++){let u=e.bMarks[l]+e.tShift[l],d=e.eMarks[l];if(u<d&&e.sCount[l]<e.blkIndent){o=l;break}let f=Hs(e,d,u);if(Ao(a,u,f,r,s))return l}return Gc.set(e,{blkIndent:e.blkIndent,close1:r,close2:s,endLine:n,from:t,stop:o}),-1},Og=(e,t,n)=>{let r=e.md.utils.isWhiteSpace;for(let s=t;s<n-1;s++)if(e.src.charCodeAt(s)===36&&e.src.charCodeAt(s+1)===36){for(let i=s+2;i<n;i++)if(!r(e.src.charCodeAt(i)))return!0;break}return!1},zg=(e,t,n,r)=>{let{src:s}=e,i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(s.charCodeAt(i)!==36||s.charCodeAt(i+1)!==36||Og(e,i+2,a))return!1;let o=Hs(e,a,i),l=i+2,u=Ao(s,l,o,36,36),d=u?t:Jc(e,t,n,36,36);if(d===-1)return!1;if(r)return!0;let f=s.slice(l,u?o-2:a),p="";if(!u){let b=e.bMarks[d]+e.tShift[d];p=s.slice(b,Hs(e,e.eMarks[d],b)-2)}e.line=d+1;let g=e.push("math_block","math",0);return g.block=!0,g.content=(f?`${f}
|
|
25
|
+
`:"")+e.getLines(t+1,d,e.sCount[t],!0)+(p?`${p}
|
|
26
|
+
`:""),g.map=[t,e.line],g.markup="$$",!0},Fg=(e,t,n,r)=>{let{src:s}=e,i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(s.charCodeAt(i)!==92||s.charCodeAt(i+1)!==91)return!1;let o=Hs(e,a,i),l=i+2,u=Ao(s,l,o,92,93),d=u?t:Jc(e,t,n,92,93);if(d===-1)return!1;if(r)return!0;let f=s.slice(l,u?o-2:a),p="";if(!u){let b=e.bMarks[d]+e.tShift[d];p=s.slice(b,Hs(e,e.eMarks[d],b)-2)}e.line=d+1;let g=e.push("math_block","math",0);return g.block=!0,g.content=(f?`${f}
|
|
27
|
+
`:"")+e.getLines(t+1,d,e.sCount[t],!0)+(p?`${p}
|
|
28
|
+
`:""),g.map=[t,e.line],g.markup=Mg,!0},Kc={alt:["paragraph","reference","blockquote","list"]},Zc=(e,t)=>{if(typeof t?.render!="function")throw TypeError('[@mdit/plugin-tex]: "render" option should be a function');let{allowInlineWithSpace:n=!1,mathFence:r=!1,delimiters:s="dollars",render:i}=t;if(!(Sn(e,"math_inline_dollar","inline")||Sn(e,"math_block_dollar","block")||Sn(e,"math_inline_bracket","inline")||Sn(e,"math_block_bracket","block"))){if(r){let a=e.renderer.rules.fence;e.renderer.rules.fence=(o,l,u,d,f)=>{let p=o[l];return p.info.trim()==="math"?i(p.content,!0,d):a(o,l,u,d,f)}}(s==="dollars"||s==="all")&&(e.inline.ruler.after("escape","math_inline_dollar",Ng(n)),e.block.ruler.after("blockquote","math_block_dollar",zg,Kc)),(s==="brackets"||s==="all")&&(e.inline.ruler.before("escape","math_inline_bracket",Bg()),e.block.ruler.after("blockquote","math_block_bracket",Fg,Kc)),e.renderer.rules.math_inline=(a,o,l,u)=>i(a[o].content,!1,u),e.renderer.rules.math_block=(a,o,l,u)=>i(a[o].content,!0,u)}};class te extends Error{constructor(e,t){var n="KaTeX parse error: "+e,r,s,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;if(r=i.start,s=i.end,r===a.length)n+=" at end of input: ";else n+=" at position "+(r+1)+": ";var o=a.slice(r,s).replace(/[^]/g,"$&̲"),l;if(r>15)l="…"+a.slice(r-15,r);else l=a.slice(0,r);var u;if(s+15<a.length)u=a.slice(s,s+15)+"…";else u=a.slice(s);n+=l+o+u}super(n);if(this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,te.prototype),this.position=r,r!=null&&s!=null)this.length=s-r;this.rawMessage=e}}var $g=/([A-Z])/g,qg=(e)=>e.replace($g,"-$1").toLowerCase(),Hg={"&":"&",">":">","<":"<",'"':""","'":"'"},Pg=/[&><"']/g,At=(e)=>String(e).replace(Pg,(t)=>Hg[t]),Xi=(e)=>{if(e.type==="ordgroup")if(e.body.length===1)return Xi(e.body[0]);else return e;else if(e.type==="color")if(e.body.length===1)return Xi(e.body[0]);else return e;else if(e.type==="font")return Xi(e.body);else return e},Ug=new Set(["mathord","textord","atom"]),Bn=(e)=>Ug.has(Xi(e).type),Wg=(e)=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);if(!t)return"_relative";if(t[2]!==":")return null;if(!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1]))return null;return t[1].toLowerCase()},Oo={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:(e)=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:(e)=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:(e)=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1000,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:(e)=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:(e)=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function jg(e){if(typeof e!=="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw Error("Unexpected schema type; settings must declare an explicit default.")}}function Gg(e){if(Object.prototype.hasOwnProperty.call(e,"default")&&e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return jg(t)}function Kg(e,t,n,r){var s=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,i=Object.prototype.hasOwnProperty.call(r,"processor")?r.processor:void 0;e[t]=s!==void 0?i?i(s):s:Gg(r)}class ia{constructor(e){if(e===void 0)e={};this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t of Object.keys(Oo)){var n=Oo[t];if(n)Kg(this,t,e,n)}}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=Wg(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust==="function"?this.trust(e):this.trust;return Boolean(n)}}class Mn{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return fn[Vg[this.id]]}sub(){return fn[Jg[this.id]]}fracNum(){return fn[Zg[this.id]]}fracDen(){return fn[Yg[this.id]]}cramp(){return fn[Xg[this.id]]}text(){return fn[Qg[this.id]]}isTight(){return this.size>=2}}var tl=0,na=1,Qr=2,In=3,Vs=4,Gt=5,es=6,St=7,fn=[new Mn(tl,0,!1),new Mn(na,0,!0),new Mn(Qr,1,!1),new Mn(In,1,!0),new Mn(Vs,2,!1),new Mn(Gt,2,!0),new Mn(es,3,!1),new Mn(St,3,!0)],Vg=[Vs,Gt,Vs,Gt,es,St,es,St],Jg=[Gt,Gt,Gt,Gt,St,St,St,St],Zg=[Qr,In,Vs,Gt,es,St,es,St],Yg=[In,In,Gt,Gt,St,St,St,St],Xg=[na,na,In,In,Gt,Gt,St,St],Qg=[tl,na,Qr,In,Qr,In,Qr,In],Se={DISPLAY:fn[tl],TEXT:fn[Qr],SCRIPT:fn[Vs],SCRIPTSCRIPT:fn[es]},zo=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function e4(e){for(var t=0;t<zo.length;t++){var n=zo[t];for(var r=0;r<n.blocks.length;r++){var s=n.blocks[r];if(e>=s[0]&&e<=s[1])return n.name}}return null}var Qi=[];zo.forEach((e)=>e.blocks.forEach((t)=>Qi.push(...t)));function Nu(e){for(var t=0;t<Qi.length;t+=2)if(e>=Qi[t]&&e<=Qi[t+1])return!0;return!1}var ut=(e)=>e+" "+e,Zr=80,t4=function(t,n){return"M95,"+(622+t+n)+`
|
|
29
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
30
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
31
|
+
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
32
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
33
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
34
|
+
l`+t/2.075+" -"+t+`
|
|
35
|
+
c5.3,-9.3,12,-14,20,-14
|
|
36
|
+
H400000v`+(40+t)+`H845.2724
|
|
37
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
38
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
39
|
+
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},n4=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
|
40
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
41
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
42
|
+
l`+t/2.084+" -"+t+`
|
|
43
|
+
c4.7,-7.3,11,-11,19,-11
|
|
44
|
+
H40000v`+(40+t)+`H1012.3
|
|
45
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
46
|
+
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
47
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
48
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
49
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},r4=function(t,n){return"M983 "+(10+t+n)+`
|
|
50
|
+
l`+t/3.13+" -"+t+`
|
|
51
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
52
|
+
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
53
|
+
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
54
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
55
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
56
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
57
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
58
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},s4=function(t,n){return"M424,"+(2398+t+n)+`
|
|
59
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
60
|
+
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
61
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
62
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
63
|
+
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|
64
|
+
v`+(40+t)+`H1014.6
|
|
65
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
66
|
+
c-2,6,-10,9,-24,9
|
|
67
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
|
68
|
+
h400000v`+(40+t)+"h-400000z"},i4=function(t,n){return"M473,"+(2713+t+n)+`
|
|
69
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
70
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
71
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
72
|
+
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
73
|
+
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
74
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
75
|
+
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},a4=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},o4=function(t,n,r){var s=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
|
76
|
+
H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
77
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
78
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
79
|
+
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},l4=function(t,n,r){n=1000*n;var s="";switch(t){case"sqrtMain":s=t4(n,Zr);break;case"sqrtSize1":s=n4(n,Zr);break;case"sqrtSize2":s=r4(n,Zr);break;case"sqrtSize3":s=s4(n,Zr);break;case"sqrtSize4":s=i4(n,Zr);break;case"sqrtTall":s=o4(n,Zr,r)}return s},c4=function(t,n){switch(t){case"⎜":return ut("M291 0 H417 V"+n+" H291z");case"∣":return ut("M145 0 H188 V"+n+" H145z");case"∥":return ut("M145 0 H188 V"+n+" H145z")+ut("M367 0 H410 V"+n+" H367z");case"⎟":return ut("M457 0 H583 V"+n+" H457z");case"⎢":return ut("M319 0 H403 V"+n+" H319z");case"⎥":return ut("M263 0 H347 V"+n+" H263z");case"⎪":return ut("M384 0 H504 V"+n+" H384z");case"⏐":return ut("M312 0 H355 V"+n+" H312z");case"‖":return ut("M257 0 H300 V"+n+" H257z")+ut("M478 0 H521 V"+n+" H478z");default:return""}},Yc={doubleleftarrow:`M262 157
|
|
80
|
+
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
81
|
+
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
82
|
+
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
83
|
+
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
84
|
+
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
85
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
86
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
87
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
88
|
+
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
89
|
+
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
90
|
+
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
91
|
+
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
92
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
93
|
+
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
94
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
95
|
+
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
96
|
+
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
97
|
+
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
98
|
+
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
99
|
+
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
100
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
101
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
102
|
+
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
103
|
+
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
104
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
105
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
106
|
+
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
107
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
108
|
+
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
109
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
110
|
+
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
111
|
+
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
112
|
+
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
113
|
+
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
114
|
+
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
115
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
116
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
117
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
118
|
+
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
119
|
+
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
120
|
+
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
121
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
122
|
+
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
123
|
+
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
124
|
+
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
125
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:ut("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:ut("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:ut("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:ut("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
126
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
127
|
+
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
128
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:ut("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
129
|
+
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
130
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
131
|
+
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
132
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
133
|
+
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
134
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
135
|
+
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
136
|
+
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
137
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
138
|
+
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
139
|
+
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
140
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
141
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
142
|
+
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
143
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
144
|
+
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
145
|
+
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
146
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
147
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
148
|
+
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
149
|
+
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
150
|
+
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
151
|
+
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
152
|
+
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
153
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
154
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
155
|
+
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
156
|
+
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
157
|
+
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
158
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
159
|
+
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
160
|
+
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
161
|
+
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
162
|
+
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
163
|
+
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
164
|
+
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
165
|
+
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
166
|
+
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
167
|
+
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
168
|
+
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
169
|
+
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
170
|
+
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
171
|
+
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
172
|
+
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
173
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
174
|
+
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
175
|
+
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
176
|
+
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
177
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:ut("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:ut("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:ut("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
178
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
179
|
+
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
180
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
181
|
+
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
182
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
183
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
184
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
185
|
+
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
186
|
+
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
187
|
+
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
188
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
189
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
190
|
+
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
191
|
+
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
192
|
+
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
193
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
194
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
195
|
+
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
196
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
197
|
+
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
198
|
+
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
199
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
200
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
201
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
202
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
203
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
204
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
205
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
206
|
+
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
207
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
208
|
+
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
209
|
+
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
210
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
211
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
212
|
+
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
213
|
+
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
214
|
+
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
215
|
+
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
216
|
+
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
217
|
+
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
218
|
+
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
219
|
+
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
220
|
+
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
221
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
222
|
+
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
223
|
+
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
224
|
+
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
225
|
+
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
226
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
227
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
228
|
+
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
229
|
+
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
230
|
+
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
231
|
+
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
232
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
233
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
234
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
235
|
+
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
236
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
237
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
238
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
239
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
240
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
241
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
242
|
+
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
243
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
244
|
+
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
245
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
246
|
+
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
247
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
248
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
249
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
250
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},u4=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
251
|
+
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
252
|
+
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
253
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
254
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
255
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
256
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
257
|
+
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
258
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
259
|
+
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|
260
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
261
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
262
|
+
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
263
|
+
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
264
|
+
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
265
|
+
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
266
|
+
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
267
|
+
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
268
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
269
|
+
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
270
|
+
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
271
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
272
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
273
|
+
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
274
|
+
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
275
|
+
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
276
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
277
|
+
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
278
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error("Unknown stretchy delimiter.")}};function d4(e){return"toText"in e}class Ar{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createDocumentFragment();for(var t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){var e="";for(var t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e)=>{if(d4(e))return e.toText();throw Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var Fo={pt:1,mm:2.8452755905511813,cm:28.45275590551181,in:72.27,bp:1.00375,pc:12,dd:1.070008643042351,cc:12.84010371650821,nd:1.0669781931464175,nc:12.80373831775701,sp:0.0000152587890625,px:1.00375},h4={ex:!0,em:!0,mu:!0},Bu=function(t){if(typeof t!=="string")t=t.unit;return t in Fo||t in h4||t==="ex"},et=function(t,n){var r;if(t.unit in Fo)r=Fo[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight())s=n.havingStyle(n.style.text());else s=n;if(t.unit==="ex")r=s.fontMetrics().xHeight;else if(t.unit==="em")r=s.fontMetrics().quad;else throw new te("Invalid unit: '"+t.unit+"'");if(s!==n)r*=s.sizeMultiplier/n.sizeMultiplier}return Math.min(t.number*r,n.maxSize)},ae=function(t){return+t.toFixed(4)+"em"},rr=function(t){return t.filter((n)=>n).join(" ")},nl=function(t){var n="";for(var r of Object.keys(t)){var s=t[r];if(s!==void 0)n+=qg(r)+":"+s+";"}return n},Ou=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){if(n.style.isTight())this.classes.push("mtight");var s=n.getColor();if(s)this.style.color=s}},zu=function(t){var n=document.createElement(t);n.className=rr(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},f4=/[\s"'>/=\x00-\x1f]/,Fu=function(t){var n="<"+t;if(this.classes.length)n+=' class="'+At(rr(this.classes))+'"';var r=nl(this.style);if(r)n+=' style="'+At(r)+'"';for(var s of Object.keys(this.attributes)){if(f4.test(s))throw new te("Invalid attribute name '"+s+"'");n+=" "+s+'="'+At(this.attributes[s])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+t+">",n};class Cr{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Ou.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return zu.call(this,"span")}toMarkup(){return Fu.call(this,"span")}}class Qs{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Ou.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return zu.call(this,"a")}toMarkup(){return Fu.call(this,"a")}}class $u{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+At(this.src)+'"'+(' alt="'+At(this.alt)+'"'),t=nl(this.style);if(t)e+=' style="'+At(t)+'"';return e+="'/>",e}}var m4={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class zt{constructor(e,t,n,r,s,i,a,o){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=s||0,this.width=i||0,this.classes=a||[],this.style=o||{},this.maxFontSize=0;var l=e4(this.text.charCodeAt(0));if(l)this.classes.push(l+"_fallback");if(/[îïíì]/.test(this.text))this.text=m4[this.text]}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;if(this.italic>0)t=document.createElement("span"),t.style.marginRight=ae(this.italic);if(this.classes.length>0)t=t||document.createElement("span"),t.className=rr(this.classes);if(Object.keys(this.style).length>0)t=t||document.createElement("span"),Object.assign(t.style,this.style);if(t)return t.appendChild(e),t;else return e}toMarkup(){var e=!1,t="<span";if(this.classes.length)e=!0,t+=' class="',t+=At(rr(this.classes)),t+='"';var n="";if(this.italic>0)n+="margin-right:"+ae(this.italic)+";";if(n+=nl(this.style),n)e=!0,t+=' style="'+At(n)+'"';var r=At(this.text);if(e)return t+=">",t+=r,t+="</span>",t;else return r}}class pn{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+At(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class Nn{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");if(this.alternate)t.setAttribute("d",this.alternate);else t.setAttribute("d",Yc[this.pathName]);return t}toMarkup(){if(this.alternate)return'<path d="'+At(this.alternate)+'"/>';else return'<path d="'+At(Yc[this.pathName])+'"/>'}}class ra{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+At(this.attributes[t])+'"';return e+="/>",e}}function p4(e){if(e instanceof zt)return e;else throw Error("Expected symbolNode but got "+String(e)+".")}function g4(e){if(e instanceof Cr)return e;else throw Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var b4=(e)=>e instanceof Cr||e instanceof Qs||e instanceof Ar,mn={"AMS-Regular":{"32":[0,0,0,0,0.25],"65":[0,0.68889,0,0,0.72222],"66":[0,0.68889,0,0,0.66667],"67":[0,0.68889,0,0,0.72222],"68":[0,0.68889,0,0,0.72222],"69":[0,0.68889,0,0,0.66667],"70":[0,0.68889,0,0,0.61111],"71":[0,0.68889,0,0,0.77778],"72":[0,0.68889,0,0,0.77778],"73":[0,0.68889,0,0,0.38889],"74":[0.16667,0.68889,0,0,0.5],"75":[0,0.68889,0,0,0.77778],"76":[0,0.68889,0,0,0.66667],"77":[0,0.68889,0,0,0.94445],"78":[0,0.68889,0,0,0.72222],"79":[0.16667,0.68889,0,0,0.77778],"80":[0,0.68889,0,0,0.61111],"81":[0.16667,0.68889,0,0,0.77778],"82":[0,0.68889,0,0,0.72222],"83":[0,0.68889,0,0,0.55556],"84":[0,0.68889,0,0,0.66667],"85":[0,0.68889,0,0,0.72222],"86":[0,0.68889,0,0,0.72222],"87":[0,0.68889,0,0,1],"88":[0,0.68889,0,0,0.72222],"89":[0,0.68889,0,0,0.72222],"90":[0,0.68889,0,0,0.66667],"107":[0,0.68889,0,0,0.55556],"160":[0,0,0,0,0.25],"165":[0,0.675,0.025,0,0.75],"174":[0.15559,0.69224,0,0,0.94666],"240":[0,0.68889,0,0,0.55556],"295":[0,0.68889,0,0,0.54028],"710":[0,0.825,0,0,2.33334],"732":[0,0.9,0,0,2.33334],"770":[0,0.825,0,0,2.33334],"771":[0,0.9,0,0,2.33334],"989":[0.08167,0.58167,0,0,0.77778],"1008":[0,0.43056,0.04028,0,0.66667],"8245":[0,0.54986,0,0,0.275],"8463":[0,0.68889,0,0,0.54028],"8487":[0,0.68889,0,0,0.72222],"8498":[0,0.68889,0,0,0.55556],"8502":[0,0.68889,0,0,0.66667],"8503":[0,0.68889,0,0,0.44445],"8504":[0,0.68889,0,0,0.66667],"8513":[0,0.68889,0,0,0.63889],"8592":[-0.03598,0.46402,0,0,0.5],"8594":[-0.03598,0.46402,0,0,0.5],"8602":[-0.13313,0.36687,0,0,1],"8603":[-0.13313,0.36687,0,0,1],"8606":[0.01354,0.52239,0,0,1],"8608":[0.01354,0.52239,0,0,1],"8610":[0.01354,0.52239,0,0,1.11111],"8611":[0.01354,0.52239,0,0,1.11111],"8619":[0,0.54986,0,0,1],"8620":[0,0.54986,0,0,1],"8621":[-0.13313,0.37788,0,0,1.38889],"8622":[-0.13313,0.36687,0,0,1],"8624":[0,0.69224,0,0,0.5],"8625":[0,0.69224,0,0,0.5],"8630":[0,0.43056,0,0,1],"8631":[0,0.43056,0,0,1],"8634":[0.08198,0.58198,0,0,0.77778],"8635":[0.08198,0.58198,0,0,0.77778],"8638":[0.19444,0.69224,0,0,0.41667],"8639":[0.19444,0.69224,0,0,0.41667],"8642":[0.19444,0.69224,0,0,0.41667],"8643":[0.19444,0.69224,0,0,0.41667],"8644":[0.1808,0.675,0,0,1],"8646":[0.1808,0.675,0,0,1],"8647":[0.1808,0.675,0,0,1],"8648":[0.19444,0.69224,0,0,0.83334],"8649":[0.1808,0.675,0,0,1],"8650":[0.19444,0.69224,0,0,0.83334],"8651":[0.01354,0.52239,0,0,1],"8652":[0.01354,0.52239,0,0,1],"8653":[-0.13313,0.36687,0,0,1],"8654":[-0.13313,0.36687,0,0,1],"8655":[-0.13313,0.36687,0,0,1],"8666":[0.13667,0.63667,0,0,1],"8667":[0.13667,0.63667,0,0,1],"8669":[-0.13313,0.37788,0,0,1],"8672":[-0.064,0.437,0,0,1.334],"8674":[-0.064,0.437,0,0,1.334],"8705":[0,0.825,0,0,0.5],"8708":[0,0.68889,0,0,0.55556],"8709":[0.08167,0.58167,0,0,0.77778],"8717":[0,0.43056,0,0,0.42917],"8722":[-0.03598,0.46402,0,0,0.5],"8724":[0.08198,0.69224,0,0,0.77778],"8726":[0.08167,0.58167,0,0,0.77778],"8733":[0,0.69224,0,0,0.77778],"8736":[0,0.69224,0,0,0.72222],"8737":[0,0.69224,0,0,0.72222],"8738":[0.03517,0.52239,0,0,0.72222],"8739":[0.08167,0.58167,0,0,0.22222],"8740":[0.25142,0.74111,0,0,0.27778],"8741":[0.08167,0.58167,0,0,0.38889],"8742":[0.25142,0.74111,0,0,0.5],"8756":[0,0.69224,0,0,0.66667],"8757":[0,0.69224,0,0,0.66667],"8764":[-0.13313,0.36687,0,0,0.77778],"8765":[-0.13313,0.37788,0,0,0.77778],"8769":[-0.13313,0.36687,0,0,0.77778],"8770":[-0.03625,0.46375,0,0,0.77778],"8774":[0.30274,0.79383,0,0,0.77778],"8776":[-0.01688,0.48312,0,0,0.77778],"8778":[0.08167,0.58167,0,0,0.77778],"8782":[0.06062,0.54986,0,0,0.77778],"8783":[0.06062,0.54986,0,0,0.77778],"8785":[0.08198,0.58198,0,0,0.77778],"8786":[0.08198,0.58198,0,0,0.77778],"8787":[0.08198,0.58198,0,0,0.77778],"8790":[0,0.69224,0,0,0.77778],"8791":[0.22958,0.72958,0,0,0.77778],"8796":[0.08198,0.91667,0,0,0.77778],"8806":[0.25583,0.75583,0,0,0.77778],"8807":[0.25583,0.75583,0,0,0.77778],"8808":[0.25142,0.75726,0,0,0.77778],"8809":[0.25142,0.75726,0,0,0.77778],"8812":[0.25583,0.75583,0,0,0.5],"8814":[0.20576,0.70576,0,0,0.77778],"8815":[0.20576,0.70576,0,0,0.77778],"8816":[0.30274,0.79383,0,0,0.77778],"8817":[0.30274,0.79383,0,0,0.77778],"8818":[0.22958,0.72958,0,0,0.77778],"8819":[0.22958,0.72958,0,0,0.77778],"8822":[0.1808,0.675,0,0,0.77778],"8823":[0.1808,0.675,0,0,0.77778],"8828":[0.13667,0.63667,0,0,0.77778],"8829":[0.13667,0.63667,0,0,0.77778],"8830":[0.22958,0.72958,0,0,0.77778],"8831":[0.22958,0.72958,0,0,0.77778],"8832":[0.20576,0.70576,0,0,0.77778],"8833":[0.20576,0.70576,0,0,0.77778],"8840":[0.30274,0.79383,0,0,0.77778],"8841":[0.30274,0.79383,0,0,0.77778],"8842":[0.13597,0.63597,0,0,0.77778],"8843":[0.13597,0.63597,0,0,0.77778],"8847":[0.03517,0.54986,0,0,0.77778],"8848":[0.03517,0.54986,0,0,0.77778],"8858":[0.08198,0.58198,0,0,0.77778],"8859":[0.08198,0.58198,0,0,0.77778],"8861":[0.08198,0.58198,0,0,0.77778],"8862":[0,0.675,0,0,0.77778],"8863":[0,0.675,0,0,0.77778],"8864":[0,0.675,0,0,0.77778],"8865":[0,0.675,0,0,0.77778],"8872":[0,0.69224,0,0,0.61111],"8873":[0,0.69224,0,0,0.72222],"8874":[0,0.69224,0,0,0.88889],"8876":[0,0.68889,0,0,0.61111],"8877":[0,0.68889,0,0,0.61111],"8878":[0,0.68889,0,0,0.72222],"8879":[0,0.68889,0,0,0.72222],"8882":[0.03517,0.54986,0,0,0.77778],"8883":[0.03517,0.54986,0,0,0.77778],"8884":[0.13667,0.63667,0,0,0.77778],"8885":[0.13667,0.63667,0,0,0.77778],"8888":[0,0.54986,0,0,1.11111],"8890":[0.19444,0.43056,0,0,0.55556],"8891":[0.19444,0.69224,0,0,0.61111],"8892":[0.19444,0.69224,0,0,0.61111],"8901":[0,0.54986,0,0,0.27778],"8903":[0.08167,0.58167,0,0,0.77778],"8905":[0.08167,0.58167,0,0,0.77778],"8906":[0.08167,0.58167,0,0,0.77778],"8907":[0,0.69224,0,0,0.77778],"8908":[0,0.69224,0,0,0.77778],"8909":[-0.03598,0.46402,0,0,0.77778],"8910":[0,0.54986,0,0,0.76042],"8911":[0,0.54986,0,0,0.76042],"8912":[0.03517,0.54986,0,0,0.77778],"8913":[0.03517,0.54986,0,0,0.77778],"8914":[0,0.54986,0,0,0.66667],"8915":[0,0.54986,0,0,0.66667],"8916":[0,0.69224,0,0,0.66667],"8918":[0.0391,0.5391,0,0,0.77778],"8919":[0.0391,0.5391,0,0,0.77778],"8920":[0.03517,0.54986,0,0,1.33334],"8921":[0.03517,0.54986,0,0,1.33334],"8922":[0.38569,0.88569,0,0,0.77778],"8923":[0.38569,0.88569,0,0,0.77778],"8926":[0.13667,0.63667,0,0,0.77778],"8927":[0.13667,0.63667,0,0,0.77778],"8928":[0.30274,0.79383,0,0,0.77778],"8929":[0.30274,0.79383,0,0,0.77778],"8934":[0.23222,0.74111,0,0,0.77778],"8935":[0.23222,0.74111,0,0,0.77778],"8936":[0.23222,0.74111,0,0,0.77778],"8937":[0.23222,0.74111,0,0,0.77778],"8938":[0.20576,0.70576,0,0,0.77778],"8939":[0.20576,0.70576,0,0,0.77778],"8940":[0.30274,0.79383,0,0,0.77778],"8941":[0.30274,0.79383,0,0,0.77778],"8994":[0.19444,0.69224,0,0,0.77778],"8995":[0.19444,0.69224,0,0,0.77778],"9416":[0.15559,0.69224,0,0,0.90222],"9484":[0,0.69224,0,0,0.5],"9488":[0,0.69224,0,0,0.5],"9492":[0,0.37788,0,0,0.5],"9496":[0,0.37788,0,0,0.5],"9585":[0.19444,0.68889,0,0,0.88889],"9586":[0.19444,0.74111,0,0,0.88889],"9632":[0,0.675,0,0,0.77778],"9633":[0,0.675,0,0,0.77778],"9650":[0,0.54986,0,0,0.72222],"9651":[0,0.54986,0,0,0.72222],"9654":[0.03517,0.54986,0,0,0.77778],"9660":[0,0.54986,0,0,0.72222],"9661":[0,0.54986,0,0,0.72222],"9664":[0.03517,0.54986,0,0,0.77778],"9674":[0.11111,0.69224,0,0,0.66667],"9733":[0.19444,0.69224,0,0,0.94445],"10003":[0,0.69224,0,0,0.83334],"10016":[0,0.69224,0,0,0.83334],"10731":[0.11111,0.69224,0,0,0.66667],"10846":[0.19444,0.75583,0,0,0.61111],"10877":[0.13667,0.63667,0,0,0.77778],"10878":[0.13667,0.63667,0,0,0.77778],"10885":[0.25583,0.75583,0,0,0.77778],"10886":[0.25583,0.75583,0,0,0.77778],"10887":[0.13597,0.63597,0,0,0.77778],"10888":[0.13597,0.63597,0,0,0.77778],"10889":[0.26167,0.75726,0,0,0.77778],"10890":[0.26167,0.75726,0,0,0.77778],"10891":[0.48256,0.98256,0,0,0.77778],"10892":[0.48256,0.98256,0,0,0.77778],"10901":[0.13667,0.63667,0,0,0.77778],"10902":[0.13667,0.63667,0,0,0.77778],"10933":[0.25142,0.75726,0,0,0.77778],"10934":[0.25142,0.75726,0,0,0.77778],"10935":[0.26167,0.75726,0,0,0.77778],"10936":[0.26167,0.75726,0,0,0.77778],"10937":[0.26167,0.75726,0,0,0.77778],"10938":[0.26167,0.75726,0,0,0.77778],"10949":[0.25583,0.75583,0,0,0.77778],"10950":[0.25583,0.75583,0,0,0.77778],"10955":[0.28481,0.79383,0,0,0.77778],"10956":[0.28481,0.79383,0,0,0.77778],"57350":[0.08167,0.58167,0,0,0.22222],"57351":[0.08167,0.58167,0,0,0.38889],"57352":[0.08167,0.58167,0,0,0.77778],"57353":[0,0.43056,0.04028,0,0.66667],"57356":[0.25142,0.75726,0,0,0.77778],"57357":[0.25142,0.75726,0,0,0.77778],"57358":[0.41951,0.91951,0,0,0.77778],"57359":[0.30274,0.79383,0,0,0.77778],"57360":[0.30274,0.79383,0,0,0.77778],"57361":[0.41951,0.91951,0,0,0.77778],"57366":[0.25142,0.75726,0,0,0.77778],"57367":[0.25142,0.75726,0,0,0.77778],"57368":[0.25142,0.75726,0,0,0.77778],"57369":[0.25142,0.75726,0,0,0.77778],"57370":[0.13597,0.63597,0,0,0.77778],"57371":[0.13597,0.63597,0,0,0.77778]},"Caligraphic-Regular":{"32":[0,0,0,0,0.25],"65":[0,0.68333,0,0.19445,0.79847],"66":[0,0.68333,0.03041,0.13889,0.65681],"67":[0,0.68333,0.05834,0.13889,0.52653],"68":[0,0.68333,0.02778,0.08334,0.77139],"69":[0,0.68333,0.08944,0.11111,0.52778],"70":[0,0.68333,0.09931,0.11111,0.71875],"71":[0.09722,0.68333,0.0593,0.11111,0.59487],"72":[0,0.68333,0.00965,0.11111,0.84452],"73":[0,0.68333,0.07382,0,0.54452],"74":[0.09722,0.68333,0.18472,0.16667,0.67778],"75":[0,0.68333,0.01445,0.05556,0.76195],"76":[0,0.68333,0,0.13889,0.68972],"77":[0,0.68333,0,0.13889,1.2009],"78":[0,0.68333,0.14736,0.08334,0.82049],"79":[0,0.68333,0.02778,0.11111,0.79611],"80":[0,0.68333,0.08222,0.08334,0.69556],"81":[0.09722,0.68333,0,0.11111,0.81667],"82":[0,0.68333,0,0.08334,0.8475],"83":[0,0.68333,0.075,0.13889,0.60556],"84":[0,0.68333,0.25417,0,0.54464],"85":[0,0.68333,0.09931,0.08334,0.62583],"86":[0,0.68333,0.08222,0,0.61278],"87":[0,0.68333,0.08222,0.08334,0.98778],"88":[0,0.68333,0.14643,0.13889,0.7133],"89":[0.09722,0.68333,0.08222,0.08334,0.66834],"90":[0,0.68333,0.07944,0.13889,0.72473],"160":[0,0,0,0,0.25]},"Fraktur-Regular":{"32":[0,0,0,0,0.25],"33":[0,0.69141,0,0,0.29574],"34":[0,0.69141,0,0,0.21471],"38":[0,0.69141,0,0,0.73786],"39":[0,0.69141,0,0,0.21201],"40":[0.24982,0.74947,0,0,0.38865],"41":[0.24982,0.74947,0,0,0.38865],"42":[0,0.62119,0,0,0.27764],"43":[0.08319,0.58283,0,0,0.75623],"44":[0,0.10803,0,0,0.27764],"45":[0.08319,0.58283,0,0,0.75623],"46":[0,0.10803,0,0,0.27764],"47":[0.24982,0.74947,0,0,0.50181],"48":[0,0.47534,0,0,0.50181],"49":[0,0.47534,0,0,0.50181],"50":[0,0.47534,0,0,0.50181],"51":[0.18906,0.47534,0,0,0.50181],"52":[0.18906,0.47534,0,0,0.50181],"53":[0.18906,0.47534,0,0,0.50181],"54":[0,0.69141,0,0,0.50181],"55":[0.18906,0.47534,0,0,0.50181],"56":[0,0.69141,0,0,0.50181],"57":[0.18906,0.47534,0,0,0.50181],"58":[0,0.47534,0,0,0.21606],"59":[0.12604,0.47534,0,0,0.21606],"61":[-0.13099,0.36866,0,0,0.75623],"63":[0,0.69141,0,0,0.36245],"65":[0,0.69141,0,0,0.7176],"66":[0,0.69141,0,0,0.88397],"67":[0,0.69141,0,0,0.61254],"68":[0,0.69141,0,0,0.83158],"69":[0,0.69141,0,0,0.66278],"70":[0.12604,0.69141,0,0,0.61119],"71":[0,0.69141,0,0,0.78539],"72":[0.06302,0.69141,0,0,0.7203],"73":[0,0.69141,0,0,0.55448],"74":[0.12604,0.69141,0,0,0.55231],"75":[0,0.69141,0,0,0.66845],"76":[0,0.69141,0,0,0.66602],"77":[0,0.69141,0,0,1.04953],"78":[0,0.69141,0,0,0.83212],"79":[0,0.69141,0,0,0.82699],"80":[0.18906,0.69141,0,0,0.82753],"81":[0.03781,0.69141,0,0,0.82699],"82":[0,0.69141,0,0,0.82807],"83":[0,0.69141,0,0,0.82861],"84":[0,0.69141,0,0,0.66899],"85":[0,0.69141,0,0,0.64576],"86":[0,0.69141,0,0,0.83131],"87":[0,0.69141,0,0,1.04602],"88":[0,0.69141,0,0,0.71922],"89":[0.18906,0.69141,0,0,0.83293],"90":[0.12604,0.69141,0,0,0.60201],"91":[0.24982,0.74947,0,0,0.27764],"93":[0.24982,0.74947,0,0,0.27764],"94":[0,0.69141,0,0,0.49965],"97":[0,0.47534,0,0,0.50046],"98":[0,0.69141,0,0,0.51315],"99":[0,0.47534,0,0,0.38946],"100":[0,0.62119,0,0,0.49857],"101":[0,0.47534,0,0,0.40053],"102":[0.18906,0.69141,0,0,0.32626],"103":[0.18906,0.47534,0,0,0.5037],"104":[0.18906,0.69141,0,0,0.52126],"105":[0,0.69141,0,0,0.27899],"106":[0,0.69141,0,0,0.28088],"107":[0,0.69141,0,0,0.38946],"108":[0,0.69141,0,0,0.27953],"109":[0,0.47534,0,0,0.76676],"110":[0,0.47534,0,0,0.52666],"111":[0,0.47534,0,0,0.48885],"112":[0.18906,0.52396,0,0,0.50046],"113":[0.18906,0.47534,0,0,0.48912],"114":[0,0.47534,0,0,0.38919],"115":[0,0.47534,0,0,0.44266],"116":[0,0.62119,0,0,0.33301],"117":[0,0.47534,0,0,0.5172],"118":[0,0.52396,0,0,0.5118],"119":[0,0.52396,0,0,0.77351],"120":[0.18906,0.47534,0,0,0.38865],"121":[0.18906,0.47534,0,0,0.49884],"122":[0.18906,0.47534,0,0,0.39054],"160":[0,0,0,0,0.25],"8216":[0,0.69141,0,0,0.21471],"8217":[0,0.69141,0,0,0.21471],"58112":[0,0.62119,0,0,0.49749],"58113":[0,0.62119,0,0,0.4983],"58114":[0.18906,0.69141,0,0,0.33328],"58115":[0.18906,0.69141,0,0,0.32923],"58116":[0.18906,0.47534,0,0,0.50343],"58117":[0,0.69141,0,0,0.33301],"58118":[0,0.62119,0,0,0.33409],"58119":[0,0.47534,0,0,0.50073]},"Main-Bold":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0,0,0.35],"34":[0,0.69444,0,0,0.60278],"35":[0.19444,0.69444,0,0,0.95833],"36":[0.05556,0.75,0,0,0.575],"37":[0.05556,0.75,0,0,0.95833],"38":[0,0.69444,0,0,0.89444],"39":[0,0.69444,0,0,0.31944],"40":[0.25,0.75,0,0,0.44722],"41":[0.25,0.75,0,0,0.44722],"42":[0,0.75,0,0,0.575],"43":[0.13333,0.63333,0,0,0.89444],"44":[0.19444,0.15556,0,0,0.31944],"45":[0,0.44444,0,0,0.38333],"46":[0,0.15556,0,0,0.31944],"47":[0.25,0.75,0,0,0.575],"48":[0,0.64444,0,0,0.575],"49":[0,0.64444,0,0,0.575],"50":[0,0.64444,0,0,0.575],"51":[0,0.64444,0,0,0.575],"52":[0,0.64444,0,0,0.575],"53":[0,0.64444,0,0,0.575],"54":[0,0.64444,0,0,0.575],"55":[0,0.64444,0,0,0.575],"56":[0,0.64444,0,0,0.575],"57":[0,0.64444,0,0,0.575],"58":[0,0.44444,0,0,0.31944],"59":[0.19444,0.44444,0,0,0.31944],"60":[0.08556,0.58556,0,0,0.89444],"61":[-0.10889,0.39111,0,0,0.89444],"62":[0.08556,0.58556,0,0,0.89444],"63":[0,0.69444,0,0,0.54305],"64":[0,0.69444,0,0,0.89444],"65":[0,0.68611,0,0,0.86944],"66":[0,0.68611,0,0,0.81805],"67":[0,0.68611,0,0,0.83055],"68":[0,0.68611,0,0,0.88194],"69":[0,0.68611,0,0,0.75555],"70":[0,0.68611,0,0,0.72361],"71":[0,0.68611,0,0,0.90416],"72":[0,0.68611,0,0,0.9],"73":[0,0.68611,0,0,0.43611],"74":[0,0.68611,0,0,0.59444],"75":[0,0.68611,0,0,0.90138],"76":[0,0.68611,0,0,0.69166],"77":[0,0.68611,0,0,1.09166],"78":[0,0.68611,0,0,0.9],"79":[0,0.68611,0,0,0.86388],"80":[0,0.68611,0,0,0.78611],"81":[0.19444,0.68611,0,0,0.86388],"82":[0,0.68611,0,0,0.8625],"83":[0,0.68611,0,0,0.63889],"84":[0,0.68611,0,0,0.8],"85":[0,0.68611,0,0,0.88472],"86":[0,0.68611,0.01597,0,0.86944],"87":[0,0.68611,0.01597,0,1.18888],"88":[0,0.68611,0,0,0.86944],"89":[0,0.68611,0.02875,0,0.86944],"90":[0,0.68611,0,0,0.70277],"91":[0.25,0.75,0,0,0.31944],"92":[0.25,0.75,0,0,0.575],"93":[0.25,0.75,0,0,0.31944],"94":[0,0.69444,0,0,0.575],"95":[0.31,0.13444,0.03194,0,0.575],"97":[0,0.44444,0,0,0.55902],"98":[0,0.69444,0,0,0.63889],"99":[0,0.44444,0,0,0.51111],"100":[0,0.69444,0,0,0.63889],"101":[0,0.44444,0,0,0.52708],"102":[0,0.69444,0.10903,0,0.35139],"103":[0.19444,0.44444,0.01597,0,0.575],"104":[0,0.69444,0,0,0.63889],"105":[0,0.69444,0,0,0.31944],"106":[0.19444,0.69444,0,0,0.35139],"107":[0,0.69444,0,0,0.60694],"108":[0,0.69444,0,0,0.31944],"109":[0,0.44444,0,0,0.95833],"110":[0,0.44444,0,0,0.63889],"111":[0,0.44444,0,0,0.575],"112":[0.19444,0.44444,0,0,0.63889],"113":[0.19444,0.44444,0,0,0.60694],"114":[0,0.44444,0,0,0.47361],"115":[0,0.44444,0,0,0.45361],"116":[0,0.63492,0,0,0.44722],"117":[0,0.44444,0,0,0.63889],"118":[0,0.44444,0.01597,0,0.60694],"119":[0,0.44444,0.01597,0,0.83055],"120":[0,0.44444,0,0,0.60694],"121":[0.19444,0.44444,0.01597,0,0.60694],"122":[0,0.44444,0,0,0.51111],"123":[0.25,0.75,0,0,0.575],"124":[0.25,0.75,0,0,0.31944],"125":[0.25,0.75,0,0,0.575],"126":[0.35,0.34444,0,0,0.575],"160":[0,0,0,0,0.25],"163":[0,0.69444,0,0,0.86853],"168":[0,0.69444,0,0,0.575],"172":[0,0.44444,0,0,0.76666],"176":[0,0.69444,0,0,0.86944],"177":[0.13333,0.63333,0,0,0.89444],"184":[0.17014,0,0,0,0.51111],"198":[0,0.68611,0,0,1.04166],"215":[0.13333,0.63333,0,0,0.89444],"216":[0.04861,0.73472,0,0,0.89444],"223":[0,0.69444,0,0,0.59722],"230":[0,0.44444,0,0,0.83055],"247":[0.13333,0.63333,0,0,0.89444],"248":[0.09722,0.54167,0,0,0.575],"305":[0,0.44444,0,0,0.31944],"338":[0,0.68611,0,0,1.16944],"339":[0,0.44444,0,0,0.89444],"567":[0.19444,0.44444,0,0,0.35139],"710":[0,0.69444,0,0,0.575],"711":[0,0.63194,0,0,0.575],"713":[0,0.59611,0,0,0.575],"714":[0,0.69444,0,0,0.575],"715":[0,0.69444,0,0,0.575],"728":[0,0.69444,0,0,0.575],"729":[0,0.69444,0,0,0.31944],"730":[0,0.69444,0,0,0.86944],"732":[0,0.69444,0,0,0.575],"733":[0,0.69444,0,0,0.575],"915":[0,0.68611,0,0,0.69166],"916":[0,0.68611,0,0,0.95833],"920":[0,0.68611,0,0,0.89444],"923":[0,0.68611,0,0,0.80555],"926":[0,0.68611,0,0,0.76666],"928":[0,0.68611,0,0,0.9],"931":[0,0.68611,0,0,0.83055],"933":[0,0.68611,0,0,0.89444],"934":[0,0.68611,0,0,0.83055],"936":[0,0.68611,0,0,0.89444],"937":[0,0.68611,0,0,0.83055],"8211":[0,0.44444,0.03194,0,0.575],"8212":[0,0.44444,0.03194,0,1.14999],"8216":[0,0.69444,0,0,0.31944],"8217":[0,0.69444,0,0,0.31944],"8220":[0,0.69444,0,0,0.60278],"8221":[0,0.69444,0,0,0.60278],"8224":[0.19444,0.69444,0,0,0.51111],"8225":[0.19444,0.69444,0,0,0.51111],"8242":[0,0.55556,0,0,0.34444],"8407":[0,0.72444,0.15486,0,0.575],"8463":[0,0.69444,0,0,0.66759],"8465":[0,0.69444,0,0,0.83055],"8467":[0,0.69444,0,0,0.47361],"8472":[0.19444,0.44444,0,0,0.74027],"8476":[0,0.69444,0,0,0.83055],"8501":[0,0.69444,0,0,0.70277],"8592":[-0.10889,0.39111,0,0,1.14999],"8593":[0.19444,0.69444,0,0,0.575],"8594":[-0.10889,0.39111,0,0,1.14999],"8595":[0.19444,0.69444,0,0,0.575],"8596":[-0.10889,0.39111,0,0,1.14999],"8597":[0.25,0.75,0,0,0.575],"8598":[0.19444,0.69444,0,0,1.14999],"8599":[0.19444,0.69444,0,0,1.14999],"8600":[0.19444,0.69444,0,0,1.14999],"8601":[0.19444,0.69444,0,0,1.14999],"8636":[-0.10889,0.39111,0,0,1.14999],"8637":[-0.10889,0.39111,0,0,1.14999],"8640":[-0.10889,0.39111,0,0,1.14999],"8641":[-0.10889,0.39111,0,0,1.14999],"8656":[-0.10889,0.39111,0,0,1.14999],"8657":[0.19444,0.69444,0,0,0.70277],"8658":[-0.10889,0.39111,0,0,1.14999],"8659":[0.19444,0.69444,0,0,0.70277],"8660":[-0.10889,0.39111,0,0,1.14999],"8661":[0.25,0.75,0,0,0.70277],"8704":[0,0.69444,0,0,0.63889],"8706":[0,0.69444,0.06389,0,0.62847],"8707":[0,0.69444,0,0,0.63889],"8709":[0.05556,0.75,0,0,0.575],"8711":[0,0.68611,0,0,0.95833],"8712":[0.08556,0.58556,0,0,0.76666],"8715":[0.08556,0.58556,0,0,0.76666],"8722":[0.13333,0.63333,0,0,0.89444],"8723":[0.13333,0.63333,0,0,0.89444],"8725":[0.25,0.75,0,0,0.575],"8726":[0.25,0.75,0,0,0.575],"8727":[-0.02778,0.47222,0,0,0.575],"8728":[-0.02639,0.47361,0,0,0.575],"8729":[-0.02639,0.47361,0,0,0.575],"8730":[0.18,0.82,0,0,0.95833],"8733":[0,0.44444,0,0,0.89444],"8734":[0,0.44444,0,0,1.14999],"8736":[0,0.69224,0,0,0.72222],"8739":[0.25,0.75,0,0,0.31944],"8741":[0.25,0.75,0,0,0.575],"8743":[0,0.55556,0,0,0.76666],"8744":[0,0.55556,0,0,0.76666],"8745":[0,0.55556,0,0,0.76666],"8746":[0,0.55556,0,0,0.76666],"8747":[0.19444,0.69444,0.12778,0,0.56875],"8764":[-0.10889,0.39111,0,0,0.89444],"8768":[0.19444,0.69444,0,0,0.31944],"8771":[0.00222,0.50222,0,0,0.89444],"8773":[0.027,0.638,0,0,0.894],"8776":[0.02444,0.52444,0,0,0.89444],"8781":[0.00222,0.50222,0,0,0.89444],"8801":[0.00222,0.50222,0,0,0.89444],"8804":[0.19667,0.69667,0,0,0.89444],"8805":[0.19667,0.69667,0,0,0.89444],"8810":[0.08556,0.58556,0,0,1.14999],"8811":[0.08556,0.58556,0,0,1.14999],"8826":[0.08556,0.58556,0,0,0.89444],"8827":[0.08556,0.58556,0,0,0.89444],"8834":[0.08556,0.58556,0,0,0.89444],"8835":[0.08556,0.58556,0,0,0.89444],"8838":[0.19667,0.69667,0,0,0.89444],"8839":[0.19667,0.69667,0,0,0.89444],"8846":[0,0.55556,0,0,0.76666],"8849":[0.19667,0.69667,0,0,0.89444],"8850":[0.19667,0.69667,0,0,0.89444],"8851":[0,0.55556,0,0,0.76666],"8852":[0,0.55556,0,0,0.76666],"8853":[0.13333,0.63333,0,0,0.89444],"8854":[0.13333,0.63333,0,0,0.89444],"8855":[0.13333,0.63333,0,0,0.89444],"8856":[0.13333,0.63333,0,0,0.89444],"8857":[0.13333,0.63333,0,0,0.89444],"8866":[0,0.69444,0,0,0.70277],"8867":[0,0.69444,0,0,0.70277],"8868":[0,0.69444,0,0,0.89444],"8869":[0,0.69444,0,0,0.89444],"8900":[-0.02639,0.47361,0,0,0.575],"8901":[-0.02639,0.47361,0,0,0.31944],"8902":[-0.02778,0.47222,0,0,0.575],"8968":[0.25,0.75,0,0,0.51111],"8969":[0.25,0.75,0,0,0.51111],"8970":[0.25,0.75,0,0,0.51111],"8971":[0.25,0.75,0,0,0.51111],"8994":[-0.13889,0.36111,0,0,1.14999],"8995":[-0.13889,0.36111,0,0,1.14999],"9651":[0.19444,0.69444,0,0,1.02222],"9657":[-0.02778,0.47222,0,0,0.575],"9661":[0.19444,0.69444,0,0,1.02222],"9667":[-0.02778,0.47222,0,0,0.575],"9711":[0.19444,0.69444,0,0,1.14999],"9824":[0.12963,0.69444,0,0,0.89444],"9825":[0.12963,0.69444,0,0,0.89444],"9826":[0.12963,0.69444,0,0,0.89444],"9827":[0.12963,0.69444,0,0,0.89444],"9837":[0,0.75,0,0,0.44722],"9838":[0.19444,0.69444,0,0,0.44722],"9839":[0.19444,0.69444,0,0,0.44722],"10216":[0.25,0.75,0,0,0.44722],"10217":[0.25,0.75,0,0,0.44722],"10815":[0,0.68611,0,0,0.9],"10927":[0.19667,0.69667,0,0,0.89444],"10928":[0.19667,0.69667,0,0,0.89444],"57376":[0.19444,0.69444,0,0,0]},"Main-BoldItalic":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0.11417,0,0.38611],"34":[0,0.69444,0.07939,0,0.62055],"35":[0.19444,0.69444,0.06833,0,0.94444],"37":[0.05556,0.75,0.12861,0,0.94444],"38":[0,0.69444,0.08528,0,0.88555],"39":[0,0.69444,0.12945,0,0.35555],"40":[0.25,0.75,0.15806,0,0.47333],"41":[0.25,0.75,0.03306,0,0.47333],"42":[0,0.75,0.14333,0,0.59111],"43":[0.10333,0.60333,0.03306,0,0.88555],"44":[0.19444,0.14722,0,0,0.35555],"45":[0,0.44444,0.02611,0,0.41444],"46":[0,0.14722,0,0,0.35555],"47":[0.25,0.75,0.15806,0,0.59111],"48":[0,0.64444,0.13167,0,0.59111],"49":[0,0.64444,0.13167,0,0.59111],"50":[0,0.64444,0.13167,0,0.59111],"51":[0,0.64444,0.13167,0,0.59111],"52":[0.19444,0.64444,0.13167,0,0.59111],"53":[0,0.64444,0.13167,0,0.59111],"54":[0,0.64444,0.13167,0,0.59111],"55":[0.19444,0.64444,0.13167,0,0.59111],"56":[0,0.64444,0.13167,0,0.59111],"57":[0,0.64444,0.13167,0,0.59111],"58":[0,0.44444,0.06695,0,0.35555],"59":[0.19444,0.44444,0.06695,0,0.35555],"61":[-0.10889,0.39111,0.06833,0,0.88555],"63":[0,0.69444,0.11472,0,0.59111],"64":[0,0.69444,0.09208,0,0.88555],"65":[0,0.68611,0,0,0.86555],"66":[0,0.68611,0.0992,0,0.81666],"67":[0,0.68611,0.14208,0,0.82666],"68":[0,0.68611,0.09062,0,0.87555],"69":[0,0.68611,0.11431,0,0.75666],"70":[0,0.68611,0.12903,0,0.72722],"71":[0,0.68611,0.07347,0,0.89527],"72":[0,0.68611,0.17208,0,0.8961],"73":[0,0.68611,0.15681,0,0.47166],"74":[0,0.68611,0.145,0,0.61055],"75":[0,0.68611,0.14208,0,0.89499],"76":[0,0.68611,0,0,0.69777],"77":[0,0.68611,0.17208,0,1.07277],"78":[0,0.68611,0.17208,0,0.8961],"79":[0,0.68611,0.09062,0,0.85499],"80":[0,0.68611,0.0992,0,0.78721],"81":[0.19444,0.68611,0.09062,0,0.85499],"82":[0,0.68611,0.02559,0,0.85944],"83":[0,0.68611,0.11264,0,0.64999],"84":[0,0.68611,0.12903,0,0.7961],"85":[0,0.68611,0.17208,0,0.88083],"86":[0,0.68611,0.18625,0,0.86555],"87":[0,0.68611,0.18625,0,1.15999],"88":[0,0.68611,0.15681,0,0.86555],"89":[0,0.68611,0.19803,0,0.86555],"90":[0,0.68611,0.14208,0,0.70888],"91":[0.25,0.75,0.1875,0,0.35611],"93":[0.25,0.75,0.09972,0,0.35611],"94":[0,0.69444,0.06709,0,0.59111],"95":[0.31,0.13444,0.09811,0,0.59111],"97":[0,0.44444,0.09426,0,0.59111],"98":[0,0.69444,0.07861,0,0.53222],"99":[0,0.44444,0.05222,0,0.53222],"100":[0,0.69444,0.10861,0,0.59111],"101":[0,0.44444,0.085,0,0.53222],"102":[0.19444,0.69444,0.21778,0,0.4],"103":[0.19444,0.44444,0.105,0,0.53222],"104":[0,0.69444,0.09426,0,0.59111],"105":[0,0.69326,0.11387,0,0.35555],"106":[0.19444,0.69326,0.1672,0,0.35555],"107":[0,0.69444,0.11111,0,0.53222],"108":[0,0.69444,0.10861,0,0.29666],"109":[0,0.44444,0.09426,0,0.94444],"110":[0,0.44444,0.09426,0,0.64999],"111":[0,0.44444,0.07861,0,0.59111],"112":[0.19444,0.44444,0.07861,0,0.59111],"113":[0.19444,0.44444,0.105,0,0.53222],"114":[0,0.44444,0.11111,0,0.50167],"115":[0,0.44444,0.08167,0,0.48694],"116":[0,0.63492,0.09639,0,0.385],"117":[0,0.44444,0.09426,0,0.62055],"118":[0,0.44444,0.11111,0,0.53222],"119":[0,0.44444,0.11111,0,0.76777],"120":[0,0.44444,0.12583,0,0.56055],"121":[0.19444,0.44444,0.105,0,0.56166],"122":[0,0.44444,0.13889,0,0.49055],"126":[0.35,0.34444,0.11472,0,0.59111],"160":[0,0,0,0,0.25],"168":[0,0.69444,0.11473,0,0.59111],"176":[0,0.69444,0,0,0.94888],"184":[0.17014,0,0,0,0.53222],"198":[0,0.68611,0.11431,0,1.02277],"216":[0.04861,0.73472,0.09062,0,0.88555],"223":[0.19444,0.69444,0.09736,0,0.665],"230":[0,0.44444,0.085,0,0.82666],"248":[0.09722,0.54167,0.09458,0,0.59111],"305":[0,0.44444,0.09426,0,0.35555],"338":[0,0.68611,0.11431,0,1.14054],"339":[0,0.44444,0.085,0,0.82666],"567":[0.19444,0.44444,0.04611,0,0.385],"710":[0,0.69444,0.06709,0,0.59111],"711":[0,0.63194,0.08271,0,0.59111],"713":[0,0.59444,0.10444,0,0.59111],"714":[0,0.69444,0.08528,0,0.59111],"715":[0,0.69444,0,0,0.59111],"728":[0,0.69444,0.10333,0,0.59111],"729":[0,0.69444,0.12945,0,0.35555],"730":[0,0.69444,0,0,0.94888],"732":[0,0.69444,0.11472,0,0.59111],"733":[0,0.69444,0.11472,0,0.59111],"915":[0,0.68611,0.12903,0,0.69777],"916":[0,0.68611,0,0,0.94444],"920":[0,0.68611,0.09062,0,0.88555],"923":[0,0.68611,0,0,0.80666],"926":[0,0.68611,0.15092,0,0.76777],"928":[0,0.68611,0.17208,0,0.8961],"931":[0,0.68611,0.11431,0,0.82666],"933":[0,0.68611,0.10778,0,0.88555],"934":[0,0.68611,0.05632,0,0.82666],"936":[0,0.68611,0.10778,0,0.88555],"937":[0,0.68611,0.0992,0,0.82666],"8211":[0,0.44444,0.09811,0,0.59111],"8212":[0,0.44444,0.09811,0,1.18221],"8216":[0,0.69444,0.12945,0,0.35555],"8217":[0,0.69444,0.12945,0,0.35555],"8220":[0,0.69444,0.16772,0,0.62055],"8221":[0,0.69444,0.07939,0,0.62055]},"Main-Italic":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0.12417,0,0.30667],"34":[0,0.69444,0.06961,0,0.51444],"35":[0.19444,0.69444,0.06616,0,0.81777],"37":[0.05556,0.75,0.13639,0,0.81777],"38":[0,0.69444,0.09694,0,0.76666],"39":[0,0.69444,0.12417,0,0.30667],"40":[0.25,0.75,0.16194,0,0.40889],"41":[0.25,0.75,0.03694,0,0.40889],"42":[0,0.75,0.14917,0,0.51111],"43":[0.05667,0.56167,0.03694,0,0.76666],"44":[0.19444,0.10556,0,0,0.30667],"45":[0,0.43056,0.02826,0,0.35778],"46":[0,0.10556,0,0,0.30667],"47":[0.25,0.75,0.16194,0,0.51111],"48":[0,0.64444,0.13556,0,0.51111],"49":[0,0.64444,0.13556,0,0.51111],"50":[0,0.64444,0.13556,0,0.51111],"51":[0,0.64444,0.13556,0,0.51111],"52":[0.19444,0.64444,0.13556,0,0.51111],"53":[0,0.64444,0.13556,0,0.51111],"54":[0,0.64444,0.13556,0,0.51111],"55":[0.19444,0.64444,0.13556,0,0.51111],"56":[0,0.64444,0.13556,0,0.51111],"57":[0,0.64444,0.13556,0,0.51111],"58":[0,0.43056,0.0582,0,0.30667],"59":[0.19444,0.43056,0.0582,0,0.30667],"61":[-0.13313,0.36687,0.06616,0,0.76666],"63":[0,0.69444,0.1225,0,0.51111],"64":[0,0.69444,0.09597,0,0.76666],"65":[0,0.68333,0,0,0.74333],"66":[0,0.68333,0.10257,0,0.70389],"67":[0,0.68333,0.14528,0,0.71555],"68":[0,0.68333,0.09403,0,0.755],"69":[0,0.68333,0.12028,0,0.67833],"70":[0,0.68333,0.13305,0,0.65277],"71":[0,0.68333,0.08722,0,0.77361],"72":[0,0.68333,0.16389,0,0.74333],"73":[0,0.68333,0.15806,0,0.38555],"74":[0,0.68333,0.14028,0,0.525],"75":[0,0.68333,0.14528,0,0.76888],"76":[0,0.68333,0,0,0.62722],"77":[0,0.68333,0.16389,0,0.89666],"78":[0,0.68333,0.16389,0,0.74333],"79":[0,0.68333,0.09403,0,0.76666],"80":[0,0.68333,0.10257,0,0.67833],"81":[0.19444,0.68333,0.09403,0,0.76666],"82":[0,0.68333,0.03868,0,0.72944],"83":[0,0.68333,0.11972,0,0.56222],"84":[0,0.68333,0.13305,0,0.71555],"85":[0,0.68333,0.16389,0,0.74333],"86":[0,0.68333,0.18361,0,0.74333],"87":[0,0.68333,0.18361,0,0.99888],"88":[0,0.68333,0.15806,0,0.74333],"89":[0,0.68333,0.19383,0,0.74333],"90":[0,0.68333,0.14528,0,0.61333],"91":[0.25,0.75,0.1875,0,0.30667],"93":[0.25,0.75,0.10528,0,0.30667],"94":[0,0.69444,0.06646,0,0.51111],"95":[0.31,0.12056,0.09208,0,0.51111],"97":[0,0.43056,0.07671,0,0.51111],"98":[0,0.69444,0.06312,0,0.46],"99":[0,0.43056,0.05653,0,0.46],"100":[0,0.69444,0.10333,0,0.51111],"101":[0,0.43056,0.07514,0,0.46],"102":[0.19444,0.69444,0.21194,0,0.30667],"103":[0.19444,0.43056,0.08847,0,0.46],"104":[0,0.69444,0.07671,0,0.51111],"105":[0,0.65536,0.1019,0,0.30667],"106":[0.19444,0.65536,0.14467,0,0.30667],"107":[0,0.69444,0.10764,0,0.46],"108":[0,0.69444,0.10333,0,0.25555],"109":[0,0.43056,0.07671,0,0.81777],"110":[0,0.43056,0.07671,0,0.56222],"111":[0,0.43056,0.06312,0,0.51111],"112":[0.19444,0.43056,0.06312,0,0.51111],"113":[0.19444,0.43056,0.08847,0,0.46],"114":[0,0.43056,0.10764,0,0.42166],"115":[0,0.43056,0.08208,0,0.40889],"116":[0,0.61508,0.09486,0,0.33222],"117":[0,0.43056,0.07671,0,0.53666],"118":[0,0.43056,0.10764,0,0.46],"119":[0,0.43056,0.10764,0,0.66444],"120":[0,0.43056,0.12042,0,0.46389],"121":[0.19444,0.43056,0.08847,0,0.48555],"122":[0,0.43056,0.12292,0,0.40889],"126":[0.35,0.31786,0.11585,0,0.51111],"160":[0,0,0,0,0.25],"168":[0,0.66786,0.10474,0,0.51111],"176":[0,0.69444,0,0,0.83129],"184":[0.17014,0,0,0,0.46],"198":[0,0.68333,0.12028,0,0.88277],"216":[0.04861,0.73194,0.09403,0,0.76666],"223":[0.19444,0.69444,0.10514,0,0.53666],"230":[0,0.43056,0.07514,0,0.71555],"248":[0.09722,0.52778,0.09194,0,0.51111],"338":[0,0.68333,0.12028,0,0.98499],"339":[0,0.43056,0.07514,0,0.71555],"710":[0,0.69444,0.06646,0,0.51111],"711":[0,0.62847,0.08295,0,0.51111],"713":[0,0.56167,0.10333,0,0.51111],"714":[0,0.69444,0.09694,0,0.51111],"715":[0,0.69444,0,0,0.51111],"728":[0,0.69444,0.10806,0,0.51111],"729":[0,0.66786,0.11752,0,0.30667],"730":[0,0.69444,0,0,0.83129],"732":[0,0.66786,0.11585,0,0.51111],"733":[0,0.69444,0.1225,0,0.51111],"915":[0,0.68333,0.13305,0,0.62722],"916":[0,0.68333,0,0,0.81777],"920":[0,0.68333,0.09403,0,0.76666],"923":[0,0.68333,0,0,0.69222],"926":[0,0.68333,0.15294,0,0.66444],"928":[0,0.68333,0.16389,0,0.74333],"931":[0,0.68333,0.12028,0,0.71555],"933":[0,0.68333,0.11111,0,0.76666],"934":[0,0.68333,0.05986,0,0.71555],"936":[0,0.68333,0.11111,0,0.76666],"937":[0,0.68333,0.10257,0,0.71555],"8211":[0,0.43056,0.09208,0,0.51111],"8212":[0,0.43056,0.09208,0,1.02222],"8216":[0,0.69444,0.12417,0,0.30667],"8217":[0,0.69444,0.12417,0,0.30667],"8220":[0,0.69444,0.1685,0,0.51444],"8221":[0,0.69444,0.06961,0,0.51444],"8463":[0,0.68889,0,0,0.54028]},"Main-Regular":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0,0,0.27778],"34":[0,0.69444,0,0,0.5],"35":[0.19444,0.69444,0,0,0.83334],"36":[0.05556,0.75,0,0,0.5],"37":[0.05556,0.75,0,0,0.83334],"38":[0,0.69444,0,0,0.77778],"39":[0,0.69444,0,0,0.27778],"40":[0.25,0.75,0,0,0.38889],"41":[0.25,0.75,0,0,0.38889],"42":[0,0.75,0,0,0.5],"43":[0.08333,0.58333,0,0,0.77778],"44":[0.19444,0.10556,0,0,0.27778],"45":[0,0.43056,0,0,0.33333],"46":[0,0.10556,0,0,0.27778],"47":[0.25,0.75,0,0,0.5],"48":[0,0.64444,0,0,0.5],"49":[0,0.64444,0,0,0.5],"50":[0,0.64444,0,0,0.5],"51":[0,0.64444,0,0,0.5],"52":[0,0.64444,0,0,0.5],"53":[0,0.64444,0,0,0.5],"54":[0,0.64444,0,0,0.5],"55":[0,0.64444,0,0,0.5],"56":[0,0.64444,0,0,0.5],"57":[0,0.64444,0,0,0.5],"58":[0,0.43056,0,0,0.27778],"59":[0.19444,0.43056,0,0,0.27778],"60":[0.0391,0.5391,0,0,0.77778],"61":[-0.13313,0.36687,0,0,0.77778],"62":[0.0391,0.5391,0,0,0.77778],"63":[0,0.69444,0,0,0.47222],"64":[0,0.69444,0,0,0.77778],"65":[0,0.68333,0,0,0.75],"66":[0,0.68333,0,0,0.70834],"67":[0,0.68333,0,0,0.72222],"68":[0,0.68333,0,0,0.76389],"69":[0,0.68333,0,0,0.68056],"70":[0,0.68333,0,0,0.65278],"71":[0,0.68333,0,0,0.78472],"72":[0,0.68333,0,0,0.75],"73":[0,0.68333,0,0,0.36111],"74":[0,0.68333,0,0,0.51389],"75":[0,0.68333,0,0,0.77778],"76":[0,0.68333,0,0,0.625],"77":[0,0.68333,0,0,0.91667],"78":[0,0.68333,0,0,0.75],"79":[0,0.68333,0,0,0.77778],"80":[0,0.68333,0,0,0.68056],"81":[0.19444,0.68333,0,0,0.77778],"82":[0,0.68333,0,0,0.73611],"83":[0,0.68333,0,0,0.55556],"84":[0,0.68333,0,0,0.72222],"85":[0,0.68333,0,0,0.75],"86":[0,0.68333,0.01389,0,0.75],"87":[0,0.68333,0.01389,0,1.02778],"88":[0,0.68333,0,0,0.75],"89":[0,0.68333,0.025,0,0.75],"90":[0,0.68333,0,0,0.61111],"91":[0.25,0.75,0,0,0.27778],"92":[0.25,0.75,0,0,0.5],"93":[0.25,0.75,0,0,0.27778],"94":[0,0.69444,0,0,0.5],"95":[0.31,0.12056,0.02778,0,0.5],"97":[0,0.43056,0,0,0.5],"98":[0,0.69444,0,0,0.55556],"99":[0,0.43056,0,0,0.44445],"100":[0,0.69444,0,0,0.55556],"101":[0,0.43056,0,0,0.44445],"102":[0,0.69444,0.07778,0,0.30556],"103":[0.19444,0.43056,0.01389,0,0.5],"104":[0,0.69444,0,0,0.55556],"105":[0,0.66786,0,0,0.27778],"106":[0.19444,0.66786,0,0,0.30556],"107":[0,0.69444,0,0,0.52778],"108":[0,0.69444,0,0,0.27778],"109":[0,0.43056,0,0,0.83334],"110":[0,0.43056,0,0,0.55556],"111":[0,0.43056,0,0,0.5],"112":[0.19444,0.43056,0,0,0.55556],"113":[0.19444,0.43056,0,0,0.52778],"114":[0,0.43056,0,0,0.39167],"115":[0,0.43056,0,0,0.39445],"116":[0,0.61508,0,0,0.38889],"117":[0,0.43056,0,0,0.55556],"118":[0,0.43056,0.01389,0,0.52778],"119":[0,0.43056,0.01389,0,0.72222],"120":[0,0.43056,0,0,0.52778],"121":[0.19444,0.43056,0.01389,0,0.52778],"122":[0,0.43056,0,0,0.44445],"123":[0.25,0.75,0,0,0.5],"124":[0.25,0.75,0,0,0.27778],"125":[0.25,0.75,0,0,0.5],"126":[0.35,0.31786,0,0,0.5],"160":[0,0,0,0,0.25],"163":[0,0.69444,0,0,0.76909],"167":[0.19444,0.69444,0,0,0.44445],"168":[0,0.66786,0,0,0.5],"172":[0,0.43056,0,0,0.66667],"176":[0,0.69444,0,0,0.75],"177":[0.08333,0.58333,0,0,0.77778],"182":[0.19444,0.69444,0,0,0.61111],"184":[0.17014,0,0,0,0.44445],"198":[0,0.68333,0,0,0.90278],"215":[0.08333,0.58333,0,0,0.77778],"216":[0.04861,0.73194,0,0,0.77778],"223":[0,0.69444,0,0,0.5],"230":[0,0.43056,0,0,0.72222],"247":[0.08333,0.58333,0,0,0.77778],"248":[0.09722,0.52778,0,0,0.5],"305":[0,0.43056,0,0,0.27778],"338":[0,0.68333,0,0,1.01389],"339":[0,0.43056,0,0,0.77778],"567":[0.19444,0.43056,0,0,0.30556],"710":[0,0.69444,0,0,0.5],"711":[0,0.62847,0,0,0.5],"713":[0,0.56778,0,0,0.5],"714":[0,0.69444,0,0,0.5],"715":[0,0.69444,0,0,0.5],"728":[0,0.69444,0,0,0.5],"729":[0,0.66786,0,0,0.27778],"730":[0,0.69444,0,0,0.75],"732":[0,0.66786,0,0,0.5],"733":[0,0.69444,0,0,0.5],"915":[0,0.68333,0,0,0.625],"916":[0,0.68333,0,0,0.83334],"920":[0,0.68333,0,0,0.77778],"923":[0,0.68333,0,0,0.69445],"926":[0,0.68333,0,0,0.66667],"928":[0,0.68333,0,0,0.75],"931":[0,0.68333,0,0,0.72222],"933":[0,0.68333,0,0,0.77778],"934":[0,0.68333,0,0,0.72222],"936":[0,0.68333,0,0,0.77778],"937":[0,0.68333,0,0,0.72222],"8211":[0,0.43056,0.02778,0,0.5],"8212":[0,0.43056,0.02778,0,1],"8216":[0,0.69444,0,0,0.27778],"8217":[0,0.69444,0,0,0.27778],"8220":[0,0.69444,0,0,0.5],"8221":[0,0.69444,0,0,0.5],"8224":[0.19444,0.69444,0,0,0.44445],"8225":[0.19444,0.69444,0,0,0.44445],"8230":[0,0.123,0,0,1.172],"8242":[0,0.55556,0,0,0.275],"8407":[0,0.71444,0.15382,0,0.5],"8463":[0,0.68889,0,0,0.54028],"8465":[0,0.69444,0,0,0.72222],"8467":[0,0.69444,0,0.11111,0.41667],"8472":[0.19444,0.43056,0,0.11111,0.63646],"8476":[0,0.69444,0,0,0.72222],"8501":[0,0.69444,0,0,0.61111],"8592":[-0.13313,0.36687,0,0,1],"8593":[0.19444,0.69444,0,0,0.5],"8594":[-0.13313,0.36687,0,0,1],"8595":[0.19444,0.69444,0,0,0.5],"8596":[-0.13313,0.36687,0,0,1],"8597":[0.25,0.75,0,0,0.5],"8598":[0.19444,0.69444,0,0,1],"8599":[0.19444,0.69444,0,0,1],"8600":[0.19444,0.69444,0,0,1],"8601":[0.19444,0.69444,0,0,1],"8614":[0.011,0.511,0,0,1],"8617":[0.011,0.511,0,0,1.126],"8618":[0.011,0.511,0,0,1.126],"8636":[-0.13313,0.36687,0,0,1],"8637":[-0.13313,0.36687,0,0,1],"8640":[-0.13313,0.36687,0,0,1],"8641":[-0.13313,0.36687,0,0,1],"8652":[0.011,0.671,0,0,1],"8656":[-0.13313,0.36687,0,0,1],"8657":[0.19444,0.69444,0,0,0.61111],"8658":[-0.13313,0.36687,0,0,1],"8659":[0.19444,0.69444,0,0,0.61111],"8660":[-0.13313,0.36687,0,0,1],"8661":[0.25,0.75,0,0,0.61111],"8704":[0,0.69444,0,0,0.55556],"8706":[0,0.69444,0.05556,0.08334,0.5309],"8707":[0,0.69444,0,0,0.55556],"8709":[0.05556,0.75,0,0,0.5],"8711":[0,0.68333,0,0,0.83334],"8712":[0.0391,0.5391,0,0,0.66667],"8715":[0.0391,0.5391,0,0,0.66667],"8722":[0.08333,0.58333,0,0,0.77778],"8723":[0.08333,0.58333,0,0,0.77778],"8725":[0.25,0.75,0,0,0.5],"8726":[0.25,0.75,0,0,0.5],"8727":[-0.03472,0.46528,0,0,0.5],"8728":[-0.05555,0.44445,0,0,0.5],"8729":[-0.05555,0.44445,0,0,0.5],"8730":[0.2,0.8,0,0,0.83334],"8733":[0,0.43056,0,0,0.77778],"8734":[0,0.43056,0,0,1],"8736":[0,0.69224,0,0,0.72222],"8739":[0.25,0.75,0,0,0.27778],"8741":[0.25,0.75,0,0,0.5],"8743":[0,0.55556,0,0,0.66667],"8744":[0,0.55556,0,0,0.66667],"8745":[0,0.55556,0,0,0.66667],"8746":[0,0.55556,0,0,0.66667],"8747":[0.19444,0.69444,0.11111,0,0.41667],"8764":[-0.13313,0.36687,0,0,0.77778],"8768":[0.19444,0.69444,0,0,0.27778],"8771":[-0.03625,0.46375,0,0,0.77778],"8773":[-0.022,0.589,0,0,0.778],"8776":[-0.01688,0.48312,0,0,0.77778],"8781":[-0.03625,0.46375,0,0,0.77778],"8784":[-0.133,0.673,0,0,0.778],"8801":[-0.03625,0.46375,0,0,0.77778],"8804":[0.13597,0.63597,0,0,0.77778],"8805":[0.13597,0.63597,0,0,0.77778],"8810":[0.0391,0.5391,0,0,1],"8811":[0.0391,0.5391,0,0,1],"8826":[0.0391,0.5391,0,0,0.77778],"8827":[0.0391,0.5391,0,0,0.77778],"8834":[0.0391,0.5391,0,0,0.77778],"8835":[0.0391,0.5391,0,0,0.77778],"8838":[0.13597,0.63597,0,0,0.77778],"8839":[0.13597,0.63597,0,0,0.77778],"8846":[0,0.55556,0,0,0.66667],"8849":[0.13597,0.63597,0,0,0.77778],"8850":[0.13597,0.63597,0,0,0.77778],"8851":[0,0.55556,0,0,0.66667],"8852":[0,0.55556,0,0,0.66667],"8853":[0.08333,0.58333,0,0,0.77778],"8854":[0.08333,0.58333,0,0,0.77778],"8855":[0.08333,0.58333,0,0,0.77778],"8856":[0.08333,0.58333,0,0,0.77778],"8857":[0.08333,0.58333,0,0,0.77778],"8866":[0,0.69444,0,0,0.61111],"8867":[0,0.69444,0,0,0.61111],"8868":[0,0.69444,0,0,0.77778],"8869":[0,0.69444,0,0,0.77778],"8872":[0.249,0.75,0,0,0.867],"8900":[-0.05555,0.44445,0,0,0.5],"8901":[-0.05555,0.44445,0,0,0.27778],"8902":[-0.03472,0.46528,0,0,0.5],"8904":[0.005,0.505,0,0,0.9],"8942":[0.03,0.903,0,0,0.278],"8943":[-0.19,0.313,0,0,1.172],"8945":[-0.1,0.823,0,0,1.282],"8968":[0.25,0.75,0,0,0.44445],"8969":[0.25,0.75,0,0,0.44445],"8970":[0.25,0.75,0,0,0.44445],"8971":[0.25,0.75,0,0,0.44445],"8994":[-0.14236,0.35764,0,0,1],"8995":[-0.14236,0.35764,0,0,1],"9136":[0.244,0.744,0,0,0.412],"9137":[0.244,0.745,0,0,0.412],"9651":[0.19444,0.69444,0,0,0.88889],"9657":[-0.03472,0.46528,0,0,0.5],"9661":[0.19444,0.69444,0,0,0.88889],"9667":[-0.03472,0.46528,0,0,0.5],"9711":[0.19444,0.69444,0,0,1],"9824":[0.12963,0.69444,0,0,0.77778],"9825":[0.12963,0.69444,0,0,0.77778],"9826":[0.12963,0.69444,0,0,0.77778],"9827":[0.12963,0.69444,0,0,0.77778],"9837":[0,0.75,0,0,0.38889],"9838":[0.19444,0.69444,0,0,0.38889],"9839":[0.19444,0.69444,0,0,0.38889],"10216":[0.25,0.75,0,0,0.38889],"10217":[0.25,0.75,0,0,0.38889],"10222":[0.244,0.744,0,0,0.412],"10223":[0.244,0.745,0,0,0.412],"10229":[0.011,0.511,0,0,1.609],"10230":[0.011,0.511,0,0,1.638],"10231":[0.011,0.511,0,0,1.859],"10232":[0.024,0.525,0,0,1.609],"10233":[0.024,0.525,0,0,1.638],"10234":[0.024,0.525,0,0,1.858],"10236":[0.011,0.511,0,0,1.638],"10815":[0,0.68333,0,0,0.75],"10927":[0.13597,0.63597,0,0,0.77778],"10928":[0.13597,0.63597,0,0,0.77778],"57376":[0.19444,0.69444,0,0,0]},"Math-BoldItalic":{"32":[0,0,0,0,0.25],"48":[0,0.44444,0,0,0.575],"49":[0,0.44444,0,0,0.575],"50":[0,0.44444,0,0,0.575],"51":[0.19444,0.44444,0,0,0.575],"52":[0.19444,0.44444,0,0,0.575],"53":[0.19444,0.44444,0,0,0.575],"54":[0,0.64444,0,0,0.575],"55":[0.19444,0.44444,0,0,0.575],"56":[0,0.64444,0,0,0.575],"57":[0.19444,0.44444,0,0,0.575],"65":[0,0.68611,0,0,0.86944],"66":[0,0.68611,0.04835,0,0.8664],"67":[0,0.68611,0.06979,0,0.81694],"68":[0,0.68611,0.03194,0,0.93812],"69":[0,0.68611,0.05451,0,0.81007],"70":[0,0.68611,0.15972,0,0.68889],"71":[0,0.68611,0,0,0.88673],"72":[0,0.68611,0.08229,0,0.98229],"73":[0,0.68611,0.07778,0,0.51111],"74":[0,0.68611,0.10069,0,0.63125],"75":[0,0.68611,0.06979,0,0.97118],"76":[0,0.68611,0,0,0.75555],"77":[0,0.68611,0.11424,0,1.14201],"78":[0,0.68611,0.11424,0,0.95034],"79":[0,0.68611,0.03194,0,0.83666],"80":[0,0.68611,0.15972,0,0.72309],"81":[0.19444,0.68611,0,0,0.86861],"82":[0,0.68611,0.00421,0,0.87235],"83":[0,0.68611,0.05382,0,0.69271],"84":[0,0.68611,0.15972,0,0.63663],"85":[0,0.68611,0.11424,0,0.80027],"86":[0,0.68611,0.25555,0,0.67778],"87":[0,0.68611,0.15972,0,1.09305],"88":[0,0.68611,0.07778,0,0.94722],"89":[0,0.68611,0.25555,0,0.67458],"90":[0,0.68611,0.06979,0,0.77257],"97":[0,0.44444,0,0,0.63287],"98":[0,0.69444,0,0,0.52083],"99":[0,0.44444,0,0,0.51342],"100":[0,0.69444,0,0,0.60972],"101":[0,0.44444,0,0,0.55361],"102":[0.19444,0.69444,0.11042,0,0.56806],"103":[0.19444,0.44444,0.03704,0,0.5449],"104":[0,0.69444,0,0,0.66759],"105":[0,0.69326,0,0,0.4048],"106":[0.19444,0.69326,0.0622,0,0.47083],"107":[0,0.69444,0.01852,0,0.6037],"108":[0,0.69444,0.0088,0,0.34815],"109":[0,0.44444,0,0,1.0324],"110":[0,0.44444,0,0,0.71296],"111":[0,0.44444,0,0,0.58472],"112":[0.19444,0.44444,0,0,0.60092],"113":[0.19444,0.44444,0.03704,0,0.54213],"114":[0,0.44444,0.03194,0,0.5287],"115":[0,0.44444,0,0,0.53125],"116":[0,0.63492,0,0,0.41528],"117":[0,0.44444,0,0,0.68102],"118":[0,0.44444,0.03704,0,0.56666],"119":[0,0.44444,0.02778,0,0.83148],"120":[0,0.44444,0,0,0.65903],"121":[0.19444,0.44444,0.03704,0,0.59028],"122":[0,0.44444,0.04213,0,0.55509],"160":[0,0,0,0,0.25],"915":[0,0.68611,0.15972,0,0.65694],"916":[0,0.68611,0,0,0.95833],"920":[0,0.68611,0.03194,0,0.86722],"923":[0,0.68611,0,0,0.80555],"926":[0,0.68611,0.07458,0,0.84125],"928":[0,0.68611,0.08229,0,0.98229],"931":[0,0.68611,0.05451,0,0.88507],"933":[0,0.68611,0.15972,0,0.67083],"934":[0,0.68611,0,0,0.76666],"936":[0,0.68611,0.11653,0,0.71402],"937":[0,0.68611,0.04835,0,0.8789],"945":[0,0.44444,0,0,0.76064],"946":[0.19444,0.69444,0.03403,0,0.65972],"947":[0.19444,0.44444,0.06389,0,0.59003],"948":[0,0.69444,0.03819,0,0.52222],"949":[0,0.44444,0,0,0.52882],"950":[0.19444,0.69444,0.06215,0,0.50833],"951":[0.19444,0.44444,0.03704,0,0.6],"952":[0,0.69444,0.03194,0,0.5618],"953":[0,0.44444,0,0,0.41204],"954":[0,0.44444,0,0,0.66759],"955":[0,0.69444,0,0,0.67083],"956":[0.19444,0.44444,0,0,0.70787],"957":[0,0.44444,0.06898,0,0.57685],"958":[0.19444,0.69444,0.03021,0,0.50833],"959":[0,0.44444,0,0,0.58472],"960":[0,0.44444,0.03704,0,0.68241],"961":[0.19444,0.44444,0,0,0.6118],"962":[0.09722,0.44444,0.07917,0,0.42361],"963":[0,0.44444,0.03704,0,0.68588],"964":[0,0.44444,0.13472,0,0.52083],"965":[0,0.44444,0.03704,0,0.63055],"966":[0.19444,0.44444,0,0,0.74722],"967":[0.19444,0.44444,0,0,0.71805],"968":[0.19444,0.69444,0.03704,0,0.75833],"969":[0,0.44444,0.03704,0,0.71782],"977":[0,0.69444,0,0,0.69155],"981":[0.19444,0.69444,0,0,0.7125],"982":[0,0.44444,0.03194,0,0.975],"1009":[0.19444,0.44444,0,0,0.6118],"1013":[0,0.44444,0,0,0.48333],"57649":[0,0.44444,0,0,0.39352],"57911":[0.19444,0.44444,0,0,0.43889]},"Math-Italic":{"32":[0,0,0,0,0.25],"48":[0,0.43056,0,0,0.5],"49":[0,0.43056,0,0,0.5],"50":[0,0.43056,0,0,0.5],"51":[0.19444,0.43056,0,0,0.5],"52":[0.19444,0.43056,0,0,0.5],"53":[0.19444,0.43056,0,0,0.5],"54":[0,0.64444,0,0,0.5],"55":[0.19444,0.43056,0,0,0.5],"56":[0,0.64444,0,0,0.5],"57":[0.19444,0.43056,0,0,0.5],"65":[0,0.68333,0,0.13889,0.75],"66":[0,0.68333,0.05017,0.08334,0.75851],"67":[0,0.68333,0.07153,0.08334,0.71472],"68":[0,0.68333,0.02778,0.05556,0.82792],"69":[0,0.68333,0.05764,0.08334,0.7382],"70":[0,0.68333,0.13889,0.08334,0.64306],"71":[0,0.68333,0,0.08334,0.78625],"72":[0,0.68333,0.08125,0.05556,0.83125],"73":[0,0.68333,0.07847,0.11111,0.43958],"74":[0,0.68333,0.09618,0.16667,0.55451],"75":[0,0.68333,0.07153,0.05556,0.84931],"76":[0,0.68333,0,0.02778,0.68056],"77":[0,0.68333,0.10903,0.08334,0.97014],"78":[0,0.68333,0.10903,0.08334,0.80347],"79":[0,0.68333,0.02778,0.08334,0.76278],"80":[0,0.68333,0.13889,0.08334,0.64201],"81":[0.19444,0.68333,0,0.08334,0.79056],"82":[0,0.68333,0.00773,0.08334,0.75929],"83":[0,0.68333,0.05764,0.08334,0.6132],"84":[0,0.68333,0.13889,0.08334,0.58438],"85":[0,0.68333,0.10903,0.02778,0.68278],"86":[0,0.68333,0.22222,0,0.58333],"87":[0,0.68333,0.13889,0,0.94445],"88":[0,0.68333,0.07847,0.08334,0.82847],"89":[0,0.68333,0.22222,0,0.58056],"90":[0,0.68333,0.07153,0.08334,0.68264],"97":[0,0.43056,0,0,0.52859],"98":[0,0.69444,0,0,0.42917],"99":[0,0.43056,0,0.05556,0.43276],"100":[0,0.69444,0,0.16667,0.52049],"101":[0,0.43056,0,0.05556,0.46563],"102":[0.19444,0.69444,0.10764,0.16667,0.48959],"103":[0.19444,0.43056,0.03588,0.02778,0.47697],"104":[0,0.69444,0,0,0.57616],"105":[0,0.65952,0,0,0.34451],"106":[0.19444,0.65952,0.05724,0,0.41181],"107":[0,0.69444,0.03148,0,0.5206],"108":[0,0.69444,0.01968,0.08334,0.29838],"109":[0,0.43056,0,0,0.87801],"110":[0,0.43056,0,0,0.60023],"111":[0,0.43056,0,0.05556,0.48472],"112":[0.19444,0.43056,0,0.08334,0.50313],"113":[0.19444,0.43056,0.03588,0.08334,0.44641],"114":[0,0.43056,0.02778,0.05556,0.45116],"115":[0,0.43056,0,0.05556,0.46875],"116":[0,0.61508,0,0.08334,0.36111],"117":[0,0.43056,0,0.02778,0.57246],"118":[0,0.43056,0.03588,0.02778,0.48472],"119":[0,0.43056,0.02691,0.08334,0.71592],"120":[0,0.43056,0,0.02778,0.57153],"121":[0.19444,0.43056,0.03588,0.05556,0.49028],"122":[0,0.43056,0.04398,0.05556,0.46505],"160":[0,0,0,0,0.25],"915":[0,0.68333,0.13889,0.08334,0.61528],"916":[0,0.68333,0,0.16667,0.83334],"920":[0,0.68333,0.02778,0.08334,0.76278],"923":[0,0.68333,0,0.16667,0.69445],"926":[0,0.68333,0.07569,0.08334,0.74236],"928":[0,0.68333,0.08125,0.05556,0.83125],"931":[0,0.68333,0.05764,0.08334,0.77986],"933":[0,0.68333,0.13889,0.05556,0.58333],"934":[0,0.68333,0,0.08334,0.66667],"936":[0,0.68333,0.11,0.05556,0.61222],"937":[0,0.68333,0.05017,0.08334,0.7724],"945":[0,0.43056,0.0037,0.02778,0.6397],"946":[0.19444,0.69444,0.05278,0.08334,0.56563],"947":[0.19444,0.43056,0.05556,0,0.51773],"948":[0,0.69444,0.03785,0.05556,0.44444],"949":[0,0.43056,0,0.08334,0.46632],"950":[0.19444,0.69444,0.07378,0.08334,0.4375],"951":[0.19444,0.43056,0.03588,0.05556,0.49653],"952":[0,0.69444,0.02778,0.08334,0.46944],"953":[0,0.43056,0,0.05556,0.35394],"954":[0,0.43056,0,0,0.57616],"955":[0,0.69444,0,0,0.58334],"956":[0.19444,0.43056,0,0.02778,0.60255],"957":[0,0.43056,0.06366,0.02778,0.49398],"958":[0.19444,0.69444,0.04601,0.11111,0.4375],"959":[0,0.43056,0,0.05556,0.48472],"960":[0,0.43056,0.03588,0,0.57003],"961":[0.19444,0.43056,0,0.08334,0.51702],"962":[0.09722,0.43056,0.07986,0.08334,0.36285],"963":[0,0.43056,0.03588,0,0.57141],"964":[0,0.43056,0.1132,0.02778,0.43715],"965":[0,0.43056,0.03588,0.02778,0.54028],"966":[0.19444,0.43056,0,0.08334,0.65417],"967":[0.19444,0.43056,0,0.05556,0.62569],"968":[0.19444,0.69444,0.03588,0.11111,0.65139],"969":[0,0.43056,0.03588,0,0.62245],"977":[0,0.69444,0,0.08334,0.59144],"981":[0.19444,0.69444,0,0.08334,0.59583],"982":[0,0.43056,0.02778,0,0.82813],"1009":[0.19444,0.43056,0,0.08334,0.51702],"1013":[0,0.43056,0,0.05556,0.4059],"57649":[0,0.43056,0,0.02778,0.32246],"57911":[0.19444,0.43056,0,0.08334,0.38403]},"SansSerif-Bold":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0,0,0.36667],"34":[0,0.69444,0,0,0.55834],"35":[0.19444,0.69444,0,0,0.91667],"36":[0.05556,0.75,0,0,0.55],"37":[0.05556,0.75,0,0,1.02912],"38":[0,0.69444,0,0,0.83056],"39":[0,0.69444,0,0,0.30556],"40":[0.25,0.75,0,0,0.42778],"41":[0.25,0.75,0,0,0.42778],"42":[0,0.75,0,0,0.55],"43":[0.11667,0.61667,0,0,0.85556],"44":[0.10556,0.13056,0,0,0.30556],"45":[0,0.45833,0,0,0.36667],"46":[0,0.13056,0,0,0.30556],"47":[0.25,0.75,0,0,0.55],"48":[0,0.69444,0,0,0.55],"49":[0,0.69444,0,0,0.55],"50":[0,0.69444,0,0,0.55],"51":[0,0.69444,0,0,0.55],"52":[0,0.69444,0,0,0.55],"53":[0,0.69444,0,0,0.55],"54":[0,0.69444,0,0,0.55],"55":[0,0.69444,0,0,0.55],"56":[0,0.69444,0,0,0.55],"57":[0,0.69444,0,0,0.55],"58":[0,0.45833,0,0,0.30556],"59":[0.10556,0.45833,0,0,0.30556],"61":[-0.09375,0.40625,0,0,0.85556],"63":[0,0.69444,0,0,0.51945],"64":[0,0.69444,0,0,0.73334],"65":[0,0.69444,0,0,0.73334],"66":[0,0.69444,0,0,0.73334],"67":[0,0.69444,0,0,0.70278],"68":[0,0.69444,0,0,0.79445],"69":[0,0.69444,0,0,0.64167],"70":[0,0.69444,0,0,0.61111],"71":[0,0.69444,0,0,0.73334],"72":[0,0.69444,0,0,0.79445],"73":[0,0.69444,0,0,0.33056],"74":[0,0.69444,0,0,0.51945],"75":[0,0.69444,0,0,0.76389],"76":[0,0.69444,0,0,0.58056],"77":[0,0.69444,0,0,0.97778],"78":[0,0.69444,0,0,0.79445],"79":[0,0.69444,0,0,0.79445],"80":[0,0.69444,0,0,0.70278],"81":[0.10556,0.69444,0,0,0.79445],"82":[0,0.69444,0,0,0.70278],"83":[0,0.69444,0,0,0.61111],"84":[0,0.69444,0,0,0.73334],"85":[0,0.69444,0,0,0.76389],"86":[0,0.69444,0.01528,0,0.73334],"87":[0,0.69444,0.01528,0,1.03889],"88":[0,0.69444,0,0,0.73334],"89":[0,0.69444,0.0275,0,0.73334],"90":[0,0.69444,0,0,0.67223],"91":[0.25,0.75,0,0,0.34306],"93":[0.25,0.75,0,0,0.34306],"94":[0,0.69444,0,0,0.55],"95":[0.35,0.10833,0.03056,0,0.55],"97":[0,0.45833,0,0,0.525],"98":[0,0.69444,0,0,0.56111],"99":[0,0.45833,0,0,0.48889],"100":[0,0.69444,0,0,0.56111],"101":[0,0.45833,0,0,0.51111],"102":[0,0.69444,0.07639,0,0.33611],"103":[0.19444,0.45833,0.01528,0,0.55],"104":[0,0.69444,0,0,0.56111],"105":[0,0.69444,0,0,0.25556],"106":[0.19444,0.69444,0,0,0.28611],"107":[0,0.69444,0,0,0.53056],"108":[0,0.69444,0,0,0.25556],"109":[0,0.45833,0,0,0.86667],"110":[0,0.45833,0,0,0.56111],"111":[0,0.45833,0,0,0.55],"112":[0.19444,0.45833,0,0,0.56111],"113":[0.19444,0.45833,0,0,0.56111],"114":[0,0.45833,0.01528,0,0.37222],"115":[0,0.45833,0,0,0.42167],"116":[0,0.58929,0,0,0.40417],"117":[0,0.45833,0,0,0.56111],"118":[0,0.45833,0.01528,0,0.5],"119":[0,0.45833,0.01528,0,0.74445],"120":[0,0.45833,0,0,0.5],"121":[0.19444,0.45833,0.01528,0,0.5],"122":[0,0.45833,0,0,0.47639],"126":[0.35,0.34444,0,0,0.55],"160":[0,0,0,0,0.25],"168":[0,0.69444,0,0,0.55],"176":[0,0.69444,0,0,0.73334],"180":[0,0.69444,0,0,0.55],"184":[0.17014,0,0,0,0.48889],"305":[0,0.45833,0,0,0.25556],"567":[0.19444,0.45833,0,0,0.28611],"710":[0,0.69444,0,0,0.55],"711":[0,0.63542,0,0,0.55],"713":[0,0.63778,0,0,0.55],"728":[0,0.69444,0,0,0.55],"729":[0,0.69444,0,0,0.30556],"730":[0,0.69444,0,0,0.73334],"732":[0,0.69444,0,0,0.55],"733":[0,0.69444,0,0,0.55],"915":[0,0.69444,0,0,0.58056],"916":[0,0.69444,0,0,0.91667],"920":[0,0.69444,0,0,0.85556],"923":[0,0.69444,0,0,0.67223],"926":[0,0.69444,0,0,0.73334],"928":[0,0.69444,0,0,0.79445],"931":[0,0.69444,0,0,0.79445],"933":[0,0.69444,0,0,0.85556],"934":[0,0.69444,0,0,0.79445],"936":[0,0.69444,0,0,0.85556],"937":[0,0.69444,0,0,0.79445],"8211":[0,0.45833,0.03056,0,0.55],"8212":[0,0.45833,0.03056,0,1.10001],"8216":[0,0.69444,0,0,0.30556],"8217":[0,0.69444,0,0,0.30556],"8220":[0,0.69444,0,0,0.55834],"8221":[0,0.69444,0,0,0.55834]},"SansSerif-Italic":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0.05733,0,0.31945],"34":[0,0.69444,0.00316,0,0.5],"35":[0.19444,0.69444,0.05087,0,0.83334],"36":[0.05556,0.75,0.11156,0,0.5],"37":[0.05556,0.75,0.03126,0,0.83334],"38":[0,0.69444,0.03058,0,0.75834],"39":[0,0.69444,0.07816,0,0.27778],"40":[0.25,0.75,0.13164,0,0.38889],"41":[0.25,0.75,0.02536,0,0.38889],"42":[0,0.75,0.11775,0,0.5],"43":[0.08333,0.58333,0.02536,0,0.77778],"44":[0.125,0.08333,0,0,0.27778],"45":[0,0.44444,0.01946,0,0.33333],"46":[0,0.08333,0,0,0.27778],"47":[0.25,0.75,0.13164,0,0.5],"48":[0,0.65556,0.11156,0,0.5],"49":[0,0.65556,0.11156,0,0.5],"50":[0,0.65556,0.11156,0,0.5],"51":[0,0.65556,0.11156,0,0.5],"52":[0,0.65556,0.11156,0,0.5],"53":[0,0.65556,0.11156,0,0.5],"54":[0,0.65556,0.11156,0,0.5],"55":[0,0.65556,0.11156,0,0.5],"56":[0,0.65556,0.11156,0,0.5],"57":[0,0.65556,0.11156,0,0.5],"58":[0,0.44444,0.02502,0,0.27778],"59":[0.125,0.44444,0.02502,0,0.27778],"61":[-0.13,0.37,0.05087,0,0.77778],"63":[0,0.69444,0.11809,0,0.47222],"64":[0,0.69444,0.07555,0,0.66667],"65":[0,0.69444,0,0,0.66667],"66":[0,0.69444,0.08293,0,0.66667],"67":[0,0.69444,0.11983,0,0.63889],"68":[0,0.69444,0.07555,0,0.72223],"69":[0,0.69444,0.11983,0,0.59722],"70":[0,0.69444,0.13372,0,0.56945],"71":[0,0.69444,0.11983,0,0.66667],"72":[0,0.69444,0.08094,0,0.70834],"73":[0,0.69444,0.13372,0,0.27778],"74":[0,0.69444,0.08094,0,0.47222],"75":[0,0.69444,0.11983,0,0.69445],"76":[0,0.69444,0,0,0.54167],"77":[0,0.69444,0.08094,0,0.875],"78":[0,0.69444,0.08094,0,0.70834],"79":[0,0.69444,0.07555,0,0.73611],"80":[0,0.69444,0.08293,0,0.63889],"81":[0.125,0.69444,0.07555,0,0.73611],"82":[0,0.69444,0.08293,0,0.64584],"83":[0,0.69444,0.09205,0,0.55556],"84":[0,0.69444,0.13372,0,0.68056],"85":[0,0.69444,0.08094,0,0.6875],"86":[0,0.69444,0.1615,0,0.66667],"87":[0,0.69444,0.1615,0,0.94445],"88":[0,0.69444,0.13372,0,0.66667],"89":[0,0.69444,0.17261,0,0.66667],"90":[0,0.69444,0.11983,0,0.61111],"91":[0.25,0.75,0.15942,0,0.28889],"93":[0.25,0.75,0.08719,0,0.28889],"94":[0,0.69444,0.0799,0,0.5],"95":[0.35,0.09444,0.08616,0,0.5],"97":[0,0.44444,0.00981,0,0.48056],"98":[0,0.69444,0.03057,0,0.51667],"99":[0,0.44444,0.08336,0,0.44445],"100":[0,0.69444,0.09483,0,0.51667],"101":[0,0.44444,0.06778,0,0.44445],"102":[0,0.69444,0.21705,0,0.30556],"103":[0.19444,0.44444,0.10836,0,0.5],"104":[0,0.69444,0.01778,0,0.51667],"105":[0,0.67937,0.09718,0,0.23889],"106":[0.19444,0.67937,0.09162,0,0.26667],"107":[0,0.69444,0.08336,0,0.48889],"108":[0,0.69444,0.09483,0,0.23889],"109":[0,0.44444,0.01778,0,0.79445],"110":[0,0.44444,0.01778,0,0.51667],"111":[0,0.44444,0.06613,0,0.5],"112":[0.19444,0.44444,0.0389,0,0.51667],"113":[0.19444,0.44444,0.04169,0,0.51667],"114":[0,0.44444,0.10836,0,0.34167],"115":[0,0.44444,0.0778,0,0.38333],"116":[0,0.57143,0.07225,0,0.36111],"117":[0,0.44444,0.04169,0,0.51667],"118":[0,0.44444,0.10836,0,0.46111],"119":[0,0.44444,0.10836,0,0.68334],"120":[0,0.44444,0.09169,0,0.46111],"121":[0.19444,0.44444,0.10836,0,0.46111],"122":[0,0.44444,0.08752,0,0.43472],"126":[0.35,0.32659,0.08826,0,0.5],"160":[0,0,0,0,0.25],"168":[0,0.67937,0.06385,0,0.5],"176":[0,0.69444,0,0,0.73752],"184":[0.17014,0,0,0,0.44445],"305":[0,0.44444,0.04169,0,0.23889],"567":[0.19444,0.44444,0.04169,0,0.26667],"710":[0,0.69444,0.0799,0,0.5],"711":[0,0.63194,0.08432,0,0.5],"713":[0,0.60889,0.08776,0,0.5],"714":[0,0.69444,0.09205,0,0.5],"715":[0,0.69444,0,0,0.5],"728":[0,0.69444,0.09483,0,0.5],"729":[0,0.67937,0.07774,0,0.27778],"730":[0,0.69444,0,0,0.73752],"732":[0,0.67659,0.08826,0,0.5],"733":[0,0.69444,0.09205,0,0.5],"915":[0,0.69444,0.13372,0,0.54167],"916":[0,0.69444,0,0,0.83334],"920":[0,0.69444,0.07555,0,0.77778],"923":[0,0.69444,0,0,0.61111],"926":[0,0.69444,0.12816,0,0.66667],"928":[0,0.69444,0.08094,0,0.70834],"931":[0,0.69444,0.11983,0,0.72222],"933":[0,0.69444,0.09031,0,0.77778],"934":[0,0.69444,0.04603,0,0.72222],"936":[0,0.69444,0.09031,0,0.77778],"937":[0,0.69444,0.08293,0,0.72222],"8211":[0,0.44444,0.08616,0,0.5],"8212":[0,0.44444,0.08616,0,1],"8216":[0,0.69444,0.07816,0,0.27778],"8217":[0,0.69444,0.07816,0,0.27778],"8220":[0,0.69444,0.14205,0,0.5],"8221":[0,0.69444,0.00316,0,0.5]},"SansSerif-Regular":{"32":[0,0,0,0,0.25],"33":[0,0.69444,0,0,0.31945],"34":[0,0.69444,0,0,0.5],"35":[0.19444,0.69444,0,0,0.83334],"36":[0.05556,0.75,0,0,0.5],"37":[0.05556,0.75,0,0,0.83334],"38":[0,0.69444,0,0,0.75834],"39":[0,0.69444,0,0,0.27778],"40":[0.25,0.75,0,0,0.38889],"41":[0.25,0.75,0,0,0.38889],"42":[0,0.75,0,0,0.5],"43":[0.08333,0.58333,0,0,0.77778],"44":[0.125,0.08333,0,0,0.27778],"45":[0,0.44444,0,0,0.33333],"46":[0,0.08333,0,0,0.27778],"47":[0.25,0.75,0,0,0.5],"48":[0,0.65556,0,0,0.5],"49":[0,0.65556,0,0,0.5],"50":[0,0.65556,0,0,0.5],"51":[0,0.65556,0,0,0.5],"52":[0,0.65556,0,0,0.5],"53":[0,0.65556,0,0,0.5],"54":[0,0.65556,0,0,0.5],"55":[0,0.65556,0,0,0.5],"56":[0,0.65556,0,0,0.5],"57":[0,0.65556,0,0,0.5],"58":[0,0.44444,0,0,0.27778],"59":[0.125,0.44444,0,0,0.27778],"61":[-0.13,0.37,0,0,0.77778],"63":[0,0.69444,0,0,0.47222],"64":[0,0.69444,0,0,0.66667],"65":[0,0.69444,0,0,0.66667],"66":[0,0.69444,0,0,0.66667],"67":[0,0.69444,0,0,0.63889],"68":[0,0.69444,0,0,0.72223],"69":[0,0.69444,0,0,0.59722],"70":[0,0.69444,0,0,0.56945],"71":[0,0.69444,0,0,0.66667],"72":[0,0.69444,0,0,0.70834],"73":[0,0.69444,0,0,0.27778],"74":[0,0.69444,0,0,0.47222],"75":[0,0.69444,0,0,0.69445],"76":[0,0.69444,0,0,0.54167],"77":[0,0.69444,0,0,0.875],"78":[0,0.69444,0,0,0.70834],"79":[0,0.69444,0,0,0.73611],"80":[0,0.69444,0,0,0.63889],"81":[0.125,0.69444,0,0,0.73611],"82":[0,0.69444,0,0,0.64584],"83":[0,0.69444,0,0,0.55556],"84":[0,0.69444,0,0,0.68056],"85":[0,0.69444,0,0,0.6875],"86":[0,0.69444,0.01389,0,0.66667],"87":[0,0.69444,0.01389,0,0.94445],"88":[0,0.69444,0,0,0.66667],"89":[0,0.69444,0.025,0,0.66667],"90":[0,0.69444,0,0,0.61111],"91":[0.25,0.75,0,0,0.28889],"93":[0.25,0.75,0,0,0.28889],"94":[0,0.69444,0,0,0.5],"95":[0.35,0.09444,0.02778,0,0.5],"97":[0,0.44444,0,0,0.48056],"98":[0,0.69444,0,0,0.51667],"99":[0,0.44444,0,0,0.44445],"100":[0,0.69444,0,0,0.51667],"101":[0,0.44444,0,0,0.44445],"102":[0,0.69444,0.06944,0,0.30556],"103":[0.19444,0.44444,0.01389,0,0.5],"104":[0,0.69444,0,0,0.51667],"105":[0,0.67937,0,0,0.23889],"106":[0.19444,0.67937,0,0,0.26667],"107":[0,0.69444,0,0,0.48889],"108":[0,0.69444,0,0,0.23889],"109":[0,0.44444,0,0,0.79445],"110":[0,0.44444,0,0,0.51667],"111":[0,0.44444,0,0,0.5],"112":[0.19444,0.44444,0,0,0.51667],"113":[0.19444,0.44444,0,0,0.51667],"114":[0,0.44444,0.01389,0,0.34167],"115":[0,0.44444,0,0,0.38333],"116":[0,0.57143,0,0,0.36111],"117":[0,0.44444,0,0,0.51667],"118":[0,0.44444,0.01389,0,0.46111],"119":[0,0.44444,0.01389,0,0.68334],"120":[0,0.44444,0,0,0.46111],"121":[0.19444,0.44444,0.01389,0,0.46111],"122":[0,0.44444,0,0,0.43472],"126":[0.35,0.32659,0,0,0.5],"160":[0,0,0,0,0.25],"168":[0,0.67937,0,0,0.5],"176":[0,0.69444,0,0,0.66667],"184":[0.17014,0,0,0,0.44445],"305":[0,0.44444,0,0,0.23889],"567":[0.19444,0.44444,0,0,0.26667],"710":[0,0.69444,0,0,0.5],"711":[0,0.63194,0,0,0.5],"713":[0,0.60889,0,0,0.5],"714":[0,0.69444,0,0,0.5],"715":[0,0.69444,0,0,0.5],"728":[0,0.69444,0,0,0.5],"729":[0,0.67937,0,0,0.27778],"730":[0,0.69444,0,0,0.66667],"732":[0,0.67659,0,0,0.5],"733":[0,0.69444,0,0,0.5],"915":[0,0.69444,0,0,0.54167],"916":[0,0.69444,0,0,0.83334],"920":[0,0.69444,0,0,0.77778],"923":[0,0.69444,0,0,0.61111],"926":[0,0.69444,0,0,0.66667],"928":[0,0.69444,0,0,0.70834],"931":[0,0.69444,0,0,0.72222],"933":[0,0.69444,0,0,0.77778],"934":[0,0.69444,0,0,0.72222],"936":[0,0.69444,0,0,0.77778],"937":[0,0.69444,0,0,0.72222],"8211":[0,0.44444,0.02778,0,0.5],"8212":[0,0.44444,0.02778,0,1],"8216":[0,0.69444,0,0,0.27778],"8217":[0,0.69444,0,0,0.27778],"8220":[0,0.69444,0,0,0.5],"8221":[0,0.69444,0,0,0.5]},"Script-Regular":{"32":[0,0,0,0,0.25],"65":[0,0.7,0.22925,0,0.80253],"66":[0,0.7,0.04087,0,0.90757],"67":[0,0.7,0.1689,0,0.66619],"68":[0,0.7,0.09371,0,0.77443],"69":[0,0.7,0.18583,0,0.56162],"70":[0,0.7,0.13634,0,0.89544],"71":[0,0.7,0.17322,0,0.60961],"72":[0,0.7,0.29694,0,0.96919],"73":[0,0.7,0.19189,0,0.80907],"74":[0.27778,0.7,0.19189,0,1.05159],"75":[0,0.7,0.31259,0,0.91364],"76":[0,0.7,0.19189,0,0.87373],"77":[0,0.7,0.15981,0,1.08031],"78":[0,0.7,0.3525,0,0.9015],"79":[0,0.7,0.08078,0,0.73787],"80":[0,0.7,0.08078,0,1.01262],"81":[0,0.7,0.03305,0,0.88282],"82":[0,0.7,0.06259,0,0.85],"83":[0,0.7,0.19189,0,0.86767],"84":[0,0.7,0.29087,0,0.74697],"85":[0,0.7,0.25815,0,0.79996],"86":[0,0.7,0.27523,0,0.62204],"87":[0,0.7,0.27523,0,0.80532],"88":[0,0.7,0.26006,0,0.94445],"89":[0,0.7,0.2939,0,0.70961],"90":[0,0.7,0.24037,0,0.8212],"160":[0,0,0,0,0.25]},"Size1-Regular":{"32":[0,0,0,0,0.25],"40":[0.35001,0.85,0,0,0.45834],"41":[0.35001,0.85,0,0,0.45834],"47":[0.35001,0.85,0,0,0.57778],"91":[0.35001,0.85,0,0,0.41667],"92":[0.35001,0.85,0,0,0.57778],"93":[0.35001,0.85,0,0,0.41667],"123":[0.35001,0.85,0,0,0.58334],"125":[0.35001,0.85,0,0,0.58334],"160":[0,0,0,0,0.25],"710":[0,0.72222,0,0,0.55556],"732":[0,0.72222,0,0,0.55556],"770":[0,0.72222,0,0,0.55556],"771":[0,0.72222,0,0,0.55556],"8214":[-0.00099,0.601,0,0,0.77778],"8593":[0.00001,0.6,0,0,0.66667],"8595":[0.00001,0.6,0,0,0.66667],"8657":[0.00001,0.6,0,0,0.77778],"8659":[0.00001,0.6,0,0,0.77778],"8719":[0.25001,0.75,0,0,0.94445],"8720":[0.25001,0.75,0,0,0.94445],"8721":[0.25001,0.75,0,0,1.05556],"8730":[0.35001,0.85,0,0,1],"8739":[-0.00599,0.606,0,0,0.33333],"8741":[-0.00599,0.606,0,0,0.55556],"8747":[0.30612,0.805,0.19445,0,0.47222],"8748":[0.306,0.805,0.19445,0,0.47222],"8749":[0.306,0.805,0.19445,0,0.47222],"8750":[0.30612,0.805,0.19445,0,0.47222],"8896":[0.25001,0.75,0,0,0.83334],"8897":[0.25001,0.75,0,0,0.83334],"8898":[0.25001,0.75,0,0,0.83334],"8899":[0.25001,0.75,0,0,0.83334],"8968":[0.35001,0.85,0,0,0.47222],"8969":[0.35001,0.85,0,0,0.47222],"8970":[0.35001,0.85,0,0,0.47222],"8971":[0.35001,0.85,0,0,0.47222],"9168":[-0.00099,0.601,0,0,0.66667],"10216":[0.35001,0.85,0,0,0.47222],"10217":[0.35001,0.85,0,0,0.47222],"10752":[0.25001,0.75,0,0,1.11111],"10753":[0.25001,0.75,0,0,1.11111],"10754":[0.25001,0.75,0,0,1.11111],"10756":[0.25001,0.75,0,0,0.83334],"10758":[0.25001,0.75,0,0,0.83334]},"Size2-Regular":{"32":[0,0,0,0,0.25],"40":[0.65002,1.15,0,0,0.59722],"41":[0.65002,1.15,0,0,0.59722],"47":[0.65002,1.15,0,0,0.81111],"91":[0.65002,1.15,0,0,0.47222],"92":[0.65002,1.15,0,0,0.81111],"93":[0.65002,1.15,0,0,0.47222],"123":[0.65002,1.15,0,0,0.66667],"125":[0.65002,1.15,0,0,0.66667],"160":[0,0,0,0,0.25],"710":[0,0.75,0,0,1],"732":[0,0.75,0,0,1],"770":[0,0.75,0,0,1],"771":[0,0.75,0,0,1],"8719":[0.55001,1.05,0,0,1.27778],"8720":[0.55001,1.05,0,0,1.27778],"8721":[0.55001,1.05,0,0,1.44445],"8730":[0.65002,1.15,0,0,1],"8747":[0.86225,1.36,0.44445,0,0.55556],"8748":[0.862,1.36,0.44445,0,0.55556],"8749":[0.862,1.36,0.44445,0,0.55556],"8750":[0.86225,1.36,0.44445,0,0.55556],"8896":[0.55001,1.05,0,0,1.11111],"8897":[0.55001,1.05,0,0,1.11111],"8898":[0.55001,1.05,0,0,1.11111],"8899":[0.55001,1.05,0,0,1.11111],"8968":[0.65002,1.15,0,0,0.52778],"8969":[0.65002,1.15,0,0,0.52778],"8970":[0.65002,1.15,0,0,0.52778],"8971":[0.65002,1.15,0,0,0.52778],"10216":[0.65002,1.15,0,0,0.61111],"10217":[0.65002,1.15,0,0,0.61111],"10752":[0.55001,1.05,0,0,1.51112],"10753":[0.55001,1.05,0,0,1.51112],"10754":[0.55001,1.05,0,0,1.51112],"10756":[0.55001,1.05,0,0,1.11111],"10758":[0.55001,1.05,0,0,1.11111]},"Size3-Regular":{"32":[0,0,0,0,0.25],"40":[0.95003,1.45,0,0,0.73611],"41":[0.95003,1.45,0,0,0.73611],"47":[0.95003,1.45,0,0,1.04445],"91":[0.95003,1.45,0,0,0.52778],"92":[0.95003,1.45,0,0,1.04445],"93":[0.95003,1.45,0,0,0.52778],"123":[0.95003,1.45,0,0,0.75],"125":[0.95003,1.45,0,0,0.75],"160":[0,0,0,0,0.25],"710":[0,0.75,0,0,1.44445],"732":[0,0.75,0,0,1.44445],"770":[0,0.75,0,0,1.44445],"771":[0,0.75,0,0,1.44445],"8730":[0.95003,1.45,0,0,1],"8968":[0.95003,1.45,0,0,0.58334],"8969":[0.95003,1.45,0,0,0.58334],"8970":[0.95003,1.45,0,0,0.58334],"8971":[0.95003,1.45,0,0,0.58334],"10216":[0.95003,1.45,0,0,0.75],"10217":[0.95003,1.45,0,0,0.75]},"Size4-Regular":{"32":[0,0,0,0,0.25],"40":[1.25003,1.75,0,0,0.79167],"41":[1.25003,1.75,0,0,0.79167],"47":[1.25003,1.75,0,0,1.27778],"91":[1.25003,1.75,0,0,0.58334],"92":[1.25003,1.75,0,0,1.27778],"93":[1.25003,1.75,0,0,0.58334],"123":[1.25003,1.75,0,0,0.80556],"125":[1.25003,1.75,0,0,0.80556],"160":[0,0,0,0,0.25],"710":[0,0.825,0,0,1.8889],"732":[0,0.825,0,0,1.8889],"770":[0,0.825,0,0,1.8889],"771":[0,0.825,0,0,1.8889],"8730":[1.25003,1.75,0,0,1],"8968":[1.25003,1.75,0,0,0.63889],"8969":[1.25003,1.75,0,0,0.63889],"8970":[1.25003,1.75,0,0,0.63889],"8971":[1.25003,1.75,0,0,0.63889],"9115":[0.64502,1.155,0,0,0.875],"9116":[0.00001,0.6,0,0,0.875],"9117":[0.64502,1.155,0,0,0.875],"9118":[0.64502,1.155,0,0,0.875],"9119":[0.00001,0.6,0,0,0.875],"9120":[0.64502,1.155,0,0,0.875],"9121":[0.64502,1.155,0,0,0.66667],"9122":[-0.00099,0.601,0,0,0.66667],"9123":[0.64502,1.155,0,0,0.66667],"9124":[0.64502,1.155,0,0,0.66667],"9125":[-0.00099,0.601,0,0,0.66667],"9126":[0.64502,1.155,0,0,0.66667],"9127":[0.00001,0.9,0,0,0.88889],"9128":[0.65002,1.15,0,0,0.88889],"9129":[0.90001,0,0,0,0.88889],"9130":[0,0.3,0,0,0.88889],"9131":[0.00001,0.9,0,0,0.88889],"9132":[0.65002,1.15,0,0,0.88889],"9133":[0.90001,0,0,0,0.88889],"9143":[0.88502,0.915,0,0,1.05556],"10216":[1.25003,1.75,0,0,0.80556],"10217":[1.25003,1.75,0,0,0.80556],"57344":[-0.00499,0.605,0,0,1.05556],"57345":[-0.00499,0.605,0,0,1.05556],"57680":[0,0.12,0,0,0.45],"57681":[0,0.12,0,0,0.45],"57682":[0,0.12,0,0,0.45],"57683":[0,0.12,0,0,0.45]},"Typewriter-Regular":{"32":[0,0,0,0,0.525],"33":[0,0.61111,0,0,0.525],"34":[0,0.61111,0,0,0.525],"35":[0,0.61111,0,0,0.525],"36":[0.08333,0.69444,0,0,0.525],"37":[0.08333,0.69444,0,0,0.525],"38":[0,0.61111,0,0,0.525],"39":[0,0.61111,0,0,0.525],"40":[0.08333,0.69444,0,0,0.525],"41":[0.08333,0.69444,0,0,0.525],"42":[0,0.52083,0,0,0.525],"43":[-0.08056,0.53055,0,0,0.525],"44":[0.13889,0.125,0,0,0.525],"45":[-0.08056,0.53055,0,0,0.525],"46":[0,0.125,0,0,0.525],"47":[0.08333,0.69444,0,0,0.525],"48":[0,0.61111,0,0,0.525],"49":[0,0.61111,0,0,0.525],"50":[0,0.61111,0,0,0.525],"51":[0,0.61111,0,0,0.525],"52":[0,0.61111,0,0,0.525],"53":[0,0.61111,0,0,0.525],"54":[0,0.61111,0,0,0.525],"55":[0,0.61111,0,0,0.525],"56":[0,0.61111,0,0,0.525],"57":[0,0.61111,0,0,0.525],"58":[0,0.43056,0,0,0.525],"59":[0.13889,0.43056,0,0,0.525],"60":[-0.05556,0.55556,0,0,0.525],"61":[-0.19549,0.41562,0,0,0.525],"62":[-0.05556,0.55556,0,0,0.525],"63":[0,0.61111,0,0,0.525],"64":[0,0.61111,0,0,0.525],"65":[0,0.61111,0,0,0.525],"66":[0,0.61111,0,0,0.525],"67":[0,0.61111,0,0,0.525],"68":[0,0.61111,0,0,0.525],"69":[0,0.61111,0,0,0.525],"70":[0,0.61111,0,0,0.525],"71":[0,0.61111,0,0,0.525],"72":[0,0.61111,0,0,0.525],"73":[0,0.61111,0,0,0.525],"74":[0,0.61111,0,0,0.525],"75":[0,0.61111,0,0,0.525],"76":[0,0.61111,0,0,0.525],"77":[0,0.61111,0,0,0.525],"78":[0,0.61111,0,0,0.525],"79":[0,0.61111,0,0,0.525],"80":[0,0.61111,0,0,0.525],"81":[0.13889,0.61111,0,0,0.525],"82":[0,0.61111,0,0,0.525],"83":[0,0.61111,0,0,0.525],"84":[0,0.61111,0,0,0.525],"85":[0,0.61111,0,0,0.525],"86":[0,0.61111,0,0,0.525],"87":[0,0.61111,0,0,0.525],"88":[0,0.61111,0,0,0.525],"89":[0,0.61111,0,0,0.525],"90":[0,0.61111,0,0,0.525],"91":[0.08333,0.69444,0,0,0.525],"92":[0.08333,0.69444,0,0,0.525],"93":[0.08333,0.69444,0,0,0.525],"94":[0,0.61111,0,0,0.525],"95":[0.09514,0,0,0,0.525],"96":[0,0.61111,0,0,0.525],"97":[0,0.43056,0,0,0.525],"98":[0,0.61111,0,0,0.525],"99":[0,0.43056,0,0,0.525],"100":[0,0.61111,0,0,0.525],"101":[0,0.43056,0,0,0.525],"102":[0,0.61111,0,0,0.525],"103":[0.22222,0.43056,0,0,0.525],"104":[0,0.61111,0,0,0.525],"105":[0,0.61111,0,0,0.525],"106":[0.22222,0.61111,0,0,0.525],"107":[0,0.61111,0,0,0.525],"108":[0,0.61111,0,0,0.525],"109":[0,0.43056,0,0,0.525],"110":[0,0.43056,0,0,0.525],"111":[0,0.43056,0,0,0.525],"112":[0.22222,0.43056,0,0,0.525],"113":[0.22222,0.43056,0,0,0.525],"114":[0,0.43056,0,0,0.525],"115":[0,0.43056,0,0,0.525],"116":[0,0.55358,0,0,0.525],"117":[0,0.43056,0,0,0.525],"118":[0,0.43056,0,0,0.525],"119":[0,0.43056,0,0,0.525],"120":[0,0.43056,0,0,0.525],"121":[0.22222,0.43056,0,0,0.525],"122":[0,0.43056,0,0,0.525],"123":[0.08333,0.69444,0,0,0.525],"124":[0.08333,0.69444,0,0,0.525],"125":[0.08333,0.69444,0,0,0.525],"126":[0,0.61111,0,0,0.525],"127":[0,0.61111,0,0,0.525],"160":[0,0,0,0,0.525],"176":[0,0.61111,0,0,0.525],"184":[0.19445,0,0,0,0.525],"305":[0,0.43056,0,0,0.525],"567":[0.22222,0.43056,0,0,0.525],"711":[0,0.56597,0,0,0.525],"713":[0,0.56555,0,0,0.525],"714":[0,0.61111,0,0,0.525],"715":[0,0.61111,0,0,0.525],"728":[0,0.61111,0,0,0.525],"730":[0,0.61111,0,0,0.525],"770":[0,0.61111,0,0,0.525],"771":[0,0.61111,0,0,0.525],"776":[0,0.61111,0,0,0.525],"915":[0,0.61111,0,0,0.525],"916":[0,0.61111,0,0,0.525],"920":[0,0.61111,0,0,0.525],"923":[0,0.61111,0,0,0.525],"926":[0,0.61111,0,0,0.525],"928":[0,0.61111,0,0,0.525],"931":[0,0.61111,0,0,0.525],"933":[0,0.61111,0,0,0.525],"934":[0,0.61111,0,0,0.525],"936":[0,0.61111,0,0,0.525],"937":[0,0.61111,0,0,0.525],"8216":[0,0.61111,0,0,0.525],"8217":[0,0.61111,0,0,0.525],"8242":[0,0.61111,0,0,0.525],"9251":[0.11111,0.21944,0,0,0.525]}};var Co={slant:[0.25,0.25,0.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[0.431,0.431,0.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[0.677,0.732,0.925],num2:[0.394,0.384,0.387],num3:[0.444,0.471,0.504],denom1:[0.686,0.752,1.025],denom2:[0.345,0.344,0.532],sup1:[0.413,0.503,0.504],sup2:[0.363,0.431,0.404],sup3:[0.289,0.286,0.294],sub1:[0.15,0.143,0.2],sub2:[0.247,0.286,0.4],supDrop:[0.386,0.353,0.494],subDrop:[0.05,0.071,0.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[0.25,0.25,0.25],defaultRuleThickness:[0.04,0.049,0.049],bigOpSpacing1:[0.111,0.111,0.111],bigOpSpacing2:[0.166,0.166,0.166],bigOpSpacing3:[0.2,0.2,0.2],bigOpSpacing4:[0.6,0.611,0.611],bigOpSpacing5:[0.1,0.143,0.143],sqrtRuleThickness:[0.04,0.04,0.04],ptPerEm:[10,10,10],doubleRuleSep:[0.2,0.2,0.2],arrayRuleWidth:[0.04,0.04,0.04],fboxsep:[0.3,0.3,0.3],fboxrule:[0.04,0.04,0.04]},Xc={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function v4(e,t){mn[e]=t}function rl(e,t,n){if(!mn[t])throw Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),s=mn[t][r];if(!s&&e[0]in Xc)r=Xc[e[0]].charCodeAt(0),s=mn[t][r];if(!s&&n==="text"){if(Nu(r))s=mn[t][77]}if(s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var _o={};function y4(e){var t;if(e>=5)t=0;else if(e>=3)t=1;else t=2;if(!_o[t]){var n=_o[t]={cssEmPerMu:Co.quad[t]/18};for(var r of Object.keys(Co))n[r]=Co[r][t]}return _o[t]}var Ze={math:{},text:{}};function h(e,t,n,r,s,i){if(Ze[e][s]={font:t,group:n,replace:r},i&&r)Ze[e][r]=Ze[e][s]}var m="math",Z="text",v="main",_="ams",Ye="accent-token",fe="bin",Rt="close",rs="inner",ke="mathord",lt="op-token",Ut="open",ei="punct",R="rel",On="spacing",I="textord";h(m,v,R,"≡","\\equiv",!0);h(m,v,R,"≺","\\prec",!0);h(m,v,R,"≻","\\succ",!0);h(m,v,R,"∼","\\sim",!0);h(m,v,R,"⊥","\\perp");h(m,v,R,"⪯","\\preceq",!0);h(m,v,R,"⪰","\\succeq",!0);h(m,v,R,"≃","\\simeq",!0);h(m,v,R,"∣","\\mid",!0);h(m,v,R,"≪","\\ll",!0);h(m,v,R,"≫","\\gg",!0);h(m,v,R,"≍","\\asymp",!0);h(m,v,R,"∥","\\parallel");h(m,v,R,"⋈","\\bowtie",!0);h(m,v,R,"⌣","\\smile",!0);h(m,v,R,"⊑","\\sqsubseteq",!0);h(m,v,R,"⊒","\\sqsupseteq",!0);h(m,v,R,"≐","\\doteq",!0);h(m,v,R,"⌢","\\frown",!0);h(m,v,R,"∋","\\ni",!0);h(m,v,R,"∝","\\propto",!0);h(m,v,R,"⊢","\\vdash",!0);h(m,v,R,"⊣","\\dashv",!0);h(m,v,R,"∋","\\owns");h(m,v,ei,".","\\ldotp");h(m,v,ei,"⋅","\\cdotp");h(m,v,ei,"⋅","·");h(Z,v,I,"⋅","·");h(m,v,I,"#","\\#");h(Z,v,I,"#","\\#");h(m,v,I,"&","\\&");h(Z,v,I,"&","\\&");h(m,v,I,"ℵ","\\aleph",!0);h(m,v,I,"∀","\\forall",!0);h(m,v,I,"ℏ","\\hbar",!0);h(m,v,I,"∃","\\exists",!0);h(m,v,I,"∇","\\nabla",!0);h(m,v,I,"♭","\\flat",!0);h(m,v,I,"ℓ","\\ell",!0);h(m,v,I,"♮","\\natural",!0);h(m,v,I,"♣","\\clubsuit",!0);h(m,v,I,"℘","\\wp",!0);h(m,v,I,"♯","\\sharp",!0);h(m,v,I,"♢","\\diamondsuit",!0);h(m,v,I,"ℜ","\\Re",!0);h(m,v,I,"♡","\\heartsuit",!0);h(m,v,I,"ℑ","\\Im",!0);h(m,v,I,"♠","\\spadesuit",!0);h(m,v,I,"§","\\S",!0);h(Z,v,I,"§","\\S");h(m,v,I,"¶","\\P",!0);h(Z,v,I,"¶","\\P");h(m,v,I,"†","\\dag");h(Z,v,I,"†","\\dag");h(Z,v,I,"†","\\textdagger");h(m,v,I,"‡","\\ddag");h(Z,v,I,"‡","\\ddag");h(Z,v,I,"‡","\\textdaggerdbl");h(m,v,Rt,"⎱","\\rmoustache",!0);h(m,v,Ut,"⎰","\\lmoustache",!0);h(m,v,Rt,"⟯","\\rgroup",!0);h(m,v,Ut,"⟮","\\lgroup",!0);h(m,v,fe,"∓","\\mp",!0);h(m,v,fe,"⊖","\\ominus",!0);h(m,v,fe,"⊎","\\uplus",!0);h(m,v,fe,"⊓","\\sqcap",!0);h(m,v,fe,"∗","\\ast");h(m,v,fe,"⊔","\\sqcup",!0);h(m,v,fe,"◯","\\bigcirc",!0);h(m,v,fe,"∙","\\bullet",!0);h(m,v,fe,"‡","\\ddagger");h(m,v,fe,"≀","\\wr",!0);h(m,v,fe,"⨿","\\amalg");h(m,v,fe,"&","\\And");h(m,v,R,"⟵","\\longleftarrow",!0);h(m,v,R,"⇐","\\Leftarrow",!0);h(m,v,R,"⟸","\\Longleftarrow",!0);h(m,v,R,"⟶","\\longrightarrow",!0);h(m,v,R,"⇒","\\Rightarrow",!0);h(m,v,R,"⟹","\\Longrightarrow",!0);h(m,v,R,"↔","\\leftrightarrow",!0);h(m,v,R,"⟷","\\longleftrightarrow",!0);h(m,v,R,"⇔","\\Leftrightarrow",!0);h(m,v,R,"⟺","\\Longleftrightarrow",!0);h(m,v,R,"↦","\\mapsto",!0);h(m,v,R,"⟼","\\longmapsto",!0);h(m,v,R,"↗","\\nearrow",!0);h(m,v,R,"↩","\\hookleftarrow",!0);h(m,v,R,"↪","\\hookrightarrow",!0);h(m,v,R,"↘","\\searrow",!0);h(m,v,R,"↼","\\leftharpoonup",!0);h(m,v,R,"⇀","\\rightharpoonup",!0);h(m,v,R,"↙","\\swarrow",!0);h(m,v,R,"↽","\\leftharpoondown",!0);h(m,v,R,"⇁","\\rightharpoondown",!0);h(m,v,R,"↖","\\nwarrow",!0);h(m,v,R,"⇌","\\rightleftharpoons",!0);h(m,_,R,"≮","\\nless",!0);h(m,_,R,"","\\@nleqslant");h(m,_,R,"","\\@nleqq");h(m,_,R,"⪇","\\lneq",!0);h(m,_,R,"≨","\\lneqq",!0);h(m,_,R,"","\\@lvertneqq");h(m,_,R,"⋦","\\lnsim",!0);h(m,_,R,"⪉","\\lnapprox",!0);h(m,_,R,"⊀","\\nprec",!0);h(m,_,R,"⋠","\\npreceq",!0);h(m,_,R,"⋨","\\precnsim",!0);h(m,_,R,"⪹","\\precnapprox",!0);h(m,_,R,"≁","\\nsim",!0);h(m,_,R,"","\\@nshortmid");h(m,_,R,"∤","\\nmid",!0);h(m,_,R,"⊬","\\nvdash",!0);h(m,_,R,"⊭","\\nvDash",!0);h(m,_,R,"⋪","\\ntriangleleft");h(m,_,R,"⋬","\\ntrianglelefteq",!0);h(m,_,R,"⊊","\\subsetneq",!0);h(m,_,R,"","\\@varsubsetneq");h(m,_,R,"⫋","\\subsetneqq",!0);h(m,_,R,"","\\@varsubsetneqq");h(m,_,R,"≯","\\ngtr",!0);h(m,_,R,"","\\@ngeqslant");h(m,_,R,"","\\@ngeqq");h(m,_,R,"⪈","\\gneq",!0);h(m,_,R,"≩","\\gneqq",!0);h(m,_,R,"","\\@gvertneqq");h(m,_,R,"⋧","\\gnsim",!0);h(m,_,R,"⪊","\\gnapprox",!0);h(m,_,R,"⊁","\\nsucc",!0);h(m,_,R,"⋡","\\nsucceq",!0);h(m,_,R,"⋩","\\succnsim",!0);h(m,_,R,"⪺","\\succnapprox",!0);h(m,_,R,"≆","\\ncong",!0);h(m,_,R,"","\\@nshortparallel");h(m,_,R,"∦","\\nparallel",!0);h(m,_,R,"⊯","\\nVDash",!0);h(m,_,R,"⋫","\\ntriangleright");h(m,_,R,"⋭","\\ntrianglerighteq",!0);h(m,_,R,"","\\@nsupseteqq");h(m,_,R,"⊋","\\supsetneq",!0);h(m,_,R,"","\\@varsupsetneq");h(m,_,R,"⫌","\\supsetneqq",!0);h(m,_,R,"","\\@varsupsetneqq");h(m,_,R,"⊮","\\nVdash",!0);h(m,_,R,"⪵","\\precneqq",!0);h(m,_,R,"⪶","\\succneqq",!0);h(m,_,R,"","\\@nsubseteqq");h(m,_,fe,"⊴","\\unlhd");h(m,_,fe,"⊵","\\unrhd");h(m,_,R,"↚","\\nleftarrow",!0);h(m,_,R,"↛","\\nrightarrow",!0);h(m,_,R,"⇍","\\nLeftarrow",!0);h(m,_,R,"⇏","\\nRightarrow",!0);h(m,_,R,"↮","\\nleftrightarrow",!0);h(m,_,R,"⇎","\\nLeftrightarrow",!0);h(m,_,R,"△","\\vartriangle");h(m,_,I,"ℏ","\\hslash");h(m,_,I,"▽","\\triangledown");h(m,_,I,"◊","\\lozenge");h(m,_,I,"Ⓢ","\\circledS");h(m,_,I,"®","\\circledR");h(Z,_,I,"®","\\circledR");h(m,_,I,"∡","\\measuredangle",!0);h(m,_,I,"∄","\\nexists");h(m,_,I,"℧","\\mho");h(m,_,I,"Ⅎ","\\Finv",!0);h(m,_,I,"⅁","\\Game",!0);h(m,_,I,"‵","\\backprime");h(m,_,I,"▲","\\blacktriangle");h(m,_,I,"▼","\\blacktriangledown");h(m,_,I,"■","\\blacksquare");h(m,_,I,"⧫","\\blacklozenge");h(m,_,I,"★","\\bigstar");h(m,_,I,"∢","\\sphericalangle",!0);h(m,_,I,"∁","\\complement",!0);h(m,_,I,"ð","\\eth",!0);h(Z,v,I,"ð","ð");h(m,_,I,"╱","\\diagup");h(m,_,I,"╲","\\diagdown");h(m,_,I,"□","\\square");h(m,_,I,"□","\\Box");h(m,_,I,"◊","\\Diamond");h(m,_,I,"¥","\\yen",!0);h(Z,_,I,"¥","\\yen",!0);h(m,_,I,"✓","\\checkmark",!0);h(Z,_,I,"✓","\\checkmark");h(m,_,I,"ℶ","\\beth",!0);h(m,_,I,"ℸ","\\daleth",!0);h(m,_,I,"ℷ","\\gimel",!0);h(m,_,I,"ϝ","\\digamma",!0);h(m,_,I,"ϰ","\\varkappa");h(m,_,Ut,"┌","\\@ulcorner",!0);h(m,_,Rt,"┐","\\@urcorner",!0);h(m,_,Ut,"└","\\@llcorner",!0);h(m,_,Rt,"┘","\\@lrcorner",!0);h(m,_,R,"≦","\\leqq",!0);h(m,_,R,"⩽","\\leqslant",!0);h(m,_,R,"⪕","\\eqslantless",!0);h(m,_,R,"≲","\\lesssim",!0);h(m,_,R,"⪅","\\lessapprox",!0);h(m,_,R,"≊","\\approxeq",!0);h(m,_,fe,"⋖","\\lessdot");h(m,_,R,"⋘","\\lll",!0);h(m,_,R,"≶","\\lessgtr",!0);h(m,_,R,"⋚","\\lesseqgtr",!0);h(m,_,R,"⪋","\\lesseqqgtr",!0);h(m,_,R,"≑","\\doteqdot");h(m,_,R,"≓","\\risingdotseq",!0);h(m,_,R,"≒","\\fallingdotseq",!0);h(m,_,R,"∽","\\backsim",!0);h(m,_,R,"⋍","\\backsimeq",!0);h(m,_,R,"⫅","\\subseteqq",!0);h(m,_,R,"⋐","\\Subset",!0);h(m,_,R,"⊏","\\sqsubset",!0);h(m,_,R,"≼","\\preccurlyeq",!0);h(m,_,R,"⋞","\\curlyeqprec",!0);h(m,_,R,"≾","\\precsim",!0);h(m,_,R,"⪷","\\precapprox",!0);h(m,_,R,"⊲","\\vartriangleleft");h(m,_,R,"⊴","\\trianglelefteq");h(m,_,R,"⊨","\\vDash",!0);h(m,_,R,"⊪","\\Vvdash",!0);h(m,_,R,"⌣","\\smallsmile");h(m,_,R,"⌢","\\smallfrown");h(m,_,R,"≏","\\bumpeq",!0);h(m,_,R,"≎","\\Bumpeq",!0);h(m,_,R,"≧","\\geqq",!0);h(m,_,R,"⩾","\\geqslant",!0);h(m,_,R,"⪖","\\eqslantgtr",!0);h(m,_,R,"≳","\\gtrsim",!0);h(m,_,R,"⪆","\\gtrapprox",!0);h(m,_,fe,"⋗","\\gtrdot");h(m,_,R,"⋙","\\ggg",!0);h(m,_,R,"≷","\\gtrless",!0);h(m,_,R,"⋛","\\gtreqless",!0);h(m,_,R,"⪌","\\gtreqqless",!0);h(m,_,R,"≖","\\eqcirc",!0);h(m,_,R,"≗","\\circeq",!0);h(m,_,R,"≜","\\triangleq",!0);h(m,_,R,"∼","\\thicksim");h(m,_,R,"≈","\\thickapprox");h(m,_,R,"⫆","\\supseteqq",!0);h(m,_,R,"⋑","\\Supset",!0);h(m,_,R,"⊐","\\sqsupset",!0);h(m,_,R,"≽","\\succcurlyeq",!0);h(m,_,R,"⋟","\\curlyeqsucc",!0);h(m,_,R,"≿","\\succsim",!0);h(m,_,R,"⪸","\\succapprox",!0);h(m,_,R,"⊳","\\vartriangleright");h(m,_,R,"⊵","\\trianglerighteq");h(m,_,R,"⊩","\\Vdash",!0);h(m,_,R,"∣","\\shortmid");h(m,_,R,"∥","\\shortparallel");h(m,_,R,"≬","\\between",!0);h(m,_,R,"⋔","\\pitchfork",!0);h(m,_,R,"∝","\\varpropto");h(m,_,R,"◀","\\blacktriangleleft");h(m,_,R,"∴","\\therefore",!0);h(m,_,R,"∍","\\backepsilon");h(m,_,R,"▶","\\blacktriangleright");h(m,_,R,"∵","\\because",!0);h(m,_,R,"⋘","\\llless");h(m,_,R,"⋙","\\gggtr");h(m,_,fe,"⊲","\\lhd");h(m,_,fe,"⊳","\\rhd");h(m,_,R,"≂","\\eqsim",!0);h(m,v,R,"⋈","\\Join");h(m,_,R,"≑","\\Doteq",!0);h(m,_,fe,"∔","\\dotplus",!0);h(m,_,fe,"∖","\\smallsetminus");h(m,_,fe,"⋒","\\Cap",!0);h(m,_,fe,"⋓","\\Cup",!0);h(m,_,fe,"⩞","\\doublebarwedge",!0);h(m,_,fe,"⊟","\\boxminus",!0);h(m,_,fe,"⊞","\\boxplus",!0);h(m,_,fe,"⋇","\\divideontimes",!0);h(m,_,fe,"⋉","\\ltimes",!0);h(m,_,fe,"⋊","\\rtimes",!0);h(m,_,fe,"⋋","\\leftthreetimes",!0);h(m,_,fe,"⋌","\\rightthreetimes",!0);h(m,_,fe,"⋏","\\curlywedge",!0);h(m,_,fe,"⋎","\\curlyvee",!0);h(m,_,fe,"⊝","\\circleddash",!0);h(m,_,fe,"⊛","\\circledast",!0);h(m,_,fe,"⋅","\\centerdot");h(m,_,fe,"⊺","\\intercal",!0);h(m,_,fe,"⋒","\\doublecap");h(m,_,fe,"⋓","\\doublecup");h(m,_,fe,"⊠","\\boxtimes",!0);h(m,_,R,"⇢","\\dashrightarrow",!0);h(m,_,R,"⇠","\\dashleftarrow",!0);h(m,_,R,"⇇","\\leftleftarrows",!0);h(m,_,R,"⇆","\\leftrightarrows",!0);h(m,_,R,"⇚","\\Lleftarrow",!0);h(m,_,R,"↞","\\twoheadleftarrow",!0);h(m,_,R,"↢","\\leftarrowtail",!0);h(m,_,R,"↫","\\looparrowleft",!0);h(m,_,R,"⇋","\\leftrightharpoons",!0);h(m,_,R,"↶","\\curvearrowleft",!0);h(m,_,R,"↺","\\circlearrowleft",!0);h(m,_,R,"↰","\\Lsh",!0);h(m,_,R,"⇈","\\upuparrows",!0);h(m,_,R,"↿","\\upharpoonleft",!0);h(m,_,R,"⇃","\\downharpoonleft",!0);h(m,v,R,"⊶","\\origof",!0);h(m,v,R,"⊷","\\imageof",!0);h(m,_,R,"⊸","\\multimap",!0);h(m,_,R,"↭","\\leftrightsquigarrow",!0);h(m,_,R,"⇉","\\rightrightarrows",!0);h(m,_,R,"⇄","\\rightleftarrows",!0);h(m,_,R,"↠","\\twoheadrightarrow",!0);h(m,_,R,"↣","\\rightarrowtail",!0);h(m,_,R,"↬","\\looparrowright",!0);h(m,_,R,"↷","\\curvearrowright",!0);h(m,_,R,"↻","\\circlearrowright",!0);h(m,_,R,"↱","\\Rsh",!0);h(m,_,R,"⇊","\\downdownarrows",!0);h(m,_,R,"↾","\\upharpoonright",!0);h(m,_,R,"⇂","\\downharpoonright",!0);h(m,_,R,"⇝","\\rightsquigarrow",!0);h(m,_,R,"⇝","\\leadsto");h(m,_,R,"⇛","\\Rrightarrow",!0);h(m,_,R,"↾","\\restriction");h(m,v,I,"‘","`");h(m,v,I,"$","\\$");h(Z,v,I,"$","\\$");h(Z,v,I,"$","\\textdollar");h(m,v,I,"%","\\%");h(Z,v,I,"%","\\%");h(m,v,I,"_","\\_");h(Z,v,I,"_","\\_");h(Z,v,I,"_","\\textunderscore");h(m,v,I,"∠","\\angle",!0);h(m,v,I,"∞","\\infty",!0);h(m,v,I,"′","\\prime");h(m,v,I,"△","\\triangle");h(m,v,I,"Γ","\\Gamma",!0);h(m,v,I,"Δ","\\Delta",!0);h(m,v,I,"Θ","\\Theta",!0);h(m,v,I,"Λ","\\Lambda",!0);h(m,v,I,"Ξ","\\Xi",!0);h(m,v,I,"Π","\\Pi",!0);h(m,v,I,"Σ","\\Sigma",!0);h(m,v,I,"Υ","\\Upsilon",!0);h(m,v,I,"Φ","\\Phi",!0);h(m,v,I,"Ψ","\\Psi",!0);h(m,v,I,"Ω","\\Omega",!0);h(m,v,I,"A","Α");h(m,v,I,"B","Β");h(m,v,I,"E","Ε");h(m,v,I,"Z","Ζ");h(m,v,I,"H","Η");h(m,v,I,"I","Ι");h(m,v,I,"K","Κ");h(m,v,I,"M","Μ");h(m,v,I,"N","Ν");h(m,v,I,"O","Ο");h(m,v,I,"P","Ρ");h(m,v,I,"T","Τ");h(m,v,I,"X","Χ");h(m,v,I,"¬","\\neg",!0);h(m,v,I,"¬","\\lnot");h(m,v,I,"⊤","\\top");h(m,v,I,"⊥","\\bot");h(m,v,I,"∅","\\emptyset");h(m,_,I,"∅","\\varnothing");h(m,v,ke,"α","\\alpha",!0);h(m,v,ke,"β","\\beta",!0);h(m,v,ke,"γ","\\gamma",!0);h(m,v,ke,"δ","\\delta",!0);h(m,v,ke,"ϵ","\\epsilon",!0);h(m,v,ke,"ζ","\\zeta",!0);h(m,v,ke,"η","\\eta",!0);h(m,v,ke,"θ","\\theta",!0);h(m,v,ke,"ι","\\iota",!0);h(m,v,ke,"κ","\\kappa",!0);h(m,v,ke,"λ","\\lambda",!0);h(m,v,ke,"μ","\\mu",!0);h(m,v,ke,"ν","\\nu",!0);h(m,v,ke,"ξ","\\xi",!0);h(m,v,ke,"ο","\\omicron",!0);h(m,v,ke,"π","\\pi",!0);h(m,v,ke,"ρ","\\rho",!0);h(m,v,ke,"σ","\\sigma",!0);h(m,v,ke,"τ","\\tau",!0);h(m,v,ke,"υ","\\upsilon",!0);h(m,v,ke,"ϕ","\\phi",!0);h(m,v,ke,"χ","\\chi",!0);h(m,v,ke,"ψ","\\psi",!0);h(m,v,ke,"ω","\\omega",!0);h(m,v,ke,"ε","\\varepsilon",!0);h(m,v,ke,"ϑ","\\vartheta",!0);h(m,v,ke,"ϖ","\\varpi",!0);h(m,v,ke,"ϱ","\\varrho",!0);h(m,v,ke,"ς","\\varsigma",!0);h(m,v,ke,"φ","\\varphi",!0);h(m,v,fe,"∗","*",!0);h(m,v,fe,"+","+");h(m,v,fe,"−","-",!0);h(m,v,fe,"⋅","\\cdot",!0);h(m,v,fe,"∘","\\circ",!0);h(m,v,fe,"÷","\\div",!0);h(m,v,fe,"±","\\pm",!0);h(m,v,fe,"×","\\times",!0);h(m,v,fe,"∩","\\cap",!0);h(m,v,fe,"∪","\\cup",!0);h(m,v,fe,"∖","\\setminus",!0);h(m,v,fe,"∧","\\land");h(m,v,fe,"∨","\\lor");h(m,v,fe,"∧","\\wedge",!0);h(m,v,fe,"∨","\\vee",!0);h(m,v,I,"√","\\surd");h(m,v,Ut,"⟨","\\langle",!0);h(m,v,Ut,"∣","\\lvert");h(m,v,Ut,"∥","\\lVert");h(m,v,Rt,"?","?");h(m,v,Rt,"!","!");h(m,v,Rt,"⟩","\\rangle",!0);h(m,v,Rt,"∣","\\rvert");h(m,v,Rt,"∥","\\rVert");h(m,v,R,"=","=");h(m,v,R,":",":");h(m,v,R,"≈","\\approx",!0);h(m,v,R,"≅","\\cong",!0);h(m,v,R,"≥","\\ge");h(m,v,R,"≥","\\geq",!0);h(m,v,R,"←","\\gets");h(m,v,R,">","\\gt",!0);h(m,v,R,"∈","\\in",!0);h(m,v,R,"","\\@not");h(m,v,R,"⊂","\\subset",!0);h(m,v,R,"⊃","\\supset",!0);h(m,v,R,"⊆","\\subseteq",!0);h(m,v,R,"⊇","\\supseteq",!0);h(m,_,R,"⊈","\\nsubseteq",!0);h(m,_,R,"⊉","\\nsupseteq",!0);h(m,v,R,"⊨","\\models");h(m,v,R,"←","\\leftarrow",!0);h(m,v,R,"≤","\\le");h(m,v,R,"≤","\\leq",!0);h(m,v,R,"<","\\lt",!0);h(m,v,R,"→","\\rightarrow",!0);h(m,v,R,"→","\\to");h(m,_,R,"≱","\\ngeq",!0);h(m,_,R,"≰","\\nleq",!0);h(m,v,On," ","\\ ");h(m,v,On," ","\\space");h(m,v,On," ","\\nobreakspace");h(Z,v,On," ","\\ ");h(Z,v,On," "," ");h(Z,v,On," ","\\space");h(Z,v,On," ","\\nobreakspace");h(m,v,On,"","\\nobreak");h(m,v,On,"","\\allowbreak");h(m,v,ei,",",",");h(m,v,ei,";",";");h(m,_,fe,"⊼","\\barwedge",!0);h(m,_,fe,"⊻","\\veebar",!0);h(m,v,fe,"⊙","\\odot",!0);h(m,v,fe,"⊕","\\oplus",!0);h(m,v,fe,"⊗","\\otimes",!0);h(m,v,I,"∂","\\partial",!0);h(m,v,fe,"⊘","\\oslash",!0);h(m,_,fe,"⊚","\\circledcirc",!0);h(m,_,fe,"⊡","\\boxdot",!0);h(m,v,fe,"△","\\bigtriangleup");h(m,v,fe,"▽","\\bigtriangledown");h(m,v,fe,"†","\\dagger");h(m,v,fe,"⋄","\\diamond");h(m,v,fe,"⋆","\\star");h(m,v,fe,"◃","\\triangleleft");h(m,v,fe,"▹","\\triangleright");h(m,v,Ut,"{","\\{");h(Z,v,I,"{","\\{");h(Z,v,I,"{","\\textbraceleft");h(m,v,Rt,"}","\\}");h(Z,v,I,"}","\\}");h(Z,v,I,"}","\\textbraceright");h(m,v,Ut,"{","\\lbrace");h(m,v,Rt,"}","\\rbrace");h(m,v,Ut,"[","\\lbrack",!0);h(Z,v,I,"[","\\lbrack",!0);h(m,v,Rt,"]","\\rbrack",!0);h(Z,v,I,"]","\\rbrack",!0);h(m,v,Ut,"(","\\lparen",!0);h(m,v,Rt,")","\\rparen",!0);h(Z,v,I,"<","\\textless",!0);h(Z,v,I,">","\\textgreater",!0);h(m,v,Ut,"⌊","\\lfloor",!0);h(m,v,Rt,"⌋","\\rfloor",!0);h(m,v,Ut,"⌈","\\lceil",!0);h(m,v,Rt,"⌉","\\rceil",!0);h(m,v,I,"\\","\\backslash");h(m,v,I,"∣","|");h(m,v,I,"∣","\\vert");h(Z,v,I,"|","\\textbar",!0);h(m,v,I,"∥","\\|");h(m,v,I,"∥","\\Vert");h(Z,v,I,"∥","\\textbardbl");h(Z,v,I,"~","\\textasciitilde");h(Z,v,I,"\\","\\textbackslash");h(Z,v,I,"^","\\textasciicircum");h(m,v,R,"↑","\\uparrow",!0);h(m,v,R,"⇑","\\Uparrow",!0);h(m,v,R,"↓","\\downarrow",!0);h(m,v,R,"⇓","\\Downarrow",!0);h(m,v,R,"↕","\\updownarrow",!0);h(m,v,R,"⇕","\\Updownarrow",!0);h(m,v,lt,"∐","\\coprod");h(m,v,lt,"⋁","\\bigvee");h(m,v,lt,"⋀","\\bigwedge");h(m,v,lt,"⨄","\\biguplus");h(m,v,lt,"⋂","\\bigcap");h(m,v,lt,"⋃","\\bigcup");h(m,v,lt,"∫","\\int");h(m,v,lt,"∫","\\intop");h(m,v,lt,"∬","\\iint");h(m,v,lt,"∭","\\iiint");h(m,v,lt,"∏","\\prod");h(m,v,lt,"∑","\\sum");h(m,v,lt,"⨂","\\bigotimes");h(m,v,lt,"⨁","\\bigoplus");h(m,v,lt,"⨀","\\bigodot");h(m,v,lt,"∮","\\oint");h(m,v,lt,"∯","\\oiint");h(m,v,lt,"∰","\\oiiint");h(m,v,lt,"⨆","\\bigsqcup");h(m,v,lt,"∫","\\smallint");h(Z,v,rs,"…","\\textellipsis");h(m,v,rs,"…","\\mathellipsis");h(Z,v,rs,"…","\\ldots",!0);h(m,v,rs,"…","\\ldots",!0);h(m,v,rs,"⋯","\\@cdots",!0);h(m,v,rs,"⋱","\\ddots",!0);h(m,v,I,"⋮","\\varvdots");h(Z,v,I,"⋮","\\varvdots");h(m,v,Ye,"ˊ","\\acute");h(m,v,Ye,"ˋ","\\grave");h(m,v,Ye,"¨","\\ddot");h(m,v,Ye,"~","\\tilde");h(m,v,Ye,"ˉ","\\bar");h(m,v,Ye,"˘","\\breve");h(m,v,Ye,"ˇ","\\check");h(m,v,Ye,"^","\\hat");h(m,v,Ye,"⃗","\\vec");h(m,v,Ye,"˙","\\dot");h(m,v,Ye,"˚","\\mathring");h(m,v,ke,"","\\@imath");h(m,v,ke,"","\\@jmath");h(m,v,I,"ı","ı");h(m,v,I,"ȷ","ȷ");h(Z,v,I,"ı","\\i",!0);h(Z,v,I,"ȷ","\\j",!0);h(Z,v,I,"ß","\\ss",!0);h(Z,v,I,"æ","\\ae",!0);h(Z,v,I,"œ","\\oe",!0);h(Z,v,I,"ø","\\o",!0);h(Z,v,I,"Æ","\\AE",!0);h(Z,v,I,"Œ","\\OE",!0);h(Z,v,I,"Ø","\\O",!0);h(Z,v,Ye,"ˊ","\\'");h(Z,v,Ye,"ˋ","\\`");h(Z,v,Ye,"ˆ","\\^");h(Z,v,Ye,"˜","\\~");h(Z,v,Ye,"ˉ","\\=");h(Z,v,Ye,"˘","\\u");h(Z,v,Ye,"˙","\\.");h(Z,v,Ye,"¸","\\c");h(Z,v,Ye,"˚","\\r");h(Z,v,Ye,"ˇ","\\v");h(Z,v,Ye,"¨","\\\"");h(Z,v,Ye,"˝","\\H");h(Z,v,Ye,"◯","\\textcircled");var qu={"--":!0,"---":!0,"``":!0,"''":!0};h(Z,v,I,"–","--",!0);h(Z,v,I,"–","\\textendash");h(Z,v,I,"—","---",!0);h(Z,v,I,"—","\\textemdash");h(Z,v,I,"‘","`",!0);h(Z,v,I,"‘","\\textquoteleft");h(Z,v,I,"’","'",!0);h(Z,v,I,"’","\\textquoteright");h(Z,v,I,"“","``",!0);h(Z,v,I,"“","\\textquotedblleft");h(Z,v,I,"”","''",!0);h(Z,v,I,"”","\\textquotedblright");h(m,v,I,"°","\\degree",!0);h(Z,v,I,"°","\\degree");h(Z,v,I,"°","\\textdegree",!0);h(m,v,I,"£","\\pounds");h(m,v,I,"£","\\mathsterling",!0);h(Z,v,I,"£","\\pounds");h(Z,v,I,"£","\\textsterling",!0);h(m,_,I,"✠","\\maltese");h(Z,_,I,"✠","\\maltese");var Qc='0123456789/@."';for(Ps=0;Ps<Qc.length;Ps++)ea=Qc.charAt(Ps),h(m,v,I,ea,ea);var ea,Ps,eu='0123456789!@*()-=+";:?/.,';for(Us=0;Us<eu.length;Us++)ta=eu.charAt(Us),h(Z,v,I,ta,ta);var ta,Us,sa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(Ws=0;Ws<sa.length;Ws++)Yr=sa.charAt(Ws),h(m,v,ke,Yr,Yr),h(Z,v,I,Yr,Yr);var Yr,Ws;h(m,_,I,"C","ℂ");h(Z,_,I,"C","ℂ");h(m,_,I,"H","ℍ");h(Z,_,I,"H","ℍ");h(m,_,I,"N","ℕ");h(Z,_,I,"N","ℕ");h(m,_,I,"P","ℙ");h(Z,_,I,"P","ℙ");h(m,_,I,"Q","ℚ");h(Z,_,I,"Q","ℚ");h(m,_,I,"R","ℝ");h(Z,_,I,"R","ℝ");h(m,_,I,"Z","ℤ");h(Z,_,I,"Z","ℤ");h(m,v,ke,"h","ℎ");h(Z,v,ke,"h","ℎ");var Ae;for(kt=0;kt<sa.length;kt++)if(Je=sa.charAt(kt),Ae=String.fromCharCode(55349,56320+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56372+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56424+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56580+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56684+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56736+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56788+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56840+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56944+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),kt<26)Ae=String.fromCharCode(55349,56632+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae),Ae=String.fromCharCode(55349,56476+kt),h(m,v,ke,Je,Ae),h(Z,v,I,Je,Ae);var Je,kt;Ae=String.fromCharCode(55349,56668);h(m,v,ke,"k",Ae);h(Z,v,I,"k",Ae);for(Dn=0;Dn<10;Dn++)hn=Dn.toString(),Ae=String.fromCharCode(55349,57294+Dn),h(m,v,ke,hn,Ae),h(Z,v,I,hn,Ae),Ae=String.fromCharCode(55349,57314+Dn),h(m,v,ke,hn,Ae),h(Z,v,I,hn,Ae),Ae=String.fromCharCode(55349,57324+Dn),h(m,v,ke,hn,Ae),h(Z,v,I,hn,Ae),Ae=String.fromCharCode(55349,57334+Dn),h(m,v,ke,hn,Ae),h(Z,v,I,hn,Ae);var hn,Dn,$o="ÐÞþ";for(js=0;js<$o.length;js++)Xr=$o.charAt(js),h(m,v,ke,Xr,Xr),h(Z,v,I,Xr,Xr);var Xr,js,qo={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},tu={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},nu={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},w4={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Er={mathClass:"",textClass:"",font:""},ru={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},su={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},iu={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Ho={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Po={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},au={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Uo={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},ou=[qo,qo,tu,tu,nu,nu,w4,Er,Er,Er,ru,ru,su,su,iu,iu,Ho,Ho,Po,Po,au,au,Er,Er,Uo,Uo],k4=[qo,Er,Ho,Po,Uo],x4=(e)=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return ou[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return k4[i]}else if(r===120485||r===120486)return ou[0];else if(120486<r&&r<120782)return Er;else throw new te("Unsupported character: "+e)};function Ot(e){var{strict:t,errorCode:n,errorMsg:r,token:s,report:i}=e,a=t;if(typeof t==="function")if(i)a=t(n,r,s);else try{a=t(n,r,s)}catch(o){a="error"}switch(a){case!0:case"error":if(i)throw new te("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+n+"]"),s);else return!0;case!1:case"ignore":if(!i)return!1;break;case"warn":default:if(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+n+"]")),!i)return!1;break}}var aa=function(t,n,r){if(Ze[r][t]){var s=Ze[r][t].replace;if(s)t=s}return{value:t,metrics:rl(t,n,r)}},Tt=function(t,n,r,s,i){var a=aa(t,n,r),o=a.metrics;t=a.value;var l;if(o){var u=o.italic;if(r==="text"||s&&s.font==="mathit")u=0;l=new zt(t,o.height,o.depth,u,o.skew,o.width,i)}else Ot({strict:s.strict,errorCode:"symbolNotInFont",errorMsg:"No character metrics for '"+t+"' in style '"+n+"' and mode '"+r+"'",report:!0}),l=new zt(t,0,0,0,0,0,i);if(l.maxFontSize=s.sizeMultiplier,s.style.isTight())l.classes.push("mtight");var d=s.getColor();if(d)l.style.color=d;return l},sl=function(t,n,r,s){if(s===void 0)s=[];if(r.font==="boldsymbol"&&aa(t,"Main-Bold",n).metrics)return Tt(t,"Main-Bold",n,r,s.concat(["mathbf"]));else if(t==="\\"||Ze[n][t].font==="main")return Tt(t,"Main-Regular",n,r,s);else return Tt(t,"AMS-Regular",n,r,s.concat(["amsrm"]))},E4=function(t,n,r){if(r!=="textord"&&aa(t,"Math-BoldItalic",n).metrics)return{fontName:"Math-BoldItalic",fontClass:"boldsymbol"};else return{fontName:"Main-Bold",fontClass:"mathbf"}},oa=function(t,n){var r=t.type==="mathord"?"mathord":"textord",{mode:s,text:i}=t,a=["mord"],{font:o,fontFamily:l,fontWeight:u,fontShape:d}=n,f=s==="math"||s==="text"&&!!o,p=f?o:l,g="",b="";if(i.charCodeAt(0)===55349){var x=x4(i);g=x.font,b=x[s+"Class"]}if(g)return Tt(i,g,s,n,a.concat(b));else if(p){var k,A;if(p==="boldsymbol"){var T=E4(i,s,r);k=T.fontName,A=[T.fontClass]}else if(f)k=Wo[o].fontName,A=[o];else k=Ki(l,u,d),A=[l,u,d];if(aa(i,k,s).metrics)return Tt(i,k,s,n,a.concat(A));else if(Object.prototype.hasOwnProperty.call(qu,i)&&k.slice(0,10)==="Typewriter"){var S=[];for(var E=0;E<i.length;E++)S.push(Tt(i[E],k,s,n,a.concat(A)));return zn(S)}}if(r==="mathord")return Tt(i,"Math-Italic",s,n,a.concat(["mathnormal"]));else if(r==="textord"){var D=Ze[s][i]&&Ze[s][i].font;if(D==="ams"){var M=Ki("amsrm",u,d);return Tt(i,M,s,n,a.concat("amsrm",u,d))}else if(D==="main"||!D){var L=Ki("textrm",u,d);return Tt(i,L,s,n,a.concat(u,d))}else{var z=Ki(D,u,d);return Tt(i,z,s,n,a.concat(z,u,d))}}else throw Error("unexpected type: "+r+" in makeOrd")},A4=(e,t)=>{if(rr(e.classes)!==rr(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},Hu=(e)=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];if(n instanceof zt&&r instanceof zt&&A4(n,r))n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--}return e},il=function(t){var n=0,r=0,s=0;for(var i=0;i<t.children.length;i++){var a=t.children[i];if(a.height>n)n=a.height;if(a.depth>r)r=a.depth;if(a.maxFontSize>s)s=a.maxFontSize}t.height=n,t.depth=r,t.maxFontSize=s},X=function(t,n,r,s){var i=new Cr(t,n,r,s);return il(i),i},sr=(e,t,n,r)=>new Cr(e,t,n,r),ts=function(t,n,r){var s=X([t],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=ae(s.height),s.maxFontSize=1,s},C4=function(t,n,r,s){var i=new Qs(t,n,r,s);return il(i),i},zn=function(t){var n=new Ar(t);return il(n),n},ns=function(t,n){if(t instanceof Ar)return X([],[t],n);return t},_4=function(t){if(t.positionType==="individualShift"){var n=t.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s;for(var a=1;a<n.length;a++){var o=-n[a].shift-i-n[a].elem.depth,l=o-(n[a-1].elem.height+n[a-1].elem.depth);i=i+o,r.push({type:"kern",size:l}),r.push(n[a])}return{children:r,depth:s}}var u;if(t.positionType==="top"){var d=t.positionData;for(var f=0;f<t.children.length;f++){var p=t.children[f];d-=p.type==="kern"?p.size:p.elem.height+p.elem.depth}u=d}else if(t.positionType==="bottom")u=-t.positionData;else{var g=t.children[0];if(g.type!=="elem")throw Error('First child must have type "elem".');if(t.positionType==="shift")u=-g.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")u=-g.elem.depth;else throw Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:u}},Oe=function(t,n){var r=_4(t),{children:s,depth:i}=r,a=0;for(var o=0;o<s.length;o++){var l=s[o];if(l.type==="elem"){var u=l.elem;a=Math.max(a,u.maxFontSize,u.height)}}a+=2;var d=X(["pstrut"],[]);d.style.height=ae(a);var f=[],p=i,g=i,b=i;for(var x=0;x<s.length;x++){var k=s[x];if(k.type==="kern")b+=k.size;else{var A=k.elem,T=k.wrapperClasses||[],S=k.wrapperStyle||{},E=X(T,[d,A],void 0,S);if(E.style.top=ae(-a-b-A.depth),k.marginLeft)E.style.marginLeft=k.marginLeft;if(k.marginRight)E.style.marginRight=k.marginRight;f.push(E),b+=A.height+A.depth}p=Math.min(p,b),g=Math.max(g,b)}var D=X(["vlist"],f);D.style.height=ae(g);var M;if(p<0){var L=X([],[]),z=X(["vlist"],[L]);z.style.height=ae(-p);var O=X(["vlist-s"],[new zt("")]);M=[X(["vlist-r"],[D,O]),X(["vlist-r"],[z])]}else M=[X(["vlist-r"],[D])];var P=X(["vlist-t"],M);if(M.length===2)P.classes.push("vlist-t2");return P.height=g,P.depth=-p,P},Pu=(e,t)=>{var n=X(["mspace"],[],t),r=et(e,t);return n.style.marginRight=ae(r),n},Ki=(e,t,n)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}if(t==="textbf"&&n==="textit")s="BoldItalic";else if(t==="textbf")s="Bold";else if(n==="textit")s="Italic";else s="Regular";return r+"-"+s},Wo={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Uu={vec:["vec",0.471,0.714],oiintSize1:["oiintSize1",0.957,0.499],oiintSize2:["oiintSize2",1.472,0.659],oiiintSize1:["oiiintSize1",1.304,0.499],oiiintSize2:["oiiintSize2",1.98,0.659]},Wu=function(t,n){var r=Uu[t],s=r[0],i=r[1],a=r[2],o=new Nn(s),l=new pn([o],{width:ae(i),height:ae(a),style:"width:"+ae(i),viewBox:"0 0 "+1000*i+" "+1000*a,preserveAspectRatio:"xMinYMin"}),u=sr(["katex-overlay"],[l],n);return u.height=a,u.style.height=ae(a),u.style.width=ae(i),u},Qe={number:3,unit:"mu"},xr={number:4,unit:"mu"},Rn={number:5,unit:"mu"},T4={mord:{mop:Qe,mbin:xr,mrel:Rn,minner:Qe},mop:{mord:Qe,mop:Qe,mrel:Rn,minner:Qe},mbin:{mord:xr,mop:xr,mopen:xr,minner:xr},mrel:{mord:Rn,mop:Rn,mopen:Rn,minner:Rn},mopen:{},mclose:{mop:Qe,mbin:xr,mrel:Rn,minner:Qe},mpunct:{mord:Qe,mop:Qe,mrel:Rn,mopen:Qe,mclose:Qe,mpunct:Qe,minner:Qe},minner:{mord:Qe,mop:Qe,mbin:xr,mrel:Rn,mopen:Qe,mpunct:Qe,minner:Qe}},S4={mord:{mop:Qe},mop:{mord:Qe,mop:Qe},mbin:{},mrel:{},mopen:{},mclose:{mop:Qe},mpunct:{},minner:{mop:Qe}},ju={},Js={},Zs={};function he(e){var{type:t,names:n,htmlBuilder:r,mathmlBuilder:s}=e;for(var i=0;i<n.length;++i)ju[n[i]]=e;if(t){if(r)Js[t]=r;if(s)Zs[t]=s}}function _r(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;if(n)Js[t]=n;if(r)Zs[t]=r}var Ys=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},ot=function(t){return t.type==="ordgroup"?t.body:[t]},R4=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),M4=new Set(["rightmost","mrel","mclose","mpunct"]),D4={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT},L4={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},dt=function(t,n,r,s){if(s===void 0)s=[null,null];var i=[];for(var a=0;a<t.length;a++){var o=Ne(t[a],n);if(o instanceof Ar){var l=o.children;i.push(...l)}else i.push(o)}if(Hu(i),!r)return i;var u=n;if(t.length===1){var d=t[0];if(d.type==="sizing")u=n.havingSize(d.size);else if(d.type==="styling")u=n.havingStyle(D4[d.style])}var f=X([s[0]||"leftmost"],[],n),p=X([s[1]||"rightmost"],[],n),g=r==="root";return jo(i,(b,x)=>{var k=x.classes[0],A=b.classes[0];if(k==="mbin"&&M4.has(A))x.classes[0]="mord";else if(A==="mbin"&&R4.has(k))b.classes[0]="mord"},{node:f},p,g),jo(i,(b,x)=>{var k,A,T=Ko(x),S=Ko(b),E=T&&S?b.hasClass("mtight")?(k=S4[T])==null?void 0:k[S]:(A=T4[T])==null?void 0:A[S]:null;if(E)return Pu(E,u)},{node:f},p,g),i},jo=function(t,n,r,s,i){if(s)t.push(s);var a=0;for(;a<t.length;a++){var o=t[a],l=Gu(o);if(l){jo(l.children,n,r,null,i);continue}var u=!o.hasClass("mspace");if(u){var d=n(o,r.node);if(d)if(r.insertAfter)r.insertAfter(d);else t.unshift(d),a++}if(u)r.node=o;else if(i&&o.hasClass("katex-newline"))r.node=X(["leftmost"]);r.insertAfter=((f)=>(p)=>{t.splice(f+1,0,p),a++})(a)}if(s)t.pop()},Gu=function(t){if(t instanceof Ar||t instanceof Qs||t instanceof Cr&&t.hasClass("enclosing"))return t;return null},Go=function(t,n){var r=Gu(t);if(r){var s=r.children;if(s.length){if(n==="right")return Go(s[s.length-1],"right");else if(n==="left")return Go(s[0],"left")}}return t},Ko=function(t,n){if(!t)return null;if(n)t=Go(t,n);var r=t.classes[0];return L4[r]||null},Xs=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return X(n.concat(r))},Ne=function(t,n,r){if(!t)return X();if(Js[t.type]){var s=Js[t.type](t,n);if(r&&n.size!==r.size){s=X(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new te("Got group of unknown type: '"+t.type+"'")};function Vi(e,t){var n=X(["katex-base"],e,t),r=X(["katex-strut"]);if(r.style.height=ae(n.height+n.depth),n.depth)r.style.verticalAlign=ae(-n.depth);return n.children.unshift(r),n}function Vo(e,t){var n=null;if(e.length===1&&e[0].type==="tag")n=e[0].tag,e=e[0].body;var r=dt(e,t,"root"),s;if(r.length===2&&r[1].hasClass("katex-tag"))s=r.pop();var i=[],a=[];for(var o=0;o<r.length;o++)if(a.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){var l=!1;while(o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("katex-newline"))if(o++,a.push(r[o]),r[o].hasClass("nobreak"))l=!0;if(!l)i.push(Vi(a,t)),a=[]}else if(r[o].hasClass("katex-newline")){if(a.pop(),a.length>0)i.push(Vi(a,t)),a=[];i.push(r[o])}if(a.length>0)i.push(Vi(a,t));var u;if(n)u=Vi(dt(n,t,!0),t),u.classes=["katex-tag"],i.push(u);else if(s)i.push(s);var d=X(["katex-html"],i);if(d.setAttribute("aria-hidden","true"),u){var f=u.children[0];if(f.style.height=ae(d.height+d.depth),d.depth)f.style.verticalAlign=ae(-d.depth)}return d}function Ku(e){return new Ar(e)}class ne{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}if(this.classes.length>0)e.className=rr(this.classes);for(var s=0;s<this.children.length;s++)if(this.children[s]instanceof st&&this.children[s+1]instanceof st){var i=this.children[s].toText()+this.children[++s].toText();while(this.children[s+1]instanceof st)i+=this.children[++s].toText();e.appendChild(new st(i).toNode())}else e.appendChild(this.children[s].toNode());return e}toMarkup(){var e="<"+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=" "+n+'="',e+=At(r),e+='"'}if(this.classes.length>0)e+=' class ="'+At(rr(this.classes))+'"';e+=">";for(var s=0;s<this.children.length;s++)e+=this.children[s].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map((e)=>e.toText()).join("")}}class st{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return At(this.toText())}toText(){return this.text}}class al{constructor(e){if(this.width=void 0,this.character=void 0,this.width=e,e>=0.05555&&e<=0.05556)this.character=" ";else if(e>=0.1666&&e<=0.1667)this.character=" ";else if(e>=0.2222&&e<=0.2223)this.character=" ";else if(e>=0.2777&&e<=0.2778)this.character=" ";else if(e>=-0.05556&&e<=-0.05555)this.character=" ";else if(e>=-0.1667&&e<=-0.1666)this.character=" ";else if(e>=-0.2223&&e<=-0.2222)this.character=" ";else if(e>=-0.2778&&e<=-0.2777)this.character=" ";else this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);else{var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ae(this.width)),e}}toMarkup(){if(this.character)return"<mtext>"+this.character+"</mtext>";else return'<mspace width="'+ae(this.width)+'"/>'}toText(){if(this.character)return this.character;else return" "}}var I4=new Set(["\\imath","\\jmath"]),N4=new Set(["mrow","mtable"]),Kt=function(t,n,r){var s,i;if(Ze[n][t]&&Ze[n][t].replace&&t.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(qu,t)&&((r==null||(s=r.fontFamily)==null?void 0:s.slice(4,6))==="tt"||(r==null||(i=r.font)==null?void 0:i.slice(4,6))==="tt")))t=Ze[n][t].replace;return new st(t)},ol=function(t){if(t.length===1)return t[0];else return new ne("mrow",t)},B4={mathit:"italic",boldsymbol:(e)=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},ll=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";else if(t.fontFamily==="textsf")if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"sans-serif-bold-italic";else if(t.fontShape==="textit")return"sans-serif-italic";else if(t.fontWeight==="textbf")return"bold-sans-serif";else return"sans-serif";else if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";else if(t.fontShape==="textit")return"italic";else if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,s=B4[n];if(s)return typeof s==="function"?s(e):s;var i=e.text;if(I4.has(i))return null;if(Ze[r][i]){var a=Ze[r][i].replace;if(a)i=a}var o=Wo[n].fontName;if(rl(i,o,r))return Wo[n].variant;return null};function To(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof st&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof st&&n.text===","}else return!1}var Wt=function(t,n,r){if(t.length===1){var s=qe(t[0],n);if(r&&s instanceof ne&&s.type==="mo")s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em");return[s]}var i=[],a;for(var o=0;o<t.length;o++){var l=qe(t[o],n);if(l instanceof ne&&a instanceof ne){if(l.type==="mtext"&&a.type==="mtext"&&l.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...l.children);continue}else if(l.type==="mn"&&a.type==="mn"){a.children.push(...l.children);continue}else if(To(l)&&a.type==="mn"){a.children.push(...l.children);continue}else if(l.type==="mn"&&To(a))l.children=[...a.children,...l.children],i.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(a.type==="mn"||To(a))){var u=l.children[0];if(u instanceof ne&&u.type==="mn")u.children=[...a.children,...u.children],i.pop()}else if(a.type==="mi"&&a.children.length===1){var d=a.children[0];if(d instanceof st&&d.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var f=l.children[0];if(f instanceof st&&f.text.length>0)f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),i.pop()}}}i.push(l),a=l}return i},ir=function(t,n,r){return ol(Wt(t,n,r))},qe=function(t,n){if(!t)return new ne("mrow");if(Zs[t.type])return Zs[t.type](t,n);else throw new te("Got group of unknown type: '"+t.type+"'")};function lu(e,t,n,r,s){var i=Wt(e,n),a;if(i.length===1&&i[0]instanceof ne&&N4.has(i[0].type))a=i[0];else a=new ne("mrow",i);var o=new ne("annotation",[new st(t)]);o.setAttribute("encoding","application/x-tex");var l=new ne("semantics",[a,o]),u=new ne("math",[l]);if(u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r)u.setAttribute("display","block");var d=s?"katex":"katex-mathml";return X([d],[u])}var O4=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],cu=[0.5,0.6,0.7,0.8,0.9,1,1.2,1.44,1.728,2.074,2.488],uu=function(t,n){return n.size<2?t:O4[t-1][n.size-1]};class Ln{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Ln.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=cu[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this.strict=e.strict,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(t,e),new Ln(t)}havingStyle(e){if(this.style===e)return this;else return this.extend({style:e,size:uu(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){if(this.size===e&&this.textSize===e)return this;else return this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:cu[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=uu(Ln.BASESIZE,e);if(this.size===t&&this.textSize===Ln.BASESIZE&&this.style===e)return this;else return this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){if(e.size!==this.size)return["katex-sizing","reset-size"+e.size,"size"+this.size];else return[]}baseSizingClasses(){if(this.size!==Ln.BASESIZE)return["katex-sizing","reset-size"+this.size,"size"+Ln.BASESIZE];else return[]}fontMetrics(){if(!this._fontMetrics)this._fontMetrics=y4(this.size);return this._fontMetrics}getColor(){if(this.phantom)return"transparent";else return this.color}}Ln.BASESIZE=6;var Vu=(e)=>new Ln({style:e.displayMode?Se.DISPLAY:Se.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),Ju=function(t,n){if(n.displayMode){var r=["katex-display"];if(n.leqno)r.push("leqno");if(n.fleqn)r.push("fleqn");t=X(r,[t])}return t},z4=function(t,n,r){var s=Vu(r),i;if(r.output==="mathml")return lu(t,n,s,r.displayMode,!0);else if(r.output==="html"){var a=Vo(t,s);i=X(["katex"],[a])}else{var o=lu(t,n,s,r.displayMode,!1),l=Vo(t,s);i=X(["katex"],[o,l])}return Ju(i,r)},F4=function(t,n){var r=Vu(n),s=Vo(t,r),i=X(["katex"],[s]);return Ju(i,n)},$4={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},la=function(t){var n=new ne("mo",[new st($4[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},q4={overrightarrow:[["rightarrow"],0.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],0.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],0.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],0.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],0.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],0.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],0.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],0.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],0.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],0.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],0.888,522,"xMaxYMin"],xlongequal:[["longequal"],0.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],0.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],0.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],0.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],0.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],0.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],0.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],0.888,342],undergroup:[["leftgroupunder","rightgroupunder"],0.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},H4=new Set(["widehat","widecheck","widetilde","utilde"]),ca=function(t,n){function r(){var l=400000,u=t.label.slice(1);if(H4.has(u)&&"base"in t){var d=t.base.type==="ordgroup"?t.base.body.length:1,f,p,g;if(d>5)if(u==="widehat"||u==="widecheck")f=420,l=2364,g=0.42,p=u+"4";else f=312,l=2340,g=0.34,p="tilde4";else{var b=[1,1,2,2,3,3][d];if(u==="widehat"||u==="widecheck")l=[0,1062,2364,2364,2364][b],f=[0,239,300,360,420][b],g=[0,0.24,0.3,0.3,0.36,0.42][b],p=u+b;else l=[0,600,1033,2339,2340][b],f=[0,260,286,306,312][b],g=[0,0.26,0.286,0.3,0.306,0.34][b],p="tilde"+b}var x=new Nn(p),k=new pn([x],{width:"100%",height:ae(g),viewBox:"0 0 "+l+" "+f,preserveAspectRatio:"none"});return{span:sr([],[k],n),minWidth:0,height:g}}else{var A=[],T=q4[u];if(!T)throw Error('No SVG data for "'+u+'".');var S=T[0],E=T[1],D=T[2],M=D/1000,L=S.length,z,O;if(L===1){if(T.length!==4)throw Error('Expected 4-tuple for single-path SVG data "'+u+'".');z=["hide-tail"],O=[T[3]]}else if(L===2)z=["halfarrow-left","halfarrow-right"],O=["xMinYMin","xMaxYMin"];else if(L===3)z=["brace-left","brace-center","brace-right"],O=["xMinYMin","xMidYMin","xMaxYMin"];else throw Error(`Correct katexImagesData or update code here to support
|
|
279
|
+
`+L+" children.");for(var P=0;P<L;P++){var V=new Nn(S[P]),G=new pn([V],{width:"400em",height:ae(M),viewBox:"0 0 "+l+" "+D,preserveAspectRatio:O[P]+" slice"}),ce=sr([z[P]],[G],n);if(L===1)return{span:ce,minWidth:E,height:M};else ce.style.height=ae(M),A.push(ce)}return{span:X(["katex-stretchy"],A,n),minWidth:E,height:M}}}var s=r(),{span:i,minWidth:a,height:o}=s;if(i.height=o,i.style.height=ae(o),a>0)i.style.minWidth=ae(a);return i},P4=function(t,n,r,s,i){var a,o=t.height+t.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=X(["katex-stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();if(l)a.style.borderColor=l}}else{var u=[];if(/^[bx]cancel$/.test(n))u.push(new ra({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"}));if(/^x?cancel$/.test(n))u.push(new ra({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new pn(u,{width:"100%",height:ae(o)});a=sr([],[d],i)}return a.height=o,a.style.height=ae(o),a},U4=["bin","close","inner","open","punct","rel"],W4=["accent-token","mathord","op-token","spacing","textord"],j4=new Set(U4),G4=new Set(W4);function K4(e){return j4.has(e)}function Me(e,t){if(!e||e.type!==t)throw Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function ua(e){var t=da(e);if(!t)throw Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function da(e){if(e.type==="atom"||G4.has(e.type))return e;return null}function cl(e,t,n){var r="";for(var s of e.body)if(s.type==="textord")r+=s.text;else if(n&&s.type==="spacing"&&s.text===" ")r+=" ";else throw new te(t,e);return r}var Zu=(e)=>{if(e instanceof zt)return e;if(b4(e)&&e.children.length===1)return Zu(e.children[0])},Yu=(e,t)=>{var n,r,s;if(e&&e.type==="supsub")r=Me(e.base,"accent"),n=r.base,e.base=n,s=g4(Ne(e,t)),e.base=r;else r=Me(e,"accent"),n=r.base;var i=Ne(n,t.havingCrampedStyle()),a=r.isShifty&&Bn(n),o=0;if(a){var l,u;o=(l=(u=Zu(i))==null?void 0:u.skew)!=null?l:0}var d=r.label==="\\c",f=d?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),p;if(!r.isStretchy){var g,b;if(r.label==="\\vec")g=Wu("vec",t),b=Uu.vec[1];else if(g=oa({type:"textord",mode:r.mode,text:r.label},t),g=p4(g),g.italic=0,b=g.width,d)f+=g.depth;p=X(["accent-body"],[g]);var x=r.label==="\\textcircled";if(x)p.classes.push("accent-full"),f=i.height;var k=o;if(!x)k-=b/2;if(p.style.left=ae(k),r.label==="\\textcircled")p.style.top=".2em";p=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-f},{type:"elem",elem:p}]})}else p=ca(r,t),p=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ae(2*o)+")",marginLeft:ae(2*o)}:void 0}]});var A=X(["mord","katex-accent"],[p],t);if(s)return s.children[0]=A,s.height=Math.max(A.height,s.height),s.classes[0]="mord",s;else return A};var V4=(e,t)=>{var n=e.isStretchy?la(e.label):new ne("mo",[Kt(e.label,e.mode)]),r=new ne("mover",[qe(e.base,t),n]);return r.setAttribute("accent","true"),r},J4=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e)=>"\\"+e).join("|"));he({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(e,t)=>{var n=Ys(t[0]),r=!J4.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:Yu,mathmlBuilder:V4});he({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.","\\\"","\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;if(r==="math")Ot({strict:e.parser.settings.strict,errorCode:"mathVsTextAccents",errorMsg:"LaTeX's accent "+e.funcName+" works only in text mode",report:!0}),r="text";return{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}});he({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(e,t)=>{var n=Ne(e.base,t),r=ca(e,t),s=e.label==="\\utilde"?0.12:0,i=Oe({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return X(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=la(e.label),r=new ne("munder",[qe(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Ji=(e)=>{var t=new ne("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};he({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),s=ns(Ne(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;if(e.below)r=t.havingStyle(n.sub()),a=ns(Ne(e.below,r,t),t),a.classes.push(i+"-arrow-pad");var o=ca(e,t),l=-t.fontMetrics().axisHeight+0.5*o.height,u=-t.fontMetrics().axisHeight-0.5*o.height-0.111;if(s.depth>0.25||e.label==="\\xleftequilibrium")u-=s.depth;var d;if(a){var f=-t.fontMetrics().axisHeight+a.height+0.5*o.height+0.111;d=Oe({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:f}]})}else d=Oe({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return X(["mrel","x-arrow"],[d],t)},mathmlBuilder(e,t){var n=la(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=Ji(qe(e.body,t));if(e.below){var i=Ji(qe(e.below,t));r=new ne("munderover",[n,i,s])}else r=new ne("mover",[n,s])}else if(e.below){var a=Ji(qe(e.below,t));r=new ne("munder",[n,a])}else r=Ji(),r=new ne("mover",[n,r]);return r}});function Z4(e,t){var n=dt(e.body,t,!0);return X([e.mclass],n,t)}function Y4(e,t){var n,r=Wt(e.body,t);if(e.mclass==="minner")n=new ne("mpadded",r);else if(e.mclass==="mord")if(e.isCharacterBox)n=r[0],n.type="mi";else n=new ne("mi",r);else{if(e.isCharacterBox)n=r[0],n.type="mo";else n=new ne("mo",r);if(e.mclass==="mbin")n.attributes.lspace="0.22em",n.attributes.rspace="0.22em";else if(e.mclass==="mpunct")n.attributes.lspace="0em",n.attributes.rspace="0.17em";else if(e.mclass==="mopen"||e.mclass==="mclose")n.attributes.lspace="0em",n.attributes.rspace="0em"}return n}he({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:ot(s),isCharacterBox:Bn(s)}},htmlBuilder:Z4,mathmlBuilder:Y4});var ha=(e)=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;if(t.type==="atom"&&(t.family==="bin"||t.family==="rel"))return"m"+t.family;else return"mord"};he({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var n=e.parser;return{type:"mclass",mode:n.mode,mclass:ha(t[0]),body:ot(t[1]),isCharacterBox:Bn(t[1])}}});he({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var{parser:n,funcName:r}=e,s=t[1],i=t[0],a;if(r!=="\\stackrel")a=ha(s);else a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ot(s)},l=r==="\\underset"?{type:"supsub",mode:i.mode,base:o,sub:i}:{type:"supsub",mode:i.mode,base:o,sup:i};return{type:"mclass",mode:n.mode,mclass:a,body:[l],isCharacterBox:Bn(l)}}});he({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser;return{type:"pmb",mode:n.mode,mclass:ha(t[0]),body:ot(t[0])}},htmlBuilder(e,t){var n=dt(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Wt(e.body,t),r=new ne("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var X4={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},du=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),hu=(e)=>e.type==="textord"&&e.text==="@",Q4=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function e2(e,t,n){var r=X4[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function t2(e){var t=[];e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();while(!0){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){if(t[t.length-1].length===0)t.pop();break}else throw new te("Expected \\\\ or \\cr or \\end",e.nextToken)}var r=[],s=[r];for(var i=0;i<t.length;i++){var a=t[i],o=du();for(var l=0;l<a.length;l++)if(!hu(a[l]))o.body.push(a[l]);else{r.push(o),l+=1;var u=ua(a[l]).text,d=[,,];if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(u));else if("<>AV".includes(u))for(var f=0;f<2;f++){var p=!0;for(var g=l+1;g<a.length;g++){if(Q4(a[g],u)){p=!1,l=g;break}if(hu(a[g]))throw new te("Missing a "+u+" character to complete a CD arrow.",a[g]);d[f].body.push(a[g])}if(p)throw new te("Missing a "+u+" character to complete a CD arrow.",a[l])}else throw new te('Expected one of "<>AV=|." after @',a[l]);var b=e2(u,d,e),x={type:"styling",body:[b],mode:"math",style:"display",resetFont:!0};r.push(x),o=du()}if(i%2===0)r.push(o);else r.shift();r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var k=Array(s[0].length).fill({type:"align",align:"c",pregap:0.25,postgap:0.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:k,colSeparationType:"CD",hLinesBeforeRow:Array(s.length+1).fill([])}}he({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=ns(Ne(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ae(0.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ne("mrow",[qe(e.label,t)]);if(n=new ne("mpadded",[n]),n.setAttribute("width","0"),e.side==="left")n.setAttribute("lspace","-1width");return n.setAttribute("voffset","0.7em"),n=new ne("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});he({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var n=e.parser;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=ns(Ne(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new ne("mrow",[qe(e.fragment,t)])}});he({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=Me(t[0],"ordgroup"),s=cl(r,"\\@char has non-numeric argument"),i=parseInt(s),a;if(isNaN(i))throw new te("\\@char has non-numeric argument "+s);else if(i<0||i>1114111)throw new te("\\@char with invalid code point "+s);else if(i<=65535)a=String.fromCharCode(i);else i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320);return{type:"textord",mode:n.mode,text:a}}});var n2=(e,t)=>{var n=dt(e.body,t.withColor(e.color),!1);return zn(n)},r2=(e,t)=>{var n=Wt(e.body,t.withColor(e.color)),r=new ne("mstyle",n);return r.setAttribute("mathcolor",e.color),r};he({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var n=e.parser,r=Me(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:r,body:ot(s)}},htmlBuilder:n2,mathmlBuilder:r2});he({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,s=Me(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}}});he({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text==="["?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!Ot({strict:t.settings.strict,errorCode:"newLineInDisplayMode",errorMsg:"In LaTeX, \\\\ or \\newline does nothing in display mode",report:!1});return{type:"cr",mode:t.mode,newLine:r,size:n&&Me(n,"size").value}},htmlBuilder(e,t){var n=X(["mspace"],[],t);if(e.newLine){if(n.classes.push("katex-newline"),e.size)n.style.marginTop=ae(et(e.size,t))}return n},mathmlBuilder(e,t){var n=new ne("mspace");if(e.newLine){if(n.setAttribute("linebreak","newline"),e.size)n.setAttribute("height",ae(et(e.size,t)))}return n}});var Jo={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Xu=(e)=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new te("Expected a control sequence",e);return t},s2=(e)=>{var t=e.gullet.popToken();if(t.text==="="){if(t=e.gullet.popToken(),t.text===" ")t=e.gullet.popToken()}return t},Qu=(e,t,n,r)=>{var s=e.gullet.macros.get(n.text);if(s==null)n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)};e.gullet.macros.set(t,s,r)};he({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Jo[r.text]){if(n==="\\global"||n==="\\\\globallong")r.text=Jo[r.text];return Me(t.parseFunction(),"internal")}throw new te("Invalid token after macro prefix",r)}});he({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new te("Expected a control sequence",r);var i=0,a,o=[[]];while(t.gullet.future().text!=="{")if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){a=t.gullet.future(),o[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new te('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new te('Argument number "'+r.text+'" out of order');i++,o.push([])}else if(r.text==="EOF")throw new te("Expected a macro definition");else o[i].push(r.text);var l=t.gullet.consumeArg(),u=l.tokens;if(a)u.unshift(a);if(n==="\\edef"||n==="\\xdef")u=t.gullet.expandTokens(u),u.reverse();return t.gullet.macros.set(s,{tokens:u,numArgs:i,delimiters:o},n===Jo[n]),{type:"internal",mode:t.mode}}});he({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Xu(t.gullet.popToken());t.gullet.consumeSpaces();var s=s2(t);return Qu(t,r,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});he({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Xu(t.gullet.popToken()),s=t.gullet.popToken(),i=t.gullet.popToken();return Qu(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var Gs=function(t,n,r){var s=Ze.math[t]&&Ze.math[t].replace,i=rl(s||t,n,r);if(!i)throw Error("Unsupported symbol "+t+" and font size "+n+".");return i},ul=function(t,n,r,s){var i=r.havingBaseStyle(n),a=X(s.concat(i.sizingClasses(r)),[t],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},ed=function(t,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ae(i),t.height-=i,t.depth+=i},i2=function(t,n,r,s,i,a){var o=Tt(t,"Main-Regular",i,s),l=ul(o,n,s,a);if(r)ed(l,s,n);return l},a2=function(t,n,r,s){return Tt(t,"Size"+n+"-Regular",r,s)},td=function(t,n,r,s,i,a){var o=a2(t,n,i,s),l=ul(X(["delimsizing","size"+n],[o],s),Se.TEXT,s,a);if(r)ed(l,s,Se.TEXT);return l},So=function(t,n,r,s){var i;if(n==="Size1-Regular")i="delim-size1";else i="delim-size4";var a=X(["delimsizinginner",i],[X([],[Tt(t,n,r,s)])]);return{type:"elem",elem:a}},Ro=function(t,n,r){var s=mn["Size4-Regular"][t.charCodeAt(0)]?mn["Size4-Regular"][t.charCodeAt(0)][4]:mn["Size1-Regular"][t.charCodeAt(0)][4],i=new Nn("inner",c4(t,Math.round(1000*n))),a=new pn([i],{width:ae(s),height:ae(n),style:"width:"+ae(s),viewBox:"0 0 "+1000*s+" "+Math.round(1000*n),preserveAspectRatio:"xMinYMin"}),o=sr([],[a],r);return o.height=n,o.style.height=ae(n),o.style.width=ae(s),{type:"elem",elem:o}},Zo=0.008,Zi={type:"kern",size:-1*Zo},o2=new Set(["|","\\lvert","\\rvert","\\vert"]),l2=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),nd=function(t,n,r,s,i,a){var o,l,u,d,f="",p=0;o=u=d=t,l=null;var g="Size1-Regular";if(t==="\\uparrow")u=d="⏐";else if(t==="\\Uparrow")u=d="‖";else if(t==="\\downarrow")o=u="⏐";else if(t==="\\Downarrow")o=u="‖";else if(t==="\\updownarrow")o="\\uparrow",u="⏐",d="\\downarrow";else if(t==="\\Updownarrow")o="\\Uparrow",u="‖",d="\\Downarrow";else if(o2.has(t))u="∣",f="vert",p=333;else if(l2.has(t))u="∥",f="doublevert",p=556;else if(t==="["||t==="\\lbrack")o="⎡",u="⎢",d="⎣",g="Size4-Regular",f="lbrack",p=667;else if(t==="]"||t==="\\rbrack")o="⎤",u="⎥",d="⎦",g="Size4-Regular",f="rbrack",p=667;else if(t==="\\lfloor"||t==="⌊")u=o="⎢",d="⎣",g="Size4-Regular",f="lfloor",p=667;else if(t==="\\lceil"||t==="⌈")o="⎡",u=d="⎢",g="Size4-Regular",f="lceil",p=667;else if(t==="\\rfloor"||t==="⌋")u=o="⎥",d="⎦",g="Size4-Regular",f="rfloor",p=667;else if(t==="\\rceil"||t==="⌉")o="⎤",u=d="⎥",g="Size4-Regular",f="rceil",p=667;else if(t==="("||t==="\\lparen")o="⎛",u="⎜",d="⎝",g="Size4-Regular",f="lparen",p=875;else if(t===")"||t==="\\rparen")o="⎞",u="⎟",d="⎠",g="Size4-Regular",f="rparen",p=875;else if(t==="\\{"||t==="\\lbrace")o="⎧",l="⎨",d="⎩",u="⎪",g="Size4-Regular";else if(t==="\\}"||t==="\\rbrace")o="⎫",l="⎬",d="⎭",u="⎪",g="Size4-Regular";else if(t==="\\lgroup"||t==="⟮")o="⎧",d="⎩",u="⎪",g="Size4-Regular";else if(t==="\\rgroup"||t==="⟯")o="⎫",d="⎭",u="⎪",g="Size4-Regular";else if(t==="\\lmoustache"||t==="⎰")o="⎧",d="⎭",u="⎪",g="Size4-Regular";else if(t==="\\rmoustache"||t==="⎱")o="⎫",d="⎩",u="⎪",g="Size4-Regular";var b=Gs(o,g,i),x=b.height+b.depth,k=Gs(u,g,i),A=k.height+k.depth,T=Gs(d,g,i),S=T.height+T.depth,E=0,D=1;if(l!==null){var M=Gs(l,g,i);E=M.height+M.depth,D=2}var L=x+S+E,z=Math.max(0,Math.ceil((n-L)/(D*A))),O=L+z*D*A,P=s.fontMetrics().axisHeight;if(r)P*=s.sizeMultiplier;var V=O/2-P,G=[];if(f.length>0){var ce=O-x-S,re=Math.round(O*1000),de=u4(f,Math.round(ce*1000)),F=new Nn(f,de),K=ae(p/1000),Y=ae(re/1000),ee=new pn([F],{width:K,height:Y,viewBox:"0 0 "+p+" "+re}),ie=sr([],[ee],s);ie.height=re/1000,ie.style.width=K,ie.style.height=Y,G.push({type:"elem",elem:ie})}else{if(G.push(So(d,g,i,s)),G.push(Zi),l===null){var H=O-x-S+2*Zo;G.push(Ro(u,H,s))}else{var q=(O-x-S-E)/2+2*Zo;G.push(Ro(u,q,s)),G.push(Zi),G.push(So(l,g,i,s)),G.push(Zi),G.push(Ro(u,q,s))}G.push(Zi),G.push(So(o,g,i,s))}var W=s.havingBaseStyle(Se.TEXT),le=Oe({positionType:"bottom",positionData:V,children:G});return ul(X(["delimsizing","mult"],[le],W),Se.TEXT,s,a)},Mo=80,Do=0.08,Lo=function(t,n,r,s,i){var a=l4(t,s,r),o=new Nn(t,a),l=new pn([o],{width:"400em",height:ae(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return sr(["hide-tail"],[l],i)},c2=function(t,n){var r=n.havingBaseSizing(),s=od("\\surd",t*r.sizeMultiplier,ad,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,u,d,f;if(s.type==="small"){if(d=1000+1000*a+Mo,t<1)i=1;else if(t<1.4)i=0.7;l=(1+a+Do)/i,u=(1+a)/i,o=Lo("sqrtMain",l,d,a,n),o.style.minWidth="0.853em",f=0.833/i}else if(s.type==="large")d=(1000+Mo)*Ks[s.size],u=(Ks[s.size]+a)/i,l=(Ks[s.size]+a+Do)/i,o=Lo("sqrtSize"+s.size,l,d,a,n),o.style.minWidth="1.02em",f=1/i;else l=t+a+Do,u=t+a,d=Math.floor(1000*t+a)+Mo,o=Lo("sqrtTall",l,d,a,n),o.style.minWidth="0.742em",f=1.056;return o.height=u,o.style.height=ae(l),{span:o,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},rd=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),u2=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),sd=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Ks=[0,1.2,1.8,2.4,3],id=function(t,n,r,s,i){if(t==="<"||t==="\\lt"||t==="⟨")t="\\langle";else if(t===">"||t==="\\gt"||t==="⟩")t="\\rangle";if(rd.has(t)||sd.has(t))return td(t,n,!1,r,s,i);else if(u2.has(t))return nd(t,Ks[n],!1,r,s,i);else throw new te("Illegal delimiter: '"+t+"'")},d2=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],h2=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"stack"}],ad=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],f2=function(t){if(t.type==="small")return"Main-Regular";else if(t.type==="large")return"Size"+t.size+"-Regular";else if(t.type==="stack")return"Size4-Regular";else{var n=t.type;throw Error("Add support for delim type '"+n+"' here.")}},od=function(t,n,r,s){var i=Math.min(2,3-s.style.size);for(var a=i;a<r.length;a++){var o=r[a];if(o.type==="stack")break;var l=Gs(t,f2(o),"math"),u=l.height+l.depth;if(o.type==="small"){var d=s.havingBaseStyle(o.style);u*=d.sizeMultiplier}if(u>n)return o}return r[r.length-1]},Yo=function(t,n,r,s,i,a){if(t==="<"||t==="\\lt"||t==="⟨")t="\\langle";else if(t===">"||t==="\\gt"||t==="⟩")t="\\rangle";var o;if(sd.has(t))o=d2;else if(rd.has(t))o=ad;else o=h2;var l=od(t,n,o,s);if(l.type==="small")return i2(t,l.style,r,s,i,a);else if(l.type==="large")return td(t,l.size,r,s,i,a);else return nd(t,n,r,s,i,a)},Io=function(t,n,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,d=Math.max(n-o,r+o),f=Math.max(d/500*l,2*d-u);return Yo(t,f,!0,s,i,a)},fu={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},m2=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function mu(e){return"isMiddle"in e}function fa(e,t){var n=da(e);if(n&&m2.has(n.text))return n;else if(n)throw new te("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e);else throw new te("Invalid delimiter type '"+e.type+"'",e)}he({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=fa(Ys(t[0]),e);return{type:"delimsizing",mode:e.parser.mode,size:fu[e.funcName].size,mclass:fu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>{if(e.delim===".")return X([e.mclass]);return id(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:(e)=>{var t=[];if(e.delim!==".")t.push(Kt(e.delim,e.mode));var n=new ne("mo",t);if(e.mclass==="mopen"||e.mclass==="mclose")n.setAttribute("fence","true");else n.setAttribute("fence","false");n.setAttribute("stretchy","true");var r=ae(Ks[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function pu(e){if(!e.body)throw Error("Bug: The leftright ParseNode wasn't fully parsed.")}he({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!=="string")throw new te("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:fa(t[0],e).text,color:n}}});he({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=fa(t[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Me(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{pu(e);var n=dt(e.body,t,!0,["mopen","mclose"]),r=0,s=0,i=!1;for(var a=0;a<n.length;a++){var o=n[a];if(mu(o))i=!0;else r=Math.max(n[a].height,r),s=Math.max(n[a].depth,s)}r*=t.sizeMultiplier,s*=t.sizeMultiplier;var l;if(e.left===".")l=Xs(t,["mopen"]);else l=Io(e.left,r,s,t,e.mode,["mopen"]);if(n.unshift(l),i)for(var u=1;u<n.length;u++){var d=n[u];if(mu(d)){var f=d.isMiddle;n[u]=Io(f.delim,r,s,f.options,e.mode,[])}}var p;if(e.right===".")p=Xs(t,["mclose"]);else{var g=e.rightColor?t.withColor(e.rightColor):t;p=Io(e.right,r,s,g,e.mode,["mclose"])}return n.push(p),X(["minner"],n,t)},mathmlBuilder:(e,t)=>{pu(e);var n=Wt(e.body,t);if(e.left!=="."){var r=new ne("mo",[Kt(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var s=new ne("mo",[Kt(e.right,e.mode)]);if(s.setAttribute("fence","true"),e.rightColor)s.setAttribute("mathcolor",e.rightColor);n.push(s)}return ol(n)}});he({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=fa(t[0],e);if(!e.parser.leftrightDepth)throw new te("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=Xs(t,[]);else n=id(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t};return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Kt("|","text"):Kt(e.delim,e.mode),r=new ne("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var p2=(e,t)=>{var n=ns(Ne(e.body,t),t),r=e.label.slice(1),s=t.sizeMultiplier,i,a,o=Bn(e.body);if(r==="sout")i=X(["katex-stretchy","katex-sout"]),i.height=t.fontMetrics().defaultRuleThickness/s,a=-0.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=et({number:0.6,unit:"pt"},t),u=et({number:0.35,unit:"ex"},t),d=t.havingBaseSizing();s=s/d.sizeMultiplier;var f=n.height+n.depth+l+u;n.style.paddingLeft=ae(f/2+l);var p=Math.floor(1000*f*s),g=a4(p),b=new pn([new Nn("phase",g)],{width:"400em",height:ae(p/1000),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=sr(["hide-tail"],[b],t),i.style.height=ae(f),a=n.depth+l+u}else{if(/cancel/.test(r)){if(!o)n.classes.push("cancel-pad")}else if(r==="angl")n.classes.push("anglpad");else n.classes.push("boxpad");var x,k,A=0;if(/box/.test(r))A=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),x=t.fontMetrics().fboxsep+(r==="colorbox"?0:A),k=x;else if(r==="angl")A=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),x=4*A,k=Math.max(0,0.25-n.depth);else x=o?0.2:0,k=x;if(i=P4(n,r,x,k,t),/fbox|boxed|fcolorbox/.test(r))i.style.borderStyle="solid",i.style.borderWidth=ae(A);else if(r==="angl"&&A!==0.049)i.style.borderTopWidth=ae(A),i.style.borderRightWidth=ae(A);if(a=n.depth+k,e.backgroundColor){if(i.style.backgroundColor=e.backgroundColor,e.borderColor)i.style.borderColor=e.borderColor}}var T;if(e.backgroundColor)T=Oe({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]});else{var S=/cancel|phase/.test(r)?["svg-align"]:[];T=Oe({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:S}]})}if(/cancel/.test(r))T.height=n.height,T.depth=n.depth;if(/cancel/.test(r)&&!o)return X(["mord","cancel-lap"],[T],t);else return X(["mord"],[T],t)},g2=(e,t)=>{var n,r=new ne(e.label.includes("colorbox")?"mpadded":"menclose",[qe(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ae(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}if(e.backgroundColor)r.setAttribute("mathbackground",e.backgroundColor);return r};he({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Me(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:p2,mathmlBuilder:g2});he({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Me(t[0],"color-token").color,a=Me(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}}});he({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var n=e.parser;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});he({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});he({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;if(n.mode==="math")Ot({strict:n.settings.strict,errorCode:"mathVsSout",errorMsg:"LaTeX's \\sout works only in text mode",report:!0});var s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});he({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var n=e.parser;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var ld={};function gn(e){var{type:t,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s};for(var l=0;l<n.length;++l)ld[n[l]]=o;if(i)Js[t]=i;if(a)Zs[t]=a}var cd={};function w(e,t){cd[e]=t}class Bt{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){if(!t)return e&&e.loc;else if(!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer)return null;else return new Bt(e.loc.lexer,e.loc.start,t.loc.end)}}class Pt{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Pt(t,Bt.range(this,e))}}function gu(e){var t=[];e.consumeSpaces();var n=e.fetch().text;if(n==="\\relax")e.consume(),e.consumeSpaces(),n=e.fetch().text;while(n==="\\hline"||n==="\\hdashline")e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var ma=(e)=>{var t=e.parser.settings;if(!t.displayMode)throw new te("{"+e.envName+"} can be used only in display mode.")},b2=new Set(["gather","gather*"]);function dl(e){if(!e.includes("ed"))return!e.includes("*")}function ar(e,t,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:f,leqno:p}=t;if(e.gullet.beginGroup(),!u)e.gullet.macros.set("\\cr","\\\\\\relax");if(!a){var g=e.gullet.expandMacroAsText("\\arraystretch");if(g==null)a=1;else if(a=parseFloat(g),!a||a<0)throw new te("Invalid \\arraystretch: "+g)}e.gullet.beginGroup();var b=[],x=[b],k=[],A=[],T=l!=null?[]:void 0;function S(){if(l)e.gullet.macros.set("\\@eqnsw","1",!0)}function E(){if(T)if(e.gullet.macros.get("\\df@tag"))T.push(e.subparse([new Pt("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0);else T.push(Boolean(l)&&e.gullet.macros.get("\\@eqnsw")==="1")}S(),A.push(gu(e));while(!0){var D=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var M={type:"ordgroup",mode:e.mode,body:D};if(n)M={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[M]};b.push(M);var L=e.fetch().text;if(L==="&"){if(f&&b.length===f)if(u||o)throw new te("Too many tab characters: &",e.nextToken);else Ot({strict:e.settings.strict,errorCode:"textEnv",errorMsg:"Too few columns specified in the {array} column argument.",report:!0});e.consume()}else if(L==="\\end"){if(E(),b.length===1&&M.type==="styling"&&M.body.length===1&&M.body[0].type==="ordgroup"&&M.body[0].body.length===0&&(x.length>1||!d)&&!Array.isArray(T==null?void 0:T[T.length-1])&&!(l&&(T==null?void 0:T[T.length-1])===!0))x.pop();if(A.length<x.length+1)A.push([]);break}else if(L==="\\\\"){e.consume();var z=void 0;if(e.gullet.future().text!==" ")z=e.parseSizeGroup(!0);k.push(z?z.value:null),E(),A.push(gu(e)),b=[],x.push(b),S()}else throw new te("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:a,body:x,cols:i,rowGaps:k,hskipBeforeAndAfter:r,hLinesBeforeRow:A,colSeparationType:o,tags:T,leqno:p}}function hl(e){if(e.slice(0,1)==="d")return"display";else return"text"}var bn=function(t,n){var r,s,i=t.body.length,a=t.hLinesBeforeRow,o=0,l=Array(i),u=[],d=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),f=1/n.fontMetrics().ptPerEm,p=5*f;if(t.colSeparationType&&t.colSeparationType==="small"){var g=n.havingStyle(Se.SCRIPT).sizeMultiplier;p=0.2778*(g/n.sizeMultiplier)}var b=t.colSeparationType==="CD"?et({number:3,unit:"ex"},n):12*f,x=3*f,k=t.arraystretch*b,A=0.7*k,T=0.3*k,S=0;function E(Re){for(var Ie=0;Ie<Re.length;++Ie){if(Ie>0)S+=0.25;u.push({pos:S,isDashed:Re[Ie]})}}E(a[0]);for(r=0;r<t.body.length;++r){var D=t.body[r],M=A,L=T;if(o<D.length)o=D.length;var z={cells:Array(D.length),height:0,depth:0,pos:0};for(s=0;s<D.length;++s){var O=Ne(D[s],n);if(L<O.depth)L=O.depth;if(M<O.height)M=O.height;z.cells[s]=O}var P=t.rowGaps[r],V=0;if(P){if(V=et(P,n),V>0){if(V+=T,L<V)L=V;V=0}}if(t.addJot&&r<t.body.length-1)L+=x;z.height=M,z.depth=L,S+=M,z.pos=S,S+=L+V,l[r]=z,E(a[r+1])}var G=S/2+n.fontMetrics().axisHeight,ce=t.cols||[],re=[],de,F,K=[];if(t.tags&&t.tags.some((Re)=>Re))for(r=0;r<i;++r){var Y=l[r],ee=Y.pos-G,ie=t.tags[r],H=void 0;if(ie===!0)H=X(["eqn-num"],[],n);else if(ie===!1)H=X([],[],n);else H=X([],dt(ie,n,!0),n);H.depth=Y.depth,H.height=Y.height,K.push({type:"elem",elem:H,shift:ee})}for(s=0,F=0;s<o||F<ce.length;++s,++F){var q,W=ce[F],le=!0;while(((N=W)==null?void 0:N.type)==="separator"){var N;if(!le)de=X(["arraycolsep"],[]),de.style.width=ae(n.fontMetrics().doubleRuleSep),re.push(de);if(W.separator==="|"||W.separator===":"){var J=W.separator==="|"?"solid":"dashed",oe=X(["vertical-separator"],[],n);oe.style.height=ae(S),oe.style.borderRightWidth=ae(d),oe.style.borderRightStyle=J,oe.style.margin="0 "+ae(-d/2);var Ce=S-G;if(Ce)oe.style.verticalAlign=ae(-Ce);re.push(oe)}else throw new te("Invalid separator type: "+W.separator);F++,W=ce[F],le=!1}if(s>=o)continue;var ye=void 0;if(s>0||t.hskipBeforeAndAfter){var Be,Fe;if(ye=(Be=(Fe=W)==null?void 0:Fe.pregap)!=null?Be:p,ye!==0)de=X(["arraycolsep"],[]),de.style.width=ae(ye),re.push(de)}var Pe=[];for(r=0;r<i;++r){var Ve=l[r],mt=Ve.cells[s];if(!mt)continue;var yt=Ve.pos-G;mt.depth=Ve.depth,mt.height=Ve.height,Pe.push({type:"elem",elem:mt,shift:yt})}var Wr=Oe({positionType:"individualShift",children:Pe}),Cn=X(["col-align-"+(((q=W)==null?void 0:q.align)||"c")],[Wr]);if(re.push(Cn),s<o-1||t.hskipBeforeAndAfter){var Te,Ss;if(ye=(Te=(Ss=W)==null?void 0:Ss.postgap)!=null?Te:p,ye!==0)de=X(["arraycolsep"],[]),de.style.width=ae(ye),re.push(de)}}var nt=X(["mtable"],re);if(u.length>0){var $e=ts("katex-hline",n,d),jr=ts("katex-hdashline",n,d),Zt=[{type:"elem",elem:nt,shift:0}];while(u.length>0){var Gr=u.pop(),Kr=Gr.pos-G;if(Gr.isDashed)Zt.push({type:"elem",elem:jr,shift:Kr});else Zt.push({type:"elem",elem:$e,shift:Kr})}nt=Oe({positionType:"individualShift",children:Zt})}if(K.length===0)return X(["mord"],[nt],n);else{var ue=Oe({positionType:"individualShift",children:K}),be=X(["katex-tag"],[ue],n);return zn([nt,be])}},v2={c:"center ",l:"left ",r:"right "},vn=function(t,n){var r=[],s=new ne("mtd",[],["mtr-glue"]),i=new ne("mtd",[],["mml-eqn-num"]);for(var a=0;a<t.body.length;a++){var o=t.body[a],l=[];for(var u=0;u<o.length;u++)l.push(new ne("mtd",[qe(o[u],n)]));if(t.tags&&t.tags[a])if(l.unshift(s),l.push(s),t.leqno)l.unshift(i);else l.push(i);r.push(new ne("mtr",l))}var d=new ne("mtable",r),f=t.arraystretch===0.5?0.1:0.16+t.arraystretch-1+(t.addJot?0.09:0);d.setAttribute("rowspacing",ae(f));var p="",g="";if(t.cols&&t.cols.length>0){var b=t.cols,x="",k=!1,A=0,T=b.length;if(b[0].type==="separator")p+="top ",A=1;if(b[b.length-1].type==="separator")p+="bottom ",T-=1;for(var S=A;S<T;S++){var E=b[S];if(E.type==="align"){if(g+=v2[E.align],k)x+="none ";k=!0}else if(E.type==="separator"){if(k)x+=E.separator==="|"?"solid ":"dashed ",k=!1}}if(d.setAttribute("columnalign",g.trim()),/[sd]/.test(x))d.setAttribute("columnlines",x.trim())}if(t.colSeparationType==="align"){var D=t.cols||[],M="";for(var L=1;L<D.length;L++)M+=L%2?"0em ":"1em ";d.setAttribute("columnspacing",M.trim())}else if(t.colSeparationType==="alignat"||t.colSeparationType==="gather")d.setAttribute("columnspacing","0em");else if(t.colSeparationType==="small")d.setAttribute("columnspacing","0.2778em");else if(t.colSeparationType==="CD")d.setAttribute("columnspacing","0.5em");else d.setAttribute("columnspacing","1em");var z="",O=t.hLinesBeforeRow;p+=O[0].length>0?"left ":"",p+=O[O.length-1].length>0?"right ":"";for(var P=1;P<O.length-1;P++)z+=O[P].length===0?"none ":O[P][0]?"dashed ":"solid ";if(/[sd]/.test(z))d.setAttribute("rowlines",z.trim());if(p!=="")d=new ne("menclose",[d]),d.setAttribute("notation",p.trim());if(t.arraystretch&&t.arraystretch<1)d=new ne("mstyle",[d]),d.setAttribute("scriptlevel","1");return d},ud=function(t,n){if(!t.envName.includes("ed"))ma(t);var r=[],s=t.envName==="split",i=ar(t.parser,{cols:r,addJot:!0,autoTag:s?void 0:dl(t.envName),emptySingleRow:!0,colSeparationType:t.envName.includes("at")?"alignat":"align",maxNumCols:s?2:void 0,leqno:t.parser.settings.leqno},"display"),a=0,o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){var u="Number of columns should be a positive integer",d=cl(n[0],u);if(!/^[0-9]+$/.test(d)||Number(d)<1)throw new te(u,n[0]);a=Number(d),o=a*2}var f=!o;i.body.forEach(function(x){for(var k=1;k<x.length;k+=2){var A=Me(x[k],"styling"),T=Me(A.body[0],"ordgroup");T.body.unshift(l)}if(!f){var S=x.length/2;if(a<S)throw new te("Too many math in a row: "+("expected "+a+", but got "+S),x[0])}else if(o<x.length)o=x.length});for(var p=0;p<o;++p){var g="r",b=0;if(p%2===1)g="l";else if(p>0&&f)b=1;r[p]={type:"align",align:g,pregap:b,postgap:0}}return i.colSeparationType=f?"align":"alignat",i};gn({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=da(t[0]),r=n?[t[0]]:Me(t[0],"ordgroup").body,s=r.map(function(a){var o=ua(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};else if(l==="|")return{type:"separator",separator:"|"};else if(l===":")return{type:"separator",separator:":"};throw new te("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return ar(e.parser,i,hl(e.envName))},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new te("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=ar(e.parser,r,hl(e.envName)),a=Math.max(0,...i.body.map((o)=>o.length));return i.cols=Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:0.5},n=ar(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=da(t[0]),r=n?[t[0]]:Me(t[0],"ordgroup").body,s=r.map(function(o){var l=ua(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new te("Unknown column alignment: "+u,o)});if(s.length>1)throw new te("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:0.5},a=ar(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new te("{subarray} can contain only one column");return a},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ar(e.parser,t,hl(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:ud,htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){if(b2.has(e.envName))ma(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:dl(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ar(e.parser,t,"display")},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:ud,htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){ma(e);var t={autoTag:dl(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ar(e.parser,t,"display")},htmlBuilder:bn,mathmlBuilder:vn});gn({type:"array",names:["CD"],props:{numArgs:0},handler(e){return ma(e),t2(e.parser)},htmlBuilder:bn,mathmlBuilder:vn});w("\\nonumber","\\gdef\\@eqnsw{0}");w("\\notag","\\nonumber");he({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new te(e.funcName+" valid only within array environment")}});var bu=ld;he({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,s=t[0];if(s.type!=="ordgroup")throw new te("Invalid environment name",s);var i=cl(s,"Environment name should contain only text characters and spaces",!0);if(r==="\\begin"){if(!Object.prototype.hasOwnProperty.call(bu,i))throw new te("No such environment: "+i,s);var a=bu[i],o=n.parseArguments("\\begin{"+i+"}",a),{args:l,optArgs:u}=o,d={mode:n.mode,envName:i,parser:n},f=a.handler(d,l,u);n.expect("\\end",!1);var p=n.nextToken,g=Me(n.parseFunction(),"environment");if(g.name!==i)throw new te("Mismatch: \\begin{"+i+"} matched by \\end{"+g.name+"}",p);return f}return{type:"environment",mode:n.mode,name:i,nameGroup:s}}});var y2=(e,t)=>{var n=e.font,r=t.withFont(n);return Ne(e.body,r)},w2=(e,t)=>{var n=e.font,r=t.withFont(n);return qe(e.body,r)},vu={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};he({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=Ys(t[0]),i=r in vu?vu[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:y2,mathmlBuilder:w2});he({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:"mclass",mode:n.mode,mclass:ha(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Bn(r)}}});he({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:s}=e,i=n.mode,a=n.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var k2=(e,t)=>{var n=t.style,r=n.fracNum(),s=n.fracDen(),i;i=t.havingStyle(r);var a=Ne(e.numer,i,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<o?o:a.height,a.depth=a.depth<l?l:a.depth}i=t.havingStyle(s);var u=Ne(e.denom,i,t),d,f,p;if(e.hasBarLine){if(e.barSize)f=et(e.barSize,t),d=ts("frac-line",t,f);else d=ts("frac-line",t);f=d.height,p=d.height}else d=null,f=0,p=t.fontMetrics().defaultRuleThickness;var g,b,x;if(n.size===Se.DISPLAY.size){if(g=t.fontMetrics().num1,f>0)b=3*p;else b=7*p;x=t.fontMetrics().denom1}else{if(f>0)g=t.fontMetrics().num2,b=p;else g=t.fontMetrics().num3,b=3*p;x=t.fontMetrics().denom2}var k;if(!d){var A=g-a.depth-(u.height-x);if(A<b)g+=0.5*(b-A),x+=0.5*(b-A);k=Oe({positionType:"individualShift",children:[{type:"elem",elem:u,shift:x},{type:"elem",elem:a,shift:-g}]})}else{var T=t.fontMetrics().axisHeight;if(g-a.depth-(T+0.5*f)<b)g+=b-(g-a.depth-(T+0.5*f));if(T-0.5*f-(u.height-x)<b)x+=b-(T-0.5*f-(u.height-x));var S=-(T-0.5*f);k=Oe({positionType:"individualShift",children:[{type:"elem",elem:u,shift:x},{type:"elem",elem:d,shift:S},{type:"elem",elem:a,shift:-g}]})}i=t.havingStyle(n),k.height*=i.sizeMultiplier/t.sizeMultiplier,k.depth*=i.sizeMultiplier/t.sizeMultiplier;var E;if(n.size===Se.DISPLAY.size)E=t.fontMetrics().delim1;else if(n.size===Se.SCRIPTSCRIPT.size)E=t.havingStyle(Se.SCRIPT).fontMetrics().delim2;else E=t.fontMetrics().delim2;var D,M;if(e.leftDelim==null)D=Xs(t,["mopen"]);else D=Yo(e.leftDelim,E,!0,t.havingStyle(n),e.mode,["mopen"]);if(e.continued)M=X([]);else if(e.rightDelim==null)M=Xs(t,["mclose"]);else M=Yo(e.rightDelim,E,!0,t.havingStyle(n),e.mode,["mclose"]);return X(["mord"].concat(i.sizingClasses(t)),[D,X(["mfrac"],[k]),M],t)},x2=(e,t)=>{var n=new ne("mfrac",[qe(e.numer,t),qe(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=et(e.barSize,t);n.setAttribute("linethickness",ae(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new ne("mo",[new st(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(n),e.rightDelim!=null){var a=new ne("mo",[new st(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return ol(s)}return n},dd=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};he({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0],i=t[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw Error("Unrecognized genfrac command")}var u=r==="\\cfrac",d=null;if(u||r.startsWith("\\d"))d="display";else if(r.startsWith("\\t"))d="text";return dd({type:"genfrac",mode:n.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},d)},htmlBuilder:k2,mathmlBuilder:x2});he({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var{parser:t,funcName:n,token:r}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:r}}});var yu=["display","text","script","scriptscript"],wu=function(t){var n=null;if(t.length>0)n=t,n=n==="."?null:n;return n};he({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var n=e.parser,r=t[4],s=t[5],i=Ys(t[0]),a=i.type==="atom"&&i.family==="open"?wu(i.text):null,o=Ys(t[1]),l=o.type==="atom"&&o.family==="close"?wu(o.text):null,u=Me(t[2],"size"),d,f=null;if(u.isBlank)d=!0;else f=u.value,d=f.number>0;var p=null,g=t[3];if(g.type==="ordgroup"){if(g.body.length>0){var b=Me(g.body[0],"textord");p=yu[Number(b.text)]}}else g=Me(g,"textord"),p=yu[Number(g.text)];return dd({type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:d,barSize:f,leftDelim:a,rightDelim:l},p)}});he({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Me(t[0],"size").value,token:r}}});he({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],s=Me(t[1],"infix").size;if(!s)throw Error("\\\\abovefrac expected size, but got "+String(s));var i=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null}}});var hd=(e,t)=>{var n=t.style,r,s;if(e.type==="supsub")r=e.sup?Ne(e.sup,t.havingStyle(n.sup()),t):Ne(e.sub,t.havingStyle(n.sub()),t),s=Me(e.base,"horizBrace");else s=Me(e,"horizBrace");var i=Ne(s.base,t.havingBaseStyle(Se.DISPLAY)),a=ca(s,t),o;if(s.isOver)o=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:0.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]});else o=Oe({positionType:"bottom",positionData:i.depth+0.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:0.1},{type:"elem",elem:i}]});if(r){var l=X(["minner",s.isOver?"mover":"munder"],[o],t);if(s.isOver)o=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:0.2},{type:"elem",elem:r}]});else o=Oe({positionType:"bottom",positionData:l.depth+0.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:0.2},{type:"elem",elem:l}]})}return X(["minner",s.isOver?"mover":"munder"],[o],t)};var E2=(e,t)=>{var n=la(e.label);return new ne(e.isOver?"mover":"munder",[qe(e.base,t),n])};he({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:hd,mathmlBuilder:E2});he({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],s=Me(t[0],"url").url;if(!n.settings.isTrusted({command:"\\href",url:s}))return n.formatUnsupportedCmd("\\href");return{type:"href",mode:n.mode,href:s,body:ot(r)}},htmlBuilder:(e,t)=>{var n=dt(e.body,t,!1);return C4(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ir(e.body,t);if(!(n instanceof ne))n=new ne("mrow",[n]);return n.setAttribute("href",e.href),n}});he({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=Me(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");var s=[];for(var i=0;i<r.length;i++){var a=r[i];if(a==="~")a="\\textasciitilde";s.push({type:"textord",mode:"text",text:a})}var o={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:r,body:ot(o)}}});he({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var n=e.parser;return{type:"hbox",mode:n.mode,body:ot(t[0])}},htmlBuilder(e,t){var n=dt(e.body,t.withFont(""),!1);return zn(n)},mathmlBuilder(e,t){return new ne("mrow",Wt(e.body,t.withFont("")))}});he({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e;e.token;var s=Me(t[0],"raw").string,i=t[1];if(n.settings.strict)Ot({strict:n.settings.strict,errorCode:"htmlExtension",errorMsg:"HTML extension is disabled on strict mode",report:!0});var a,o={};switch(r){case"\\htmlClass":o.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":o.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":o.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{var l="{,}",u=[],d="";for(var f=0;f<s.length;f++)if(s.startsWith(l,f))d+=",",f+=l.length-1;else if(s[f]===",")u.push(d),d="";else d+=s[f];u.push(d);for(var p=0;p<u.length;p++){var g=u[p],b=g.indexOf("=");if(b<0)throw new te("\\htmlData key/value '"+g+"' missing equals sign");var x=g.slice(0,b),k=g.slice(b+1);o["data-"+x.trim()]=k}a={command:"\\htmlData",attributes:o};break}default:throw Error("Unrecognized html command")}if(!n.settings.isTrusted(a))return n.formatUnsupportedCmd(r);return{type:"html",mode:n.mode,attributes:o,body:ot(i)}},htmlBuilder:(e,t)=>{var n=dt(e.body,t,!1),r=["enclosing"];if(e.attributes.class)r.push(...e.attributes.class.trim().split(/\s+/));var s=X(r,n,t);for(var i of Object.entries(e.attributes)){var a=i[0],o=i[1];if(a!=="class")s.setAttribute(a,o)}return s},mathmlBuilder:(e,t)=>ir(e.body,t)});he({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var n=e.parser;return{type:"htmlmathml",mode:n.mode,html:ot(t[0]),mathml:ot(t[1])}},htmlBuilder:(e,t)=>{var n=dt(e.html,t,!1);return zn(n)},mathmlBuilder:(e,t)=>ir(e.mathml,t)});var No=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};else{var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new te("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!Bu(r))throw new te("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}};he({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,s={number:0,unit:"em"},i={number:0.9,unit:"em"},a={number:0,unit:"em"},o="";if(n[0]){var l=Me(n[0],"raw").string,u=l.split(",");for(var d=0;d<u.length;d++){var f=u[d].split("=");if(f.length===2){var p=f[1].trim();switch(f[0].trim()){case"alt":o=p;break;case"width":s=No(p);break;case"height":i=No(p);break;case"totalheight":a=No(p);break;default:throw new te("Invalid key: '"+f[0]+"' in \\includegraphics.")}}}}var g=Me(t[0],"url").url;if(o==="")o=g,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."));if(!r.settings.isTrusted({command:"\\includegraphics",url:g}))return r.formatUnsupportedCmd("\\includegraphics");return{type:"includegraphics",mode:r.mode,alt:o,width:s,height:i,totalheight:a,src:g}},htmlBuilder:(e,t)=>{var n=et(e.height,t),r=0;if(e.totalheight.number>0)r=et(e.totalheight,t)-n;var s=0;if(e.width.number>0)s=et(e.width,t);var i={height:ae(n+r)};if(s>0)i.width=ae(s);if(r>0)i.verticalAlign=ae(-r);var a=new $u(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new ne("mglyph",[]);n.setAttribute("alt",e.alt);var r=et(e.height,t),s=0;if(e.totalheight.number>0)s=et(e.totalheight,t)-r,n.setAttribute("valign",ae(-s));if(n.setAttribute("height",ae(r+s)),e.width.number>0){var i=et(e.width,t);n.setAttribute("width",ae(i))}return n.setAttribute("src",e.src),n}});he({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=Me(t[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";if(i){if(!a)Ot({strict:n.settings.strict,errorCode:"mathVsTextUnits",errorMsg:"LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units"),report:!0});if(n.mode!=="math")Ot({strict:n.settings.strict,errorCode:"mathVsTextUnits",errorMsg:"LaTeX's "+r+" works only in math mode",report:!0})}else if(a)Ot({strict:n.settings.strict,errorCode:"mathVsTextUnits",errorMsg:"LaTeX's "+r+" doesn't support mu units",report:!0})}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return Pu(e.dimension,t)},mathmlBuilder(e,t){var n=et(e.dimension,t);return new al(n)}});he({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;if(e.alignment==="clap")n=X([],[Ne(e.body,t)]),n=X(["katex-inner"],[n],t);else n=X(["katex-inner"],[Ne(e.body,t)]);var r=X(["katex-fix"],[]),s=X([e.alignment],[n,r],t),i=X(["katex-strut"]);if(i.style.height=ae(s.height+s.depth),s.depth)i.style.verticalAlign=ae(-s.depth);return s.children.unshift(i),s=X(["katex-thinbox"],[s],t),X(["mord","katex-vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new ne("mpadded",[qe(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});he({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});he({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new te("Mismatched "+e.funcName)}});var ku=(e,t)=>{switch(t.style.size){case Se.DISPLAY.size:return e.display;case Se.TEXT.size:return e.text;case Se.SCRIPT.size:return e.script;case Se.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};he({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var n=e.parser;return{type:"mathchoice",mode:n.mode,display:ot(t[0]),text:ot(t[1]),script:ot(t[2]),scriptscript:ot(t[3])}},htmlBuilder:(e,t)=>{var n=ku(e,t),r=dt(n,t,!1);return zn(r)},mathmlBuilder:(e,t)=>{var n=ku(e,t);return ir(n,t)}});var fd=(e,t,n,r,s,i,a)=>{e=X([],[e]);var o=n&&Bn(n),l,u;if(t){var d=Ne(t,r.havingStyle(s.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var f=Ne(n,r.havingStyle(s.sub()),r);l={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var p;if(u&&l){var g=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=Oe({positionType:"bottom",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ae(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ae(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var b=e.height-a;p=Oe({positionType:"top",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ae(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var x=e.depth+a;p=Oe({positionType:"bottom",positionData:x,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ae(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var k=[p];if(l&&i!==0&&!o){var A=X(["mspace"],[],r);A.style.marginRight=ae(i),k.unshift(A)}return X(["mop","op-limits"],k,r)},md=new Set(["\\smallint"]),pd=(e,t)=>{var n,r,s=!1,i;if(e.type==="supsub")n=e.sup,r=e.sub,i=Me(e.base,"op"),s=!0;else i=Me(e,"op");var a=t.style,o=!1;if(a.size===Se.DISPLAY.size&&i.symbol&&!md.has(i.name))o=!0;var l,u;if(i.symbol){var d=o?"Size2-Regular":"Size1-Regular",f="";if(i.name==="\\oiint"||i.name==="\\oiiint")f=i.name.slice(1),i.name=f==="oiint"?"\\iint":"\\iiint";if(l=Tt(i.name,d,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,f.length>0){var p=Wu(f+"Size"+(o?"2":"1"),t);l=Oe({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?0.08:0}]}),i.name="\\"+f,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var g=dt(i.body,t,!0);if(g.length===1&&g[0]instanceof zt)l=g[0],l.classes[0]="mop";else l=X(["mop"],g,t)}else{var b=[];for(var x=1;x<i.name.length;x++)b.push(sl(i.name[x],i.mode,t));l=X(["mop"],b,t)}var k=0,A=0;if((l instanceof zt||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var T;k=(l.height-l.depth)/2-t.fontMetrics().axisHeight,A=(T=l.italic)!=null?T:0}if(s)return fd(l,n,r,t,a,A,k);else{if(k)l.style.position="relative",l.style.top=ae(k);return l}},A2=(e,t)=>{var n;if(e.symbol){if(n=new ne("mo",[Kt(e.name,e.mode)]),md.has(e.name))n.setAttribute("largeop","false")}else if(e.body)n=new ne("mo",Wt(e.body,t));else{n=new ne("mi",[new st(e.name.slice(1))]);var r=new ne("mo",[Kt("","text")]);if(e.parentIsSupSub)n=new ne("mrow",[n,r]);else n=Ku([n,r])}return n},C2={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};he({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=r;if(s.length===1)s=C2[s];return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:pd,mathmlBuilder:A2});he({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ot(r)}}});var _2={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};he({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}});he({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}});he({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;if(r.length===1)r=_2[r];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var gd=(e,t)=>{var n,r,s=!1,i;if(e.type==="supsub")n=e.sup,r=e.sub,i=Me(e.base,"operatorname"),s=!0;else i=Me(e,"operatorname");var a;if(i.body.length>0){var o=i.body.map((f)=>{var p="text"in f?f.text:void 0;if(typeof p==="string")return{type:"textord",mode:f.mode,text:p};else return f}),l=dt(o,t.withFont("mathrm"),!0);for(var u=0;u<l.length;u++){var d=l[u];if(d instanceof zt)d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*")}a=X(["mop"],l,t)}else a=X(["mop"],[],t);if(s)return fd(a,n,r,t,t.style,0,0);else return a},T2=(e,t)=>{var n=Wt(e.body,t.withFont("mathrm")),r=!0;for(var s=0;s<n.length;s++){var i=n[s];if(i instanceof al);else if(i instanceof ne)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var a=i.children[0];if(i.children.length===1&&a instanceof st)a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*");else r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map((d)=>d.toText()).join("");n=[new st(o)]}var l=new ne("mi",n);l.setAttribute("mathvariant","normal");var u=new ne("mo",[Kt("","text")]);if(e.parentIsSupSub)return new ne("mrow",[l,u]);else return Ku([l,u])};he({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:ot(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:gd,mathmlBuilder:T2});w("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");_r({type:"ordgroup",htmlBuilder(e,t){if(e.semisimple)return zn(dt(e.body,t,!1));return X(["mord"],dt(e.body,t,!0),t)},mathmlBuilder(e,t){return ir(e.body,t,!0)}});he({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Ne(e.body,t.havingCrampedStyle()),r=ts("overline-line",t),s=t.fontMetrics().defaultRuleThickness,i=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return X(["mord","katex-overline"],[i],t)},mathmlBuilder(e,t){var n=new ne("mo",[new st("‾")]);n.setAttribute("stretchy","true");var r=new ne("mover",[qe(e.body,t),n]);return r.setAttribute("accent","true"),r}});he({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:"phantom",mode:n.mode,body:ot(r)}},htmlBuilder:(e,t)=>{var n=dt(e.body,t.withPhantom(),!1);return zn(n)},mathmlBuilder:(e,t)=>{var n=Wt(e.body,t);return new ne("mphantom",n)}});w("\\hphantom","\\smash{\\phantom{#1}}");he({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=X(["katex-inner"],[Ne(e.body,t.withPhantom())]),r=X(["katex-fix"],[]);return X(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Wt(ot(e.body),t),r=new ne("mphantom",n),s=new ne("mpadded",[r]);return s.setAttribute("width","0px"),s}});he({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var n=e.parser,r=Me(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(e,t){var n=Ne(e.body,t),r=et(e.dy,t);return Oe({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ne("mpadded",[qe(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});var bd=(e,t)=>{var n=e.parser;return{type:"reflectbox",mode:n.mode,body:t[0]}};he({type:"reflectbox",names:["\\reflectbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler:bd,htmlBuilder(e,t){return X(["mord","reflectbox"],[Ne(e.body,t)],t)},mathmlBuilder(e,t){return qe(e.body,t)}});he({type:"reflectbox",names:["\\mathreflectbox"],numArgs:1,argTypes:["math"],handler:bd});he({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var t=e.parser;return{type:"internal",mode:t.mode}}});he({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var r=e.parser,s=n[0],i=Me(t[0],"size"),a=Me(t[1],"size");return{type:"rule",mode:r.mode,shift:s&&Me(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=X(["mord","katex-rule"],[],t),r=et(e.width,t),s=et(e.height,t),i=e.shift?et(e.shift,t):0;return n.style.borderRightWidth=ae(r),n.style.borderTopWidth=ae(s),n.style.bottom=ae(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=et(e.width,t),r=et(e.height,t),s=e.shift?et(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new ne("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ae(n)),a.setAttribute("height",ae(r));var o=new ne("mpadded",[a]);if(s>=0)o.setAttribute("height",ae(s));else o.setAttribute("height",ae(s)),o.setAttribute("depth",ae(-s));return o.setAttribute("voffset",ae(s)),o}});function vd(e,t,n){var r=dt(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier;for(var i=0;i<r.length;i++){var a=r[i].classes.indexOf("katex-sizing");if(a<0)Array.prototype.push.apply(r[i].classes,t.sizingClasses(n));else if(r[i].classes[a+1]==="reset-size"+t.size)r[i].classes[a+1]="reset-size"+n.size;r[i].height*=s,r[i].depth*=s}return zn(r)}var xu=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],S2=(e,t)=>{var n=t.havingSize(e.size);return vd(e.body,n,t)};he({type:"sizing",names:xu,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:xu.indexOf(r)+1,body:i}},htmlBuilder:S2,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Wt(e.body,n),s=new ne("mstyle",r);return s.setAttribute("mathsize",ae(n.sizeMultiplier)),s}});he({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,s=!1,i=!1,a=n[0]&&Me(n[0],"ordgroup");if(a){var o;for(var l=0;l<a.body.length;++l){var u=a.body[l];if(o=ua(u).text,o==="t")s=!0;else if(o==="b")i=!0;else{s=!1,i=!1;break}}}else s=!0,i=!0;var d=t[0];return{type:"smash",mode:r.mode,body:d,smashHeight:s,smashDepth:i}},htmlBuilder:(e,t)=>{var n=X([],[Ne(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight)n.height=0;if(e.smashDepth)n.depth=0;if(e.smashHeight&&e.smashDepth)return X(["mord","katex-smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++){if(e.smashHeight)n.children[r].height=0;if(e.smashDepth)n.children[r].depth=0}var s=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return X(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new ne("mpadded",[qe(e.body,t)]);if(e.smashHeight)n.setAttribute("height","0px");if(e.smashDepth)n.setAttribute("depth","0px");return n}});he({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,s=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,t){var n=Ne(e.body,t.havingCrampedStyle());if(n.height===0)n.height=t.fontMetrics().xHeight;n=ns(n,t);var r=t.fontMetrics(),s=r.defaultRuleThickness,i=s;if(t.style.id<Se.TEXT.id)i=t.fontMetrics().xHeight;var a=s+i/4,o=n.height+n.depth+a+s,l=c2(o,t),{span:u,ruleWidth:d,advanceWidth:f}=l,p=u.height-d;if(p>n.height+n.depth+a)a=(a+p-n.height-n.depth)/2;var g=u.height-n.height-a-d;n.style.paddingLeft=ae(f);var b=Oe({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]});if(!e.index)return X(["mord","sqrt"],[b],t);else{var x=t.havingStyle(Se.SCRIPTSCRIPT),k=Ne(e.index,x,t),A=0.6*(b.height-b.depth),T=Oe({positionType:"shift",positionData:-A,children:[{type:"elem",elem:k}]}),S=X(["katex-root"],[T]);return X(["mord","sqrt"],[S,b],t)}},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ne("mroot",[qe(n,t),qe(r,t)]):new ne("msqrt",[qe(n,t)])}});var Xo={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT};function R2(e){return e in Xo}he({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!R2(a))throw Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,t){var n=Xo[e.style],r=t.havingStyle(n);if(e.resetFont)r=r.withFont("");return vd(e.body,r,t)},mathmlBuilder(e,t){var n=Xo[e.style],r=t.havingStyle(n);if(e.resetFont)r=r.withFont("");var s=Wt(e.body,r),i=new ne("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var M2=function(t,n){var r=t.base;if(!r)return null;else if(r.type==="op"){var s=r.limits&&(n.style.size===Se.DISPLAY.size||r.alwaysHandleSupSub);return s?pd:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Se.DISPLAY.size||r.limits);return i?gd:null}else if(r.type==="accent")return Bn(r.base)?Yu:null;else if(r.type==="horizBrace"){var a=!t.sub;return a===r.isOver?hd:null}else return null};_r({type:"supsub",htmlBuilder(e,t){var n=M2(e,t);if(n)return n(e,t);var{base:r,sup:s,sub:i}=e,a=Ne(r,t),o,l,u=t.fontMetrics(),d=0,f=0,p=r&&Bn(r);if(s){var g=t.havingStyle(t.style.sup());if(o=Ne(s,g,t),!p)d=a.height-g.fontMetrics().supDrop*g.sizeMultiplier/t.sizeMultiplier}if(i){var b=t.havingStyle(t.style.sub());if(l=Ne(i,b,t),!p)f=a.depth+b.fontMetrics().subDrop*b.sizeMultiplier/t.sizeMultiplier}var x;if(t.style===Se.DISPLAY)x=u.sup1;else if(t.style.cramped)x=u.sup3;else x=u.sup2;var k=t.sizeMultiplier,A=ae(0.5/u.ptPerEm/k),T=null;if(l){var S=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof zt||S){var E;T=ae(-((E=a.italic)!=null?E:0))}}var D;if(o&&l){d=Math.max(d,x,o.depth+0.25*u.xHeight),f=Math.max(f,u.sub2);var M=u.defaultRuleThickness,L=4*M;if(d-o.depth-(l.height-f)<L){f=L-(d-o.depth)+l.height;var z=0.8*u.xHeight-(d-o.depth);if(z>0)d+=z,f-=z}var O=[{type:"elem",elem:l,shift:f,marginRight:A,marginLeft:T},{type:"elem",elem:o,shift:-d,marginRight:A}];D=Oe({positionType:"individualShift",children:O})}else if(l){f=Math.max(f,u.sub1,l.height-0.8*u.xHeight);var P=[{type:"elem",elem:l,marginLeft:T,marginRight:A}];D=Oe({positionType:"shift",positionData:f,children:P})}else if(o)d=Math.max(d,x,o.depth+0.25*u.xHeight),D=Oe({positionType:"shift",positionData:-d,children:[{type:"elem",elem:o,marginRight:A}]});else throw Error("supsub must have either sup or sub.");var V=Ko(a,"right")||"mord";return X([V],[a,X(["msupsub"],[D])],t)},mathmlBuilder(e,t){var n=!1,r,s;if(e.base&&e.base.type==="horizBrace"){if(s=!!e.sup,s===e.base.isOver)n=!0,r=e.base.isOver}if(e.base&&(e.base.type==="op"||e.base.type==="operatorname"))e.base.parentIsSupSub=!0;var i=[qe(e.base,t)];if(e.sub)i.push(qe(e.sub,t));if(e.sup)i.push(qe(e.sup,t));var a;if(n)a=r?"mover":"munder";else if(!e.sub){var o=e.base;if(o&&o.type==="op"&&o.limits&&(t.style===Se.DISPLAY||o.alwaysHandleSupSub))a="mover";else if(o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Se.DISPLAY))a="mover";else a="msup"}else if(!e.sup){var l=e.base;if(l&&l.type==="op"&&l.limits&&(t.style===Se.DISPLAY||l.alwaysHandleSupSub))a="munder";else if(l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Se.DISPLAY))a="munder";else a="msub"}else{var u=e.base;if(u&&u.type==="op"&&u.limits&&t.style===Se.DISPLAY)a="munderover";else if(u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Se.DISPLAY||u.limits))a="munderover";else a="msubsup"}return new ne(a,i)}});_r({type:"atom",htmlBuilder(e,t){return sl(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new ne("mo",[Kt(e.text,e.mode)]);if(e.family==="bin"){var r=ll(e,t);if(r==="bold-italic")n.setAttribute("mathvariant",r)}else if(e.family==="punct")n.setAttribute("separator","true");else if(e.family==="open"||e.family==="close")n.setAttribute("stretchy","false");return n}});var yd={mi:"italic",mn:"normal",mtext:"normal"};_r({type:"mathord",htmlBuilder(e,t){return oa(e,t)},mathmlBuilder(e,t){var n=new ne("mi",[Kt(e.text,e.mode,t)]),r=ll(e,t)||"italic";if(r!==yd[n.type])n.setAttribute("mathvariant",r);return n}});_r({type:"textord",htmlBuilder(e,t){return oa(e,t)},mathmlBuilder(e,t){var n=Kt(e.text,e.mode,t),r=ll(e,t)||"normal",s;if(e.mode==="text")s=new ne("mtext",[n]);else if(/[0-9]/.test(e.text))s=new ne("mn",[n]);else if(e.text==="\\prime")s=new ne("mo",[n]);else s=new ne("mi",[n]);if(r!==yd[s.type])s.setAttribute("mathvariant",r);return s}});var Eu=new Map([["\\nobreak","nobreak"],["\\allowbreak","allowbreak"]]),Au=new Map([[" ",{}],["\\ ",{}],["~",{className:"nobreak"}],["\\space",{}],["\\nobreakspace",{className:"nobreak"}]]);_r({type:"spacing",htmlBuilder(e,t){var n=Au.get(e.text),r=Eu.get(e.text);if(n){var s=n.className||"";if(e.mode==="text"){var i=oa(e,t);return i.classes.push(s),i}else return X(["mspace",s],[sl(e.text,e.mode,t)],t)}else if(r)return X(["mspace",r],[],t);else throw new te('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){var n;if(Au.has(e.text))n=new ne("mtext",[new st(" ")]);else if(Eu.has(e.text))return new ne("mspace");else throw new te('Unknown type of space "'+e.text+'"');return n}});var Cu=()=>{var e=new ne("mtd",[]);return e.setAttribute("width","50%"),e};_r({type:"tag",mathmlBuilder(e,t){var n=new ne("mtable",[new ne("mtr",[Cu(),new ne("mtd",[ir(e.body,t)]),Cu(),new ne("mtd",[ir(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var _u={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Tu={"\\textbf":"textbf","\\textmd":"textmd"},D2={"\\textit":"textit","\\textup":"textup"},Su=(e,t)=>{var n=e.font;if(!n)return t;else if(_u[n])return t.withTextFontFamily(_u[n]);else if(Tu[n])return t.withTextFontWeight(Tu[n]);else if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit");return t.withTextFontShape(D2[n])};he({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"text",mode:n.mode,body:ot(s),font:r}},htmlBuilder(e,t){var n=Su(e,t),r=dt(e.body,n,!0);return X(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Su(e,t);return ir(e.body,n)}});he({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ne(e.body,t),r=ts("underline-line",t),s=t.fontMetrics().defaultRuleThickness,i=Oe({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]});return X(["mord","katex-underline"],[i],t)},mathmlBuilder(e,t){var n=new ne("mo",[new st("‾")]);n.setAttribute("stretchy","true");var r=new ne("munder",[qe(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});he({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var n=e.parser;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ne(e.body,t),r=t.fontMetrics().axisHeight,s=0.5*(n.height-r-(n.depth+r));return Oe({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ne("mpadded",[qe(e.body,t)],["vcenter"]);return new ne("mrow",[n])}});he({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new te("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){var n=Ru(e),r=[],s=t.havingStyle(t.style.text());for(var i=0;i<n.length;i++){var a=n[i];if(a==="~")a="\\textasciitilde";r.push(Tt(a,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return X(["mord","text"].concat(s.sizingClasses(t)),Hu(r),s)},mathmlBuilder(e,t){var n=new st(Ru(e)),r=new ne("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Ru=(e)=>e.body.replace(/ /g,e.star?"␣":" "),nr=ju,wd=`[ \r
|
|
280
|
+
]`,L2="\\\\[a-zA-Z@]+",I2="\\\\[^\uD800-\uDFFF]",N2="("+L2+")"+wd+"*",B2=`\\\\(
|
|
281
|
+
|[ \r ]+
|
|
282
|
+
?)[ \r ]*`,Qo="[̀-ͯ]",O2=new RegExp(Qo+"+$"),z2="("+wd+"+)|"+(B2+"|")+"([!-\\[\\]-‧-豈-]"+(Qo+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Qo+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+N2)+("|"+I2+")");class el{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(z2,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Pt("EOF",new Bt(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new te("Unexpected character: '"+e[t]+"'",new Pt(e[t],new Bt(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[r]===14){var s=e.indexOf(`
|
|
283
|
+
`,this.tokenRegex.lastIndex);if(s===-1)this.tokenRegex.lastIndex=e.length,Ot({strict:this.settings.strict,errorCode:"commentAtEnd",errorMsg:"% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)",report:!0});else this.tokenRegex.lastIndex=s+1;return this.lex()}return new Pt(r,new Bt(this,t,this.tokenRegex.lastIndex))}}class kd{constructor(e,t){if(e===void 0)e={};if(t===void 0)t={};this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new te("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t of Object.keys(e))if(e[t]===void 0)delete this.current[t];else this.current[t]=e[t]}endGroups(){while(this.undefStack.length>0)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];else if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e];else return}set(e,t,n){if(n===void 0)n=!1;if(n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];if(this.undefStack.length>0)this.undefStack[this.undefStack.length-1][e]=t}else{var s=this.undefStack[this.undefStack.length-1];if(s&&!Object.prototype.hasOwnProperty.call(s,e))s[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0}if(t==null)delete this.current[e];else this.current[e]=t}}var F2=cd;w("\\noexpand",function(e){var t=e.popToken();if(e.isExpandable(t.text))t.noexpand=!0,t.treatAsRelax=!0;return{tokens:[t],numArgs:0}});w("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});w("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});w("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});w("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();if(t[0].length===1&&t[0][0].text===n.text)return{tokens:t[1],numArgs:0};else return{tokens:t[2],numArgs:0}});w("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");w("\\TextOrMath",function(e){var t=e.consumeArgs(2);if(e.mode==="text")return{tokens:t[0],numArgs:0};else return{tokens:t[1],numArgs:0}});var Mu={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};w("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else if(t.text==="EOF")throw new te("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=Mu[t.text],r==null||r>=n)throw new te("Invalid base-"+n+" digit "+t.text);var s;while((s=Mu[e.future().text])!=null&&s<n)r*=n,r+=s,e.popToken()}return"\\@char{"+r+"}"});var fl=(e,t,n,r)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new te("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!t)throw new te("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new te("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){var l="",u=e.expandNextToken();while(u.text!=="]"&&u.text!=="EOF")l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new te("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}if(!(a&&r))e.macros.set(i,{tokens:s,numArgs:o});return""};w("\\newcommand",(e)=>fl(e,!1,!0,!1));w("\\renewcommand",(e)=>fl(e,!0,!1,!1));w("\\providecommand",(e)=>fl(e,!0,!0,!0));w("\\message",(e)=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((n)=>n.text).join("")),""});w("\\errmessage",(e)=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((n)=>n.text).join("")),""});w("\\show",(e)=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),nr[n],Ze.math[n],Ze.text[n]),""});w("\\bgroup","{");w("\\egroup","}");w("~","\\nobreakspace");w("\\lq","`");w("\\rq","'");w("\\aa","\\r a");w("\\AA","\\r A");w("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");w("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");w("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");w("ℬ","\\mathscr{B}");w("ℰ","\\mathscr{E}");w("ℱ","\\mathscr{F}");w("ℋ","\\mathscr{H}");w("ℐ","\\mathscr{I}");w("ℒ","\\mathscr{L}");w("ℳ","\\mathscr{M}");w("ℛ","\\mathscr{R}");w("ℭ","\\mathfrak{C}");w("ℌ","\\mathfrak{H}");w("ℨ","\\mathfrak{Z}");w("\\Bbbk","\\Bbb{k}");w("\\llap","\\mathllap{\\textrm{#1}}");w("\\rlap","\\mathrlap{\\textrm{#1}}");w("\\clap","\\mathclap{\\textrm{#1}}");w("\\mathstrut","\\vphantom{(}");w("\\underbar","\\underline{\\text{#1}}");w("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');w("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");w("\\ne","\\neq");w("≠","\\neq");w("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}"+"{\\mathrel{\\char`∉}}");w("∉","\\notin");w("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}"+"}{\\mathrel{\\char`≘}}");w("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");w("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");w("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}"+"{\\mathrel{\\char`≛}}");w("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}"+"{\\mathrel{\\char`≝}}");w("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}"+"{\\mathrel{\\char`≞}}");w("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");w("⟂","\\perp");w("‼","\\mathclose{!\\mkern-0.8mu!}");w("∌","\\notni");w("⌜","\\ulcorner");w("⌝","\\urcorner");w("⌞","\\llcorner");w("⌟","\\lrcorner");w("©","\\copyright");w("®","\\textregistered");w("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');w("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');w("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');w("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');w("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");w("⋮","\\vdots");w("\\varGamma","\\mathit{\\Gamma}");w("\\varDelta","\\mathit{\\Delta}");w("\\varTheta","\\mathit{\\Theta}");w("\\varLambda","\\mathit{\\Lambda}");w("\\varXi","\\mathit{\\Xi}");w("\\varPi","\\mathit{\\Pi}");w("\\varSigma","\\mathit{\\Sigma}");w("\\varUpsilon","\\mathit{\\Upsilon}");w("\\varPhi","\\mathit{\\Phi}");w("\\varPsi","\\mathit{\\Psi}");w("\\varOmega","\\mathit{\\Omega}");w("\\substack","\\begin{subarray}{c}#1\\end{subarray}");w("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");w("\\boxed","\\fbox{$\\displaystyle{#1}$}");w("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");w("\\implies","\\DOTSB\\;\\Longrightarrow\\;");w("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");w("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");w("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Du={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},$2=new Set(["bin","rel"]);w("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;if(n in Du)t=Du[n];else if(n.slice(0,4)==="\\not")t="\\dotsb";else if(n in Ze.math){if($2.has(Ze.math[n].group))t="\\dotsb"}return t});var ml={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};w("\\dotso",function(e){var t=e.future().text;if(t in ml)return"\\ldots\\,";else return"\\ldots"});w("\\dotsc",function(e){var t=e.future().text;if(t in ml&&t!==",")return"\\ldots\\,";else return"\\ldots"});w("\\cdots",function(e){var t=e.future().text;if(t in ml)return"\\@cdots\\,";else return"\\@cdots"});w("\\dotsb","\\cdots");w("\\dotsm","\\cdots");w("\\dotsi","\\!\\cdots");w("\\dotsx","\\ldots\\,");w("\\DOTSI","\\relax");w("\\DOTSB","\\relax");w("\\DOTSX","\\relax");w("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");w("\\,","\\tmspace+{3mu}{.1667em}");w("\\thinspace","\\,");w("\\>","\\mskip{4mu}");w("\\:","\\tmspace+{4mu}{.2222em}");w("\\medspace","\\:");w("\\;","\\tmspace+{5mu}{.2777em}");w("\\thickspace","\\;");w("\\!","\\tmspace-{3mu}{.1667em}");w("\\negthinspace","\\!");w("\\negmedspace","\\tmspace-{4mu}{.2222em}");w("\\negthickspace","\\tmspace-{5mu}{.277em}");w("\\enspace","\\kern.5em ");w("\\enskip","\\hskip.5em\\relax");w("\\quad","\\hskip1em\\relax");w("\\qquad","\\hskip2em\\relax");w("\\tag","\\@ifstar\\tag@literal\\tag@paren");w("\\tag@paren","\\tag@literal{({#1})}");w("\\tag@literal",(e)=>{if(e.macros.get("\\df@tag"))throw new te("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});w("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");w("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");w("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");w("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");w("\\newline","\\\\\\relax");w("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var xd=ae(mn["Main-Regular"][84][1]-0.7*mn["Main-Regular"][65][1]);w("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+xd+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");w("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+xd+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");w("\\hspace","\\@ifstar\\@hspacer\\@hspace");w("\\@hspace","\\hskip #1\\relax");w("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");w("\\ordinarycolon",":");w("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");w("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');w("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');w("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');w("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');w("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');w("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');w("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');w("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');w("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');w("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');w("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');w("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');w("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');w("∷","\\dblcolon");w("∹","\\eqcolon");w("≔","\\coloneqq");w("≕","\\eqqcolon");w("⩴","\\Coloneqq");w("\\ratio","\\vcentcolon");w("\\coloncolon","\\dblcolon");w("\\colonequals","\\coloneqq");w("\\coloncolonequals","\\Coloneqq");w("\\equalscolon","\\eqqcolon");w("\\equalscoloncolon","\\Eqqcolon");w("\\colonminus","\\coloneq");w("\\coloncolonminus","\\Coloneq");w("\\minuscolon","\\eqcolon");w("\\minuscoloncolon","\\Eqcolon");w("\\coloncolonapprox","\\Colonapprox");w("\\coloncolonsim","\\Colonsim");w("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");w("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");w("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");w("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");w("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");w("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");w("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");w("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");w("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");w("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");w("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");w("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");w("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");w("\\nleqq","\\html@mathml{\\@nleqq}{≰}");w("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");w("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");w("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");w("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");w("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");w("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");w("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");w("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");w("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");w("\\imath","\\html@mathml{\\@imath}{ı}");w("\\jmath","\\html@mathml{\\@jmath}{ȷ}");w("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}"+"{\\mathopen{\\char`⟦}}");w("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}"+"{\\mathclose{\\char`⟧}}");w("⟦","\\llbracket");w("⟧","\\rrbracket");w("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}"+"{\\mathopen{\\char`⦃}}");w("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}"+"{\\mathclose{\\char`⦄}}");w("↤","\\mapsfrom");w("\\mapsfrom","\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}");w("⦃","\\lBrace");w("⦄","\\rBrace");w("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}"+"{\\char`⦵}}");w("⦵","\\minuso");w("\\darr","\\downarrow");w("\\dArr","\\Downarrow");w("\\Darr","\\Downarrow");w("\\lang","\\langle");w("\\rang","\\rangle");w("\\uarr","\\uparrow");w("\\uArr","\\Uparrow");w("\\Uarr","\\Uparrow");w("\\N","\\mathbb{N}");w("\\R","\\mathbb{R}");w("\\Z","\\mathbb{Z}");w("\\alef","\\aleph");w("\\alefsym","\\aleph");w("\\Alpha","\\mathrm{A}");w("\\Beta","\\mathrm{B}");w("\\bull","\\bullet");w("\\Chi","\\mathrm{X}");w("\\clubs","\\clubsuit");w("\\cnums","\\mathbb{C}");w("\\Complex","\\mathbb{C}");w("\\Dagger","\\ddagger");w("\\diamonds","\\diamondsuit");w("\\empty","\\emptyset");w("\\Epsilon","\\mathrm{E}");w("\\Eta","\\mathrm{H}");w("\\exist","\\exists");w("\\harr","\\leftrightarrow");w("\\hArr","\\Leftrightarrow");w("\\Harr","\\Leftrightarrow");w("\\hearts","\\heartsuit");w("\\image","\\Im");w("\\infin","\\infty");w("\\Iota","\\mathrm{I}");w("\\isin","\\in");w("\\Kappa","\\mathrm{K}");w("\\larr","\\leftarrow");w("\\lArr","\\Leftarrow");w("\\Larr","\\Leftarrow");w("\\lrarr","\\leftrightarrow");w("\\lrArr","\\Leftrightarrow");w("\\Lrarr","\\Leftrightarrow");w("\\Mu","\\mathrm{M}");w("\\natnums","\\mathbb{N}");w("\\Nu","\\mathrm{N}");w("\\Omicron","\\mathrm{O}");w("\\plusmn","\\pm");w("\\rarr","\\rightarrow");w("\\rArr","\\Rightarrow");w("\\Rarr","\\Rightarrow");w("\\real","\\Re");w("\\reals","\\mathbb{R}");w("\\Reals","\\mathbb{R}");w("\\Rho","\\mathrm{P}");w("\\sdot","\\cdot");w("\\sect","\\S");w("\\spades","\\spadesuit");w("\\sub","\\subset");w("\\sube","\\subseteq");w("\\supe","\\supseteq");w("\\Tau","\\mathrm{T}");w("\\thetasym","\\vartheta");w("\\weierp","\\wp");w("\\Zeta","\\mathrm{Z}");w("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");w("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");w("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");w("\\bra","\\mathinner{\\langle{#1}|}");w("\\ket","\\mathinner{|{#1}\\rangle}");w("\\braket","\\mathinner{\\langle{#1}\\rangle}");w("\\Bra","\\left\\langle#1\\right|");w("\\Ket","\\left|#1\\right\\rangle");var Ed=(e)=>(t)=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=(f)=>(p)=>{if(e){if(p.macros.set("|",a),s.length)p.macros.set("\\|",o)}var g=f;if(!f&&s.length){var b=p.future();if(b.text==="|")p.popToken(),g=!0}return{tokens:g?s:r,numArgs:0}};if(t.macros.set("|",l(!1)),s.length)t.macros.set("\\|",l(!0));var u=t.consumeArg().tokens,d=t.expandTokens([...i,...u,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};w("\\bra@ket",Ed(!1));w("\\bra@set",Ed(!0));w("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");w("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");w("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");w("\\angln","{\\angl n}");w("\\blue","\\textcolor{##6495ed}{#1}");w("\\orange","\\textcolor{##ffa500}{#1}");w("\\pink","\\textcolor{##ff00af}{#1}");w("\\red","\\textcolor{##df0030}{#1}");w("\\green","\\textcolor{##28ae7b}{#1}");w("\\gray","\\textcolor{gray}{#1}");w("\\purple","\\textcolor{##9d38bd}{#1}");w("\\blueA","\\textcolor{##ccfaff}{#1}");w("\\blueB","\\textcolor{##80f6ff}{#1}");w("\\blueC","\\textcolor{##63d9ea}{#1}");w("\\blueD","\\textcolor{##11accd}{#1}");w("\\blueE","\\textcolor{##0c7f99}{#1}");w("\\tealA","\\textcolor{##94fff5}{#1}");w("\\tealB","\\textcolor{##26edd5}{#1}");w("\\tealC","\\textcolor{##01d1c1}{#1}");w("\\tealD","\\textcolor{##01a995}{#1}");w("\\tealE","\\textcolor{##208170}{#1}");w("\\greenA","\\textcolor{##b6ffb0}{#1}");w("\\greenB","\\textcolor{##8af281}{#1}");w("\\greenC","\\textcolor{##74cf70}{#1}");w("\\greenD","\\textcolor{##1fab54}{#1}");w("\\greenE","\\textcolor{##0d923f}{#1}");w("\\goldA","\\textcolor{##ffd0a9}{#1}");w("\\goldB","\\textcolor{##ffbb71}{#1}");w("\\goldC","\\textcolor{##ff9c39}{#1}");w("\\goldD","\\textcolor{##e07d10}{#1}");w("\\goldE","\\textcolor{##a75a05}{#1}");w("\\redA","\\textcolor{##fca9a9}{#1}");w("\\redB","\\textcolor{##ff8482}{#1}");w("\\redC","\\textcolor{##f9685d}{#1}");w("\\redD","\\textcolor{##e84d39}{#1}");w("\\redE","\\textcolor{##bc2612}{#1}");w("\\maroonA","\\textcolor{##ffbde0}{#1}");w("\\maroonB","\\textcolor{##ff92c6}{#1}");w("\\maroonC","\\textcolor{##ed5fa6}{#1}");w("\\maroonD","\\textcolor{##ca337c}{#1}");w("\\maroonE","\\textcolor{##9e034e}{#1}");w("\\purpleA","\\textcolor{##ddd7ff}{#1}");w("\\purpleB","\\textcolor{##c6b9fc}{#1}");w("\\purpleC","\\textcolor{##aa87ff}{#1}");w("\\purpleD","\\textcolor{##7854ab}{#1}");w("\\purpleE","\\textcolor{##543b78}{#1}");w("\\mintA","\\textcolor{##f5f9e8}{#1}");w("\\mintB","\\textcolor{##edf2df}{#1}");w("\\mintC","\\textcolor{##e0e5cc}{#1}");w("\\grayA","\\textcolor{##f6f7f7}{#1}");w("\\grayB","\\textcolor{##f0f1f2}{#1}");w("\\grayC","\\textcolor{##e3e5e6}{#1}");w("\\grayD","\\textcolor{##d6d8da}{#1}");w("\\grayE","\\textcolor{##babec2}{#1}");w("\\grayF","\\textcolor{##888d93}{#1}");w("\\grayG","\\textcolor{##626569}{#1}");w("\\grayH","\\textcolor{##3b3e40}{#1}");w("\\grayI","\\textcolor{##21242c}{#1}");w("\\kaBlue","\\textcolor{##314453}{#1}");w("\\kaGreen","\\textcolor{##71B307}{#1}");var Ad={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Cd{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new kd(F2,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new el(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){if(this.stack.length===0)this.pushToken(this.lexer.lex());return this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken();var s=this.consumeArg(["]"]);r=s.tokens,n=s.end}else{var i=this.consumeArg();r=i.tokens,t=i.start,n=i.end}return this.pushToken(new Pt("EOF",n.loc)),this.pushTokens(r),new Pt("",Bt.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;if(!n)this.consumeSpaces();var r=this.future(),s,i=0,a=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++i;else if(s.text==="}"){if(--i,i===-1)throw new te("Extra }",s)}else if(s.text==="EOF")throw new te("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((i===0||i===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(i!==0||n);if(r.text==="{"&&t[t.length-1].text==="}")t.pop(),t.shift();return t.reverse(),{tokens:t,start:r,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new te("The length of delimiters doesn't match the number of args!");var n=t[0];for(var r=0;r<n.length;r++){var s=this.popToken();if(n[r]!==s.text)throw new te("Use of the macro doesn't match its definition",s)}}var i=[];for(var a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new te("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=!t.noexpand?this._getExpansion(n):null;if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]==="\\"&&!this.isDefined(n))throw new te("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var s=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var o=s[a];if(o.text==="#"){if(a===0)throw new te("Incomplete placeholder at end of macro body",o);if(o=s[--a],o.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(o.text))s.splice(a,2,...i[+o.text-1]);else throw new te("Not a valid argument number",o)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();if(e.treatAsRelax)e.text="\\relax";return e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Pt(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;this.pushTokens(e);while(this.stack.length>n)if(this.expandOnce(!0)===!1){var r=this.stack.pop();if(r.treatAsRelax)r.noexpand=!1,r.treatAsRelax=!1;t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);if(t)return t.map((n)=>n.text).join("");else return t}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==="function"?t(this):t;if(typeof r==="string"){var s=0;if(r.includes("#")){var i=r.replace(/##/g,"");while(i.includes("#"+(s+1)))++s}var a=new el(r,this.settings),o=[],l=a.lex();while(l.text!=="EOF")o.push(l),l=a.lex();o.reverse();var u={tokens:o,numArgs:s};return u}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(nr,e)||Object.prototype.hasOwnProperty.call(Ze.math,e)||Object.prototype.hasOwnProperty.call(Ze.text,e)||Object.prototype.hasOwnProperty.call(Ad,e)}isExpandable(e){var t=this.macros.get(e);if(t!=null)return typeof t==="string"||typeof t==="function"||!t.unexpandable;return Object.prototype.hasOwnProperty.call(nr,e)&&!nr[e].primitive}}var Lu=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Yi=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Bo={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:"\\\"",math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Iu={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class pa{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Cd(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0)t=!0;if(this.fetch().text!==e)throw new te("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());if(t)this.consume()}consume(){this.nextToken=null}fetch(){if(this.nextToken==null)this.nextToken=this.gullet.expandNextToken();return this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){if(!this.settings.globalGroup)this.gullet.beginGroup();if(this.settings.colorIsTextColor)this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);if(this.expect("EOF"),!this.settings.globalGroup)this.gullet.endGroup();return e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Pt("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){var n=[];while(!0){if(this.mode==="math")this.consumeSpaces();var r=this.fetch();if(pa.endOfExpression.has(r.text))break;if(t&&r.text===t)break;if(e&&nr[r.text]&&nr[r.text].infix)break;var s=this.parseAtom(t);if(!s)break;else if(s.type==="internal")continue;n.push(s)}if(this.mode==="text")this.formLigatures(n);return this.handleInfixNodes(n)}handleInfixNodes(e){var t=-1,n;for(var r=0;r<e.length;r++){var s=e[r];if(s.type==="infix"){if(t!==-1)throw new te("only one infix operator per group",s.token);t=r,n=s.replaceWith}}if(t!==-1&&n){var i,a,o=e.slice(0,t),l=e.slice(t+1);if(o.length===1&&o[0].type==="ordgroup")i=o[0];else i={type:"ordgroup",mode:this.mode,body:o};if(l.length===1&&l[0].type==="ordgroup")a=l[0];else a={type:"ordgroup",mode:this.mode,body:l};var u;if(n==="\\\\abovefrac")u=this.callFunction(n,[i,e[t],a],[]);else u=this.callFunction(n,[i,a],[]);return[u]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do{var s;r=this.parseGroup(e)}while(((s=r)==null?void 0:s.type)==="internal");if(!r)throw new te("Expected group after '"+n+"'",t);return r}formatUnsupportedCmd(e){var t=[];for(var n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]};return s}parseAtom(e){var t=this.parseGroup("atom",e);if((t==null?void 0:t.type)==="internal")return t;if(this.mode==="text")return t;var n,r;while(!0){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(t&&t.type==="op")t.limits=s.text==="\\limits",t.alwaysHandleSupSub=!0;else if(t&&t.type==="operatorname"){if(t.alwaysHandleSupSub)t.limits=s.text==="\\limits"}else throw new te("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new te("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(r)throw new te("Double subscript",s);r=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new te("Double superscript",s);var i={type:"textord",mode:this.mode,text:"\\prime"},a=[i];this.consume();while(this.fetch().text==="'")a.push(i),this.consume();if(this.fetch().text==="^")a.push(this.handleSupSubscript("superscript"));n={type:"ordgroup",mode:this.mode,body:a}}else if(Yi[s.text]){var o=Lu.test(s.text),l=[];l.push(new Pt(Yi[s.text])),this.consume();while(!0){var u=this.fetch().text;if(!Yi[u])break;if(Lu.test(u)!==o)break;l.unshift(new Pt(Yi[u])),this.consume()}var d=this.subparse(l);if(o)r={type:"ordgroup",mode:"math",body:d};else n={type:"ordgroup",mode:"math",body:d}}else break}if(n&&r)return{type:"supsub",mode:this.mode,base:t,sup:n,sub:r};else if(n)return{type:"supsub",mode:this.mode,base:t,sup:n};else if(r)return{type:"supsub",mode:this.mode,base:t,sub:r};else return t}parseFunction(e,t){var n=this.fetch(),r=n.text,s=nr[r];if(!s)return null;if(this.consume(),t&&t!=="atom"&&!s.allowedInArgument)throw new te("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);else if(this.mode==="text"&&!s.allowedInText)throw new te("Can't use function '"+r+"' in text mode",n);else if(this.mode==="math"&&s.allowedInMath===!1)throw new te("Can't use function '"+r+"' in math mode",n);var i=this.parseArguments(r,s),{args:a,optArgs:o}=i;return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,s){var i={funcName:e,parser:this,token:r,breakOnTokenText:s},a=nr[e];if(a&&a.handler)return a.handler(i,t,n);else throw new te("No function handler for "+e)}parseArguments(e,t){var n,r=(n=t.numOptionalArgs)!=null?n:0,s=t.numArgs+r;if(s===0)return{args:[],optArgs:[]};var i=[],a=[];for(var o=0;o<s;o++){var l,u=(l=t.argTypes)==null?void 0:l[o],d=o<r;if("primitive"in t&&t.primitive&&u==null||t.type==="sqrt"&&o===1&&a[0]==null)u="primitive";var f=this.parseGroupOfType("argument to '"+e+"'",u,d);if(d)a.push(f);else if(f!=null)i.push(f);else throw new te("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var r=this.parseArgumentGroup(n,"text");return r!=null?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null}case"raw":{this.gullet.consumeSpaces();var s=this.gullet.lexer.catcodes["%"];this.gullet.lexer.setCatcode("%",12);var i=this.parseStringGroup(n);return this.gullet.lexer.setCatcode("%",s),i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(n)throw new te("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new te("Expected group as "+e,this.fetch());return a}case"original":case void 0:return this.parseArgumentGroup(n);default:throw new te("Unknown group type as "+e,this.fetch())}}consumeSpaces(){while(this.fetch().text===" ")this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;var n="",r;while((r=this.fetch()).text!=="EOF")n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){var n=this.fetch(),r=n,s="",i;while((i=this.fetch()).text!=="EOF"&&e.test(s+i.text))r=i,s+=r.text,this.consume();if(s==="")throw new te("Invalid "+t+": '"+n.text+"'",n);return n.range(r,s)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new te("Invalid color: '"+t.text+"'",t);var r=n[0];if(/^[0-9a-f]{6}$/i.test(r))r="#"+r;return{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{")t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size");else t=this.parseStringGroup(e);if(!t)return null;if(!e&&t.text.length===0)t.text="0pt",n=!0;var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new te("Invalid size: '"+t.text+"'",t);var s={number:+(r[1]+r[2]),unit:r[3]};if(!Bu(s))throw new te("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,isBlank:n}}parseUrlGroup(e){var t=this.gullet.lexer.catcodes["%"],n=this.gullet.lexer.catcodes["~"];this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",t),this.gullet.lexer.setCatcode("~",n),r==null)return null;var s=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:s}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;if(t)this.switchMode(t);this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};if(t)this.switchMode(r);return i}parseGroup(e,t){var n=this.fetch(),r=n.text,s;if(r==="{"||r==="\\begingroup"){this.consume();var i=r==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),o=this.fetch();this.expect(i),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:Bt.range(n,o),body:a,semisimple:r==="\\begingroup"||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),s==null&&r[0]==="\\"&&!Object.prototype.hasOwnProperty.call(Ad,r)){if(this.settings.throwOnError)throw new te("Undefined control sequence: "+r,n);s=this.formatUnsupportedCmd(r),this.consume()}return s}formLigatures(e){var t=e.length-1;for(var n=0;n<t;++n){var r=e[n];if(r.type!=="textord")continue;var s=r.text,i=e[n+1];if(!i||i.type!=="textord")continue;if(s==="-"&&i.text==="-"){var a=e[n+2];if(n+1<t&&a&&a.type==="textord"&&a.text==="-")e.splice(n,3,{type:"textord",mode:"text",loc:Bt.range(r,a),text:"---"}),t-=2;else e.splice(n,2,{type:"textord",mode:"text",loc:Bt.range(r,i),text:"--"}),t-=1}if((s==="'"||s==="`")&&i.text===s)e.splice(n,2,{type:"textord",mode:"text",loc:Bt.range(r,i),text:s+s}),t-=1}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)==="*";if(r)n=n.slice(1);if(n.length<2||n.charAt(0)!==n.slice(-1))throw new te(`\\verb assertion failed --
|
|
284
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:r}}if(Object.prototype.hasOwnProperty.call(Iu,t[0])&&!Ze[this.mode][t[0]]){if(this.settings.strict&&this.mode==="math")Ot({strict:this.settings.strict,errorCode:"unicodeTextInMathMode",errorMsg:'Accented Unicode text character "'+t[0]+'" used in math mode',report:!0,token:e});t=Iu[t[0]]+t.slice(1)}var s=O2.exec(t);if(s){if(t=t.substring(0,s.index),t==="i")t="ı";else if(t==="j")t="ȷ"}var i;if(Ze[this.mode][t]){if(this.settings.strict&&this.mode==="math"&&$o.includes(t))Ot({strict:this.settings.strict,errorCode:"unicodeTextInMathMode",errorMsg:'Latin-1/Unicode text character "'+t[0]+'" used in math mode',report:!0,token:e});var a=Ze[this.mode][t].group,o=Bt.range(e),l;if(K4(a))l={type:"atom",mode:this.mode,family:a,loc:o,text:t};else l={type:a,mode:this.mode,loc:o,text:t};i=l}else if(t.charCodeAt(0)>=128){if(this.settings.strict){if(!Nu(t.charCodeAt(0)))Ot({strict:this.settings.strict,errorCode:"unknownSymbol",errorMsg:'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),report:!0,token:e});else if(this.mode==="math")Ot({strict:this.settings.strict,errorCode:"unicodeTextInMathMode",errorMsg:'Unicode text character "'+t[0]+'" used in math mode',report:!0,token:e})}i={type:"textord",mode:"text",loc:Bt.range(e),text:t}}else return null;if(this.consume(),s)for(var u=0;u<s[0].length;u++){var d=s[0][u];if(!Bo[d])throw new te("Unknown accent ' "+d+"'",e);var f=Bo[d][this.mode]||Bo[d].text;if(!f)throw new te("Accent "+d+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:Bt.range(e),label:f,isStretchy:!1,isShifty:!0,base:i}}return i}}pa.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var pl=function(t,n){if(!(typeof t==="string"||t instanceof String))throw TypeError("KaTeX can only parse string typed expression");var r=new pa(t,n);delete r.gullet.macros.current["\\df@tag"];var s=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new te("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:r.subparse([new Pt("\\df@tag")])}]}return s},_d=function(t,n,r){n.textContent="";var s=gl(t,r).toNode();n.appendChild(s)};if(typeof document<"u"){if(document.compatMode!=="CSS1Compat")typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),_d=function(){throw new te("KaTeX doesn't work in quirks mode.")}}var q2=function(t,n){var r=gl(t,n).toMarkup();return r},H2=function(t,n){var r=new ia(n);return pl(t,r)},Td=function(t,n,r){if(r.throwOnError||!(t instanceof te))throw t;var s=X(["katex-error"],[new zt(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+r.errorColor),s},gl=function(t,n){var r=new ia(n);try{var s=pl(t,r);return z4(s,t,r)}catch(i){return Td(i,t,r)}},P2=function(t,n){var r=new ia(n);try{var s=pl(t,r);return F4(s,r)}catch(i){return Td(i,t,r)}},U2="0.19.1",W2={Span:Cr,Anchor:Qs,SymbolNode:zt,SvgNode:pn,PathNode:Nn,LineNode:ra},bl={version:U2,render:_d,renderToString:q2,ParseError:te,SETTINGS_SCHEMA:Oo,__parse:H2,__renderToDomTree:gl,__renderToHTMLTree:P2,__setFontMetrics:v4,__defineSymbol:h,__defineFunction:he,__defineMacro:w,__domTree:W2};var Yd=$m(Zd(),1);var as=Yd.default;function Xd(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);let l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],A={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],E=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:x,literal:k,built_in:[...T,...S,"set","shopt",...E,...D]},contains:[g,e.SHEBANG(),b,f,i,a,A,o,l,u,d,n]}}function Qd(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",i="<[^<>]+>",a="(decltype\\(auto\\)|"+t.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o=t.concat(/\batomic_/,t.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:o}]},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},d,{scope:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(d,{className:"string"}),n,e.C_BLOCK_COMMENT_MODE]},b=[p,g],x={className:"title",begin:t.optional("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},k=t.optional("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",A=12,E={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},D=[...b,l,n,e.C_BLOCK_COMMENT_MODE,f,d],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:D.concat([{begin:/\(/,end:/\)/,keywords:E,contains:D.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+a+"[\\*&\\s]+){1,12}"+k,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:E,relevance:0},{begin:k,returnBegin:!0,contains:[e.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,...b]};return{name:"C",aliases:["h"],keywords:E,disableAutodetect:!0,illegal:"</",contains:[].concat(M,L,D,[...b,{begin:e.IDENT_RE+"::",keywords:E},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:d,keywords:E}}}function eh(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",i="<[^<>]+>",a="(?!struct)(decltype\\(auto\\)|"+t.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},u,{scope:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),n,e.C_BLOCK_COMMENT_MODE]},g=[f,p],b={className:"title",begin:t.optional("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},x=t.optional("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",k=12,A=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],T=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],L={type:T,keyword:A,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},z={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,`(?!${A.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[z,...g,o,n,e.C_BLOCK_COMMENT_MODE,d,u],P={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:O.concat([{begin:/\(/,end:/\)/,keywords:L,contains:O.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+a+"[\\*&\\s]+){1,12}"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:L,relevance:0},{begin:x,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,...g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(P,V,z,O,[...g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:L,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}var N3=(e)=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),B3=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],O3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],z3=[...B3,...O3],F3=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$3=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),q3=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),H3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function th(e){let t=e.regex,n=N3(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+$3.join("|")+")"},{begin:":(:)?("+q3.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+H3.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:F3.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+z3.join("|")+")\\b"}]}}function nh(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function rh(e){let i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var os="[0-9](_*[0-9])*",wa=`\\.(${os})`,ka="[0-9a-fA-F](_*[0-9a-fA-F])*",sh={className:"number",variants:[{begin:`(\\b(${os})((${wa})|\\.)?|(${wa}))[eE][+-]?(${os})[fFdD]?\\b`},{begin:`\\b(${os})((${wa})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wa})[fFdD]?\\b`},{begin:`\\b(${os})[fFdD]\\b`},{begin:`\\b0[xX]((${ka})\\.?|(${ka})?\\.(${ka}))[pP][+-]?(${os})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ka})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ih(e,t,n){if(n===-1)return"";return e.replace(t,(r)=>ih(e,t,n-1))}function ah(e){let t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r="(?:(?:\\s*\\[\\s*])+)?",s="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"<@@@>(?:(?:\\s*\\[\\s*])+)?",a="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+s+")?")+"|"+s+")",o=ih("(?:\\s*<\\s*"+a+"(?:\\s*,\\s*"+a+")*\\s*>)?",/<@@@>/g,2),p={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:p,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:["[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t.concat(o,"(?:(?:\\s*\\[\\s*])+)?",/\s+/),"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*","(?:(?:\\s*\\[\\s*])+)?",/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:["[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t.concat(o,"(?:(?:\\s*\\[\\s*])+)?",/\s+/),"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:p,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,sh,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},sh,g]}}var P3=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],U3=["true","false","null","undefined","NaN","Infinity"],oh=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],lh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ch=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],W3=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],j3=[].concat(ch,oh,lh);function uh(e){let t=e.regex,n=(Y,{after:ee})=>{let ie="</"+Y[0].slice(1);return Y.input.indexOf(ie,ee)!==-1},r="[A-Za-z$_][0-9A-Za-z$_]*",s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,ee)=>{let ie=Y[0].length+Y.index,H=Y.input[ie];if(H==="<"||H===","){ee.ignoreMatch();return}if(H===">"){if(!n(Y,{after:ie}))ee.ignoreMatch()}let q,W=Y.input.substring(ie);if(q=W.match(/^\s*=/)){ee.ignoreMatch();return}if(q=W.match(/^\s+extends\s+/)){if(q.index===0){ee.ignoreMatch();return}}}},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:P3,literal:U3,built_in:j3,"variable.language":W3},l="[0-9](_?[0-9])*",u="\\.([0-9](_?[0-9])*)",d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},T={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,x,k,{match:/\$\d+/},f];p.contains=S.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(S)});let E=[].concat(T,p.contains),D=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(E)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:D},L={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,t.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",t.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},z={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...oh,...lh]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return t.concat("(?!",Y.join("|"),")")}let ce={match:t.concat(/\b/,G([...ch,"super","import","await"].map((Y)=>`${Y}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",t.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},de={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:z},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,x,k,T,{match:/\$\d+/},f,z,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ce,V,L,de,{match:/\$[(.]/}]}}var G3={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function dh(e){let t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,G3,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function hh(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),p=e.inherit(d,{contains:[]});u.contains.push(p),d.contains.push(f);let g=[n,l];return[u,d,f,p].forEach((A)=>{A.contains=A.contains.concat(g)}),g=g.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},n,i,r,u,d,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},s,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function fh(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",g="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",b=`\\b|${r.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${b})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${b})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,x,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,x,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,A,f]}]}}function mh(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={scope:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(16|32|64|128))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","raw","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f16","f32","f64","f128","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:o,literal:l,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(16|32|64|128))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(16|32|64|128))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(16|32|64|128))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(16|32|64|128))?"}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:"keyword",3:"keyword"}},{begin:[/fn/,/\s+/,r],scope:{1:"keyword",3:"title.function"}},{scope:"meta",begin:"#!?\\[",end:"\\]",contains:[{scope:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],scope:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{scope:"punctuation",begin:"->"},i]}}function ph(e){let t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=d,b=[...u,...l].filter((D)=>!d.includes(D)),x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:t.concat(/\b/,t.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function T(D){return t.concat(/\b/,t.either(...D.map((M)=>M.replace(/\s+/,"\\s+"))),/\b/)}let S={scope:"keyword",match:T(p),relevance:0};function E(D,{exceptions:M,when:L}={}){let z=L;return M=M||[],D.map((O)=>{if(O.match(/\|\d+$/)||M.includes(O))return O;else if(z(O))return`${O}|0`;else return O})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:E(b,{when:(D)=>D.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:T(a)},S,A,x,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}var gh=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],bh=["true","false","null","undefined","NaN","Infinity"],vh=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],yh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wh=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kh=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],xh=[].concat(wh,vh,yh);function K3(e){let t=e.regex,n=(Y,{after:ee})=>{let ie="</"+Y[0].slice(1);return Y.input.indexOf(ie,ee)!==-1},r="[A-Za-z$_][0-9A-Za-z$_]*",s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,ee)=>{let ie=Y[0].length+Y.index,H=Y.input[ie];if(H==="<"||H===","){ee.ignoreMatch();return}if(H===">"){if(!n(Y,{after:ie}))ee.ignoreMatch()}let q,W=Y.input.substring(ie);if(q=W.match(/^\s*=/)){ee.ignoreMatch();return}if(q=W.match(/^\s+extends\s+/)){if(q.index===0){ee.ignoreMatch();return}}}},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:gh,literal:bh,built_in:xh,"variable.language":kh},l="[0-9](_?[0-9])*",u="\\.([0-9](_?[0-9])*)",d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},T={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,x,k,{match:/\$\d+/},f];p.contains=S.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(S)});let E=[].concat(T,p.contains),D=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(E)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:D},L={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,t.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",t.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},z={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vh,...yh]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return t.concat("(?!",Y.join("|"),")")}let ce={match:t.concat(/\b/,G([...wh,"super","import","await"].map((Y)=>`${Y}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",t.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},de={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:z},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,x,k,T,{match:/\$\d+/},f,z,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ce,V,L,de,{match:/\$[(.]/}]}}function Eh(e){let t=e.regex,n=K3(e),r="[A-Za-z$_][0-9A-Za-z$_]*",s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:gh.concat(l),literal:bh,built_in:xh.concat(s),"variable.language":kh},d={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},f=(x,k,A)=>{let T=x.contains.findIndex((S)=>S.label===k);if(T===-1)throw Error("can not find mode to replace");x.contains.splice(T,1,A)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);let p=n.contains.find((x)=>x.scope==="attr"),g=Object.assign({},p,{match:t.concat("[A-Za-z$_][0-9A-Za-z$_]*",t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,g]),n.contains=n.contains.concat([d,i,a,g]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);let b=n.contains.find((x)=>x.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ah(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,l,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ch(e){let r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l="[0-9]{4}(-[0-9][0-9]){0,2}",u="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",d="(\\.[0-9]*)?",f="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",p={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},b={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},k=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},b,x,i,a],A=[...k];return A.pop(),A.push(o),g.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}var V3={bash:Xd,c:Qd,cpp:eh,css:th,diff:nh,go:rh,java:ah,javascript:uh,json:dh,markdown:hh,python:fh,rust:mh,sql:ph,typescript:Eh,xml:Ah,yaml:Ch};for(let[e,t]of Object.entries(V3))as.registerLanguage(e,t);as.registerAliases(["sh","shell","zsh"],{languageName:"bash"});as.registerAliases("tsx",{languageName:"typescript"});var xa=262144,J3=24576,Mh=4096,Z3=65536,Ft=new Fc({html:!1,linkify:!0,maxNesting:24}),lr=Ft.utils.escapeHtml,Y3=0,_h=new WeakMap,Th=new WeakMap;function Dh(e,t){if(!e||typeof e.remaining!=="number"||e.remaining<t)return!1;return e.remaining-=t,!0}function El(e){if(!/^(?:https?:\/\/|mailto:)/i.test(e))return;let t=URL.parse(e);if(t&&!t.username&&!t.password&&t.origin!==globalThis.location?.origin)return t}function Sh(e){return e.normalize("NFKC").toLowerCase().trim().replace(/[^\p{L}\p{N}\p{M}_\s-]/gu,"").replace(/\s+/g,"-")}Ft.validateLink=(e)=>e.startsWith("#")||El(e)!==void 0;function Lh(e,t,n){if(e.length<=Mh&&Dh(n,e.length+64))try{return bl.renderToString(e,{displayMode:t,output:"mathml",trust:!1,maxExpand:128,maxSize:20})}catch(r){if(!(r instanceof bl.ParseError))throw r}return`<code class="math-source">${lr(e)}</code>`}Ft.use(Pc).use(Wc,{disabled:!0,label:!1}).use(Zc,{delimiters:"all",mathFence:!0,render(e,t,n){let r=Lh(e,t,n);return t?`<div class="markdown-math">${r}</div>
|
|
285
|
+
`:r}});Ft.inline.ruler.before("escape","web_display_math",(e,t)=>{if(!e.src.startsWith("\\[",e.pos)||e.pos+2>=e.posMax)return!1;let n=e.pos+2,r=e.src.slice(n,Math.min(e.posMax,n+Mh+2)),s=/(?<!\\)(?:\\\\)*\\\]/u.exec(r);if(!s||/[\r\n]/u.test(r.slice(0,s.index)))return!1;let i=s.index+s[0].length-2,a=r.slice(0,i);if(!a.trim())return!1;if(!t)e.push("web_display_math","span",0).content=a;return e.pos=n+i+2,!0});Ft.renderer.rules.web_display_math=(e,t,n,r)=>`<span class="markdown-math markdown-math-in-prose">${Lh(e[t].content,!0,r)}</span>`;Ft.renderer.rules.link_open=(e,t,n,r,s)=>{let i=e[t],a=String(i.attrGet("href")??"");if(a.startsWith("#"))i.attrSet("data-markdown-fragment",a.slice(1)),i.attrSet("href","#");else if(El(a)?.protocol!=="mailto:")i.attrSet("target","_blank"),i.attrSet("rel","noopener noreferrer");return s.renderToken(e,t,n)};Ft.renderer.rules.image=(e,t,n,r,s)=>{let i=e[t],a=s.renderInlineAsText(i.children??[],n,r),o=El(String(i.attrGet("src")??""));if(!o||o.protocol==="mailto:")return lr(a);for(let u=t-1;i.level>0&&u>=0;u--){if(e[u].type==="link_open")return lr(a||o.hostname);if(e[u].type==="link_close")break}let l=c(`打开图片:${a||o.hostname}`,`Open image: ${a||o.hostname}`);return`<a class="markdown-image" href="${lr(o.href)}" target="_blank" rel="noopener noreferrer">${lr(l)}</a>`};function Ih(e,t,n){let r=/^[a-z0-9][a-z0-9_+#.-]{0,23}$/i.test(t)?t.toLowerCase():"",s=r&&e.length<=J3&&as.getLanguage(r)&&Dh(n,e.length+64),i=s?as.highlight(e,{language:r,ignoreIllegals:!0}).value:lr(e);return`<div class="markdown-code"><div class="markdown-code-bar"><span>${lr(r||c("代码","Code"))}</span><button type="button" class="button button--quiet markdown-copy">${c("复制代码","Copy code")}</button></div><pre tabindex="0"><code${r?` class="${s?"hljs ":""}language-${lr(r)}"`:""}>${i}</code></pre></div>
|
|
286
|
+
`}var Rh=Ft.renderer.rules.fence;Ft.renderer.rules.fence=(e,t,n,r,s)=>{let i=e[t],a=i.info.trim().split(/\s+/,1)[0]??"";return a==="math"&&Rh?Rh(e,t,n,r,s):Ih(i.content,a,r)};Ft.renderer.rules.code_block=(e,t,n,r)=>Ih(e[t].content,"",r);Ft.renderer.rules.table_open=()=>'<div class="markdown-table" tabindex="0" role="region" aria-label="'+c("表格","Table")+`"><table>
|
|
287
|
+
`;Ft.renderer.rules.table_close=()=>`</table></div>
|
|
288
|
+
`;for(let e of["th","td"])Ft.renderer.rules[`${e}_open`]=(t,n)=>{let r=String(t[n].attrGet("style")??"").match(/^text-align:(left|center|right)$/)?.[1];return r?`<${e} class="markdown-align-${r}">`:`<${e}>`};function X3(e,t){let n=new Map,r=new Map;for(let s of e.querySelectorAll("h1, h2, h3, h4, h5, h6")){let i=Sh(s.textContent);if(!i)continue;let a=i,o=r.get(i)??1;while(n.has(a))a=`${i}-${o++}`;r.set(i,o),s.id=`${t}-${a}`,n.set(a,s.id)}for(let s of e.querySelectorAll("a[data-markdown-fragment]")){let i=s.dataset.markdownFragment??"",a;try{a=decodeURIComponent(i)}catch(l){if(!(l instanceof URIError))throw l;a=i}let o=n.get(Sh(a));if(o)s.setAttribute("href",`#${encodeURIComponent(o)}`);else s.removeAttribute("href");delete s.dataset.markdownFragment}}function Q3(e){e.addEventListener("click",async(t)=>{let n=t.target;if(!(n instanceof HTMLButtonElement)||!n.matches(".markdown-copy"))return;let r=n.closest(".markdown-code")?.querySelector("pre > code");if(!r||n.getAttribute("aria-busy")==="true")return;n.setAttribute("aria-busy","true");try{await navigator.clipboard.writeText(r.textContent),n.textContent=c("已复制","Copied")}catch(s){if(!(s instanceof DOMException||s instanceof TypeError))throw s;n.textContent=c("复制失败","Copy failed")}finally{n.removeAttribute("aria-busy")}})}function e5(e,t,n){let r=e.children[n],s=t.outerHTML;if(r&&Th.get(r)===s)return;if(Th.set(t,s),!r){e.append(t);return}let i=document.activeElement,a=i instanceof HTMLAnchorElement&&r.contains(i)?i.getAttribute("href"):null;if(r.replaceWith(t),a)[...t.querySelectorAll("a[href]")].find((o)=>o.getAttribute("href")===a)?.focus({preventScroll:!0})}function Al(e,t=y("div","prose")){let n=_h.get(t);if(n?.text===e)return t;let r=n?.id??`omo-markdown-${++Y3}`;if(!n)Q3(t);let s=document.createDocumentFragment();if(e.length>xa)s.append(y("p","small muted",c("正文过长,已按纯文本显示。","This long message is displayed as plain text.")),y("div","plain break",e));else{let a=y("template");a.innerHTML=Ft.render(e,{docId:r,remaining:Z3}),X3(a.content,r),s.append(a.content)}let i=[...s.children];for(let[a,o]of i.entries())e5(t,o,a);while(t.childElementCount>i.length)t.lastElementChild?.remove();return _h.set(t,{id:r,text:e}),t}var Nh=/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/u,t5=new Intl.NumberFormat(me,{style:"unit",unit:"byte"}),n5=new Intl.NumberFormat(me,{maximumFractionDigits:1}),r5=["KiB","MiB","GiB","TiB","PiB"];function Bh(e,t){if(!e||!Nh.test(e)||!Array.isArray(t)||t.length!==1)return;let n=j(t[0]),r=C(n.text);if(n.type!=="text"||!r||r.length>2048)return;let s;try{s=j(JSON.parse(r))}catch(g){if(g instanceof SyntaxError)return;throw g}let{omoWebAttachment:i,id:a,name:o,size:l}=s;if(Object.keys(s).length!==4||i!==1||typeof a!=="string"||!Nh.test(a)||typeof o!=="string"||!o||o.length>255||/[\\/\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(o)||typeof l!=="number"||!Number.isSafeInteger(l)||l<0)return;let u=l,d;for(let g of r5){if(u<1024)break;u/=1024,d=g}let f=d?`${n5.format(u)} ${d}`:t5.format(u),p=y("a","tool-attachment");return p.href=`/api/sessions/${e}/attachments/${a}`,p.download=o,p.append(`${c("下载","Download")} `,y("bdi","tool-attachment-name",o),` · ${f}`),p}var s5=new Map([["init",c("初始化","Set up list")],["start",c("请求开始","Request to start")],["done",c("请求完成","Request to complete")],["drop",c("请求放弃","Request to drop")],["rm",c("请求移除","Request to remove")],["append",c("追加","Append")],["view",c("查看","View")]]),Oh=24,Cl=(e,t)=>typeof e==="string"&&e.length<=t&&Boolean(e.trim())&&!/[\p{Cc}\p{Cf}]/u.test(e);function i5(e){if(e.op!=="init"&&e.op!=="append")return;let t=e.list!==void 0;if(t&&(e.op!=="init"||e.items!==void 0))return;let n=t?e.list:[{items:e.items,phase:e.op==="append"?e.phase:void 0}];if(!Array.isArray(n)||n.length>Oh)return;let r=[],s=0;for(let i of n){let{phase:a,items:o}=j(i);if((t||a!==void 0)&&!Cl(a,96))return;if(!Array.isArray(o)||s+o.length>Oh||!o.every((l)=>Cl(l,240)))return;if(s+=o.length,o.length)r.push({phase:C(a)||void 0,items:o})}return r}function zh(e){return e.length<=48&&/^[\p{L}][\p{L}\p{M}\p{N}]*(?: [\p{L}\p{N}][\p{L}\p{M}\p{N}]*)*$/u.test(e)&&(e.includes(" ")||/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(e))&&!/[a-z0-9]{21,}|\d{6,}|\b(?:password|passwd|secret|credential|token|authorization|bearer|api key|private key)\b|凭据|密钥|口令|令牌|密码/iu.test(e)&&!/^(?:bash|sh|zsh|fish|pwsh|powershell|sudo|env|git|cd|ls|cat|printf|echo|rm|cp|mv|mkdir|touch|curl|wget|ssh|scp|chmod|chown|find|grep|rg|node|bun|npm|npx|python3?|pip|uv|docker|kubectl|kubectx|systemctl|make|sed|awk|head|tail|dd|export|set)\b/iu.test(e)}function Fh(e){let t=C(e.op),n=s5.get(t),r=i5(e),s=r?.flatMap((p)=>p.items)??[],i=s.map((p)=>p.trim()).filter(zh),o=(t==="start"||t==="done"||t==="drop"||t==="rm")&&e.phase===void 0&&e.list===void 0&&e.items===void 0&&Cl(e.task,240)?e.task.trim():void 0,l=o&&zh(o)?o:void 0,u=l??i[0],d=s.length.toLocaleString(me),f=(s.length-1).toLocaleString(me);return{operation:n&&r!==void 0?c(`${n} · ${d} 项`,`${n} · ${d} ${s.length===1?"task":"tasks"}`):n,preview:u&&s.length>1?c(`${u} · 另 ${f} 项`,`${u} · ${f} more`):u,batches:r??[],card:l?{heading:c("待办变更","Task changes"),titles:[l],total:1}:i.length?{heading:t==="append"?c("新增待办","Add tasks"):c("提交的待办","Tasks submitted"),titles:i,total:s.length}:void 0}}var Tl={inspect:"M7 3h6l4 4v6l-4 4H7l-4-4V7Zm8 12 6 6",modify:"m3 15 12-12h3l3 3v3L9 21H3Zm10-10 6 6",terminal:"M3 5h14l4 4v10H7l-4-4Zm4 4 3 3-3 3m6 0h4",memory:"M8 5V3m8 2V3M8 21v-2m8 2v-2M5 5h11l3 3v11H8l-3-3Zm4 4h4m-4 5h6",todo:"M6 3h10l3 3v12l-3 3H5V4Zm2 6 2 2 4-4m-6 9h7",execution:"m8 6-6 6 6 6m8-12 6 6-6 6m-3-14-2 16",context:"M8 4H6L3 7v10l3 3h2m8-16h2l3 3v10l-3 3h-2M8 9h8m-8 6h8",agent:"M8 3h4l3 3v4l-3 3H8l-3-3V6ZM2 21v-3l3-3h10l3 3v3m0-18 4 4v5",web:"M8 3h8l5 5v8l-5 5H8l-5-5V8Zm-5 9h18m-9-9-3 5v8l3 5 3-5V8Z",unknown:"M7 3h10l4 4v10l-4 4H7l-4-4V7Zm2 5 2-1h2l2 2v2l-3 2v1m0 3v.1"},a5=new Map([["create",[c("新建","Create"),c("记忆条目","Memory entry")]],["str_replace",[c("替换","Replace"),c("正文","Content")]],["insert",[c("插入","Insert"),c("正文","Content")]],["delete",[c("删除","Delete"),c("记忆条目","Memory entry")]],["rename",[c("重命名","Rename"),c("名称","Name")]],["update_description",[c("更新描述","Update description"),c("描述","Description")]],["apply_patch",[c("应用补丁","Apply patch"),c("记忆补丁","Memory patch")]]]),o5=new Map([["js","JavaScript"],["javascript","JavaScript"],["ts","TypeScript"],["typescript","TypeScript"],["py","Python"],["python","Python"],["shell","Shell"],["bash","Bash"],["powershell","PowerShell"]]);function $h(e,t){if(e==="eval"&&t.action!==void 0&&t.action!=="run")return{};let n=e==="eval"?t.language==="js"?"JavaScript":t.language==="py"?"Python":void 0:o5.get(C(t.language).toLowerCase());return{preview:n,source:C(t.code)||void 0,facts:n?[[c("语言","Language"),n]]:void 0}}var Aa=/^(?:sk-|gh[pousr]_|github_pat_|xox[baprs]-|AKIA[A-Z0-9]{16}$)/iu,_l=(e)=>typeof e==="string"&&/^[a-z][a-z0-9_-]{0,47}$/u.test(e)&&!Aa.test(e);function l5(e){let t=[];for(let[n,r]of[[c("类别","Category"),e.category],[c("角色","Role"),e.subagent_type]])if(_l(r))t.push(`${n} ${r}`);if(typeof e.run_in_background==="boolean")t.push(e.run_in_background?c("后台","Background"):c("前台","Foreground"));return t}var Ph=24,c5=16384,Rr=(e)=>typeof e==="string"&&e.length<=c5&&/\S/u.test(e);function Ea(e,t){if(Array.isArray(e)&&e.length>0&&e.length<=Ph&&e.every(t))return e.length}function Uh(e,t){if(e===void 0&&_l(t))return c(`角色 ${t}`,`Role ${t}`);if(t===void 0&&_l(e))return c(`类别 ${e}`,`Category ${e}`)}function u5(e){if(e.prompt!==void 0||!Array.isArray(e.tasks)||!e.tasks.length||e.tasks.length>Ph)return;let t=[];for(let n of e.tasks){let r=j(n),s=r.category===void 0?e.category:r.category,i=r.subagent_type===void 0?e.subagent_type:r.subagent_type,a=Uh(s,i);if(!a||!Rr(r.prompt))return;t.push({route:a,prompt:r.prompt})}return t}var d5=new Map([["status",c("状态","Status")],["tail",c("最近输出","Recent output")],["full",c("完整输出","Full output")]]);function Mr(e){if(typeof e!=="string"||e.length>65536)return;if(!e.length)return 0;return(e.match(/\r\n|[\n\r]/gu)?.length??0)+(e.endsWith(`
|
|
289
|
+
`)||e.endsWith("\r")?0:1)}function ri(e){let t=e.toLocaleString(me);return c(`${t} 行`,`${t} ${e===1?"line":"lines"}`)}function qh(e,t,n){if(e==="apply_patch"){let a=(C(n)||C(t.patch)||C(t.patchText)).trim();if(a.length>65536||!/^\*\*\* Begin Patch\r?\n/u.test(a)||!/\n\*\*\* End Patch$/u.test(a))return[];let o=[];for(let[l,u]of[["Add",c("提交新增","Add")],["Update",c("提交更新","Update")],["Delete",c("提交删除","Delete")]]){let d=[...a.matchAll(new RegExp(`^\\*\\*\\* ${l} File: [^\\r\\n]+`,"gmu"))].length,f=d.toLocaleString(me);if(d)o.push([u,c(`${f} 个文件`,`${f} ${d===1?"file":"files"}`)])}return o}if(e==="write"||e==="write_file"){let a=Mr(t.content);return a===void 0?[]:[[c("提交文本","Submitted text"),ri(a)]]}let r=Mr(t.oldText??t.old_string),s=Mr(t.newText??t.new_string),i=[];if(r!==void 0)i.push([c("替换前","Before replacement"),ri(r)]);if(s!==void 0)i.push([r===void 0?c("提交文本","Submitted text"):c("替换后","After replacement"),ri(s)]);return i}function Hh(e){let t=C(e),n=/^https?:\/\/([^/?#\\]+)/iu.exec(t)?.[1];if(!n||n.includes("@")||/[\s\\\p{Cc}\p{Cf}]/u.test(t))return;let r=URL.parse(t);if(!r||r.username||r.password)return;let s=r.hostname.replace(/\.$/u,"");if(s.length>253||!/[a-z]/iu.test(s))return;if(!s.split(".").every((i)=>/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/iu.test(i)&&!Aa.test(i)))return;return s}function cr(e){let t=C(e);if(!t||t.length>512||!/^[\p{L}\p{M}\p{N}_.~ /\\-]+$/u.test(t)||t.startsWith("-"))return"";if(t==="."||t===".."||t==="~")return t;let n=t.split(/[/\\]/).filter(Boolean);if(n.some((r)=>Aa.test(r)))return"";if(!/[/\\]/.test(t)&&!/^(?:[\p{L}_][\p{L}\p{M}\p{N}_-]{0,23}|[\p{L}\p{N}_-]*\.[\p{L}\p{N}]{1,10})$/u.test(t))return"";return n.length>3?`…/${n.slice(-3).join("/")}`:`${t.startsWith("/")?"/":""}${n.join("/")}`}function Sl(e,t){let n=j(t),{path:r,file_path:s,filePath:i}=n,a=e.toLowerCase();switch(a){case"read":case"read_file":return{kind:"inspect",label:c("读取文件","Read file"),group:"Read",target:cr(r??s??i)};case"grep":return{kind:"inspect",label:c("搜索内容","Search contents"),group:"Grep",target:cr(r)};case"search":return{kind:"inspect",label:c("搜索内容","Search contents"),target:cr(r)};case"find":return{kind:"inspect",label:c("查找文件","Find files"),group:"Find",target:cr(r)};case"glob":return{kind:"inspect",label:c("查找文件","Find files"),group:"Glob",target:cr(r)};case"ls":case"list":case"list_dir":case"list_directory":case"list_files":return{kind:"inspect",label:c("列出目录","List directory"),group:"List",target:cr(r)};case"tool_search":return{kind:"inspect",label:c("查找工具","Find tools"),group:"Tool Search"};case"edit":case"edit_file":case"multiedit":case"apply_patch":return{kind:"modify",label:c("编辑文件","Edit file"),target:cr(r??s??i),facts:qh(a,n,t)};case"write":case"write_file":return{kind:"modify",label:c("写入文件","Write file"),target:cr(r??s??i),facts:qh(a,n,t)};case"bash":case"shell":case"powershell":return{kind:"terminal",label:a==="powershell"?"PowerShell":a==="shell"?"Shell":"Bash",operation:c("运行命令","Run command"),command:C(n.command)};case"bash_output":return{kind:"terminal",label:"Bash",operation:c("读取输出","Read output")};case"kill_bash":return{kind:"terminal",label:"Bash",operation:c("终止命令","Stop command")};case"memory":{let[o,l]=a5.get(C(n.command))??[];return{kind:"memory",label:"Memory",operation:o,facts:l?[[c("变更对象","Change target"),l]]:void 0}}case"todo":case"todowrite":{let o=Fh(n);return{kind:"todo",label:"Todo",operation:o.operation,preview:o.preview,todo:o}}case"eval":{let o=C(n.action),l=o==="peek"?c("查看执行","View run"):o==="list"?c("列出执行","List runs"):o==="stop"?c("停止执行","Stop run"):o==="run"||n.action===void 0?c("执行脚本","Run script"):void 0;return{kind:"execution",label:"Eval",operation:l,...$h(a,n),group:l&&o!=="stop"&&(n.reset===void 0||n.reset===!1)?"Eval":void 0}}case"ctx_execute":case"ctx_execute_file":return{kind:"context",label:"Ctx Execute",operation:c("执行脚本","Run script"),group:"Ctx Execute",...$h(a,n)};case"ctx_search":{let o=Ea(n.queries,Rr);return{kind:"context",label:"Ctx Search",operation:c("搜索上下文","Search context"),group:"Ctx Search",facts:o===void 0?void 0:[[c("查询","Queries"),c(`${o.toLocaleString(me)} 条`,o.toLocaleString(me))]]}}case"ctx_batch":{let o=Ea(n.commands,Rr),l=Ea(n.queries,Rr),u=o!==void 0&&l!==void 0?{preview:c(`提交 ${o.toLocaleString(me)} 条命令 · ${l.toLocaleString(me)} 条查询`,`Submitted ${o.toLocaleString(me)} ${o===1?"command":"commands"} · ${l.toLocaleString(me)} ${l===1?"query":"queries"}`),facts:[[c("命令","Commands"),c(`${o.toLocaleString(me)} 条`,o.toLocaleString(me))],[c("查询","Queries"),c(`${l.toLocaleString(me)} 条`,l.toLocaleString(me))]]}:void 0;return{kind:"context",label:"Ctx Batch",operation:c("批量查询","Batch search"),group:"Ctx Batch",...u}}case"ctx_index":{let o=[[n.path,c("本机文件","Local file")],[n.content,c("提交文本","Submitted text")],[n.url,c("网页地址","Web address")]].filter(([u])=>Rr(u)),l=o.length===1?C(o[0]?.[1]):"";return{kind:"context",label:"Ctx Index",operation:c("收录上下文","Index context"),facts:l?[[c("来源类型","Source type"),l]]:void 0}}case"ctx_purge":{let o=[n.project===!0&&c("项目","Project"),C(n.session)&&c("指定会话","Selected session"),C(n.source)&&c("指定来源","Selected source")].filter(Boolean),l=o.length===1?C(o[0]):"";return{kind:"context",label:"Ctx Purge",operation:c("清除上下文","Clear context"),facts:l?[[c("清除范围","Scope"),l]]:void 0}}case"task":{let o=u5(n),l=o?.map((p)=>p.route),u=n.tasks===void 0?l5(n):void 0,d=n.tasks===void 0&&Uh(n.category,n.subagent_type)?C(n.prompt):"",f=l?.length.toLocaleString(me);return{kind:"agent",label:"Agent",operation:c("派发任务","Dispatch tasks"),preview:u?.join(" · ")??(l&&c(`提交 ${f} 项任务`,`Submitted ${f} ${l.length===1?"task":"tasks"}`)),dispatchRoutes:l,agentRouting:u,agentPrompts:o?.map((p)=>p.prompt)??(d.trim()?[d]:void 0)}}case"task_output":return{kind:"agent",label:"Agent",operation:c("查看任务","View task"),scope:d5.get(C(n.mode))};case"task_send":return{kind:"agent",label:"Agent",operation:c("发送消息","Send message")};case"web_search":case"mcp_tinyfish_search":return{kind:"web",label:"Web",operation:c("网页搜索","Search the web"),group:"Web Search",facts:Rr(n.query)?[[c("查询","Queries"),c("1 条","1")]]:void 0};case"webfetch":case"mcp_tinyfish_fetch_content":{let o=Hh(n.url),l=Ea(n.urls,Rr),u=l===1&&Array.isArray(n.urls)?Hh(n.urls[0]):void 0,d=o??u;return{kind:"web",label:"Web",operation:c("读取网页","Read webpage"),group:"Web Fetch",preview:d,facts:[...d?[[c("主机","Host"),d]]:[],...l===void 0?[]:[[c("地址","Addresses"),c(`${l.toLocaleString(me)} 个`,l.toLocaleString(me))]]]}}default:return{kind:"unknown",label:/^[\p{L}\p{N}_.:-]{1,80}$/u.test(e)&&/\p{L}/u.test(e)&&!e.split(/[.:]/u).some((l)=>Aa.test(l)||/^(?:token|password|authorization|bearer|api[_-]?key)$/iu.test(l))?e:c("工具调用","Tool call")}}}var h5=4;function Wh(e,t,n=t.length,r){let s=t.slice(0,h5),i=n-s.length,a=i.toLocaleString(me);return{heading:e,rows:s,note:[r,i>0&&c(`其余 ${a} 项见详情`,`${a} more in details`)].filter(Boolean).join(" · ")}}function jh(e,t){if(!t)return[];let n=Mr(t);return[[e,n===void 0?c("已附","Included"):ri(n)]]}function Gh(e){let t=e.toLocaleString(me);return c(`${t} 行文本`,`${t} ${e===1?"line":"lines"} of text`)}function Rl(e){let t=c("可见输出","Visible output"),n=c("已收到文本","Text received");if(typeof e==="string"){let o=Mr(e);return e.length?[[t,o===void 0?n:Gh(o)]]:[]}let r=0,s=0;for(let o of ve(e)){let l=j(o);if(l.type==="text"&&typeof l.text==="string"){let u=Mr(l.text);if(u===void 0)return[[t,n]];r+=u}else if(l.type==="image"||l.type==="image_placeholder"||l.type==="imagePlaceholder")s++}let i=s.toLocaleString(me),a=[r&&Gh(r),s&&c(`${i} 项图片`,`${i} ${s===1?"image":"images"}`)].filter(Boolean).join(" · ");return a?[[t,a]]:[]}function ls(e,t,n){if(t.length)return{heading:e,facts:t,note:n}}function f5(e){let t=e.trim().replace(/\s+/gu," "),n=/^[\s\S]{1,140}/u.exec(t)?.[0]??"";return n.length<t.length?`${n}…`:n}function Kh(e,t){let n=e.facts??[];switch(e.kind){case"todo":{let r=e.todo?.card;if(r)return Wh(r.heading,r.titles,r.total);return}case"agent":{let r=e.dispatchRoutes??e.agentRouting;if(r?.length){let s=e.agentPrompts;return{...Wh(c("派发配置","Dispatch settings"),r),prompts:s&&{previews:s.slice(0,2).map(f5),count:s.length}}}if(e.scope)return ls(c("任务读取","Task lookup"),[[c("范围","Scope"),e.scope]]);return}case"terminal":return ls(c("终端记录","Terminal log"),[...jh(c("命令","Command"),e.command),...Rl(t)]);case"execution":case"context":return ls(e.kind==="execution"?c("脚本记录","Script run"):c("上下文请求","Context request"),[...n,...jh(c("源码","Source code"),e.source),...Rl(t)]);case"modify":return ls(c("提交内容","Submitted changes"),n);case"memory":return ls(c("记忆变更","Memory changes"),n,c("路径与内容按需查看","Open details to inspect paths and content"));case"web":return ls(c("网页请求","Web request"),[...n,...Rl(t)]);case"inspect":case"unknown":return;default:return e.kind}}function Ml(e){let t=y("ul","tool-card-rows");return t.append(...e.map((n)=>y("li","",n))),t}function Dl(e,t){let n=(e+1).toLocaleString(me);return t>1?c(`任务 ${n} · 提示词`,`Task ${n} prompt`):c("提示词","Prompt")}function Vh(e){let t=y("div","tool-card-content");if(t.append(y("p","tool-card-heading",e.heading)),"rows"in e)t.append(Ml(e.rows));else{let n=y("dl","tool-card-facts");for(let[r,s]of e.facts){let i=y("div","tool-card-fact");i.append(y("dt","",r),y("dd","",s)),n.append(i)}t.append(n)}if(e.prompts){let{previews:n,count:r}=e.prompts,s=y("div","tool-card-prompts");if(n.forEach((i,a)=>{let o=y("div");o.append(y("p","tool-card-note",Dl(a,r)),y("p","tool-card-prompt",i)),s.append(o)}),r>n.length){let i=r-n.length,a=i.toLocaleString(me);s.append(y("p","tool-card-note",c(`其余 ${a} 条提示词见详情`,`${a} more ${i===1?"prompt":"prompts"} in details`)))}t.append(s)}if(e.note)t.append(y("p","tool-card-note",e.note));return t}class Ll{node=y("details","tool-group");body=y("ol","tool-group-body");count=y("span","tool-group-count");kinds=y("span","tool-group-kinds");paths=y("span","tool-group-paths");rows=new WeakMap;constructor(){let e=y("summary","tool-group-summary");e.append(this.count," ",this.kinds," ",this.paths),this.node.append(e,this.body)}update(e){let t=new Map,n=new Set,r=!0,s=this.body.firstElementChild;for(let u of e){let d=u.firstElementChild;if(d instanceof HTMLDetailsElement){let p=d.dataset.groupTool;if(p)t.set(p,(t.get(p)??0)+1);r&&=d.dataset.toolKind==="inspect";let g=d.querySelector(":scope > .tool-summary .tool-target:not([hidden])")?.textContent;if(g&&n.size<2)n.add(g)}let f=this.rows.get(u);if(!f)f=y("li","tool-group-row"),this.rows.set(u,f);if(u.parentElement!==f||f.parentElement!==this.body){if(u.contains(document.activeElement)||d instanceof HTMLDetailsElement&&d.open)this.node.open=!0}if(u.parentElement!==f)f.append(u);if(f!==s)this.body.insertBefore(f,s);s=f.nextElementSibling}while(s){let u=s.nextElementSibling;s.remove(),s=u}let i=r?c("探查工具","File and tool lookups"):c("工具调用","Tool calls"),a=e.length.toLocaleString(me),o=c(`${i} · ${a} 项成功`,`${i} · ${a} succeeded`);if(this.count.textContent!==o)this.count.textContent=o;let l=[...t].map(([u,d])=>`${u} ×${d.toLocaleString(me)}`);if(this.kinds.textContent!==l.join(" "))this.kinds.replaceChildren(...l.flatMap((u,d)=>[...d?[" "]:[],y("span","tool-group-kind",u)]));if(this.paths.textContent!==[...n].join(" "))this.paths.replaceChildren(...[...n].flatMap((u,d)=>[...d?[" "]:[],y("code","tool-group-path path",u)]));return this.paths.hidden=!n.size,this.node}}var Il={inspect:c("探查结果","Inspection results"),modify:c("文件变更回执","File change receipt"),terminal:c("终端输出","Terminal output"),todo:c("待办工具回执","Todo receipt"),memory:c("记忆工具回执","Memory receipt"),execution:c("执行结果","Execution results"),context:c("上下文结果","Context results"),agent:c("任务工具输出","Agent tool output"),web:c("网页输出","Web output"),unknown:c("输出","Output")};function m5(e){let t=y("div","tool-scene tool-terminal"),n=Tn(""),r=n.querySelector("code"),s=y("div","tool-terminal-input");return n.classList.add("tool-command-preview"),n.setAttribute("aria-label",c("提交的命令","Submitted command")),s.append(y("span","tool-scene-key",c("命令","Command")),n),t.append(s,e),{node:t,update(i){if(s.hidden=!i.command,r)se(r,i.command)}}}function Zh(e,t){let n=y("details",`tool-receipt tool-${e}-receipt`);return n.append(y("summary","",c("查看原始回执","View raw receipt")),t),n}function p5(e){let t=y("div","tool-scene tool-todo"),n=y("div","tool-todo-list"),r=y("div","tool-todo-board");return n.append(y("p","tool-scene-key",c("提交的待办","Tasks submitted")),r),t.append(n,Zh("todo",e)),{node:t,update(s){let i=s.todo?.batches??[];n.hidden=!i.length;let a=1;r.replaceChildren(...i.map((o)=>{let l=y("div","tool-todo-lane stack stack--tight"),u=y("ol");if(u.start=a,a+=o.items.length,u.append(...o.items.map((d)=>y("li","",d))),o.phase)l.append(y("p","small",o.phase));return l.append(u),l}))}}}function Jh(e,t){let n=y("div",`tool-scene tool-code-desk tool-code-desk--${t?"context":"execution"}`),r=y("details","tool-source"),s=Tn(""),i=s.querySelector("code");return r.append(y("summary","",c("查看原始代码","View source code")),s),n.append(r,e),{node:n,update(a){if(r.hidden=!a.source,i)se(i,a.source)}}}function Yh(e,t){switch(e){case"terminal":return m5(t);case"todo":return p5(t);case"memory":{let n=y("div","tool-scene tool-memory-audit");return n.append(y("p","tool-memory-note small muted",c("记忆路径与内容默认隐藏。","Memory paths and content are hidden by default.")),Zh("memory",t)),{node:n}}case"execution":return Jh(t,!1);case"context":return Jh(t,!0);case"inspect":case"modify":{let n=y("div",`tool-scene tool-file tool-file--${e}`);return n.append(t),{node:n}}case"agent":{let n=y("div","tool-scene tool-agent"),r=y("p","tool-agent-scope small muted"),s=y("div","stack stack--tight"),i=y("div","stack stack--tight"),a=[];return i.hidden=!0,n.append(r,s,i,t),{node:n,update(o){if(se(r,o.scope&&c(`范围:${o.scope}`,`Scope: ${o.scope}`)),s.hidden=!o.dispatchRoutes,o.dispatchRoutes)s.replaceChildren(y("p","tool-scene-key",c("派发配置","Dispatch settings")),Ml(o.dispatchRoutes));let l=o.agentPrompts??[];if(l.length===a.length&&l.every((u,d)=>u===a[d]))return;a=l,i.hidden=!l.length,i.replaceChildren(...l.flatMap((u,d)=>{let f=Dl(d,l.length),p=Tn(u);return p.classList.add("tool-agent-prompt"),p.setAttribute("aria-label",f),[y("p","tool-scene-key",f),p]}))}}}case"web":{let n=y("div","tool-scene tool-web");return n.append(t),{node:n}}case"unknown":return;default:return e}}var Xh={running:{label:c("运行中","Running"),icon:"M12 4a8 8 0 1 0 8 8"},success:{label:c("成功","Succeeded"),icon:"m5 12 4 4L19 6"},error:{label:c("失败","Failed"),icon:"m6 6 12 12M18 6 6 18"},unknown:{label:c("未见结果","No result"),icon:"M6 12h12"},incomplete:{label:c("结果不完整","Incomplete result"),icon:"M12 4v10m0 5v1"}},Qh=c("工具输出","Tool output"),cs=(e)=>e?.truncated===!0||e?.partial===!0,ef=(e)=>typeof e.content==="string"||Array.isArray(e.content);function g5(e,t,n){if(n?.isError===!0||C(n?.errorMessage)||t?.stage==="error")return"error";if(cs(e)||cs(n)||n?.isError===!1&&!ef(n))return"incomplete";if(n?.isError===!1||t?.stage==="done")return"success";return!n&&t?.stage==="running"?"running":"unknown"}function Nl(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.append(e),t}class Bl{renderOutputPart;node=y("article","message message--tool");details=y("details","tool-details");label=y("span","tool-label");target=y("span","tool-target path");operation=y("span","tool-operation small muted");preview=y("span","tool-preview small muted");compactFacts=y("span","tool-card-inline small muted");status=y("span","tool-state-text");icon=document.createElementNS("http://www.w3.org/2000/svg","path");kindIcon=document.createElementNS("http://www.w3.org/2000/svg","path");identity=y("p","tool-name small muted",c("工具名:","Tool name: "));name=y("code");args=Tn("");argsSection=y("div","stack stack--tight");rawArgs=y("details","tool-raw-args");output=y("div","tool-output stack stack--tight");outputLabel=y("p","small muted",Il.unknown);empty=y("p","muted small");outputSection=y("div","tool-result stack stack--tight");body=y("div","fold-body stack stack--tight");card;cardKey;scene;lastName;lastArgs;lastOutput;group;attachment;constructor(e){this.renderOutputPart=e;let t=y("summary","tool-summary"),n=y("span","tool-chevron");n.setAttribute("aria-hidden","true");let r=y("span","tool-subject"),s=Nl(this.kindIcon);s.classList.add("tool-kind-icon"),this.compactFacts.hidden=!0,r.append(s,this.label,this.operation,this.target,this.preview,this.compactFacts);let i=y("span","tool-state");i.append(Nl(this.icon),this.status),t.append(n,r,i),this.identity.append(this.name),this.rawArgs.append(y("summary","",c("原始参数","Raw arguments"))),this.argsSection.append(y("p","small muted",c("调用参数","Call arguments"))),this.output.tabIndex=0,this.output.setAttribute("role","region"),this.output.setAttribute("aria-label",Qh),this.outputSection.append(this.outputLabel,this.output,this.empty),this.body.append(this.identity),this.details.append(t,this.body),this.node.append(this.details)}get open(){return this.details.open}set open(e){this.details.open=e}groupWith(e){return this.group??=new Ll,this.group.update(e)}updateCard(e,t){let n=Kh(e,t),r=Boolean(e.preview&&!e.dispatchRoutes),s=n&&JSON.stringify([e.kind,n,r]);if(this.cardKey===s)return;if(this.cardKey=s,this.card?.remove(),this.card=void 0,se(this.compactFacts,n&&"facts"in n?n.facts.map(([l,u])=>`${l} ${u}`).join(" · "):""),!n)return;let i=y("div","tool-card-preview");if(r)i.dataset.repeatRecap="";let a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",e.kind==="todo"?"m3 12 6 6L21 6":Tl[e.kind]);let o=Nl(a);o.classList.add("tool-card-emblem"),i.append(o,Vh(n)),this.node.append(i),this.card=i}update(e,t,n,r){let s=C(e?.name)||t?.name||C(n?.toolName),i=e?.arguments===void 0?t?.args:e.arguments,a=n?.content??t?.output,o=g5(e,t,n),l=s==="send_file"&&o==="success"&&n?.role==="toolResult"&&n.toolName===s&&n.isError===!1?Bh(r,n.content):void 0;if(l?.href!==this.attachment?.href||l?.textContent!==this.attachment?.textContent){if(this.attachment?.remove(),this.attachment=l,l)this.node.append(l)}let u=o==="unknown"&&n?c("状态未知","Unknown status"):Xh[o].label,d=Sl(s,i),{kind:f,label:p,operation:g,target:b,preview:x,group:k}=d,A=this.details.dataset.toolKind!==f;if(A){this.details.dataset.toolKind=f,this.kindIcon.setAttribute("d",Tl[f]);let D=Il[f];if(this.outputLabel.textContent=D,this.output.setAttribute("aria-label",f==="unknown"?Qh:D),this.scene?.node.remove(),this.outputSection.remove(),this.argsSection.remove(),this.rawArgs.remove(),this.scene=Yh(f,this.outputSection),this.body.classList.toggle("tool-generic",!this.scene),this.scene)this.rawArgs.append(this.args),this.body.append(this.scene.node,this.rawArgs);else this.argsSection.append(this.args),this.body.append(this.argsSection,this.outputSection)}if(this.details.dataset.groupTool!==k)if(k)this.details.dataset.groupTool=k;else delete this.details.dataset.groupTool;let T=this.details.dataset.state;if(T!==o)if(this.details.dataset.state=o,this.icon.setAttribute("d",Xh[o].icon),o==="running"&&this.scene)this.details.dataset.toolMotion="entry";else if(T==="running"&&(o==="success"||o==="error"))this.details.dataset.toolMotion="settlement";else delete this.details.dataset.toolMotion;if(this.status.textContent!==u)this.status.textContent=u;if(this.label.textContent!==p)this.label.textContent=p;se(this.operation,g),se(this.target,b),se(this.preview,x),se(this.name,f==="unknown"||s.toLowerCase()===p.toLowerCase()?"":s),this.identity.hidden=this.name.hidden;let S=A||this.lastArgs!==i||this.lastName!==s;if(S||this.lastOutput!==a)this.updateCard(d,a);if(S){this.scene?.update?.(d),this.argsSection.hidden=this.rawArgs.hidden=i===void 0;let D=this.args.firstElementChild,M=L0(i);if(D&&D.textContent!==M)D.textContent=M;this.lastArgs=i,this.lastName=s}if(this.lastOutput!==a){let D=typeof a==="string"?[{type:"text",text:a}]:ve(a),M=this.output.scrollTop,L=this.output.scrollLeft;this.output.replaceChildren(...D.flatMap((z)=>{let O=this.renderOutputPart(j(z));if(O?.tagName==="PRE")O.removeAttribute("tabindex");return O??[]})),this.output.scrollTop=M,this.output.scrollLeft=L,this.lastOutput=a}this.output.hidden=!this.output.childElementCount,this.outputLabel.hidden=this.output.hidden,this.empty.hidden=!this.output.hidden;let E=o==="running"?c("等待工具输出…","Waiting for tool output…"):o==="unknown"&&!n?c("没有可见的工具结果。","No tool result is available."):c("无可显示的输出。","No output to display.");if(this.empty.textContent!==E)this.empty.textContent=E}}function tf({entries:e,start:t,liveKey:n,tools:r,calls:s,results:i}){let a=new Map,o=!1,l=[],u=()=>{if(l.length>1)for(let d of l)a.set(C(d.id),l);l=[]};for(let d=t;d<e.length;d++){let f=e[d],p=f?.message;if(!f||!p||p.role!=="assistant"||!o||f.key===n||p.streaming===!0||cs(p)||C(p.errorMessage)||p.stopReason!==void 0&&p.stopReason!=="toolUse"&&p.stopReason!=="stop"){if(u(),p?.role==="user")o=!cs(p);continue}let g=ve(p.content).map(j);if(!g.length){u();continue}let b=new Set(g.flatMap((k)=>k.type==="toolCall"?C(k.id)||[]:[])),x=new Map;for(let k=e[d+1]?.message;k?.role==="toolResult";k=e[d+1]?.message){let A=C(k.toolCallId);if(!b.has(A)||x.has(A)||i.get(A)!==d+1)break;x.set(A,k),d++}for(let k of g){let A=C(k.id),T=C(k.name).toLowerCase(),S=x.get(A),E=r.get(A),D=E?.stage,M=k.arguments===void 0?E?.args:k.arguments;if(k.type==="toolCall"&&s.get(A)===1&&Sl(T,M).group&&!cs(k)&&S?.isError===!1&&ef(S)&&!cs(S)&&!C(S.errorMessage)&&(!C(S.toolName)||C(S.toolName).toLowerCase()===T)&&(D===void 0||D==="done"))l.push(k);else u()}}return u(),a}function Ca(e){if(!e)return;return e.closest(".tool-group:not([open])")?.querySelector(":scope > summary")??e}function of(e){return typeof e==="string"?[{type:"text",text:e}]:ve(e)}function lf(e,t,n){if(t==="tool"&&e.type!=="text"&&e.type!=="image"&&e.type!=="image_placeholder"&&e.type!=="imagePlaceholder")return;switch(e.type){case"text":{let r=C(e.text);if(!r)return;return t==="markdown"?Al(r,n):t==="tool"?Tn(r):y("p","plain",r)}case"thinking":{let r=C(e.thinking);if(!r)return;let s=n?.querySelector(".plain");if(n&&s)return s.textContent=r,n;return Yt(c("思考过程","Thinking"),y("p","plain muted",r))}case"image":{let r=C(e.data);if(!Li(e.mimeType)||!/^[A-Za-z0-9+/]+={0,2}$/.test(r))return y("p","small muted",c("图片内容不可用","Image unavailable"));let s=y("img");return s.alt=t==="tool"?c("工具输出图片","Tool output image"):c("消息图片","Image attached to message"),s.loading="lazy",s.src=`data:${e.mimeType};base64,${r}`,s}case"image_placeholder":case"imagePlaceholder":return y("p","small muted",c("此图片未包含在会话快照中","This image is not included in the session snapshot."));default:{let r=C(e.type)||c("未知类型","Unknown type");return Object.keys(e).length?y("p","small muted",c(`未展开的内容 · ${r}`,`Content not displayed · ${r}`)):void 0}}}var Qt=(e)=>C(e.role),Dr=(e)=>{if(Qt(e)==="toolResult"&&C(e.toolCallId))return`result:${C(e.toolCallId)}`;if(C(e.id))return`id:${C(e.id)}`;let t=we(e.timestamp);return t===void 0?"":`${Qt(e)}:${t}`};function b5(e){let t=we(e);if(t===void 0)return;let n=new Date(t);if(!Number.isFinite(n.getTime()))return;let r=y("time","numerical",n.toLocaleTimeString(me,{hour:"2-digit",minute:"2-digit"}));return r.dateTime=n.toISOString(),r.title=n.toLocaleString(me),r}function v5(e,t,n,r){let s=Qt(e),i=r?.role===s?r:void 0,a=s==="user"||s==="assistant",o=i?.node??y("article",a?`message message--${s}`:"message"),l=i?.speaker??y("span","speaker"),u=s==="assistant"?t?c("助手 · 正在生成","Assistant · Writing"):c("助手","Assistant"):s==="user"?c("你","You"):s==="bashExecution"?c("命令输出","Command output"):c("会话记录","Session record");if(l.textContent!==u)l.textContent=u;let d=i?.body??y("div","message-body"),f=i?.timestamp===e.timestamp?i?.time:b5(e.timestamp),p=i?.header??y("header");if(!i){if(a){let z=document.createElementNS("http://www.w3.org/2000/svg","svg"),O=document.createElementNS("http://www.w3.org/2000/svg","path");z.setAttribute("viewBox","0 0 24 24"),z.setAttribute("fill","currentColor"),z.setAttribute("aria-hidden","true"),z.setAttribute("focusable","false"),O.setAttribute("fill-rule","evenodd"),O.setAttribute("d",s==="user"?"M3 6 6 3h15v15l-3 3H3V6Zm9 1-1.4 1.4 2.6 2.6H7v2h6.2l-2.6 2.6L12 17l5-5-5-5Z":"M12 2 22 12 12 22 2 12 12 2Zm0 3-7 7 7 7 7-7-7-7Zm0 4 3 3-3 3-3-3 3-3Z"),z.append(O);let P=y("span","message-identity");l.style.overflowWrap="normal",P.append(z,l),p.append(P)}else p.append(l);o.append(d)}if(i?.time!==f){if(i?.time?.remove(),f)p.append(f)}let g=of(e.content).map((L,z)=>{let O=j(L);if(O.type==="toolCall")return{part:O,node:n(O,z)};let P=i?.parts[z];if(P){let ce=Object.keys(O);if(P.part===O||ce.length===Object.keys(P.part).length&&ce.every((re)=>Object.hasOwn(P.part,re)&&O[re]===P.part[re]))return P}let V=P?.part.type===O.type?P?.node:void 0,G=lf(O,s==="assistant"?"markdown":"plain",V);if(G instanceof HTMLDetailsElement&&V instanceof HTMLDetailsElement)G.open=V.open;return{part:O,node:G}}),b=C(e.errorMessage),x=s==="bashExecution"?C(e.output):"",k=C(e.stopReason),A=JSON.stringify([x,b,k]),T=i?.metadata===A?i.notices:[...x?[Tn(x)]:[],...b||k==="error"?[y("p","notice error small",b||c("生成失败","Could not generate a response."))]:[],...k==="aborted"?[y("p","muted small",c("已停止生成","Response stopped."))]:[],...k==="length"?[y("p","muted small",c("已达到输出长度限制","Response reached the length limit."))]:[]],S=s==="assistant"&&!T.length&&g.some(({part:L})=>L.type==="toolCall")&&g.every(({part:L,node:z})=>L.type==="toolCall"||!z||L.type==="text"&&!C(L.text).trim());if(o.classList.toggle("message--tool-only",S),S)p.remove();else if(p.parentNode!==o)o.prepend(p);let E=(S?g.filter(({part:L})=>L.type==="toolCall"):g).flatMap((L)=>L.node??[]),D=new Set(E);for(let L of i?.parts??[])if(L.node?.parentNode===d&&!D.has(L.node))L.node.remove();if(i&&i.notices!==T)for(let L of i.notices)L.remove();let M=d.firstElementChild;for(let L of[...E,...T]){if(L!==M)d.insertBefore(L,M);M=L.nextElementSibling}return{node:o,body:d,header:p,speaker:l,time:f,timestamp:e.timestamp,role:s,parts:g,notices:T,metadata:A}}var Ol=80,nf=c("加载更早消息","Load older messages"),rf=c("重新加载记录","Reload transcript");function sf(e,t,n){if(e.textContent!==n)e.textContent=n;e.toggleAttribute("data-reload",t?.reload===!0),e.setAttribute("aria-disabled",String(Boolean(t?.busy||t?.disabled))),e.setAttribute("aria-busy",String(t?.busy===!0))}function af(e){if(e&&!e.busy&&!e.disabled)e.activate()}class Fn{root;scroller;empty;cache=new Map;openFolds=new Map;toolViews=new Map;openTools=new Set;results=new Map;contentViews=new WeakMap;older=We(nf,()=>{if(this.start)this.flush(!0);else af(this.latest?.history?.older)},"transcript-load");status=y("span","sr-only");olderError=y("p","notice small");latest;frame;forceBottom=!1;prepended;limit=Ol;start=0;first;displayed;indexed;indexedLength=0;trace;constructor(e,t,n){this.root=e;this.scroller=t;this.empty=n;this.status.setAttribute("role","status"),this.olderError.setAttribute("role","status")}observeTrace(e){this.trace=e}reset(){if(this.frame!==void 0)cancelAnimationFrame(this.frame);this.frame=void 0,this.latest=this.displayed=this.indexed=void 0,this.first=void 0,this.forceBottom=!1,this.prepended=void 0,this.limit=Ol,this.start=this.indexedLength=0,this.cache.clear(),this.openFolds.clear(),this.toolViews.clear(),this.openTools.clear(),this.results.clear(),this.root.replaceChildren(),this.status.textContent="",this.empty.hidden=!1,this.scroller.scrollTop=0,this.trace?.({})}render(e,t,n,r=!1,s,i,a){if(this.latest={entries:e,liveKey:t,tools:n,history:s,sessionId:a},this.forceBottom||=r,i!==void 0)this.prepended=(this.prepended??0)+i;this.frame??=requestAnimationFrame(()=>{this.frame=void 0,this.flush()})}indexResults(e){if(this.indexed!==e||this.indexedLength>e.length)this.indexed=e,this.indexedLength=0,this.results.clear();for(;this.indexedLength<e.length;this.indexedLength++){let t=e[this.indexedLength]?.message,n=C(t?.toolCallId);if(t?.role==="toolResult"&&n)this.results.set(n,this.indexedLength)}}flush(e=!1){if(!this.latest||e&&!this.start)return;if(this.frame!==void 0)cancelAnimationFrame(this.frame);this.frame=void 0;let{entries:t,liveKey:n,tools:r,history:s,sessionId:i}=this.latest,a=this.prepended;this.prepended=void 0;let o=e||a!==void 0,{scrollTop:l,scrollHeight:u,clientHeight:d}=this.scroller,f=document.activeElement,p=f instanceof HTMLElement&&this.root.contains(f)&&(f.closest(".tool-details, .tool-group, .tool-attachment, .transcript-content, .prose")||this.trace&&f.matches(".message[tabindex='-1']"))?f:void 0,g=p?.matches(".tool-group-summary")?p.parentElement?.querySelector(".tool-summary"):p?.querySelector(".tool-summary"),b=u-d-l<72,x=this.forceBottom||b&&!p&&f!==this.older;this.forceBottom=!1;let k=this.olderError.nextElementSibling,A=o&&k instanceof HTMLElement?k:void 0,T=A?.querySelector(".tool-summary")??void 0,S=o&&p?.closest(".tool-details, .tool-group")&&A?.contains(p)?p:A,E=S?.getBoundingClientRect().top,D=o&&document.activeElement===this.older;this.indexResults(t);let M=[];for(let[N,J]of r)if(!this.results.has(N))M.push({key:`result:${N}`,tool:J});let L=t.length+M.length;if(a!==void 0)this.limit+=a;let z=Math.max(0,L-this.limit);if(!this.displayed||x&&!o)this.start=z;else{if(t!==this.displayed&&this.first){let N=t.findIndex((J)=>J.key===this.first);if(N>=0)this.start=N}this.start=Math.min(this.start,z)}let O=a??0;if(e)O=Math.min(this.start,Ol),this.start-=O,this.limit=Math.max(this.limit,L-this.start);else if(a!==void 0)this.start=Math.max(0,this.start-a);this.displayed=t,this.first=t[this.start]?.key;let P=[],V=new Map;for(let N=this.start;N<t.length;N++){let J=t[N];if(!J)continue;let{message:oe}=J;if(oe.role==="toolResult"){let Ce=C(oe.toolCallId);if(!Ce||this.results.get(Ce)===N)P.push({...J,tool:r.get(Ce)})}else{let Ce=!1;if(oe.role==="assistant")for(let ye of of(oe.content)){let Be=j(ye);if(Be.type!=="toolCall")continue;Ce=!0;let Fe=C(Be.id);if(Fe)V.set(Fe,(V.get(Fe)??0)+1)}P.push({...J,live:J.key===n,hasCalls:Ce})}}for(let N=Math.max(0,this.start-t.length);N<M.length;N++)P.push(M[N]);let G=tf({entries:t,start:this.start,liveKey:n,tools:r,calls:V,results:this.results}),ce=new Set(P.filter((N)=>N.message&&N.message.role!=="toolResult").map((N)=>N.key));for(let[N,J]of this.cache)if(!ce.has(N)){let oe=[...J.view.body.querySelectorAll(":scope > details:not(.tool-group)")].flatMap((Ce,ye)=>Ce.open?[ye]:[]);if(oe.length)this.openFolds.set(N,oe);J.view.node.remove(),this.cache.delete(N)}let re=new Set,de,F=(N,J,oe,Ce)=>{if(re.has(N))return;re.add(N);let ye=this.toolViews.get(N);if(!ye)ye=new Bl((Fe)=>lf(Fe,"tool")),ye.open=this.openTools.delete(N),this.toolViews.set(N,ye);ye.update(J,oe,Ce,i);let Be=ye.node.querySelector(":scope > .tool-details > .fold-body");if(Be)this.renderHistoryContent(Be,Ce&&s?.content(Ce));if(this.trace&&(oe?.id||C(J?.id)||C(J?.name)||C(Ce?.toolCallId)||C(Ce?.toolName)))de=ye.node;return ye.node};if(this.older.parentNode!==this.root)this.root.prepend(this.status,this.older,this.olderError);let K=this.start?void 0:s?.older;this.older.hidden=!this.start&&!K;let Y=this.start.toLocaleString(me),ee=this.start?c(`加载更早消息(${Y} 条)`,`Load older messages (${Y})`):K?.reload?rf:K?.busy?c("正在读取…","Loading…"):nf;if(sf(this.older,K,ee),this.olderError.hidden=!K?.error,this.olderError.textContent!==(K?.error??""))this.olderError.textContent=K?.error??"";let ie=(N,J)=>{let oe=C(J.id),Ce=this.results.get(oe);return F(oe?`id:${oe}`:N,J,r.get(oe),Ce===void 0?void 0:t[Ce]?.message)},H=this.olderError,q,W;for(let N of P){let{message:J}=N,oe;if(!J||J.role==="toolResult"){let ye=C(J?.toolCallId)||N.tool?.id;if(ye&&V.has(ye))continue;oe=F(ye?`id:${ye}`:`row:${N.key}`,void 0,N.tool,J)}else{let ye=!1;oe=this.updateMessage(N,J,(Fe,Pe)=>{let Ve=C(Fe.id),mt=G.get(Ve),yt=`part:${N.key}:${Pe}`;if(!mt)return ie(yt,Fe);if(mt[0]!==Fe){ye=!0;return}let Wr=mt.flatMap((Cn)=>ie(yt,Cn)??[]);return this.toolViews.get(`id:${Ve}`)?.groupWith(Wr)});let Be=this.cache.get(N.key)?.view;if(Be){let Fe=s?.content(J),Pe=Be.parts.filter(({part:Ve})=>Ve.type==="text");if(Pe.length===1&&Pe[0]?.node)Pe[0].node.hidden=Boolean(Fe?.chunks.length);this.renderHistoryContent(Be.body,Fe,J.role==="assistant"&&Pe.length===1)}if(ye&&oe.classList.contains("message--tool-only")&&!this.cache.get(N.key)?.view.body.childElementCount){oe.remove();continue}if(this.trace&&(J.role==="user"||J.role==="assistant")){if(this.cache.get(N.key)?.view.parts?.some(({part:Pe,node:Ve})=>Ve&&Pe.type!=="toolCall"&&Pe.type!=="thinking"&&(Pe.type!=="text"||C(Pe.text).trim())))if(J.role==="user")q=oe;else W=oe}}if(!oe)continue;let Ce=H.nextElementSibling;if(oe!==Ce)this.root.insertBefore(oe,Ce);H=oe}for(let[N,J]of this.toolViews)if(!re.has(N)){if(J.open)this.openTools.add(N);J.node.remove(),this.toolViews.delete(N)}if(p&&document.activeElement===document.body){let N=this.root.contains(p)?p:g;if(N&&this.root.contains(N))Ca(N)?.focus({preventScroll:!0})}this.empty.hidden=L>0;let le=de?.closest(".tool-group")??de;if(this.trace?.({user:q,assistant:W,tool:le?.querySelector("summary")??void 0}),o){if(O){let J=O.toLocaleString(me);this.status.textContent=c(`已加载 ${J} 条更早消息。`,`Loaded ${J} older ${O===1?"message":"messages"}.`)}let N=S&&this.root.contains(S)?Ca(S):Ca(T);if(N&&this.root.contains(N)&&E!==void 0){if(D&&(O||this.older.hidden)){if(N.tagName!=="SUMMARY")N.tabIndex=-1;N.focus({preventScroll:!0})}this.scroller.scrollTop+=N.getBoundingClientRect().top-E}else if(D&&this.older.hidden)this.scroller.focus({preventScroll:!0})}else if(x)this.scroller.scrollTop=this.scroller.scrollHeight;if(!o&&f===this.older&&this.older.hidden)this.scroller.focus({preventScroll:!0})}renderHistoryContent(e,t,n=!1){let r=this.contentViews.get(e);if(r&&(!t||r.key!==t.key)){let u=r.node.contains(document.activeElement);if(r.node.remove(),this.contentViews.delete(e),r=void 0,u)this.scroller.focus({preventScroll:!0})}if(!t)return;if(!r){let u=y("div","transcript-content stack stack--tight"),d=y("div",n?"prose":"plain break"),f=y("p","small muted");f.setAttribute("role","status");let p=We("",()=>af(this.contentViews.get(e)?.control),"button--quiet");u.append(d,f,p),e.append(u),r={key:t.key,node:u,output:d,status:f,button:p,count:0,length:0},this.contentViews.set(e,r)}if(r.control=t.control,t.chunks.length<r.count)r.count=r.length=0,r.output.replaceChildren(),r.output.className=n?"prose":"plain break";let s=t.chunks.slice(r.count),i;if(s.length){let u=r.length;if(r.length+=s.reduce((d,f)=>d+f.length,0),n&&r.length<=xa)Al(t.chunks.join(""),r.output),i=r.output;else{let d=n&&u<=xa;if(d)r.output.className="plain break",r.output.replaceChildren(y("p","small muted",c("正文过长,已按纯文本显示。","This long message is displayed as plain text.")));let f=(d?t.chunks:s).map((p)=>y("span","",p));r.output.append(...f),i=f.find((p)=>p.textContent)}}r.count=t.chunks.length,r.output.hidden=!r.count;let a=t.control?.reload?rf:t.control?.busy?c("正在读取…","Loading…"):r.count?c("加载下一段正文","Load next content chunk"):c("加载正文","Load message content");sf(r.button,t.control,a);let o=t.control?.reload?c("记录版本已失效。","This transcript page expired."):t.control?.error??(s.length?c("已加载正文。","Message content loaded."):t.control?.busy||!r.count?"":r.status.textContent);if(r.status.textContent!==o)r.status.textContent=o;if(r.status.hidden=!o,i&&document.activeElement===r.button)i.tabIndex=-1,i.focus({preventScroll:!0});let l=!t.control&&document.activeElement===r.button;if(r.button.hidden=!t.control,l)this.scroller.focus({preventScroll:!0})}updateMessage(e,t,n){let{key:r,hasCalls:s}=e,i=Boolean(e.live),a=this.cache.get(r);if(!s&&a&&a.message===t&&a.live===i)return a.view.node;let o=v5(t,i,n,a?.view);if(a&&o.node!==a.view.node)a.view.node.remove();if(!a){let l=this.openFolds.get(r);if(l){let u=o.body.querySelectorAll(":scope > details:not(.tool-group)");for(let d of l)if(u[d])u[d].open=!0;this.openFolds.delete(r)}}return this.cache.set(r,{message:t,live:i,view:o}),o.node}}function zl(e){let t=j(e),n=C(t.id);if(n)return{id:n,olderCursor:C(t.olderCursor)}}function Fl(e){let t=j(e).status;if(t==="truncated"||t==="unavailable")return t}class $l{api;sessionId;current;enabled;tail;changed;reload;id;entries=[];status;stale=!1;reloading=!1;olderCursor;olderError;requests=new Map;contents=new Map;constructor(e,t,n,r,s,i,a,o){this.api=t;this.sessionId=n;this.current=r;this.enabled=s;this.tail=i;this.changed=a;this.reload=o;this.id=e.id,this.olderCursor=e.olderCursor}invalidate(){for(let e of this.requests.values())e.abort();this.requests.clear()}clearExpansion(){this.invalidate(),this.entries=[],this.status=void 0,this.contents.clear()}render(){let e=(t,n,r)=>({activate:this.stale?this.reload:t,disabled:!this.enabled(),busy:this.reloading||this.requests.has(n),reload:this.stale,error:r});return{older:this.olderCursor||this.stale?e(()=>{this.loadOlder()},this.olderCursor,this.olderError):void 0,content:(t)=>{let n=C(j(t.historyContent).cursor);if(!n)return;let r=this.contents.get(n),s=r?.next??n;return{key:n,chunks:r?.chunks??[],control:s?e(()=>{this.loadContent(n,s)},s,r?.error):void 0}}}}async read(e,t,n,r){if(!e||this.stale||!this.current()||!this.enabled()||this.requests.has(e))return;let s=new AbortController,i=()=>this.current()&&this.requests.get(e)===s&&!s.signal.aborted;this.requests.set(e,s),this.changed();let a;try{let o=`${Xe(this.sessionId)}/transcript${t?"/content":""}`,l=await this.api.request(`${o}?${new URLSearchParams({cursor:e})}`,void 0,AbortSignal.any([s.signal,AbortSignal.timeout(20000)]));if(i())a=n(l)}catch(o){if(!i())return;if(o instanceof De&&(o.code.includes("cursor")||[400,401,403,404,409,410].includes(o.status)))this.expire();else r(c("读取失败,请重试。","Couldn't load this part. Try again."))}finally{if(i())this.requests.delete(e),this.changed(a)}}expire(){this.stale=!0,this.olderError=c("记录版本已失效,请重新加载。","This transcript page expired. Reload the transcript."),this.invalidate(),this.changed()}async loadOlder(){let e=this.olderCursor;await this.read(e,!1,(t)=>{let n=zl(t.page);if(!n||n.id!==this.id||n.olderCursor===e||!Array.isArray(t.messages)){this.expire();return}let r=new Set([...this.entries,...this.tail()].map((i)=>i.key)),s=ve(t.messages).map(j).filter((i)=>Boolean(Qt(i))).flatMap((i,a)=>{let o=Dr(i),l=r.has(o);if(l&&(o.startsWith("id:")||o.startsWith("result:")))return[];let u=o&&!l?o:`older:${this.entries.length}:${a}`;return r.add(u),[{key:u,message:i}]});return this.entries=[...s,...this.entries],this.olderCursor=n.olderCursor,this.olderError=void 0,this.status=Fl(t.transcript)??this.status,s.length},(t)=>{this.olderError=t})}async loadContent(e,t){let n=this.contents.get(e)??{next:e,chunks:[]};if(this.contents.set(e,n),n.next!==t)return;await this.read(t,!0,(r)=>{let s=C(r.nextCursor);if(typeof r.text!=="string"||s===t||s&&s===e){this.expire();return}n.chunks.push(r.text),n.next=s,n.error=void 0;return},(r)=>{n.error=r})}}var cf={pending:c("等待中","Pending"),queued:c("排队中","Queued"),scheduled:c("已调度","Scheduled"),blocked:c("被依赖阻塞","Blocked by dependencies"),paused:c("已暂停","Paused"),running:c("运行中","Running"),completed:c("已完成","Completed"),done:c("已完成","Completed"),success:c("成功","Succeeded"),failed:c("失败","Failed"),error:c("出错","Error"),cancelled:c("已取消","Canceled"),skipped:c("已跳过","Skipped"),interrupted:c("已中断","Interrupted"),lost:c("已失联","Lost contact")},ql=c("未知时间","Unknown time"),Mt=new Intl.NumberFormat(me),Lr=(e)=>Object.hasOwn(cf,e)?cf[e]:void 0,_a=(e)=>Lr(e)??e;function Dt(e){let t=we(e);if(t===void 0)return ql;let n=new Date(t);return Number.isNaN(n.getTime())?ql:n.toLocaleString(me,{hour12:!1})}function y5(e,t){let n=we(e),r=we(t);if(n===void 0||r===void 0||r<n)return"";let s=Math.round((r-n)/1000);if(s<60)return c(`${Mt.format(s)} 秒`,`${Mt.format(s)} sec`);let i=Math.floor(s/60);if(i<60)return c(`${Mt.format(i)} 分钟`,`${Mt.format(i)} min`);let a=Mt.format(Math.floor(i/60)),o=Mt.format(i%60);return c(`${a} 小时 ${o} 分钟`,`${a} hr ${o} min`)}function w5(e){let t=y("dl","details-list small numerical");for(let[n,r]of e)if(r)t.append(y("dt","",n),y("dd","",r));return t.childElementCount?t:y("p","small muted",c("当前没有可用数据。","No data available."))}function k5(e,t){let n=ve(e.nodes).map(j),r=ve(e.edges).map(j),s=(a)=>{if(!a)return"";let o=t.get(a),l=o?C(o.description):"";return l?c(`${l}(${a})`,`${l} (${a})`):c(`子任务 ${a}`,`Subtask ${a}`)},i=[];if(n.length)i.push(w5(n.map((a)=>{let o=C(j(a).taskId),l=ve(j(a).upstream).map(C).filter(Boolean),u=Mt.format(we(j(a).attempt)??0);return[C(j(a).label)||C(j(a).id)||c("节点","Node"),[`${_a(C(j(a).state))}`,c(`尝试 ${u} 次`,`Attempts: ${u}`),o?c(`关联:${s(o)}`,`Task: ${s(o)}`):"",l.length?c(`上游:${l.join("、")}`,`Upstream: ${l.join(", ")}`):""].filter(Boolean).join(" · ")]})));else i.push(y("p","small muted",c("这次运行还没有节点记录。","No nodes were recorded for this run.")));if(r.length){let a=y("ul","inline-list");for(let o of r){let l=C(o.fromLabel)||C(o.from),u=C(o.toLabel)||C(o.to);if(l&&u){let d=y("li","stack stack--tight");d.append(y("p","plain",`${l} → ${u}`)),a.append(d)}}if(a.childElementCount)i.push(Yt(c(`依赖边(${Mt.format(a.childElementCount)})`,`Dependencies (${Mt.format(a.childElementCount)})`),a))}return Yt(`${C(e.name)||c("运行","Run")} · ${_a(C(e.status))}`,...i)}function x5(e){let t=y("ul","inline-list");for(let n of e){let r=j(n),s=[Dt(r.startedAt),r.completedAt===void 0?"":Dt(r.completedAt)].filter((u)=>u&&u!==ql),i=y5(r.startedAt,r.completedAt),a=we(r.turns),o=we(r.toolCalls),l=y("li","stack stack--tight");l.append(y("p","plain",C(r.description)||c("子任务","Subtask"))),l.append(y("p","small muted break",[C(r.id)?c(`任务 ID:${C(r.id)}`,`Task ID: ${C(r.id)}`):"",C(r.parentTaskId)?c(`父任务:${C(r.parentTaskId)}`,`Parent task: ${C(r.parentTaskId)}`):"",C(r.agent)?c(`智能体:${C(r.agent)}`,`Agent: ${C(r.agent)}`):"",C(r.model)?c(`模型:${C(r.model)}`,`Model: ${C(r.model)}`):"",C(r.status)?c(`状态:${_a(C(r.status))}`,`Status: ${_a(C(r.status))}`):"",s.length?c(`时间:${s.join(" → ")}${i?`(耗时 ${i})`:""}`,`Time: ${s.join(" → ")}${i?` (${i} elapsed)`:""}`):"",a!==void 0?c(`轮次:${Mt.format(a)}`,`Turns: ${Mt.format(a)}`):"",o!==void 0?c(`工具调用:${Mt.format(o)}`,`Tool calls: ${Mt.format(o)}`):""].filter(Boolean).join(" · "))),t.append(l)}return Yt(c(`子任务(${Mt.format(t.childElementCount)})`,`Subtasks (${Mt.format(t.childElementCount)})`),t)}var E5={"no-agent-dir":c("原生任务快照不可用:未配置原生配置目录,快照入口已关闭。","Native task snapshots are disabled because no native configuration directory is set."),"invalid-id":c("原生任务快照不可用:会话标识无效,无法定位快照。","Could not locate the native task snapshot: the session ID is invalid."),"session-unavailable":c("原生任务快照不可用:会话尚未接入引擎,请先恢复会话。","Resume the session to connect it to the engine before reading its native task snapshot."),"missing-projection":c("原生任务快照不可用:原生暂无此会话的任务快照,并非读取失败。","The native host has no task snapshot for this session. The read did not fail.")};function uf(e){let t=y("div","stack stack--tight"),n=y("section","subpanel stack stack--tight"),r=y("section","subpanel stack stack--tight");if(n.id="runtime-dag",n.tabIndex=-1,r.id="runtime-subagent",r.tabIndex=-1,n.append(y("h3","",c("DAG 快照","DAG snapshot"))),r.append(y("h3","",c("子代理","Subagents"))),t.append(r,n),C(e.status)!=="ok"){let l=C(e.reason),u=E5[l]??c("原生任务快照不可用。","Native task snapshot unavailable.");return n.append(y("p","small muted",u)),r.append(y("p","small muted",u)),t}let s=[c(`快照时间:${Dt(e.updatedAt)}`,`Snapshot time: ${Dt(e.updatedAt)}`),e.connected===void 0?c("工作区记录,非实时","Workspace record · Not live"):c(`Herdr 快照,记录时${e.connected===!0?"已连接":"未连接"},非实时`,`Herdr snapshot · ${e.connected===!0?"Connected":"Not connected"} at capture · Not live`)].join(" · ");n.append(y("p","small muted",s)),r.append(y("p","small muted",s));let i=ve(e.runs).map(j),a=ve(e.tasks).map(j);if(!i.length)n.append(y("p","small muted",c("快照中没有 DAG 记录。","No DAG runs in this snapshot.")));let o=new Map(a.map((l)=>[C(l.id),l]));for(let l of i)n.append(k5(l,o));if(a.length)r.append(x5(a));else r.append(y("p","small muted",c("快照中没有子代理记录。","No subagents in this snapshot.")));return t}function df(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)?e:{}}function hf(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function us(e){let t=hf(e);return t===void 0||t<0?void 0:t}function ds(e){let t=df(e),n=us(t.tokens),r=us(t.contextWindow??t.window??t.context_window),s=us(t.percent??t.percentUsed??t.usagePercent);if(n===void 0&&r===void 0&&s===void 0)return{status:"unavailable",reason:"no-data"};return{status:"ok",...n===void 0?{}:{tokens:n},...r===void 0?{}:{window:r},...s===void 0?{}:{percent:s}}}function Ta(e){let t=df(e),n=hf(t.latestCacheHitRate),r=us(t.input),s=us(t.cacheRead),i=us(t.cacheWrite);if(!((s??0)>0||(i??0)>0||(n??0)>0))return{status:"unavailable",reason:"no-data"};let o=n===void 0||n<0||n>100?void 0:n/100,l;if(r!==void 0&&s!==void 0&&i!==void 0){let u=r+i+s;if(u>0&&Number.isFinite(u))l=s/u}if(o===void 0&&l===void 0)return{status:"unavailable",reason:"no-data"};return{status:"ok",...o===void 0?{}:{latest:o},...l===void 0?{}:{cumulative:l}}}var si={off:c("关闭","Off"),minimal:c("极低","Minimal"),low:c("低","Low"),medium:c("中","Medium"),high:c("高","High"),xhigh:c("极高","Extra high"),max:c("最高","Maximum")};function ff(e){let t=j(e),n=we(t.tokensPerSecond),r=we(t.measuredAt);return n!==void 0&&n>0&&r!==void 0&&r>=0?{tokensPerSecond:n,measuredAt:r}:void 0}function mf(e,t){let n=ge("runtime-instructions",HTMLDetailsElement),r=ge("runtime-instructions-status",HTMLElement),s=ge("runtime-instructions-text",HTMLPreElement),i=c("当前无法读取 AGENTS.md。关闭后可展开重试。","Could not read AGENTS.md. Close and reopen this section to try again."),a;function o(){a?.abort(),a=void 0,s.hidden=!0,s.textContent="",r.textContent=""}return n.addEventListener("toggle",async()=>{o();let l=t();if(!n.open||!l)return;let u=a=new AbortController,d=()=>a===u&&n.open&&t()===l;r.textContent=c("正在读取工作目录中的 AGENTS.md…","Reading AGENTS.md in the working directory…");try{let f=await e.request(`${Xe(l)}/instructions`,void 0,AbortSignal.any([u.signal,AbortSignal.timeout(18000)]));if(!d())return;switch(f.status){case"ok":if(f.file!=="AGENTS.md"||typeof f.content!=="string"){r.textContent=c("未能验证 AGENTS.md 原文。","Could not verify the contents of AGENTS.md.");break}s.textContent=f.content,s.hidden=!f.content,r.textContent=f.content?c("已读取 AGENTS.md 原文。","Showing AGENTS.md as written."):c("AGENTS.md 是空文件。","AGENTS.md is empty.");break;case"missing":r.textContent=c("当前工作目录没有 AGENTS.md。","There is no AGENTS.md in the working directory.");break;case"unsupported":r.textContent=c("当前宿主或连接方式不支持读取项目规则。","The current host or connection does not support reading project rules.");break;case"refused":r.textContent=c("宿主拒绝读取,或无法确认文件属于当前会话。","The host refused the read or could not verify that the file belongs to this session.");break;case"too_large":r.textContent=c("AGENTS.md 超过读取上限,未显示内容。","AGENTS.md exceeds the read limit. Its contents are not shown.");break;case"unavailable":default:r.textContent=i}}catch(f){if(!d())return;r.textContent=f instanceof De&&[401,403,409].includes(f.status)?c("读取被拒绝,或当前会话连接已变化。","The read was refused or the session connection changed."):f instanceof De&&f.status===404&&f.code==="not_found"?c("当前 Web 服务不支持读取项目规则。","This Web server does not support reading project rules."):i}finally{if(a===u)a=void 0}}),()=>{n.open=!1,o()}}var $t=new Intl.NumberFormat(me,{maximumFractionDigits:2}),A5=new Intl.NumberFormat(me,{style:"currency",currency:"USD",maximumFractionDigits:5}),it=(e)=>{let t=we(e);return t===void 0?"":$t.format(t)},pf=(e)=>typeof e==="boolean"?e?c("开启","On"):c("关闭","Off"):"";function wf(e){let t=y("span","","—");t.setAttribute("aria-hidden","true"),e.append(t,y("span","sr-only",Ct))}function kf(e,t=!1){let n=y("dl","details-list small numerical");for(let[r,s]of e)if(s){let a=y("dd",s===Ct||s===Hl||s===Pl?"metric-unreported":"");if(t&&s===Ct)wf(a);else a.textContent=s;n.append(y("dt","",r),a)}return n.childElementCount?n:y("p","small muted",c("当前没有可用数据。","No data available."))}function xf(e,...t){let n=y("section","subpanel stack stack--tight");return n.append(y("h3","",e),...t),n}function Ul(e,t,...n){let r=Yt(t,...n);return r.dataset.overviewDisclosure=e,r.querySelector("summary")?.setAttribute("data-overview-focus",e),r}function ii(e,t){let n=y("div","metric-group stack");return n.append(y("p","metric-label small",e),kf(t,!0)),n}var Ct=c("尚无数据(原生未报告)","Not reported by the native host"),Hl=c("未报告","Not reported"),Pl=c("已报告,无数值","Reported without a value"),gf=c("— 表示原生未报告","— means the native host did not report a value");function bf(e){let t=we(e);if(t===void 0)return"";if(t>=1048576)return`${$t.format(t/1048576)} MB`;if(t>=1024)return`${$t.format(t/1024)} KB`;return`${$t.format(t)} B`}function vf(e){return e===void 0?"":`${$t.format(e*100)}%`}function Ir(e){let t=we(e);if(t===void 0)return"";let n=new Date(t);return Number.isNaN(n.getTime())?"":n.toLocaleString(me,{hour12:!1})}function C5(e,t,n){let r=ds(e.contextUsage);if(r.status==="ok"&&(r.tokens!==void 0||r.window!==void 0||r.percent===0))return r;if(r.status!=="ok"&&Object.hasOwn(e,"contextUsage"))return r;let s=ds(t.contextUsage);if(s.status==="ok")return s;let i=ds(n.contextUsage);if(i.status==="ok"&&(!Object.hasOwn(e,"contextUsage")||r.status==="ok"&&i.tokens!==void 0&&i.window!==void 0))return i;return r}function Ef(e,t,n){let r=j(e.stats),s=j(e.state),i={...s,...t},a=j(e.sessionMemory),o=j(i.model),l=j(r.tokens??i.usageTotals),u=C5(t,s,r),d=u.status==="ok"?it(u.tokens):"",f=u.status==="ok"?it(u.window):"",p=u.status==="ok"?it(u.percent):"",g=Ta(i.usageTotals),b=g.status==="ok"?g.latest:void 0,x=g.status==="ok"?g.cumulative:void 0,k=we(l.input),A=we(l.cacheRead),T=we(l.cacheWrite),S=(H)=>H!==void 0&&H>=0,E=S(k)&&S(A)&&S(T),D=we(r.cost),M=j(r.failures),L=we(a.mainHeapBytes),z=we(a.kernelHeapBytes),O=we(a.kernelCount),P=L!==void 0||z!==void 0||O!==void 0,V=p?d?`${d} (${p}%)`:`${p}%`:d,G=vf(b),ce=it(r.toolCalls),re=D===void 0?"":A5.format(D),de=y("dl","metric-highlights numerical");for(let[H,q,W]of[["context",c("上下文已用","Context used"),p?`${p}%`:d?c(`${d} token`,`${d} tokens`):""],["cache",c("最新缓存命中率","Latest cache hit rate"),G],["tools",c("工具调用","Tool calls"),ce],["cost",c("估算费用","Estimated cost"),re]]){let le=y("div","metric-tile");le.dataset.tone=H;let N=y("dd",W?"":"metric-unreported",W);if(!W)wf(N);le.append(y("dt","",q),N),de.append(le)}let F=C(i.thinkingLevel),K=y("div","row row--between"),Y=y("button","button button--quiet small",c("规则与记忆","Rules and memory"));Y.type="button",Y.id="runtime-open-resources",Y.dataset.overviewFocus="resources",Y.setAttribute("aria-controls","runtime-resources"),K.append(y("h3","",c("运行状态与用量","Runtime and usage")),Y);let ee=y("section","subpanel stack stack--tight runtime-metrics");ee.append(K,de,ii(c("会话设置","Session settings"),[[c("模型","Model"),[C(o.provider),C(o.name)||C(o.id)].filter(Boolean).join(" · ")||Ct],[c("生效思考档","Active thinking level"),(Object.hasOwn(si,F)?si[F]:F)||Ct],[c("快速模式","Fast mode"),pf(i.fastMode)||Ct],[c("最近流式 · Web 观测","Latest streaming speed (Web)"),n?`${n.tokensPerSecond<0.01?`<${$t.format(0.01)}`:$t.format(n.tokensPerSecond)} token/s`:c("未测得","Not measured")]]));let ie=Ul("metrics",c("完整运行明细","Full runtime details"),ii(c("上下文与缓存","Context and cache"),[[c("上下文已用(原生)","Context used (native)"),V||Ct],[c("上下文窗口","Context window"),f?c(`${f} token`,`${f} tokens`):Ct],[c("缓存命中率(原生最新)","Latest cache hit rate (native)"),G||(g.status==="ok"?Pl:Ct)],[c("缓存累计命中率","Cumulative cache hit rate"),vf(x)||(g.status==="ok"?Pl:Ct)]]),ii(c("其他设置","Other settings"),[[c("权限预设","Permission preset"),C(i.effectivePermissionPreset)||C(i.permissionPreset)||Ct],[c("自动压缩","Auto-compaction"),pf(i.autoCompactionEnabled)||Ct]]),ii(c("流量与费用","Usage and cost"),[[c("用户消息","User messages"),it(r.userMessages)],[c("助手消息","Assistant messages"),it(r.assistantMessages)],[c("工具调用","Tool calls"),ce],[c("输入 token(含缓存)","Input tokens (including cache)"),E?it(k+A+T):Ct],[c("未缓存输入 token","Uncached input tokens"),E?it(k+T):it(k)],[c("输出 token","Output tokens"),it(l.output)],[c("缓存读取 token","Cache read tokens"),it(l.cacheRead)],[c("缓存写入 token","Cache write tokens"),it(l.cacheWrite)],[c("总 token","Total tokens"),it(l.total??l.totalTokens)],[c("估算费用","Estimated cost"),re],[c("失败请求","Failed requests"),it(M.erroredRequests)]]),ii(c("原生内存","Native memory"),[[c("OmO 宿主主堆(引擎共享)","OmO host heap (shared by the engine)"),L!==void 0?bf(L):Ct],[c("本会话内核堆","Session kernel heap"),z!==void 0?bf(z):P?Hl:Ct],[c("本会话内核数","Session kernel count"),O!==void 0?it(O):P?Hl:Ct]]));if(ie.classList.add("metric-breakdown"),ee.append(ie),de.querySelector(".metric-unreported"))de.after(y("p","metric-key small",gf));else if(ie.querySelector(".metric-unreported [aria-hidden='true']"))ie.querySelector(".fold-body")?.append(y("p","metric-key small",gf));return ee}function _5(e){let t=y("ul","inline-list");for(let n of e){let r=j(n),s=C(r.requestedMode),i={queued:c("排队中","Queued"),sending:c("正在发送","Sending"),held:c("等待中","Waiting"),pending:c("等待中","Waiting"),accepted:c("已接收","Accepted")}[C(r.state)]||"",a=[s==="steer"?c("引导","Steer"):s==="followUp"||s==="follow_up"?c("后续","Follow-up"):"",i].filter(Boolean).join(" · "),o=y("li","stack stack--tight");if(a)o.append(y("span","small muted",a));o.append(y("p","plain",C(r.text)||c("(无文本)","(No text)"))),t.append(o)}return t}function Af(e,t,n,r,s){let i=y("p","small muted"),a=y("p","small muted");a.setAttribute("role","status");let o=y("div","stack stack--tight"),l=Ul("queue",c("预览待处理输入","Preview pending inputs"),a,o),u=We(c("清空队列","Clear queue"),s,"button--danger");u.dataset.overviewFocus="queue:clear",u.dataset.write="";let d=y("div","row");d.append(u);let f=xf(c("输入队列","Input queue"),i,d,l),p,g,b=!1,x=!1,k=()=>{let D=!(p!==void 0&&p>0)&&!x;u.toggleAttribute("data-unavailable",D),u.disabled=D||!r()},A=(D="",...M)=>{if(o.contains(document.activeElement))l.querySelector("summary")?.focus({preventScroll:!0});se(a,D),o.replaceChildren(...M)},T=()=>{if(!b)return;g?.abort(),g=void 0,b=x=!1,A(),k()},S=()=>f.isConnected&&l.open&&n(),E=(D=!1)=>{if(!S())return;if(b&&!D)return;g?.abort();let M=g=new AbortController;b=!0,x=!1,k(),A(c("正在读取待处理输入…","Loading pending inputs…"));let L=()=>g===M&&S(),z=(O=!1)=>{A(O?c("队列响应超出读取上限。","The queue response exceeded the read limit."):c("无法读取待处理输入。","Couldn't load pending inputs."),We(c("重试队列预览","Retry queue preview"),()=>E(!0),"button--quiet"))};e.request(`${t}/queue`,void 0,M.signal).then((O)=>{if(!L())return;if(!Array.isArray(O.inputs)){z();return}x=O.inputs.length>0,k(),A(O.truncated===!0?c("预览已截断,仅显示部分队列内容。","Preview truncated. Only part of the queue is shown."):x?"":c("没有可预览的待处理输入。","No pending inputs to preview."),...x?[_5(O.inputs)]:[])},(O)=>{if(L())z(O instanceof De&&O.code==="queue_too_large")}).finally(()=>{if(g===M)g=void 0})};return l.addEventListener("toggle",()=>{if(l.open)E();else T()}),{root:f,activate:E,deactivate:T,update(D){p=D,i.textContent=D===void 0?c("待处理输入数量未知。","Pending input count unknown."):D>0?c(`${$t.format(D)} 条待处理输入`,`${$t.format(D)} pending ${D===1?"input":"inputs"}`):c("没有排队的输入。","No queued inputs."),k()}}}function T5(e,t){let n=ve(e.commands).map(j).filter((i)=>Boolean(C(i.invocation))),r=xf(c("可用命令","Available commands"));if(!n.length)return r.append(y("p","muted small",c("未读取到可用命令。","No commands were returned."))),r;let s=y("ul","command-list");for(let i of n){let a=C(i.invocation),o=We(a,()=>t.insertCommand(a),"button--quiet path");o.title=c("插入输入框,不会立即发送","Insert in the input box without sending"),o.setAttribute("aria-label",c(`插入命令:${a}`,`Insert command: ${a}`)),o.dataset.overviewFocus=`command:${a}`;let l=y("li","stack stack--tight");if(l.append(o),C(i.description))l.append(y("p","small muted break",C(i.description)));s.append(l)}return r.append(Ul("commands",c(`${$t.format(n.length)} 项 · 展开后可插入输入框`,`${$t.format(n.length)} ${n.length===1?"command":"commands"} · Expand to insert`),s)),r}var S5={pending:c("待办","Pending"),in_progress:c("进行中","In progress"),completed:c("已完成","Completed"),abandoned:c("已放弃","Abandoned")},yf={"missing-tree":c("快照缺少会话树","The snapshot has no session tree."),"invalid-leaf":c("活动分支标识无效","The active branch ID is invalid."),"unknown-leaf":c("活动分支不在会话树中","The active branch is not in the session tree."),"duplicate-id":c("会话树有重复标识","The session tree contains duplicate IDs."),"broken-ancestry":c("分支链断裂或指向其他分支","The branch chain is broken or points to another branch."),"tree-budget":c("会话树超出读取上限,可能不完整","The session tree exceeds the read limit and may be incomplete."),incomplete:c("历史超出分支读取上限","The branch history exceeds the read limit."),ownership_changed:c("会话或活动分支已变化","The session or active branch changed."),binding_unverified:c("无法确认会话归属","The session binding could not be verified."),unsupported:c("当前宿主不支持有界分支读取","The current host does not support bounded branch reads."),malformed:c("原生返回的分支数据格式无效","The native host returned invalid branch data.")};function R5(e){let t=y("section","subpanel stack stack--tight");if(t.append(y("h3","",c("待办 · 当前活动分支","Todo · Active branch"))),e.status==="loading"){let s=y("p","small muted",c("正在读取当前分支…","Loading the active branch…"));return s.setAttribute("role","status"),t.append(s),t}if(C(e.status)==="invalid"){let s=yf[C(e.reason)]??c("未知原因","Unknown reason.");return t.append(y("p","small muted",c(`无法确认活动分支(${s}),不显示待办,以免混入其他分支。`,`Could not verify the active branch. ${s} Todo is hidden to avoid showing another branch’s tasks.`))),t}if(C(e.status)!=="ok"){let s=yf[C(e.reason)];return t.append(y("p","small muted",s?c(`分支数据不可用(${s}),待办数量未知。`,`Branch data is unavailable. ${s} The Todo count is unknown.`):c("分支数据不可用,待办数量未知。可刷新重试。","Branch data is unavailable. The Todo count is unknown. Refresh to try again."))),t}let n=C(e.leafId);t.append(y("p","small muted",n?c(`活动分支:${n}`,`Active branch: ${n}`):c("当前没有活动分支。","No branch is active.")));let r=j(e.todo);if(C(r.status)==="ok"){let s=ve(r.phases).map(j),i=e.incomplete===!0;if(!s.length)t.append(y("p","small muted",c("当前活动分支待办为空(原生明确返回空列表)。","The native host returned an empty Todo list for the active branch.")));else{let a=y("ul","inline-list");for(let l of s){let u=y("li","stack stack--tight");u.append(y("p","plain",C(l.name)||c("待办","Todo")));let d=y("ul","inline-list");for(let f of ve(l.tasks).map(j)){let p=y("li");p.append(y("p","small break",`${S5[C(f.status)]??C(f.status)} · ${C(f.content)}`)),d.append(p)}if(d.childElementCount)u.append(d);a.append(u)}let o=a.childElementCount;t.append(Yt(c(`待办(${$t.format(o)} 组)${i?" · 内容已截断":""}`,`Todo (${$t.format(o)} ${o===1?"group":"groups"})${i?" · Truncated":""}`),y("p","small muted",c("只读:来自所选活动分支的最新原生记录;其他分支与原始自定义内容不在此显示。","Read-only. Shows the latest native record for the selected branch. Other branches and raw custom entries are not shown.")),a))}if(i&&s.length)t.append(y("p","small muted",c("待办内容超出显示上限,仅显示前面的记录。","The Todo list exceeds the display limit. Only the first entries are shown.")))}else t.append(y("p","small muted",c("当前分支未报告待办,数量未知。","No Todo record was reported for the active branch. The task count is unknown.")));return t}function M5(e){if(e.status==="loading")return[y("p","small muted",c("正在读取当前分支…","Loading the active branch…"))];if(e.status!=="ok")return[y("p","small muted",c("无法确认当前分支,未显示长期记忆计数。","Could not verify the active branch, so long-term memory counts are hidden."))];let t=j(e.memory);if(C(t.status)!=="ok")return[y("p","small muted",c("当前分支没有召回记录;不代表未启用长期记忆。","No recall record for this branch. Long-term memory may still be enabled."))];let n=we(t.recalledCount),r=Ir(t.recentRecalledAt),s=j(t.gate),i=j(t.unavailable),a=s.status==="failed"||s.status==="skipped"?c(`${s.status==="failed"?"失败":"跳过"} · 连续 ${it(s.consecutiveFailures)} 次 · 候选 ${it(s.candidateCount)}${Ir(s.at)?` · ${Ir(s.at)}`:""}`,`${s.status==="failed"?"Failed":"Skipped"} · Consecutive failures: ${it(s.consecutiveFailures)} · Candidates: ${it(s.candidateCount)}${Ir(s.at)?` · ${Ir(s.at)}`:""}`):"",o=we(i.count),u=[[c("长期记忆召回条目(累计,仅计数)","Long-term memory recalls (total count)"),n!==void 0?it(n):""],[c("最近召回时间","Last recall"),r],[c("召回门控","Recall gate"),a],[c("记忆不可用记录(仅计数)","Memory unavailability records (count only)"),o!==void 0?`${it(o)}${Ir(i.at)?` · ${Ir(i.at)}`:""}`:""]].filter(([,d])=>Boolean(d));return[y("p","small muted",c("仅活动分支的召回计数与状态,不含个人记忆原文、路径、提示词或宿主堆内存。","Recall counts and status for the active branch only. Personal memory text, paths, prompts, and host heap data are not shown.")),u.length?kf(u):y("p","small muted",c("有记忆聚合记录,但暂无可显示的数值。","Memory records exist, but there are no values to show."))]}function Cf(e,t,n){let r=ge("runtime-metrics",HTMLElement).querySelector(".runtime-metrics");if(!r)return;let s=Ef(e,t,n),i=r.querySelector("details"),a=s.querySelector("details"),o=document.activeElement,l=o instanceof HTMLElement&&r.contains(o)?o.dataset.overviewFocus:void 0;if(i&&a)a.open=i.open;if(r.replaceWith(s),l)s.querySelector(`[data-overview-focus="${CSS.escape(l)}"]`)?.focus({preventScroll:!0})}function _f(e,t,n,r,s,i,a){let o=ge("runtime-metrics",HTMLElement),l=document.activeElement,u=l instanceof HTMLElement&&o.contains(l)?l.dataset.overviewFocus:void 0,d=new Set([...o.querySelectorAll("details[open]")].map((f)=>f.dataset.overviewDisclosure));for(let f of[...o.children])if(f!==s&&f!==i)f.remove();if(i.parentElement!==o)o.prepend(i);if(o.prepend(Ef(e,t,a)),i.after(T5(n,r)),o.querySelectorAll("details[data-overview-disclosure]").forEach((f)=>{f.open=d.has(f.dataset.overviewDisclosure)}),u!==void 0&&document.activeElement!==l){let f=o.querySelector(`[data-overview-focus="${CSS.escape(u)}"]:not(:disabled)`);((f?.getClientRects().length)?f:o).focus({preventScroll:!0})}}function Wl(e){let t=ge("runtime-todo",HTMLElement),n=document.activeElement,r=R5(e),s=t.querySelector("[data-runtime-branch]"),i=s?.querySelector("details"),a=r.querySelector("details");if(i&&a)a.open=i.open;let o=i?.querySelector("summary")===n;if(r.dataset.runtimeBranch="",s)s.replaceWith(r);else t.prepend(r);if(ge("runtime-memory-branch-content",HTMLElement).replaceChildren(...M5(e)),o)(a?.querySelector("summary")??t).focus({preventScroll:!0})}function Tf(e,t){let n=new Set([...e.querySelectorAll("details[open]")].map((i)=>i.firstElementChild?.textContent)),r=uf(t);r.querySelectorAll("details").forEach((i)=>{i.open=n.has(i.firstElementChild?.textContent)});let s=e.querySelectorAll('[role="tabpanel"]');if(!s.length){for(let i of r.children)i.removeAttribute("id");e.replaceChildren(r)}for(let i of s){let a=[...r.children].find((o)=>o.id===i.id);if(!a)continue;a.removeAttribute("id"),a.removeAttribute("tabindex"),i.replaceChildren(a)}}function Sf(e,t){let n=ge("branch-dialog",HTMLDialogElement),r=ge("branch-message",HTMLSelectElement),s=(x)=>ge(x,HTMLElement),i=(x)=>ge(x,HTMLButtonElement),a={web:c("来源:Web 会话。新会话和原会话可分别继续。","Source: Web session. You can continue the original and the new session separately."),history:c("来源:CLI 最后保存的上下文,不修改 CLI 记录。","Source: Last saved CLI context. The CLI record will not change."),live:c("来源:CLI 当前上下文。无法校验实时位置时不会改用历史记录。","Source: Current CLI context. If the live position cannot be verified, history will not be used instead.")},o,l,u=!1,d=!1,f=new Map;function p(){let x=u||Boolean(l),k=f.get(r.value);r.disabled=x||!f.size,i("branch-fork").disabled=x||k===void 0,i("branch-clone").disabled=x||!d,i("branch-refresh").disabled=x,i("branch-close").disabled=u,se(s("branch-message-preview"),k)}async function g(x){if(u||l)return;let k=l=new AbortController,A=s("branch-status");se(A,c("正在读取可用分支与复制选项…","Loading branch and clone options…")),se(s("branch-error")),p();try{let T=await e.request(`${to(x)}/branch-options`,void 0,k.signal);if(k.signal.aborted||!n.open||o!==x)return;d=T.canClone===!0,f=new Map(ve(T.forkMessages).map(j).flatMap((E)=>{let D=C(E.entryId);return D&&typeof E.text==="string"?[[D,E.text]]:[]}));let S=r.value;if(r.replaceChildren(pt(c("选择一条用户消息","Choose a user message"),""),...Array.from(f,([E,D],M)=>{let L=D.trim().replace(/\s+/g," ");return pt(`${$t.format(M+1)} · ${L.slice(0,100)}${L.length>100?"…":""}`,E)})),f.has(S))r.value=S;se(A,!d&&!f.size?c("此来源没有可分支或复制的上下文。","This source has no context to branch or clone."):"")}catch(T){if(!k.signal.aborted&&n.open&&o===x)d=!1,f.clear(),r.replaceChildren(pt(c("未读取到选项","No options loaded"),"")),se(A),se(s("branch-error"),c(`无法读取分支选项:${Ee(T)}`,`Could not load branch options: ${Ee(T)}`))}finally{if(l===k)l=void 0;p()}}async function b(x){let k=o;if(!k||u||l)return;u=!0,se(s("branch-error")),se(s("branch-status"),c("正在创建独立的 Web 会话…","Creating a separate Web session…")),p();try{let A=await e.request(`${to(k)}/branches`,x);if(A.cancelled===!0){se(s("branch-status"),c("已取消,原会话没有修改。","Canceled. The original session did not change."));return}let T=ln(A.session);if(!T?.active)throw new De(c("没有收到可继续的 Web 会话。请检查会话列表。","No active Web session was returned. Check the session list."),502,"");n.close(),t(T,C(A.editorText),k)}catch(A){se(s("branch-status")),se(s("branch-error"),c(`无法确认新会话:${Ee(A)}`,`Could not confirm the new session: ${Ee(A)}`))}finally{u=!1,p()}}return r.addEventListener("change",p),ge("branch-form",HTMLFormElement).addEventListener("submit",(x)=>{if(x.preventDefault(),!i("branch-fork").disabled)b({kind:"fork",entryId:r.value})}),i("branch-clone").addEventListener("click",()=>void b({kind:"clone"})),i("branch-close").addEventListener("click",()=>n.close()),i("branch-refresh").addEventListener("click",()=>{if(o)g(o)}),n.addEventListener("cancel",(x)=>{if(u)x.preventDefault()}),n.addEventListener("close",()=>{if(n.open)return;l?.abort(),l=void 0,o=void 0}),(x)=>{if(n.open)return;o=x,d=!1,f.clear(),r.replaceChildren(pt(c("选择一条用户消息","Choose a user message"),"")),s("branch-source").textContent=x.name,s("branch-context").textContent=a[x.kind],n.showModal(),g(x)}}var jl=(e)=>e instanceof De&&e.status===409&&(e.code==="tree_stale"||e.code==="session_changed"||e.code==="stale_leaf");function D5(e){let{leafId:t,nextCursor:n}=e,r=(o)=>typeof o==="string"&&o.length>0,s=(o)=>o===void 0||typeof o==="string";if(!Array.isArray(e.nodes)||e.nodes.length>40||t!==null&&!r(t)||n!==void 0&&(!r(n)||!e.nodes.length))throw Error("Invalid tree page");let i=new Set;return{nodes:e.nodes.map((o)=>{let{id:l,parentId:u,type:d,role:f,label:p,summary:g}=j(o);if(!r(l)||i.has(l)||u!==null&&!r(u)||!r(d)||!s(f)||!s(p)||!s(g))throw Error("Invalid tree node");return i.add(l),{id:l,parentId:u,type:d,role:f,label:p,summary:g}}),leafId:t,nextCursor:n}}var Rf={user:c("你","You"),assistant:c("助手","Assistant"),toolResult:c("工具结果","Tool result"),bashExecution:c("命令输出","Command output"),message:c("消息","Message"),compaction:c("上下文压缩","Context compaction"),branch_summary:c("分支摘要","Branch summary"),model_change:c("模型变更","Model change"),thinking_level_change:c("思考档变更","Thinking level change"),custom:c("会话记录","Session entry"),session_info:c("会话信息","Session info")},Mf=c("会话位置已变化,请重新读取会话树。","The session position changed. Reload the session tree.");function Df(e,t,n,r,s){let i=y("section","subpanel stack stack--tight");i.id="runtime-tree";let a=y("p","small muted");a.setAttribute("role","status");let o=y("p","small muted",c("仅显示已加载的节点(最新记录在前),不代表完整的分支结构。选择历史用户消息可将其载入输入框;不会自动发送。","Shows loaded entries (newest first), not the complete branch structure. Select a past user message to load it into the input box without sending it.")),l=y("ul","tree"),u=y("div","row"),d=We(c("加载更早节点","Load older"),()=>{if(A)ce(A)});d.dataset.treeOlder="";let f=We(c("重新读取会话树","Reload session tree"),()=>{ce()});f.dataset.treeReload="";let p=We(c("切换到空上下文","Switch to an empty context"),()=>O(null));u.append(d,f,p);let g=Yt(c("查看会话节点","View session nodes"),a,o,l,u),b=g.querySelector("summary");i.append(y("h3","",c("会话树","Session tree")),g);let x,k,A,T=[],S=!1,E=!1,D="",M=new Map,L=()=>n()&&g.open;function z(){let F=!r();p.disabled=F;for(let K of M.values())K.disabled=F}function O(F){if(L()&&!S&&k!==void 0&&r())s(F,k)}function P(){let F=document.activeElement;if(a.textContent=D||(k!==void 0&&!M.size?k===null?c("没有可导航的会话节点。","No session nodes to navigate."):c("这一页没有列出活动节点。","This page does not include the active node."):M.size&&k!==null&&k!==void 0&&!M.has(k)?c("活动节点不在已加载的记录中。","The active node is not among the loaded entries."):""),a.classList.toggle("error",S||E),a.hidden=!a.textContent,o.hidden=!M.size,l.hidden=!M.size,d.hidden=S||!A&&F!==d,d.textContent=A?c("加载更早节点","Load older"):c("没有更早的可加载节点","No older entries to load"),f.hidden=!S&&!E&&F!==f,p.hidden=k===void 0||k===null||S,u.hidden=d.hidden&&f.hidden&&p.hidden,d.setAttribute("aria-disabled",String(Boolean(x)||!A)),f.setAttribute("aria-disabled",String(Boolean(x))),z(),L()&&(F===d&&d.hidden||F===p&&p.hidden))(S?f:b).focus({preventScroll:!0})}function V(F,K){let Y=F.nodes.map((H)=>H.id),ee=!K&&k===F.leafId&&Y.length===T.length&&Y.every((H,q)=>H===T[q]);if(!K&&!ee){let H=new Set(Y);for(let[q,W]of M)if(!H.has(q)){if(document.activeElement===W)b.focus({preventScroll:!0});W.parentElement?.remove(),M.delete(q)}}if(k=F.leafId,!ee||M.size===T.length)A=F.nextCursor;if(!K)T=Y;let ie=[];for(let H of[...F.nodes].reverse()){let q=M.get(H.id);if(!q){q=We("",()=>O(H.id),"button--quiet break"),M.set(H.id,q);let N=y("li");N.append(q),l.append(N)}let W=H.role||H.type,le=H.label||(Object.hasOwn(Rf,W)?Rf[W]:W);if(q.textContent=`${le} · ${C(H.summary)||H.id.slice(0,12)}`,H.id===k)q.setAttribute("aria-current","true");else q.removeAttribute("aria-current");ie.push(q.parentElement)}if(!K&&!ee){let H=null;for(let q of ie.reverse()){if(q.nextElementSibling!==H&&!q.contains(document.activeElement))l.insertBefore(q,H);H=q}}}function G(){if(re(),!g.open&&k===void 0)return;if(l.contains(document.activeElement))b.focus({preventScroll:!0});l.replaceChildren(),M.clear(),k=void 0,A=void 0,T=[],S=!0,E=!1,D=Mf,P()}async function ce(F){if(!L()||x||F!==void 0&&S)return;let K=x=new AbortController,Y=()=>x===K&&L(),ee=F===void 0?"":`?${new URLSearchParams({cursor:F})}`;E=!1,D=F===void 0?c("正在读取会话节点…","Loading session entries…"):c("正在读取更早的节点…","Loading older entries…");let ie=!1;P();try{let H=AbortSignal.any([K.signal,AbortSignal.timeout(12000)]),q=await e.request(`${t}/tree${ee}`,void 0,H);if(!Y())return;let W=D5(q);if(F!==void 0&&W.leafId!==k){G();return}if(F!==void 0&&(W.nextCursor===F||W.nodes.some((le)=>M.has(le.id))))throw Error("Overlapping tree page");if(S=!1,D="",V(W,F!==void 0),ie=F!==void 0,document.activeElement===f)b.focus({preventScroll:!0})}catch(H){if(!Y())return;if(jl(H)){G();return}E=!0,D=F===void 0?c("读取会话树失败。请重试。","Could not load the session tree. Try again."):c("读取更早的节点失败。已保留之前的节点。","Could not load older entries. The loaded entries are kept.")}finally{if(x===K){if(x=void 0,L()){if(P(),ie&&document.activeElement===d)d.scrollIntoView({block:"nearest",behavior:"instant"})}}}}function re(){if(!x)return;x.abort(),x=void 0,D=S?Mf:"",P()}let de=()=>{if(k===void 0&&!S&&!E)ce()};return g.addEventListener("toggle",()=>{if(L())de();else re()}),P(),{root:i,activate:de,abort:re,invalidate:G,syncWrites:z,checkLeaf:(F)=>{if(k!==void 0&&k!==F)G()},refresh:()=>{ce()}}}function ai(e){return!(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)}function oi(e,t,n,r){let s=n.length-1;if(s<0)return;switch(e){case"ArrowDown":return t===s?0:t+1;case"ArrowUp":return t<=0?s:t-1;case"PageUp":case"PageDown":{let i=e==="PageUp"?-1:1;if(t<0)return i<0?s:0;let a=i<0?0:s;if(t===a)return t;let o=n[t].getBoundingClientRect().top,l=t+i;while(l!==a&&Math.abs(n[l+i].getBoundingClientRect().top-o)<=r.clientHeight)l+=i;return l}}}function li(e,t){let n=e.getBoundingClientRect().top+e.clientTop,r=n+e.clientHeight,s=t.getBoundingClientRect();if(s.top<n)e.scrollTop-=n-s.top;else if(s.bottom>r)e.scrollTop+=Math.min(s.bottom-r,s.top-n)}function Lf(e,t,n){let r=!1;t.addEventListener("compositionstart",()=>{r=!0}),t.addEventListener("compositionend",()=>{r=!1}),t.addEventListener("blur",()=>{r=!1}),e.addEventListener("keydown",(s)=>{if(!e.open||r||!ai(s)||n.hidden)return;let i=s.target===t;if(!i&&!(s.target instanceof Element&&n.contains(s.target)))return;let a=Array.from(n.querySelectorAll("button[data-invocation]:enabled")),o=a.findIndex((u)=>u===s.target);if(!i&&o<0)return;if(i&&s.key==="Enter"&&a[0]){s.preventDefault(),a[0].click();return}let l=oi(s.key,o,a,e);if(l===void 0)return;s.preventDefault(),a[l].focus({preventScroll:!0}),li(e,a[l])})}var Nf=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,L5=new Map([["extension",c("扩展","Extension")],["prompt",c("提示模板","Prompt template")],["skill",c("技能","Skill")]]),I5=new Map([["enabled",c("已启用","Enabled")],["disabled",c("已停用","Disabled")],["untrusted",c("不受信任","Untrusted")],["idle",c("空闲","Idle")],["connecting",c("连接中","Connecting")],["connected",c("已连接","Connected")],["degraded",c("降级","Degraded")],["suspended",c("已挂起","Suspended")],["needs_auth",c("需要认证","Authentication required")],["needs_client_registration",c("需要注册客户端","Client registration required")]]),If=new Intl.NumberFormat(me);function N5(e){let t=C(e.invocation),n=C(e.source),r=L5.get(n);if(!r)return;if(n==="skill"?/^\$[A-Za-z0-9-]{1,64}$/.test(t):/^\/[A-Za-z0-9_-]{1,64}$/.test(t))return{name:t,detail:r}}function B5({name:e,enabled:t,origin:n}){if(typeof e!=="string"||!Nf.test(e)||typeof t!=="boolean")return;let r=n==="package"?c(" · 包来源"," · From package"):n==="top-level"?c(" · 顶层来源"," · Top-level"):"";return{name:e,detail:(t?c("已启用","Enabled"):c("已停用","Disabled"))+r}}function O5({name:e,status:t,toolCount:n}){let r=I5.get(C(t));if(!r||typeof e!=="string"||!Nf.test(e)||typeof n!=="number"||!Number.isSafeInteger(n)||n<0)return;return{name:e,detail:c(`${r} · ${If.format(n)} 个工具`,`${r} · ${If.format(n)} ${n===1?"tool":"tools"}`)}}function Gl(e,t){let n=j(e);if(n.status!=="ok"||!Array.isArray(n.rows)||typeof n.incomplete!=="boolean")return{status:"unavailable",reason:n.status==="unavailable"&&n.reason==="rpc-failed"?"rpc-failed":"invalid-response"};let r=n.rows.slice(0,128).flatMap((s)=>t(j(s))??[]);return{status:"ok",rows:r,incomplete:n.incomplete||r.length!==n.rows.length}}function Kl(e,t,n){let r=y("section","subpanel stack stack--tight");if(r.append(y("h3","",e)),n.status==="unavailable")return r.append(y("p","small muted",n.reason==="rpc-failed"?c("当前不可用:未能从当前宿主读取。","Unavailable: Could not read from the current host."):c("当前不可用:原生响应格式无效。","Unavailable: The native response was invalid."))),r;if(t)r.append(y("p","small muted",t));if(n.rows.length){let s=y("dl","capability-list small numerical");s.tabIndex=0,s.setAttribute("aria-label",c(`${e} · 只读列表`,`${e} · Read-only list`));for(let i of n.rows){let a=y("div");a.tabIndex=-1;let o=y("dt");o.append(y("code","",i.name)),a.append(o,y("dd","muted",i.detail)),s.append(a)}s.addEventListener("keydown",(i)=>{if(!ai(i))return;let a=s.closest(".details-scroll");if(!a)return;let o=Array.from(s.children),l=o.findIndex((d)=>d===i.target),u=oi(i.key,l,o,a);if(u===void 0)return;i.preventDefault(),o[u].focus({preventScroll:!0}),li(a,o[u])}),r.append(s)}if(n.incomplete)r.append(y("p","small muted",n.rows.length?c("清单不完整,部分项目未显示。","This list is incomplete. Some entries are not shown."):c("清单不完整,没有可显示的项目。","This list is incomplete. No entries can be shown.")));else if(!n.rows.length)r.append(y("p","small muted",c("原生未报告任何条目。","The native host did not report any entries.")));return r}function Bf(e){return[Kl(c("已加载扩展","Loaded extensions"),c("这里只显示当前会话的原生报告,不是安装清单。","Shows only what the native host reports for this session, not everything installed."),Gl(e.extensions,B5)),Kl(c("MCP 服务","MCP servers"),c("状态与工具数由原生报告,不代表工具可立即调用。","The native host reports status and tool counts. Tools may not be ready to use."),Gl(e.mcpServers,O5)),Vl(),Kl(c("注册命令与技能","Registered commands and skills"),c("已注册不代表当前可执行。","Registered commands and skills may not be available to run."),Gl(e.commands,N5))]}function Vl(){let e=y("section","subpanel stack stack--tight");return e.id="runtime-compatibility",e.append(y("h3","",c("浏览器原生兼容未启用","Native terminal features are unavailable in the browser")),y("p","small muted",c("尚未验证浏览器终端能在各模式下可靠隔离私密交互。","The browser terminal has not been verified to keep private interactions isolated in every mode.")),y("p","small muted",c("账户登录、凭据、私密授权(含 MCP)、直接 shell 或外部编辑器,请在本机 OmO 终端完成。","Use the local OmO terminal for sign-in, credentials, private approvals (including MCP), direct shell access, and external editors.")),y("p","small muted",c("请自行打开本机 OmO,选择对应的工作目录和会话,再手动操作。此提示不会启动终端、执行或重放命令,也不会传送私密内容。","Open OmO locally and select the working directory and session. This notice does not launch a terminal, run or replay commands, or transmit private content.")),y("p","small muted",c("如果要继续同一会话,符合条件的空闲会话可用「会话管理 → 转到 CLI」先释放,再按回执在本机继续。","To continue an eligible idle session, release it with “Manage session → Move to CLI”, then follow the instructions to continue locally."))),e}var ui=64,ci="http://www.w3.org/2000/svg",z5=0;function F5(e){if(!Array.isArray(e.nodes)||!e.nodes.length||e.nodes.length>ui||!Array.isArray(e.waves)||!e.waves.length||e.waves.length>e.nodes.length)return;let t=e.nodes.length,n=new Map,r=(a)=>typeof a==="number"&&Number.isInteger(a)&&a>=0&&a<t;for(let a of e.nodes){let{id:o,state:l,upstream:u}=j(a);if(!r(o)||n.has(o)||!Array.isArray(u)||u.length>=t||!u.every(r)||new Set(u).size!==u.length)return;n.set(o,{id:o,state:C(l),upstream:u})}let s=new Map,i=[];for(let[a,o]of e.waves.entries()){let l=j(o);if(l.index!==a||!Array.isArray(l.nodes)||!l.nodes.length||l.nodes.length>n.size)return;let u=[];for(let d of l.nodes){if(!r(d)||s.has(d))return;let f=n.get(d);if(!f)return;s.set(d,a),u.push(f)}i.push(u)}if(s.size!==n.size)return;for(let[a,o]of i.entries())for(let l of o)if(!l.upstream.every((u)=>(s.get(u)??1/0)<a))return;return i}function Of(e){let t=F5(e);if(!t)return;let n=88,r=46,s=16,i=12,a=96,o=21,l=(L)=>L*(n+s)-s,u=l(Math.max(...t.map((L)=>L.length))),d=Math.min(u,l(2)),f=new Map,p=new Map,g=y("div","dag-graph-map");g.tabIndex=0,g.setAttribute("role","region"),g.setAttribute("aria-label",c("有向依赖图;可滚动,完整依赖见下方文字列表","Scrollable directed dependency graph. See the text list below for all dependencies."));let b=y("div","dag-graph-canvas"),x=(L)=>`${L/16}rem`;for(let[L,z]of t.entries()){let O=i+L*a,P=y("div","dag-graph-wave",c(`第 ${L+1} 波`,`Wave ${L+1}`));P.style.top=x(O),b.append(P);for(let[V,G]of z.entries()){let ce=i+Math.max(0,(d-l(z.length))/2)+V*(n+s);f.set(G.id,{x:ce+n/2,y:O+o,wave:L});let re=y("div","dag-graph-node");re.dataset.node=String(G.id);let de=Lr(G.state);if(de)re.dataset.state=G.state;re.style.left=x(ce),re.style.top=x(O+o),re.style.width=x(n),re.style.height=x(r),re.append(y("strong","",c(`节点 ${G.id+1}`,`Node ${G.id+1}`)),y("span","",G.state==="blocked"?c("被依赖阻塞","Blocked"):de??c("状态未知","Unknown"))),b.append(re)}}let k=document.createElementNS(ci,"svg");k.setAttribute("class","dag-graph-edges"),k.setAttribute("aria-hidden","true"),k.setAttribute("focusable","false");let A=document.createElementNS(ci,"defs"),T=document.createElementNS(ci,"marker"),S=`dag-arrow-${++z5}`;T.setAttribute("id",S),T.setAttribute("viewBox","0 0 6 8"),T.setAttribute("markerWidth","6"),T.setAttribute("markerHeight","8"),T.setAttribute("markerUnits","userSpaceOnUse"),T.setAttribute("refX","6"),T.setAttribute("refY","4"),T.setAttribute("orient","auto");let E=document.createElementNS(ci,"path");E.setAttribute("d","M0 0 L6 4 L0 8 Z"),T.append(E),A.append(T),k.append(A);for(let L of t)for(let z of L){let O=f.get(z.id);for(let P of z.upstream){let V=f.get(P),G=V.y+r,ce=O.y-2,re=document.createElementNS(ci,"path");if(re.dataset.from=String(P),re.dataset.to=String(z.id),re.setAttribute("marker-end",`url(#${S})`),O.wave===V.wave+1){let de=(G+ce)/2;re.setAttribute("d",`M${V.x} ${G} C${V.x} ${de} ${O.x} ${de} ${O.x} ${ce}`)}else{let de=p.get(P)??p.size;p.set(P,de);let F=i+u+8+5*de;re.setAttribute("d",`M${V.x} ${G} V${G+6} H${F} V${ce-9} H${O.x} V${ce}`)}k.append(re)}}let D=2*i+u+p.size*5,M=2*i+(t.length-1)*a+o+r;return b.style.width=x(D),b.style.height=x(M),k.setAttribute("viewBox",`0 0 ${D} ${M}`),b.prepend(k),g.append(b),g}var $5=new Map([["inactive",c("会话尚未接入,或正在交接。","The session is not connected or is being handed off.")],["binding_unverified",c("无法验证当前会话的宿主绑定。","Could not verify which host owns the current session.")],["unsupported",c("当前宿主或连接方式不支持此读取。","The current host or connection does not support this read.")],["native_unavailable",c("宿主未能提供摘要。","The host could not provide a summary.")],["engine_unavailable",c("宿主连接忙碌、已断开或读取超时。","The host is busy, disconnected, or did not respond in time.")],["web_unsupported",c("当前 Web 服务没有实时摘要入口。","This Web server does not support live summaries.")],["read_refused",c("Web 服务未允许此读取,请确认当前会话仍可用。","The Web server refused this read. Check that the session is still available.")],["read_failed",c("读取失败或超时,可手动刷新。","The read failed or timed out. Refresh to try again.")]]),xt=new Intl.NumberFormat(me);function en(e){let t=we(e);return t!==void 0&&Number.isSafeInteger(t)&&t>=0?t:void 0}function di(e){switch(e.status){case"unavailable":{let t=$5.get(C(e.reason))??c("没有可用的读取结果。","No results are available.");return c(`不可用:${t}`,`Unavailable: ${t}`)}case"ownership_changed":return c("会话归属已变化,未显示任何宿主数据。","Session ownership changed. No host data is shown.");default:return c("摘要格式无效,未显示宿主数据。","The summary is invalid. No host data is shown.")}}function Sa(e){return e.status==="unavailable"&&e.reason==="unsupported"}var q5=/^[a-f0-9]{64}$/u;function Jl(e,t=!1){let n=y("div","dag-readout stack stack--tight");if(e.status!=="ok")return n.append(y("p","small muted",e.status==="not_found"?c("该运行不在当前列表中,请刷新。","This run is no longer in the list. Refresh to try again."):di(e))),n;let r=new Map(ve(e.nodes).slice(0,ui).map(j).flatMap((s)=>{let i=en(s.id);return i===void 0?[]:[[i,s]]}));for(let s of ve(e.waves).slice(0,ui)){let i=j(s),a=en(i.index);if(a===void 0)continue;let o=y("section","dag-wave stack stack--tight"),l=y("ol","inline-list numerical");for(let u of ve(i.nodes).slice(0,ui)){let d=en(u),f=d===void 0?void 0:r.get(d);if(d===void 0||!f)continue;r.delete(d);let p=t?ve(f.upstream).map(en).filter((A)=>A!==void 0):[],g=t?C(f.agent)||C(f.category):"",b=Lr(C(f.state))??c("状态未知","Unknown status"),x=en(f.attempt),k=y("li","stack stack--tight");if(k.append(y("p","small",[c(`节点 ${xt.format(d+1)}`,`Node ${xt.format(d+1)}`),b,g,x?c(`尝试 ${xt.format(x)} 次`,`Attempts: ${xt.format(x)}`):""].filter(Boolean).join(" · "))),p.length)k.append(y("p","small muted",c(`依赖:${p.map((A)=>`节点 ${xt.format(A+1)}`).join("、")}`,`Depends on: ${p.map((A)=>`Node ${xt.format(A+1)}`).join(", ")}`)));l.append(k)}if(l.childElementCount)o.append(y("h4","",c(`第 ${xt.format(a+1)} 波`,`Wave ${xt.format(a+1)}`)),l),n.append(o)}if(!n.childElementCount)n.append(y("p","small muted",c("运行未提供可显示的波次。","This run did not report any waves to display.")));return n}function H5(e){if(e.status!=="ok")return Jl(e);let t=Of(e),n=y("div","dag-graph-view stack stack--tight");if(t)n.append(t);else n.append(y("p","small muted",c("无法验证完整拓扑;仅显示可识别的节点,不显示依赖连线。","Could not verify the full graph. Only recognized nodes are shown, without dependency lines.")));let r=y("details","dag-graph-text");return r.open=!t,r.append(y("summary","small",c("文字列表 · 波次与依赖","Text list · Waves and dependencies")),Jl(e,!!t)),n.append(r),n}function zf(e,t,n,r){let s=y("ol","inline-list numerical");for(let[i,a]of t.entries()){let o=y("li","stack stack--tight"),l=e==="dag"?n?ve(a.nodes).length:en(a.nodeCount):void 0,u=n&&e==="tasks"?a.startedAt:a.createdAt,d=n&&e==="tasks"?a.completedAt:a.updatedAt,f=Lr(C(a.status))??c("状态未知","Unknown status"),p=`${e==="tasks"?c("任务","Task"):c("运行","Run")} ${xt.format(i+1)} · ${f}`,g=C(a.key),b=j(a.counts),x=[["completed",c("完成","Completed")],["running",c("运行中","Running")],["failed",c("失败","Failed")],["blocked",c("阻塞","Blocked")]].flatMap(([T,S])=>{let E=en(b[T]);return E?[`${S} ${xt.format(E)}`]:[]}),k=l===void 0?"":[c(`${xt.format(l)} 个节点`,`${xt.format(l)} ${l===1?"node":"nodes"}`),...x].join(" · ");if(r&&e==="dag"&&!n&&q5.test(g)){let T=y("details","dag-run");T.dataset.dagKey=g;let S=y("div","dag-content"),E=y("p","small muted",c("正在读取波次与依赖…","Loading waves and dependencies…"));E.setAttribute("role","status"),T.append(y("summary","",[p,k].filter(Boolean).join(" · ")),S);let D=!1,M=!1;T.addEventListener("toggle",()=>{if(!T.open||D||M)return;D=!0,S.replaceChildren(E),r(g).then((L)=>{if(T.isConnected)S.replaceChildren(H5(L));M=L.status==="ok"},(L)=>{if(L instanceof DOMException&&L.name==="AbortError")return;if(T.isConnected)S.replaceChildren(Jl({status:"unavailable",reason:"read_failed"}))}).finally(()=>{D=!1})}),o.append(T)}else if(o.append(y("p","metric-label small",p)),k)o.append(y("p","small muted",k));let A=e==="tasks"&&!n&&[C(a.agent),C(a.category),C(a.executionMode)].filter(Boolean).join(" · ");if(A)o.append(y("p","small muted",A));if(we(u)!==void 0)o.append(y("p","small muted",n&&e==="tasks"?c(`开始:${Dt(u)}`,`Started: ${Dt(u)}`):c(`创建:${Dt(u)}`,`Created: ${Dt(u)}`)));if(we(d)!==void 0&&d!==u)o.append(y("p","small muted",n&&e==="tasks"?c(`结束:${Dt(d)}`,`Ended: ${Dt(d)}`):c(`更新:${Dt(d)}`,`Updated: ${Dt(d)}`)));s.append(o)}return s}function P5(e,t){let n=y("section","subpanel stack stack--tight");if(n.append(y("h4","",c("磁盘快照 · 只读","Saved snapshot · Read-only"))),t==="waiting"){let r=y("p","small muted",c("正在查找已保存的快照…","Looking for a saved snapshot…"));r.setAttribute("role","status"),n.append(r)}else if(t.status==="ok"){let r=ve(e==="tasks"?t.tasks:t.runs).map(j);n.append(y("p","small muted",c(`保存时间:${Dt(t.updatedAt)} · 非实时`,`Saved: ${Dt(t.updatedAt)} · Not live`))),n.append(r.length?zf(e,r,!0):y("p","small muted",c("快照没有此类记录,不代表当前没有。","No matching records in the snapshot. There may still be live activity.")))}else n.append(y("p","small muted",c("没有可读取的快照。","No readable snapshot.")));return n}function Zl(e,t,n,r){let s=y("section","subpanel stack stack--tight");s.append(y("h3","",e==="tasks"?c("子代理任务","Subagent tasks"):c("DAG 运行","DAG runs")),y("p","metric-label small",c("实时宿主 · 只读","Live host · Read-only")));let i=y("p","small muted");if(i.setAttribute("role","status"),s.append(i),!t)i.textContent=c("正在读取宿主摘要…","Loading host summary…");else if(t.status==="empty")i.textContent=e==="tasks"?c("宿主报告当前没有子代理任务。","The host reports no current subagent tasks."):c("宿主报告当前没有 DAG 运行。","The host reports no current DAG runs.");else if(t.status==="ok"){let a=ve(t.rows).map(j),o=en(t.omittedCount);if(a.length&&a.length<=256&&a.every((l)=>Lr(C(l.status))&&we(l.createdAt)!==void 0&&we(l.updatedAt)!==void 0&&(e!=="dag"||en(l.nodeCount)!==void 0))&&(e==="tasks"?o!==void 0:typeof t.limitReached==="boolean")){if(i.textContent=c(`读到 ${xt.format(a.length)} 条摘要。`,`${xt.format(a.length)} ${a.length===1?"summary":"summaries"} loaded.`),s.append(zf(e,a,!1,r)),e==="tasks"&&o)s.append(y("p","small muted",c(`宿主另有 ${xt.format(o)} 条未返回。`,`The host omitted ${xt.format(o)} ${o===1?"additional entry":"additional entries"}.`)));if(e==="dag"&&t.limitReached)s.append(y("p","small muted",c("本次读取已达上限,不代表还有下一页。","The read limit was reached. It is not known whether there are more runs.")))}else i.textContent=di({})}else i.textContent=di(t);return[s,...t&&n&&Sa(t)?[P5(e,n)]:[]]}function Ff(e){let t=y("section","subpanel stack stack--tight");t.id="runtime-journal",t.append(y("h3","",c("本会话记忆计数","Session memory counts")));let n=y("p","small muted");if(n.setAttribute("role","status"),t.append(n),!e)n.textContent=c("正在读取会话记忆…","Loading session memory…");else if(e.status==="ok"){let r=en(e.totalSteps),s=en(e.reflectedSteps);if(r!==void 0&&s!==void 0){n.textContent=c("仅当前会话的原生日志计数,不含共享记忆或原文。","Native journal counts for this session only. Shared memory and original text are not shown.");let i=y("dl","capability-list small numerical");for(let[a,o]of[[c("记录步数","Recorded steps"),r],[c("已反思步数","Reflected steps"),s]]){let l=y("div");l.append(y("dt","",a),y("dd","",xt.format(o))),i.append(l)}t.append(i)}else n.textContent=di({})}else n.textContent=di(e);return t}var ct=(e)=>ge(e,HTMLElement),hi=(e)=>ge(e,HTMLButtonElement),U5=new Intl.DateTimeFormat(me,{dateStyle:"medium",timeStyle:"short"}),$f=(e)=>Number.isFinite(new Date(e).getTime())?U5.format(e):"";function qf(e,t,n,r,s,i){let a=ge("cli-history-dialog",HTMLDialogElement),o=ge("cli-history-search",HTMLInputElement),l=ct("cli-history-list"),u=ct("cli-history-index"),d=ct("cli-history-record"),f=ct("cli-history-record-title"),p=ct("cli-history-activity"),g=hi("cli-history-refresh"),b=hi("cli-history-refresh-activity"),x=hi("cli-history-branch"),k=hi("cli-history-resume"),A=ct("cli-history-resume-status"),T=ct("cli-history-resume-error"),S=new Fn(ct("cli-history-messages"),a,ct("cli-history-empty")),E=[],D,M,L,z,O,P=!1,V=!1,G;function ce(){let q=r();x.disabled=!P||G!==void 0,k.disabled=!P&&!V||G!==void 0||Boolean(q),b.disabled=V||O!==void 0,se(A,G?c("正在尝试打开同一会话…","Opening the same session in Web…"):P||V?q:"")}function re(){let q=o.value.trim().toLocaleLowerCase(),W=E.filter((le)=>i(le.cwd)&&`${le.name} ${le.cwd}`.toLocaleLowerCase().includes(q));l.replaceChildren();for(let le of W){let N=y("li"),J=We("",()=>ie(le),"button--quiet session-link");J.dataset.history=le.id,J.append(y("span","",le.name),y("span","small muted path",le.cwd),y("small","",$f(le.updatedAt)),...le.adopted?[y("small","muted",c("已在 Web 打开","Open in Web"))]:[]),N.append(J),l.append(N)}l.hidden=!W.length,se(ct("cli-history-list-status"),L?c("正在读取 CLI 历史…","Loading CLI history…"):D===!1?c("CLI 历史不可用:未启用或未找到本地历史记录。","CLI history is disabled or no local history records were found."):D&&!W.length?q?c("没有匹配的 CLI 历史。","No matching CLI history."):c("没有可显示的 CLI 历史。","No CLI history to show."):"")}async function de(){L?.abort();let q=L=new AbortController;g.disabled=!0,se(ct("cli-history-list-error")),re();try{let W=await e.request("/api/cli-history",void 0,q.signal);if(q.signal.aborted||!a.open)return;D=W.available===!0,E=ve(W.sessions).map(j).flatMap((le)=>{let N=C(le.id);return N?[{id:N,name:C(le.name)||c("未命名 CLI 会话","Untitled CLI session"),cwd:C(le.cwd),updatedAt:we(le.updatedAt)??0,adopted:le.adopted===!0}]:[]})}catch(W){if(!q.signal.aborted&&a.open)se(ct("cli-history-list-error"),c(`无法读取 CLI 历史:${Ee(W)}`,`Could not load CLI history: ${Ee(W)}`))}finally{if(L===q)L=void 0,g.disabled=!1,re()}}let F=(q)=>Ii(q.id);async function K(q){O?.abort();let W=O=new AbortController;ce(),p.querySelector("[data-activity-status]")?.remove();let N=y("p","small muted",c("正在读取原生快照…","Loading native snapshot…"));N.dataset.activityStatus="",N.setAttribute("role","status"),p.append(N);try{let J=await e.request(`${F(q)}/activity`,void 0,W.signal);if(W.signal.aborted||!a.open||M!==q)return;Tf(p,J)}catch(J){if(!W.signal.aborted&&a.open&&M===q)N.textContent=c(`无法读取原生快照:${Ee(J)}`,`Could not load the native snapshot: ${Ee(J)}`),N.className="notice error small",N.setAttribute("role","alert")}finally{if(O===W)O=void 0,ce()}}async function Y(q){z?.abort();let W=z=new AbortController,le=ct("cli-history-record-status");se(le,c("正在读取对话记录…","Loading conversation…")),se(ct("cli-history-record-error"));try{let N=await e.request(F(q),void 0,W.signal);if(W.signal.aborted||!a.open||M!==q)return;let J=j(N.session);f.textContent=C(J.name)||q.name,V=!1,P=!0,ce();let oe=$f(we(J.updatedAt)??q.updatedAt);ct("cli-history-record-meta").textContent=[q.cwd,oe&&c(`记录更新:${oe}`,`Record updated: ${oe}`)].filter(Boolean).join(" · ");let Ce=ve(N.messages).map(j).map((ye,Be)=>{let Fe=Qt(ye)==="toolResult"&&C(ye.toolCallId);return{key:Fe?`result:${Fe}`:`history-${Be}`,message:ye}});S.render(Ce,"",new Map),requestAnimationFrame(()=>{if(!W.signal.aborted&&a.open&&M===q)a.scrollTop=0})}catch(N){if(W.signal.aborted||!a.open||M!==q)return;if(N instanceof De&&N.code==="history_too_large"){V=!0,ce(),f.textContent=q.name,ct("cli-history-record-meta").textContent=q.cwd,se(ct("cli-history-record-error"),c("这条 CLI 历史记录过大,仅显示基本信息,无法预览完整对话。","This CLI history is too large to preview; only basic info is shown."));return}se(ct("cli-history-record-error"),c(`无法读取这条记录:${Ee(N)}`,`Could not load this record: ${Ee(N)}`))}finally{if(z===W)z=void 0,se(le)}}function ee(){z?.abort(),z=void 0,O?.abort(),O=void 0,M=void 0,P=!1,V=!1,G=void 0,se(T),ce(),S.reset(),p.replaceChildren()}function ie(q){if(!i(q.cwd))return;ee(),M=q,u.hidden=!0,d.hidden=!1,f.textContent=q.name,ct("cli-history-record-meta").textContent=q.cwd,ct("cli-history-empty").hidden=!0,f.focus({preventScroll:!0}),a.scrollTop=0,Y(q).then(()=>{if(M===q&&!V)K(q)})}o.addEventListener("input",re),g.addEventListener("click",()=>void de()),b.addEventListener("click",()=>{if(M&&!V)K(M)}),x.addEventListener("click",()=>{if(M)n({kind:"history",id:M.id,name:M.name})}),k.addEventListener("click",async()=>{let q=M;if(!q||k.disabled)return;let W=G=Symbol(),le=()=>G===W&&a.open&&M===q;se(T),ce(),A.focus();try{let N=await e.resumeHistory(q.id);s(N,le())}catch(N){if(le()){if(se(T,c(`无法在 Web 继续:${Ee(N)}`,`Could not continue in Web: ${Ee(N)}`)),document.activeElement===A)T.focus()}}finally{if(G===W)G=void 0,ce()}}),hi("cli-history-back").addEventListener("click",()=>{let q=M?.id;ee(),d.hidden=!0,u.hidden=!1,([...l.querySelectorAll("button")].find((W)=>W.dataset.history===q)??o).focus()}),a.querySelector("[data-close]")?.addEventListener("click",()=>a.close()),a.addEventListener("close",()=>{if(a.open)return;L?.abort(),L=void 0,ee(),t()});function H(q){if(!a.open)ee(),d.hidden=!0,u.hidden=!1,o.value="",a.showModal();de().then(()=>{if(!a.open||q===void 0)return;let W=E.find((le)=>le.id===q);if(W)ie(W)})}return{open:H,update:ce}}var ht=(e)=>ge(e,HTMLElement),gt=(e)=>ge(e,HTMLButtonElement),Yl=c("仅普通文字。命令、权限审批及私密交互请回到 CLI 处理。","Plain text only. Use the CLI for commands, permission approvals, and private interactions."),Hf=new Set(["terminal_not_attached","terminal_not_found","terminal_offline"]);function Pf(e,t,n,r){let s=ge("cli-live-dialog",HTMLDialogElement),i=ge("cli-live-session",HTMLSelectElement),a=ge("cli-live-input",HTMLTextAreaElement),o=new Fn(ht("cli-live-messages"),ht("cli-live-transcript"),ht("cli-live-empty")),l=new Map,u=new Map,d=new Map,f=[],p=[],g,b="",x="",k,A,T,S,E=!1,D=500,M="waiting",L=!1,z={},O=[],P,V=!0;function G(){let H=p.find((Fe)=>Fe.id===i.value),q=H!==void 0&&b===H.id,W=q&&L&&M==="open"&&!T,le=z.running===!0||z.compacting===!0,N=q||Boolean(H&&x===H.id),J=Boolean(H&&d.get(H.id)===a.value);i.disabled=Boolean(b||T||k||!p.length),gt("cli-live-close").disabled=Boolean(T),gt("cli-live-connect").hidden=q,gt("cli-live-connect").disabled=!H||!g||!e.token||M!=="open"||Boolean(T||k),gt("cli-live-disconnect").hidden=!q,gt("cli-live-disconnect").disabled=Boolean(T),gt("cli-live-refresh").disabled=Boolean(T||k),gt("cli-live-branch").hidden=!q,gt("cli-live-branch").disabled=!W||le,gt("cli-live-send").disabled=!W||le||J||!a.value.trim();let oe=gt("cli-live-stop"),Ce=q&&z.running===!0&&Boolean(C(z.turnId));if(!Ce&&document.activeElement===oe)a.focus({preventScroll:!0});oe.hidden=!Ce,oe.disabled=!W,a.readOnly=T==="input",ht("cli-live-conversation").hidden=!N&&!a.value,se(ht("cli-live-workspace"),H?.cwd);let ye=T==="connect"?c("正在连接 CLI…","Connecting to CLI…"):T==="disconnect"?c("正在释放 Web 连接…","Disconnecting Web…"):M==="lost"?c("实时更新已离线,草稿会保留。连接恢复后只刷新消息,不会重发。","Live updates are offline. Your draft is kept. Reconnecting refreshes messages without resending them."):k?c("正在查找本地 CLI 会话…","Looking for local CLI sessions…"):q?!L?c("正在同步 CLI 对话…","Syncing the CLI conversation…"):z.compacting===!0?c("CLI 正在压缩上下文。","CLI is compacting context."):z.running===!0?c("已连接 · CLI 正在运行","Connected · CLI is running"):c("已连接 · 等待输入","Connected · Waiting for input"):g===!1?c("CLI 实时不可用:未启用或找不到本地终端控制服务。","Live CLI is unavailable. The local terminal service is disabled or could not be found."):!p.length?c("没有发现可连接的 CLI 会话。","No CLI sessions are available to connect."):M==="waiting"?c("正在等待 Web 实时连接…","Waiting for the Web connection…"):x===H?.id?O.length?c("已断开;显示最后一次同步的消息。","Disconnected. Showing the last synced messages."):c("已断开。","Disconnected."):c("选择会话后,点击「连接」读取对话。","Select a session and choose “Connect” to read the conversation."),Be=x===H?.id&&(q?L:!T)?P==="unavailable"?c(" · 对话记录暂不可读"," · Conversation history is unavailable"):P==="truncated"?c(" · 仅显示部分近期消息"," · Showing a limited set of recent messages"):"":"";se(ht("cli-live-status"),ye+Be),ht("cli-live-hint").textContent=J?c(`上一次发送的结果未知,请先核对 CLI,不要重发这条消息。${Yl}`,`Delivery of your last message is unknown. Check the CLI before trying again. Do not resend this message. ${Yl}`):Yl}function ce(){x="",z={},O=[],P=void 0,o.reset(),a.value=u.get(i.value)??"",se(ht("cli-live-error")),se(ht("cli-live-receipt")),G()}function re(){let H=i.value,q=b||(T==="connect"?H:"");if(p=f.filter((W)=>W.id===q||r(W.cwd)),i.replaceChildren(pt(c("选择可用会话","Choose a session"),""),...p.map((W)=>pt(W.name,W.id))),i.value=p.some((W)=>W.id===H)?H:p.length===1?p[0]?.id??"":"",i.value!==H)ce()}async function de(){if(b||k||!s.open)return;let H=k=new AbortController;se(ht("cli-live-error")),G();try{let q=await e.request("/api/cli-live",void 0,H.signal);if(!s.open||H.signal.aborted)return;g=q.available===!0,f=ve(q.sessions).map(j).flatMap((W)=>{let le=C(W.id);return le?[{id:le,name:C(W.name)||c("未命名 CLI 会话","Untitled CLI session"),cwd:C(W.cwd)}]:[]}),re()}catch(q){if(!H.signal.aborted&&s.open)g=!1,se(ht("cli-live-error"),c(`无法发现 CLI 会话:${Ee(q)}`,`Could not find CLI sessions: ${Ee(q)}`))}finally{if(k===H)k=void 0;G()}}function F(H,q){z=j(q.state);let W=j(q.transcript).status;P=W==="truncated"||W==="unavailable"?W:void 0;let le=O;O=ve(q.messages).map(j).map((J,oe)=>({key:`cli-live:${oe}`,message:JSON.stringify(le[oe]?.message)===JSON.stringify(J)?le[oe]?.message??J:J}));let N=O.at(-1);if(!N&&P)o.reset();else o.render(O,N?.message.streaming===!0?N.key:"",l,x!==H);ht("cli-live-empty").hidden=Boolean(P)||O.length>0,x=H,L=!0,D=500}function K(){clearTimeout(S),S=void 0,A?.abort(),A=void 0,E=!1}function Y(H=50){if(!s.open||!b||M!=="open")return;if(A||T){E=!0;return}if(S!==void 0&&H!==0)return;clearTimeout(S),S=window.setTimeout(()=>{S=void 0,ee()},H)}async function ee(){let H=b;if(!H||A||!s.open||M!=="open")return;if(T){E=!0;return}let q=A=new AbortController,W=()=>b===H&&s.open&&!q.signal.aborted,le=0;E=!1;try{let N=await e.request(Ni(H),void 0,AbortSignal.any([q.signal,AbortSignal.timeout(1e4)]));if(W()){if(F(H,N),ht("cli-live-error").dataset.read==="true")se(ht("cli-live-error"))}}catch(N){if(W()){if(L=!1,N instanceof De&&Hf.has(N.code))b="";else le=D,D=Math.min(D*2,5000);let J=ht("cli-live-error");if(J.hidden||J.dataset.read==="true")J.dataset.read="true",se(J,c(`无法同步 CLI 对话:${Ee(N)}`,`Could not sync the CLI conversation: ${Ee(N)}`))}}finally{if(A===q)A=void 0;if(W()&&(le||E))Y(le||50);G()}}async function ie(H,q){if(!H||T)return;T=q.action;let W=ht("cli-live-error");if(delete W.dataset.read,se(W),q.action!=="disconnect")se(ht("cli-live-receipt"));if(q.action==="disconnect")K();G();let le;try{let N=await e.cliLiveAction(H,q);switch(q.action){case"connect":b=H,F(H,N),le=a;break;case"disconnect":b="",L=!1,le=gt("cli-live-connect");break;case"input":u.delete(H),d.delete(H),a.value="",se(ht("cli-live-receipt"),N.disposition==="held"?c("CLI 已暂存消息;请在 CLI 查看,勿重发。","The CLI is holding the message. Check the CLI and do not resend it."):N.disposition==="queued"?c("CLI 已将消息加入队列。","The CLI queued the message."):c("CLI 已接收消息。","The CLI accepted the message."));break;case"stop":se(ht("cli-live-receipt"),c("当前回合已停止。","The current turn stopped.")),le=a;break}}catch(N){if(q.action==="input"&&(!(N instanceof De)||N.status>=500||N.code==="terminal_outcome_unknown"))d.set(H,q.message);if(N instanceof De&&Hf.has(N.code))b="",L=!1;se(W,Ee(N))}finally{if(T=void 0,!b&&(q.action==="disconnect"||q.action==="connect"))re();if(G(),s.open)le?.focus({preventScroll:!0});if(b)Y(0)}}return i.addEventListener("change",ce),a.addEventListener("input",()=>{u.set(i.value,a.value),G()}),gt("cli-live-connect").addEventListener("click",()=>void ie(i.value,{action:"connect"})),gt("cli-live-disconnect").addEventListener("click",()=>void ie(b,{action:"disconnect"})),gt("cli-live-refresh").addEventListener("click",()=>{if(b)Y(0);else de()}),gt("cli-live-stop").addEventListener("click",()=>{let H=C(z.turnId);if(H)ie(b,{action:"stop",expectedTurnId:H})}),gt("cli-live-branch").addEventListener("click",()=>{let H=p.find((q)=>q.id===b);if(H)n({...H,kind:"live"})}),ge("cli-live-form",HTMLFormElement).addEventListener("submit",(H)=>{if(H.preventDefault(),!gt("cli-live-send").disabled)ie(b,{action:"input",mode:"prompt",clientMessageId:crypto.randomUUID(),message:a.value})}),gt("cli-live-close").addEventListener("click",()=>s.close()),s.addEventListener("cancel",(H)=>{if(T)H.preventDefault()}),s.addEventListener("close",()=>{if(s.open)return;if(k?.abort(),k=void 0,K(),b)ie(b,{action:"disconnect"});if(V)t();V=!0}),{open(){if(s.open)return;if(s.showModal(),G(),!b)de()},scopeChanged(){re(),G()},closeAfterBranch(){V=!1,s.close()},invalidate(H){if(b&&b===H)Y()},setTransport(H){if(H===M)return;if(M=H,H!=="open")L=!1,K();else if(b)Y(0);else if(!g)de();G()}}}var W5=2000,Uf=8000,j5={pending:c("正在查找 CLI 会话…","Looking for a CLI session…"),none:c("未发现可跟随的 CLI 会话。","No CLI session to follow."),ambiguous:c("有多个 CLI 会话,无法确认跟随哪一个。","Multiple CLI sessions were found. Could not determine which one to follow."),unavailable:c("无法核验 CLI 会话,暂不显示对话。","Could not verify the CLI session. The conversation is hidden.")};function G5(e,t){switch(e.status){case"none":return{status:"none"};case"ambiguous":return{status:"ambiguous"};case"ok":{let n=j(e.session),r=C(n.id),s=C(n.cwd),i=C(n.name);if(!r||!s||!t(s)||typeof n.name!=="string"||typeof n.running!=="boolean"||!Array.isArray(e.messages))return{status:"unavailable"};let a=j(e.transcript).status,o=[];for(let l of a==="unavailable"?[]:e.messages){let{role:u,content:d,timestamp:f,streaming:p}=j(l);if(u!=="user"&&u!=="assistant"&&u!=="custom"||typeof d!=="string")return{status:"unavailable"};o.push({role:u,content:d,timestamp:we(f),streaming:u==="assistant"&&p===!0})}return{status:"ok",target:{id:r,name:i||c("未命名 CLI 会话","Untitled CLI session"),cwd:s,running:n.running},messages:o,...a==="truncated"||a==="unavailable"?{history:a}:{}}}default:return{status:"unavailable"}}}function Wf(e,t,n){let r=ge("cli-follow-view",HTMLElement),s=ge("cli-follow-status",HTMLElement),i=ge("cli-follow-empty",HTMLElement),a=new Fn(ge("cli-follow-messages",HTMLElement),r,i),o=new Map,l=!1,u,d="",f,p,g=[];function b(){g=[],a.reset(),i.hidden=!0}function x(E,D=!1,M){let L=E==="ok"?c(`只读跟随 · ${D?"CLI 正在运行":"CLI 未在运行"}`,`Following · Read-only · ${D?"CLI is running":"CLI is idle"}`):j5[E],z=M==="unavailable"?c(" · 对话记录暂不可读"," · Conversation history is unavailable"):M==="truncated"?c(" · 仅显示部分近期消息"," · Showing a limited set of recent messages"):"";if(s.dataset.state!==E)s.dataset.state=E;if(s.textContent!==L+z)s.textContent=L+z}function k(E){let D=u;if(E.status!=="ok"){if(u)b();if(u=void 0,x(E.status),D)n();return}u=E.target,d=u.cwd;let M=!D||D.id!==u.id||D.cwd!==u.cwd;if(M)b();x("ok",u.running,E.history);let L=new Map(g.map((P)=>[P.key,P])),z=new Set,O=E.messages.map((P,V)=>{let G=Dr(P)||`follow:${V}`,ce=z.has(G)?`${G}:${V}`:G;z.add(ce);let re=L.get(ce);return re&&JSON.stringify(re.message)===JSON.stringify(P)?re:{key:ce,message:P}});if(E.history&&O.length===0)b();else if(M||g.length!==O.length||O.some((P,V)=>P!==g[V])){g=O;let P=g.at(-1);a.render(g,P?.message.streaming===!0?P.key:"",o,M)}if(i.hidden=Boolean(E.history)||g.length>0,M||D?.name!==u.name)n()}function A(){clearTimeout(p),p=void 0,f?.abort(),f=void 0}async function T(){if(!l||document.hidden||f)return;let E=f=new AbortController,D=AbortSignal.any([E.signal,AbortSignal.timeout(Uf)]),M=performance.now()+Uf,L=()=>l&&!document.hidden&&f===E;try{let z=await e.request("/api/cli-follow",void 0,D).catch(()=>{return});if(L())k(!z||D.aborted||performance.now()>=M?{status:"unavailable"}:G5(z,t))}finally{if(f===E){if(f=void 0,l&&!document.hidden)p=window.setTimeout(()=>{p=void 0,T()},W5)}}}function S(){if(!l)return;l=!1,A(),u=void 0,d="",b(),n()}return document.addEventListener("visibilitychange",()=>{if(!l)return;if(document.hidden){if(A(),u)b(),u=void 0,n();x("pending")}else T()}),window.addEventListener("pagehide",S),{get active(){return l},get target(){return u},get workspace(){return d},start(){if(l)return;l=!0,x("pending"),n(),T()},stop:S,recheckWorkspace(){if(!d||t(d))return;d="",k({status:"unavailable"})}}}var jf=1e4,Gf=(e)=>e instanceof DOMException&&e.name==="TimeoutError";function Xl(e){return Array.isArray(e)?[...new Set(e.filter((t)=>typeof t==="string"&&Boolean(t)))]:[]}function Kf(e,t,n,r){let s=ge("workspace-browser-button",HTMLButtonElement),i=ge("workspace-browser-dialog",HTMLDialogElement),a=ge("workspace-browser-close",HTMLButtonElement),o=ge("workspace-browser-form",HTMLFormElement),l=ge("workspace-browser-path",HTMLInputElement),u=ge("workspace-browser-use",HTMLButtonElement),d=ge("workspace-browser-navigation",HTMLElement),f=ge("workspace-browser-root-field",HTMLElement),p=ge("workspace-browser-root",HTMLSelectElement),g=ge("workspace-browser-up",HTMLButtonElement),b=ge("workspace-browser-current",HTMLElement),x=ge("workspace-browser-status",HTMLElement),k=ge("workspace-browser-entries",HTMLUListElement),A=ge("workspace-browser-feedback",HTMLElement),T=ge("workspace-browser-approval",HTMLElement),S=ge("workspace-browser-approval-title",HTMLElement),E=ge("workspace-browser-approval-path",HTMLElement),D=ge("workspace-browser-confirm",HTMLButtonElement),M=ge("workspace-browser-deny",HTMLButtonElement),L,z,O,P=0,V="";function G(N="",J=!1){A.classList.toggle("error",J),se(A,N)}function ce(){let N=z?.kind==="decision",J=z?.kind==="prepare";d.hidden=Boolean(O),T.hidden=!O,E.textContent=O?.path??"",u.disabled=!l.value||J||N,p.disabled=J,g.disabled=!V||J,a.setAttribute("aria-disabled",String(N)),D.setAttribute("aria-disabled",String(N)),M.setAttribute("aria-disabled",String(N))}function re(N){if(clearTimeout(P),O=N,N)P=window.setTimeout(()=>{if(O===N&&z?.kind!=="decision")de()},N.expiresAt-Date.now());ce()}function de(){re(),G(c("审批已过期。请重新选择「使用此目录」,发起新的审批。","Approval expired. Choose “Use this directory” to request approval again."),!0),u.focus()}function F(){let N=z;z=void 0,N?.controller.abort()}async function K(N,J,oe,Ce,ye){if(!i.open||z?.kind==="decision"||!L)return;F();let Be={kind:N,controller:new AbortController};z=Be,ce();let Fe=performance.now()+jf,Pe=AbortSignal.any([Be.controller.signal,AbortSignal.timeout(jf)]),Ve;try{let mt=new Promise((Wr,Cn)=>{Ve=()=>Cn(Pe.reason),Pe.addEventListener("abort",Ve,{once:!0})}),yt=await Promise.race([e.request(`/api/workspaces/${J}`,oe,Pe),mt]);if(z!==Be||!i.open||Be.controller.signal.aborted)return;if(Pe.throwIfAborted(),performance.now()>=Fe)throw new DOMException("Workspace request timed out","TimeoutError");z=void 0,ce(),Ce(yt)}catch(mt){if(z!==Be&&z!==void 0||!i.open||Be.controller.signal.aborted)return;z=void 0,ce(),ye(mt)}finally{if(Ve)Pe.removeEventListener("abort",Ve)}}function Y(N=""){V="",b.textContent=N,b.hidden=!N,k.replaceChildren(),k.hidden=!0}function ee(N,J=!0){if(!N||O||z?.kind==="prepare"||!i.open)return;if(l.value=N,J)b.textContent=N,b.hidden=!1,b.focus({preventScroll:!0});Y(N),G(),x.textContent=c("正在读取目录…","Reading directory…"),K("browse","browse",{path:N},(oe)=>{let Ce=C(oe.path);if(!Ce||!Array.isArray(oe.entries))throw Error("Invalid browse response");V=C(oe.parent),b.textContent=Ce,l.value=Ce,p.value=t().roots.includes(Ce)?Ce:"";for(let ye of oe.entries){let{name:Be,path:Fe,kind:Pe}=j(ye);if(typeof Be!=="string"||!Be||typeof Fe!=="string"||!Fe)continue;if(Pe!=="directory"&&Pe!=="file")continue;let Ve=y("li"),mt=Pe==="directory"?We("",()=>ee(Fe),"button--quiet workspace-entry"):y("div","workspace-entry");mt.append(y("bdi","break",Be),y("span","small muted",Pe==="directory"?c("目录 ›","Folder ›"):c("文件","File"))),Ve.append(mt),k.append(Ve)}k.hidden=!k.childElementCount,x.textContent=oe.truncated===!0?c("目录条目太多,仅显示部分名称。","This directory has too many entries to show them all."):k.hidden?c("没有可显示的条目。","No entries to show."):"",ce()},(oe)=>{x.textContent="",p.value="",G(Gf(oe)?c("读取目录超时。请重新选择一个已授权工作区。","Reading the directory timed out. Choose an authorized directory and try again."):c("无法读取该目录。只能浏览已授权范围内仍可访问的目录。","Could not read this directory. You can only browse accessible directories within authorized locations."),!0)})}function ie(N){let J=C(N.path),oe=Xl(N.workspaces);if(!J||!oe.includes(J))throw Error("Invalid workspace selection receipt");i.close(),n(J,oe)}function H(N){if(!N||O||z?.kind==="prepare")return;if(z?.kind==="browse")x.textContent=c("目录读取已取消。","Directory read canceled.");G(c("正在核验目录…","Verifying directory…")),K("prepare","prepare",{path:N},(J)=>{if(J.status==="authorized"){ie(J);return}let oe=C(J.path),Ce=C(J.confirmation),ye=we(J.expiresAt);if(J.status!=="confirmation_required"||!oe||!Ce||ye===void 0)throw Error("Invalid approval response");if(l.value=oe,ye<=Date.now()){de();return}G(),re({token:Ce,path:oe,expiresAt:ye}),S.focus()},(J)=>{G(Gf(J)?c("核验目录超时。路径已保留,请重试。","Directory verification timed out. The path is still in the field. Try again."):c("无法核验目录。请检查绝对路径、目录是否仍存在及本机 Web 服务是否可用。","Could not verify the directory. Check the absolute path, whether the directory still exists, and whether the local Web server is running."),!0)})}function q(N,J=!1){if(!O||z?.kind==="decision")return;let{token:oe,expiresAt:Ce}=O;if(Ce<=Date.now()){de();return}clearTimeout(P),G(N?c("正在提交允许决定…","Granting access…"):c("正在提交拒绝决定…","Denying access…")),K("decision","confirm",{confirmation:oe,allow:N},(ye)=>{if(N){ie(ye);return}if(ye.status!=="cancelled")throw Error("Invalid denial receipt");if(re(),J)i.close();else G(c("已拒绝。工作区未切换。","Access denied. The selected directory did not change.")),u.focus()},(ye)=>{re();let Be=ye instanceof De&&(ye.code==="workspace_confirmation_stale"||ye.status===410);G(Be?c("审批已失效:可能已过期或目录已变更。请重新核验路径。","Approval expired or the directory changed. Verify the path again."):c("未能确认审批结果,未切换工作区。请重新核验路径。","Could not confirm the approval result. The selected directory did not change. Verify the path again."),!0),u.focus()})}function W(){if(z?.kind==="decision")return;if(O)q(!1,!0);else F(),i.close()}function le(){let{roots:N}=t(),J=p.value;p.replaceChildren(pt(c("选择已授权工作区","Choose an authorized directory"),""),...N.map((oe)=>pt(oe,oe))),p.value=N.includes(J)?J:"",f.hidden=!N.length}return s.addEventListener("click",()=>{if(!L||document.querySelector("dialog:modal"))return;F(),re(),G();let{roots:N,selected:J}=t(),oe=N.includes(J)?J:N[0]??"";if(le(),p.value=oe,l.value=oe,x.textContent=oe?"":c("没有已授权目录。可手动输入目录的绝对路径。","No directories are authorized. Enter an absolute directory path."),Y(),ce(),i.showModal(),oe)ee(oe,!1)}),o.addEventListener("submit",(N)=>{N.preventDefault(),H(l.value)}),l.addEventListener("input",()=>{if(z?.kind==="browse"||z?.kind==="prepare"){if(z.kind==="browse")x.textContent=c("目录读取已取消。","Directory read canceled.");F()}G(),ce()}),p.addEventListener("change",()=>ee(p.value)),g.addEventListener("click",()=>ee(V)),D.addEventListener("click",()=>q(!0)),M.addEventListener("click",()=>q(!1)),a.addEventListener("click",W),i.addEventListener("cancel",(N)=>{N.preventDefault(),W()}),i.addEventListener("close",()=>{if(i.open)return;if(F(),re(),G(),Y(),!document.querySelector("dialog:modal"))r()}),{update(N,J){let oe=j(N).platform,Ce=oe==="win32"||oe==="posix"?oe:void 0,ye=L!==Ce||J;if(L=Ce,s.hidden=!L,l.placeholder=L==="win32"?"C:\\Projects\\OmO":"/home/me/projects/OmO",!i.open)return;if(!L)F(),i.close();else{if(le(),!ye)return;F(),re(),Y(),x.textContent="",G(c("本机 Web 服务连接已更新。请重新选择或核验目录。","The local Web server connection changed. Choose a directory or verify the path again."),!0),l.focus()}}}}var Vf=["scoped-models","favorite-models","task-kill","login","logout","trust","export","import","share","reload","keybindings","changelog","quit","exit","bug","debug"];var Yf=120,Xf=6000,Ra=Yf.toLocaleString(me),Ma=Xf.toLocaleString(me),Ql=[{name:"new",invocation:"/new",label:c("新会话","New session"),description:c("开始一个新会话。","Start a new session.")},{name:"resume",invocation:"/resume",label:c("继续会话","Resume session"),description:c("从历史会话中选择一个继续。","Choose a past session to resume.")},{name:"sessions",invocation:"/sessions",label:c("会话列表","Session list"),description:c("列出历史会话并继续其中一个。","Browse and resume past sessions.")},{name:"rename",invocation:"/rename",label:c("重命名","Rename"),description:c(`重命名当前会话(名称可选,最长 ${Ra} 字)。`,`Rename the current session. The name is optional and can be up to ${Ra} characters.`)},{name:"name",invocation:"/name",label:c("重命名(别名)","Rename (alias)"),description:c("与 /rename 相同:设置会话显示名。","Alias for /rename. Set the session's display name.")},{name:"session",invocation:"/session",label:c("会话信息","Session info"),description:c("查看当前会话的信息与统计。","View details and statistics for this session.")},{name:"tree",invocation:"/tree",label:c("会话树","Session tree"),description:c("查看会话分支树并跳到任意点继续。","Browse session branches and resume from any point.")},{name:"todo",invocation:"/todo",label:c("本会话待办","Session Todo"),description:c("查看当前分支的待办。","View the Todo list for the current branch.")},{name:"tasks",invocation:"/tasks",label:c("本会话任务","Session tasks"),description:c("查看当前会话的原生子代理任务。","View native subagent tasks for this session.")},{name:"dag",invocation:"/dag",label:c("本会话 DAG","Session DAG"),description:c("查看本会话的运行,展开读取波次和依赖。","View workflow runs and expand them to inspect execution waves and dependencies.")},{name:"help",invocation:"/help",label:c("命令帮助","Command help"),description:c("查看 Web 可用的命令和快捷键。","See which commands and keyboard shortcuts are available on the web.")},{name:"hotkeys",invocation:"/hotkeys",label:c("快捷键","Keyboard shortcuts"),description:c("查看此工作台的键盘操作。","View keyboard shortcuts for the workbench.")},{name:"fork",invocation:"/fork",label:c("分支","Fork"),description:c("选择一条用户消息,从该消息之前创建分支。","Choose a user message and start a branch from just before it.")},{name:"clone",invocation:"/clone",label:c("副本","Clone"),description:c("复制当前会话为新会话并切换过去。","Copy the current session and switch to the copy.")},{name:"compact",invocation:"/compact",label:c("压缩上下文","Compact context"),description:c(`手动压缩上下文(指示可选,最长 ${Ma} 字)。`,`Compact context manually. Optional instructions can be up to ${Ma} characters.`)},{name:"settings",invocation:"/settings",label:c("会话设置","Session settings"),description:c("打开当前会话的运行设置;全局配置请在本机终端修改。","Open this session's run settings. Change global configuration in the local terminal.")},{name:"setting",invocation:"/setting",label:c("会话设置(别名)","Session settings (alias)"),description:c("与 /settings 相同。","Alias for /settings.")},{name:"model",invocation:"/model",label:c("模型","Model"),description:c("切换本会话的模型(只对当前会话有效)。","Change the model for this session only.")},{name:"thinking",invocation:"/thinking",label:c("思考档位","Thinking level"),description:c("设置思考档位(可选;档位按实际可选值校验)。","Set a thinking level. If specified, it must be one of the available levels.")},{name:"reasoning",invocation:"/reasoning",label:c("推理状态","Reasoning status"),description:c("查看当前模型是否启用推理。持久设置在本机修改。","Check whether reasoning is enabled for the current model. Change persistent settings in the native client.")},{name:"efforts",invocation:"/efforts",label:c("原生推理档位","Native reasoning levels"),description:c("查看当前档和原生可用档位。持久设置在本机修改。","View the current level and available native levels. Change persistent settings in the native client.")},{name:"fast",invocation:"/fast",label:c("极速模式","Fast mode"),description:c("切换极速模式(开、关或不带参数切换;只影响当前模型)。","Set fast mode to on or off, or omit the argument to toggle it. Applies only to the current model.")},{name:"copy",invocation:"/copy",label:c("复制","Copy"),description:c("复制上一条助手消息。","Copy the last assistant message.")}],K5=Ql.map((e)=>e.name);function Qf(e){let t=hs(e);return t.kind==="builtin"&&["session","tree","todo","tasks","dag","help","hotkeys","reasoning","efforts","settings","setting"].includes(t.command.name)}var V5=/^\/[A-Za-z][A-Za-z0-9_-]*/,Jf=/[\0-\b\v\f\x0e-\x1f\x7f]/,J5=/^[A-Za-z0-9_./:@+-]+$/,Zf=c("命令只能是单行文本,不能包含换行或控制字符。","Commands must be on one line and cannot contain control characters."),$n=(e)=>({kind:"malformed",message:e});function hs(e){let t=V5.exec(e)?.[0];if(t===void 0)return{kind:"plain"};let n=e.slice(t.length),r=t.slice(1),s=K5.find((o)=>o===r),i=Vf.find((o)=>o===r);if(s===void 0&&i===void 0)return{kind:"plain"};if(n!==""&&!/^[ \t\r\n]/.test(n))return Jf.test(n[0])?$n(Zf):{kind:"plain"};if(Jf.test(e)||e.includes("\r")||e.includes(`
|
|
290
|
+
`))return $n(Zf);if(i!==void 0)return{kind:"tui-only",name:i};let a=n.trim();switch(s){case"new":case"resume":case"sessions":case"session":case"tree":case"todo":case"tasks":case"dag":case"help":case"hotkeys":case"fork":case"clone":case"copy":case"settings":case"setting":if(a!=="")return $n(c(`“/${s}”不带参数。`,`/${s} does not take arguments.`));return{kind:"builtin",command:{name:s}};case"reasoning":case"efforts":return a===""?{kind:"builtin",command:{name:s}}:{kind:"tui-only",name:s};case"rename":case"name":if(a.length>Yf)return $n(c(`会话名称不能超过 ${Ra} 字。`,`Session names can be up to ${Ra} characters.`));return{kind:"builtin",command:{name:s,...a===""?{}:{value:a}}};case"compact":if(a.length>Xf)return $n(c(`压缩指示不能超过 ${Ma} 字。`,`Compaction instructions can be up to ${Ma} characters.`));if(a==="")return{kind:"builtin",command:{name:"compact"}};return{kind:"builtin",command:{name:"compact",instructions:a}};case"model":if(a==="")return{kind:"builtin",command:{name:"model"}};if(/(^|\s)--\S/.test(a))return $n(c("Web 只接受精确模型引用,不支持 --default 等持久化参数。","The web app accepts exact model references only. Persistent flags such as --default are not supported."));if(!J5.test(a))return $n(c("模型引用只能是单个精确引用(如 provider/model)。","Enter one exact model reference, such as provider/model."));return{kind:"builtin",command:{name:"model",reference:a}};case"thinking":if(a==="")return{kind:"builtin",command:{name:"thinking"}};if(!/^[^\s]+$/.test(a))return $n(c("请输入单个思考档位,例如 high。","Enter a single thinking level, such as high."));return{kind:"builtin",command:{name:"thinking",level:a.toLowerCase()}};case"fast":{if(a==="")return{kind:"builtin",command:{name:"fast"}};let o=a.toLowerCase();return o==="on"||o==="off"?{kind:"builtin",command:{name:s,mode:o}}:$n(c("“/fast”只接受 on、off 或无参数(切换)。","Use /fast on, /fast off, or /fast to toggle."))}default:return{kind:"plain"}}}var Nr=/^(?:\/(?:[A-Za-z0-9_-]{1,64}|skill:[A-Za-z0-9-]{1,64})|\$[A-Za-z0-9-]{1,64})$/,Z5=/^(?:\/(?:[A-Za-z0-9_-]{0,64}|skill:[A-Za-z0-9-]{0,64})|\$[A-Za-z0-9-]{0,64})$/;function Da(e){return[...Ql.map((t)=>({...t,source:"builtin"})),...ve(e).map(j).filter((t)=>hs(C(t.invocation)).kind==="plain")]}function em(e,t){let n=[],r=-1,s,i=!1;function a(){n=[],r=-1,t.hidden=!0,e.removeAttribute("aria-activedescendant")}function o(l){let u=n[l];if(!u)return;e.value=`${u.invocation} `,e.focus(),e.setSelectionRange(e.value.length,e.value.length),a(),e.dispatchEvent(new Event("input",{bubbles:!0}))}return e.addEventListener("compositionstart",()=>{i=!0,a()}),e.addEventListener("compositionend",()=>{i=!1}),e.addEventListener("blur",a),t.addEventListener("mousedown",(l)=>l.preventDefault()),t.addEventListener("click",(l)=>{let u=l.target;if(!(u instanceof Element))return;let d=Array.from(t.children).findIndex((f)=>f.contains(u));o(d)}),{get composing(){return i},reset(){s=void 0,a()},render(l,u){let d=e.value;if(s!==d)s=void 0;if(!u||i||s===d||document.activeElement!==e||!Z5.test(d)||e.selectionStart!==d.length||e.selectionEnd!==d.length){a();return}let f=d.startsWith("$")||d.startsWith("/skill:"),p=d.toLowerCase().replace(/^\/skill:/,"$"),g=new Map;for(let x of Da(l)){let k=C(x.invocation);if(!Nr.test(k)||k.startsWith("$")!==f)continue;if(k.toLowerCase().startsWith(p)&&!g.has(k))g.set(k,{invocation:k,description:C(x.description)})}let b=[...g.values()].sort((x,k)=>Number(k.invocation===p)-Number(x.invocation===p)||x.invocation.localeCompare(k.invocation));if(!b.length){a();return}if(b.length===n.length&&b.every((x,k)=>x.invocation===n[k]?.invocation&&x.description===n[k]?.description))return;n=b,r=-1,e.removeAttribute("aria-activedescendant"),t.replaceChildren(...b.map((x,k)=>{let A=y("li");return A.id=`inline-command-${k}`,A.setAttribute("role","option"),A.setAttribute("aria-selected","false"),A.append(y("code","",x.invocation),y("span","small muted",x.description)),A})),t.hidden=!1,t.scrollTop=0},key(l){if(i||t.hidden||!ai(l))return!1;switch(l.key){case"Escape":s=e.value,a();break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":{let u=oi(l.key,r,t.children,t);if(u===void 0)return!1;t.children[r]?.setAttribute("aria-selected","false"),r=u;let d=t.children[r];d.setAttribute("aria-selected","true"),e.setAttribute("aria-activedescendant",d.id),li(t,d);break}case"Enter":case"Tab":if(r<0)return!1;o(r);break;default:return!1}return l.preventDefault(),!0}}}D0();var U=(e)=>ge(e,HTMLElement),Q=(e)=>ge(e,HTMLButtonElement),He=(e)=>ge(e,HTMLSelectElement),Lt=(e)=>ge(e,HTMLInputElement),Ia=(e)=>ge(e,HTMLFormElement),An=(e)=>ge(e,HTMLDialogElement),ze=new no,As=new Fn(U("messages"),U("transcript"),U("no-messages")),ur=y("p","notice small");ur.id="transcript-status";ur.setAttribute("role","status");ur.hidden=!0;Ia("composer").prepend(ur);var xi=new ro(U("interactions")),$a=U("session-trace"),fs={user:Q("trace-jump-user"),assistant:Q("trace-jump-assistant"),tool:Q("trace-jump-tool"),request:Q("jump-to-request")},ms=new Map,Ge=ge("prompt",HTMLTextAreaElement),pi=em(Ge,U("inline-commands")),Hn=He("prompt-mode"),Pn=He("model"),Na=He("thinking"),Gn=y("button","button button--quiet",c("应用模型","Apply model"));Gn.id="apply-model";Gn.type="button";Gn.hidden=!0;var En=y("p","small muted sr-only");En.id="model-preview";En.setAttribute("role","status");En.hidden=!0;Pn.setAttribute("aria-describedby",En.id);Na.setAttribute("aria-describedby",En.id);Pn.parentElement?.after(Gn);var bs=U("compose-options"),o0=bs.parentElement,dr=Q("compose-options-button"),um=y("div","row compose-selectors");um.append(...bs.children);var dm=y("div","stack stack--tight");dm.append(um,En);bs.append(dm);var vs=An("new-dialog"),Ke=An("manage-dialog"),xe=An("details-dialog"),Ht=An("command-dialog"),gi=An("branch-dialog"),tn=si,e0={explicit:c("显式指定","Selected"),session:c("会话内记录","Session"),global:c("设备记忆","Saved on this device"),"model-default":c("模型默认","Model default"),default:c("默认设置","Default"),fallback:c("回退档位","Fallback"),clamped:c("按模型能力调整","Adjusted for this model")},t0={ask:c("审批:询问","Ask first"),auto:c("审批:Auto","Auto"),"full-access":c("审批:无审批","No approval")},tm=[["ask",t0.ask],["auto",t0.auto],["full-access",t0["full-access"]]],B,v0=mf(ze,()=>xe.open&&B?.status==="ready"?B.session.id:void 0),bt={},Ei={},tt="connecting",jt="waiting",_t=!1,qr=!1,qa=!1,zr="",Ai="",Hr=new Map,hm=[],Ha="",nm=Number.NEGATIVE_INFINITY,n0=0,fm=30000,Y5=new Intl.DateTimeFormat(me,{dateStyle:"medium",timeStyle:"short"}),vt=[],l0=0,Ba=!1,Vt="",Fr="",Jt=(e)=>vt.includes(e),mm=(e)=>Jt(e)&&(!Vt||e===Vt),bi="omo-web-language-return-session",on=!1,yn,vi=0,X5=2000,Q5=2000,Or=0,mr,r0=0,Ci=0,c0=0,kn,yi=!1,wn=!1,rm="omo-web-navigation-collapsed",y0="omo-web-desktop-inspector",hr=!1,_i=!0,It=new Set,Jn=new Set,u0=new Map,Le=new Map,ys=matchMedia("(max-width: 760px)"),ws=matchMedia("(max-width: 1000px)"),sm=matchMedia("(prefers-color-scheme: dark)"),s0=new Intl.NumberFormat(me),eb=new Intl.NumberFormat(me,{maximumFractionDigits:2}),w0=(e)=>Q(ys.matches?"open-navigation":hr?"rail-toggle":e).focus(),tb=Sf(ze,bm),k0=(e)=>{if(gi.open)return;gi.dataset.sourceKind=e.kind,tb(e)},at=Wf(ze,Jt,()=>{if(at.active)B?.history?.invalidate();if(Vn(),$r(),_e(),B?.history)ks(B)}),Cs=Pf(ze,()=>w0("cli-live-button"),k0,Jt),nb=Kf(ze,()=>({roots:vt,selected:Fr||B?.session.cwd||Vt}),lb,()=>{if(ys.matches&&!wn)Q("open-navigation").focus();else if(Q("workspace-browser-button").hidden)Lt("search").focus();else Q("workspace-browser-button").focus()}),Oa=!1,pm=qf(ze,()=>{if(!Oa&&!document.querySelector("dialog:modal"))w0("cli-history-button");Oa=!1},k0,rb,(e,t)=>{if(_s(!0),!t){pr();return}if(Oa=!0,An("cli-history-dialog").close(),on=e.archived,Le.get(e.id)?.status==="pending"&&B?.session.id===e.id)Ka(B);Le.delete(e.id),Yn(e),Mi(e.id,!0)},Jt);function fi(e){switch(e){case"engine_offline":return c("本机引擎未连接。","The local engine is offline.");case"shared_transport":return c("切换到 CLI 需要私有本机连接。","Switching to the CLI requires a private local connection.");case"missing_capability":return c("此 OmO 版本不支持换端。","This version of OmO does not support handoff.");case"profile_mismatch":return c("本机引擎与 CLI 会话使用不同配置。","The local engine and the CLI session use different profiles.");case"session_busy":return c("等本轮结束后再换端。","Wait for this turn to finish before switching.");case"dialog_pending":return c("先处理会话中的待答事项。","Answer the pending request before switching.");default:return c("这个会话暂时无法换端。","This session cannot be switched right now.")}}function rb(){if(tt!=="online")return c("连接断开,只能浏览记录。","Offline. You can still browse the history.");return Ei.supported===!0?"":fi(Ei.reason)}function gm(e){if(!e.session.active||e.status!=="ready")return c("先恢复此会话。","Resume this session first.");if(tt!=="online")return c("连接断开,无法换端。","Reconnect before switching.");if(Ei.supported!==!0)return fi(Ei.reason);if(e.running||e.compacting)return fi("session_busy");if(e.requests.size)return fi("dialog_pending");if(e.queue)return c("等队列里的消息发送后再换端。","Wait for queued messages to finish before switching.");if(e.handoff.eligible!==!0)return fi(e.handoff.reason);if(It.has(e.session.id)||Jn.has(e.session.id))return c("正在提交,请稍候。","Submitting…");return""}function Ka(e){if(Ti(e),e.optionSync++,e.snapshotRequestChanges=void 0,e.status="inactive",e.running=!1,e.compacting=!1,e.workbench=void 0,e.generationSpeed=void 0,e===B)kn?.abort()}function Ti(e){if(Va(e),e.sync++,e.revision++,e.transcriptRefresh=e.stateRefresh=void 0,e.pendingStateUnknown=e.refreshScheduled=void 0,e.messages=[],e.liveKey="",e.liveMessageKeys.clear(),e.tools.clear(),e.transcript="unavailable",e===B)As.reset()}function Va(e){e.historyEpoch++,e.history?.invalidate(),e.history=void 0}function Ja(e){let t=Boolean(e.history);if(Va(e),t)e.messages=[],e.liveMessageKeys.clear(),e.transcript="unavailable",As.reset()}function bm(e,t,n){if(!vt.includes(e.cwd))return;if(n.kind==="live")Cs.closeAfterBranch();if(n.kind==="history")Oa=!0,An("cli-history-dialog").close();on=!1,Ue(e.id).text=t,Yn(e),_s(!0),Mi(e.id,!0)}function Ue(e){let t=u0.get(e);if(!t)t={text:"",mode:"prompt",images:[],reading:0,error:"",commandMode:!1,commandText:"",commandError:""},u0.set(e,t);return t}function vm(e){return hs(e).kind!=="plain"||Nr.test(e.split(/\s/,1)[0]??"")}function sb(){let e=He("theme");try{let n=localStorage.getItem("omo-web-theme");if(n==="dark"||n==="light")e.value=n}catch(n){if(!(n instanceof DOMException))throw n}let t=()=>{document.documentElement.dataset.theme=e.value==="system"?sm.matches?"dark":"light":e.value};e.addEventListener("change",()=>{t();try{localStorage.setItem("omo-web-theme",e.value)}catch(n){if(!(n instanceof DOMException))throw n}}),sm.addEventListener("change",t),t()}function ib(){let e=He("language-select"),t=U("language-feedback");e.value=me,e.addEventListener("change",()=>{let n=e.value;if(n!=="en"&&n!=="zh-CN"||n===me)return;let r=(i)=>{e.value=me,se(t,i)};if([...u0.values()].some((i)=>i.text||i.commandText||i.images.length||i.reading)){r(c("发送或清空草稿后,再切换语言。","Send or clear your drafts before changing the language."));return}if(yi||Jn.size||It.size||B?.requests.size){r(c("先完成当前操作,再切换语言。","Finish the current action before changing the language."));return}if(at.active){r(c("退出 CLI 跟随后,再切换语言。","Stop following the CLI before changing the language."));return}let s=B?.session.id;try{if(s)sessionStorage.setItem(bi,s);else sessionStorage.removeItem(bi)}catch{if(s){r(c("浏览器无法保留当前会话。关闭此会话页面后再切换语言。","The browser could not preserve this session. Change the language from the start screen."));return}}if(!M0(n)){try{sessionStorage.removeItem(bi)}catch{}r(c("浏览器无法保存语言设置。","The browser could not save your language setting."));return}location.reload()})}function ab(){let e;try{e=sessionStorage.getItem(bi),sessionStorage.removeItem(bi)}catch{return}let t=e?Hr.get(e):void 0;if(!t||!Jt(t.cwd))return;on=t.archived,Mi(t.id,!1,!1)}function im(e){try{return localStorage.getItem(e)}catch(t){if(!(t instanceof DOMException))throw t;return null}}function x0(e,t){try{localStorage.setItem(e,t)}catch(n){if(!(n instanceof DOMException))throw n}}function am(){U("workspace-shell").toggleAttribute("data-rail-collapsed",hr);let e=Q("rail-toggle");e.setAttribute("aria-expanded",String(!hr));let t=hr?c("展开会话导航","Expand sessions"):c("收起会话导航","Collapse sessions");e.setAttribute("aria-label",t),e.title=t}function nn(e,t=!1){if(wn=e&&ys.matches,U("navigation").classList.toggle("is-open",wn),U("nav-scrim").hidden=!wn,U("conversation").inert=wn,U("skip-link").inert=wn,Q("open-navigation").setAttribute("aria-expanded",String(wn)),wn)Lt("search").focus();else if(t&&ys.matches)Q("open-navigation").focus()}function Zn(){Cs.setTransport(jt);let e=tt==="online";tt=zr||bt.online===!1||jt==="lost"?"offline":qr&&jt==="open"&&!_t&&bt.online===!0?"online":"connecting",U("connection").dataset.state=tt,U("connection-label").textContent={online:c("本机已连接","Connected"),offline:c("连接不可用","Offline"),connecting:c("正在连接","Connecting")}[tt];let t=C(bt.version);se(U("engine-version"),t&&c(`引擎 ${t}`,`Engine ${t}`));let n=zr||(bt.online===!1?C(bt.error)||c("Senpi 引擎未连接。检查引擎后再重连。","The Senpi engine is offline. Check it and reconnect."):jt==="lost"?c("实时连接已断开。正在重连,草稿会保留。","Connection lost. Reconnecting; your drafts are kept."):Ai);U("banner").toggleAttribute("data-unprotected",qa),U("access-warning").hidden=!qa,Q("retry").hidden=!n,se(U("banner-text"),n);let r=tt==="online"&&Boolean(vt.length);if(Q("new-sidebar").disabled=!r,Q("new-welcome").disabled=!r,U("welcome-copy").textContent=qr&&!vt.length?Q("workspace-browser-button").hidden?c("没有可用目录。请检查 OmO Web 的启动配置。","No directories are available. Check your OmO Web startup settings."):c("还没有可用目录。打开侧栏的「目录」添加。","No directories yet. Open Directories in the sidebar to add one."):c("从列表打开会话,或选个目录开始新会话。","Open a session from the list, or choose a directory to start a new one."),Q("create").disabled=!r||yi,pm.update(),Vn(),_s(),$r(),_e(),B?.history)ks(B);if(!e&&tt==="online"&&B&&(B.stateRefresh||B.transcriptRefresh))ft(B)}async function _s(e=!1){if(!qr)return;if(!e&&performance.now()-nm<fm)return;let t=++n0;nm=performance.now();try{let n=await ze.request("/api/cli-history");if(t!==n0)return;Ha=n.available===!0?"":c("没有可读取的 CLI 历史。","No CLI history is available."),hm=n.available===!0?ve(n.sessions).map(j).flatMap((r)=>{let s=C(r.id);return s&&r.adopted!==!0?[{id:s,name:C(r.name)||c("未命名 CLI 会话","Untitled CLI session"),cwd:C(r.cwd),updatedAt:we(r.updatedAt)??0}]:[]}):[]}catch(n){if(t!==n0)return;Ha=c(`无法读取 CLI 历史:${Ee(n)}`,`Couldn't load CLI history: ${Ee(n)}`)}$r()}function $r(){let e=U("cli-sessions"),t=U("cli-session-list"),n=document.activeElement instanceof HTMLButtonElement&&t.contains(document.activeElement)?document.activeElement.dataset.cliSession:void 0,r=Lt("search").value.trim().toLocaleLowerCase(),s=on?[]:hm.filter((i)=>mm(i.cwd)&&(!r||`${i.name} ${i.cwd}`.toLocaleLowerCase().includes(r))).sort((i,a)=>a.updatedAt-i.updatedAt);e.hidden=s.length===0&&!Ha,t.replaceChildren();for(let i of s){let a=y("li"),o=We("",()=>Mm(i.id),"button--quiet session-link");o.dataset.cliSession=i.id;let l=Number.isFinite(new Date(i.updatedAt).getTime())?Y5.format(i.updatedAt):"",u=y("span","small muted path",Si(i.cwd));u.title=i.cwd,o.append(y("span","",i.name),u,y("small","",l)),a.append(o),t.append(a)}if(t.hidden=!s.length,se(U("cli-list-empty"),s.length?"":Ha||(qr?c("没有本机 CLI 会话。","No local CLI sessions."):"")),n)[...t.querySelectorAll("button")].find((i)=>i.dataset.cliSession===n)?.focus({preventScroll:!0})}function ym(e){if(Hr=new Map(e.map((t)=>[t.id,t])),B){let t=Hr.get(B.session.id);if(t&&t.cwd!==B.session.cwd)Ti(B);if(B.session=t??B.session,!vt.includes(B.session.cwd))A0();else if(!B.session.active&&B.status==="ready"&&Le.get(B.session.id)?.status!=="pending"){if(Ka(B),Ke.open)Ke.close()}}Vn(),_e()}function Yn(e){if(Ci++,Hr.set(e.id,e),B?.session.id===e.id)B.session=e;Vn()}async function pr(){let e=++r0,t=Ci;try{let n=await ze.request("/api/sessions");if(e!==r0||t!==Ci)return;Ai="",ym(eo(n))}catch(n){if(e===r0)Ai=c(`无法读取会话列表:${Ee(n)}`,`Couldn't load sessions: ${Ee(n)}`)}Zn()}function Si(e){let t=(r)=>Ba?r.replaceAll("\\","/"):r,n=t(e).split("/").filter(Boolean);if(Ba&&n.length===1)return e;for(let r=1;r<=n.length;r++){let s=n.slice(-r).join("/");if(!vt.some((i)=>i!==e&&t(i).endsWith(`/${s}`)))return Ba?s.replaceAll("/","\\"):s}return e}function E0(){let e=He("workspace-select"),t=c("所有目录","All directories");Pa(e,vt.map((n)=>[n,Si(n)]),Vt,t),e.title=Vt||t,U("workspace-field").hidden=vt.length<2}function A0(){if(B)Va(B);if(B=void 0,mr?.(),clearTimeout(c0),As.reset(),xi.reset(),Ge.value="",Ts(),Ke.open)Ke.close();if(yr(!1),jn(!1),Ht.open)fr?.abort(),Ht.close();if(gi.open&&gi.dataset.sourceKind==="web")gi.close()}function ob(e){if(e&&!Jt(e))return;Vt=e,E0(),Vn(),$r()}function lb(e,t){if(l0++,vt=t,Fr=Jt(e)?e:"",Vt&&!Jt(Vt))Vt="";if(B&&!Jt(B.session.cwd))A0();at.recheckWorkspace(),E0(),Cs.scopeChanged(),nn(!1),pr(),_s(!0),Zn()}async function Kn(e=!1){let t=++Or;mr?.();let n=Ci,r=l0;try{let s=await ze.request("/api/bootstrap");if(t!==Or)return;let i=C(s.token),a=i!==ze.token;if(a&&B)Ja(B);ze.token=i,bt=j(s.engine),qa=s.unprotected===!0,Ei=j(s.handoff);let o=j(s.fileBrowser);if(Ba=o.platform==="win32",r===l0||a)vt=Xl(s.workspaces);let l=!qr;if(Vt&&!Jt(Vt))Vt="";if(Fr&&!Jt(Fr))Fr="";if(nb.update(o,a),B&&!vt.includes(B.session.cwd))A0();if(at.recheckWorkspace(),E0(),Cs.scopeChanged(),qr=!0,zr="",Ai="",n===Ci)ym(eo(s));if(!yn)km();if(l)ab();let u=B&&Le.get(B.session.id);if(e&&_t==="transport"){if(tt==="offline"&&jt==="open"&&bt.online===!0)Zn();await cb(t)}else if(e&&B&&(!u||u.status==="failed")){if(!B.session.active&&B.status!=="loading"&&bt.online===!0)B.status="inactive",B.error="";else if(B.session.active&&bt.online===!0){let d=B;if(await Ur(d),d===B)gr(d)}}}catch(s){if(t===Or)zr=c(`无法连接本机 Web 服务:${Ee(s)}`,`Couldn't connect to OmO Web: ${Ee(s)}`)}if(t!==Or)return;if(_t!=="transport"||jt==="open"&&bt.online===!0&&!zr)_t=!1;Zn()}async function cb(e){let t=()=>e===Or&&_t==="transport"&&jt==="open"&&bt.online===!0;while(t()){let n=B;if(!n?.session.active)return;let r=Le.get(n.session.id);if(r&&r.status!=="failed")return;let s=Promise.withResolvers();mr=s.resolve;let i;try{let a=await Promise.race([n.pendingSnapshot??Ur(n,!1,!0),s.promise]);if(t()&&n===B&&Le.get(n.session.id)===r&&a===n.sync){gr(n);return}}catch(a){if(!(a instanceof De||a instanceof TypeError))throw a;if(t()&&n===B&&Le.get(n.session.id)===r)i=window.setTimeout(s.resolve,Q5),await s.promise}finally{if(clearTimeout(i),mr===s.resolve)mr=void 0}}}function Vn(){let e=Lt("search").value.trim().toLocaleLowerCase(),t=U("session-list"),n=document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)?document.activeElement.dataset.session:void 0,r=[...Hr.values()].filter((a)=>mm(a.cwd)&&a.archived===on&&(!e||`${a.name} ${a.cwd}`.toLocaleLowerCase().includes(e))).sort((a,o)=>o.updatedAt-a.updatedAt),s=new Map([...t.children].flatMap((a)=>a instanceof HTMLLIElement&&a.dataset.session?[[a.dataset.session,a]]:[])),i=t.firstElementChild;for(let a of r){let o=s.get(a.id);if(!o){o=y("li"),o.dataset.session=a.id;let u=We("",()=>Mi(a.id),"button--quiet session-link");u.dataset.session=a.id,u.append(y("span"),y("span","small muted path"),y("small")),o.append(u)}let l=o.firstElementChild;if(l instanceof HTMLButtonElement){l.firstElementChild&&(l.firstElementChild.textContent=a.name);let u=l.children.item(1);if(u instanceof HTMLElement)u.textContent=Si(a.cwd),u.title=a.cwd,u.hidden=!a.cwd;let d=l.lastElementChild;if(d)d.textContent=Le.get(a.id)?.status==="released"?c("已释放","Released"):a.running?c("运行中","Running"):a.settled?c("已结清","Done"):a.active?c("已打开","Open"):c("待恢复","Resume");if(!at.active&&a.id===B?.session.id)l.setAttribute("aria-current","true");else l.removeAttribute("aria-current")}if(o!==i)t.insertBefore(o,i);i=o.nextElementSibling,s.delete(a.id)}for(let a of s.values())a.remove();if(n&&!r.some((a)=>a.id===n))Lt("search").focus();se(U("list-empty"),r.length?"":e?c("没有匹配的会话","No matching sessions"):!qr?zr?c("暂时无法读取会话","Couldn't load sessions"):c("正在读取会话…","Loading sessions…"):on?c("没有已归档的会话","No archived sessions"):c("还没有最近会话","No recent sessions")),Q("recent").setAttribute("aria-pressed",String(!on)),Q("archived").setAttribute("aria-pressed",String(on))}function Mi(e,t=!1,n=!0){let r=Hr.get(e);if(!r||!vt.includes(r.cwd))return;if(at.stop(),n)nn(!1),U("conversation").focus();if(e===B?.session.id){if(!t)return;if(B.status==="ready"){Ge.focus();return}}if(B)Va(B);if(Ke.open)Ke.close();if(yr(!1),jn(!1),Ht.open)fr?.abort(),Ht.close();if(kn?.abort(),n)U("conversation").focus({preventScroll:!0});let s=Le.get(e),i=r.active&&s?.status!=="released"&&s?.status!=="uncertain",a={session:r,status:i?"loading":"inactive",error:"",state:{},messages:[],liveKey:"",liveMessageKeys:new Set,tools:new Map,requests:new Map,options:{},optionsError:"",handoff:{},queue:void 0,revision:0,serial:0,sync:0,optionSync:0,historyEpoch:0,running:r.running,compacting:!1};B=a,mr?.(),As.reset(),xi.reset();let o=Ue(e);if(Ge.value=o.commandMode?o.commandText:o.text,Hn.value=o.mode,Ts(),Vn(),_e(),i)Ur(a,!0).then(()=>{if(t&&a===B&&a.status==="ready"&&document.activeElement===U("conversation"))Ge.focus()}),gr(a);else if(n&&s?.status==="released"&&!document.querySelector("dialog:modal"))U("handoff-title").focus()}function qt(e){return C(e.id)?JSON.stringify([C(e.provider),C(e.id)]):""}function ub(e){let t=C(e.name)||C(e.id);return t?[C(e.provider),t].filter(Boolean).join(" · "):""}function Pa(e,t,n,r){let s=JSON.stringify(t);if(e.dataset.options!==s)e.replaceChildren(pt(r,""),...t.map(([i,a])=>pt(a,i))),e.dataset.options=s;if(e.value=n,e.selectedIndex<0)e.value=""}function db(e,t,n){let r=j(e.state.model),s=qt(r),i=ve(e.options.models).map(j).filter((x)=>Boolean(qt(x))),a=e.state.pendingModelSwitch!=null;if(!n||a||e.modelSelection===s)e.modelSelection=void 0;let o=i.find((x)=>qt(x)===e.modelSelection),l=o??i.find((x)=>qt(x)===s);if(s&&!i.some((x)=>qt(x)===s))i.unshift(r);Pa(Pn,i.map((x)=>[qt(x),ub(x)]),qt(o??r),c("模型","Model")),Pn.disabled=t||a||!ve(e.options.models).length,Gn.hidden=!o,Gn.disabled=t||a;let u=a?c("正在切换模型。","Changing model…"):"",d;if(n&&!a&&l){let x=JSON.stringify([s,qt(l),e.state.thinkingLevel]);if(e.modelPreview?.key!==x&&!It.has(e.session.id)){let S={key:x,result:void 0};e.modelPreview=S;let E=new URLSearchParams({provider:C(l.provider),modelId:C(l.id)});ze.request(`${Xe(e.session.id)}/model-preview?${E}`).catch(()=>({})).then((D)=>{if(B!==e||e.modelPreview!==S)return;S.result=D,_e()})}let k=e.modelPreview?.key===x?e.modelPreview.result:void 0,A=C(k?.source),T=C(k?.level);if(k?.status==="ok"&&Object.hasOwn(e0,A)&&Object.hasOwn(tn,T)){d=k;let S=ve(d.availableLevels).map(C).filter((M)=>Object.hasOwn(tn,M)),E=o?c("切换后","After switching"):c("当前","Current"),D=S.map((M)=>tn[M]).join(c("、",", "));u=c(`${E}:${tn[T]}(来源:${e0[A]}) · 可用:${D}`,`${E}: ${tn[T]} (${e0[A]}) · Available: ${D}`)}else u=k?c("无法预览此模型的思考档。","Thinking preview is unavailable for this model."):c("正在读取模型档位…","Loading thinking levels…")}else if(e.modelPreview=void 0,n&&!a&&s&&!e.optionsError&&ve(e.options.models).length)u=c("此模型不在可用列表里。","The current model is not available.");if(En.textContent!==u)En.textContent=u;En.classList.toggle("sr-only",!o),En.hidden=!u,Pn.title=!o&&u?u:c("模型","Model"),Na.title=!o&&u?u:c("思考档","Thinking level");let f=o?void 0:d,p=C(f?.level??e.state.thinkingLevel),g=ve(f?.availableLevels??e.options.levels).map(C).filter((x)=>Object.hasOwn(tn,x)),b=g.length>0;if(Object.hasOwn(tn,p)&&!g.includes(p))g.unshift(p);Pa(Na,g.map((x)=>[x,c(`思考:${tn[x]}`,`Thinking: ${tn[x]}`)]),p,c("思考档","Thinking")),Na.disabled=t||a||Boolean(o)||!b}function wm(e,t){if(!t||t===qt(j(e.state.model)))return;e.modelSelection=void 0,e.modelPreview=void 0,e.options={...e.options,levels:[]},gr(e)}function wi(e,t){let n=ms.get(e);if(n===t)return;if(n?.removeAttribute("id"),t){let r=e.getAttribute("aria-controls");if(r)t.id=r;ms.set(e,t)}else ms.delete(e);e.hidden=!t,$a.hidden=U("active-session").hidden||!ms.size}function hb(e){let t=Q("sidebar-question"),n=0;for(let i of e.values())if(i.method==="question"&&++n===100)break;if(!n){if(t===document.activeElement)xe.querySelector('[aria-selected="true"]')?.focus();t.hidden=!0;return}let r=n===100?"99+":String(n),s=c(`Agent 提问 · ${r}`,`Agent questions · ${r}`);if(t.textContent!==s)t.textContent=s,t.setAttribute("aria-label",c(`跳至首个 Agent 提问(${n===100?"超过 99":r} 个待答)`,`Jump to first Agent question (${n===100?"over 99":r} pending)`));t.hidden=!1}function _e(){let e=at.active;if(U("cli-follow-view").hidden=!e,U("transcript").hidden=e,Q("cli-follow-stop").hidden=!e,Q("cli-follow-button").setAttribute("aria-pressed",String(e)),U("banner").hidden=!qa&&(e||!U("banner-text").textContent),e){if(B)B.consideredDesktopDock=!1;pi.reset(),$a.hidden=!0,U("composer-shell").hidden=!0,Q("details-button").hidden=!0,Q("web-branch-button").hidden=!0,Q("manage-button").hidden=!0,om(at.target?.name??c("跟随 CLI","Follow CLI"),at.target?.cwd??"");return}let t=B,n=t?.session,r=n&&Le.get(n.id),s=r?.status==="pending",i=r?.status==="released"?r:void 0,a=Boolean(t&&t.status==="ready"),o=a?t?.transcript??t?.history?.status:void 0;if(o)ur.dataset.status=o,U("transcript").setAttribute("aria-describedby",ur.id);else delete ur.dataset.status,U("transcript").removeAttribute("aria-describedby");if(U("no-messages").style.display=o?"none":"",se(ur,o==="truncated"?c("部分聊天记录未包含在快照中。","Some chat history was omitted from this snapshot."):o==="unavailable"?c("暂时无法读取聊天记录。新消息仍会显示在这里。","Chat history is unavailable. New messages will still appear here."):""),U("welcome").hidden=Boolean(t),U("inactive-session").hidden=!t||a,U("active-session").hidden=!a,$a.hidden=!a||!ms.size,!a){pi.reset();for(let N of Object.values(fs))wi(N)}if(U("composer-shell").hidden=!a,Ge.disabled=!a||n?.active!==!0,om(n?.name??c("会话工作台","Workbench"),n?.cwd??""),Q("details-button").hidden=!a,!a)yr(!1);if(Q("web-branch-button").hidden=!n,Q("web-branch-button").disabled=s,Q("manage-button").hidden=!a,!t)return;let l=Ue(t.session.id);if(Ke.open){let N=s?c("正在释放会话…","Releasing session…"):gm(t);Q("manage-handoff").disabled=Boolean(N),se(U("manage-handoff-status"),N),se(U("manage-handoff-error"),r?.status==="failed"?r.error:"")}for(let N of[Ke,xe])if(N.open)N.querySelectorAll("[data-write]").forEach((J)=>{J.disabled=tt!=="online"||s||It.has(t.session.id)||J.hasAttribute("data-unavailable")||J.hasAttribute("data-idle")&&(t.running||t.compacting||Jn.has(t.session.id))});Nt?.syncWrites();let u=t.status!=="inactive";U("inactive-title").textContent=t.status==="loading"?c("正在读取会话…","Loading session…"):t.status==="failed"?c("无法读取会话","Couldn't load session"):c("继续此会话","Continue this session");let d=Boolean(i&&t.status!=="loading");U("inactive-title").hidden=d,U("inactive-copy").hidden=d,U("inactive-copy").textContent=s?c("等本机引擎确认释放。","Waiting for the local engine to release the session."):t.status==="loading"?"":t.status==="failed"?c("检查连接后重试。","Check the connection and try again."):t.session.archived?c("恢复已归档的会话,继续之前的对话。","Restore this archived session to continue the conversation."):c("恢复后可继续之前的对话。","Resume to pick up where you left off."),U("handoff-receipt").hidden=!d;let f=U("handoff-command").firstElementChild;if(f&&f.textContent!==(i?.command??""))f.textContent=i?.command??"";se(U("handoff-copy-status"),i?.copyStatus),se(U("handoff-draft-note"),!a&&(i||s||r?.status==="uncertain")&&(l.text||l.commandText||l.images.length||l.reading)?c("草稿仍在这页。","Your draft is still on this page."):""),se(U("session-error"),t.error||(r?.status==="uncertain"&&t.status!=="loading"?r.error:""));let p=Q("resume");if(p.hidden=a||t.status==="loading",p.disabled=tt!=="online"||s||It.has(t.session.id),p.classList.toggle("button--primary",!i),p.textContent=!i&&r?.status!=="uncertain"&&u&&t.session.active?c("重试读取","Retry"):c("恢复会话","Resume session"),!a){t.modelSelection=void 0,t.modelPreview=void 0;return}let g=tt==="online",b=s||It.has(t.session.id),x=Jn.has(t.session.id),k=t.session.archived,A=g&&t.session.active&&!k&&!t.compacting,T=Hn.value,S=l.commandMode,E=S||vm(l.text),D=t.running&&(T==="prompt"||k||E);Q("stop").hidden=!t.running,Q("stop").disabled=!g||b,Q("stop").classList.toggle("button--primary",D),Q("stop").classList.toggle("button--danger",!D);let M=Q("send");M.hidden=E||t.running&&(T==="prompt"||k),M.disabled=!A||b||x||l.reading>0||!l.text.trim()&&!l.images.length;let L=T==="follow_up"?c("排队","Queue"):T==="steer"?c("发送引导","Steer"):c("发送","Send");U("send-label").textContent=M.title=L;let z=Q("send-command");z.hidden=!E;let O=S?l.commandText:l.text,P=Qf(O);z.disabled=!g||!t.session.active||b||k&&!P||!P&&(t.running||t.compacting||Boolean(t.queue)||x)||!O.trim(),Q("command-mode").setAttribute("aria-pressed",String(S)),Q("command-picker").hidden=!S,Q("command-picker").disabled=!g||k,U("prompt-label").textContent=S?c("命令及参数","Command and arguments"):c("消息","Message"),Ge.placeholder=S?c("输入 /命令 或 $技能,可加参数…","Enter a /command or $skill…"):c("输入消息…","Write a message…"),Q("attach").disabled=S||k||l.images.length+l.reading>=4||b,Q("attach").hidden=S,(Hn.closest("label")??Hn).hidden=S,Hn.disabled=k||b,db(t,!A||t.running||b||x,g&&u&&!s);let V=C(t.state.effectivePermissionPreset)||C(t.state.permissionPreset)||"ask";Pa(He("approval"),[...tm],tm.some(([N])=>N===V)?V:"ask",c("审批","Approval")),He("approval").dataset.preset=He("approval").value,He("approval").disabled=!A||b||x,He("approval").title=V==="full-access"?c("无审批:工具默认放行。原生权限规则仍有效,用户问题仍需回答。","Off: Tools are allowed by default. Native permission rules and user questions still apply."):V==="auto"?c("Auto:原生确认安全的项目内操作自动放行,其余询问。","Auto: OmO allows safe project operations and asks about the rest."):c("询问:未被原生权限规则处理的工具操作需要批准。恢复会话会回到此模式。","Ask: Approve tool calls not covered by native rules. Resuming a session returns to Ask.");let G=ds(t.state.contextUsage),ce=c("上下文","Context");se(U("context-usage"),G.status!=="ok"?"":G.percent!==void 0?`${ce} ${s0.format(G.percent)}%`:G.tokens!==void 0&&G.window?`${ce} ${s0.format(G.tokens)} / ${s0.format(G.window)}`:"");let re=Ta(t.state.usageTotals),de=re.status==="ok"&&re.latest!==void 0?eb.format(re.latest*100):"";se(U("cache-usage"),g&&de?c(`最新缓存 ${de}%`,`Latest cache ${de}%`):"");let F=s?c("正在换端,草稿不会发送。","Switching clients. Your draft won't be sent."):!g?c("离线时可以编辑,重连后再发送。","You can edit offline and send when reconnected."):k?c("先在会话管理里取消归档。","Unarchive this session in Manage session."):l.commandStatus||(E?!P&&(t.running||t.compacting||t.queue)?c("等本轮和队列结束后再执行命令。","Wait for this turn and queue to finish before running a command."):c("Ctrl / ⌘ + Enter 执行命令;开头加空格就按文字发送。","Ctrl / ⌘ + Enter runs the command. Add a leading space to send it as text."):t.compacting?c("等压缩完成后再发送。","Send after compaction finishes."):l.reading?c("正在读取图片…","Loading images…"):t.running&&T==="prompt"?c("停止本轮,或选引导或排队。","Stop this turn, or choose Steer or Queue."):!t.running&&T!=="prompt"?c("当前空闲,这条消息会在下一轮处理。","No turn is running. This message will be handled in the next turn."):c("Ctrl / ⌘ + Enter 发送","Ctrl / ⌘ + Enter to send"));U("composer-hint").textContent=F,U("composer-hint").classList.toggle("sr-only",!l.commandStatus&&g&&!s&&!k&&!l.reading&&!t.compacting&&!E&&(T==="prompt"||t.running));let K=[t.requests.size?c(`待答 ${t.requests.size}`,`Pending ${t.requests.size}`):"",t.running?c("生成中","Generating"):"",t.compacting?c("压缩中","Compacting"):"",t.queue?c(`排队 ${t.queue}`,`Queued ${t.queue}`):""].filter(Boolean).join(" · ");if(U("activity-row").hidden=!K,U("activity-row").dataset.pending=String(t.requests.size>0),U("activity").textContent!==K)U("activity").textContent=K;let Y=Q("current-todo"),ee=t.workbench,ie=ee?.status==="ok"?C(ee.currentTodo):"",H=ee?.status==="ok"?we(ee.pendingTodo):void 0,q=c("待办","Todo"),W=ie?`${q} · ${ie}`:H?`${q} ${H}`:"";Y.hidden=!g||!W;let le=U("current-todo-label");if(le.textContent!==W)le.textContent=W;Y.title=ie&&H?c(`${W};另有 ${H} 项待处理`,`${W} · ${H} more pending`):W,se(U("compose-error"),(S?l.commandError:l.error)||t.optionsError||(!Ke.open&&r?.status==="failed"?r.error:"")),xi.render(t.requests,g&&!s,(N,J)=>bb(t,N,J)),hb(t.requests),wi(fs.request,xi.first),pi.render(t.options.commands,g&&!k&&!s),Rm(t)}function om(e,t){let n=U("session-title");if(n.textContent!==e)n.textContent=e;n.title=e;let r=U("session-path");if(se(r,t),r.title=t,se(U("session-path-short"),t?Si(t):""),Q("session-path-trigger").hidden=!t,at.active&&t)r.dataset.workspaceLabel=Si(t);else delete r.dataset.workspaceLabel}function fb(e){let t=new Map;for(let n of[...ve(e.pendingDialogs),...ve(e.pendingQuestions)]){let r=j(n);if(Bi(r))t.set(Rs(r),r)}return t}function ks(e,t=!1){if(e!==B||e.status!=="ready")return;za(e,t)}function za(e,t=!1,n){let r=e.history,s=r?.entries.length?[...r.entries,...e.messages]:e.messages;As.render(s,e.liveKey,e.tools,t,r?.render(),n,e.session.id)}function mb(e,t){let n=e.history;if(t&&n?.id===t.id&&!n.reloading)return;if(n?.invalidate(),e.history=void 0,!t)return;let{id:r,cwd:s}=e.session,i=()=>e===B&&e.history===o&&e.session.id===r&&e.session.cwd===s&&Jt(s)&&e.session.active&&!at.active&&(!Le.has(r)||Le.get(r)?.status==="failed"),a=()=>i()&&e.status==="ready"&&tt==="online"&&!at.active,o=new $l(t,ze,r,i,a,()=>e.messages,(l)=>{if(!i())return;_e(),za(e,!1,l)},()=>{if(!a()||o.reloading)return;o.reloading=!0,o.clearExpansion(),_e(),za(e),Ur(e).finally(()=>{if(o.reloading=!1,i())za(e)})});e.history=o}async function Ur(e,t=!1,n=!1){let r=Le.get(e.session.id),s=r?.status==="released"||r?.status==="uncertain";if(s&&(e.status!=="loading"||!It.has(e.session.id)))return;let i=++e.sync,{historyEpoch:a,session:o,transcriptRefresh:l,stateRefresh:u}=e,d=e.status==="ready"&&e.running&&Boolean(l||u),f=Promise.withResolvers();e.pendingSnapshot=f.promise;let p=e.revision,g=new Set(e.messages),{state:b,generationSpeed:x}=e,k=[];e.snapshotRequestChanges=k;let A=e.liveKey,T=new Set([...e.tools].filter(([,S])=>S.stage==="running").map(([S])=>S));try{let S=await ze.request(Xe(e.session.id));if(B!==e||i!==e.sync||Le.get(e.session.id)!==r)return;let E=ln(S.session),D=zl(S.page);if(D&&!E||E&&(E.id!==o.id||E.cwd!==o.cwd))throw new De(c("会话读取响应已失效。","The session read no longer matches this conversation."),409,"stale_session_read");if(e.historyEpoch!==a&&D)return;if(s&&!E?.active)throw Error(c("本机服务未确认已恢复此会话。","The local engine did not confirm the session resumed."));let M=E??e.session;if(s)Le.delete(M.id);Yn(M);let L=j(S.state),z=e.pendingStateUnknown?{...e.state,...L}:L;if(bt.online!==!1)if(S.generationSpeed===void 0&&e.generationSpeed===x)e.generationSpeed=void 0;else C0(e,S.generationSpeed);let O=qt(j(e.state.model));e.handoff=j(S.handoff);let P=n||!d&&(!e.transcriptRefresh||e.transcriptRefresh===l&&!e.running),V=Fl(S.transcript);if(P){if(e.transcript=V,mb(e,V==="unavailable"?void 0:D),e.transcriptRefresh===l)e.transcriptRefresh=void 0}let G=V==="unavailable"?[]:ve(S.messages).map(j),ce=p!==e.revision,re=new Map(e.messages.map((ee)=>[ee.key,ee.message])),de=new Set,F=G.filter((ee)=>Boolean(Qt(ee))).map((ee,ie)=>{let H=Dr(ee)||`snapshot:${ie}`,q=de.has(H)?`${H}:${ie}`:H;de.add(q);let W=re.get(q);return{key:q,message:W&&JSON.stringify(W)===JSON.stringify(ee)?W:ee}});if(P&&V==="unavailable")e.messages=e.messages.filter((ee)=>e.liveMessageKeys.has(ee.key));if(ce){if(P&&V!=="unavailable"){let ie=V==="truncated"||Boolean(l),H=e.messages.filter((W)=>e.liveMessageKeys.has(W.key)&&(!ie||!g.has(W)||e.running&&W.key===e.liveKey)),q=new Map(H.map((W)=>[W.key,W]));e.messages=[...F.map((W)=>q.get(W.key)??W),...H.filter((W)=>!de.has(W.key))]}if(e.state={...z,...Object.fromEntries(Object.entries(e.state).filter(([ie,H])=>H!==b[ie]))},!(M.running||z.isStreaming===!0)&&!e.running){if(e.liveKey="",P&&V!=="unavailable"&&A&&!de.has(A))e.messages=e.messages.filter((ie)=>ie.key!==A);for(let ie of T)if(e.tools.get(ie)?.stage==="running")e.tools.delete(ie)}}else{if(P&&V!=="unavailable")e.messages=F;if(e.state=z,!e.pendingStateUnknown||typeof L.isStreaming==="boolean"||M.running)e.running=M.running||z.isStreaming===!0;if(!e.pendingStateUnknown||typeof L.isCompacting==="boolean")e.compacting=z.isCompacting===!0;if(!e.pendingStateUnknown||we(L.pendingMessageCount)!==void 0)e.queue=we(z.pendingMessageCount);if(!e.running){e.liveKey="";for(let[ee,ie]of e.tools)if(ie.stage==="running")e.tools.delete(ee)}else if(P&&V!=="unavailable"&&e.liveKey&&!de.has(e.liveKey)){let ee=re.get(e.liveKey);if(ee)e.messages.push({key:e.liveKey,message:ee})}}e.liveMessageKeys=new Set(e.messages.flatMap((ee)=>e.liveMessageKeys.has(ee.key)?[ee.key]:[]));let K=fb(L);if(e.pendingStateUnknown){let ee=Array.isArray(L.pendingDialogs),ie=Array.isArray(L.pendingQuestions);for(let[H,q]of e.requests)if(!(q.method==="question"?ie:ee)&&!K.has(H))K.set(H,q);if(ee&&ie&&e.stateRefresh===u)e.pendingStateUnknown=void 0}if(e.stateRefresh===u)e.stateRefresh=void 0;if(!P&&!e.running&&e.transcriptRefresh)ft(e);for(let ee of k)xm(K,ee);e.requests=K,wm(e,O);let Y=e.status!=="ready";if(e.status="ready",e.error="",_e(),ks(e,t),mi(e),Y||!e.workbench)Ua(e);return i}catch(S){if(B!==e||i!==e.sync||Le.get(e.session.id)!==r)return;if(Le.get(e.session.id)?.status==="pending")return;if(n)throw S;if(e.status!=="ready"||!e.session.active)e.status="failed",e.error=Ee(S);else Ue(e.session.id).error=c(`无法刷新会话:${Ee(S)}`,`Couldn't refresh the session: ${Ee(S)}`);_e()}finally{if(e.pendingSnapshot===f.promise)e.pendingSnapshot=void 0;if(f.resolve(),e.snapshotRequestChanges===k)e.snapshotRequestChanges=void 0;if(e===B&&!e.pendingSnapshot&&e.refreshScheduled)e.refreshScheduled=void 0,ft(e)}}async function Ua(e){if(e!==B||e.status!=="ready"||!e.session.active||e.session.archived||tt!=="online"||at.active||Le.get(e.session.id)?.status==="pending")return;kn?.abort();let t=kn=new AbortController,n=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);try{let r=await ze.request(`${Xe(e.session.id)}/workbench-status`,void 0,n);if(t.signal.aborted||kn!==t||e!==B||e.status!=="ready")return;e.workbench=r}catch(r){if(!(r instanceof Error))throw r;if(t.signal.aborted||kn!==t||e!==B)return;e.workbench={status:"unavailable"}}finally{if(kn===t)kn=void 0}_e()}async function gr(e){let t=++e.optionSync;try{let n=await ze.request(`${Xe(e.session.id)}/options`);if(B!==e||t!==e.optionSync)return;e.options=n,e.optionsError=""}catch(n){if(B!==e||t!==e.optionSync)return;e.optionsError=c(`无法读取模型和运行选项:${Ee(n)}`,`Couldn't load models and settings: ${Ee(n)}`)}_e()}function km(){if(yn)return;let e=new EventSource("/api/events");yn=e,e.addEventListener("open",()=>{if(e!==yn)return;let t=jt==="lost";if(t)_t="transport";if(jt="open",Zn(),t)if(bt.online===!1)pr();else Kn(!0)}),e.addEventListener("error",()=>{if(e!==yn)return;if(jt!=="lost"&&B)Ja(B),B.liveMessageKeys.clear(),B.liveKey="",B.tools.clear();if(jt="lost",_t==="transport")Or++,mr?.();if(Zn(),e.readyState!==EventSource.CLOSED||vi)return;vi=window.setTimeout(()=>{if(vi=0,e!==yn)return;yn=void 0,km()},X5)}),e.addEventListener("omo",(t)=>{if(!(t instanceof MessageEvent)||typeof t.data!=="string"||e!==yn)return;try{let n=JSON.parse(t.data);gb(j(n))}catch(n){if(!(n instanceof SyntaxError))throw n;if(B?.session.active)ft(B)}})}function pb(e,t,n){let r=j(t.message),s=Qt(r);if(!s)return;if(s==="toolResult"&&r.toolName==="send_file"&&n!=="message_end")return;let i=e.messages[e.messages.length-1],a=Dr(r),o=s==="assistant"&&e.liveKey,l=n!=="message_start"&&o||a||"";if(!l&&n!=="message_start"&&i&&s===Qt(i.message))l=i.key;if(!l)l=`live:${++e.serial}`;let u=e.messages.findIndex((d)=>d.key===l);if(u<0)e.messages.push({key:l,message:r});else e.messages[u]={key:l,message:r};if(e.liveMessageKeys.add(l),s==="assistant"){if(e.liveKey=n==="message_end"?"":l,n!=="message_end")e.running=!0}}function ft(e){clearTimeout(c0),c0=window.setTimeout(()=>{if(B!==e||!e.session.active||jt!=="open"||_t==="transport"||Le.get(e.session.id)?.status==="pending")return;if(e.transcriptRefresh&&e.running&&!e.stateRefresh)return;if(e.pendingSnapshot){e.refreshScheduled=!0;return}Ur(e)},120)}function xm(e,t){if(t.type==="upsert"){e.set(Rs(t.request),t.request);return}for(let[n,r]of e){if(!t.ids.includes(n)&&!t.ids.includes(C(r.requestId)))continue;if(t.type==="resolve")e.delete(n);else if(r.method==="question")e.set(n,{...r,...t.timing})}}function Wa(e,t){xm(e.requests,t),e.snapshotRequestChanges?.push(t)}function i0(e,t){let n=j(t);if(Bi(n))Wa(e,{type:"upsert",request:n})}function C0(e,t){let n=ff(t);if(!n||e.generationSpeed&&e.generationSpeed.measuredAt>=n.measuredAt)return!1;return e.generationSpeed=n,!0}function mi(e){if(xe.open&&e.detailData)Cf(e.detailData,e.state,e.generationSpeed)}function gb(e){let t=C(e.type);if(t==="cli-live"){Cs.invalidate(C(e.id));return}if(t==="ready"||t==="engine"){if(t==="engine"){let r=j(e.engine);if(typeof r.online!=="boolean")return;if(_t!=="transport")_t=r.online&&bt.online===!1?"engine":!1;if(bt=r,!r.online&&_t==="transport")Or++,mr?.();if(!r.online&&B)Ja(B),B.liveMessageKeys.clear(),B.liveKey="",B.tools.clear(),B.generationSpeed=void 0,mi(B);if(Zn(),r.online)Kn(!0);else pr()}else if(_t==="transport"){if(bt.online===!1&&j(e.engine).online===!0)Kn(!0)}else if(_t)return;else if(B&&bt.online!==!1)Kn(!0);else pr();return}if(t==="sessions"){pr();return}let n=B;if(!n||e.sessionId!==n.session.id)return;if(n.status!=="ready"&&n.status!=="loading")return;if(t==="generation_speed"){if(C0(n,e.generationSpeed))mi(n);return}switch(n.revision++,t){case"transcript_refresh_required":if(n.transcriptRefresh={},!n.running)ft(n);return;case"state_refresh_required":n.stateRefresh={},n.pendingStateUnknown=!0,ft(n);return;case"agent_start":n.running=!0;break;case"turn_start":{let r=C(e.turnId);if(r)n.state={...n.state,currentTurnId:r};break}case"agent_end":if(e.willRetry===!0)break;n.liveKey="",ft(n);break;case"agent_settled":if(n.running=!1,n.liveKey="",n.state={...n.state,currentTurnId:void 0},ft(n),Ua(n),n.status==="ready"&&xe.open)Nt?.invalidate(),Fa(n);break;case"agent_idle":if(n.transcriptRefresh)n.running=!1,n.liveKey="";ft(n);break;case"message_start":case"message_update":case"message_end":pb(n,e,t);break;case"tool_execution_start":case"tool_execution_update":case"tool_execution_end":{let r=C(e.toolCallId);if(!r)break;let s=n.tools.get(r),i=j(e.result??e.partialResult);if(n.tools.set(r,{id:r,name:C(e.toolName)||s?.name||"",args:e.args??s?.args,output:i.content??s?.output,stage:e.isError===!0?"error":t==="tool_execution_end"?"done":"running"}),t==="tool_execution_end"&&e.isError!==!0&&/^(?:todo|todowrite)$/u.test(C(e.toolName)||s?.name||""))Ua(n);break}case"extension_ui_request":i0(n,e);break;case"ui_request_pending":i0(n,e.request);break;case"question_updated":{if(Bi(e))i0(n,e);else{let r=[C(e.id),C(e.requestId)].filter(Boolean),s=we(e.deadlineAtMs),i=we(e.remainingMs);if(!r.length||s===void 0&&i===void 0)return;Wa(n,{type:"timing",ids:r,timing:{...s===void 0?{}:{deadlineAtMs:s},...i===void 0?{}:{remainingMs:i}}})}break}case"question_resolved":case"ui_request_resolved":case"extension_ui_resolved":case"extension_ui_request_resolved":{let r=[e.id,e.requestId,e.uiRequestId].map(C).filter(Boolean);if(r.length)Wa(n,{type:"resolve",ids:r});ft(n);break}case"compaction_start":n.compacting=!0;break;case"compaction_end":if(n.compacting=!1,e.aborted!==!0&&C(e.errorMessage))Ue(n.session.id).error=C(e.errorMessage);if(e.aborted!==!0&&e.success!==!1&&!e.errorMessage&&!e.error)Ti(n);if(e.aborted!==!0&&!C(e.errorMessage)&&xe.open)Nt?.invalidate(),Fa(n);ft(n);break;case"queue_update":if(n.queue=ve(e.steering).length+ve(e.followUp).length,xe.open&&Pr())b0(n);else xs=!0;vr?.activate(!0);break;case"pending_input_update":if(ft(n),xe.open&&Pr())b0(n);else xs=!0;vr?.activate(!0);break;case"model_changed":case"service_tier_changed":{let r=qt(j(n.state.model));if(e.model)n.state={...n.state,model:e.model};if(typeof e.thinkingLevel==="string")n.state={...n.state,thinkingLevel:e.thinkingLevel};if(typeof e.fastMode==="boolean")n.state={...n.state,fastMode:e.fastMode};if(mi(n),!r||r===qt(j(n.state.model)))n.modelPreview=void 0,gr(n);else wm(n,r);ft(n);break}case"commands_changed":case"loaded_surfaces_changed":gr(n);break;case"auto_retry_start":n.running=!0;break;case"auto_retry_end":ft(n);break;case"session_replaced":if(Ti(n),n.status="loading",n.running=!1,n.compacting=!1,n.state={},n.requests.clear(),n.queue=void 0,kn?.abort(),n.workbench=void 0,n.generationSpeed=void 0,v0(),mi(n),xe.open)Nt?.invalidate(),Fa(n);ft(n);break;case"transcript_write_failed":case"extension_error":case"retry_fallback_exhausted":Ue(n.session.id).error=C(e.errorMessage)||C(e.error)||C(e.lastError)||c("本机引擎报告会话错误","The local engine reported a session error.");break;case"session_closed":case"session_parked":case"session_released":if(Le.get(n.session.id)?.status!=="pending")Ka(n);Yn({...n.session,active:!1,running:!1});break;default:return}_e(),ks(n)}async function Za(e,t){if(tt!=="online")throw Error(c("连接断开。重连后重试。","Offline. Reconnect and try again."));if(t.action!=="resume"&&(e!==B||e.status!=="ready"||!e.session.active||Le.get(e.session.id)?.status==="pending"))throw Error(c("恢复会话后再试。","Resume the session and try again."));try{let n=await ze.action(e.session.id,t),r=ln(n.session);if(r)Yn(r);return n}catch(n){if(n instanceof De&&(n.status===401||n.status===403))Kn(!0);throw n}}async function bb(e,t,n){let r=[t,C(e.requests.get(t)?.requestId)].filter(Boolean);if(await Za(e,{action:"answer",requestId:t,...n}),Wa(e,{type:"resolve",ids:r}),e===B)_e();ft(e)}function Ts(){let e=B,t=U("attachments"),n=e&&Ue(e.session.id);if(t.hidden=!n?.images.length||n.commandMode,t.replaceChildren(),!n)return;for(let r of n.images){let s=y("div","attachment"),i=y("img");i.alt=r.name,i.src=r.url;let a=We(c("移除","Remove"),()=>{n.images=n.images.filter((o)=>o!==r),Ts(),_e(),(t.querySelector("button")??Q("attach")).focus()},"button--quiet");a.setAttribute("aria-label",c(`移除图片:${r.name}`,`Remove image: ${r.name}`)),s.append(i,a),t.append(s)}}async function lm(e){let t=B;if(!t||t.status!=="ready"||t.session.archived||Ue(t.session.id).commandMode)return;let n=Ue(t.session.id),r=[],s=[];for(let a of e){let o=a.type;if(!Li(o)){r.push(c(`不支持图片格式:${a.name}`,`Unsupported image format: ${a.name}`));continue}if(!a.size||a.size>2100000){r.push(c(`图片为空或超过 2.1 MB:${a.name}`,`Image is empty or larger than 2.1 MB: ${a.name}`));continue}if(n.images.length+n.reading>=4){r.push(c("最多可添加 4 张图片。","You can attach up to 4 images."));break}n.reading++,s.push(new Promise((l,u)=>{let d=new FileReader;d.addEventListener("error",()=>u(Error(c(`无法读取图片:${a.name}`,`Couldn't read image: ${a.name}`))),{once:!0}),d.addEventListener("load",()=>{let f=typeof d.result==="string"?d.result:"",p=f.slice(f.indexOf(",")+1);if(!p||!f.startsWith(`data:${o};base64,`)){u(Error(c(`图片编码无效:${a.name}`,`Invalid image data: ${a.name}`)));return}l({type:"image",mimeType:o,data:p,name:a.name||c("粘贴的图片","Pasted image"),url:f})},{once:!0}),d.readAsDataURL(a)}))}if(t===B)_e();let i=await Promise.allSettled(s);n.reading-=s.length;for(let a of i)if(a.status==="fulfilled")n.images=[...n.images,a.value];else r.push(Ee(a.reason));if(n.error=[...new Set(r)].join(" "),t===B)Ts(),_e()}async function vb(){let e=B;if(!e||Q("send").disabled||Q("send").hidden)return;let t=e.session.id,n=Ue(t),{text:r,mode:s,images:i}=n,a=s==="prompt"?"":C(e.state.currentTurnId),o=n.admission,l=o&&o.text===r&&o.mode===s&&o.turn===a&&o.imageList===i?o.id:crypto.randomUUID();n.admission={id:l,text:r,mode:s,turn:a,imageList:i},n.error="",Jn.add(t),_e();try{if(await Za(e,{action:"prompt",message:r,mode:s,clientMessageId:l,...a?{expectedTurnId:a}:{},...i.length?{images:i.map(({type:u,mimeType:d,data:f})=>({type:u,mimeType:d,data:f}))}:{}}),n.admission=void 0,n.text===r){if(n.text="",e===B&&!n.commandMode)Ge.value=""}if(n.images=n.images.filter((u)=>!i.includes(u)),e===B)Ts();ft(e)}catch(u){if(n.error=c(`未能发送:${Ee(u)}`,`Couldn't send: ${Ee(u)}`),u instanceof De&&u.status>=400&&u.status<500)n.admission=void 0;ft(e)}finally{if(Jn.delete(t),e===B)_e()}}async function yb(e){if(Q("send-command").disabled||Q("send-command").hidden)return;let t=e.session.id,n=Ue(t),r=n.commandMode?"commandText":"text",s=n.commandMode?"commandError":"error",i=n[r],a=(p)=>{n[s]=p},o=()=>{if(n[r]!==i)return;if(n[r]="",B?.session.id===t&&n.commandMode===(r==="commandText"))Ge.value=""};n.commandStatus=void 0;let l=hs(i);if(l.kind==="malformed"||l.kind==="tui-only"){a(l.kind==="malformed"?l.message:c(`“/${l.name}”请在本机 OmO 终端重新发起。Web 没有转交输入,也没有发送给模型。`,`Run /${l.name} in the local OmO terminal. The Web app did not forward your input or send it to the model.`)),_e();return}if(l.kind==="builtin"){a("");try{if(await wb(e,l.command,a))o()}catch(p){a(c(`命令失败:${Ee(p)}`,`Command failed: ${Ee(p)}`))}if(B?.session.id===t)_e();return}let[,u,d]=/^(\S+)(?:[ \t]+([^\r\n]*))?$/.exec(i)??[];if(!u||!Nr.test(u)||/[\r\n]/.test(i)){a(c("请输入单行 /命令 或 $技能,可附加参数。","Enter a /command or $skill on one line. Arguments are optional.")),_e();return}let f=n.commandAdmission?.text===i?n.commandAdmission.id:crypto.randomUUID();n.commandAdmission={text:i,id:f},a(""),Jn.add(t),_e();try{await Za(e,{action:"command",invocation:u,...d?{arguments:d}:{},clientMessageId:f}),n.commandAdmission=void 0,o()}catch(p){if(p instanceof De&&p.status>=400&&p.status<500)n.commandAdmission=void 0;let g=p instanceof De?p.code:"",b=g==="unknown_command"?c("未知命令","Unknown command"):g==="session_busy"||g==="bridge_busy"?c("会话忙","Session is busy"):g==="invalid_arguments"||g==="invalid_request"?c("命令输入无效","Invalid command input"):c("原生命令失败","Native command failed");a(c(`${b}:${Ee(p)}`,`${b}: ${Ee(p)}`))}finally{if(Jn.delete(t),B?.session.id===t)_e(),ft(B)}}async function wb(e,t,n){let r=e.session.id,s=(i,a)=>rn(e,i,a,n);switch(t.name){case"new":return d0(),vs.open;case"resume":case"sessions":return Q("cli-history-button").click(),An("cli-history-dialog").open;case"name":case"rename":if(t.value!==void 0)return s({action:"rename",name:t.value},c("重命名","Rename"));return Q("manage-button").click(),Ke.querySelector('[data-key="name"]')?.focus(),Ke.open;case"session":return Br(),xe.open;case"settings":case"setting":return Q("manage-button").click(),Ke.querySelector('[data-key="run-settings"]')?.focus(),Ke.open;case"tree":return Br("overview",Ge,"tree"),xe.open;case"todo":return Br("todo",Ge,"todo"),xe.open;case"tasks":return Br("subagents",Ge),xe.open;case"dag":return Br("dag",Ge),xe.open;case"help":case"hotkeys":return await _m(e,!0),Ht.open;case"reasoning":case"efforts":{let i=j(e.state.model),a=C(e.state.thinkingLevel);if(!qt(i))return n(c("没有已确认的模型。","No model is selected yet.")),!1;if(!a||!Object.hasOwn(tn,a))return n(c("当前思考档未知。","The current thinking level is unknown.")),!1;if(t.name==="reasoning")return Ue(r).commandStatus=a==="off"?c("当前模型推理:关闭。","Model reasoning: off."):c(`当前模型推理:开启(${a})。`,`Model reasoning: on (${a}).`),!0;let o=ve(e.options.levels).map(C).filter((u)=>Object.hasOwn(tn,u)),l=o.filter((u)=>u!=="off");if(!o.length)return n(c("暂时无法读取可用思考档。","Thinking levels are unavailable.")),!1;if(i.reasoning===!1||!l.length)return n(c("当前模型不支持推理。","This model does not support reasoning.")),!1;if(o.includes("off")&&l.length===1)return n(c("此模型只能开启或关闭推理。","This model can only turn reasoning on or off.")),!1;return Ue(r).commandStatus=c(`当前档位:${a}。可用推理档:${l.join("、")}。`,`Thinking: ${a}. Available levels: ${l.join(", ")}.`),!0}case"fork":return Q("web-branch-button").click(),An("branch-dialog").open;case"compact":{let i=await s({action:"compact",...t.instructions?{instructions:t.instructions}:{}},c("压缩上下文","Compact context"));if(i)Ue(r).commandStatus=c("上下文已压缩。","Context compaction completed.");return i}case"model":{if(!t.reference){if(g0()&&!He("model").disabled)jn(!0);if(He("model").focus(),document.activeElement===He("model")){try{He("model").showPicker?.()}catch(a){if(!(a instanceof DOMException))throw a}return!0}return n(c("没有可选模型。","No models available.")),!1}let i=ve(e.options.models).map(j).filter((a)=>[C(a.id),`${C(a.provider)}/${C(a.id)}`].includes(t.reference??""));if(i.length===1)return s({action:"model",provider:C(i[0].provider),modelId:C(i[0].id)},c("切换模型","Change model"));return n(i.length?c("多个模型同名,请用 provider/model。","Multiple models have that name. Use provider/model."):c("找不到此模型。用 /model 查看列表。","Model not found. Use /model to list available models.")),!1}case"thinking":{if(!t.level){if(g0()&&!He("thinking").disabled)jn(!0);if(He("thinking").focus(),document.activeElement===He("thinking")){try{He("thinking").showPicker?.()}catch(i){if(!(i instanceof DOMException))throw i}return!0}return n(c("没有可选思考档。","No thinking levels available.")),!1}if(!ve(e.options.levels).includes(t.level))return n(c("此模型不支持这个思考档。","This model does not support that thinking level.")),!1;return s({action:"thinking",level:t.level},c("切换思考档","Change thinking level"))}case"fast":if(typeof e.state.fastMode!=="boolean")return n(c("此模型没有快速模式。","Fast mode is unavailable for this model.")),!1;return s({action:"fast",enabled:t.mode?t.mode==="on":!e.state.fastMode},c("切换快速模式","Change fast mode"));case"clone":case"copy":It.add(r),_e();try{if(t.name==="copy"){let{text:o}=await ze.request(`${Xe(r)}/last-assistant`);if(typeof o!=="string"||!o)return n(c("没有可复制的助手消息。","No assistant message to copy.")),!1;if(!navigator.clipboard)return n(c("浏览器无法访问剪贴板。","The browser can't access the clipboard.")),!1;return await navigator.clipboard.writeText(o),Ue(r).commandStatus=c("已复制上一条助手消息。","Copied the last assistant message."),!0}let i=await ze.request(`${Xe(r)}/branches`,{kind:"clone"});if(i.cancelled===!0)return n(c("原生引擎取消了复制。","OmO cancelled the clone.")),!1;let a=ln(i.session);if(!a)throw Error(c("本机服务没有返回新会话。","The local service did not return a new session."));if(e===B)bm(a,"",{kind:"web",id:r,name:e.session.name});else Yn(a);return!0}finally{It.delete(r)}}}function cm(){if(!B||B.status!=="ready"||!B.session.active||Le.get(B.session.id)?.status==="pending")return;let e=Ue(B.session.id);if(e.commandMode||vm(e.text))yb(B);else vb()}async function rn(e,t,n,r,s){let i=e.session.id;if(It.has(i)||Le.get(i)?.status==="pending")return!1;It.add(i),r(""),_e(),Ke.setAttribute("aria-busy","true"),xe.setAttribute("aria-busy","true");try{let a=await Za(e,t);if(e!==B)return!0;if(s?.(a),t.action==="navigate"){if(j(a.result).cancelled===!0)return!1;Nt?.invalidate(),Ti(e),kn?.abort(),e.workbench=void 0;let o=C(j(a.result).editorText);if(o){let l=Ue(i);if(l.text=o,!l.commandMode)Ge.value=o}}if(t.action==="resume")e.status="loading";if(t.action==="model"||t.action==="thinking")e.modelPreview=void 0;if(await Ur(e,t.action==="resume"||t.action==="navigate"),e!==B)return!0;if(t.action==="resume")gr(e);if(Ke.open)Em(e);if(xe.open&&t.action!=="abort")Fa(e);return!0}catch(a){if(e===B)r(c(`${n}失败:${Ee(a)}`,`${n} failed: ${Ee(a)}`),a);return!1}finally{if(It.delete(i),Ke.removeAttribute("aria-busy"),xe.removeAttribute("aria-busy"),e===B)_e()}}function d0(){if(tt!=="online"||!vt.length||vs.open)return;at.stop();let e=He("new-cwd");e.replaceChildren(...vt.map((n)=>pt(n,n))),e.value=Fr||B?.session.cwd||vt[0]||"";let t=vt.length>1;if(U("new-cwd-field").hidden=!t,U("new-cwd-fixed").hidden=t,U("new-cwd-path").textContent=e.value,Lt("new-name").value="",se(U("new-error")),vs.showModal(),!t)Lt("new-name").focus()}async function kb(){if(yi||tt!=="online")return;let e=He("new-cwd").value;if(!vt.includes(e))return;let t=Lt("new-name").value.trim();if(t.length>120){se(U("new-error"),c("会话名称不能超过 120 个字符。","Keep the session name to 120 characters or fewer."));return}yi=!0,Q("create").disabled=!0,se(U("new-error"));try{let n=await ze.request("/api/sessions",{cwd:e,...t?{name:t}:{}}),r=ln(n.session);if(!r)throw Error(c("本机服务没有返回会话。","The local service did not return a session."));if(Fr="",Yn(r),!at.active){if(on=r.archived,vs.open)vs.close();Mi(r.id)}}catch(n){if(se(U("new-error"),c(`创建失败:${Ee(n)}`,`Couldn't create session: ${Ee(n)}`)),n instanceof De&&(n.status===401||n.status===403))Kn(!0)}finally{yi=!1,Zn()}}async function xb(e){let t=e.session.id;if(e!==B||!Ke.open||Le.get(t)?.status==="pending"||gm(e))return;let n={status:"pending"};Le.set(t,n),e.history?.invalidate(),_e(),ks(e),U("manage-handoff-status").focus();let r=()=>B?.session.id===t?B:void 0,s=()=>Ke.open||document.activeElement===Q("manage-button")||U("composer-shell").contains(document.activeElement),i=(a,o)=>{let l=s();if(Ka(a),a.error="",Ke.open)Ke.close();if(_e(),l&&!document.querySelector("dialog:modal"))U(o).focus()};try{let{session:a,command:o}=await ze.handoff(t);if(Le.get(t)!==n)return;Le.set(t,{status:"released",command:o}),Yn(a),_s(!0);let l=r();if(l)i(l,"handoff-title")}catch(a){if(Le.get(t)!==n)return;let o=!(a instanceof De)||a.status>=500||a.code==="session_not_open",l=c(`无法转到 CLI:${Ee(a)}`,`Couldn't switch to the CLI: ${Ee(a)}`),u=r();if(o||u&&!u.session.active){Le.set(t,{status:"uncertain",error:l});let d=u?.session??Hr.get(t);if(d)Yn({...d,active:!1,running:!1});if(u)i(u,"session-error");pr()}else if(Le.set(t,{status:"failed",error:l}),u){if(_e(),ks(u),Ke.open&&document.activeElement===U("manage-handoff-status"))U("manage-handoff-error").focus()}if(a instanceof De&&(a.status===401||a.status===403))Kn(!0)}}function Em(e){let t=U("manage-body"),n=document.activeElement,r=n instanceof HTMLElement&&t.contains(n)?n.dataset.key:void 0,s=e.session.id,i=(M)=>se(U("manage-error"),M),a=y("input");a.type="text",a.required=!0,a.maxLength=120,a.value=e.session.name,a.dataset.key="name";let o=y("form","stack stack--tight"),l=y("button","button",c("保存名称","Save name"));l.type="submit",l.dataset.write="",l.dataset.key="save";let u=y("div","row");u.append(l),o.append(Xn(c("会话名称","Session name"),a),u),o.addEventListener("submit",(M)=>{M.preventDefault();let L=a.value.trim();if(!L){i(c("请输入会话名称。","Enter a session name."));return}if(L!==e.session.name)rn(e,{action:"rename",name:L},c("重命名","Rename"),i)});let d=(M,L,z,O=!1)=>{let P=We(M,()=>void rn(e,z,M,i));return P.dataset.key=L,P.dataset.write="",P.disabled=O||tt!=="online",P},f=y("section","subpanel stack stack--tight"),p=y("div","row");p.append(d(e.session.archived?c("取消归档","Unarchive"):c("归档","Archive"),"archive",{action:"archive",enabled:!e.session.archived}),d(e.session.settled?c("重新标为未结清","Mark as open"):c("标为已结清","Mark as done"),"settle",{action:"settle",enabled:!e.session.settled})),f.append(y("h3","",c("会话状态","Session status")),y("p","small muted",e.session.archived?c("已归档","Archived"):c("未归档","Not archived")),p);let g=y("section","subpanel stack stack--tight"),b=y("div","row"),x=e.state.fastMode,k=e.state.autoCompactionEnabled;if(typeof x==="boolean")b.append(d(x?c("关闭快速模式","Turn off fast mode"):c("开启快速模式","Turn on fast mode"),"fast",{action:"fast",enabled:!x}));if(typeof k==="boolean")b.append(d(k?c("关闭自动压缩","Turn off auto-compaction"):c("开启自动压缩","Turn on auto-compaction"),"auto",{action:"autoCompaction",enabled:!k}));let A=y("h3","",c("运行设置","Run settings"));if(A.dataset.key="run-settings",A.tabIndex=-1,g.append(A),b.childElementCount)g.append(b);let T=y("form","stack stack--tight"),S=y("input");S.type="text",S.maxLength=6000,S.dataset.key="instructions";let E=y("button","button",c("压缩上下文","Compact context"));E.type="submit",E.dataset.write="",E.dataset.idle="",E.dataset.key="compact",E.disabled=tt!=="online"||e.running||e.compacting;let D=y("div","row");if(D.append(E),T.append(Xn(c("压缩说明(选填)","Compaction instructions (optional)"),S),D),T.addEventListener("submit",(M)=>{if(M.preventDefault(),e.running||e.compacting||It.has(s)){i(c("等本轮结束后再压缩。","Wait for this turn to finish before compacting."));return}let L=S.value.trim();rn(e,{action:"compact",...L?{instructions:L}:{}},c("压缩上下文","Compact context"),i)}),g.append(T),l.disabled=tt!=="online",t.replaceChildren(o,f,g),r)[...t.querySelectorAll("[data-key]")].find((M)=>M.dataset.key===r)?.focus()}var fr,h0=[];function Am(e,t){if(e!==B)return;let n=Ue(e.session.id);n.commandMode=t,Ge.value=t?n.commandText:n.text,Ts(),_e(),Ge.focus()}function Cm(e,t){if(e!==B||!Nr.test(t))return;let n=Ue(e.session.id),[r=""]=n.commandText.split(/\s/,1),s=Nr.test(r)?n.commandText.slice(r.length):"";if(n.commandText=`${t}${s||" "}`,n.commandError="",Ht.open)Ht.close();if(xe.matches(":modal"))yr(!1);Am(e,!0),Ge.setSelectionRange(t.length+1,t.length+1)}function f0(e){let t=U("command-list"),n=document.activeElement,r=n instanceof HTMLButtonElement&&t.contains(n)?n.dataset.invocation:void 0,s,i=Lt("command-search").value.trim().toLocaleLowerCase(),a=h0.flatMap((o)=>{let l=C(o.invocation),u=C(o.description),d=C(o.source),f=d==="builtin"?c("内置命令","Built-in"):d==="skill"?c("技能","Skill"):d==="prompt"?c("提示模板","Prompt template"):c("扩展","Extension");if(!Nr.test(l)||!`${l} ${u} ${f} ${d}`.toLocaleLowerCase().includes(i))return[];let p=y("li","stack stack--tight"),g=We(l,()=>Cm(e,l),"button--quiet path");if(g.dataset.invocation=l,l===r)s=g;return g.setAttribute("aria-label",c(`插入命令:${l}`,`Insert command: ${l}`)),p.append(g,y("p","small muted break",[f,u].filter(Boolean).join(" · "))),[p]});t.replaceChildren(...a),t.hidden=!a.length,s?.focus({preventScroll:!0}),se(U("command-status"),a.length?"":i?c("没有匹配的命令。","No matching commands."):c("此会话没有可用命令。","This session has no listed commands."))}async function _m(e,t=!1){if(Ht.open||Q("command-picker").disabled)return;fr?.abort();let n=fr=new AbortController;h0=Da([]);let r=Lt("command-search"),s=ge("command-shortcuts",HTMLDetailsElement);if(s.open=t,r.value="",U("command-list").replaceChildren(),U("command-list").hidden=!0,se(U("command-error")),Ht.showModal(),f0(e),t)s.querySelector("summary")?.focus();let i=()=>!n.signal.aborted&&Ht.open&&e===B;try{let a=await ze.request(`${Xe(e.session.id)}/options`,void 0,n.signal);if(!i())return;h0=Da(a.commands),f0(e)}catch(a){if(!i())return;se(U("command-error"),c(`无法读取扩展命令:${Ee(a)}。内置命令仍可用。`,`Couldn't load extension commands: ${Ee(a)}. Built-in commands remain available.`))}finally{if(fr===n)fr=void 0}}var Un,sn,xn,br,an,Nt,vr,xs=!1,Ri,Wn,m0,ps,qn,Ya=!1,p0=()=>[...xe.querySelectorAll('[role="tab"]')],_0=()=>!U("runtime-capabilities").hidden,Pr=()=>!U("runtime-metrics").hidden,Di=()=>!U("runtime-todo").hidden,ja=()=>ge("runtime-memory-branch",HTMLDetailsElement),Es=()=>!U("runtime-subagent").hidden?"tasks":!U("runtime-dag").hidden?"dag":Di()&&ja().open?"memory":void 0;function Ga(){let e=Q("details-refresh");if(_0()&&qn)e.setAttribute("aria-disabled","true");else e.removeAttribute("aria-disabled")}function Tm(){qn?.abort(),qn=void 0,Ya=!1;let e=U("capabilities-status");e.textContent="",e.className="sr-only",U("capabilities-content").replaceChildren(),Ga()}function Eb(e){if(qn)return;let t=qn=new AbortController,n=()=>qn===t&&xe.open&&B===e,r=U("capabilities-status"),s=U("capabilities-content"),i=Vl();Ya=!0,s.replaceChildren(i),r.className="small muted",r.textContent=c("正在读取能力清单…","Loading capabilities…"),Ga();let a=AbortSignal.any([t.signal,AbortSignal.timeout(1e4)]);ze.request(`${Xe(e.session.id)}/capabilities`,void 0,a).then((o)=>{if(!n())return;s.replaceChildren(...Bf(o)),r.className="sr-only",r.textContent=c("能力清单已加载。","Capabilities loaded.")},(o)=>{if(!n())return;if(r.className="notice error small",o instanceof De&&o.status===404&&o.code==="not_found")r.textContent=c("此版本的 Web 服务不提供能力清单。","This Web server does not list capabilities.");else if(o instanceof De&&(o.code==="session_changed"||o.code==="session_not_open"||o.code==="session_not_found"))r.textContent=c("会话已断开。打开会话后重试。","Session disconnected. Open it and try again.");else r.textContent=c("无法读取能力清单。刷新重试。","Couldn't load capabilities. Refresh to try again.")}).finally(()=>{if(qn!==t)return;qn=void 0,Ga()})}function ki(e){if(e.getAttribute("aria-selected")==="true")return;for(let t of p0()){let n=t===e;t.setAttribute("aria-selected",String(n)),t.tabIndex=n?0:-1;let r=t.getAttribute("aria-controls");if(r)U(r).hidden=!n;if(r==="runtime-todo"&&!n)v0()}if(U("details-scroll").scrollTop=0,ps=void 0,xe.open&&B?.status==="ready")gs(B);Ga()}function Xa(){if(!ps)return;let e=ps==="todo"?"#runtime-todo [data-runtime-branch]":"#runtime-tree",t=xe.querySelector(`${e} details`);if(!t)return;ps=void 0,t.open=!0;let n=t.querySelector("summary");if(document.activeElement===Q(e==="#runtime-tree"?"runtime-open-overview":"runtime-open-todo"))n?.focus({preventScroll:!0}),n?.scrollIntoView({block:"start"})}function Br(e="overview",t=Q("details-button"),n){if(B?.status!=="ready")return;let r=Q(`runtime-open-${e}`);if(ki(r),m0=t,ps=n,!ws.matches&&!_i)_i=!0,x0(y0,"open");if(!xe.open)Sm(B);r.focus({preventScroll:!0}),Xa()}function Sm(e){se(U("details-error")),xs=!1;for(let s of xe.querySelectorAll('[role="tabpanel"]:not(#runtime-capabilities, #runtime-todo)'))s.replaceChildren();U("runtime-todo").querySelector("[data-runtime-branch]")?.remove(),U("runtime-memory-journal").replaceChildren(),U("runtime-memory-branch-content").replaceChildren(),ja().open=!1;let t=()=>B===e&&xe.open&&Pr();vr=Af(ze,Xe(e.session.id),()=>t()&&e.status==="ready",()=>e.session.active&&tt==="online"&&!It.has(e.session.id)&&Le.get(e.session.id)?.status!=="pending",()=>{if(window.confirm(c("清空所有尚未发送的排队输入?","Remove all unsent messages from the queue?")))rn(e,{action:"clearQueue"},c("清空队列","Clear queue"),(s)=>se(U("details-error"),s))});let n=()=>e.session.active&&tt==="online"&&!e.running&&!e.compacting&&!e.requests.size&&!(e.queue&&e.queue>0)&&!Jn.has(e.session.id)&&!It.has(e.session.id)&&Le.get(e.session.id)?.status!=="pending",r=Df(ze,Xe(e.session.id),t,n,(s,i)=>{let o=Ue(e.session.id).text.trim()?c("切换上下文位置?选中的消息可能替换当前草稿。","Switch context? The selected message may replace your draft."):c("切换上下文位置?原有分支仍会保留。","Switch context? Existing branches are kept."),l=(u,d)=>{if(Nt!==r)return;let f=jl(d);if(f)r.invalidate();se(U("details-error"),f?"":u)};if(window.confirm(o))rn(e,{action:"navigate",targetId:s,expectedLeafId:i},c("切换上下文","Switch context"),l,(d)=>{if(j(d.result).cancelled===!0)l(c("本次切换已取消。","Context switch cancelled."))})});if(Nt=r,U("runtime-metrics").append(Nt.root),ws.matches)xe.showModal();else xe.open=!0;Q("details-button").setAttribute("aria-expanded","true"),U("details-scroll").scrollTop=0,gs(e)}function Rm(e,t=!1){if(!e||e.status!=="ready"||at.active||e.consideredDesktopDock&&!t)return;if(e.consideredDesktopDock=!0,!_i||ws.matches||xe.open)return;ki(Q("runtime-open-overview")),Sm(e)}function yr(e=!0){if(!xe.open)return;if(xe.close(),Un?.abort(),Un=void 0,sn?.abort(),sn=void 0,xn?.abort(),xn=void 0,br?.abort(),br=void 0,an?.abort(),an=void 0,Nt?.abort(),Nt=void 0,vr?.deactivate(),vr=void 0,Ri=void 0,Wn=void 0,v0(),B)B.detailData=void 0;ps=void 0,Tm();let t=Q("details-button");t.setAttribute("aria-expanded","false");let n=m0??t;if(m0=void 0,e)(n.getClientRects().length?n:t.hidden?U("conversation"):t).focus({preventScroll:!0})}function La(){if(!xe.matches(":modal"))_i=!1,x0(y0,"closed");yr()}function a0(){let e=Q("details-button");if(ws.matches){if(e.setAttribute("aria-haspopup","dialog"),xe.open&&!xe.matches(":modal"))yr(xe.contains(document.activeElement));return}if(e.removeAttribute("aria-haspopup"),!xe.matches(":modal")||document.querySelector("dialog:modal:not(#details-dialog)"))return;let t=U("details-scroll"),n=t.scrollTop,r=document.activeElement;if(xe.close(),xe.open=!0,r instanceof HTMLElement&&xe.contains(r))r.focus({preventScroll:!0});t.scrollTop=n}function jn(e){dr.setAttribute("aria-expanded",String(e))}function g0(){return getComputedStyle(o0).getPropertyValue("--compact-options").trim()==="1"}function Ab(){let e=g0();if(e===o0.hasAttribute("data-compact"))return;let t=document.activeElement;if(!e)jn(!1);if(o0.toggleAttribute("data-compact",e),e&&bs.contains(t)&&dr.getAttribute("aria-expanded")!=="true")dr.focus({preventScroll:!0});else if(!e&&t===dr)(bs.querySelector("select:enabled:not([hidden] *)")??Ge).focus({preventScroll:!0})}function b0(e){Un?.abort();let t=Un=new AbortController,n=Nt?.root,r=vr,s=()=>!t.signal.aborted&&xe.open&&Pr()&&e===B,i=U("runtime-metrics"),a=(l)=>se(U("details-error"),l),o=!i.querySelector(".runtime-metrics")&&!i.querySelector(":scope > p")?y("p","muted",c("正在读取运行详情…","Loading run details…")):void 0;if(o)i.prepend(o);a(""),ze.request(`${Xe(e.session.id)}/details`,void 0,t.signal).then((l)=>{if(!s()||!n||!r)return;if(e.detailData=l,xs=!1,bt.online!==!1)C0(e,l.generationSpeed);r.update(we(j(l.state).pendingMessageCount)),_f(l,e.state,e.options,{insertCommand:(u)=>Cm(e,u)},n,r.root,e.generationSpeed),Xa()}).catch((l)=>{if(!s())return;i.querySelector(":scope > p")?.remove(),a(c(`无法读取运行详情:${Ee(l)}`,`Couldn't load run details: ${Ee(l)}`))}).finally(()=>{if(Un===t)Un=void 0})}function Cb(e){xn?.abort();let t=xn=new AbortController,n=()=>t===xn&&xe.open&&Di()&&B===e;if(!Ri)Wl({status:"loading"});let r=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);ze.request(`${Xe(e.session.id)}/branch-runtime`,void 0,r).catch(()=>({status:"unavailable",reason:"read_failed"})).then((s)=>{if(!n())return;if(Ri=s,s.status==="ok"&&(typeof s.leafId==="string"||s.leafId===null))Nt?.checkLeaf(s.leafId);Wl(s),Xa()}).finally(()=>{if(xn===t)xn=void 0})}function T0(e){let t=Es();if(!t||!Wn)return;if(t==="memory"){U("runtime-memory-journal").replaceChildren(Ff(Wn.memory));return}let n=Wn,r=Sa(n[t]),s=r?n.snapshot??"waiting":void 0;if(t==="tasks")U("runtime-subagent").replaceChildren(...Zl("tasks",n.tasks,s));else{let o=U("runtime-dag"),l=o.querySelector(".dag-run[open]")?.dataset.dagKey,u=document.activeElement?.closest(".dag-run")?.dataset.dagKey;br?.abort();let d=br=new AbortController;o.replaceChildren(...Zl("dag",n.dag,s,(f)=>{let p=AbortSignal.any([d.signal,AbortSignal.timeout(28000)]);return ze.request(`${Xe(e.session.id)}/native-runtime/dag/${f}`,void 0,p)}));for(let f of o.querySelectorAll(".dag-run")){if(f.dataset.dagKey===l)f.open=!0;if(u&&f.dataset.dagKey===u&&document.activeElement===document.body)f.querySelector("summary")?.focus({preventScroll:!0})}}if(!r||n.snapshot||an)return;let i=an=new AbortController,a=AbortSignal.any([i.signal,AbortSignal.timeout(8000)]);ze.request(`${Xe(e.session.id)}/activity`,void 0,a).catch(()=>({status:"unavailable"})).then((o)=>{if(an!==i||!xe.open||B!==e||Wn!==n)return;n.snapshot=o;let l=Es();if((l==="tasks"||l==="dag")&&Sa(n[l]))T0(e)}).finally(()=>{if(an===i)an=void 0})}function _b(e){sn?.abort(),an?.abort(),an=void 0;let t=sn=new AbortController,n=()=>sn===t&&xe.open&&B===e&&Boolean(Es()),r=Es();if(r==="dag")br?.abort(),br=void 0;let s=U(r==="memory"?"runtime-memory-journal":r==="dag"?"runtime-dag":"runtime-subagent");if(!s.childElementCount){let a=y("p","small muted",c("正在读取原生运行信息…","Loading native runtime…"));a.setAttribute("role","status"),s.append(a)}let i=AbortSignal.any([t.signal,AbortSignal.timeout(20000)]);ze.request(`${Xe(e.session.id)}/native-runtime`,void 0,i).catch((a)=>{let l={status:"unavailable",reason:a instanceof De&&a.status===404&&a.code==="not_found"?"web_unsupported":a instanceof De&&a.status>=400&&a.status<500?"read_refused":"read_failed"};return{tasks:l,dag:l,memory:l}}).then((a)=>{if(!n())return;Wn={tasks:j(a.tasks),dag:j(a.dag),memory:j(a.memory)},T0(e)}).finally(()=>{if(sn===t)sn=void 0})}function gs(e,t=!1){if(e!==B||e.status!=="ready"||!xe.open)return;if(Pr()){if(t||!Un&&(xs||!e.detailData))b0(e);Nt?.activate(),vr?.activate(t)}else Un?.abort(),Un=void 0,Nt?.abort(),vr?.deactivate();if(Di())if(t||!Ri&&!xn)Cb(e);else Xa();else xn?.abort(),xn=void 0;let n=Es();if(n){if(t||!Wn&&!sn)_b(e);else if(Wn&&!sn)T0(e)}else sn?.abort(),sn=void 0;if(n!=="dag")br?.abort(),br=void 0;if(!n||n==="memory")an?.abort(),an=void 0;if(_0()){if(t||!Ya)Eb(e)}else if(qn)Tm()}function Fa(e){if(!Pr())xs=!0;if(!Di())Ri=void 0;if(!Es())Wn=void 0;if(!_0())Ya=!1;gs(e,!0)}function Mm(e){at.stop(),nn(!1),pm.open(e)}function Tb(){let e=()=>{at.stop(),nn(!1),w0("cli-follow-button")};Q("cli-follow-button").addEventListener("click",()=>{if(at.active){e();return}nn(!1),yr(!1),jn(!1),at.start(),Q("cli-follow-stop").focus({preventScroll:!0})}),Q("cli-follow-stop").addEventListener("click",e),Q("cli-history-button").addEventListener("click",()=>Mm()),Q("cli-live-button").addEventListener("click",()=>{at.stop(),nn(!1),Cs.open()}),Q("web-branch-button").addEventListener("click",()=>{if(B&&Le.get(B.session.id)?.status!=="pending")k0({kind:"web",id:B.session.id,name:B.session.name})}),Q("open-navigation").addEventListener("click",()=>nn(!0)),Q("close-navigation").addEventListener("click",()=>nn(!1,!0)),Q("nav-scrim").addEventListener("click",()=>nn(!1,!0)),hr=im(rm)==="true",_i=im(y0)!=="closed",am(),Q("rail-toggle").addEventListener("click",()=>{hr=!hr,x0(rm,String(hr)),am()}),ys.addEventListener("change",()=>{let l=document.activeElement,u=wn||l===Q("open-navigation")||l===Q("rail-toggle")||U("navigation").contains(l);if(nn(!1),u&&!document.querySelector("dialog:modal"))Q(ys.matches?"open-navigation":"rail-toggle").focus({preventScroll:!0})}),a0(),ws.addEventListener("change",()=>{if(a0(),!ws.matches)Rm(B,!0)}),document.addEventListener("close",(l)=>{if(l.target!==xe)a0()},!0),new ResizeObserver(Ab).observe(Ia("composer"));let t=()=>dr.getAttribute("aria-expanded")==="true";dr.addEventListener("click",()=>jn(!t()));let n=(l)=>{if(t()&&l.target instanceof Node&&!dr.contains(l.target)&&!bs.contains(l.target))jn(!1)};document.addEventListener("click",n),document.addEventListener("focusin",n),document.addEventListener("keydown",(l)=>{if(l.key!=="Escape"||l.defaultPrevented||l.isComposing||document.querySelector("dialog:modal"))return;if(wn)nn(!1,!0);else if(t())jn(!1),dr.focus({preventScroll:!0});else if(xe.open)La()}),Lt("search").addEventListener("input",()=>{Vn(),$r()}),He("workspace-select").addEventListener("change",()=>ob(He("workspace-select").value)),Q("recent").addEventListener("click",()=>{on=!1,Vn(),$r()}),Q("archived").addEventListener("click",()=>{on=!0,Vn(),$r()}),document.addEventListener("visibilitychange",()=>{if(document.hidden)return;if(pr(),B)Ua(B);if(B&&xe.open)gs(B,!0)}),window.setInterval(()=>{if(!document.hidden&&tt==="online")_s(!0)},fm),Q("new-welcome").addEventListener("click",d0),Q("new-sidebar").addEventListener("click",d0),Ia("new-form").addEventListener("submit",(l)=>{l.preventDefault(),kb()});let r=An("session-path-dialog");for(let l of[vs,Ke,Ht,r])for(let u of l.querySelectorAll("[data-close]"))u.addEventListener("click",()=>l.close());Q("session-path-trigger").addEventListener("click",()=>{let l=U("session-path").textContent;if(!l||r.open)return;U("session-path-full").textContent=l,se(U("session-path-status")),r.showModal()}),Q("session-path-copy").addEventListener("click",async()=>{let l=U("session-path-full"),u=l.textContent;if(!u)return;let d=c("已复制路径。","Path copied.");try{await navigator.clipboard.writeText(u)}catch{d=c("剪贴板不可用。可选中路径手动复制。","Clipboard unavailable. Select and copy the path.")}if(r.open&&l.textContent===u)se(U("session-path-status"),d)}),Q("manage-button").addEventListener("click",()=>{if(!B||Ke.open)return;se(U("manage-error")),Em(B),Ke.showModal(),_e()}),Ke.addEventListener("close",_e),Q("manage-handoff").addEventListener("click",()=>{if(B)xb(B)}),Q("handoff-copy").addEventListener("click",async()=>{let l=B;if(!l)return;let u=Le.get(l.session.id);if(u?.status!=="released")return;try{await navigator.clipboard.writeText(u.command),u.copyStatus=c("已复制命令。","Command copied.")}catch{u.copyStatus=c("剪贴板不可用。可选中命令手动复制。","Clipboard unavailable. Select and copy the command.")}if(B?.session.id===l.session.id&&Le.get(l.session.id)===u)_e()}),Q("details-button").addEventListener("click",()=>{if(xe.open)La();else Br()}),Q("current-todo").addEventListener("click",()=>Br("todo",Q("current-todo"),"todo"));let s=U("runtime-memory-journal");s.classList.add("fold-body"),U("runtime-memory-branch-content").before(s),ja().addEventListener("toggle",()=>{if(B&&xe.open&&Di())gs(B)}),U("runtime-metrics").addEventListener("click",(l)=>{if(!(l.target instanceof Element)||!l.target.closest("#runtime-open-resources"))return;ki(Q("runtime-open-todo")),ja().open=!0;let u=U("runtime-resources-title");u.focus({preventScroll:!0}),u.scrollIntoView({block:"start"})});for(let l of p0())l.addEventListener("click",()=>ki(l));U("runtime-shortcuts").addEventListener("keydown",(l)=>{let u=p0(),d=u.findIndex((p)=>p===l.target);if(d<0)return;let f=l.key==="Home"?u[0]:l.key==="End"?u.at(-1):l.key==="ArrowLeft"?u[(d+u.length-1)%u.length]:l.key==="ArrowRight"?u[(d+1)%u.length]:void 0;if(!f)return;l.preventDefault(),ki(f),f.focus({preventScroll:!0})}),Q("details-refresh").addEventListener("click",()=>{if(!B||!xe.open)return;if(gs(B,!0),Pr())Nt?.refresh()}),xe.querySelector("[data-close]")?.addEventListener("click",La),xe.addEventListener("cancel",(l)=>{l.preventDefault(),La()}),Q("command-mode").addEventListener("click",()=>{if(B)Am(B,!Ue(B.session.id).commandMode)}),Q("command-picker").addEventListener("click",()=>{if(B)_m(B)}),Lf(Ht,Lt("command-search"),U("command-list")),Ht.addEventListener("close",()=>{if(!Ht.open)fr?.abort()}),Lt("command-search").addEventListener("input",()=>{if(B&&!fr&&U("command-error").hidden)f0(B)}),Q("retry").addEventListener("click",()=>{if(clearTimeout(vi),vi=0,yn?.close(),yn=void 0,B)Ja(B);if(jt=_t==="transport"?"lost":"waiting",_t!=="transport")_t=!1;zr="",Ai="",Zn(),Kn(!0)}),Q("resume").addEventListener("click",()=>{let l=B;if(!l||Q("resume").disabled)return;let u=Le.get(l.session.id),d=u?.status==="released"||u?.status==="uncertain";if(l.session.active&&!d){l.status="loading",l.error="",_e(),Ur(l,!0),gr(l);return}let f=U("conversation");f.focus(),rn(l,{action:"resume"},c("恢复会话","Resume session"),(p)=>{l.error=p,_e()}).then(()=>{if(l!==B||document.activeElement!==f||document.querySelector("dialog:modal"))return;if(l.status==="ready")Ge.focus();else if(!U("session-error").hidden)U("session-error").focus()})}),Ia("composer").addEventListener("submit",(l)=>{l.preventDefault(),cm()}),Ge.addEventListener("input",()=>{if(!B)return;let l=Ue(B.session.id);if(l.commandStatus=void 0,l.commandMode)l.commandText=Ge.value,l.commandError="";else l.text=Ge.value,l.error="";_e()}),Ge.addEventListener("keydown",(l)=>{if(pi.key(l))return;if(l.key==="Enter"&&!l.isComposing&&!pi.composing&&(l.ctrlKey||l.metaKey))l.preventDefault(),cm()}),Ge.addEventListener("focus",_e),Ge.maxLength=200000,Ge.addEventListener("paste",(l)=>{let u=[...l.clipboardData?.files??[]].filter((d)=>d.type.startsWith("image/"));if(u.length)lm(u)}),Q("attach").addEventListener("click",()=>Lt("files").click()),Lt("files").addEventListener("change",(l)=>{let u=l.currentTarget;if(u instanceof HTMLInputElement)lm([...u.files??[]]),u.value=""}),Hn.addEventListener("change",()=>{if(!B)return;Ue(B.session.id).mode=Hn.value==="steer"||Hn.value==="follow_up"?Hn.value:"prompt",_e()}),Q("stop").addEventListener("click",()=>{let l=B;if(l)rn(l,{action:"abort"},c("停止","Stop"),(u)=>{Ue(l.session.id).error=u,_e()})}),As.observeTrace(({user:l,assistant:u,tool:d})=>{wi(fs.user,l),wi(fs.assistant,u),wi(fs.tool,d)});let i=matchMedia("(prefers-reduced-motion: no-preference) and (forced-colors: none)"),a;i.addEventListener("change",()=>a?.cancel());let o=(l)=>{if(l.tagName!=="SUMMARY")l.tabIndex=-1;if(l.focus({preventScroll:!0}),l.scrollIntoView({block:"nearest",inline:"nearest"}),a?.cancel(),!i.matches)return;let u=l.animate([{backgroundColor:"var(--trace-arrival)"},{}],{duration:460,easing:"ease-out"});a=u,u.onfinish=u.oncancel=()=>{if(a===u)a=void 0}};for(let l of Object.values(fs))l.addEventListener("click",()=>{let u=ms.get(l);if(!$a.hidden&&u?.isConnected)o(u)});Q("sidebar-question").addEventListener("click",()=>{let l=xi.firstQuestion;if(!l?.isConnected)return;if(xe.matches(":modal"))yr(!1);o(l)}),Pn.addEventListener("change",()=>{let l=B;if(!l||Pn.disabled)return;l.modelSelection=Pn.value||void 0,_e()}),Gn.addEventListener("click",async()=>{let l=B,u=ve(l?.options.models).map(j).find((d)=>qt(d)===l?.modelSelection);if(!l||!u||Gn.disabled)return;if(await rn(l,{action:"model",provider:C(u.provider),modelId:C(u.id)},c("切换模型","Change model"),(d)=>{Ue(l.session.id).error=d,_e()}),B!==l)return;if(l.modelSelection=void 0,_e(),document.activeElement===document.body||document.activeElement===Gn)Pn.focus()}),He("thinking").addEventListener("change",()=>{let l=B,u=He("thinking").value;if(l&&u&&!He("thinking").disabled)rn(l,{action:"thinking",level:u},c("切换思考档","Change thinking level"),(d)=>{Ue(l.session.id).error=d,_e()});else _e()}),He("approval").addEventListener("change",()=>{let l=B,u=He("approval").value;if(!l||u!=="ask"&&u!=="auto"&&u!=="full-access"){_e();return}if(u==="full-access"&&!window.confirm(c("关闭此会话的审批?工具默认放行,包括删除文件或对外发送数据。原生权限规则仍有效,用户问题仍需回答。","Turn off approval for this session? Tools can delete files or send data without asking. Native rules and user questions still apply."))){_e();return}rn(l,{action:"preset",preset:u},c("切换审批模式","Change approval mode"),(d)=>{Ue(l.session.id).error=d,_e()})})}sb();ib();Tb();Kn();
|