var po=Object.defineProperty;var mo=(e,t,n)=>t in e?po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>mo(e,typeof t!="symbol"?t+"":t,n);import{d as _o,n as nn,c as rn,e as xt,b as Ke,t as Je,aP as go,p as bo,f as cr,C as on,X as ko,r as Dt,Z as Ro}from"./index-BhVKyY57.js";import{s as Ao}from"./safeText-O-oWGdGq.js";const Co=["aria-labelledby","aria-describedby"],xo=["id"],Do=["id"],Eo={key:0,class:"error-text",role:"alert"},vo={class:"btn-row chat-confirm-buttons"},wo=["aria-busy","disabled"],yo=["disabled"],To=["disabled"],Wl=_o({__name:"ConfirmDialog",props:{title:{},body:{default:""},confirmLabel:{},cancelLabel:{},extraLabel:{default:""},tone:{default:"neutral"},cancelClass:{default:"btn ghost"},extraClass:{default:"btn ghost"}},setup(e,{expose:t}){const n=e,i=ko(),r=Dt(null),o=Dt(null),s=Dt(!1),u=Dt("");let a=null,c,d="cancel",p=null;function k(x={}){return p?.("cancel"),c=x.action,d="cancel",u.value="",s.value=!1,a=x.from??(document.activeElement instanceof HTMLElement?document.activeElement:null),r.value?.open||r.value?.showModal(),Ro(()=>o.value?.focus()),new Promise(C=>{p=C})}function m(x){d=x,r.value?.close()}function h(x){s.value&&x.preventDefault()}function T(){a?.isConnected&&a.focus(),a=null,c=void 0,s.value=!1;const x=p;p=null,x?.(d)}function A(x){x.target===r.value&&!s.value&&m("cancel")}async function D(){if(!s.value){if(!c){m("confirm");return}s.value=!0,u.value="";try{await c()}catch(x){s.value=!1,u.value=x instanceof Error?x.message:String(x);return}s.value=!1,m("confirm")}}return t({open:k}),(x,C)=>(nn(),rn("dialog",{ref_key:"dialog",ref:r,class:"chat-dialog chat-confirm confirm-dialog","aria-labelledby":`confirm-h-${xt(i)}`,"aria-describedby":`confirm-b-${xt(i)}`,onCancel:h,onClose:T,onClick:A},[Ke("h2",{id:`confirm-h-${xt(i)}`,class:"chat-dialog-title"},Je(n.title),9,xo),Ke("p",{id:`confirm-b-${xt(i)}`,class:"chat-confirm-body"},[go(x.$slots,"default",{},()=>[bo(Je(n.body),1)])],8,Do),u.value?(nn(),rn("p",Eo,Je(u.value),1)):cr("",!0),Ke("div",vo,[Ke("button",{class:on(["btn",{danger:n.tone==="danger"}]),type:"button","aria-busy":s.value?"true":void 0,disabled:s.value,onClick:D},Je(n.confirmLabel),11,wo),n.extraLabel?(nn(),rn("button",{key:0,class:on(n.extraClass),type:"button",disabled:s.value,onClick:C[0]||(C[0]=R=>m("extra"))},Je(n.extraLabel),11,yo)):cr("",!0),Ke("button",{ref_key:"cancelBtn",ref:o,class:on(n.cancelClass),type:"button",disabled:s.value,onClick:C[1]||(C[1]=R=>m("cancel"))},Je(n.cancelLabel),11,To)])],40,Co))}}),fr={};function Fo(e){let t=fr[e];if(t)return t;t=fr[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&d<=57343?r+="���":r+=String.fromCharCode(d),o+=6;continue}}if((u&248)===240&&o+91114111?r+="����":(p-=65536,r+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),o+=9;continue}}r+="�"}return r})}He.defaultChars=";/?:@&=+$,#";He.componentChars="";const hr={};function So(e){let t=hr[e];if(t)return t;t=hr[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=So(t);let r="";for(let o=0,s=e.length;o=55296&&u<=57343){if(u>=55296&&u<=56319&&o+1=56320&&a<=57343){r+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[o])}return r}Re.defaultChars=";/?:@&=+$,-_.!~*'()#";Re.componentChars="-_.!~*'()";function Dn(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Tt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Io=/^([a-z0-9.+-]+:)/i,Bo=/:[0-9]*$/,Lo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Oo=["<",">",'"',"`"," ","\r",` `," "],zo=["{","}","|","\\","^","`"].concat(Oo),Mo=["'"].concat(zo),pr=["%","/","?",";","#"].concat(Mo),dr=["/","?","#"],No=255,mr=/^[+a-z0-9A-Z_-]{0,63}$/,Po=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_r={javascript:!0,"javascript:":!0},gr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function En(e,t){if(e&&e instanceof Tt)return e;const n=new Tt;return n.parse(e,t),n}Tt.prototype.parse=function(e,t){let n,i,r,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const c=Lo.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=Io.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=o.substr(0,2)==="//",r&&!(s&&_r[s])&&(o=o.substr(2),this.slashes=!0)),!_r[s]&&(r||s&&!gr[s])){let c=-1;for(let h=0;h127?x+="x":x+=D[C];if(!x.match(mr)){const C=h.slice(0,T),R=h.slice(T+1),E=D.match(Po);E&&(C.push(E[1]),R.unshift(E[2])),R.length&&(o=R.join(".")+o),this.hostname=C.join(".");break}}}}this.hostname.length>No&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=o.indexOf("#");u!==-1&&(this.hash=o.substr(u),o=o.slice(0,u));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),gr[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Tt.prototype.parseHost=function(e){let t=Bo.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const jo=Object.freeze(Object.defineProperty({__proto__:null,decode:He,encode:Re,format:Dn,parse:En},Symbol.toStringTag,{value:"Module"})),Vr=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Kr=/[\0-\x1F\x7F-\x9F]/,Uo=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Fn=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,Qr=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,ei=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Jo=Object.freeze(Object.defineProperty({__proto__:null,Any:Vr,Cc:Kr,Cf:Uo,P:Fn,S:Qr,Z:ei},Symbol.toStringTag,{value:"Module"})),Wo=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function $o(e){return e===0||e>=55296&&e<=57343||e>1114111}function qo(e){return $o(e)?65533:e>=128&&e<=159&&Wo[e-128]||e}function Ho(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(qo(e))}const ae=(()=>{const e=new Uint8Array(127);let t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function Zo(e,t,n,i,r,o){const u=e.length,a=o*90;let c=0;const d=()=>{const L=ae[e.charCodeAt(c++)];return L=o&&(L=L*91-a+ae[e.charCodeAt(c++)]);const j=m[L];if(j<0){let I=h[L];const N=I+T[L];for(;I%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&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@C5vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2!a)-g>>ti;return t===vn?ni:t}function Vo(e){return e-oe.ZERO>>>0<=9}function Ko(e){return(e|Ft)-oe.LOWER_A>>>0<=5}function Qo(e){return(e|Ft)-oe.LOWER_A>>>0<=25}var br;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(br||(br={}));var kr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(kr||(kr={}));function es(e,t,n,i){const r=(t&X.BRANCH_LENGTH)>>7,o=t&X.JUMP_TABLE;if(o){if(r===0)return i===o?n:-1;const a=i-o;if(a>>>0>=r)return-1;const c=e[n+a];return c===0?-1:n+r+c-1&65535}if(r===0)return-1;const s=r+1>>1,u=n+s+r;for(let a=0;a>1)]>>((a&1)<<3)&255;if(d===i){const p=n+s+a;return u+e[p]&65535}if(d>i)return-1}return-1}function Rr(e,t,n){return n===1?String.fromCharCode(e[t]&X.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function ts(e,t,n){let i=t+1,r=0,o=i;if(i>>0>9)break;r=r*10+u,i+=1}if(i===o)return 0;i1114111&&(r=1114112);let s=i-t;return s>=vn&&(ni=s,s=vn),s<>7;do{const p=r+1,k=e.charCodeAt(p);let m,h;if(k===oe.NUM){const T=ts(e,p,o);m=Go(T),m>0&&e.charCodeAt(p+m-1)!==oe.SEMI&&(m=0),h=m===0?"":Ho(T&Xo)}else if(Qo(k)){m=0,h="";const T=k-c;let A;if(T>>>0>7;if(L===0){if(e.charCodeAt(R)!==z)break e;A+=1}else{const j=e.charCodeAt(R)-z;if(j>>>0>=L)break e;const I=i[A+1+j];if(I===0)break e;A=A+L+I&65535}if(C=i[A],R+=1,R>=o)break e}if((C&(X.VALUE_LENGTH|X.FLAG13))===X.FLAG13){const z=(C&X.BRANCH_LENGTH)>>7;if(e.charCodeAt(R)!==(C&X.JUMP_TABLE))break;R+=1;const L=z-1;let j=A+1,I=0;for(;I+1>8&255)))break e;R+=1,j+=1}if(I>1),C=i[A];continue}const E=C>>>14,w=e.charCodeAt(R);if(E!==0){if(w===oe.SEMI){m=R-p+1,h=E===1?String.fromCharCode(C&X.VALUE_MASK):Rr(i,A,E);break}if(E===1)break}const S=es(i,C,A+(E||1),w);if(S<0)break;A=S,C=i[A],R+=1}h===""&&m>0&&(h=Rr(i,D,x))}else m=0,h="";m===0||n?r=p:(s=0);return u+e.slice(s)}function ri(e){return ns(e,!0,!1)}var rs=class{constructor(e={}){Y(this,"src_Any",Vr.source);Y(this,"src_Cc",Kr.source);Y(this,"src_Z",ei.source);Y(this,"src_P",Fn.source);Y(this,"src_ZPCc",[this.src_Z,this.src_P,this.src_Cc].join("|"));Y(this,"src_ZCc",[this.src_Z,this.src_Cc].join("|"));Y(this,"cache",{});Y(this,"opts",{maxLength:1e4,urlAuth:!1,schema_names:[]});this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),r=this.escapeRE(t),o=`(?:(?!${this.src_ZCc}|${i}|${r}).)`;let s=`${i}${o}{0,1000}${r}`;for(let u=2;u<=n;u++)s=`${i}(?:${o}|${s}){0,1000}${r}`;return s}get_text_separators(){var e;return(e=this.cache).text_separators??(e.text_separators=/[><\uff5c]/)}get_pseudo_letter(){var e;return(e=this.cache).src_pseudo_letter??(e.src_pseudo_letter=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`))}get_ipv4_addr(){var e;return(e=this.cache).src_ip4??(e.src_ip4=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"))}get_ipv6_addr(){var n;const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return(n=this.cache).src_ip6_addr??(n.src_ip6_addr=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`))}get_ipv6_url_host(){var e;return(e=this.cache).src_ip6_host??(e.src_ip6_host=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`))}get_ipv6_mail_host(){var e;return(e=this.cache).src_ipv6_mail_host??(e.src_ipv6_mail_host=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`))}get_auth(){var e;return(e=this.cache).src_auth??(e.src_auth=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`))}get_port(){var e;return(e=this.cache).src_port??(e.src_port=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"))}get_host_terminator(){var e;return(e=this.cache).src_host_terminator??(e.src_host_terminator=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`))}get_path_terminator(){var e;return(e=this.cache).src_path_terminator??(e.src_path_terminator=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`))}get_path(){var e;return(e=this.cache).src_path??(e.src_path=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`))}get_mail_name(){var e;return(e=this.cache).src_mail_name??(e.src_mail_name=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"))}get_xn(){var e;return(e=this.cache).src_xn??(e.src_xn=new RegExp("xn--[a-z0-9\\-]{1,59}"))}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){var e;return(e=this.cache).src_domain_root??(e.src_domain_root=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`))}get_domain(){var e;return(e=this.cache).src_domain??(e.src_domain=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`))}get_url_host_port(){var e;return(e=this.cache).url_host_port??(e.url_host_port=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source))}get_fuzzy_url_host_port(){var e;return(e=this.cache).fuzzy_url_host_port??(e.fuzzy_url_host_port=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source))}get_mail_host(){var e;return(e=this.cache).src_mail_host??(e.src_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source))}get_fuzzy_mail_host(){var e;return(e=this.cache).src_fuzzy_mail_host??(e.src_fuzzy_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source))}get_path_extra(){var e;return(e=this.cache).src_path_extra??(e.src_path_extra=new RegExp(""))}get_fuzzy_mail_host_search(){var e;return(e=this.cache).mail_fuzzy_host_search??(e.mail_fuzzy_host_search=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig"))}get_fuzzy_link_search(){var e;return(e=this.cache).link_fuzzy_search??(e.link_fuzzy_search=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig"))}get_http_validator(){var e;return(e=this.cache).http_validator??(e.http_validator=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy"))}get_relative_proto_validator(){var e;return(e=this.cache).relative_proto_validator??(e.relative_proto_validator=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy"))}get_mail_name_validator(){var e;return(e=this.cache).mail_name_validator??(e.mail_name_validator=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`))}get_mailto_validator(){var e;return(e=this.cache).mailto_validator??(e.mailto_validator=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy"))}get_schema_names(){var e;return(e=this.cache).schema_names??(e.schema_names=new RegExp((this.opts.schema_names||[]).map(t=>this.escapeRE(t)).join("|")))}get_schema_search(){var e;return(e=this.cache).schema_search??(e.schema_search=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig"))}get_schema_at_start(){var e;return(e=this.cache).schema_at_start??(e.schema_at_start=new RegExp(`^${this.get_schema_search().source}`,"i"))}},sn={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const r=i.exec(e);return r?r[0].length:0},normalize:(e,t)=>t.normalize(e)},is={"http:":sn,"https:":sn,"ftp:":sn,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const r=i.exec(e);return r?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const r=i.exec(e);return r?r[0].length:0},normalize:(e,t)=>t.normalize(e)}},os="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",ss="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function us(){const e=ss.split("|");return os.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const r of t.slice(n+1))e.push(i+r)}),e}var ls={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:us(),urlAuth:!1,maxLength:1e4},Ar=class{constructor(e,t,n,i){Y(this,"schema");Y(this,"index");Y(this,"lastIndex");Y(this,"raw");Y(this,"text");Y(this,"url");const r=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}},as=class{constructor(e={}){Y(this,"__opts__");Y(this,"__schemas__");Y(this,"re");const{rebuilder:t,...n}=e;this.__opts__={...ls,...n},this.__schemas__={...is},this.re=t||new rs,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,r)=>r.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),r=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const o=e.slice(Math.max(0,t.index-65),t.index);if(r.test(o))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,r,o,s,u,a,c=!1,d=!1,p=!1,k=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(r=this.re.get_fuzzy_mail_host_search(),r.lastIndex=0,o=this.re.get_mail_name_validator());;){const m=Math.max(k-1,0);if(r&&o&&!p&&(!u||u.index=k)break;r.lastIndex=k)break;i.lastIndexh.lastIndex))&&(h=s);let T;if(!c)for(;;){if(!a){n.lastIndexh.index)break;const x=a;a=void 0;const C=this.testSchemaAt(e,x.schema,x.lastIndex);if(C){T={schema:x.schema,index:x.index,lastIndex:x.lastIndex+C};break}}let A=T;if((!A||u&&(u.indexA.lastIndex))&&(A=u),(!A||s&&(s.indexA.lastIndex))&&(A=s),!A)break;A===u?u=void 0:A===s&&(s=void 0);const D=new Ar(e,A.schema,A.index,A.lastIndex);D.schema?this.__schemas__[D.schema].normalize(D,this):this.normalize(D),t.push(D),k=A.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new Ar(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const $e=2147483647,pe=36,Sn=1,it=26,cs=38,fs=700,ii=72,oi=128,si="-",hs=/^xn--/,ps=/[^\0-\x7F]/,ds=/[\x2E\u3002\uFF0E\uFF61]/g,ms={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},un=pe-Sn,de=Math.floor,ln=String.fromCharCode;function Ee(e){throw new RangeError(ms[e])}function _s(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function ui(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(ds,".");const r=e.split("."),o=_s(r,t).join(".");return i+o}function li(e){const t=[];let n=0;const i=e.length;for(;n=55296&&r<=56319&&nString.fromCodePoint(...e),bs=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:pe},Cr=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},ai=function(e,t,n){let i=0;for(e=n?de(e/fs):e>>1,e+=de(e/t);e>un*it>>1;i+=pe)e=de(e/un);return de(i+(un+1)*e/(e+cs))},ci=function(e){const t=[],n=e.length;let i=0,r=oi,o=ii,s=e.lastIndexOf(si);s<0&&(s=0);for(let u=0;u=128&&Ee("not-basic"),t.push(e.charCodeAt(u));for(let u=s>0?s+1:0;u=n&&Ee("invalid-input");const k=bs(e.charCodeAt(u++));k>=pe&&Ee("invalid-input"),k>de(($e-i)/d)&&Ee("overflow"),i+=k*d;const m=p<=o?Sn:p>=o+it?it:p-o;if(kde($e/h)&&Ee("overflow"),d*=h}const c=t.length+1;o=ai(i-a,c,a==0),de(i/c)>$e-r&&Ee("overflow"),r+=de(i/c),i%=c,t.splice(i++,0,r)}return String.fromCodePoint(...t)},fi=function(e){const t=[];e=li(e);const n=e.length;let i=oi,r=0,o=ii;for(const a of e)a<128&&t.push(ln(a));const s=t.length;let u=s;for(s&&t.push(si);u=i&&dde(($e-r)/c)&&Ee("overflow"),r+=(a-i)*c,i=a;for(const d of e)if(d$e&&Ee("overflow"),d===i){let p=r;for(let k=pe;;k+=pe){const m=k<=o?Sn:k>=o+it?it:k-o;if(p{let n={};for(var i in e)Dr(n,i,{get:e[i],enumerable:!0});return Dr(n,Symbol.toStringTag,{value:"Module"}),n},As=hi({arrayReplaceAt:()=>Cs,asciiTrim:()=>It,callable:()=>pi,escapeHtml:()=>ve,escapeRE:()=>Is,fromCodePoint:()=>ot,isMdAsciiPunct:()=>lt,isPunctChar:()=>mi,isPunctCharCode:()=>ut,isSpace:()=>M,isValidEntityCode:()=>In,isWhiteSpace:()=>st,lib:()=>Bs,normalizeReference:()=>St,unescapeAll:()=>Ze,unescapeMd:()=>vs});function pi(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Cs(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function In(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ot(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var di=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,xs=new RegExp(`${di.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ds=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Es(e,t){if(t.charCodeAt(0)===35&&Ds.test(t)){const i=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return In(i)?ot(i):e}const n=ri(e);return n!==e?n:e}function vs(e){return e.indexOf("\\")<0?e:e.replace(di,"$1")}function Ze(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(xs,function(t,n,i){return n||Es(t,i)})}var ws=/[&<>"]/,ys=/[&<>"]/g,Ts={"&":"&","<":"<",">":">",'"':"""};function Fs(e){return Ts[e]}function ve(e){return ws.test(e)?e.replace(ys,Fs):e}var Ss=/[.?*+^$[\]\\(){}|-]/g;function Is(e){return e.replace(Ss,"\\$&")}function M(e){switch(e){case 9:case 32:return!0}return!1}function st(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function mi(e){return Fn.test(e)||Qr.test(e)}function ut(e){return mi(ot(e))}function lt(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function St(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Er(e){return e===32||e===9||e===10||e===13}function It(e){let t=0;for(;t=t&&Er(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Bs={mdurl:jo,ucmicro:Jo};function Ls(e,t,n){let i,r,o,s;const u=e.posMax,a=e.pos;for(e.pos=t+1,i=1;e.pos32))return o;if(i===41){if(s===0)break;s--}r++}return t===r||s!==0||(o.str=Ze(e.slice(t,r)),o.pos=r,o.ok=!0),o}function zs(e,t,n,i){let r,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)s.str=i.str,s.marker=i.marker;else{if(o>=n)return s;let u=e.charCodeAt(o);if(u!==34&&u!==39&&u!==40)return s;t++,o++,u===40&&(u=41),s.marker=u}for(;oOs,parseLinkLabel:()=>Ls,parseLinkTitle:()=>zs});function at(e){"@babel/helpers - typeof";return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(e)}function Ns(e,t){if(at(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(at(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ps(e){var t=Ns(e,"string");return at(t)=="symbol"?t:t+""}function v(e,t,n){return(t=Ps(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Be=class{constructor(e,t,n){v(this,"map",null),v(this,"level",0),v(this,"children",null),v(this,"content",""),v(this,"markup",""),v(this,"info",""),v(this,"block",!1),v(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ct=class{constructor(){v(this,"__rules__",[]),v(this,"__cache__",null)}__find__(e){for(let t=0;t{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const i=this.__find__(e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[i].fn=t,this.__rules__[i].alt=n.alt||[],this.__cache__=null}before(e,t,n,i={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null}after(e,t,n,i={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(i=>{const r=this.__find__(i);if(r<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}this.__rules__[r].enabled=!0,n.push(i)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(i=>{const r=this.__find__(i);if(r<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}this.__rules__[r].enabled=!1,n.push(i)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},me={};me.code_inline=function(e,t,n,i,r){const o=e[t];return`${ve(o.content)}`};me.code_block=function(e,t,n,i,r){const o=e[t];return`${ve(e[t].content)} `};me.fence=function(e,t,n,i,r){const o=e[t],s=o.info?Ze(o.info).trim():"";let u="",a="";if(s){const d=s.split(/(\s+)/g);u=d[0],a=d.slice(2).join("")}let c;if(n.highlight?c=n.highlight(o.content,u,a)||ve(o.content):c=ve(o.content),c.indexOf("${c} `}return`
${c}
`};me.image=function(e,t,n,i,r){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,n,i),r.renderToken(e,t,n)};me.hardbreak=function(e,t,n){return n.xhtmlOut?`
`:`
`};me.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`
`:`
`:` `};me.text=function(e,t){return ve(e[t].content)};me.html_block=function(e,t){return e[t].content};me.html_inline=function(e,t){return e[t].content};var _i=class{constructor(){v(this,"rules",Object.assign({},me))}renderAttrs(e){let t,n,i;if(!e.attrs)return"";for(i="",t=0,n=e.attrs.length;t=0&&e[o].hidden&&e[o].nesting===0;)o--;i.block&&i.nesting!==-1&&o>=0&&e[o].hidden&&e[o].nesting===-1&&(r+=` `),r+=(i.nesting===-1?" `:">",r}renderInline(e,t,n){let i="";const r=this.rules;for(let o=0,s=e.length;o\s]/i.test(e)}function Zs(e){return/^<\/a\s*>/i.test(e)}function Ys(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n=0;u--){const a=r[u];if(a.type==="link_close"){for(u--;r[u].level!==a.level&&r[u].type!=="link_open";)u--;continue}if(a.type==="html_inline"&&(Hs(a.content)&&s>0&&s--,Zs(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const c=a.content;let d=e.md.linkify.match(c);const p=[];let k=a.level,m=0;d.length>0&&d[0].index===0&&u>0&&r[u-1].type==="text_special"&&(d=d.slice(1));for(let h=0;hm){const w=new e.Token("text","",0);w.content=c.slice(m,x),w.level=k,p.push(w)}const C=new e.Token("link_open","a",1);C.attrs=[["href",A]],C.level=k++,C.markup="linkify",C.info="auto",p.push(C);const R=new e.Token("text","",0);R.content=D,R.level=k,p.push(R);const E=new e.Token("link_close","a",-1);E.level=--k,E.markup="linkify",E.info="auto",p.push(E),m=d[h].lastIndex}if(m0){let u=r.length;for(const p of o)u+=p.nodes.length-1;const a=new Array(u);let c=0,d=0;o.reverse();for(let p=0;p=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Gs,Ks)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function eu(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&bi.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function tu(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Xs.test(e.tokens[t].content)&&Qs(e.tokens[t].children),bi.test(e.tokens[t].content)&&eu(e.tokens[t].children))}var nu=/['"]/,vr=/['"]/g,wr="’",ru=1e3;function yr(e,t,n){for(;e.length>n;){const i=e.pop();i.isSingleQuote?t.single=i.prevSameQuoteIdx:t.double=i.prevSameQuoteIdx}}function Et(e,t,n,i){e[t]||(e[t]=[]),e[t].push({pos:n,ch:i})}function iu(e,t){let n="",i=0;t.sort((r,o)=>r.pos-o.pos);for(let r=0;r=0&&!(i[n].level<=a);n--);if(yr(i,r,n+1),u.type!=="text")continue;const c=u.content;let d=0;const p=c.length;e:for(;d=0)A=c.charCodeAt(k.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){A=e[n].content.charCodeAt(e[n].content.length-1);break}let D=32;if(d=48&&A<=57&&(h=m=!1),m&&h&&(m=x,h=C),!m&&!h){T&&Et(o,s,k.index,wr);continue}if(h&&(n=T?r.single:r.double,n>=0&&i[n].level===a)){const w=i[n];let S,z;T?(S=t.md.options.quotes[2],z=t.md.options.quotes[3]):(S=t.md.options.quotes[0],z=t.md.options.quotes[1]),Et(o,s,k.index,z),Et(o,w.tokenIdx,w.contentPos,S),yr(i,r,n);continue e}if(m){if(i.length>=ru)return;i.push({tokenIdx:s,contentPos:k.index,isSingleQuote:T,level:a,prevSameQuoteIdx:T?r.single:r.double}),T?r.single=i.length-1:r.double=i.length-1}else h&&T&&Et(o,s,k.index,wr)}}Object.keys(o).forEach(function(s){const u=Number(s);e[u].content=iu(e[u].content,o[s])})}function su(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!nu.test(e.tokens[t].content)||ou(e.tokens[t].children,e)}function uu(e){let t,n;const i=e.length;for(t=0;t0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;et;)if(!M(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";const r=new Array(t-e);for(let o=0,s=e;sn?r[o]=new Array(u-n+1).join(" ")+this.src.slice(c,d):r[o]=this.src.slice(c,d)}return r.join("")}},au=65536;function cn(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Tr(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),o=!1,s=0,u="";for(;in)return!1;let r=t+1;if(e.sCount[r]=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[r])return!1;const u=e.src.charCodeAt(o++);if(u!==124&&u!==45&&u!==58&&!M(u)||s===45&&M(u))return!1;for(;o=4)return!1;c=Tr(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const p=c.length;if(p===0||p!==d.length)return!1;if(i)return!0;const k=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),T=[t,0];h.map=T;const A=e.push("thead_open","thead",1);A.map=[t,t+1];const D=e.push("tr_open","tr",1);D.map=[t,t+1];for(let R=0;R=4||(c=Tr(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),C+=p-c.length,C>au))break;if(r===t+2){const w=e.push("tbody_open","tbody",1);w.map=x=[t+2,0]}const E=e.push("tr_open","tr",1);E.map=[r,r+1];for(let w=0;w=4){i++,r=i;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+` `,o.map=[t,e.line],!0}function hu(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const s=e.src.charCodeAt(r);if(s!==126&&s!==96)return!1;let u=r;r=e.skipChars(r,s);let a=r-u;if(a<3)return!1;const c=e.src.slice(u,r),d=e.src.slice(r,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(i)return!0;let p=t,k=!1;for(;p++,!(p>=n||(r=u=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r=4)&&(r=e.skipChars(r,s),!(r-u=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const u=[],a=[],c=[],d=[],p=e.md.block.ruler.getRules("blockquote"),k=e.parentType;e.parentType="blockquote";let m=!1,h;for(h=t;h=o)break;if(e.src.charCodeAt(r++)===62&&!C){let E=e.sCount[h]+1,w,S;e.src.charCodeAt(r)===32?(r++,E++,S=!1,w=!0):e.src.charCodeAt(r)===9?(w=!0,(e.bsCount[h]+E)%4===3?(r++,E++,S=!1):S=!0):w=!1;let z=E;for(u.push(e.bMarks[h]),e.bMarks[h]=r;r=o,a.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(w?1:0),c.push(e.sCount[h]),e.sCount[h]=z-E,d.push(e.tShift[h]),e.tShift[h]=r-e.bMarks[h];continue}if(m)break;let R=!1;for(let E=0,w=p.length;E";const D=[t,0];A.map=D,e.md.block.tokenize(e,t,h);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=s,e.parentType=k,D[1]=e.line;for(let C=0;C=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let u=1;for(;o=i)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return r=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]=e.blkIndent&&(d=!0);let p,k,m;if((m=Sr(e,a))>=0){if(p=!0,s=e.bMarks[a]+e.tShift[a],k=Number(e.src.slice(s,m-1)),d&&k!==1)return!1}else if((m=Fr(e,a))>=0)p=!1;else return!1;if(d&&e.skipSpaces(m)>=e.eMarks[a])return!1;if(i)return!0;const h=e.src.charCodeAt(m-1),T=e.tokens.length;p?(u=e.push("ordered_list_open","ol",1),k!==1&&(u.attrs=[["start",k]])):u=e.push("bullet_list_open","ul",1);const A=[a,0];u.map=A,u.markup=String.fromCharCode(h);let D=!1;const x=e.md.block.ruler.getRules("list"),C=e.parentType;for(e.parentType="list";a=r?S=1:S=E-R,S>4&&(S=1);const z=R+S;u=e.push("list_item_open","li",1),u.markup=String.fromCharCode(h);const L=[a,0];u.map=L,p&&(u.info=e.src.slice(s,m-1));const j=e.tight,I=e.tShift[a],N=e.sCount[a],Q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=z,e.tight=!0,e.tShift[a]=w-e.bMarks[a],e.sCount[a]=E,w>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n),(!e.tight||D)&&(c=!1),D=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Q,e.tShift[a]=I,e.sCount[a]=N,e.tight=j,u=e.push("list_item_close","li",-1),u.markup=String.fromCharCode(h),a=e.line,L[1]=a,a>=n||e.sCount[a]=4)break;let ee=!1;for(let q=0,ht=x.length;q56319)continue;const r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(t--,n++)}return t}function Qe(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function vt(e,t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let i=!1;if(e.sCount[t]-e.blkIndent>3&&(i=!0),e.sCount[t]<0&&(i=!0),!i){const r=e.md.block.ruler.getRules("reference"),o=e.parentType;e.parentType="reference";let s=!1;for(let u=0,a=r.length;u=4||r.charCodeAt(o)!==91)return!1;let u=Qe(e,t),a="",c=-1,d=++o;for(;ofn*2)return!1;let w=r.charCodeAt(o);if(w===91)return!1;if(w===93){c=o;break}if(w===92&&(w=r.charCodeAt(++o)),w===10&&ofn&&gu(a)>fn))return!1;for(o=c+2;o"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:x,href:k});const R=e.push("reference_definition","",0);R.map=[t,s],R.hidden=!0;const E=Object.create(null);return E.label=C,R.meta=E,e.line=s,!0}var ku=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ru=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Au="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ai=new RegExp(`^(?:${Ru}|${Au})`),Se=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Ai.source}\\s*$`),/^$/,!1]];function Cu(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let s=e.src.slice(r,o),u=0;for(;u=4)return!1;let s=e.src.charCodeAt(r);if(s!==35||r>=o)return!1;let u=1;for(s=e.src.charCodeAt(++r);s===35&&r6||rr&&M(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;const c=e.push("heading_open",`h${u}`,1);c.markup="########".slice(0,u),c.map=[t,e.line];const d=e.push("inline","",0);d.content=It(e.src.slice(r,o)),d.map=[t,e.line],d.children=[];const p=e.push("heading_close",`h${u}`,-1);return p.markup="########".slice(0,u),!0}function Du(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,s,u=t+1;for(;u3)continue;if(e.sCount[u]>=e.blkIndent){let m=e.bMarks[u]+e.tShift[u];const h=e.eMarks[u];if(m=h))){o=s===61?1:2;break}}if(e.sCount[u]<0)continue;let k=!1;for(let m=0,h=i.length;m3||e.sCount[o]<0)continue;let c=!1;for(let d=0,p=i.length;d=n||e.sCount[s]=o){e.line=n;break}const a=e.line;let c=!1;for(let d=0;d=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!u,e.isEmpty(e.line-1)&&(u=!0),s=e.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i}scanDelims(e,t){const n=this.posMax,i=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const h=this.src.charCodeAt(e-2);r=(h&64512)===55296?65536+(h-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let o=e;for(;o=65&&e<=90||e>=97&&e<=122}function Tu(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function Fu(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=n-Math.min(10,e.pending.length,n);let o=n;for(;o>r&&Tu(e.src.charCodeAt(o-1));)o--;if(o===n||!yu(e.src.charCodeAt(o)))return!1;const s=n-o,u=e.md.linkify.matchAtStart(e.src.slice(o));if(!u)return!1;let a=u.url;if(a.length<=s)return!1;let c=a.length;for(;c>0&&a.charCodeAt(c-1)===42;)c--;c!==a.length&&(a=a.slice(0,c));const d=e.md.normalizeLink(a);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-s);const p=e.push("link_open","a",1);p.attrs=[["href",d]],p.markup="linkify",p.info="auto";const k=e.push("text","",0);k.content=e.md.normalizeLinkText(a);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=a.length-s,!0}function Su(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Bn[e.charCodeAt(0)]=1});function Iu(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&r<=56319&&n+1=56320&&u<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const u=e.push("text_special","",0);r<256&&Bn[r]!==0?u.content=o:u.content=s,u.markup=s,u.info="escape"}return e.pos=n+1,!0}function Bu(e){const t={};let n=0;for(;(n=e.indexOf("`",n))!==-1;){const i=n;for(;e.charCodeAt(++n)===96;);t[n-i]=i}return t}function Lu(e,t){var n;const i=e.pos;if(e.src.charCodeAt(i)!==96)return!1;const r=e.posMax;let o=i+1;for(;o=o){let a=o,c;for(;(c=e.src.indexOf("`",a))!==-1&&cr)break;if(a-c===u){if(!t){const d=e.push("code_inline","code",0);d.markup=s;let p=e.src.slice(o,c).replace(/\n/g," ");p.startsWith(" ")&&p.endsWith(" ")&&/[^ ]/.test(p)&&(p=p.slice(1,-1)),d.content=p}return e.pos=a,!0}}}return t||(e.pending+=s),e.pos=o,!0}function Ou(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const s=String.fromCharCode(i);if(o<2)return!1;let u;o%2&&(u=e.push("text","",0),u.content=s,o--);for(let a=0;a=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],s=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===o.token+1,u=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?u+u:u,a.content="";const c=e.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?u+u:u,c.content="",s&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function Nu(e){const t=e.tokens_meta,n=e.tokens_meta.length;Br(e,e.delimiters);for(let r=0;r=p)return!1;if(a=h,r=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),r.ok){for(s=e.md.normalizeLink(r.str),e.md.validateLink(s)?h=r.pos:s="",a=h;h=p||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h=0?i=e.src.slice(a,h++):h=m+1):h=m+1,i||(i=e.src.slice(k,m)),i=St(i),o=e.env.references[i],!o)return e.pos=d,!1;s=o.href,u=o.title}if(!t){e.pos=k,e.posMax=m;const T=e.push("link_open","a",1),A=[["href",s]];if(T.attrs=A,u&&A.push(["title",u]),i){const D=Object.create(null);D.label=i,T.meta=D}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=p,!0}function ju(e,t){let n,i,r,o,s,u,a,c,d="";const p=e.pos,k=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(o=h+1,o=k)return!1;for(c=o,u=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),u.ok&&(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?o=u.pos:d=""),c=o;o=k||e.src.charCodeAt(o)!==41)return e.pos=p,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?r=e.src.slice(c,o++):o=h+1):o=h+1,r||(r=e.src.slice(m,h)),r=St(r),s=e.env.references[r],!s)return e.pos=p,!1;d=s.href,a=s.title}if(!t){i=e.src.slice(m,h);const T=[];e.md.inline.parse(i,e.md,e.env,T);const A=e.push("image","img",0),D=[["src",d],["alt",""]];if(A.attrs=D,A.children=T,A.content=i,a&&D.push(["title",a]),r){const x=Object.create(null);x.label=r,A.meta=x}}return e.pos=o,e.posMax=k,!0}var Uu=/^([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])?)*)$/,Ju=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Wu(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=e.src.slice(i+1,n);if(Ju.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}if(Uu.test(o)){const s=e.md.normalizeLink(`mailto:${o}`);if(!e.md.validateLink(s))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}return!1}function $u(e){return/^\s]/i.test(e)}function qu(e){return/^<\/a\s*>/i.test(e)}function vi(e){const t=e|32;return t>=97&&t<=122}function Hu(e,t){const n=e.src;let i,r;if(n.startsWith(""}else if(n.startsWith("";else if(n.charCodeAt(t+1)===63)i=t+2,r="?>";else if(vi(n.charCodeAt(t+2)))i=t+3,r=">";else return-1;if(e.skipHtmlSpecial)return-1;const o=n.indexOf(r,i);return o<0?(e.skipHtmlSpecial=!0,-1):o+r.length}function Zu(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;let r;const o=e.src.charCodeAt(i+1);if(o===33||o===63)r=Hu(e,i);else if(o===47||vi(o)){const s=e.src.slice(i).match(Ai);r=s?i+s[0].length:-1}else return!1;if(r<0)return!1;if(!t){const s=e.push("html_inline","",0);s.content=e.src.slice(i,r),$u(s.content)&&e.linkLevel++,qu(s.content)&&e.linkLevel--}return e.pos=r,!0}var Yu=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Xu=/^&([a-z][a-z0-9]{1,31});/i;function Gu(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const r=e.src.slice(n).match(Yu);if(r){if(!t){const o=r[1][0].toLowerCase()==="x"?parseInt(r[1].slice(1),16):parseInt(r[1],10),s=e.push("text_special","",0);s.content=In(o)?ot(o):ot(65533),s.markup=r[0],s.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(Xu);if(r){const o=ri(r[0]);if(o!==r[0]){if(!t){const s=e.push("text_special","",0);s.content=o,s.markup=r[0],s.info="entity"}return e.pos+=r[0].length,!0}}}return!1}function Lr(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const o=[];for(let s=0;sa;c-=o[c]+1){const p=e[c];if(p.marker===u.marker&&p.open&&p.end<0){let k=!1;if((p.close||u.open)&&(p.length+u.length)%3===0&&(p.length%3!==0||u.length%3!==0)&&(k=!0),!k){const m=c>0&&!e[c-1].open?o[c-1]+1:0;o[s]=s-c+m,o[c]=m,u.open=!1,p.end=s,p.close=!1,d=-1,r=-2;break}}}d!==-1&&(t[u.marker][(u.open?3:0)+(u.length||0)%3]=d)}}function Vu(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lr(e.delimiters);for(let r=0;r0&&i++,r[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),s=o.length;for(let u=0;u=0))try{t.hostname=xr.toASCII(t.hostname)}catch{}return t.auth&&(t.auth=Re(t.auth)),t.hostname&&(t.hostname=Re(t.hostname)),t.pathname&&(t.pathname=Re(t.pathname)),t.search&&(t.search=Re(t.search)),t.hash&&(t.hash=Re(t.hash)),Dn(t)}normalizeLinkText(e){const t=En(e,!0);if(t.hostname&&(!t.protocol||Or.indexOf(t.protocol)>=0))try{t.hostname=xr.toUnicode(t.hostname)}catch{}return He(Dn(t),He.defaultChars+"%")}constructor(...e){v(this,"inline",new wi),v(this,"block",new Ci),v(this,"core",new ki),v(this,"renderer",new _i),v(this,"linkify",new as),v(this,"utils",As),v(this,"helpers",Object.assign({},Ms));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const r=e;if(t=Qu[r],!t)throw new Error(`Wrong 'markdown-it' preset "${r}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var i;["core","block","inline"].forEach(o=>{var s;const u=(s=n[o])===null||s===void 0?void 0:s.rules;u&&this[o].ruler.enableOnly(u)});const r=(i=n.inline)===null||i===void 0?void 0:i.rules2;r&&this.inline.ruler2.enableOnly(r)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(r=>{n=n.concat(this[r].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(r=>n.indexOf(r)<0);if(i.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${i}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(r=>{n=n.concat(this[r].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(r=>n.indexOf(r)<0);if(i.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${i}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};v(_e,"Token",Be);v(_e,"Ruler",ct);v(_e,"Renderer",_i);v(_e,"ParserCore",ki);v(_e,"StateCore",gi);v(_e,"ParserBlock",Ci);v(_e,"StateBlock",Ri);v(_e,"ParserInline",wi);v(_e,"StateInline",xi);var nl=pi(_e);function zr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n2?i-2:0),o=2;o1?n-1:0),r=1;r"u"?null:W(BigInt.prototype.toString),Jr=typeof Symbol>"u"?null:W(Symbol.prototype.toString),ie=W(Object.prototype.hasOwnProperty),rt=W(Object.prototype.toString),V=W(RegExp.prototype.test),ke=Ii(TypeError);function W(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Ie;if(Mr&&Mr(e,null),!qe(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){const o=n(r);o!==r&&(ll(t)||(t[i]=o),r=o)}e[r]=!0}return e}function ml(e){for(let t=0;t/g),xl=K(/\${[\w\W]*/g),Dl=K(/^data-[\-\w.\u00B7-\uFFFF]+$/),El=K(/^aria-[\-\w]+$/),Zr=K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vl=K(/^(?:\w+script|data):/i),wl=K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yl=K(/^html$/i),Tl=K(/^[a-z][.\w]*(-[.\w]+)+$/i),An=K(/<[/\w!]/g),Yr=K(/<[/\w]/g),Fl=K(/<\/no(script|embed|frames)/i),Xr=K(/\/>/i),H={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Sl=G(O({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Il=function(){return typeof window>"u"?null:window},Bl=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Gr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},De=function(t,n,i,r){return ie(t,n)&&qe(t[n])?O(r.base?se(r.base):{},t[n],r.transform):i},Cn=function(t,n,i){const r=ie(t,n)?t[n]:void 0;return r&&typeof r=="object"?se(r):i()};function Bi(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Il();const t=b=>Bi(b);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==H.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const i=n,r=i.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,s=e.Node,u=e.Element,a=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,d=e.trustedTypes,p=u.prototype,k=ue(p,"cloneNode"),m=ue(p,"remove"),h=ue(p,"removeAttributeNode"),T=ue(p,"nextSibling"),A=ue(p,"childNodes"),D=ue(p,"parentNode"),x=ue(p,"shadowRoot"),C=ue(p,"attributes"),R=s&&s.prototype?ue(s.prototype,"nodeType"):null,E=s&&s.prototype?ue(s.prototype,"nodeName"):null,w=s&&s.prototype?ue(s.prototype,"ownerDocument"):null,S=function(l){return R?R(l):l.nodeType},z=function(l){return E?E(l):l.nodeName},L=gl(p,"namespaceURI"),j=function(l){return L?L(l):l.namespaceURI};if(typeof o=="function"){const b=n.createElement("template");b.content&&b.content.ownerDocument&&(n=b.content.ownerDocument)}let I,N="",Q,ee=!1,q=0;const ht=function(){if(q>0)throw ke('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Le=function(l){ht(),q++;try{return I.createHTML(l)}finally{q--}},Oi=function(l){ht(),q++;try{return I.createScriptURL(l)}finally{q--}},zi=function(){return ee||(Q=Bl(d,r),ee=!0),Q},pt=n,Bt=pt.implementation,Ln=pt.createNodeIterator,Mi=pt.createDocumentFragment,Ni=pt.getElementsByTagName,Pi=i.importNode;let P=Gr();t.isSupported=typeof yi=="function"&&typeof D=="function"&&Bt&&Bt.createHTMLDocument!==void 0;const ji=Al,Ui=Cl,Ji=xl,Wi=Dl,$i=El,qi=vl,On=wl,Hi=Tl;let zn=Zr,U=null;const Lt=O({},[...Wr,...gn,...bn,...kn,...$r]);let J=null;const Ot=O({},[...qr,...Rn,...Hr,...yt]);let ce=Object.seal(We(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ye=null,Mn=null;const Ae=Object.seal(We(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Nn=!0,zt=!0,Pn=!1,Mt=!0,ge=!1,we=!0,ye=!1,Nt=!1,dt=null,mt=null,Pt=!1,Oe=!1,_t=!1,gt=!1,jn=!0,Un=!1;const Jn="user-content-";let jt=!0,Ut=!1,Te=null,ze={},Fe=null;const Wn=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let $n=null;const qn=O({},["audio","video","img","source","image","track"]);let Hn=null;const Zn=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Me=fe,Jt=!1,Wt=null;const Zi=O({},[bt,kt,fe],_n),Yn=G(["mi","mo","mn","ms","mtext"]);let $t=O({},Yn);const Xn=G(["annotation-xml"]);let qt=O({},Xn);const Yi=O({},["title","style","font","a","script"]);let Xe=null;const Xi=["application/xhtml+xml","text/html"],Gi="text/html";let $=null,Ne=null;const Vi=n.createElement("form"),Gn=function(l){return l instanceof RegExp||l instanceof Function},Ht=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===l)return;(!l||typeof l!="object")&&(l={}),l=se(l),Xe=Xi.indexOf(l.PARSER_MEDIA_TYPE)===-1?Gi:l.PARSER_MEDIA_TYPE,$=Xe==="application/xhtml+xml"?_n:Ie,U=De(l,"ALLOWED_TAGS",Lt,{transform:$}),J=De(l,"ALLOWED_ATTR",Ot,{transform:$}),Wt=De(l,"ALLOWED_NAMESPACES",Zi,{transform:_n}),Hn=De(l,"ADD_URI_SAFE_ATTR",Zn,{transform:$,base:Zn}),$n=De(l,"ADD_DATA_URI_TAGS",qn,{transform:$,base:qn}),Fe=De(l,"FORBID_CONTENTS",Wn,{transform:$}),Ye=De(l,"FORBID_TAGS",se({}),{transform:$}),Mn=De(l,"FORBID_ATTR",se({}),{transform:$}),ze=ie(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?se(l.USE_PROFILES):l.USE_PROFILES:!1,Nn=l.ALLOW_ARIA_ATTR!==!1,zt=l.ALLOW_DATA_ATTR!==!1,Pn=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Mt=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=l.SAFE_FOR_TEMPLATES||!1,we=l.SAFE_FOR_XML!==!1,ye=l.WHOLE_DOCUMENT||!1,Oe=l.RETURN_DOM||!1,_t=l.RETURN_DOM_FRAGMENT||!1,gt=l.RETURN_TRUSTED_TYPE||!1,Pt=l.FORCE_BODY||!1,jn=l.SANITIZE_DOM!==!1,Un=l.SANITIZE_NAMED_PROPS||!1,jt=l.KEEP_CONTENT!==!1,Ut=l.IN_PLACE||!1,zn=bl(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:Zr,Me=typeof l.NAMESPACE=="string"?l.NAMESPACE:fe,$t=Cn(l,"MATHML_TEXT_INTEGRATION_POINTS",()=>O({},Yn)),qt=Cn(l,"HTML_INTEGRATION_POINTS",()=>O({},Xn));const f=Cn(l,"CUSTOM_ELEMENT_HANDLING",()=>We(null));if(ce=We(null),ie(f,"tagNameCheck")&&Gn(f.tagNameCheck)&&(ce.tagNameCheck=f.tagNameCheck),ie(f,"attributeNameCheck")&&Gn(f.attributeNameCheck)&&(ce.attributeNameCheck=f.attributeNameCheck),ie(f,"allowCustomizedBuiltInElements")&&typeof f.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=f.allowCustomizedBuiltInElements),K(ce),ge&&(zt=!1),_t&&(Oe=!0),ze&&(U=O({},$r),J=We(null),ze.html===!0&&(O(U,Wr),O(J,qr)),ze.svg===!0&&(O(U,gn),O(J,Rn),O(J,yt)),ze.svgFilters===!0&&(O(U,bn),O(J,Rn),O(J,yt)),ze.mathMl===!0&&(O(U,kn),O(J,Hr),O(J,yt))),Ae.tagCheck=null,Ae.attributeCheck=null,ie(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?Ae.tagCheck=l.ADD_TAGS:qe(l.ADD_TAGS)&&(U===Lt&&(U=se(U)),O(U,l.ADD_TAGS,$))),ie(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?Ae.attributeCheck=l.ADD_ATTR:qe(l.ADD_ATTR)&&(J===Ot&&(J=se(J)),O(J,l.ADD_ATTR,$))),ie(l,"ADD_FORBID_CONTENTS")&&qe(l.ADD_FORBID_CONTENTS)&&(Fe===Wn&&(Fe=se(Fe)),O(Fe,l.ADD_FORBID_CONTENTS,$)),jt&&(U["#text"]=!0),ye&&O(U,["html","head","body"]),U.table&&(O(U,["tbody"]),delete Ye.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _=I;I=l.TRUSTED_TYPES_POLICY;try{N=Le("")}catch(g){throw I=_,g}}else l.TRUSTED_TYPES_POLICY===null?(I=void 0,N=""):(I===void 0&&(I=zi()),I&&typeof N=="string"&&(N=Le("")));G&&G(l),Ne=l},Vn=O({},[...gn,...bn,...kl]),Kn=O({},[...kn,...Rl]),Ki=function(l,f,_){return f.namespaceURI===fe?l==="svg":f.namespaceURI===bt?l==="svg"&&(_==="annotation-xml"||$t[_]):!!Vn[l]},Qi=function(l,f,_){return f.namespaceURI===fe?l==="math":f.namespaceURI===kt?l==="math"&&qt[_]:!!Kn[l]},eo=function(l,f,_){return f.namespaceURI===kt&&!qt[_]||f.namespaceURI===bt&&!$t[_]?!1:!Kn[l]&&(Yi[l]||!Vn[l])},to=function(l){const f=j(l),_=Ie(z(l)),g=D(l);let y,F;return g&&S(g)===H.element?(y={namespaceURI:j(g)},F=Ie(z(g))):(y={namespaceURI:Me},F="template"),Wt[f]?f===kt?Ki(_,y,F):f===bt?Qi(_,y,F):f===fe?eo(_,y,F):!!(Xe==="application/xhtml+xml"&&Wt[f]):!1},Ce=function(l){et(t.removed,{element:l});try{D(l).removeChild(l)}catch{if(m(l),!D(l))throw ke("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qn=function(l,f,_){try{h(l,f)}catch{try{l.removeAttribute(_)}catch{}}},Zt=function(l){Xt(l);const f=A(l);f&&be(cl(f),g=>{try{m(g)}catch{}});const _=S(l)===H.element?C(l):null;if(_)for(let g=_.length-1;g>=0;--g){const y=_[g],F=y&&y.name;typeof F=="string"&&Qn(l,y,F)}},Pe=function(l,f,_){if(!_)try{_=f.getAttributeNode(l)}catch{_=null}et(t.removed,{attribute:_||null,from:f});try{_?h(f,_):f.removeAttribute(l)}catch{try{f.removeAttribute(l)}catch{}}if(l==="is")if(Oe||_t)try{Ce(f)}catch{}else try{f.setAttribute(l,"")}catch{}},er=function(l){const f=C(l);if(f)for(let _=f.length-1;_>=0;--_){const g=f[_],y=g&&g.name;typeof y!="string"||J[$(y)]||Qn(l,g,y)}},Yt=function(l,f){let _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const g=[l];for(;g.length>0;){const y=g.pop();if(f(y)===!1)continue;if(_&&S(y)===H.element){const B=x(y);xe(B)&&g.push(B)}const F=A(y);if(F)for(let B=F.length-1;B>=0;--B)g.push(F[B])}},Xt=function(l){Yt(l,f=>{S(f)===H.element&&er(f)})},Gt=function(l){const f=[];return Yt(l,_=>{f.push(_)},!0),f},no=function(l,f){const _=dn();be(Gt(l),g=>{S(g)===H.element&&mn(_,g)}),be(f,g=>{S(g)===H.element&&!tt(_,g)&&er(g)})},tr=function(l,f){let _=!1;return be(t.removed,g=>{g.element&&(_=_||g.element===l,Xt(g.element))}),no(l,f),_},ro=8,io=function(l,f){const _=Te;let g=null;const y=()=>(g||(g=dn(),be(f,F=>{mn(g,F)})),g);for(let F=0;;F++){const B=Gt(l),Z=[l];let he=!1;if(be(B,te=>{S(te)===H.documentFragment?et(Z,te):!he&&!tt(_,te)&&(he=tt(y(),te))}),!he)return;if(F>=ro)throw ke("the tree kept changing during in-place sanitization; refusing to return it");be(Z,(te,ne)=>{oo(te,ne>0,l,y())})}},oo=function(l,f,_,g){const y=Vt(l);let F;for(;F=y.nextNode();)!tt(g,F)||tt(Te,F)||(f&&le(P.uponSanitizeShadowNode,F,null),Qt(F,_),en(F,_),xe(F.content)&&Ve(F.content))},so=function(l){Te&&mn(Te,l)},nr=function(l,f){return we?l==="patchsrc"?!0:l==="for"&&f!=="label"&&f!=="output":!1},uo=function(l){we&&Yt(l,f=>{const _=S(f);if(_===H.processingInstruction||_===H.comment&&V(Yr,f.data)){try{m(f)}catch{}return!1}if(_===H.element){const g=f,y=$(z(f));try{g.hasAttribute&&g.hasAttribute("patchsrc")&&g.removeAttribute("patchsrc"),g.hasAttribute&&g.hasAttribute("for")&&nr("for",y)&&g.removeAttribute("for")}catch{}}return!0})},rr=function(l){let f=null,_=null;if(Pt)l=""+l;else{const F=Pr(l,/^[\r\n\t ]+/);_=F&&F[0]}Xe==="application/xhtml+xml"&&Me===fe&&(l=''+l+"");const g=I?Le(l):l;if(Me===fe)try{f=new c().parseFromString(g,Xe)}catch{}if(!f||!f.documentElement){f=Bt.createDocument(Me,"template",null);try{f.documentElement.innerHTML=Jt?N:g}catch{}}const y=f.body||f.documentElement;return l&&_&&y.insertBefore(n.createTextNode(_),y.childNodes[0]||null),Me===fe?Ni.call(f,ye?"html":"body")[0]:ye?f.documentElement:y},Vt=function(l){const f=w?w(l):l.ownerDocument;return Ln.call(f||l,l,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT|a.SHOW_PROCESSING_INSTRUCTION|a.SHOW_CDATA_SECTION,null)},Rt=function(l){return l=nt(l,ji," "),l=nt(l,Ui," "),l=nt(l,Ji," "),l},Kt=function(l){var f;ir(l);const _=(f=l.querySelectorAll)===null||f===void 0?void 0:f.call(l,"template");_&&be(_,g=>{xe(g.content)&&Kt(g.content)})},ir=function(l){l.normalize();const f=w?w(l):l.ownerDocument,_=Ln.call(f||l,l,a.SHOW_TEXT|a.SHOW_COMMENT|a.SHOW_CDATA_SECTION|a.SHOW_PROCESSING_INSTRUCTION,null);let g=_.nextNode();for(;g;)g.data=Rt(g.data),g=_.nextNode()},At=function(l){const f=E?E(l):null;return typeof f!="string"||$(f)!=="form"?!1:typeof l.nodeName!="string"||typeof l.textContent!="string"||typeof l.removeChild!="function"||l.attributes!==C(l)||typeof l.removeAttribute!="function"||typeof l.removeAttributeNode!="function"||typeof l.getAttributeNode!="function"||typeof l.setAttribute!="function"||typeof l.namespaceURI!="string"||typeof l.insertBefore!="function"||typeof l.hasChildNodes!="function"||l.nodeType!==R(l)||l.childNodes!==A(l)},xe=function(l){if(!R||typeof l!="object"||l===null)return!1;try{return R(l)===H.documentFragment}catch{return!1}},Ge=function(l){if(!R||typeof l!="object"||l===null)return!1;try{return typeof R(l)=="number"}catch{return!1}};function le(b,l,f){b.length!==0&&be(b,_=>{_.call(t,l,f,Ne)})}const lo=function(l,f){return!!(we&&l.hasChildNodes()&&!Ge(l.firstElementChild)&&V(An,l.textContent)&&V(An,l.innerHTML)||we&&Sl[f]&&S(l)===H.element&&j(l)===fe&&(Ge(l.firstElementChild)||typeof l.textContent=="string"&&V(An,l.textContent))||l.nodeType===H.processingInstruction||we&&l.nodeType===H.comment&&V(Yr,l.data))},Ct=function(l,f){if(l instanceof RegExp)return V(l,f);if(l instanceof Function){for(var _=arguments.length,g=new Array(_>2?_-2:0),y=2;y<_;y++)g[y-2]=arguments[y];return!!l(f,...g)}return!1},ao=function(l,f,_){if(!Ye[f]&&ur(f)&&Ct(ce.tagNameCheck,f))return!1;if(jt&&!Fe[f]&&!Fe[Ie(f)]){const g=D(l),y=A(l);if(y&&g){const F=y.length;for(let B=F-1;B>=0;--B){const Z=l===_?k(y[B],!0):y[B];g.insertBefore(Z,T(l))}}}return Ce(l),!0},or=function(l,f,_,g){return l.length===0?f:f===_||f===g?se(f):f},je=function(l,f){return l===f||D(l)!==null?!1:(Ut&&Xt(l),!0)},Qt=function(l,f){if(so(l),le(P.beforeSanitizeElements,l,null),je(l,f))return!0;if(At(l))return Ce(l),!0;const _=$(z(l));if(U=or(P.uponSanitizeElement,U,Lt,dt),le(P.uponSanitizeElement,l,{tagName:_,allowedTags:U}),je(l,f))return!0;if(lo(l,_))return Ce(l),!0;if(Ye[_]||!(Ae.tagCheck instanceof Function&&Ae.tagCheck(_))&&!U[_]){const g=ao(l,_,f);return g===!1&&(le(P.afterSanitizeElements,l,null),je(l,f))?!0:g}if(S(l)===H.element&&!to(l)||(_==="noscript"||_==="noembed"||_==="noframes")&&V(Fl,l.innerHTML))return Ce(l),!0;if(ge&&l.nodeType===H.text){const g=Rt(l.textContent);l.textContent!==g&&(et(t.removed,{element:l.cloneNode()}),l.textContent=g)}return le(P.afterSanitizeElements,l,null),je(l,f)},sr=function(l,f,_){if(Mn[f]||nr(f,l)||jn&&(f==="id"||f==="name")&&(_ in n||_ in Vi))return!1;const g=J[f]||Ae.attributeCheck instanceof Function&&Ae.attributeCheck(f,l);return zt&&V(Wi,f)||Nn&&V($i,f)?!0:g?Hn[f]||V(zn,nt(_,On,""))||(f==="src"||f==="xlink:href"||f==="href")&&l!=="script"&&jr(_,"data:")===0&&$n[l]||Pn&&!V(qi,nt(_,On,""))?!0:!_:ur(l)&&Ct(ce.tagNameCheck,l)&&Ct(ce.attributeNameCheck,f,l)||f==="is"&&ce.allowCustomizedBuiltInElements&&Ct(ce.tagNameCheck,_)},co=O({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ur=function(l){return!co[Ie(l)]&&V(Hi,l)},fo=function(l,f,_,g){if(I&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!_)switch(d.getAttributeType(l,f)){case"TrustedHTML":return Le(g);case"TrustedScriptURL":return Oi(g)}return g},ho=function(l,f,_,g){try{return _?l.setAttributeNS(_,f,g):l.setAttribute(f,g),At(l)?(Ce(l),!1):!0}catch{return Pe(f,l),!1}},lr=function(l,f){return we&&V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)?!0:Ie(l)==="attributename"&&Pr(f,"href")!==null},en=function(l,f){if(le(P.beforeSanitizeAttributes,l,null),je(l,f))return;const _=l.attributes;if(!_||At(l))return;J=or(P.uponSanitizeAttribute,J,Ot,mt);const g={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let y=_.length;const F=$(l.nodeName);for(;y--;){const B=_[y],Z=B.name,he=B.namespaceURI,te=B.value,ne=$(Z),Ue=te;let re=Z==="value"?Ue:hl(Ue),ar=!1;if(g.attrName=ne,g.attrValue=re,g.keepAttr=!0,g.forceKeepAttr=void 0,le(P.uponSanitizeAttribute,l,g),re=g.attrValue,Un&&(ne==="id"||ne==="name")&&jr(re,Jn)!==0&&(Pe(Z,l,B),re=Jn+re,ar=!0),lr(Z,re)){Pe(Z,l,B);continue}if(!g.forceKeepAttr){if(!g.keepAttr){Pe(Z,l,B);continue}if(!Mt&&V(Xr,re)){Pe(Z,l,B);continue}if(ge&&(re=Rt(re)),!sr(F,ne,re)){Pe(Z,l,B);continue}re=fo(F,ne,he,re),re!==Ue&&ho(l,Z,he,re)&&ar&&Nr(t.removed)}}le(P.afterSanitizeAttributes,l,null),je(l,f)},Ve=function(l){let f=null;const _=Vt(l);for(le(P.beforeSanitizeShadowDOM,l,null);f=_.nextNode();)if(le(P.uponSanitizeShadowNode,f,null),Qt(f,l),en(f,l),xe(f.content)&&Ve(f.content),S(f)===H.element){const g=x(f);xe(g)&&(tn(g),Ve(g))}ge&&ir(l),le(P.afterSanitizeShadowDOM,l,null)},tn=function(l){const f=[{node:l,shadow:null}];for(;f.length>0;){const _=f.pop();if(_.shadow){Ve(_.shadow);continue}const g=_.node,y=S(g)===H.element,F=A(g);if(F)for(let B=F.length-1;B>=0;--B)f.push({node:F[B],shadow:null});if(y){const B=E?E(g):null;if(typeof B=="string"&&$(B)==="template"){const Z=g.content;xe(Z)&&f.push({node:Z,shadow:null})}}if(y){const B=x(g);xe(B)&&f.push({node:null,shadow:B},{node:B,shadow:null})}}};return t.sanitize=function(b){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,_=null,g=null,y=null;if(Jt=!b,Jt&&(b=""),typeof b!="string"&&!Ge(b)&&(b=_l(b),typeof b!="string"))throw ke("dirty is not a string, aborting");if(!t.isSupported)return b;Nt?(U=dt,J=mt):Ht(l),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(U=se(U)),P.uponSanitizeAttribute.length>0&&(J=se(J)),t.removed=[];const F=Ut&&typeof b!="string"&&Ge(b);let B=[];const Z=Te;if(F){uo(b);const ne=z(b);if(typeof ne=="string"){const Ue=$(ne);if(!U[Ue]||Ye[Ue])throw Zt(b),ke("root node is forbidden and cannot be sanitized in-place")}if(At(b))throw Zt(b),ke("root node is clobbered and cannot be sanitized in-place");B=Gt(b),Te=dn()}else if(Ge(b))f=rr(""),_=f.ownerDocument.importNode(b,!0),_.nodeType===H.element&&_.nodeName==="BODY"||_.nodeName==="HTML"?f=_:f.appendChild(_),tn(f);else{if(!Oe&&!ge&&!ye&&b.indexOf("<")===-1)return I&>?Le(b):b;if(f=rr(b),!f)return Oe?null:gt?N:""}f&&Pt&&Ce(f.firstChild);const he=F?b:f;try{F&&tn(b);const ne=Vt(he);for(;g=ne.nextNode();)Qt(g,he),en(g,he),xe(g.content)&&Ve(g.content);F&&io(b,B)}catch(ne){throw F&&(Zt(b),tr(b,B)),ne}finally{Te=Z}if(F){if(tr(b,B))throw ke("a node selected for removal could not be safely returned; refusing to sanitize in place");return ge&&Kt(b),b}if(Oe){if(ge&&Kt(f),_t)for(y=Mi.call(f.ownerDocument);f.firstChild;)y.appendChild(f.firstChild);else y=f;return(J.shadowroot||J.shadowrootmode)&&(y=Pi.call(i,y,!0)),y}let te=ye?f.outerHTML:f.innerHTML;return ye&&U["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&V(yl,f.ownerDocument.doctype.name)&&(te=" `+te),ge&&(te=Rt(te)),I&>?Le(te):te},t.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(b),Nt=!0,dt=U,mt=J},t.clearConfig=function(){Ne=null,Nt=!1,dt=null,mt=null,I=Q,N=""},t.isValidAttribute=function(b,l,f){Ne||Ht({});const _=$(b),g=$(l);return typeof f=="string"&&(lr(l,f)||!Mt&&V(Xr,f))?!1:sr(_,g,f)},t.addHook=function(b,l){typeof l=="function"&&ie(P,b)&&et(P[b],l)},t.removeHook=function(b,l){if(ie(P,b)){if(l!==void 0){const f=al(P[b],l);return f===-1?void 0:fl(P[b],f,1)[0]}return Nr(P[b])}},t.removeHooks=function(b){ie(P,b)&&(P[b]=[])},t.removeAllHooks=function(){P=Gr()},t}var Ll=Bi();const Tn="noopener noreferrer nofollow",Ol=/^\[([ xX])\] /;function Li(e){const t=e.trim().replace(/[\u0000-\u001f\u007f\s]+/g,"");return/^https:\/\/[^/\\]/i.test(t)||/^\/(?![/\\])/.test(t)?t:null}const ft=new nl({html:!1,linkify:!1,typographer:!1});ft.validateLink=()=>!0;function zl(e,t,n){const i=e[t+2];if(e[t+1]?.type!=="paragraph_open"||i?.type!=="inline"||!i.children)return;const r=Ol.exec(i.content),o=i.children[0];if(!r||o?.type!=="text"||!o.content.startsWith(r[0]))return;o.content=o.content.slice(r[0].length),i.content=i.content.slice(r[0].length),e[t].attrJoin("class","task-list-item");const s=new n.Token("html_inline","",0);s.content=r[1]===" "?'':'',i.children.unshift(s)}function Ml(e,t){const n=[],i=[];for(const r of e){if(r.type==="link_open"){const o=Ao(String(r.attrGet("href")??""));if(i.push(!o),!o)continue;(/^https?:/i.test(o)||t.env?.newTabLinks&&o.startsWith("/"))&&(r.attrSet("target","_blank"),r.attrSet("rel",Tn))}else if(r.type==="link_close"){if(i.pop())continue}else if(r.type==="image"){const o=Li(String(r.attrGet("src")??""));if(!o){const s=new t.Token("text","",0);s.content=t.md.renderer.renderInlineAsText(r.children??[],t.md.options,t.env),n.push(s);continue}r.attrSet("loading","lazy"),r.attrSet("decoding","async"),/^https:/i.test(o)&&r.attrSet("referrerpolicy","no-referrer")}n.push(r)}return n}ft.core.ruler.push("bm_safe",e=>{const t=e.tokens;for(let n=0;n`
${r.renderToken(e,t,n)}`;ft.renderer.rules.table_close=(e,t,n,i,r)=>`${r.renderToken(e,t,n)}
`;const Nl={ALLOWED_TAGS:["p","h2","h3","h4","h5","h6","ul","ol","li","blockquote","pre","code","hr","strong","em","s","a","img","table","thead","tbody","tr","th","td","div","input","br"],ALLOWED_ATTR:["href","target","rel","src","alt","title","loading","decoding","referrerpolicy","class","style","type","checked","disabled","role","aria-label","tabindex"],ADD_URI_SAFE_ATTR:["target","rel","loading","decoding","referrerpolicy","type","checked","disabled","aria-label","tabindex"],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#|\/(?![/\\]))/i,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1};let xn=null;function Pl(){if(xn)return xn;const e=Ll(window);return e.setConfig(Nl),e.addHook("uponSanitizeAttribute",(t,n)=>{const i=t.nodeName.toLowerCase(),r=n.attrValue.trim();let o=!0;n.attrName==="style"?o=(i==="th"||i==="td")&&/^text-align:\s*(left|center|right);?$/i.test(r):n.attrName==="class"?o=i==="li"&&r==="task-list-item"||i==="div"&&r==="table-scroll":n.attrName==="type"&&(o=i==="input"&&r==="checkbox"),o||(n.keepAttr=!1)}),e.addHook("afterSanitizeAttributes",t=>{t.nodeName==="IMG"?Li(t.getAttribute("src")??"")||t.replaceWith(t.ownerDocument.createTextNode(t.getAttribute("alt")??"")):t.nodeName==="A"?t.hasAttribute("target")&&(t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_blank"),t.getAttribute("rel")!==Tn&&t.setAttribute("rel",Tn)):t.nodeName==="INPUT"&&(t.getAttribute("type")!=="checkbox"?t.remove():t.hasAttribute("disabled")||t.setAttribute("disabled",""))}),xn=e,e}function $l(e,t={}){if(!e)return"";const n=e.replace(/\r\n?/g,` `).replace(/\u0000/g,""),i=ft.render(n,{newTabLinks:!!t.newTabLinks});return String(Pl().sanitize(i)).trim()}export{Wl as _,$l as r};