MindMap/frontend/dist/assets/index-78cb04db.js

793 lines
601 KiB
JavaScript
Raw Normal View History

var Qd=Object.defineProperty;var eh=(t,e,r)=>e in t?Qd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Je=(t,e,r)=>(eh(t,typeof e!="symbol"?e+"":e,r),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();/**
* @vue/shared v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function _a(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const Ze={},$n=[],dr=()=>{},Kc=()=>!1,Vi=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),La=t=>t.startsWith("onUpdate:"),Et=Object.assign,za=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},th=Object.prototype.hasOwnProperty,Ve=(t,e)=>th.call(t,e),Ce=Array.isArray,Fn=t=>Wi(t)==="[object Map]",Yc=t=>Wi(t)==="[object Set]",Ie=t=>typeof t=="function",ft=t=>typeof t=="string",ln=t=>typeof t=="symbol",ot=t=>t!==null&&typeof t=="object",Xc=t=>(ot(t)||Ie(t))&&Ie(t.then)&&Ie(t.catch),Jc=Object.prototype.toString,Wi=t=>Jc.call(t),rh=t=>Wi(t).slice(8,-1),Zc=t=>Wi(t)==="[object Object]",$a=t=>ft(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,c0=_a(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gi=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},nh=/-(\w)/g,tn=Gi(t=>t.replace(nh,(e,r)=>r?r.toUpperCase():"")),ih=/\B([A-Z])/g,cn=Gi(t=>t.replace(ih,"-$1").toLowerCase()),Qc=Gi(t=>t.charAt(0).toUpperCase()+t.slice(1)),ws=Gi(t=>t?`on${Qc(t)}`:""),en=(t,e)=>!Object.is(t,e),ci=(t,...e)=>{for(let r=0;r<t.length;r++)t[r](...e)},eu=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:r})},Qs=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let Jo;const Ki=()=>Jo||(Jo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Un(t){if(Ce(t)){const e={};for(let r=0;r<t.length;r++){const n=t[r],i=ft(n)?lh(n):Un(n);if(i)for(const s in i)e[s]=i[s]}return e}else if(ft(t)||ot(t))return t}const sh=/;(?![^(]*\))/g,ah=/:([^]+)/,oh=/\/\*[^]*?\*\//g;function lh(t){const e={};return t.replace(oh,"").split(sh).forEach(r=>{if(r){const n=r.split(ah);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Vn(t){let e="";if(ft(t))e=t;else if(Ce(t))for(let r=0;r<t.length;r++){const n=Vn(t[r]);n&&(e+=n+" ")}else if(ot(t))for(const r in t)t[r]&&(e+=r+" ");return e.trim()}const ch="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",uh=_a(ch);function tu(t){return!!t||t===""}const ru=t=>!!(t&&t.__v_isRef===!0),Zt=t=>ft(t)?t:t==null?"":Ce(t)||ot(t)&&(t.toString===Jc||!Ie(t.toString))?ru(t)?Zt(t.value):JSON.stringify(t,nu,2):String(t),nu=(t,e)=>ru(e)?nu(t,e.value):Fn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[n,i],s)=>(r[xs(n,s)+" =>"]=i,r),{})}:Yc(e)?{[`Set(${e.size})`]:[...e.values()].map(r=>xs(r))}:ln(e)?xs(e):ot(e)&&!Ce(e)&&!Zc(e)?String(e):e,xs=(t,e="")=>{var r;return ln(t)?`Symbol(${(r=t.description)!=null?r:e})`:t};/**
* @vue/reactivity v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ht;class dh{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ht,!e&&Ht&&(this.index=(Ht.scopes||(Ht.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].pause();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].resume();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].resume()}}run(e){if(this._active){const r=Ht;try{return Ht=this,e()}finally{Ht=r}}}on(){++this._on===1&&(this.prevScope=Ht,Ht=this)}off(){this._on>0&&--this._on===0&&(Ht=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(this.effects.length=0,r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.cleanups.length=0,this.scopes){for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function hh(){return Ht}let et;const ks=new WeakSet;class iu{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ht&&Ht.active&&Ht.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ks.has(this)&&(ks.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||au(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Zo(this),ou(this);const e=et,r=hr;et=this,hr=!0;try{return this.fn()}finally{lu(this),et=e,hr=r,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Pa(e);this.deps=this.depsTail=void 0,Zo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ks.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ea(this)&&this.run()}get dirty(){return ea(this)}}let su=0,u0,d0;function au(t,e=!1){if(t.flags|=8,e){t.next=d0,d0=t;return}t.next=u0,u0=t}function Fa(){su++}function Ba(){if(--su>0)return;if(d0){let e=d0;for(d0=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;u0;){let e=u0;for(u0=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=r}}if(t)throw t}function ou(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function lu(t){let e,r=t.depsTail,n=r;for(;n;){const i=n.prevDep;n.version===-1?(n===r&&(r=i),Pa(n),fh(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}t.deps=e,t.depsTail=r}function ea(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(cu(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function cu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===y0)||(t.globalVersion=y0,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ea(t))))return;t.flags|=2;const e=t.dep,r=et,n=hr;et=t,hr=!0;try{ou(t);const i=t.fn(t._value);(e.version===0||en(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{et=r,hr=n,lu(t),t.flags&=-3}}function Pa(t,e=!1){const{dep:r,prevSub:n,nextSub:i}=t;if(n&&(n.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=n,t.nextSub=void 0),r.subs===t&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let s=r.computed.deps;s;s=s.nextDep)Pa(s,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function fh(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let hr=!0;const uu=[];function Br(){uu.push(hr),hr=!1}function Pr(){const t=uu.pop();hr=t===void 0?!0:t}function Zo(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=et;et=void 0;try{e()}finally{et=r}}}let y0=0;class ph{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=t
* @vue/runtime-core v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function C0(t,e,r,n){try{return n?t(...n):t()}catch(i){Xi(i,e,r)}}function Tr(t,e,r,n){if(Ie(t)){const i=C0(t,e,r,n);return i&&Xc(i)&&i.catch(s=>{Xi(s,e,r)}),i}if(Ce(t)){const i=[];for(let s=0;s<t.length;s++)i.push(Tr(t[s],e,r,n));return i}}function Xi(t,e,r,n=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Ze;if(e){let o=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${r}`;for(;o;){const u=o.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](t,l,c)===!1)return}o=o.parent}if(s){Br(),C0(s,null,10,[t,l,c]),Pr();return}}Hh(t,r,i,n,a)}function Hh(t,e,r,n=!0,i=!1){if(i)throw t;console.error(t)}const Ot=[];let br=-1;const Pn=[];let Xr=null,On=0;const wu=Promise.resolve();let Si=null;function _n(t){const e=Si||wu;return t?e.then(this?t.bind(this):t):e}function qh(t){let e=br+1,r=Ot.length;for(;e<r;){const n=e+r>>>1,i=Ot[n],s=x0(i);s<t||s===t&&i.flags&2?e=n+1:r=n}return e}function Wa(t){if(!(t.flags&1)){const e=x0(t),r=Ot[Ot.length-1];!r||!(t.flags&2)&&e>=x0(r)?Ot.push(t):Ot.splice(qh(e),0,t),t.flags|=1,xu()}}function xu(){Si||(Si=wu.then(Su))}function jh(t){Ce(t)?Pn.push(...t):Xr&&t.id===-1?Xr.splice(On+1,0,t):t.flags&1||(Pn.push(t),t.flags|=1),xu()}function el(t,e,r=br+1){for(;r<Ot.length;r++){const n=Ot[r];if(n&&n.flags&2){if(t&&n.id!==t.uid)continue;Ot.splice(r,1),r--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function ku(t){if(Pn.length){const e=[...new Set(Pn)].sort((r,n)=>x0(r)-x0(n));if(Pn.length=0,Xr){Xr.push(...e);return}for(Xr=e,On=0;On<Xr.length;On++){const r=Xr[On];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}Xr=null,On=0}}const x0=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Su(t){const e=dr;try{for(br=0;br<Ot.length;br++){const r=Ot[br];r&&!(r.flags&8)&&(r.flags&4&&(r.flags&=-2),C0(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2))}}finally{for(;br<Ot.length;br++){const r=Ot[br];r&&(r.flags&=-2)}br=-1,Ot.length=0,ku(),Si=null,(Ot.length||Pn.length)&&Su()}}let Qt=null,Tu=null;function Ti(t){const e=Qt;return Qt=t,Tu=t&&t.type.__scopeId||null,e}function Uh(t,e=Qt,r){if(!e||t._n)return t;const n=(...i)=>{n._d&&ll(-1);const s=Ti(e);let a;try{a=t(...i)}finally{Ti(s),n._d&&ll(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function Ai(t,e){if(Qt===null)return t;const r=es(Qt),n=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[s,a,o,l=Ze]=e[i];s&&(Ie(s)&&(s={mounted:s,updated:s}),s.deep&&_r(a),n.push({dir:s,instance:r,value:a,oldValue:void 0,arg:o,modifiers:l}))}return t}function fn(t,e,r,n){const i=t.dirs,s=e&&e.dirs;for(let a=0;a<i.length;a++){const o=i[a];s&&(o.oldValue=s[a].value);let l=o.dir[n];l&&(Br(),Tr(l,r,8,[t.el,o,t,e]),Pr())}}const Vh=Symbol("_vte"),Wh=t=>t.__isTeleport,Gh=Symbol("_leaveCb");function Ga(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Ga(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Au(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function h0(t,e,r,n,i=!1){if(Ce(t)){t.forEach((b,x)=>h0(b,e&&(Ce(e)?e[x]:e),r,n,i));return}if(f0(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&h0(t,e,r,n.component.subTree);return}const s=n.shapeFlag&4?es(n.component):n.el,a=i?null:s,{i:o,r:l}=t,c=e&&e.r,u=o.refs===Ze?o.refs={}:o.refs,f=o.setupState,p=Ue(f),g=f===Ze?Kc:b=>Ve(p,b);if(c!=null&&c!==l){if(ft(c))u[c]=null,g(c)&&(f[c]=null);else if(Nt(c)){c.value=null;const b=e;b.k&&(u[b.k]=null)}}if(Ie(l))C0(l,o,12,[a,u]);else{const b=ft(l),x=Nt(l);if(b||x){const w=()=>{if(t.f){const N=b?g(l)?f[l]:u[l]:l.value;if(i)Ce(N)&&za(N,s);else if(Ce(N))N.includes(s)||N.push(s);else if(b)u[l]=[s],g(l)&&(f[l]=u[l]);else{const y=[s];l.value=y,t.k&&(u[t.k]=y)}}else b?(u[l]=a,g(l)&&(f[l]=a)):x&&(l.value=a,t.k&&(u[t.k]=a))};a?(w.id=-1,Vt(w,r)):w()}}}Ki().requestIdleCallback;Ki().cancelIdleCallback;const f0=t=>!!t.type.__asyncLoader,Eu=t=>t.type.__isKeepAlive;function Kh(t,e){Cu(t,"a",e)}function Yh(t,e){Cu(t,"da",e)}function Cu(t,e,r=_t){const n=t.__wdc||(t.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.p
* @vue/runtime-dom v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let ca;const fl=typeof window<"u"&&window.trustedTypes;if(fl)try{ca=fl.createPolicy("vue",{createHTML:t=>t})}catch{}const Zu=ca?t=>ca.createHTML(t):t=>t,Jf="http://www.w3.org/2000/svg",Zf="http://www.w3.org/1998/Math/MathML",Rr=typeof document<"u"?document:null,pl=Rr&&Rr.createElement("template"),Qf={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?Rr.createElementNS(Jf,t):e==="mathml"?Rr.createElementNS(Zf,t):r?Rr.createElement(t,{is:r}):Rr.createElement(t);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>Rr.createTextNode(t),createComment:t=>Rr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,s){const a=r?r.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===s||!(i=i.nextSibling)););else{pl.innerHTML=Zu(n==="svg"?`<svg>${t}</svg>`:n==="mathml"?`<math>${t}</math>`:t);const o=pl.content;if(n==="svg"||n==="mathml"){const l=o.firstChild;for(;l.firstChild;)o.appendChild(l.firstChild);o.removeChild(l)}e.insertBefore(o,r)}return[a?a.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},ep=Symbol("_vtc");function tp(t,e,r){const n=t[ep];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const Mi=Symbol("_vod"),Qu=Symbol("_vsh"),rp={name:"show",beforeMount(t,{value:e},{transition:r}){t[Mi]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):t0(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e!=!r&&(n?e?(n.beforeEnter(t),t0(t,!0),n.enter(t)):n.leave(t,()=>{t0(t,!1)}):t0(t,e))},beforeUnmount(t,{value:e}){t0(t,e)}};function t0(t,e){t.style.display=e?t[Mi]:"none",t[Qu]=!e}const np=Symbol(""),ip=/(^|;)\s*display\s*:/;function sp(t,e,r){const n=t.style,i=ft(r);let s=!1;if(r&&!i){if(e)if(ft(e))for(const a of e.split(";")){const o=a.slice(0,a.indexOf(":")).trim();r[o]==null&&fi(n,o,"")}else for(const a in e)r[a]==null&&fi(n,a,"");for(const a in r)a==="display"&&(s=!0),fi(n,a,r[a])}else if(i){if(e!==r){const a=n[np];a&&(r+=";"+a),n.cssText=r,s=ip.test(r)}}else e&&t.removeAttribute("style");Mi in t&&(t[Mi]=s?n.display:"",t[Qu]&&(n.display="none"))}const ml=/\s*!important$/;function fi(t,e,r){if(Ce(r))r.forEach(n=>fi(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=ap(t,e);ml.test(r)?t.setProperty(cn(n),r.replace(ml,""),"important"):t[n]=r}}const gl=["Webkit","Moz","ms"],Ms={};function ap(t,e){const r=Ms[e];if(r)return r;let n=tn(e);if(n!=="filter"&&n in t)return Ms[e]=n;n=Qc(n);for(let i=0;i<gl.length;i++){const s=gl[i]+n;if(s in t)return Ms[e]=s}return e}const vl="http://www.w3.org/1999/xlink";function bl(t,e,r,n,i,s=uh(e)){n&&e.startsWith("xlink:")?r==null?t.removeAttributeNS(vl,e.slice(6,e.length)):t.setAttributeNS(vl,e,r):r==null||s&&!tu(r)?t.removeAttribute(e):t.setAttribute(e,s?"":ln(r)?String(r):r)}function yl(t,e,r,n,i){if(e==="innerHTML"||e==="textContent"){r!=null&&(t[e]=e==="innerHTML"?Zu(r):r);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const o=s==="OPTION"?t.getAttribute("value")||"":t.value,l=r==null?t.type==="checkbox"?"on":"":String(r);(o!==l||!("_value"in t))&&(t.value=l),r==null&&t.removeAttribute(e),t._value=r;return}let a=!1;if(r===""||r==null){const o=typeof t[e];o==="boolean"?r=tu(r):r==null&&o==="string"?(r="",a=!0):o==="number"&&(r=0,a=!0)}try{t[e]=r}catch{}a&&t.removeAttribute(i||e)}function Ln(t,e,r,n){t.addEventListener(e,r,n)}function op(t,e,r,n){t.removeEventListener(e,r,n)}const wl=Symbol("_vei");function lp(t,e,r,n,i=null){const s=t[wl]||(t[wl]={}),a=s[e];if(n&&a)a.value=n;else{const[o,l]=cp(e);if(n){const c=s[e]=hp(n,i);Ln(t,o,c,l)}else a&&(op(t,o,a,l),s[e]=void 0)}}const xl=/(?:Once|Passive|Capture)$/;function cp(t
color:${i.color};
padding:${i.padding};
margin:${i.margin};
font:${i.font};
background-color:${i.backgroundColor!=="rgba(0, 0, 0, 0)"&&i.backgroundColor};
border-radius:${i.borderRadius};`,this.direction===0&&(e.style.right="0"),r1(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",s=>{s.stopPropagation();const a=s.key;if(a==="Enter"||a==="Tab"){if(s.shiftKey)return;s.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{var s;if(!e)return;const a=((s=e.textContent)==null?void 0:s.trim())||"";a===""?r.topic=n:(r.topic=a,this.markdown?t.text.innerHTML=this.markdown(r.topic,r):t.text.textContent=a),e.remove(),rs.call(this,t,r),a!==n&&(this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:r,origin:n}))})},oo=function(t){const e=Gt.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},kn=document,rr="http://www.w3.org/2000/svg",ha=function(t,e,r,n={}){const{anchor:i="middle",color:s,dataType:a}=n,o=document.createElementNS(rr,"text");return rt(o,{"text-anchor":i,x:e+"",y:r+"",fill:s||(i==="middle"?"rgb(235, 95, 82)":"#666")}),a&&(o.dataset.type=a),o.innerHTML=t,o},n1=function(t,e,r){const n=kn.createElementNS(rr,"path");return rt(n,{d:t,stroke:e||"#666",fill:"none","stroke-width":r}),n},o0=function(t){const e=kn.createElementNS(rr,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Ml=function(){const t=kn.createElementNS(rr,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Vp=function(t,e,r,n){const i=kn.createElementNS(rr,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:r}].forEach((s,a)=>{const o=s.d,l=kn.createElementNS(rr,"path"),c={d:o,stroke:(n==null?void 0:n.stroke)||"rgb(235, 95, 82)",fill:"none","stroke-linecap":(n==null?void 0:n.strokeLinecap)||"cap","stroke-width":String((n==null?void 0:n.strokeWidth)||"2")};(n==null?void 0:n.opacity)!==void 0&&(c.opacity=String(n.opacity)),rt(l,c),a===0&&l.setAttribute("stroke-dasharray",(n==null?void 0:n.strokeDasharray)||"8,2");const u=kn.createElementNS(rr,"path");rt(u,{d:o,stroke:"transparent",fill:"none","stroke-width":"15"}),i.appendChild(u),i.appendChild(l),i[s.name]=l}),i},i1=function(t,e,r){if(!e)return;const n=kn.createElement("div");t.nodes.appendChild(n);const i=e.innerHTML;n.id="input-box",n.textContent=i,n.contentEditable="plaintext-only",n.spellcheck=!1;const s=e.getBBox();n.style.cssText=`
min-width:${Math.max(88,s.width)}px;
position:absolute;
left:${s.x}px;
top:${s.y}px;
padding: 2px 4px;
margin: -2px -4px;
`,r1(n),t.scrollIntoView(n),n.addEventListener("keydown",a=>{a.stopPropagation();const o=a.key;if(o==="Enter"||o==="Tab"){if(a.shiftKey)return;a.preventDefault(),n.blur(),t.container.focus()}}),n.addEventListener("blur",()=>{var a;if(!n)return;const o=((a=n.textContent)==null?void 0:a.trim())||"";o===""?r.label=i:r.label=o,n.remove(),o!==i&&(e.innerHTML=r.label,"parent"in r?t.bus.fire("operation",{name:"finishEditSummary",obj:r}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:r}))})},Wp=function(t){const e=this.map.querySelector("me-root"),r=e.offsetTop,n=e.offsetLeft,i=e.offsetWidth,s=e.offsetHeight,a=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let o=0;o<a.length;o++){const l=a[o],c=l.querySelector("me-tpc"),{offsetLeft:u,offsetTop:f}=N0(this.nodes,c),p=c.offsetWidth,g=c.offsetHeight,b=l.parentNode.className,x=this.generateMainBranch({pT:r,pL:n,pW:i,pH:s,cT:f,cL:u,cW:p,cH:g,direction:b,containerHeight:this.nodes.offsetHeight}),w=this.theme.palette,N=c.nodeObj.branchColor||w[o%w.length];if(c.style.borderColor=N,this.lines.appendChild(n1(x,N,"3")),t&&t!==l)continue;const y=o0("subLines"),k=l.lastChild;k.tagName==="svg"&&k.remove(),l.appendChild(y),s1(this,y,N,l,b,!0)}this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},s1=function(t,e,r,n,i,s){const a=n.firstChild,o=n.children[1].children;if(o.length===0)return;const l=a.offsetTop,c=a.offsetLeft,u=a.offsetWidth,f=a.offsetHeight;for(let p=0;p<o.length;p++){const g=o[p],b=g.firstChild,x=b.offsetTop,w=b.offsetLeft,N=b.offsetWidth,y=b.offsetHeight,k=b.firstChild.nodeObj.branchColor||r,I=t.generateSubBranch({pT:l,pL:c,pW:u,pH:f,cT:x,cL:w,cW:N,cH:y,direction:i,isFirst:s});e.appendChild(n1(I,k,"2"));const D=b.children[1];if(D){if(!D.expanded)continue}else continue;s1(t,e,k,g,i)}},Nl={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Il={cn:Nl,zh_CN:Nl,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",linkBidirectional:"雙向連接",clickTips:"請點擊目標節點",summary:"摘要"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",linkBidirectional:"Bidirectional Link",clickTips:"Please click the target node",summary:"Summary"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",linkBidirectional:"Двунаправленная ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",summary:"Описание"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",linkBidirectional:"双方向リンク",clickTips:"ターゲットノードをクリックしてください",summary:"概要"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",linkBidirectional:"Link bidirecional",clickTips:"Favor clicar no item alvo",summary:"Resumo"},it:{addChild:"Aggiungi figlio",addParent:"Aggiungi ge
.topic { font-family: Arial, sans-serif; font-size: 14px; color: #333; }
.markdown-content { font-size: 12px; line-height: 1.3; }
/* 表格样式 */
.markdown-table {
border-collapse: collapse;
width: 100%;
margin: 4px 0;
font-size: 11px;
border: 1px solid #e0e0e0;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
background-color: #fafafa;
overflow: hidden;
white-space: normal;
}
.markdown-table th,
.markdown-table td {
border: 1px solid #e0e0e0;
padding: 8px 12px;
text-align: left;
vertical-align: top;
position: relative;
white-space: normal;
}
.markdown-table th {
background-color: #f5f5f5;
font-weight: 600;
color: #333;
text-align: center;
border-bottom: 1px solid #d0d0d0;
}
.markdown-table td {
background-color: #fff;
}
.markdown-table tr:nth-child(even) td {
background-color: #f8f8f8;
}
.markdown-table tr:hover td {
background-color: #f0f8ff;
}
/* 移除多余的边框,保持简洁 */
.markdown-table th:not(:last-child),
.markdown-table td:not(:last-child) {
border-right: 1px solid #e0e0e0;
}
.markdown-table tr:not(:last-child) td {
border-bottom: 1px solid #e0e0e0;
}
`,s=await e.exportSvg(!0,i);if(!s)return;const a=URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=`${n}.${t}`,o.click(),URL.revokeObjectURL(a)}catch{alert(`导出${t.toUpperCase()}失败请重试`)}},cm={side:em,left:tm,right:rm,full:nm,living:im,zoomin:sm,zoomout:am,exportSvg:om},Zr=(t,e)=>{const r=document.createElement("span");return r.id=t,r.innerHTML=cm[e],r};function um(t){try{const e=document.createElement("div"),r=Zr("fullscreen","full"),n=Zr("toCenter","living"),i=Zr("zoomout","zoomout"),s=Zr("zoomin","zoomin"),a=Zr("exportSvg","exportSvg");a.title="导出SVG矢量图";const o=document.createElement("span");return o.innerText="100%",e.appendChild(r),e.appendChild(n),e.appendChild(i),e.appendChild(s),e.appendChild(a),e.className="mind-elixir-toolbar rb",r.onclick=()=>{document.fullscreenElement===t.el?(document.exitFullscreen(),setTimeout(()=>{t.el.focus()},100)):(t.el.requestFullscreen(),setTimeout(()=>{},100))},n.onclick=()=>{t.toCenter()},i.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},s.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},a.onclick=()=>{lm("svg")(t)},setTimeout(()=>{const l=document.getElementById("exportSvg")},1e3),e}catch{const e=document.createElement("div");return e.className="mind-elixir-toolbar rb",e}}function dm(t){const e=document.createElement("div"),r=Zr("tbltl","left"),n=Zr("tbltr","right"),i=Zr("tblts","side");return e.appendChild(r),e.appendChild(n),e.appendChild(i),e.className="mind-elixir-toolbar lt",r.onclick=()=>{t.initLeft()},n.onclick=()=>{t.initRight()},i.onclick=()=>{t.initSide()},e}function hm(t){try{if(!t.container)return;const e=um(t),r=dm(t);t.container.append(e),t.container.append(r)}catch{}}/*! @viselect/vanilla v3.9.0 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */class fm{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,r){const n=this._listeners.get(e)??new Set;return this._listeners.set(e,n),n.add(r),this}removeEventListener(e,r){var n;return(n=this._listeners.get(e))==null||n.delete(r),this}dispatchEvent(e,...r){let n=!0;for(const i of this._listeners.get(e)??[])n=i(...r)!==!1&&n;return n}unbindAllListeners(){this._listeners.clear()}}const Dl=(t,e="px")=>typeof t=="number"?t+e:t,Wr=({style:t},e,r)=>{if(typeof e=="object")for(const[n,i]of Object.entries(e))i!==void 0&&(t[n]=Dl(i));else r!==void 0&&(t[e]=Dl(r))},Ol=(t=0,e=0,r=0,n=0)=>{const i={x:t,y:e,width:r,height:n,top:e,left:t,right:t+r,bottom:e+n};return{...i,toJSON:()=>JSON.stringify(i)}},pm=t=>{let e,r=-1,n=!1;return{next:(...i)=>{e=i,n||(n=!0,r=requestAnimationFrame(()=>{t(...e),n=!1}))},cancel:()=>{cancelAnimationFrame(r),n=!1}}},_l=(t,e,r="touch")=>{switch(r){case"center":{const n=e.left+e.width/2,i=e.top+e.height/2;return n>=t.left&&n<=t.right&&i>=t.top&&i<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},mm=()=>matchMedia("(hover: none), (pointer: coarse)").matches,gm=()=>"safari"in window,ma=t=>Array.isArray(t)?t:[t],a1=t=>(e,r,n,i={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),r=ma(r),e=ma(e);for(const s of e)if(s)for(const a of r)s[t](a,n,{capture:!1,...i})},Gr=a1("addEventListener"),lr=a1("removeEventListener"),K0=t=>{var e;const{clientX:r,clientY:n,target:i}=((e=t.touches)==null?void 0:e[0])??t;return{x:r,y:n,target:i}},In=(t,e=document)=>ma(t).map(r=>typeof r=="string"?Array.from(e.querySelectorAll(r)):r instanceof Element?r:null).flat().filter(Boolean),vm=(t,e)=>e.some(r=>typeof r=="number"?t.button===r:typeof r=="object"?r.button!==t.button?!1:r.modifiers.every(n=>{switch(n){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:mn,max:Ll,min:zl,ceil:$l}=Math,Fl=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),o1=class extends fm{constructor(t){var e,r,n,i,s;super(),this._selection=Fl(),th
`),o=parseFloat(e.lineHeight)||parseFloat(e.fontSize)*1.2,l=parseFloat(e.fontSize),c=parseInt(e.paddingTop)||8,u=parseInt(e.paddingLeft)||8,f=t.offsetWidth||200,p=r+u,g=(a.length-1)*o+l+c+(parseInt(e.paddingBottom)||8),b=t.offsetHeight||100,x=Math.min(g,b),w=document.createElementNS(vt,"rect");return rt(w,{x:r+"",y:n+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:f+"px",height:x+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),i.appendChild(w),a.forEach((N,y)=>{const k=document.createElementNS(vt,"text");rt(k,{x:p+"",y:n+c+l+o*y+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),k.innerHTML=N,i.appendChild(k)}),i}function ql(t){if(!t)return t;let e=t.replace(/<td[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/td>/gi,(r,n,i)=>`<td>${n} ${i}</td>`);return e=e.replace(/<th[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/th>/gi,(r,n,i)=>`<th>${n} ${i}</th>`),e=e.replace(/<br\s*\/?>/gi," "),e=e.replace(/\s*/g,""),e=e.replace(/\s*\[/g,"["),e=e.replace(/\s*/g,""),e=e.replace(/\s*\(/g,"("),e=e.replace(/<([^>]+)>/g,(r,n)=>{const i=["br","hr","img","input","meta","link"],s=n.split(" ")[0].toLowerCase();return i.includes(s)?`<${n} />`:r}),e}function Os(t,e,r,n,i=!1){const s=document.createElementNS(vt,"g");i||s.setAttribute("transform",`translate(${r}, ${n})`);const a=t;let o="";a.nodeObj&&a.nodeObj.dangerouslySetInnerHTML?o=a.nodeObj.dangerouslySetInnerHTML:a.text&&a.text.innerHTML&&(o=a.text.innerHTML);const l=o&&o!==t.textContent,c=o&&o.includes("<table");if(c){const u=t.offsetWidth||400,f=t.offsetHeight||200,p=document.createElementNS(vt,"rect");rt(p,{x:r+"",y:n+"",width:u+"",height:f+"",fill:"white",stroke:"#ccc","stroke-width":"1"}),s.appendChild(p);const g=document.createElementNS(vt,"foreignObject");rt(g,{x:i?r+"":"0",y:i?n+"":"0",width:u+"",height:f+""});const b=`
<div xmlns="http://www.w3.org/1999/xhtml" style="
width: 100%;
height: 100%;
padding: 8px;
box-sizing: border-box;
overflow: hidden;
font-family: '${(e.fontFamily||"Arial, sans-serif").replace(/"/g,"&quot;")}';
font-size: ${e.fontSize||"14px"};
line-height: 1.4;
">
${ql(o)}
</div>
`;return g.innerHTML=b,s.appendChild(g),s}if(l&&!c){const u=ql(o),f=t.getBoundingClientRect(),p=f.width,g=f.height;u.includes("<img"),a.nodeObj&&a.nodeObj.image;try{const O=document.createElement("div");O.innerHTML=u,O.style.cssText=`
position: absolute;
top: -9999px;
left: -9999px;
width: ${p}px;
font-family: '${(e.fontFamily||"Arial").replace(/"/g,"&quot;")}';
font-size: ${e.fontSize};
color: ${e.color};
`,document.body.appendChild(O);const z=(O.textContent||O.innerText||"").split(`
`).filter(W=>W.trim());if(z.length>0){const W=parseFloat(e.fontSize)||14,H=W*1.4,oe=parseInt(e.paddingTop)||8,me=parseInt(e.paddingBottom)||8,ye=parseInt(e.paddingLeft)||8,Le=(z.length-1)*H+W+oe+me,ze=Math.min(Le,g),Ge=u.includes("<img"),Oe=Ge?r+p/2:r+ye,Se=n+W+oe;z.forEach((je,Ke)=>{const Be=document.createElementNS(vt,"text");rt(Be,{x:Oe+"",y:Se+H*Ke+"","text-anchor":Ge?"middle":"start","font-family":e.fontFamily,"font-size":e.fontSize,"font-weight":e.fontWeight,fill:e.color}),Be.innerHTML=je.trim(),s.appendChild(Be)});const he=document.createElementNS(vt,"rect");return rt(he,{x:r+"",y:n+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:p+"px",height:ze+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),s.insertBefore(he,s.firstChild),document.body.removeChild(O),s}document.body.removeChild(O)}catch{}const b=document.createElementNS(vt,"foreignObject");rt(b,{x:r+"",y:n+"",width:p+"px",height:g+"px"});const x=document.createElement("div");x.innerHTML=u;const w=15,N=15,y=parseInt(e.paddingLeft)||8,k=parseInt(e.paddingRight)||8;x.style.cssText=`
width: 100%;
height: 100%;
font-family: '${(e.fontFamily||"Arial").replace(/"/g,"&quot;")}';
font-size: ${e.fontSize};
color: ${e.color};
background: transparent;
padding: ${w}px ${k}px ${N}px ${y}px;
box-sizing: border-box;
overflow: visible;
text-align: center !important;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
`,x.querySelectorAll("table").forEach(O=>{const z=O;z.style.cssText=`
width: 100%;
border-collapse: collapse;
font-size: ${e.fontSize};
font-family: '${(e.fontFamily||"Arial").replace(/"/g,"&quot;")}';
margin: 0 auto 0px auto;
border: 1px solid #ccc;
`,O.querySelectorAll("td, th").forEach(W=>{const H=W;H.style.cssText=`
border: 1px solid #ccc;
padding: 4px 8px;
text-align: center;
vertical-align: top;
font-size: ${parseFloat(e.fontSize)*.9}px;
background: white;
`})}),x.querySelectorAll("ul, ol").forEach(O=>{const z=O;z.style.cssText=`
margin: 2px 0 4px 0 !important;
padding-left: 0 !important;
text-align: center !important;
list-style-position: inside !important;
`}),x.querySelectorAll("li").forEach(O=>{const z=O;z.style.cssText=`
margin: 1px 0 !important;
line-height: 1.2 !important;
padding: 0 !important;
text-align: center !important;
list-style-position: inside !important;
`}),x.querySelectorAll("p").forEach(O=>{const z=O;z.style.cssText=`
margin: 2px 0 !important;
line-height: 1.4 !important;
padding: 0 !important;
text-align: center !important;
`}),x.querySelectorAll("span, div, strong, em").forEach(O=>{const z=O;z.style.cssText=`
text-align: center !important;
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
`});const I=document.createElement("style");I.textContent=`
* {
text-align: center !important;
margin-left: auto !important;
margin-right: auto !important;
}
`,x.appendChild(I),x.querySelectorAll("img").forEach((O,z)=>{const W=O,H=p-y-k-5,oe=Math.floor(g*.7);W.style.cssText=`
max-width: ${H}px !important;
max-height: ${oe}px !important;
width: auto !important;
height: auto !important;
display: block !important;
margin: 8px auto 0px auto !important;
border-radius: 4px;
object-fit: contain !important;
flex-shrink: 0 !important;
box-sizing: border-box !important;
position: relative !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
`}),b.appendChild(x);const D=document.createElementNS(vt,"rect");rt(D,{x:r+"",y:n+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:p+"px",height:g+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),s.insertBefore(D,s.firstChild),s.appendChild(b)}else return v1(t,e,r,n);return s}function X0(t,e,r=!1,n){var i;const s=getComputedStyle(e);let a,o;if(n)a=n.x,o=n.y;else{const{offsetLeft:g,offsetTop:b}=ao(t.nodes,e);a=g,o=b}Mp(e);const l=e;l.nodeObj&&l.nodeObj.dangerouslySetInnerHTML&&((i=l.nodeObj.dangerouslySetInnerHTML)==null||i.includes("<img")),l.nodeObj&&l.nodeObj.image;const c=document.createElementNS(vt,"g");n||c.setAttribute("transform",`translate(${a}, ${o})`);let u=null;const f=e,p=f.nodeObj&&f.nodeObj.dangerouslySetInnerHTML&&f.nodeObj.dangerouslySetInnerHTML.includes("<table");if(f.nodeObj&&f.nodeObj.dangerouslySetInnerHTML){if(p)return Os(e,s,a,o);u=Os(e,s,a,o)}else r?u=Os(e,s,a,o):u=v1(e,s,a,o);return u&&c.appendChild(u),c}function P4(t,e){const r=getComputedStyle(e),{offsetLeft:n,offsetTop:i}=N0(t.nodes,e),s=document.createElementNS(vt,"a"),a=document.createElementNS(vt,"text");return rt(a,{x:n+"",y:i+parseInt(r.fontSize)+"","text-anchor":"start","font-family":r.fontFamily,"font-size":`${r.fontSize}`,"font-weight":`${r.fontWeight}`,fill:`${r.color}`}),a.innerHTML=e.textContent,s.appendChild(a),s.setAttribute("href",e.href),s}async function H4(t,e){const r=getComputedStyle(e),{offsetLeft:n,offsetTop:i}=ao(t.nodes,e);if(!e.nodeObj.image)return null;const s=e.nodeObj.image,a=document.createElementNS(vt,"image"),o=parseInt(r.width),l=parseInt(r.height),c=Math.min(o-10,300),u=Math.min(l*.6,150),f=Math.min(s.width||200,c),p=Math.min(s.height||150,u);let g=0;if(e.text&&e.text.textContent){const w=e.text.textContent.trim();if(w){const N=w.split(`
`).length,y=parseFloat(r.lineHeight)||parseFloat(r.fontSize)*1.2;parseFloat(r.fontSize);const k=parseInt(r.paddingTop)||8,I=parseInt(r.paddingBottom)||8;g=N*y+k+I}}const b=n+(o-f)/2,x=i+g+0;try{const w=await b1(s.url);rt(a,{x:b+"",y:x+"",width:f+"",height:p+"",href:w})}catch{rt(a,{x:b+"",y:x+"",width:f+"",height:p+"",href:s.url})}return a}async function q4(t,e){const r=getComputedStyle(e),{offsetLeft:n,offsetTop:i}=ao(t.nodes,e),s=document.createElementNS(vt,"image"),a=t.imageProxy?t.imageProxy(e.src):e.src,o=Math.min(parseInt(r.width)||300,300),l=Math.min(parseInt(r.height)||200,200);try{const c=await b1(a);rt(s,{x:n+"",y:i+"",width:o+"",height:l+"",href:c})}catch{rt(s,{x:n+"",y:i+"",width:o+"",height:l+"",href:a})}return s}function b1(t){return new Promise((e,r)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{const i=document.createElement("canvas");i.width=n.width,i.height=n.height;const s=i.getContext("2d");if(!s){r(new Error("Failed to get canvas context"));return}s.drawImage(n,0,0);const a=i.toDataURL("image/png");e(a)}catch(i){r(i)}},n.onerror=()=>{r(new Error("Failed to load image"))},n.src=t})}const J0=100,j4='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',jl=(t,e)=>{const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return window.getComputedStyle(e).transform,{x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height}},U4=async()=>{await new Promise(t=>setTimeout(t,0)),await document.fonts.ready,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>setTimeout(t,100))},V4=async(t,e=!1)=>{var r,n,i;await U4();const s=t.nodes;s.getBoundingClientRect();const a=s.offsetHeight+J0*2,o=s.offsetWidth+J0*2,l=B4(a+"px",o+"px"),c=document.createElementNS(vt,"svg"),u=document.createElementNS(vt,"rect");rt(u,{x:"0",y:"0",width:`${o}`,height:`${a}`,fill:t.theme.cssVar["--bgcolor"]}),l.appendChild(u),s.querySelectorAll(".subLines").forEach(w=>{const N=w.cloneNode(!0),y=w.parentElement,k=jl(y,s);N.setAttribute("x",`${k.x}`),N.setAttribute("y",`${k.y}`),c.appendChild(N)});const f=(r=s.querySelector(".lines"))==null?void 0:r.cloneNode(!0);f&&c.appendChild(f);const p=(n=s.querySelector(".topiclinks"))==null?void 0:n.cloneNode(!0);p&&c.appendChild(p);const g=(i=s.querySelector(".summary"))==null?void 0:i.cloneNode(!0);g&&c.appendChild(g);const b=Array.from(s.querySelectorAll("me-tpc")).map(async w=>{const N=jl(w,s),y=w.nodeObj.dangerouslySetInnerHTML,k=!!(w.text&&w.text.innerHTML&&w.text.innerHTML!==w.text.textContent),I=w.nodeObj.image;if(y||k){const D=X0(t,w,!e,N);c.appendChild(D)}else c.appendChild(X0(t,w,!1,N));if(I)try{const D=await H4(t,w);D&&c.appendChild(D)}catch{}});await Promise.all(b),s.querySelectorAll(".tags > span").forEach(w=>{c.appendChild(X0(t,w))}),s.querySelectorAll(".icons > span").forEach(w=>{c.appendChild(X0(t,w))}),s.querySelectorAll(".hyper-link").forEach(w=>{c.appendChild(P4(t,w))});const x=Array.from(s.querySelectorAll("img")).map(async(w,N)=>{const y=w.closest("me-tpc"),k=w.closest("foreignObject");return y||k?null:await q4(t,w)});return(await Promise.all(x)).filter(w=>w!==null).forEach(w=>{w&&c.appendChild(w)}),rt(c,{x:J0+"",y:J0+"",overflow:"visible"}),l.appendChild(c),l},W4=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),j4+t.outerHTML);function G4(t){return new Promise((e,r)=>{const n=new FileReader;n.onload=i=>{e(i.target.result)},n.onerror=i=>{r(i)},n.readAsDataURL(t)})}const K4=async function(t=!1,e){const r=await V4(this,t),n=W4(r,e);return new Blob([n],{type:"image/svg+xml"})},Y4=async function(t=!1,e){const r=await this.exportSvg(t,e),n=await G4(r);return new Promise((i,s)=>{const a=new Image;a.setAttribute("crossOrigin","anonymous");const o=setTimeout(()=>{s(new Error("Image loading timeout"))},1e4);a.onload=()=>{clearTimeout(o);try{const l=document.createElement("canvas");l.width=a.width,l.height=a.height;const c=l.getContext("2d");c.fillStyle="#ffffff",c.fillRect(0,0,l.width,l.height),c.drawImage(a,0,0),l.toBlob(i,"image/png",1)}catch(l){s(
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||e[r]&&s3[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},Yl=Symbol("internals");function n0(t){return t&&String(t).trim().toLowerCase()}function mi(t){return t===!1||t==null?t:P.isArray(t)?t.map(mi):String(t)}function o3(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const l3=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function _s(t,e,r,n,i){if(P.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!P.isString(e)){if(P.isString(n))return e.indexOf(n)!==-1;if(P.isRegExp(n))return n.test(e)}}function c3(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function u3(t,e){const r=P.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,a){return this[n].call(this,e,i,s,a)},configurable:!0})})}class ls{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function s(o,l,c){const u=n0(l);if(!u)throw new Error("header name must be a non-empty string");const f=P.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=mi(o))}const a=(o,l)=>P.forEach(o,(c,u)=>s(c,u,l));if(P.isPlainObject(e)||e instanceof this.constructor)a(e,r);else if(P.isString(e)&&(e=e.trim())&&!l3(e))a(a3(e),r);else if(P.isObject(e)&&P.isIterable(e)){let o={},l,c;for(const u of e){if(!P.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[c=u[0]]=(l=o[c])?P.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}a(o,r)}else e!=null&&s(r,e,n);return this}get(e,r){if(e=n0(e),e){const n=P.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return o3(i);if(P.isFunction(r))return r.call(this,i,n);if(P.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=n0(e),e){const n=P.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||_s(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function s(a){if(a=n0(a),a){const o=P.findKey(n,a);o&&(!r||_s(n,n[o],o,r))&&(delete n[o],i=!0)}}return P.isArray(e)?e.forEach(s):s(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!e||_s(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const r=this,n={};return P.forEach(this,(i,s)=>{const a=P.findKey(n,s);if(a){r[a]=mi(i),delete r[s];return}const o=e?c3(s):String(s).trim();o!==s&&delete r[s],r[o]=mi(i),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return P.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&P.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[Yl]=this[Yl]={accessors:{}}).accessors,i=this.prototype;function s(a){const o=n0(a);n[o]||(u3(i,a),n[o]=!0)}return P.isArray(e)?e.forEach(s):s(e),this}}ls.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(ls.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});P.freezeMethods(ls);const fr=ls;function Ls(t,e){const r=this||go,n=e||r,i=fr.from(n.headers);let s=n.data;return P.forEach(t,function(o){s=o.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function L1(t){return!!(t&&t.__CANCEL__)}function Xn(t,e,r){Me.call(this,t??"canceled",Me.ERR_CANCELED,e,r),this.name="CanceledError"}P.inherits(Xn,Me,{__CANCEL__:!0});function z1(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new Me("Request failed with status code "+r.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function d3(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function h3(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=n[s];a||(a=c),r[i]=l,n[i]=c;let f=s,p=0;for(;f!==i;)p+=r[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-a<e)return;const g=u&&c-u;return g?Math.round(p*1e3/g):void 0}}function f3(t,e){let r=0,n=1e3/e,i,s;const a=(c,u=Date.now())=>{r=u,i=null,s&&(clearTimeout(s),s=null),t(...c)};return[(...c)=>{const u=Date.now(),f=u-r;f>=n?a(c,u):(i=c,s||(s=setTimeout(()=>{s=null,a(i)},n-f)))},()=>i&&a(i)]}const _i=(t,e,r=3)=>{let n=0;const i=h3(50,250);return f3(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,l=a-n,c=i(l),u=a<=o;n=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:c||void 0,estimated:c&&o&&u?(o-a)/c:void 0,event:s,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(f)},r)},Xl=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Jl=t=>(...e)=>P.asap(()=>t(...e)),p3=Mt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,Mt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,m3=Mt.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const a=[t+"="+encodeURIComponent(e)];P.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),P.isString(n)&&a.push("path="+n),P.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function g3(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function v3(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $1(t,e,r){let n=!g3(e);return t&&(n||r==!1)?v3(t,e):e}const Zl=t=>t instanceof fr?{...t}:t;function Sn(t,e){e=e||{};const r={};function n(c,u,f,p){return P.isPlainObject(c)&&P.isPlainObject(u)?P.merge.call({caseless:p},c,u):P.isPlainObject(u)?P.merge({},u):P.isArray(u)?u.slice():u}function i(c,u,f,p){if(P.isUndefined(u)){if(!P.isUndefined(c))return n(void 0,c,f,p)}else return n(c,u,f,p)}function s(c,u){if(!P.isUndefined(u))return n(void 0,u)}function a(c,u){if(P.isUndefined(u)){if(!P.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function o(c,u,f){if(f in e)return n(c,u);if(f in t)return n(void 0,c)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cance
`+s.map(tc).join(`
`):" "+tc(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:wa};function zs(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Xn(null,t)}function rc(t){return zs(t),t.headers=fr.from(t.headers),t.data=Ls.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),H1.getAdapter(t.adapter||go.adapter)(t).then(function(n){return zs(t),n.data=Ls.call(t,t.transformResponse,n),n.headers=fr.from(n.headers),n},function(n){return L1(n)||(zs(t),n&&n.response&&(n.response.data=Ls.call(t,t.transformResponse,n.response),n.response.headers=fr.from(n.response.headers))),Promise.reject(n)})}const q1="1.11.0",us={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{us[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const nc={};us.transitional=function(e,r,n){function i(s,a){return"[Axios v"+q1+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,o)=>{if(e===!1)throw new Me(i(a," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!nc[a]&&(nc[a]=!0,console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,a,o):!0}};us.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function R3(t,e,r){if(typeof t!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],a=e[s];if(a){const o=t[s],l=o===void 0||a(o,s,t);if(l!==!0)throw new Me("option "+s+" must be "+l,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}const gi={assertOptions:R3,validators:us},gr=gi.validators;class zi{constructor(e){this.defaults=e||{},this.interceptors={request:new Kl,response:new Kl}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
`+s):n.stack=s}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Sn(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&gi.assertOptions(n,{silentJSONParsing:gr.transitional(gr.boolean),forcedJSONParsing:gr.transitional(gr.boolean),clarifyTimeoutError:gr.transitional(gr.boolean)},!1),i!=null&&(P.isFunction(i)?r.paramsSerializer={serialize:i}:gi.assertOptions(i,{encode:gr.function,serialize:gr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),gi.assertOptions(r,{baseUrl:gr.spelling("baseURL"),withXsrfToken:gr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&P.merge(s.common,s[r.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=fr.concat(a,s);const o=[];let l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(l=l&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let u,f=0,p;if(!l){const b=[rc.bind(this),void 0];for(b.unshift(...o),b.push(...c),p=b.length,u=Promise.resolve(r);f<p;)u=u.then(b[f++],b[f++]);return u}p=o.length;let g=r;for(f=0;f<p;){const b=o[f++],x=o[f++];try{g=b(g)}catch(w){x.call(this,w);break}}try{u=rc.call(this,g)}catch(b){return Promise.reject(b)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=Sn(this.defaults,e);const r=$1(e.baseURL,e.url,e.allowAbsoluteUrls);return D1(r,e.params,e.paramsSerializer)}}P.forEach(["delete","get","head","options"],function(e){zi.prototype[e]=function(r,n){return this.request(Sn(n||{},{method:e,url:r,data:(n||{}).data}))}});P.forEach(["post","put","patch"],function(e){function r(n){return function(s,a,o){return this.request(Sn(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}zi.prototype[e]=r(),zi.prototype[e+"Form"]=r(!0)});const vi=zi;class vo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(o=>{n.subscribe(o),s=o}).then(i);return a.cancel=function(){n.unsubscribe(s)},a},e(function(s,a,o){n.reason||(n.reason=new Xn(s,a,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new vo(function(i){e=i}),cancel:e}}}const D3=vo;function O3(t){return function(r){return t.apply(null,r)}}function _3(t){return P.isObject(t)&&t.isAxiosError===!0}const xa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFiel
]`).replace("lheading",W1).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},X3=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,J3=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,K1=/^( {2,}|\\)\n(?!\s*$)/,Z3=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hs=/[\p{P}\p{S}]/u,To=/[\s\p{P}\p{S}]/u,Y1=/[^\s\p{P}\p{S}]/u,Q3=We(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,To).getRegex(),X1=/(?!~)[\p{P}\p{S}]/u,e6=/(?!~)[\s\p{P}\p{S}]/u,t6=/(?:[^\s\p{P}\p{S}]|~)/u,r6=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,J1=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,n6=We(J1,"u").replace(/punct/g,hs).getRegex(),i6=We(J1,"u").replace(/punct/g,X1).getRegex(),Z1="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",s6=We(Z1,"gu").replace(/notPunctSpace/g,Y1).replace(/punctSpace/g,To).replace(/punct/g,hs).getRegex(),a6=We(Z1,"gu").replace(/notPunctSpace/g,t6).replace(/punctSpace/g,e6).replace(/punct/g,X1).getRegex(),o6=We("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Y1).replace(/punctSpace/g,To).replace(/punct/g,hs).getRegex(),l6=We(/\\(punct)/,"gu").replace(/punct/g,hs).getRegex(),c6=We(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),u6=We(ko).replace("(?:-->|$)","-->").getRegex(),d6=We("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",u6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$i=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,h6=We(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",$i).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Q1=We(/^!?\[(label)\]\[(ref)\]/).replace("label",$i).replace("ref",xo).getRegex(),ed=We(/^!?\[(ref)\](?:\[\])?/).replace("ref",xo).getRegex(),f6=We("reflink|nolink(?!\\()","g").replace("reflink",Q1).replace("nolink",ed).getRegex(),Ao={_backpedal:v0,anyPunctuation:l6,autolink:c6,blockSkip:r6,br:K1,code:J3,del:v0,emStrongLDelim:n6,emStrongRDelimAst:s6,emStrongRDelimUnd:o6,escape:X3,link:h6,nolink:ed,punctuation:Q3,reflink:Q1,reflinkSearch:f6,tag:d6,text:Z3,url:v0},p6={...Ao,link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",$i).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$i).getRegex()},ka={...Ao,emStrongRDelimAst:a6,emStrongLDelim:i6,url:We(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},m6={...ka,br:We(K1).replace("{2,}","*").getRegex(),text:We(ka.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Z0={normal:So,gfm:K3,pedantic:Y3},i0={normal:Ao,gfm:ka,breaks:m6,pedantic:p6},g6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"
`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
`)}var Fi=class{constructor(t){Je(this,"options");Je(this,"rules");Je(this,"lexer");this.options=t||En}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:s0(r,`
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=b6(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=s0(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:s0(e[0],`
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=s0(e[0],`
`).split(`
`),n="",i="",s=[];for(;r.length>0;){let a=!1,o=[],l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))o.push(r[l]),a=!0;else if(!a)o.push(r[l]);else break;r=r.slice(l);let c=o.join(`
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
${c}`:c,i=i?`${i}
${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=f,r.length===0)break;let p=s.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let g=p,b=g.raw+`
`+r.join(`
`),x=this.blockquote(b);s[s.length-1]=x,n=n.substring(0,n.length-g.raw.length)+x.raw,i=i.substring(0,i.length-g.text.length)+x.text;break}else if((p==null?void 0:p.type)==="list"){let g=p,b=g.raw+`
`+r.join(`
`),x=this.list(b);s[s.length-1]=x,n=n.substring(0,n.length-p.raw.length)+x.raw,i=i.substring(0,i.length-g.raw.length)+x.raw,r=b.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:n,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let s=this.rules.other.listItemRegex(r),a=!1;for(;t;){let l=!1,c="",u="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let f=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,N=>" ".repeat(3*N.length)),p=t.split(`
`,1)[0],g=!f.trim(),b=0;if(this.options.pedantic?(b=2,u=f.trimStart()):g?b=e[1].length+1:(b=e[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,u=f.slice(b),b+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(c+=p+`
`,t=t.substring(p.length+1),l=!0),!l){let N=this.rules.other.nextBulletRegex(b),y=this.rules.other.hrRegex(b),k=this.rules.other.fencesBeginRegex(b),I=this.rules.other.headingBeginRegex(b),D=this.rules.other.htmlBeginRegex(b);for(;t;){let O=t.split(`
`,1)[0],z;if(p=O,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),z=p):z=p.replace(this.rules.other.tabCharGlobal," "),k.test(p)||I.test(p)||D.test(p)||N.test(p)||y.test(p))break;if(z.search(this.rules.other.nonSpaceChar)>=b||!p.trim())u+=`
`+z.slice(b);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(f)||I.test(f)||y.test(f))break;u+=`
`+p}!g&&!p.trim()&&(g=!0),c+=O+`
`,t=t.substring(O.length+1),f=z.slice(b)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let x=null,w;this.options.gfm&&(x=this.rules.other.listIsTask.exec(u),x&&(w=x[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:c,task:!!x,checked:w,loose:!1,text:u,tokens:[]}),i.raw+=c}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;l<i.items.length;l++)if(this.lexer.state.top=!1,i.items[l].tokens=this.lexer.blockTokens(i.items[l].text,[]),!i.loose){let c=i.items[l].tokens.filter(f=>f.type==="space"),u=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=u}if(i.loose)for(let l=0;l<i.items.length;l++)i.items[l].loose=!0;return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:n,title:i}}}table(t){var a;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=oc(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let o of n)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<r.length;o++)s.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:s.align[o]});for(let o of i)s.rows.push(oc(o,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let s=s0(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{let s=v6(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),lc(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[n.toLowerCase()];if(!i){let s=r[0].charAt(0);return{type:"text",raw:s,text:s}}return lc(r,i,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,s,a,o=i,l=0,c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+i);(n=c.exec(e))!=null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(a=[...s].length,n[3]||n[4]){o+=a;continue}else if((n[5]||n[6])&&i%3&&!((i+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let u=[...n[0]][0].length,f=t.slice(0,i+n.index+u+a);if(Math.min(i,a)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let s;do s=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(s!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Lr=class Sa{constructor(e){Je(this,"tokens");Je(this,"
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var i,s,a;for(this.options.pedantic&&(e=e.replace(Lt.tabCharGlobal," ").replace(Lt.spaceLine,""));e;){let o;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(c=>(o=c.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let c=r.at(-1);o.raw.length===1&&c!==void 0?c.raw+=`
`:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+o.raw,c.text+=`
`+o.text,this.inlineQueue.at(-1).src=c.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+o.raw,c.text+=`
`+o.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((a=this.options.extensions)!=null&&a.startBlock){let c=1/0,u=e.slice(1),f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},u),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let c=r.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+o.raw,c.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+o.raw,c.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var o,l,c;let n=e,i=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,a="";for(;e;){s||(a=""),s=!1;let u;if((l=(o=this.options.extensions)==null?void 0:o.inline)!=null&&l.some(p=>(u=p.call({lexer:this},e,r))?(e=e.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);let p=r.at(-1);u.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=u.raw,p.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(e,n,a)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),r.push(u);continue}let f=e;if((c=this.options.extensions)!=null&&c.startInline){let p=1/0,g=e.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},g),typeof b=="number"&&b>=0&&(p=Math.min(p,b))}),p<1/0&&p>=0&&(f=e.substring(0,p+1))}if(u=this.tokenizer.inlineText(f)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),s=!0;let p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=u.raw,p.text+=u.text):r.push(u);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},Bi=class{constructor(t){Je(this,"options");Je(this,"parser");this.options=t||En}space(t){return""}code({text:t,lang:e,escaped:r}){var s;let n=(s=(e||"").match(Lt.notSpaceStart))==null?void 0:s[0],i=t.replace(Lt.endingNewline,"")+`
`;return n?'<pre><code class="language-'+vr(n)+'">'+(r?i:vr(i,!0))+`</code></pre>
`:"<pre><code>"+(r?i:vr(i,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
`}hr(t){return`<hr>
`}list(t){let e=t.ordered,r=t.start,n="";for(let a=0;a<t.items.length;a++){let o=t.items[a];n+=this.listitem(o)}let i=e?"ol":"ul",s=e&&r!==1?' start="'+r+'"':"";return"<"+i+s+`>
`+n+"</"+i+`>
`}listitem(t){var r;let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+vr(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let e="",r="";for(let i=0;i<t.header.length;i++)r+=this.tablecell(t.header[i]);e+=this.tablerow({text:r});let n="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];r="";for(let a=0;a<s.length;a++)r+=this.tablecell(s[a]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+n+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${vr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let n=this.parser.parseInline(r),i=ac(t);if(i===null)return n;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+vr(e)+'"'),s+=">"+n+"</a>",s}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=ac(t);if(i===null)return vr(r);t=i;let s=`<img src="${t}" alt="${r}"`;return e&&(s+=` title="${vr(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:vr(t.text)}},Eo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},zr=class Ta{constructor(e){Je(this,"options");Je(this,"renderer");Je(this,"textRenderer");this.options=e||En,this.options.renderer=this.options.renderer||new Bi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Eo}static parse(e,r){return new Ta(r).parse(e)}static parseInline(e,r){return new Ta(r).parseInline(e)}parse(e,r=!0){var i,s;let n="";for(let a=0;a<e.length;a++){let o=e[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[o.type]){let c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){n+=u||"";continue}}let l=o;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"def":{n+=this.renderer.def(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;a+1<e.length&&e[a+1].type==="text";)c=e[++a],u+=`
`+this.renderer.text(c);r?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=u;continue}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(e,r=this.renderer){var i,s;let n="";for(let a=0;a<e.length;a++){let o=e[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[o.type]){let c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=c||"";continue}}let l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Zs,bi=(Zs=class{constructor(t){Je(this,"options");Je(this,"block");this.options=t||En}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Lr.lex:Lr.lexInline}provideParser(){return this.block?zr.parse:zr.parseInline}},Je(Zs,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Zs),y6=class{constructor(...t){Je(this,"defaults",bo());Je(this,"options",this.setOptions);Je(this,"parse",this.parseMarkdown(!0));Je(this,"parseInline",this.parseMarkdown(!1));Je(this,"Parser",zr);Je(this,"Renderer",Bi);Je(this,"TextRenderer",Eo);Je(this,"Lexer",Lr);Je(this,"Tokenizer",Fi);Je(this,"Hooks",bi);this.use(...t)}walkTokens(t,e){var n,i;let r=[];for(let s of t)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let a=s;for(let o of a.header)r=r.concat(this.walkTokens(o.tokens,e));for(let o of a.rows)for(let l of o)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,e));break}default:{let a=s;(i=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{let l=a[o].flat(1/0);r=r.concat(this.walkTokens(l,e))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),r.renderer){let i=this.defaults.renderer||new Bi(this.defaults);for(let s in r.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=r.renderer[a],l=i[a];i[a]=(...c)=>{let u=o.apply(i,c);return u===!1&&(u=l.apply(i,c)),u||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Fi(this.defaults);for(let s in r.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=r.tokenizer[a],l=i[a];i[a]=(...c)=>{let u=o.apply(i,c);return u===!1&&(u=l.apply(i,c)),u}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new bi;for(let s in r.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].include
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+vr(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Tn=new y6;function qe(t,e){return Tn.parse(t,e)}qe.options=qe.setOptions=function(t){return Tn.setOptions(t),qe.defaults=Tn.defaults,U1(qe.defaults),qe};qe.getDefaults=bo;qe.defaults=En;qe.use=function(...t){return Tn.use(...t),qe.defaults=Tn.defaults,U1(qe.defaults),qe};qe.walkTokens=function(t,e){return Tn.walkTokens(t,e)};qe.parseInline=Tn.parseInline;qe.Parser=zr;qe.parser=zr.parse;qe.Renderer=Bi;qe.TextRenderer=Eo;qe.Lexer=Lr;qe.lexer=Lr.lex;qe.Tokenizer=Fi;qe.Hooks=bi;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;zr.parse;Lr.lex;var cc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function w6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ug(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var td={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var r=function(n){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,a={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function y(k){return k instanceof l?new l(k.type,y(k.content),k.alias):Array.isArray(k)?k.map(y):k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++s}),y.__id},clone:function y(k,I){I=I||{};var D,O;switch(o.util.type(k)){case"Object":if(O=o.util.objId(k),I[O])return I[O];D={},I[O]=D;for(var z in k)k.hasOwnProperty(z)&&(D[z]=y(k[z],I));return D;case"Array":return O=o.util.objId(k),I[O]?I[O]:(D=[],I[O]=D,k.forEach(function(W,H){D[H]=y(W,I)}),D);default:return k}},getLanguage:function(y){for(;y;){var k=i.exec(y.className);if(k)return k[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,k){y.className=y.className.replace(RegExp(i,"gi"),""),y.classList.add("language-"+k)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(D){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if(y){var k=document.getElementsByTagName("script");for(var I in k)if(k[I].src==y)return k[I]}return null}},isActive:function(y,k,I){for(var D="no-"+k;y;){var O=y.classList;if(O.contains(k))return!0;if(O.contains(D))return!1;y=y.parentElement}return!!I}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(y,k){var I=o.util.clone(o.languages[y]);for(var D in k)I[D]=k[D];return I},insertBefore:function(y,k,I,D){D=D||o.languages;var O=D[y],z={};for(var W in O)if(O.hasOwnProperty(W)){if(W==k)for(var H in I)I.hasOwnProperty(H)&&(z[H]=I[H]);I.hasOwnProperty(W)||(z[W]=O[W])}var oe=D[y];return D[y]=z,o.languages.DFS(o.languages,function(me,ye){ye===oe&&me!=y&&(this[me]=z)}),z},DFS:function y(k,I,D,O){O=O||{};var z=o.util.objId;for(var W in k)if(k.hasOwnProperty(W)){I.call(k,W,k[W],D||W);var H=k[W],oe=o.util.type(H);oe==="Object"&&!O[z(H)]?(O[z(H)]=!0,y(H,I,null,O)):oe==="Array"&&!O[z(H)]&&(O[z(H)]=!0,y(H,I,W,O))}}},plugins:{},highlightAll:function(y,k){o.highlightAllUnder(document,y,k)},highlightAllUnder:function(y,k,I){var D={callback:I,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),o.hooks.run("before-all-elements-highlight",D);for(var O=0,z;z=D.elements[O++];)o.highlightElement(z,k===!0,D.callback)},highlightElement:function(y,k,I){var D=o.util.getLanguage(y),O=o.languages[D];o.util.setLanguage(y,D);var z=y.parentElement;z&&z.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(z,D);var W=y.textContent,H={element:y,language:D,grammar:O,code:W};function oe(ye){H.highlightedCode=ye,o.hooks.run("before-insert",H),H.element.innerHTML=H.highlightedCode,o.hooks.run("after-highlight",H),o.hooks.run("complete",H),I&&I.call(H.element)}if(o.hooks.run("before-sanity-check",H),z=H.element.parentElement,z&&z.nodeName.toLowerCase()==="pre"&&!z.hasAttribute("tabindex")&&z.setAttribute("tabindex","0"),!H.code){o.hooks.run("complete",H),I&&I.call(H.element);return}if(o.hooks.run("before-highlight",H),!H.grammar){oe(o.util.encode(H.code));return}if(k&&n.Worker){var me=new Worker(o.filename);me.onmessage=function(ye){oe(ye.data)},me.postMessage(JSON.stringify({language:H.language,code:H.code,immediateClose:!0}))}else oe(o.highlight(H.code,H.grammar,H.language))},highlight:function(y,k,I){var D={code:y,grammar:k,language:I};if(o.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=o.tokenize(D.code,D.grammar),o.hooks.run("after-tokenize",D),l.stringify(o.util.encode(D.tokens),D.language)},tokenize:function(y,k){var I=k.rest;if(I){for(var D in I)k[D]=I[D];delete k.rest}var O=new f;return p(O,
`),w.hasAttribute("data-start")||w.setAttribute("data-start",String(H+1))}N.textContent=O,r.highlightElement(N)},function(O){w.setAttribute(o,u),N.textContent=O})}}),r.plugins.fileHighlight={highlight:function(w){for(var N=(w||document).querySelectorAll(f),y=0,k;k=N[y++];)r.highlightElement(k)}};var b=!1;r.fileHighlight=function(){b||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),b=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(td);var x6=td.exports;const uc=w6(x6);class Wt{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new Wt(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class nr{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new nr(r,Wt.range(this,e))}}class te{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),c;i>15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var u;s+15<o.length?u=o.slice(s,s+15)+"…":u=o.slice(s),n+=c+l+u}var f=new Error(n);return f.name="ParseError",f.__proto__=te.prototype,f.position=i,i!=null&&s!=null&&(f.length=s-i),f.rawMessage=e,f}}te.prototype.__proto__=Error.prototype;var k6=function(e,r){return e.indexOf(r)!==-1},S6=function(e,r){return e===void 0?r:e},T6=/([A-Z])/g,A6=function(e){return e.replace(T6,"-$1").toLowerCase()},E6={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},C6=/[&><"']/g;function M6(t){return String(t).replace(C6,e=>E6[e])}var rd=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},N6=function(e){var r=rd(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},I6=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},R6=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},ve={contains:k6,deflt:S6,escape:M6,hyphenate:A6,getBaseElem:rd,isCharacterBox:N6,protocolFromUrl:R6},yi={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:t=>"#"+t},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:(t,e)=>(e.push(t),e)},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:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-a
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
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
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},H6=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
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
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},q6=function(e,r){return"M983 "+(10+e+r)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
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
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
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},j6=function(e,r){return"M424,"+(2398+e+r)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
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
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
h400000v`+(40+e)+"h-400000z"},U6=function(e,r){return"M473,"+(2713+e+r)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
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
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
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},V6=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},W6=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
H742v`+i+`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
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},G6=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=P6(r,Dn);break;case"sqrtSize1":i=H6(r,Dn);break;case"sqrtSize2":i=q6(r,Dn);break;case"sqrtSize3":i=j6(r,Dn);break;case"sqrtSize4":i=U6(r,Dn);break;case"sqrtTall":i=W6(r,Dn,n)}return i},K6=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},dc={doubleleftarrow:`M262 157
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
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
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
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
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
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-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
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
-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
-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
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
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
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
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
-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
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
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
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
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
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
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
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
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
435 0h399565z`,leftgroupunder:`M400000 262
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
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-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
-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
-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
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
-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
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
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
-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
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
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
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
-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
-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
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 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-70-101l-7-8h399905v-40H95l7-8
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
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
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
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
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
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
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
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
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
-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
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
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
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
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
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
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
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
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
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
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
-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
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
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
-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
-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
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-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
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
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
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-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
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
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
-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
-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
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
-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
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
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
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
-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
-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
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
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
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
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
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
-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
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-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
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
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
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
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
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
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
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
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
-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
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
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-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
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
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
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
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-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
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
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
-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
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
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
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
-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
-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
-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,
-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,
-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,
-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,
-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
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
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
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
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
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
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-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 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 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-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
-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
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
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
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
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,
-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
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
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
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,
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,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
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
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,
-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
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
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Y6=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
M347 1759 V0 h-84 V1759 v`+r+" 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
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,
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
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
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,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-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,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
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
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
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
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class L0{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 ve.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var kr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
`+z+" children.");for(var me=0;me<z;me++){var ye=new an(k[me]),Le=new Hr([ye],{width:"400em",height:ae(O),viewBox:"0 0 "+o+" "+D,preserveAspectRatio:H[me]+" slice"}),ze=F.makeSvgSpan([W[me]],[Le],r);if(z===1)return{span:ze,minWidth:I,height:O};ze.style.height=ae(O),N.push(ze)}return{span:F.makeSpan(["stretchy"],N,r),minWidth:I,height:O}}}var{span:i,minWidth:s,height:a}=n();return i.height=a,i.style.height=ae(a),s>0&&(i.style.minWidth=ae(s)),i},_5=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=F.makeSpan(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(r)&&c.push(new Ca({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&c.push(new Ca({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Hr(c,{width:"100%",height:ae(o)});a=F.makeSvgSpan([],[u],s)}return a.height=o,a.style.height=ae(o),a},jr={encloseSpan:_5,mathMLnode:I5,svgSpan:O5};function Re(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function _o(t){var e=ms(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function ms(t){return t&&(t.type==="atom"||s5.hasOwnProperty(t.type))?t:null}var Lo=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Re(t.base,"accent"),r=n.base,t.base=r,i=n5($e(t,e)),t.base=n):(n=Re(t,"accent"),r=n.base);var s=$e(r,e.havingCrampedStyle()),a=n.isShifty&&ve.isCharacterBox(r),o=0;if(a){var l=ve.getBaseElem(r),c=$e(l,e.havingCrampedStyle());o=mc(c).skew}var u=n.label==="\\c",f=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),p;if(n.isStretchy)p=jr.svgSpan(n,e),p=F.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ae(2*o)+")",marginLeft:ae(2*o)}:void 0}]},e);else{var g,b;n.label==="\\vec"?(g=F.staticSvg("vec",e),b=F.svgData.vec[1]):(g=F.makeOrd({mode:n.mode,text:n.label},e,"textord"),g=mc(g),g.italic=0,b=g.width,u&&(f+=g.depth)),p=F.makeSpan(["accent-body"],[g]);var x=n.label==="\\textcircled";x&&(p.classes.push("accent-full"),f=s.height);var w=o;x||(w-=b/2),p.style.left=ae(w),n.label==="\\textcircled"&&(p.style.top=".2em"),p=F.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-f},{type:"elem",elem:p}]},e)}var N=F.makeSpan(["mord","accent"],[p],e);return i?(i.children[0]=N,i.height=Math.max(N.height,i.height),i.classes[0]="mord",i):N},bd=(t,e)=>{var r=t.isStretchy?jr.mathMLnode(t.label):new ee.MathNode("mo",[ar(t.label,t.mode)]),n=new ee.MathNode("mover",[Qe(t.base,e),r]);return n.setAttribute("accent","true"),n},L5=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ce({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"],props:{numArgs:1},handler:(t,e)=>{var r=Ui(e[0]),n=!L5.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:Lo,mathmlBuilder:bd});ce({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Lo,mathmlBuilder:bd});ce({type:"accentUnder",names:["\\underleftarrow","\
]`,l7="\\\\[a-zA-Z@]+",c7="\\\\[^\uD800-\uDFFF]",u7="("+l7+")"+Vd+"*",d7=`\\\\(
|[ \r ]+
?)[ \r ]*`,Oa="[̀-ͯ]",h7=new RegExp(Oa+"+$"),f7="("+Vd+"+)|"+(d7+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Oa+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Oa+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+u7)+("|"+c7+")");class Pc{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(f7,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new nr("EOF",new Wt(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new te("Unexpected character: '"+e[r]+"'",new nr(e[r],new Wt(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new nr(i,new Wt(this,r,this.tokenRegex.lastIndex))}}class p7{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,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 r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var m7=_d;v("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});v("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});v("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});v("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});v("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});v("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");v("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Hc={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};v("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new te("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Hc[e.text],n==null||n>=r)throw new te("Invalid base-"+r+" digit "+e.text);for(var i;(i=Hc[t.future().text])!=null&&i<r;)n*=r,n+=i,t.popToken()}return"\\@char{"+n+"}"});var jo=(t,e,r,n)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new te("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new te("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new te("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new te("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};v("\\newcommand",t=>jo(t,!1,!0,!1));v("\\renewcommand",t=>jo(t,!0,!1,!1));v("\\providecommand",t=>jo(t,!0,!0,!0));v("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});v("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});v("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Qr[r],tt.math[r],tt.text[r]),""});v("\\bgroup","{");v("\\egroup","}");v("~","\\nobreakspace");v("\\lq","`");v("\\rq","'");v("\\aa","\\r a");v("\\AA","\\r A");v("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");v("\\copyright","\\TextOrMath{
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}Uc.hasOwnProperty(r[0])&&!tt[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=Uc[r[0]]+r.slice(1));var s=h7.exec(r);s&&(r=r.substring(0,s.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var a;if(tt[this.mode][r]){this.settings.strict&&this.mode==="math"&&Ma.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=tt[this.mode][r].group,l=Wt.range(e),c;if(i5.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:o,mode:this.mode,loc:l,text:r};a=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(nd(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:Wt.range(e),text:r};else return null;if(this.consume(),s)for(var f=0;f<s[0].length;f++){var p=s[0][f];if(!Js[p])throw new te("Unknown accent ' "+p+"'",e);var g=Js[p][this.mode]||Js[p].text;if(!g)throw new te("Accent "+p+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:Wt.range(e),label:g,isStretchy:!1,isShifty:!0,base:a}}return a}}ys.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Vo=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new ys(e,r);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new te("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new nr("\\df@tag")])}]}return i},Yd=function(e,r,n){r.textContent="";var i=Wo(e,n).toNode();r.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Yd=function(){throw new te("KaTeX doesn't work in quirks mode.")});var v7=function(e,r){var n=Wo(e,r).toMarkup();return n},b7=function(e,r){var n=new Co(r);return Vo(e,n)},Xd=function(e,r,n){if(n.throwOnError||!(e instanceof te))throw e;var i=F.makeSpan(["katex-error"],[new sr(r)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},Wo=function(e,r){var n=new Co(r);try{var i=Vo(e,n);return C5(i,e,n)}catch(s){return Xd(s,e,n)}},y7=function(e,r){var n=new Co(r);try{var i=Vo(e,n);return M5(i,e,n)}catch(s){return Xd(s,e,n)}},w7="0.16.22",x7={Span:z0,Anchor:Io,SymbolNode:sr,SvgNode:Hr,PathNode:an,LineNode:Ca},Vc={version:w7,render:Yd,renderToString:v7,ParseError:te,SETTINGS_SCHEMA:yi,__parse:b7,__renderToDomTree:Wo,__renderToHTMLTree:y7,__setFontMetrics:X6,__defineSymbol:d,__defineFunction:ce,__defineMacro:v,__domTree:x7};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\
`);let r=!1,n=!1;for(const a of e){const o=a.trim();o.includes("|")&&o.split("|").length>=3&&(r=!0),o.includes("|")&&o.includes("-")&&/^[\s\|\-\:]+$/.test(o)&&(n=!0)}const i=(t.match(/\|/g)||[]).length,s=i>=6;return r&&n||r&&s||r&&i>=4},A7=t=>!t||typeof t!="string"?!1:T7(t)?!0:[/#{1,6}\s+/,/\*\*.*?\*\*/,/\*.*?\*/,/`.*?`/,/```[\s\S]*?```/,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/\[.*?\]\(.*?\)/,/!\[.*?\]\(.*?\)/,/\$\$.*?\$\$/,/\$.*?\$/].some(r=>r.test(t)),li=t=>!t||typeof t!="string"?t||"":A7(t)||t.includes("|")?wn(t):t;const Go=(t,e)=>{const r=t.__vccOpts||t;for(const[n,i]of e)r[n]=i;return r},E7={class:"mindmap-container"},C7={key:0,class:"welcome-page"},M7={class:"ai-input-content"},N7=["disabled","onKeydown"],I7={class:"ai-input-actions"},R7=["disabled"],D7=["disabled"],O7={key:0},_7={key:1},L7={key:3,class:"save-controls"},z7={class:"image-preview-header"},$7={class:"image-preview-title"},F7={class:"image-preview-body"},B7={key:0,class:"image-preview-loading"},P7={key:1,class:"image-preview-error"},H7=["src","alt"],q7={__name:"MindMap",setup(t,{expose:e}){const r={name:"Light Purple",type:"light",palette:["#660874","#660874","#660874","#660874","#660874","#660874","#660874","#660874","#660874","#660874"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#660874","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#660874","--accent-color":"#660874","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px","--enable-node-border":"true","--node-border-padding":"8","--node-border-radius":"8","--node-border-color":"#660874","--node-border-fill":"#ffffff","--node-border-width":"1"}},n=De(null),i=De(null),s=De(null),a=De({}),o=De({}),l=De(null),c=De(1),u=De(!0),f=De(!1),p=De(!1),g=De(null),b=De(""),x=De(!1);De(new Map),De(!1),De({x:0,y:0}),De(null);const w=De(!1),N=De(""),y=De(""),k=De(!1),I=De(""),D=()=>{u.value=!0,n.value&&(n.value.innerHTML=""),i.value&&(i.value=null)},O=()=>{u.value=!1},z=()=>{u.value=!1},W=(T,M="")=>{console.log("🖼️ 打开图片预览:",{imageUrl:T,altText:M});let _=T;typeof T=="string"&&(T.startsWith("/")||T.startsWith("./")||T.startsWith("../")?_=new URL(T,window.location.origin).href:(T.startsWith("data:image/")||T.startsWith("http://")||T.startsWith("https://"))&&(_=T)),console.log("🖼️ 处理后的图片URL:",_),w.value=!0,y.value=M||"图片预览",k.value=!0,I.value="",ze();const V=new Image;V.onload=()=>{console.log("✅ 图片预加载成功"),N.value=_,k.value=!1,Ge()},V.onerror=()=>{console.error("❌ 图片预加载失败:",_),Ge(),k.value=!1,I.value=`图片加载失败: ${_}`},V.src=_},H=()=>{Ge(),w.value=!1,N.value="",y.value="",k.value=!1,I.value=""},oe=()=>{console.log("✅ 模态框图片加载成功")},me=T=>{console.error("❌ 模态框图片加载失败:",T),console.error("❌ 失败的图片URL:",N.value),k.value=!1,I.value=`图片显示失败: ${N.value}`},ye=()=>{console.log("🔄 重试加载图片"),k.value=!0,I.value="",ze()};let Le=null;const ze=()=>{Le&&clearTimeout(Le),Le=setTimeout(()=>{k.value&&(console.warn("⚠️ 图片加载超时"),k.value=!1,I.value="图片加载超时请检查网络连接或图片URL是否正确")},1e4)},Ge=()=>{Le&&(clearTimeout(Le),Le=null)},Oe=()=>{if(!i.value||!n.value)return null;try{const T=n.value.querySelector(".map-canvas");if(T){const M=T.style.transform,_=i.value.scaleVal||1;return console.log("📍 保存位置:",{transform:M,scaleVal:_}),{transform:M,scaleVal:_}}}catch(T){console.warn("保存位置失败:",T)}return null},Se=T=>{if(!(!T||!n.value||!i.value))try{const M=n.value.querySelector(".map-canvas");M&&T.transform&&(M.style.setProperty("transform",T.transform,"important"),T.scaleVal&&i.value.scaleVal!==T.scaleVal&&(i.value.scaleVal=T.scaleVal),M.style.setProperty("transform-origin","center center","important"),console.log(
font-size: 11px;
color: #666;
margin-top: 6px;
padding: 6px 8px;
background: rgba(0, 0, 0, 0.03);
border-radius: 4px;
max-width: 250px;
word-wrap: break-word;
line-height: 1.3;
border-left: 3px solid #e0e0e0;
display: block;
`,M.appendChild(de));const Ee=ue.data.des;Ee.length>150?(de.textContent=Ee.substring(0,150)+"...",de.title=Ee):de.textContent=Ee}})},1e3)},Ke=()=>{try{if(i.value&&i.value.toCenter){i.value.toCenter(),console.log("✅ 使用 MindElixir toCenter 方法实现根节点居中");return}const T=n.value;if(!T)return;const M=T.querySelector(".map-canvas");if(!M)return;const _=M.querySelectorAll("me-tpc");if(_.length===0)return;let V=1/0,se=-1/0,ue=1/0,L=-1/0;_.forEach(H0=>{const Mn=H0.getBoundingClientRect(),q0=T.getBoundingClientRect(),Yo=Mn.left-q0.left,Xo=Mn.top-q0.top;V=Math.min(V,Yo),se=Math.max(se,Yo+Mn.width),ue=Math.min(ue,Xo),L=Math.max(L,Xo+Mn.height)});const de=(V+se)/2,Ee=(ue+L)/2,Ae=T.clientWidth/2,_e=T.clientHeight/2,Xe=Ae-de,xt=_e-Ee;M.style.transform=`translate(${Xe}px, ${xt}px)`,M.style.opacity="1",M.style.transition="opacity 0.3s ease";const Pt=100,or=Math.max(Xe,Pt),Mr=Math.max(xt,Pt);M.style.transform=`translate(${or}px, ${Mr}px)`,M.style.opacity="1",M.style.visibility="visible"}catch{}},Be=async T=>{if(!(!i.value||!T))try{console.log("🎯 开始处理新节点:",T);let M=null,_=0;const V=5;for(;!M&&_<V;)M=i.value.findEle(T),M||(_++,await new Promise(se=>setTimeout(se,50)));M?(console.log("✅ 找到节点元素:",M),i.value.scrollIntoView&&(i.value.scrollIntoView(M),console.log("✅ 节点已平滑居中显示")),setTimeout(()=>{i.value.beginEdit&&(i.value.beginEdit(M),console.log("✅ 节点已进入编辑状态"))},350)):console.error("❌ 多次尝试后仍未找到节点元素:",T)}catch(M){console.error("❌ 居中显示节点失败:",M)}},ge=()=>{if(!s.value)return;if(i.value&&i.value.getNodeById)try{const M=i.value.getNodeById(s.value.id);if(M){const _=M.getBoundingClientRect(),V=n.value.getBoundingClientRect(),se=_.left-V.left+_.width/2,ue=_.bottom-V.top+10;a.value={left:`${se}px`,top:`${ue}px`};return}}catch{}let T=document.querySelector(`[data-id="${s.value.id}"]`);if(T||(T=document.querySelector(`.topic[data-id="${s.value.id}"]`)),T||(T=document.querySelector(`[data-node-id="${s.value.id}"]`)),T||(T=document.querySelector(`[data-nodeid="me${s.value.id}"]`)),!T){const M=document.querySelectorAll("me-tpc");for(const _ of M)if(_.getAttribute("data-nodeid")===`me${s.value.id}`){T=_;break}}if(!T){const M=document.querySelectorAll(".topic");for(const _ of M)if(_.textContent.trim()===s.value.topic){T=_;break}}if(T){const M=T.getBoundingClientRect(),_=n.value.getBoundingClientRect(),V=M.left-_.left+M.width/2,se=M.bottom-_.top+10;a.value={left:`${V}px`,top:`${se}px`}}else a.value={left:"50%",top:"50%",transform:"translate(-50%, -50%)"}},Ft=async()=>{s.value&&(await ie(s.value),s.value=null)},ht=async()=>{s.value&&(await pe(s.value),s.value=null)},yt=async()=>{s.value&&(await we(s.value),s.value=null)},St=async()=>{if(!s.value)return;console.log("Ask AI for node:",s.value);const T=parseFloat(a.value.left)||0,M=parseFloat(a.value.top)||0;o.value={left:`${T}px`,top:`${M+60}px`,transform:"translateX(-50%)"},p.value=!0,g.value=s.value},lt=()=>{p.value=!1,g.value=null,b.value="",x.value=!1,s.value=null},U=T=>{if(!T)return"";const M=[];return T.parent&&T.parent.topic&&M.push(`父节点: ${T.parent.topic}`),T.parent&&T.parent.parent&&T.parent.parent.topic&&M.push(`祖父节点: ${T.parent.parent.topic}`),M.join(" | ")},G=T=>{T.ctrlKey||T.metaKey||(T.preventDefault(),J())},J=async()=>{if(!(!b.value.trim()||!g.value||x.value)){x.value=!0;try{const T="你是一个专业的思维导图分析助手。请根据用户的问题和提供的节点信息,给出专业、有用的回答。",M=`节点信息
当前节点${g.value.topic}
上下文${U(g.value)}
用户问题${b.value}
请给出详细的回答回答应该
1. 直接回答用户的问题
2. 提供具体的建议或改进方案
3. 保持专业和有用的语调
4. 回答长度适中便于在思维导图中展示`;console.log("发送AI请求:",{systemPrompt:T,userPrompt:M});const _=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:T,user_prompt:M,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!_.ok)throw new Error(`HTTP error! status: ${_.status}`);let V="";const se=_.body.getReader(),ue=new TextDecoder;let L="";for(;;){const{done:de,value:Ee}=await se.read();if(de)break;L+=ue.decode(Ee,{stream:!0});const Ae=L.split(`
`);L=Ae.pop()||"";for(const _e of Ae)if(_e.startsWith("data: "))try{const Xe=JSON.parse(_e.slice(6));if(Xe.type==="chunk")V+=Xe.content;else if(Xe.type==="error")throw new Error(Xe.content)}catch(Xe){console.warn("解析流式数据失败:",Xe)}}await C(g.value,b.value,V),lt()}catch(T){console.error("AI请求失败:",T),alert("AI请求失败请稍后重试")}finally{x.value=!1}}},ne=T=>T.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(M,_)=>{if(_.includes(":")){const V=_.split(":");if(V.length>1)return`${V[0]}: ${V.slice(1).join(":")}`}return`${_}`}).replace(/\*(.*?)\*/g,"《$1》").replace(/^- (.*$)/gim," • $1").replace(/^\d+\. (.*$)/gim," $&").replace(/```(.*?)```/gims,"💻 $1").replace(/`(.*?)`/g,"「$1」").replace(/\[([^\]]+)\]\([^)]+\)/g,"🔗 $1").replace(/\n\n/g,`
`).replace(/\n/g,`
`),be=(T,M,_)=>{const V=T.split(`
`);let se=_,ue=[];for(let L=0;L<V.length;L++){const Ee=V[L].trim(),Ae=Ee.match(/^[-*+]\s*【(.+)】/);if(Ae){const _e=Ae[1].trim(),Xe={id:`node_${se++}`,topic:_e,children:[],level:(M.level||0)+1,data:{}};let xt=[],Pt=L+1;for(;Pt<V.length;){const or=V[Pt].trim();if(or.match(/^[-*+]\s*【(.+)】/))break;const H0=or.match(/^[-*+]\s+(.+)$/);if(H0){const Mn=H0[1].trim(),q0=ne(Mn);xt.push("• "+q0)}Pt++}if(xt.length>0){const or=ne(xt.join(`
`));Xe.topic=Xe.topic+`
`+or}M.children.push(Xe),L=Pt-1}else Ee&&ue.push(Ee)}if(ue.length>0){const L=ue.join(`
`).trim();L&&L.split(`
`).filter(Ee=>Ee.trim()).forEach(Ee=>{const Ae=ne(Ee.trim());if(Ae){const _e={id:`node_${se++}`,topic:Ae,children:[],level:(M.level||0)+1,data:{}};M.children.push(_e)}})}return{nodeCounter:se}},S=T=>{const M=T.split(`
`);let _=null;const V=[];let se=0,ue=[];if(M.forEach((L,de)=>{const Ee=L.trim(),Ae=Ee.match(/^(#{1,6})\s+(.+)$/);if(Ae){if(ue.length>0&&V.length>0){const or=ue.join(`
`).trim();or&&(se=be(or,V[V.length-1],se).nodeCounter),ue=[]}const _e=Ae[1].length,Xe=Ae[2].trim(),xt=ne(Xe),Pt={id:`node_${se++}`,topic:xt,children:[],level:_e,data:{}};if(_e===1&&!_)_=Pt,V.length=0,V.push(_);else{for(;V.length>1&&V[V.length-1].level>=_e;)V.pop();V.length>0&&V[V.length-1].children.push(Pt),V.push(Pt)}}else Ee&&ue.push(Ee)}),ue.length>0&&V.length>0){const L=ue.join(`
`).trim();L&&(se=be(L,V[V.length-1],se).nodeCounter)}return _||(_={id:"root",topic:"根节点",children:[],data:{}}),_},C=async(T,M,_)=>{var V,se,ue;try{const de=(Mr=>Mr.replace(/^#+\s*/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/^\s*[-*+]\s*(?![|])/gm,"• ").replace(/\n{3,}/g,`
`).trim())(_),Ee=`# ${M}
${de}`,Ae=S(Ee),_e={title:M,des:`AI追问产生的节点 - ${new Date().toLocaleString()}`,parentId:T.id,isRoot:!1},Xe=[];if(Ae.children&&Ae.children.length>0&&Ae.children.forEach(Mr=>{Xe.push({title:Mr.topic,des:"",parentId:null,isRoot:!1})}),console.log("当前思维导图ID:",l.value),!l.value)throw new Error("没有找到当前思维导图ID无法创建节点");const xt=await ut.addNodes(l.value,[_e]);if(!xt.data||!xt.data.success)throw new Error("AI父节点创建失败");const Pt=(ue=(se=(V=xt.data.data)==null?void 0:V.nodes)==null?void 0:se[0])==null?void 0:ue.id;if(!Pt)throw new Error("无法获取创建的父节点ID");Xe.forEach(Mr=>{Mr.parentId=Pt});let or=null;if(Xe.length>0&&(or=await ut.addNodes(l.value,Xe)),xt.data&&xt.data.success)await Bt();else throw new Error("AI父节点创建失败")}catch(L){console.error("创建AI节点失败:",L),alert("创建AI回答节点失败: "+L.message)}},$=async()=>{if(s.value){try{const T=s.value.topic||s.value.title||"无标题";if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(T),q();else{const M=document.createElement("textarea");M.value=T,M.style.position="fixed",M.style.left="-999999px",M.style.top="-999999px",document.body.appendChild(M),M.focus(),M.select();const _=document.execCommand("copy");document.body.removeChild(M),_?q():B()}}catch{B()}s.value=null}},q=()=>{const T=document.createElement("div");T.textContent="文本已复制到剪贴板",T.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
background: #4CAF50;
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
`;const M=document.createElement("style");M.textContent=`
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
`,document.head.appendChild(M),document.body.appendChild(T),setTimeout(()=>{T.parentNode&&T.parentNode.removeChild(T),M.parentNode&&M.parentNode.removeChild(M)},3e3)},B=()=>{const T=document.createElement("div");T.textContent="复制失败,请手动复制",T.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
background: #f44336;
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
`,document.body.appendChild(T),setTimeout(()=>{T.parentNode&&T.parentNode.removeChild(T)},3e3)},j=(T,M="success")=>{const _=document.createElement("div");_.textContent=T;const V=M==="success"?"#4CAF50":M==="error"?"#f44336":"#ff9800";_.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
background: ${V};
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
`,document.body.appendChild(_),setTimeout(()=>{_.parentNode&&_.parentNode.removeChild(_)},2e3)},re=()=>{const T=document.createElement("div");T.textContent="✅ 节点编辑已保存",T.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
background: #4CAF50;
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
`,document.body.appendChild(T),setTimeout(()=>{T.parentNode&&T.parentNode.removeChild(T)},2e3)},Z=()=>{const T=document.createElement("div");T.textContent="❌ 节点编辑保存失败",T.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
background: #f44336;
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
`,document.body.appendChild(T),setTimeout(()=>{T.parentNode&&T.parentNode.removeChild(T)},3e3)},Q=async T=>{try{console.log("🎯 处理节点拖拽操作:",T.name),console.log("📦 操作详情:",{name:T.name,objs:T.objs,toObj:T.toObj}),setTimeout(async()=>{var M;try{const _=T.objs||[],V=T.toObj;if(!_.length||!V){console.warn("⚠️ 拖拽操作缺少必要信息");return}console.log(`📦 准备保存 ${_.length} 个节点的父子关系`);let se=null;T.name==="moveNodeIn"?(se=V.id,console.log(`📌 拖入操作新父节点为 ${se}`)):(T.name==="moveNodeBefore"||T.name==="moveNodeAfter")&&(se=((M=V.parent)==null?void 0:M.id)||null,console.log(`📌 拖到兄弟位置新父节点为 ${se||"根节点"}`));const ue=_.map(async Ae=>{try{console.log(`🔄 更新节点 ${Ae.id} 的父节点为 ${se||"根节点"}`);const _e=await ut.updateNode(Ae.id,{newParentId:se});return _e.data&&_e.data.success?(console.log(` 节点 ${Ae.id} 父子关系更新成功`),{success:!0,nodeId:Ae.id}):(console.warn(` 节点 ${Ae.id} 父子关系更新失败:`,_e),{success:!1,nodeId:Ae.id})}catch(_e){return console.error(` 节点 ${Ae.id} 父子关系更新失败:`,_e),{success:!1,nodeId:Ae.id,error:_e}}}),L=await Promise.all(ue),de=L.filter(Ae=>Ae.success).length,Ee=L.filter(Ae=>!Ae.success).length;console.log(`📊 拖拽保存结果: ${de} 成功, ${Ee} 失败`)}catch(_){console.error("❌ 保存拖拽后的结构失败:",_),j("❌ 节点拖拽保存失败","error")}},500)}catch(M){console.error("❌ 处理节点拖拽操作失败:",M)}},K=async T=>{try{const M=T.obj;M?await le(M):console.error("无法解析编辑操作:",T)}catch(M){console.error("处理编辑完成失败:",M)}},le=async T=>{var M,_;try{if(!l.value){console.error("无法获取思维导图ID");return}const V=await ut.updateNode(T.id,{newTitle:T.topic,newDes:((M=T.data)==null?void 0:M.des)||"",newParentId:T.parentId||((_=T.parent)==null?void 0:_.id)});V.data&&V.data.success?re():(console.error("更新节点编辑失败:",V.data),Z())}catch(V){console.error("更新节点编辑失败:",V),Z()}},ie=async T=>{var M;try{await Ne();const _=l.value||T.mindmap_id||T.mindmapId;if(!_){console.error("无法获取思维导图ID");return}const V=await ut.addNodes(_,[{title:"新子节点",des:"子节点描述",parentId:T.id}]);if(V.data&&V.data.success){const se=((M=V.data.data)==null?void 0:M.nodes)||[];if(se.length>0){const ue=se[0];try{await new Promise(de=>setTimeout(de,800));const L=await ut.getMindmap(_);if(L.data&&L.data.nodeData){await he(L.data,!1,!1);try{console.log("🎯 开始居中显示新子节点:",ue.id),await Be(ue.id)}catch(de){console.error("居中显示新节点失败:",de)}}else throw new Error("无法获取思维导图数据")}catch(L){console.error("刷新思维导图失败:",L)}}}}catch(_){console.error("添加子节点失败:",_)}},pe=async T=>{var M;try{await Ne(),console.log("添加兄弟节点到API:",T.id),console.log("节点信息:",{id:T.id,parentId:T.parentId,parent:T.parent,mindmap_id:T.mindmap_id,mindmapId:T.mindmapId});const _=l.value||T.mindmap_id||T.mindmapId;if(!_){console.error("无法获取思维导图ID");return}let V=T.parentId;!V&&T.parent&&(V=T.parent.id);const se=await ut.addNodes(_,[{title:"新兄弟节点",des:"兄弟节点描述",parentId:V}]);if(console.log("添加兄弟节点响应:",se),se.data&&se.data.success){const ue=((M=se.data.data)==null?void 0:M.nodes)||[];if(ue.length>0){const L=ue[0];console.log("新创建的兄弟节点:",L),console.log("🎯 使用MindElixir init方法重新初始化数据...");try{const de=await ut.getMindmap(_);if(de.data&&de.data.nodeData){await he(de.data,!1,!1),console.log("✅ 思维导图刷新成功");try{console.log("🎯 开始居中显示新兄弟节点:",L.id),await Be(L.id)}catch(Ee){console.error("居中显示新节点失败:",Ee)}}else throw new Error("无法获取思维导图数据")}catch(de){console.error("重新初始化失败,使用完整重新加载:",de);const Ee=await ut.getMindmap(_);Ee.data&&Ee.data.nodeData&&await he(Ee.data,!0,!1)}}}}catch(_){console.error("<22><>
1. 提取主要主题和关键概念
2. 组织成层次分明的结构
3. 使用清晰的标题和子标题
4. 保持内容的逻辑性和完整性
5. 对于长文档请确保完整处理所有内容不要截断
6. **重要如果原文档中包含图片请按以下方式处理
- 识别图片在文档中的位置和上下文
- 根据图片内容生成准确的描述文字
- 在相应位置插入图片占位符![图片描述](图片路径)
- 图片描述要准确反映图片内容图片路径可以是相对路径或占位符
- 确保图片占位符放在逻辑上合适的位置**
7. **重要如果原文档中包含表格请完整保留表格结构
- 保持表格的Markdown格式
- 确保所有表格行都被包含
- 不要省略任何表格内容
- 对于合并单元格的表格请使用HTML格式并正确使用rowspan和colspan属性
- 如果表格结构复杂优先使用HTML table标签而不是Markdown表格语法**
8. **重要确保内容完整性
- 不要截断任何内容
- 保持原文的完整性
- 所有重要信息都要包含在思维导图中**
9. 输出格式直接输出Markdown内容不要添加任何说明文字或代码块标记`,J=`请分析以下文档内容并生成结构化Markdown
${U}`;await me(G,J),await Le(),ht(b.value.name,s.value),setTimeout(async()=>{try{await Be()}catch(ne){console.error("自动保存失败:",ne)}},1500)}catch(U){console.error("从文件生成Markdown失败:",U),ge("生成失败: "+U.message,"error")}finally{o.value=!1}},z=U=>new Promise(async(G,J)=>{try{const ne=U.type.includes("text")||U.name.endsWith(".txt")||U.name.endsWith(".md"),be=U.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||U.type==="application/msword"||U.name.endsWith(".docx")||U.name.endsWith(".doc"),S=U.type==="application/pdf"||U.name.endsWith(".pdf");if(ne){const C=new FileReader;C.onload=$=>G($.target.result),C.onerror=()=>J(new Error("文本文件读取失败")),C.readAsText(U)}else if(be){const C=await W(U);G(C)}else if(S){const C=await H(U);G(C)}else{const C=new FileReader;C.onload=$=>G($.target.result),C.onerror=()=>J(new Error("文件读取失败")),C.readAsText(U)}}catch(ne){J(ne)}}),W=async U=>{try{if(U.name.endsWith(".docx")){const G=await Gc(()=>import("./index-78e18852.js").then(be=>be.i),[]),J=await U.arrayBuffer();return(await G.extractRawText({arrayBuffer:J})).value}else if(U.name.endsWith(".doc"))throw new Error("请将.doc文件转换为.docx格式或安装相应的解析库")}catch(G){throw new Error(`Office文档解析失败: ${G.message}`)}},H=async U=>{try{const G=await Gc(()=>import("./pdf-569cfa96.js"),[]);G.GlobalWorkerOptions.workerSrc="/pdf.worker.min.mjs";const J=await U.arrayBuffer(),ne=await G.getDocument({data:J}).promise;let be="";for(let S=1;S<=ne.numPages;S++){const q=(await(await ne.getPage(S)).getTextContent()).items.map(B=>B.str).join(" ");be+=q+`
`}return be}catch(G){throw new Error(`PDF文件解析失败: ${G.message}`)}},oe=U=>U&&U.replace(/^好的[,]?作为.*?专家[,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^好的[,]?作为.*?专业的.*?专家[,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^以下是.*?结构化的.*?思维导图[:]\s*/i,"").replace(/^以下是.*?Markdown.*?思维导图[:]\s*/i,"").replace(/^以下是.*?Markdown.*?格式.*?思维导图[:]\s*/i,"").replace(/^```(?:markdown)?\s*/gm,"").replace(/```\s*$/gm,"").replace(/^「」`markdown\s*/gm,"").replace(/^`\s*/gm,"").replace(/^\s*「」`markdown\s*/gm,"").replace(/^\s*`\s*/gm,"").replace(/^作为.*?专家[,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^我已.*?分析.*?内容.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^根据.*?文档内容.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^基于.*?文档.*?生成了以下.*?思维导图[:]\s*/i,"").replace(/^以下是.*?分析.*?结果[:]\s*/i,"").replace(/^以下是.*?整理.*?结果[:]\s*/i,"").replace(/^以下是.*?结构化.*?内容[:]\s*/i,"").replace(/\n{3,}/g,`
`).trim(),me=async(U,G)=>{const ne=U||`你是一位Markdown格式转换专家你的任务是将用户提供的文章内容精确转换为结构化的Markdown格式请遵循以下步骤
提取主标题 识别文章最顶层的主标题通常为文章题目或书名并使用Markdown的 # 级别表示
识别层级标题 从文章内容中提取所有层级的内容标题从主标题后的第一个标题开始Level 1 Level 4判断层级依据
视觉与结构特征 如独立成行/位置行首格式加粗编号如 1., 1.1, (1), -
语义逻辑 标题之间的包含和并列关系
在Markdown中使用相应标题级别
Level 1 标题用 ##
Level 2 标题用 ###
Level 3 标题用 ####
Level 4 标题用 #####
精确保留原文标题文字不得修改概括或润色
处理正文内容 对于每个标题下的正文内容区块从该标题后开始直到下一个同级或更高级别标题前
直接保留原文文本但根据内容结构适当格式化为Markdown
如果内容是列表如项目符号或编号列表使用Markdown列表语法例如 - 用于无序列表1. 用于有序列表
保持段落和换行不变
**重要如果原文档中包含图片请按以下方式处理
1. 识别图片在文档中的位置和上下文
2. 根据图片内容生成准确的描述文字
3. 在相应位置插入图片占位符![图片描述](图片路径)
4. 图片描述要准确反映图片内容图片路径可以是相对路径或占位符
5. 确保图片占位符放在逻辑上合适的位置**
输出格式 输出必须是纯Markdown格式的文本不得包含任何额外说明JSON或非Markdown元素确保输出与示例风格一致直接输出Markdown内容不要添加任何说明文字`,be=G||"请将以下内容转换为结构化的Markdown格式";try{const S=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:ne,user_prompt:be,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);const C=S.body.getReader(),$=new TextDecoder;let q="",B=0;for(;;){const{done:j,value:re}=await C.read();if(j)break;q+=$.decode(re,{stream:!0});const Z=q.split(`
`);q=Z.pop()||"";for(const Q of Z)if(Q.startsWith("data: "))try{const K=JSON.parse(Q.slice(6));if(K.type==="start")ge("AI开始生成内容...","info");else if(K.type==="chunk"){if(B++,s.value+=K.content,B%5===0)try{const le=oe(s.value),ie=Oe(le);a.value=JSON.stringify(ie,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:ie,title:ie.topic||"AI生成中...",source:"ai-streaming",chunkCount:B}}))}catch(le){console.warn("⚠️ 实时转换JSON失败:",le)}}else if(K.type==="end"){ge("AI内容生成完成","success");try{const le=oe(s.value);console.log("🎯 最终内容长度:",le.length),console.log("🎯 最终内容预览:",le.substring(0,500)+"...");const ie=ze(le);console.log(`🖼 最终统计共发现 ${ie.length} 张图片`);const pe=Oe(le);a.value=JSON.stringify(pe,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:pe,title:pe.topic||"AI生成完成",source:"ai-final",chunkCount:B}}))}catch(le){console.error("⚠️ 最终处理失败:",le)}}else if(K.type==="error")throw new Error(K.content)}catch(K){console.warn("解析流式数据失败:",K)}}}catch(S){throw console.error("流式AI API调用失败:",S),S}},ye=U=>{if(U.includes("|")&&U.includes("-")){const G=U.split(`
`);let J=!1,ne=!1;for(const be of G){const S=be.trim();S.includes("|")&&S.split("|").length>=3&&(J=!0),S.includes("|")&&S.includes("-")&&/^[\s\|\-\:]+$/.test(S)&&(ne=!0)}if(J&&ne)return console.log("🚫 formatMarkdownToText: 检测到表格内容,跳过转换"),U}return U.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(G,J)=>{if(J.includes(":")){const ne=J.split(":");if(ne.length>1)return`${ne[0]}: ${ne.slice(1).join(":")}`}return`${J}`}).replace(/\*(.*?)\*/g,"《$1》").replace(/^- (.*$)/gim," • $1").replace(/^\d+\. (.*$)/gim," $&").replace(/```(.*?)```/gims,"💻 $1").replace(/`(.*?)`/g,"「$1」").replace(/\[([^\]]+)\]\([^)]+\)/g,"🔗 $1").replace(/\n\n/g,`
`).replace(/\n/g,`
`).split(`
`).map(G=>G.length>80?G.substring(0,77)+"...":G).join(`
`).trim()},Le=async()=>{if(!s.value.trim()){ge("请输入Markdown内容","error");return}l.value=!0;try{const U=oe(s.value),G=Oe(U);a.value=JSON.stringify(G,null,2)}catch(U){console.error("转换失败:",U),ge("转换失败请检查Markdown格式","error")}finally{l.value=!1}},ze=U=>{const G=/!\[([^\]]*)\]\(([^)]+)\)/g,J=[];let ne;for(;(ne=G.exec(U))!==null;){const be=ne[2],S=ne[1]||"";be&&be.trim()&&(be.startsWith("http")||be.startsWith("data:")||be.startsWith("/"))?(J.push({alt:S,url:be.trim(),fullMatch:ne[0]}),console.log(` 有效图片URL: ${be}`)):console.warn(` 跳过无效的图片URL: ${be}`)}return console.log(`🔍 从内容中提取到 ${J.length} 张图片:`,J),J},Ge=U=>U.trim(),Oe=U=>{const G=U.split(`
`);let J=null;const ne=[];let be=0,S=[];if(G.forEach((C,$)=>{const q=C.trim(),B=q.match(/^(#{1,6})\s+(.+)$/);if(B){if(S.length>0&&ne.length>0){const le=S.join(`
`).trim();le&&(be=Se(le,ne[ne.length-1],be).nodeCounter),S=[]}const j=B[1].length,re=B[2].trim(),Z=ze(re),Q=Ge(ye(re));Z.length>0&&console.log(`🖼 在标题中发现 ${Z.length} 张图片: ${re}`);const K={id:`node_${be++}`,topic:Q,children:[],level:j,data:{}};if(Z.length>0){const le=Z[0];if(le.url&&le.url.trim()!==""){let ie=le.url;ie.includes("cdn-mineru.openxlab.org.cn")&&(ie=`/proxy-image${ie.replace("https://cdn-mineru.openxlab.org.cn","")}`);const pe=`![${le.alt||Q}](${ie})`,we=wn(pe);K.topic="",K.dangerouslySetInnerHTML=we,console.log(` 成功为标题节点设置图片: ${ie}`)}else console.error("❌ 标题图片URL无效:",le)}if(j===1&&!J)J=K,ne.length=0,ne.push(J);else{for(;ne.length>1&&ne[ne.length-1].level>=j;)ne.pop();ne.length>0&&ne[ne.length-1].children.push(K),ne.push(K)}}else q&&S.push(q)}),S.length>0&&ne.length>0){const C=S.join(`
`).trim();C&&(C.includes("|")&&console.log("🔍 处理最后的内容(包含表格):",C.substring(0,200)+"..."),be=Se(C,ne[ne.length-1],be).nodeCounter)}return J||(J={id:"root",topic:"根节点",children:[],data:{}}),J},Se=(U,G,J)=>{const ne=ze(U);if(ne.length>0){console.log(`🖼 在内容中发现 ${ne.length} 张图片`),ne.forEach((q,B)=>{console.log(`🖼 处理图片 ${B+1}:`,{alt:q.alt,url:q.url,urlLength:q.url.length});let j=q.url;j.includes("cdn-mineru.openxlab.org.cn")&&(j=`/proxy-image${j.replace("https://cdn-mineru.openxlab.org.cn","")}`,console.log(`🔄 转换图片URL: ${q.url} -> ${j}`));const re=`![${q.alt||`图片 ${B+1}`}](${j})`,Z=wn(re);console.log("🖼️ 图片HTML内容:",Z);const Q={id:`node_${J++}`,topic:"",dangerouslySetInnerHTML:Z,children:[],level:(G.level||0)+1,data:{}};if(!j||j.trim()===""){console.error(` 图片节点 ${B+1} URL为空:`,Q);return}G.children.push(Q),console.log(` 成功创建图片节点: ${q.alt||`图片 ${B+1}`} - ${j}`)});const $=Ge(U);return $.trim()&&(J=Se($,G,J).nodeCounter),{nodeCounter:J}}if(he(U)){console.log("🎯 检测到表格内容,创建表格节点");const $=wn(U);console.log("🎯 表格HTML内容:",$);const q={id:`node_${J++}`,topic:"",dangerouslySetInnerHTML:$,children:[],level:(G.level||0)+1,data:{}};return G.children.push(q),{nodeCounter:J}}const be=U.split(`
`);let S=J,C=[];for(let $=0;$<be.length;$++){const B=be[$].trim(),j=B.match(/^[-*+]\s*【(.+)】/);if(j){const re=j[1].trim(),Z={id:`node_${S++}`,topic:re,children:[],level:(G.level||0)+1,data:{}};let Q=[],K=$+1;for(;K<be.length;){const le=be[K].trim();if(le.match(/^[-*+]\s*【(.+)】/))break;const pe=le.match(/^[-*+]\s+(.+)$/);if(pe){const we=pe[1].trim(),Ne=ye(we);Q.push("• "+Ne)}K++}if(Q.length>0){const le=ye(Q.join(`
`));Z.topic=Z.topic+`
`+le}G.children.push(Z),$=K-1}else B&&C.push(B)}if(C.length>0){const $=C.join(`
`).trim();if($)if(he($)){console.log("🎯 检测到表格内容,创建表格节点");const q=wn($);console.log("🎯 表格HTML内容:",q);const B={id:`node_${S++}`,topic:"",dangerouslySetInnerHTML:q,children:[],level:(G.level||0)+1,data:{}};G.children.push(B)}else $.split(`
`).filter(B=>B.trim()).forEach(B=>{const j=ye(B.trim());if(j){const re={id:`node_${S++}`,topic:j,children:[],level:(G.level||0)+1,data:{}};G.children.push(re)}})}return{nodeCounter:S}},he=U=>{if(!U||typeof U!="string")return!1;if(U.includes("<table")||U.includes("<tr")||U.includes("<td"))return console.log("🔍 检测到HTML表格内容"),!0;U.includes("|")&&console.log("🔍 检查Markdown表格内容:",U.substring(0,200)+"...");const J=U.split(`
`);let ne=!1,be=!1;for(const q of J){const B=q.trim();B.includes("|")&&B.split("|").length>=3&&(ne=!0,console.log("✅ 找到表格行:",B)),B.includes("|")&&B.includes("-")&&/^[\s\|\-\:]+$/.test(B)&&(be=!0,console.log("✅ 找到分隔符行:",B))}const S=(U.match(/\|/g)||[]).length,C=S>=4,$=ne&&be||ne&&C;return console.log("🔍 表格检测结果:",{hasTableRow:ne,hasSeparator:be,pipeCount:S,hasMultiplePipes:C,result:$}),$},je=async()=>{if(!s.value){ge("没有Markdown内容可复制","error");return}try{await navigator.clipboard.writeText(s.value),ge("Markdown已复制到剪贴板","success")}catch{const G=document.createElement("textarea");G.value=s.value,document.body.appendChild(G),G.select(),document.execCommand("copy"),G.remove(),ge("Markdown已复制到剪贴板","success")}},Ke=async()=>{try{await navigator.clipboard.writeText(a.value),ge("JSON已复制到剪贴板","success")}catch(U){console.error("复制失败:",U),ge("复制失败","error")}},Be=async()=>{if(!a.value){ge("请先生成或转换JSON数据","error");return}try{const U=JSON.parse(a.value),G=U.topic||U.title||`AI生成的思维导图_${new Date().toLocaleString()}`,J=new CustomEvent("save-preview-to-database",{detail:{data:U,title:G,source:"ai-generated",timestamp:Date.now()}});window.dispatchEvent(J),setTimeout(()=>{ge("思维导图已保存成功!","success"),b.value=null,g.value&&(g.value.value="")},2e3)}catch(U){console.error("JSON解析失败:",U),ge("JSON格式错误请检查数据","error")}},ge=(U,G="info")=>{const J=document.createElement("div");switch(J.className=`notification notification-${G}`,J.textContent=U,J.style.cssText=`
position: fixed;
top: 20px;
right: 20px;
padding: 12px 20px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
z-index: 10000;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: slideIn 0.3s ease;
max-width: 300px;
word-wrap: break-word;
`,G){case"success":J.style.background="#4CAF50",J.style.color="white";break;case"error":J.style.background="#f44336",J.style.color="white";break;case"info":default:J.style.background="#2196F3",J.style.color="white";break}if(!document.querySelector("#notification-styles")){const ne=document.createElement("style");ne.id="notification-styles",ne.textContent=`
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
`,document.head.appendChild(ne)}document.body.appendChild(J),setTimeout(()=>{J.style.animation="slideOut 0.3s ease",setTimeout(()=>{J.parentNode&&J.parentNode.removeChild(J)},300)},3e3)},Ft=()=>{s.value="",a.value="",ge("内容已清空","info")},ht=(U,G,J=null)=>{const ne={title:U,content:G,mindmapId:J,timestamp:new Date};c.value.unshift(ne),c.value.length>10&&(c.value=c.value.slice(0,10)),localStorage.setItem("ai-sidebar-history",JSON.stringify(c.value))},yt=async U=>{U.mindmapId?window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{mindmapId:U.mindmapId,title:U.title}})):(s.value=U.content,await Le(),window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{markdown:U.content,json:a.value,title:U.title}})))},St=U=>new Date(U).toLocaleString("zh-CN");Ka(()=>{const U=localStorage.getItem("ai-sidebar-history");if(U)try{c.value=JSON.parse(U)}catch(G){console.error("加载历史记录失败:",G)}window.addEventListener("add-to-history",G=>{const{title:J,content:ne,timestamp:be}=G.detail;ht(J,ne,null)}),window.addEventListener("mindmap-saved",G=>{const{mindmapId:J,title:ne,timestamp:be}=G.detail,S=c.value.find(C=>C.title===ne||C.timestamp&&Math.abs(C.timestamp-be)<5e3);S?(S.mindmapId=J,localStorage.setItem("ai-sidebar-history",JSON.stringify(c.value))):ht(ne,"",J)}),m0(i,(G,J)=>{}),m0(s,(G,J)=>{})});const lt=async()=>{try{const U=await fetch("http://127.0.0.1:8000/api/ai/test-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test:"data"})});if(!U.ok)throw new Error(`HTTP error! status: ${U.status}`);const G=U.body.getReader(),J=new TextDecoder;let ne="";for(;;){const{done:be,value:S}=await G.read();if(be)break;ne+=J.decode(S,{stream:!0});const C=ne.split(`
`);ne=C.pop()||"";for(const $ of C)if($.startsWith("data: "))try{const q=JSON.parse($.slice(6))}catch(q){console.warn("解析测试数据失败:",q)}}}catch(U){console.error("❌ 测试流式API失败:",U)}};return window.testStreamAPI=lt,(U,G)=>(Fe(),He("div",W7,[Y("div",{class:"sidebar-toggle",onClick:x,title:n.value?"展开AI助手":"折叠AI助手",style:Un({left:n.value?"10px":"420px"})},[n.value?(Fe(),He("svg",K7,[...G[1]||(G[1]=[Y("path",{d:"M9 18l6-6-6-6"},null,-1)])])):(Fe(),He("svg",Y7,[...G[2]||(G[2]=[Y("path",{d:"M15 18l-6-6 6-6"},null,-1)])]))],12,G7),Y("div",{class:Vn(["ai-sidebar",{"sidebar-collapsed":n.value}])},[Ai(Y("div",X7,[G[12]||(G[12]=Y("div",{class:"sidebar-header"},[Y("h3",null,"🤖 AI 助手"),Y("p",null,"文档转思维导图工具"),Y("div",{class:"collapse-hint"},[Y("small",null,"💡 点击右侧按钮可折叠侧边栏")])],-1)),Y("div",J7,[G[6]||(G[6]=Y("h4",null,"📁 生成思维导图",-1)),Y("div",Z7,[G[4]||(G[4]=Y("label",null,"上传文件:",-1)),Y("div",{class:"file-upload-area",onDrop:N,onDragover:y,onDragleave:k},[Y("input",{type:"file",ref_key:"fileInput",ref:g,onChange:w,accept:".txt,.md,.doc,.docx,.pdf",class:"file-input"},null,544),Y("div",{class:Vn(["file-upload-placeholder",{"drag-over":u.value}])},[...G[3]||(G[3]=[Y("span",{class:"upload-icon"},"📎",-1),Y("span",{class:"upload-text"},"点击选择文件或拖拽文件到此处",-1),Y("span",{class:"upload-hint"},"支持 .txt, .md, .doc, .docx, .pdf 格式",-1)])],2)],32)]),b.value?(Fe(),He("div",Q7,[Y("div",eg,[Y("div",tg,[Y("span",rg,"📄 "+Zt(b.value.name),1),Y("span",ng,"("+Zt(D(b.value.size))+")",1)]),Y("button",{onClick:I,class:"btn-remove",title:"删除文件"},[...G[5]||(G[5]=[Y("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[Y("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})],-1)])])])])):yr("",!0),Y("div",ig,[Y("button",{onClick:O,disabled:!b.value||o.value,class:"btn-primary"},[o.value?(Fe(),He("span",ag,"AI生成中...")):(Fe(),He("span",og,"AI生成思维导图"))],8,sg)])]),c.value.length>0?(Fe(),He("div",lg,[G[7]||(G[7]=Y("h4",null,"📚 历史记录",-1)),Y("div",cg,[(Fe(!0),He(ur,null,Mu(c.value,(J,ne)=>(Fe(),He("div",{key:ne,class:"history-item",onClick:be=>yt(J)},[Y("div",dg,Zt(J.title),1),Y("div",hg,Zt(St(J.timestamp)),1)],8,ug))),128))])])):yr("",!0),Y("div",fg,[G[9]||(G[9]=Y("h4",null,"📝 AI生成的Markdown结果",-1)),Y("div",pg,[G[8]||(G[8]=Y("label",null,"Markdown内容",-1)),Ai(Y("textarea",{"onUpdate:modelValue":G[0]||(G[0]=J=>s.value=J),placeholder:"AI生成的Markdown内容将显示在这里",rows:"6",readonly:"",class:"markdown-result"},null,512),[[eo,s.value]])]),Y("div",mg,[Y("button",{onClick:Le,disabled:l.value,class:"btn-secondary"},[l.value?(Fe(),He("span",vg,"转换中...")):(Fe(),He("span",bg,"🔄 转换为JSON"))],8,gg),Y("button",{onClick:Ft,class:"btn-clear"},"清空"),Y("button",{onClick:je,class:"btn-copy"},"📋 复制Markdown")])]),Y("div",yg,[G[11]||(G[11]=Y("h4",null,"📊 Markdown转JSON结果",-1)),f.value?(Fe(),He("div",wg,[G[10]||(G[10]=Y("div",{class:"spinner"},null,-1)),Y("span",null,Zt(p.value),1)])):yr("",!0),Y("div",xg,[Y("pre",kg,Zt(a.value||"JSON转换结果将显示在这里"),1),Y("div",Sg,[Y("button",{onClick:Ke,class:"btn-copy"},"📋 复制JSON"),Y("button",{onClick:Be,disabled:f.value,class:"btn-copy"},Zt(f.value?"处理中...":"👁️ 预览"),9,Tg)])])])],512),[[rp,!n.value]])],2)]))}},Eg=Go(Ag,[["__scopeId","data-v-bd0fccb9"]]);const Cg={class:"markdown-test"},Mg={class:"test-section"},Ng={class:"test-section"},Ig=["innerHTML"],Rg={class:"test-section"},Dg={class:"test-cases"},Og=["onClick"],_g={__name:"MarkdownTest",setup(t){const e=De(`# 测试标题
这是一个**粗体***斜体*的测试
## 表格测试
| 产品 | 价格 | 库存 |
|------|------|------|
| 苹果 | 4 | 100 |
| 香蕉 | 2 | 50 |
## 代码测试
\`\`\`javascript
function hello() {
console.log('Hello World!');
}
\`\`\`
行内代码\`const name = 'test'\`
## 列表测试
- 项目1
- 项目2
- 子项目2.1
- 子项目2.2
- 项目3
## 链接测试
- [GitHub](https://github.com)
- [Vue.js](https://vuejs.org)`),r=De([{name:"基础表格",content:`# 产品价格表
| 产品 | 价格 |
|------|------|
| 苹果 | 4 |
| 香蕉 | 2 |`},{name:"复杂表格",content:`# 技术栈对比
| 技术 | 前端 | 后端 | 数据库 |
|------|------|------|--------|
| Vue.js | | | |
| Django | | | |
| PostgreSQL | | | |`},{name:"代码块",content:`# 代码示例
\`\`\`javascript
function markdownToJSON(markdown) {
const lines = markdown.split('\\n');
// 处理逻辑...
return result;
}
\`\`\``},{name:"混合内容",content:`# 混合内容测试
这是一个包含**粗体***斜体*\`行内代码\`的段落。
## 表格
| 功能 | 状态 | 说明 |
|------|------|------|
| 表格渲染 | | 支持markdown表格 |
| 代码高亮 | | 支持代码块 |
## 代码
\`\`\`python
def hello_world():
print("Hello, World!")
\`\`\``}]),n=Ju(()=>{if(!e.value)return"";try{return wn(e.value)}catch(a){return`<div class="error">渲染失败: ${a.message}</div>`}}),i=()=>{},s=a=>{e.value=a.content};return(a,o)=>(Fe(),He("div",Cg,[o[4]||(o[4]=Y("h2",null,"Markdown渲染测试",-1)),Y("div",Mg,[o[1]||(o[1]=Y("h3",null,"输入Markdown内容",-1)),Ai(Y("textarea",{"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),placeholder:"输入markdown内容...",rows:"10",class:"markdown-input"},null,512),[[eo,e.value]])]),Y("div",Ng,[o[2]||(o[2]=Y("h3",null,"渲染结果",-1)),Y("div",{class:"rendered-content",innerHTML:n.value},null,8,Ig)]),Y("div",Rg,[o[3]||(o[3]=Y("h3",null,"测试用例",-1)),Y("button",{onClick:i,class:"test-btn"},"加载测试用例"),Y("div",Dg,[(Fe(!0),He(ur,null,Mu(r.value,(l,c)=>(Fe(),He("button",{key:c,onClick:u=>s(l),class:"test-case-btn"},Zt(l.name),9,Og))),128))])])]))}},Lg=Go(_g,[["__scopeId","data-v-68a00828"]]);const zg={id:"app"},$g={class:"test-mode-toggle",style:{display:"none"}},Fg={key:0,class:"test-mode"},Bg={key:1},Pg={class:"main-content"},Hg={__name:"App",setup(t){const e=De(null),r=De(!1),n=()=>{r.value=!r.value},i=()=>{e.value&&e.value.showMindMapPage()};return(s,a)=>(Fe(),He("div",zg,[a[0]||(a[0]=Ku("« ",-1)),Y("div",$g,[Y("button",{onClick:n,class:"test-btn"},Zt(r.value?"切换到思维导图":"测试Markdown渲染"),1)]),r.value?(Fe(),He("div",Fg,[Xt(Lg)])):(Fe(),He("div",Bg,[Xt(Eg,{onStartRealtimeGeneration:i}),Y("div",Pg,[Xt(j7,{ref_key:"mindMapRef",ref:e},null,512)])]))]))}};kp(Hg).mount("#app");export{Gc as _,cc as c,Ug as g};