pcm-agents 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{g as t,r as e,c as o,h as r}from"./p-DaMwkrv5.js";import{a as n,s as i}from"./p-B2EtEi7v.js";function s(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let a=s();function l(t){a=t}const d=/[&<>"']/;const c=new RegExp(d.source,"g");const h=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const p=new RegExp(h.source,"g");const m={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const u=t=>m[t];function b(t,e){if(e){if(d.test(t)){return t.replace(c,u)}}else{if(h.test(t)){return t.replace(p,u)}}return t}const f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(t){return t.replace(f,((t,e)=>{e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}const y=/(^|[^\[])\^/g;function w(t,e){t=typeof t==="string"?t:t.source;e=e||"";const o={replace:(e,r)=>{r=typeof r==="object"&&"source"in r?r.source:r;r=r.replace(y,"$1");t=t.replace(e,r);return o},getRegex:()=>new RegExp(t,e)};return o}function k(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch(t){return null}return t}const x={exec:()=>null};function v(t,e){const o=t.replace(/\|/g,((t,e,o)=>{let r=false;let n=e;while(--n>=0&&o[n]==="\\")r=!r;if(r){return"|"}else{return" |"}})),r=o.split(/ \|/);let n=0;if(!r[0].trim()){r.shift()}if(r.length>0&&!r[r.length-1].trim()){r.pop()}if(e){if(r.length>e){r.splice(e)}else{while(r.length<e)r.push("")}}for(;n<r.length;n++){r[n]=r[n].trim().replace(/\\\|/g,"|")}return r}function z(t,e,o){const r=t.length;if(r===0){return""}let n=0;while(n<r){const o=t.charAt(r-n-1);if(o===e&&true){n++}else{break}}return t.slice(0,r-n)}function C(t,e){if(t.indexOf(e[1])===-1){return-1}let o=0;for(let r=0;r<t.length;r++){if(t[r]==="\\"){r++}else if(t[r]===e[0]){o++}else if(t[r]===e[1]){o--;if(o<0){return r}}}return-1}function _(t,e,o,r){const n=e.href;const i=e.title?b(e.title):null;const s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=true;const t={type:"link",raw:o,href:n,title:i,text:s,tokens:r.inlineTokens(s)};r.state.inLink=false;return t}return{type:"image",raw:o,href:n,title:i,text:b(s)}}function $(t,e){const o=t.match(/^(\s+)(?:```)/);if(o===null){return e}const r=o[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(e===null){return t}const[o]=e;if(o.length>=r.length){return t.slice(r.length)}return t})).join("\n")}class S{options;rules;lexer;constructor(t){this.options=t||a}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0){return{type:"space",raw:e[0]}}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:!this.options.pedantic?z(t,"\n"):t}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0];const o=$(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:o}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=z(t,"#");if(this.options.pedantic){t=e.trim()}else if(!e||/ $/.test(e)){t=e.trim()}}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e){return{type:"hr",raw:e[0]}}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){const t=z(e[0].replace(/^ *>[ \t]?/gm,""),"\n");const o=this.lexer.state.top;this.lexer.state.top=true;const r=this.lexer.blockTokens(t);this.lexer.state.top=o;return{type:"blockquote",raw:e[0],tokens:r,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim();const r=o.length>1;const n={type:"list",raw:"",ordered:r,start:r?+o.slice(0,-1):"",loose:false,items:[]};o=r?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`;if(this.options.pedantic){o=r?o:"[*+-]"}const i=new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="";let a="";let l=false;while(t){let o=false;if(!(e=i.exec(t))){break}if(this.rules.block.hr.test(t)){break}s=e[0];t=t.substring(s.length);let r=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length)));let d=t.split("\n",1)[0];let c=0;if(this.options.pedantic){c=2;a=r.trimStart()}else{c=e[2].search(/[^ ]/);c=c>4?1:c;a=r.slice(c);c+=e[1].length}let h=false;if(!r&&/^ *$/.test(d)){s+=d+"\n";t=t.substring(d.length+1);o=true}if(!o){const e=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const o=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const n=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`);const i=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);while(t){const l=t.split("\n",1)[0];d=l;if(this.options.pedantic){d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(n.test(d)){break}if(i.test(d)){break}if(e.test(d)){break}if(o.test(t)){break}if(d.search(/[^ ]/)>=c||!d.trim()){a+="\n"+d.slice(c)}else{if(h){break}if(r.search(/[^ ]/)>=4){break}if(n.test(r)){break}if(i.test(r)){break}if(o.test(r)){break}a+="\n"+d}if(!h&&!d.trim()){h=true}s+=l+"\n";t=t.substring(l.length+1);r=d.slice(c)}}if(!n.loose){if(l){n.loose=true}else if(/\n *\n *$/.test(s)){l=true}}let p=null;let m;if(this.options.gfm){p=/^\[[ xX]\] /.exec(a);if(p){m=p[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}n.items.push({type:"list_item",raw:s,task:!!p,checked:m,loose:false,text:a,tokens:[]});n.raw+=s}n.items[n.items.length-1].raw=s.trimEnd();n.items[n.items.length-1].text=a.trimEnd();n.raw=n.raw.trimEnd();for(let t=0;t<n.items.length;t++){this.lexer.state.top=false;n.items[t].tokens=this.lexer.blockTokens(n.items[t].text,[]);if(!n.loose){const e=n.items[t].tokens.filter((t=>t.type==="space"));const o=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));n.loose=o}}if(n.loose){for(let t=0;t<n.items.length;t++){n.items[t].loose=true}}return n}}html(t){const e=this.rules.block.html.exec(t);if(e){const t={type:"html",block:true,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]};return t}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," ");const o=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"";const r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:o,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(e){if(!/[:|]/.test(e[2])){return}const t={type:"table",raw:e[0],header:v(e[1]).map((t=>({text:t,tokens:[]}))),align:e[2].replace(/^\||\| *$/g,"").split("|"),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){let e=t.align.length;let o,r,n,i;for(o=0;o<e;o++){const e=t.align[o];if(e){if(/^ *-+: *$/.test(e)){t.align[o]="right"}else if(/^ *:-+: *$/.test(e)){t.align[o]="center"}else if(/^ *:-+ *$/.test(e)){t.align[o]="left"}else{t.align[o]=null}}}e=t.rows.length;for(o=0;o<e;o++){t.rows[o]=v(t.rows[o],t.header.length).map((t=>({text:t,tokens:[]})))}e=t.header.length;for(r=0;r<e;r++){t.header[r].tokens=this.lexer.inline(t.header[r].text)}e=t.rows.length;for(r=0;r<e;r++){i=t.rows[r];for(n=0;n<i.length;n++){i[n].tokens=this.lexer.inline(i[n].text)}}return t}}}lheading(t){const 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){const e=this.rules.block.paragraph.exec(t);if(e){const t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const 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){const e=this.rules.inline.escape.exec(t);if(e){return{type:"escape",raw:e[0],text:b(e[1])}}}tag(t){const e=this.rules.inline.tag.exec(t);if(e){if(!this.lexer.state.inLink&&/^<a /i.test(e[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(e[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:e[0]}}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t)){return}const e=z(t.slice(0,-1),"\\");if((t.length-e.length)%2===0){return}}else{const t=C(e[2],"()");if(t>-1){const o=e[0].indexOf("!")===0?5:4;const r=o+e[1].length+t;e[2]=e[2].substring(0,t);e[0]=e[0].substring(0,r).trim();e[3]=""}}let o=e[2];let r="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);if(t){o=t[1];r=t[3]}}else{r=e[3]?e[3].slice(1,-1):""}o=o.trim();if(/^</.test(o)){if(this.options.pedantic&&!/>$/.test(t)){o=o.slice(1)}else{o=o.slice(1,-1)}}return _(e,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:r?r.replace(this.rules.inline._escapes,"$1"):r},e[0],this.lexer)}}reflink(t,e){let o;if((o=this.rules.inline.reflink.exec(t))||(o=this.rules.inline.nolink.exec(t))){let t=(o[2]||o[1]).replace(/\s+/g," ");t=e[t.toLowerCase()];if(!t){const t=o[0].charAt(0);return{type:"text",raw:t,text:t}}return _(o,t,o[0],this.lexer)}}emStrong(t,e,o=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r)return;if(r[3]&&o.match(/[\p{L}\p{N}]/u))return;const n=r[1]||r[2]||"";if(!n||!o||this.rules.inline.punctuation.exec(o)){const o=[...r[0]].length-1;let n,i,s=o,a=0;const l=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;l.lastIndex=0;e=e.slice(-1*t.length+o);while((r=l.exec(e))!=null){n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6];if(!n)continue;i=[...n].length;if(r[3]||r[4]){s+=i;continue}else if(r[5]||r[6]){if(o%3&&!((o+i)%3)){a+=i;continue}}s-=i;if(s>0)continue;i=Math.min(i,i+s+a);const e=[...r[0]][0].length;const l=t.slice(0,o+r.index+e+i);if(Math.min(o,i)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const o=/[^ ]/.test(t);const r=/^ /.test(t)&&/ $/.test(t);if(o&&r){t=t.substring(1,t.length-1)}t=b(t,true);return{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e){return{type:"br",raw:e[0]}}}del(t){const 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){const e=this.rules.inline.autolink.exec(t);if(e){let t,o;if(e[2]==="@"){t=b(e[1]);o="mailto:"+t}else{t=b(e[1]);o=t}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,o;if(e[2]==="@"){t=b(e[0]);o="mailto:"+t}else{let r;do{r=e[0];e[0]=this.rules.inline._backpedal.exec(e[0])[0]}while(r!==e[0]);t=b(e[0]);if(e[1]==="www."){o="http://"+e[0]}else{o=e[0]}}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;if(this.lexer.state.inRawBlock){t=e[0]}else{t=b(e[0])}return{type:"text",raw:e[0],text:t}}}}const M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:x,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};M._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;M._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;M.def=w(M.def).replace("label",M._label).replace("title",M._title).getRegex();M.bullet=/(?:[*+-]|\d{1,9}[.)])/;M.listItemStart=w(/^( *)(bull) */).replace("bull",M.bullet).getRegex();M.list=w(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex();M._tag="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|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";M._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;M.html=w(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();M.lheading=w(M.lheading).replace(/bull/g,M.bullet).getRegex();M.paragraph=w(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.blockquote=w(M.blockquote).replace("paragraph",M.paragraph).getRegex();M.normal={...M};M.gfm={...M.normal,table:"^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};M.gfm.table=w(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.gfm.paragraph=w(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.pedantic={...M.normal,html:w("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:x,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const A={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:x,tag:"^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:x,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};A._punctuation="\\p{P}$+<=>`^|~";A.punctuation=w(A.punctuation,"u").replace(/punctuation/g,A._punctuation).getRegex();A.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;A.anyPunctuation=/\\[punct]/g;A._escapes=/\\([punct])/g;A._comment=w(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex();A.emStrong.lDelim=w(A.emStrong.lDelim,"u").replace(/punct/g,A._punctuation).getRegex();A.emStrong.rDelimAst=w(A.emStrong.rDelimAst,"gu").replace(/punct/g,A._punctuation).getRegex();A.emStrong.rDelimUnd=w(A.emStrong.rDelimUnd,"gu").replace(/punct/g,A._punctuation).getRegex();A.anyPunctuation=w(A.anyPunctuation,"gu").replace(/punct/g,A._punctuation).getRegex();A._escapes=w(A._escapes,"gu").replace(/punct/g,A._punctuation).getRegex();A._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;A._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])?)+(?![-_])/;A.autolink=w(A.autolink).replace("scheme",A._scheme).replace("email",A._email).getRegex();A._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;A.tag=w(A.tag).replace("comment",A._comment).replace("attribute",A._attribute).getRegex();A._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;A._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;A._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;A.link=w(A.link).replace("label",A._label).replace("href",A._href).replace("title",A._title).getRegex();A.reflink=w(A.reflink).replace("label",A._label).replace("ref",M._label).getRegex();A.nolink=w(A.nolink).replace("ref",M._label).getRegex();A.reflinkSearch=w(A.reflinkSearch,"g").replace("reflink",A.reflink).replace("nolink",A.nolink).getRegex();A.normal={...A};A.pedantic={...A.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",A._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",A._label).getRegex()};A.gfm={...A.normal,escape:w(A.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\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.!#$%&'*+\/=?_`{\|}~-]+@)))/};A.gfm.url=w(A.gfm.url,"i").replace("email",A.gfm._extended_email).getRegex();A.breaks={...A.gfm,br:w(A.br).replace("{2,}","*").getRegex(),text:w(A.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class E{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||a;this.options.tokenizer=this.options.tokenizer||new S;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const e={block:M.normal,inline:A.normal};if(this.options.pedantic){e.block=M.pedantic;e.inline=A.pedantic}else if(this.options.gfm){e.block=M.gfm;if(this.options.breaks){e.inline=A.breaks}else{e.inline=A.gfm}}this.tokenizer.rules=e}static get rules(){return{block:M,inline:A}}static lex(t,e){const o=new E(e);return o.lex(t)}static lexInline(t,e){const o=new E(e);return o.inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,"\n");this.blockTokens(t,this.tokens);let e;while(e=this.inlineQueue.shift()){this.inlineTokens(e.src,e.tokens)}return this.tokens}blockTokens(t,e=[]){if(this.options.pedantic){t=t.replace(/\t/g," ").replace(/^ +$/gm,"")}else{t=t.replace(/^( *)(\t+)/gm,((t,e,o)=>e+" ".repeat(o.length)))}let o;let r;let n;let i;while(t){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);if(o.raw.length===1&&e.length>0){e[e.length-1].raw+="\n"}else{e.push(o)}continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.raw;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else if(!this.tokens.links[o.tag]){this.tokens.links[o.tag]={href:o.href,title:o.title}}continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length);e.push(o);continue}n=t;if(this.options.extensions&&this.options.extensions.startBlock){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){n=t.substring(0,e+1)}}if(this.state.top&&(o=this.tokenizer.paragraph(n))){r=e[e.length-1];if(i&&r.type==="paragraph"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}i=n.length!==t.length;t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&r.type==="text"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}this.state.top=true;return e}inline(t,e=[]){this.inlineQueue.push({src:t,tokens:e});return e}inlineTokens(t,e=[]){let o,r,n;let i=t;let s;let a,l;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0){while((s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null){if(t.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))){i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null){i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null){i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(t){if(!a){l=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.emStrong(t,i,l)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length);e.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length);e.push(o);continue}n=t;if(this.options.extensions&&this.options.extensions.startInline){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){n=t.substring(0,e+1)}}if(o=this.tokenizer.inlineText(n)){t=t.substring(o.raw.length);if(o.raw.slice(-1)!=="_"){l=o.raw.slice(-1)}a=true;r=e[e.length-1];if(r&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}return e}}class I{options;constructor(t){this.options=t||a}code(t,e,o){const r=(e||"").match(/^\S*/)?.[0];t=t.replace(/\n$/,"")+"\n";if(!r){return"<pre><code>"+(o?t:b(t,true))+"</code></pre>\n"}return'<pre><code class="language-'+b(r)+'">'+(o?t:b(t,true))+"</code></pre>\n"}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t,e){return t}heading(t,e,o){return`<h${e}>${t}</h${e}>\n`}hr(){return"<hr>\n"}list(t,e,o){const r=e?"ol":"ul";const n=e&&o!==1?' start="'+o+'"':"";return"<"+r+n+">\n"+t+"</"+r+">\n"}listitem(t,e,o){return`<li>${t}</li>\n`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>\n`}table(t,e){if(e)e=`<tbody>${e}</tbody>`;return"<table>\n"+"<thead>\n"+t+"</thead>\n"+e+"</table>\n"}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e){const o=e.header?"th":"td";const r=e.align?`<${o} align="${e.align}">`:`<${o}>`;return r+t+`</${o}>\n`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,o){const r=k(t);if(r===null){return o}t=r;let n='<a href="'+t+'"';if(e){n+=' title="'+e+'"'}n+=">"+o+"</a>";return n}image(t,e,o){const r=k(t);if(r===null){return o}t=r;let n=`<img src="${t}" alt="${o}"`;if(e){n+=` title="${e}"`}n+=">";return n}text(t){return t}}class R{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,o){return""+o}image(t,e,o){return""+o}br(){return""}}class T{options;renderer;textRenderer;constructor(t){this.options=t||a;this.options.renderer=this.options.renderer||new I;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new R}static parse(t,e){const o=new T(e);return o.parse(t)}static parseInline(t,e){const o=new T(e);return o.parseInline(t)}parse(t,e=true){let o="";for(let r=0;r<t.length;r++){const n=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const t=n;const e=this.options.extensions.renderers[t.type].call({parser:this},t);if(e!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){o+=e||"";continue}}switch(n.type){case"space":{continue}case"hr":{o+=this.renderer.hr();continue}case"heading":{const t=n;o+=this.renderer.heading(this.parseInline(t.tokens),t.depth,g(this.parseInline(t.tokens,this.textRenderer)));continue}case"code":{const t=n;o+=this.renderer.code(t.text,t.lang,!!t.escaped);continue}case"table":{const t=n;let e="";let r="";for(let e=0;e<t.header.length;e++){r+=this.renderer.tablecell(this.parseInline(t.header[e].tokens),{header:true,align:t.align[e]})}e+=this.renderer.tablerow(r);let i="";for(let e=0;e<t.rows.length;e++){const o=t.rows[e];r="";for(let e=0;e<o.length;e++){r+=this.renderer.tablecell(this.parseInline(o[e].tokens),{header:false,align:t.align[e]})}i+=this.renderer.tablerow(r)}o+=this.renderer.table(e,i);continue}case"blockquote":{const t=n;const e=this.parse(t.tokens);o+=this.renderer.blockquote(e);continue}case"list":{const t=n;const e=t.ordered;const r=t.start;const i=t.loose;let s="";for(let e=0;e<t.items.length;e++){const o=t.items[e];const r=o.checked;const n=o.task;let a="";if(o.task){const t=this.renderer.checkbox(!!r);if(i){if(o.tokens.length>0&&o.tokens[0].type==="paragraph"){o.tokens[0].text=t+" "+o.tokens[0].text;if(o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"){o.tokens[0].tokens[0].text=t+" "+o.tokens[0].tokens[0].text}}else{o.tokens.unshift({type:"text",text:t+" "})}}else{a+=t+" "}}a+=this.parse(o.tokens,i);s+=this.renderer.listitem(a,n,!!r)}o+=this.renderer.list(s,e,r);continue}case"html":{const t=n;o+=this.renderer.html(t.text,t.block);continue}case"paragraph":{const t=n;o+=this.renderer.paragraph(this.parseInline(t.tokens));continue}case"text":{let i=n;let s=i.tokens?this.parseInline(i.tokens):i.text;while(r+1<t.length&&t[r+1].type==="text"){i=t[++r];s+="\n"+(i.tokens?this.parseInline(i.tokens):i.text)}o+=e?this.renderer.paragraph(s):s;continue}default:{const t='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}parseInline(t,e){e=e||this.renderer;let o="";for(let r=0;r<t.length;r++){const n=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const t=this.options.extensions.renderers[n.type].call({parser:this},n);if(t!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){o+=t||"";continue}}switch(n.type){case"escape":{const t=n;o+=e.text(t.text);break}case"html":{const t=n;o+=e.html(t.text);break}case"link":{const t=n;o+=e.link(t.href,t.title,this.parseInline(t.tokens,e));break}case"image":{const t=n;o+=e.image(t.href,t.title,t.text);break}case"strong":{const t=n;o+=e.strong(this.parseInline(t.tokens,e));break}case"em":{const t=n;o+=e.em(this.parseInline(t.tokens,e));break}case"codespan":{const t=n;o+=e.codespan(t.text);break}case"br":{o+=e.br();break}case"del":{const t=n;o+=e.del(this.parseInline(t.tokens,e));break}case"text":{const t=n;o+=e.text(t.text);break}default:{const t='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}}class j{options;constructor(t){this.options=t||a}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}class F{defaults=s();options=this.setOptions;parse=this.#t(E.lex,T.parse);parseInline=this.#t(E.lexInline,T.parseInline);Parser=T;Renderer=I;TextRenderer=R;Lexer=E;Tokenizer=S;Hooks=j;constructor(...t){this.use(...t)}walkTokens(t,e){let o=[];for(const r of t){o=o.concat(e.call(this,r));switch(r.type){case"table":{const t=r;for(const r of t.header){o=o.concat(this.walkTokens(r.tokens,e))}for(const r of t.rows){for(const t of r){o=o.concat(this.walkTokens(t.tokens,e))}}break}case"list":{const t=r;o=o.concat(this.walkTokens(t.items,e));break}default:{const t=r;if(this.defaults.extensions?.childTokens?.[t.type]){this.defaults.extensions.childTokens[t.type].forEach((r=>{o=o.concat(this.walkTokens(t[r],e))}))}else if(t.tokens){o=o.concat(this.walkTokens(t.tokens,e))}}}}return o}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const o={...t};o.async=this.defaults.async||o.async||false;if(t.extensions){t.extensions.forEach((t=>{if(!t.name){throw new Error("extension name required")}if("renderer"in t){const o=e.renderers[t.name];if(o){e.renderers[t.name]=function(...e){let r=t.renderer.apply(this,e);if(r===false){r=o.apply(this,e)}return r}}else{e.renderers[t.name]=t.renderer}}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const o=e[t.level];if(o){o.unshift(t.tokenizer)}else{e[t.level]=[t.tokenizer]}if(t.start){if(t.level==="block"){if(e.startBlock){e.startBlock.push(t.start)}else{e.startBlock=[t.start]}}else if(t.level==="inline"){if(e.startInline){e.startInline.push(t.start)}else{e.startInline=[t.start]}}}}if("childTokens"in t&&t.childTokens){e.childTokens[t.name]=t.childTokens}}));o.extensions=e}if(t.renderer){const e=this.defaults.renderer||new I(this.defaults);for(const o in t.renderer){const r=t.renderer[o];const n=o;const i=e[n];e[n]=(...t)=>{let o=r.apply(e,t);if(o===false){o=i.apply(e,t)}return o||""}}o.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new S(this.defaults);for(const o in t.tokenizer){const r=t.tokenizer[o];const n=o;const i=e[n];e[n]=(...t)=>{let o=r.apply(e,t);if(o===false){o=i.apply(e,t)}return o}}o.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new j;for(const o in t.hooks){const r=t.hooks[o];const n=o;const i=e[n];if(j.passThroughHooks.has(o)){e[n]=t=>{if(this.defaults.async){return Promise.resolve(r.call(e,t)).then((t=>i.call(e,t)))}const o=r.call(e,t);return i.call(e,o)}}else{e[n]=(...t)=>{let o=r.apply(e,t);if(o===false){o=i.apply(e,t)}return o}}}o.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens;const r=t.walkTokens;o.walkTokens=function(t){let o=[];o.push(r.call(this,t));if(e){o=o.concat(e.call(this,t))}return o}}this.defaults={...this.defaults,...o}}));return this}setOptions(t){this.defaults={...this.defaults,...t};return this}lexer(t,e){return E.lex(t,e??this.defaults)}parser(t,e){return T.parse(t,e??this.defaults)}#t(t,e){return(o,r)=>{const n={...r};const i={...this.defaults,...n};if(this.defaults.async===true&&n.async===false){if(!i.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}i.async=true}const s=this.#e(!!i.silent,!!i.async);if(typeof o==="undefined"||o===null){return s(new Error("marked(): input parameter is undefined or null"))}if(typeof o!=="string"){return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"))}if(i.hooks){i.hooks.options=i}if(i.async){return Promise.resolve(i.hooks?i.hooks.preprocess(o):o).then((e=>t(e,i))).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>e(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(s)}try{if(i.hooks){o=i.hooks.preprocess(o)}const r=t(o,i);if(i.walkTokens){this.walkTokens(r,i.walkTokens)}let n=e(r,i);if(i.hooks){n=i.hooks.postprocess(n)}return n}catch(t){return s(t)}}}#e(t,e){return o=>{o.message+="\nPlease report this to https://github.com/markedjs/marked.";if(t){const t="<p>An error occurred:</p><pre>"+b(o.message+"",true)+"</pre>";if(e){return Promise.resolve(t)}return t}if(e){return Promise.reject(o)}throw o}}}const q=new F;function L(t,e){return q.parse(t,e)}L.options=L.setOptions=function(t){q.setOptions(t);L.defaults=q.defaults;l(L.defaults);return L};L.getDefaults=s;L.defaults=a;L.use=function(...t){q.use(...t);L.defaults=q.defaults;l(L.defaults);return L};L.walkTokens=function(t,e){return q.walkTokens(t,e)};L.parseInline=q.parseInline;L.Parser=T;L.parser=T.parse;L.Renderer=I;L.TextRenderer=R;L.Lexer=E;L.lexer=E.lex;L.Tokenizer=S;L.Hooks=j;L.parse=L;const U=':host{display:block;width:100%}.message-round{margin-bottom:16px;width:100%}.user-message-container{display:flex;flex-direction:column;align-items:flex-end;margin-bottom:8px}.assistant-message-container{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:8px}.message-bubble{padding:7px 18px;max-width:80%;position:relative}.user-message{background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);font-weight:600;font-size:14px;color:#FFFFFF;border-radius:14px 0 14px 14px}.assistant-message{background-color:#0000000f;border-radius:0 14px 14px 14px;font-weight:600;font-size:14px;color:#00000099}.message-time{font-size:12px;color:#999;margin-top:4px}.user-message-container .message-time{color:rgba(255, 255, 255, 0.7)}.loading-dots{display:flex;align-items:center;padding:12px 16px;background-color:#f0f0f0;border-radius:18px;border-top-left-radius:4px}.loading-dots span{width:8px;height:8px;margin:0 3px;background-color:#999;border-radius:50%;display:inline-block;animation:dot-pulse 1.5s infinite ease-in-out}.loading-dots span:nth-child(2){animation-delay:0.2s}.loading-dots span:nth-child(3){animation-delay:0.4s}@keyframes dot-pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.2);opacity:1}}.file-view{margin-top:8px;padding:8px;background-color:#f5f5f5;border-radius:4px;font-size:14px;word-break:break-all}.input-view{margin-top:8px;border:1px solid #eee;border-radius:4px;overflow:hidden}.input-label{padding:4px 8px;background-color:#f5f5f5;font-size:12px;font-weight:500}.input-value{padding:8px;font-size:14px}.input-metadata{font-size:0.875rem;margin-top:4px}.markdown-body{--base-size-4:0.25rem;--base-size-8:0.5rem;--base-size-16:1rem;--base-size-24:1.5rem;--base-size-40:2.5rem;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#1f6feb;--fgColor-default:#f0f6fc;--fgColor-muted:#9198a1;--fgColor-accent:#4493f8;--fgColor-success:#3fb950;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-done:#ab7df8;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--bgColor-attention-muted:#bb800926;--borderColor-default:#3d444d;--borderColor-muted:#3d444db3;--borderColor-neutral-muted:#3d444db3;--borderColor-accent-emphasis:#1f6feb;--borderColor-success-emphasis:#238636;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-done-emphasis:#8957e5;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-variable:#ffa657;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-invalid-illegal-text:#f0f6fc;--color-prettylights-syntax-invalid-illegal-bg:#8e1519;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.message-actions{position:absolute;top:8px;right:8px;opacity:0;transition:opacity 0.2s ease}.assistant-message:hover .message-actions{opacity:1}.copy-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#6e6e80;display:flex;align-items:center;justify-content:center}.copy-button:hover{background-color:rgba(0, 0, 0, 0.05);color:#000}.copy-button svg{width:16px;height:16px}';const Z=class{message;messageChange;get hostElement(){return t(this)}constructor(t){e(this,t);this.messageChange=o(this,"messageChange");L.setOptions({breaks:true,gfm:true})}copyMessageContent(){if(this.message.answer){navigator.clipboard.writeText(this.message.answer).then((()=>{console.log("内容已复制到剪贴板")})).catch((t=>{console.error("复制失败:",t)}))}}renderUserMessage(){if(!this.message?.query?.trim())return null;return r("div",{class:"user-message-container"},r("div",{class:"message-bubble user-message"},r("p",null,this.message.query),this.renderInputs()))}renderAssistantMessage(){if(!this.message.answer&&!this.message.isStreaming)return null;const t=this.message.isStreaming&&!this.message.answer;const e=this.message.answer?L(this.message.answer):"";return r("div",{class:"assistant-message-container"},r("div",{class:"message-bubble assistant-message"},r("div",{class:"markdown-content markdown-body",innerHTML:t?`请稍等...`:e})),!t&&this.message.answer&&r("div",{class:"message-actions"},r("button",{class:"copy-button",onClick:()=>this.copyMessageContent(),title:"复制内容"},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},r("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),r("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})))))}renderInputs(){if(!this.message.inputs)return null;return r("div",null,Object.keys(this.message.inputs).map(((t,e)=>{const o=this.message.inputs[t];if(o&&!t.startsWith("hide_")&&t!=="answer"){if(t==="file_url"){return r("div",{key:e,class:"file-view"},o)}else if(t==="file_urls"||t==="fileUrls"){const t=o.split(",");return r("div",{key:e,class:"flex flex-wrap"},t.map(((t,e)=>r("div",{key:e,class:"file-view"},t))))}else if(t==="job_info"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"职位信息"),r("div",{class:"input-value"},o))}else if(t==="rule"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"评估规则"),r("div",{class:"input-value"},o))}else{return r("div",{key:e,class:"input-metadata"},t,": ",`${o}`)}}return null})))}render(){return r("div",{key:"5748f17414b9442b9b791955de38437184fa2f7e",class:"message-round"},this.renderUserMessage(),this.renderAssistantMessage())}};Z.style=U;const P=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:calc(100% - 360px);min-height:200px;max-height:calc(100% - 360px);background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.file-name{font-size:13px;color:#333;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:1rem 1rem;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{border:2px dashed #ddd;border-radius:8px;padding:1rem;cursor:pointer;transition:all 0.3s ease}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.function-select{margin-top:2rem}.function-options{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:1rem}.function-button{padding:0.5rem 1rem;border:1px solid #ddd;border-radius:4px;background:white;cursor:pointer;transition:all 0.3s ease}.function-button:hover{border-color:#1890ff;color:#1890ff}.function-button.selected{background:#1890ff;color:white;border-color:#1890ff}.submit-button{margin-top:1rem;padding:0.8rem 2rem;background:#1890ff;color:white;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all 0.3s ease;width:95%}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;bottom:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:0.8rem;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:1rem;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}";const B=class{constructor(t){e(this,t);this.modalClosed=o(this,"modalClosed");this.streamComplete=o(this,"streamComplete");this.interviewComplete=o(this,"interviewComplete");this.recordingError=o(this,"recordingError");this.recordingStatusChange=o(this,"recordingStatusChange")}modalTitle="在线客服";apiKey="";isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;botId;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return t(this)}streamComplete;selectedFile=null;isUploading=false;uploadedFileInfo=[];defaultQuery="";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;recordingMaxTime=120;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=10;videoRef=null;totalQuestions=2;currentQuestionNumber=0;isInterviewComplete=false;interviewComplete;SCROLL_THRESHOLD=30;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;email="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;welcomeMessage;recordingError;recordingStatusChange;enableVoice=true;handleClose=()=>{this.isOpen=false;this.stopRecording();this.modalClosed.emit()};handleFileChange=async t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const t=new FormData;t.append("file",this.selectedFile);const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:t});const o=await e.json();if(!e.ok){throw new Error(o.message||"文件上传失败")}if(o){this.uploadedFileInfo=[{cos_key:o.cos_key,filename:o.filename,ext:o.ext,presigned_url:o.presigned_url}]}}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();alert(t instanceof Error?t.message:"文件上传失败,请重试")}finally{this.isUploading=false}}handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async sendMessageToAPI(t){this.isLoading=true;let e="";let o="";const r=new Date;const i=`${r.getHours()}:${r.getMinutes().toString().padStart(2,"0")}`;const s=t.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const a=this.messages.length>0?this.messages[this.messages.length-1]:null;if(a&&this.conversationId&&t!=="下一题"){this.saveAnswer(this.conversationId,"1234567890",a.answer,s)}const l=this.currentQuestionNumber>=this.totalQuestions&&t==="下一题";const d={id:`temp-${Date.now()}`,time:i,query:s,answer:"",bot_id:this.botId,isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=d;this.shouldAutoScroll=true;this.scrollToBottom();if(l){this.messages=[...this.messages,d];this.currentStreamingMessage=null;this.isLoading=false;this.isInterviewComplete=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const c={bot_id:this.botId,response_mode:"streaming",conversation_id:this.conversationId,query:s,user:"1234567890"};c.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.email};if(this.uploadedFileInfo.length>0){const t=this.uploadedFileInfo.map((t=>t.cos_key)).join(",");c.inputs.file_urls=t}await n({url:`https://pcm_api.ylzhaopin.com/external/v1/chat-messages`,method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:c,onMessage:t=>{console.log("收到Stream数据:",t);if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.updateUrlWithConversationId(t.conversation_id)}if(t.event==="node_finished"&&t.data.inputs&&t.data.inputs.LLMText){o=t.data.inputs.LLMText;console.log("获取到 LLMText:",o)}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){e+=t.answer;const o={...this.currentStreamingMessage,answer:e,isStreaming:true};this.currentStreamingMessage=o;this.scrollToBottom()}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:t=>{console.error("发生错误:",t);alert(t instanceof Error?t.message:"消息发送失败,请稍后再试");this.messages=[...this.messages,{...d,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{console.log("请求完成");this.isLoading=false;const e=this.currentStreamingMessage;this.messages=[...this.messages,this.currentStreamingMessage];this.currentStreamingMessage=null;if(t==="下一题"||this.currentQuestionNumber===0){this.currentQuestionNumber++}console.log(this.currentQuestionNumber);console.log(t);if(e&&e.answer){const t=o||e.answer;if(t){const e=await this.synthesizeAudio(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}}})}async saveAnswer(t,e,o,r){try{await i({url:"https://pcm_api.ylzhaopin.com/agents/hr_competition/answer",method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:t,user:e,question:o,answer:r}})}catch(t){console.error("保存答案失败:",t)}}handleScroll=()=>{const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:r}=t;const n=o-e-r;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD};scrollToBottom(){if(!this.shouldAutoScroll)return;const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}componentDidRender(){if(this.isLoadingHistory||this.shouldAutoScroll&&this.isOpen){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.scrollTop=t.scrollHeight}}}updateUrlWithConversationId(t){const e=new URLSearchParams(window.location.search);if(!e.get("conversation_id")){const e=new URL(window.location.href);e.searchParams.set("conversation_id",t);window.history.replaceState({},"",e)}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;console.log("加载历史消息...");try{await i({url:`https://pcm_api.ylzhaopin.com/external/v1/messages`,method:"GET",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,bot_id:this.botId,user:"1234567890",limit:20},onMessage:t=>{if(t.data){const e=t.data||[];const o=e.map((t=>{const e=new Date(t.created_at*1e3);const o=e.getHours().toString().padStart(2,"0");const r=e.getMinutes().toString().padStart(2,"0");const n=`${o}:${r}`;const{inputs:i,...s}=t;return{...s,time:n,bot_id:this.botId,isStreaming:false,status:t.status==="error"?"error":"normal"}}));this.messages=o;this.isLoadingHistory=false;requestAnimationFrame((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}))}else{this.isLoadingHistory=false}},onError:t=>{console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false},onComplete:()=>{this.isLoadingHistory=false}})}catch(t){console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false}}async handleIsOpenChange(t){if(t){if(this.conversationId){await this.loadHistoryMessages()}else if(this.welcomeMessage){alert(this.welcomeMessage)}}}handleJobCategorySelect=t=>{this.selectedJobCategory=t};handleDimensionSelect=t=>{if(this.selectedDimensions.includes(t)){this.selectedDimensions=this.selectedDimensions.filter((e=>e!==t))}else{this.selectedDimensions=[...this.selectedDimensions,t]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}const t=confirm('如果您已做好准备请点击"确定"开始面试。');if(!t){return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=10;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const t=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=t;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(t);const e=this.getSupportedMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e})}catch(e){console.warn("指定的MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t)}catch(t){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:t});this.showRecordingUI=false;return}}this.mediaRecorder=o;const r=[];o.ondataavailable=t=>{if(t.data.size>0){r.push(t.data)}};o.onerror=t=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:t});this.stopRecording()};o.onstop=()=>{try{const t=e||"video/mp4";const o=new Blob(r,{type:t});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(t){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:t});this.showRecordingUI=false}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(t){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:t});this.showRecordingUI=false;return}this.recordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-t);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(t){console.error("无法访问摄像头或麦克风:",t);this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:t});this.showRecordingUI=false}}setupVideoPreview(t){setTimeout((()=>{const e=this.hostElement.shadowRoot?.querySelector("video");if(e&&t){try{e.srcObject=t;e.play().catch((t=>{console.error("视频播放失败:",t)}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(t);e.src=o;e.onended=()=>{URL.revokeObjectURL(o)}}catch(t){console.error("创建对象URL失败:",t)}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const t=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){console.log("使用支持的MIME类型:",e);return e}}catch(t){console.warn(`检查MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((t=>t.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const t=this.recordedBlob.type.includes("webm")?"webm":"mp4";const e=`answer.${t}`;const o=new FormData;o.append("file",this.recordedBlob,e);const r=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:o});const n=await r.json();console.log("视频上传结果:",n);if(n&&n.cos_key){await this.saveVideoAnswer(n.cos_key);this.sendNextQuestion()}else{throw new Error("视频上传失败")}}catch(t){console.error("视频上传错误:",t);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:t})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(t){if(!this.conversationId)return;try{const e=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!e)return;await i({url:"https://pcm_api.ylzhaopin.com/agents/hr_competition/answer",method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,user:"1234567890",question:e.answer,file_url:t}})}catch(t){console.error("保存视频答案失败:",t)}}sendNextQuestion(){this.sendMessageToAPI("下一题")}async completeInterview(){if(!this.conversationId)return;try{await i({url:`https://pcm_api.ylzhaopin.com/agents/hr_competition/${this.conversationId}/end`,method:"POST",headers:{authorization:"Bearer "+this.apiKey}})}catch(t){console.error("发送面试完成请求失败:",t)}}async synthesizeAudio(t){try{const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/tts/synthesize_audio",{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+this.apiKey},body:JSON.stringify({text:t})});if(!e.ok){throw new Error("语音合成失败")}const o=await e.blob();return URL.createObjectURL(o)}catch(t){console.error("语音合成错误:",t);throw t}}playAudio(t){return new Promise((e=>{this.isPlayingAudio=true;this.audioUrl=t;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=t;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.play().catch((t=>{console.error("音频播放失败:",t);this.isPlayingAudio=false;this.audioUrl=null;e()}))}))}disconnectedCallback(){if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording()}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=()=>r("div",{class:"video-preview"},r("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:t=>{if(t&&this.recordingStream&&!this.videoRef){this.videoRef=t}}}),r("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},r("span",{class:"recording-dot"}),r("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const i=()=>{if(this.isPlayingAudio){return r("div",{class:"placeholder-status"},r("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return r("div",{class:"placeholder-status"},r("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return r("div",{class:"placeholder-status"},r("p",null,"请等待题目..."))}if(this.waitingToRecord){return r("div",{class:"placeholder-status"},r("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return r("div",{class:"placeholder-status default-status"},r("p",null,"准备中..."))};return r("div",{class:o,style:t},r("div",{class:e},this.isShowHeader&&r("div",{class:"modal-header"},r("div",{class:"header-left"},this.icon&&r("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),r("div",null,this.modalTitle)),this.isNeedClose&&r("button",{class:"close-button",onClick:this.handleClose},r("span",null,"×"))),this.showInitialUpload?r("div",{class:"initial-upload"},r("div",{class:"upload-section"},this.requireResume&&r(r.Fragment,null,r("h3",null,"开始前,请上传您的简历"),r("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?r("div",{class:"file-info"},r("span",null,this.selectedFile.name),r("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):r("div",{class:"upload-placeholder"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",width:"48",height:"48"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m0-16l-4 4m4-4l4 4"})),r("p",null,"点击上传简历"),r("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),r("div",{class:"category-select"},r("h3",null,"请选择您的职能类别(单选)"),r("div",{class:"category-options"},this.jobCategories.map((t=>r("button",{class:{"category-button":true,selected:this.selectedJobCategory===t},onClick:()=>this.handleJobCategorySelect(t)},t))))),r("div",{class:"dimension-select"},r("h3",null,"请选择关注的模块(可多选)"),r("div",{class:"dimension-options"},this.dimensions.map((t=>r("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(t)},onClick:()=>this.handleDimensionSelect(t)},t))))),r("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&r("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):r("div",{style:{height:"100%"}},r("div",{class:"chat-history",onScroll:this.handleScroll},this.isLoadingHistory?r("div",{class:"loading-container"},r("div",{class:"loading-spinner"}),r("p",null,"加载历史消息中...")):r(r.Fragment,null,this.messages.map((t=>r("div",{id:`message_${t.id}`,key:t.id},r("pcm-chat-message",{message:t,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&r("div",{id:`message_${this.currentStreamingMessage.id}`},r("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&r("div",{class:"empty-state"},r("p",null,"请上传简历开始面试")))),r("div",{class:"recording-section"},r("div",{class:"recording-container"},r("div",{class:"video-area"},this.showRecordingUI?n():r("div",{class:"video-preview placeholder"},i())),r("div",{class:"recording-controls"},this.showRecordingUI?r("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):r("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return r("div",{class:"play-audio-container",onClick:this.handlePlayAudio},r("p",null,r("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},r("path",{d:"M8 5v14l11-7z"})),r("span",{style:{verticalAlign:"middle"}},"播放题目")))}return r("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{isOpen:["handleIsOpenChange"]}}};B.style=P;export{Z as pcm_chat_message,B as pcm_hr_chat_modal};
2
- //# sourceMappingURL=p-836c9444.entry.js.map
1
+ import{g as t,r as e,c as o,h as r}from"./p-DaMwkrv5.js";import{a as i,s as n}from"./p-B2EtEi7v.js";function s(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let a=s();function l(t){a=t}const d=/[&<>"']/;const c=new RegExp(d.source,"g");const h=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const p=new RegExp(h.source,"g");const m={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const u=t=>m[t];function f(t,e){if(e){if(d.test(t)){return t.replace(c,u)}}else{if(h.test(t)){return t.replace(p,u)}}return t}const b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(t){return t.replace(b,((t,e)=>{e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}const y=/(^|[^\[])\^/g;function w(t,e){t=typeof t==="string"?t:t.source;e=e||"";const o={replace:(e,r)=>{r=typeof r==="object"&&"source"in r?r.source:r;r=r.replace(y,"$1");t=t.replace(e,r);return o},getRegex:()=>new RegExp(t,e)};return o}function k(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch(t){return null}return t}const x={exec:()=>null};function v(t,e){const o=t.replace(/\|/g,((t,e,o)=>{let r=false;let i=e;while(--i>=0&&o[i]==="\\")r=!r;if(r){return"|"}else{return" |"}})),r=o.split(/ \|/);let i=0;if(!r[0].trim()){r.shift()}if(r.length>0&&!r[r.length-1].trim()){r.pop()}if(e){if(r.length>e){r.splice(e)}else{while(r.length<e)r.push("")}}for(;i<r.length;i++){r[i]=r[i].trim().replace(/\\\|/g,"|")}return r}function z(t,e,o){const r=t.length;if(r===0){return""}let i=0;while(i<r){const o=t.charAt(r-i-1);if(o===e&&true){i++}else{break}}return t.slice(0,r-i)}function C(t,e){if(t.indexOf(e[1])===-1){return-1}let o=0;for(let r=0;r<t.length;r++){if(t[r]==="\\"){r++}else if(t[r]===e[0]){o++}else if(t[r]===e[1]){o--;if(o<0){return r}}}return-1}function _(t,e,o,r){const i=e.href;const n=e.title?f(e.title):null;const s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=true;const t={type:"link",raw:o,href:i,title:n,text:s,tokens:r.inlineTokens(s)};r.state.inLink=false;return t}return{type:"image",raw:o,href:i,title:n,text:f(s)}}function $(t,e){const o=t.match(/^(\s+)(?:```)/);if(o===null){return e}const r=o[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(e===null){return t}const[o]=e;if(o.length>=r.length){return t.slice(r.length)}return t})).join("\n")}class S{options;rules;lexer;constructor(t){this.options=t||a}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0){return{type:"space",raw:e[0]}}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:!this.options.pedantic?z(t,"\n"):t}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0];const o=$(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:o}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=z(t,"#");if(this.options.pedantic){t=e.trim()}else if(!e||/ $/.test(e)){t=e.trim()}}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e){return{type:"hr",raw:e[0]}}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){const t=z(e[0].replace(/^ *>[ \t]?/gm,""),"\n");const o=this.lexer.state.top;this.lexer.state.top=true;const r=this.lexer.blockTokens(t);this.lexer.state.top=o;return{type:"blockquote",raw:e[0],tokens:r,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim();const r=o.length>1;const i={type:"list",raw:"",ordered:r,start:r?+o.slice(0,-1):"",loose:false,items:[]};o=r?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`;if(this.options.pedantic){o=r?o:"[*+-]"}const n=new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="";let a="";let l=false;while(t){let o=false;if(!(e=n.exec(t))){break}if(this.rules.block.hr.test(t)){break}s=e[0];t=t.substring(s.length);let r=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length)));let d=t.split("\n",1)[0];let c=0;if(this.options.pedantic){c=2;a=r.trimStart()}else{c=e[2].search(/[^ ]/);c=c>4?1:c;a=r.slice(c);c+=e[1].length}let h=false;if(!r&&/^ *$/.test(d)){s+=d+"\n";t=t.substring(d.length+1);o=true}if(!o){const e=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const o=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const i=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`);const n=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);while(t){const l=t.split("\n",1)[0];d=l;if(this.options.pedantic){d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(i.test(d)){break}if(n.test(d)){break}if(e.test(d)){break}if(o.test(t)){break}if(d.search(/[^ ]/)>=c||!d.trim()){a+="\n"+d.slice(c)}else{if(h){break}if(r.search(/[^ ]/)>=4){break}if(i.test(r)){break}if(n.test(r)){break}if(o.test(r)){break}a+="\n"+d}if(!h&&!d.trim()){h=true}s+=l+"\n";t=t.substring(l.length+1);r=d.slice(c)}}if(!i.loose){if(l){i.loose=true}else if(/\n *\n *$/.test(s)){l=true}}let p=null;let m;if(this.options.gfm){p=/^\[[ xX]\] /.exec(a);if(p){m=p[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}i.items.push({type:"list_item",raw:s,task:!!p,checked:m,loose:false,text:a,tokens:[]});i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd();i.items[i.items.length-1].text=a.trimEnd();i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++){this.lexer.state.top=false;i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]);if(!i.loose){const e=i.items[t].tokens.filter((t=>t.type==="space"));const o=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));i.loose=o}}if(i.loose){for(let t=0;t<i.items.length;t++){i.items[t].loose=true}}return i}}html(t){const e=this.rules.block.html.exec(t);if(e){const t={type:"html",block:true,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]};return t}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," ");const o=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"";const r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:o,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(e){if(!/[:|]/.test(e[2])){return}const t={type:"table",raw:e[0],header:v(e[1]).map((t=>({text:t,tokens:[]}))),align:e[2].replace(/^\||\| *$/g,"").split("|"),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){let e=t.align.length;let o,r,i,n;for(o=0;o<e;o++){const e=t.align[o];if(e){if(/^ *-+: *$/.test(e)){t.align[o]="right"}else if(/^ *:-+: *$/.test(e)){t.align[o]="center"}else if(/^ *:-+ *$/.test(e)){t.align[o]="left"}else{t.align[o]=null}}}e=t.rows.length;for(o=0;o<e;o++){t.rows[o]=v(t.rows[o],t.header.length).map((t=>({text:t,tokens:[]})))}e=t.header.length;for(r=0;r<e;r++){t.header[r].tokens=this.lexer.inline(t.header[r].text)}e=t.rows.length;for(r=0;r<e;r++){n=t.rows[r];for(i=0;i<n.length;i++){n[i].tokens=this.lexer.inline(n[i].text)}}return t}}}lheading(t){const 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){const e=this.rules.block.paragraph.exec(t);if(e){const t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const 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){const e=this.rules.inline.escape.exec(t);if(e){return{type:"escape",raw:e[0],text:f(e[1])}}}tag(t){const e=this.rules.inline.tag.exec(t);if(e){if(!this.lexer.state.inLink&&/^<a /i.test(e[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(e[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:e[0]}}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t)){return}const e=z(t.slice(0,-1),"\\");if((t.length-e.length)%2===0){return}}else{const t=C(e[2],"()");if(t>-1){const o=e[0].indexOf("!")===0?5:4;const r=o+e[1].length+t;e[2]=e[2].substring(0,t);e[0]=e[0].substring(0,r).trim();e[3]=""}}let o=e[2];let r="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);if(t){o=t[1];r=t[3]}}else{r=e[3]?e[3].slice(1,-1):""}o=o.trim();if(/^</.test(o)){if(this.options.pedantic&&!/>$/.test(t)){o=o.slice(1)}else{o=o.slice(1,-1)}}return _(e,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:r?r.replace(this.rules.inline._escapes,"$1"):r},e[0],this.lexer)}}reflink(t,e){let o;if((o=this.rules.inline.reflink.exec(t))||(o=this.rules.inline.nolink.exec(t))){let t=(o[2]||o[1]).replace(/\s+/g," ");t=e[t.toLowerCase()];if(!t){const t=o[0].charAt(0);return{type:"text",raw:t,text:t}}return _(o,t,o[0],this.lexer)}}emStrong(t,e,o=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r)return;if(r[3]&&o.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||!o||this.rules.inline.punctuation.exec(o)){const o=[...r[0]].length-1;let i,n,s=o,a=0;const l=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;l.lastIndex=0;e=e.slice(-1*t.length+o);while((r=l.exec(e))!=null){i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6];if(!i)continue;n=[...i].length;if(r[3]||r[4]){s+=n;continue}else if(r[5]||r[6]){if(o%3&&!((o+n)%3)){a+=n;continue}}s-=n;if(s>0)continue;n=Math.min(n,n+s+a);const e=[...r[0]][0].length;const l=t.slice(0,o+r.index+e+n);if(Math.min(o,n)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const o=/[^ ]/.test(t);const r=/^ /.test(t)&&/ $/.test(t);if(o&&r){t=t.substring(1,t.length-1)}t=f(t,true);return{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e){return{type:"br",raw:e[0]}}}del(t){const 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){const e=this.rules.inline.autolink.exec(t);if(e){let t,o;if(e[2]==="@"){t=f(e[1]);o="mailto:"+t}else{t=f(e[1]);o=t}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,o;if(e[2]==="@"){t=f(e[0]);o="mailto:"+t}else{let r;do{r=e[0];e[0]=this.rules.inline._backpedal.exec(e[0])[0]}while(r!==e[0]);t=f(e[0]);if(e[1]==="www."){o="http://"+e[0]}else{o=e[0]}}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;if(this.lexer.state.inRawBlock){t=e[0]}else{t=f(e[0])}return{type:"text",raw:e[0],text:t}}}}const M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:x,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};M._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;M._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;M.def=w(M.def).replace("label",M._label).replace("title",M._title).getRegex();M.bullet=/(?:[*+-]|\d{1,9}[.)])/;M.listItemStart=w(/^( *)(bull) */).replace("bull",M.bullet).getRegex();M.list=w(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex();M._tag="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|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";M._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;M.html=w(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();M.lheading=w(M.lheading).replace(/bull/g,M.bullet).getRegex();M.paragraph=w(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.blockquote=w(M.blockquote).replace("paragraph",M.paragraph).getRegex();M.normal={...M};M.gfm={...M.normal,table:"^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};M.gfm.table=w(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.gfm.paragraph=w(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex();M.pedantic={...M.normal,html:w("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:x,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const A={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:x,tag:"^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:x,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};A._punctuation="\\p{P}$+<=>`^|~";A.punctuation=w(A.punctuation,"u").replace(/punctuation/g,A._punctuation).getRegex();A.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;A.anyPunctuation=/\\[punct]/g;A._escapes=/\\([punct])/g;A._comment=w(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex();A.emStrong.lDelim=w(A.emStrong.lDelim,"u").replace(/punct/g,A._punctuation).getRegex();A.emStrong.rDelimAst=w(A.emStrong.rDelimAst,"gu").replace(/punct/g,A._punctuation).getRegex();A.emStrong.rDelimUnd=w(A.emStrong.rDelimUnd,"gu").replace(/punct/g,A._punctuation).getRegex();A.anyPunctuation=w(A.anyPunctuation,"gu").replace(/punct/g,A._punctuation).getRegex();A._escapes=w(A._escapes,"gu").replace(/punct/g,A._punctuation).getRegex();A._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;A._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])?)+(?![-_])/;A.autolink=w(A.autolink).replace("scheme",A._scheme).replace("email",A._email).getRegex();A._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;A.tag=w(A.tag).replace("comment",A._comment).replace("attribute",A._attribute).getRegex();A._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;A._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;A._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;A.link=w(A.link).replace("label",A._label).replace("href",A._href).replace("title",A._title).getRegex();A.reflink=w(A.reflink).replace("label",A._label).replace("ref",M._label).getRegex();A.nolink=w(A.nolink).replace("ref",M._label).getRegex();A.reflinkSearch=w(A.reflinkSearch,"g").replace("reflink",A.reflink).replace("nolink",A.nolink).getRegex();A.normal={...A};A.pedantic={...A.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",A._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",A._label).getRegex()};A.gfm={...A.normal,escape:w(A.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\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.!#$%&'*+\/=?_`{\|}~-]+@)))/};A.gfm.url=w(A.gfm.url,"i").replace("email",A.gfm._extended_email).getRegex();A.breaks={...A.gfm,br:w(A.br).replace("{2,}","*").getRegex(),text:w(A.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class E{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||a;this.options.tokenizer=this.options.tokenizer||new S;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const e={block:M.normal,inline:A.normal};if(this.options.pedantic){e.block=M.pedantic;e.inline=A.pedantic}else if(this.options.gfm){e.block=M.gfm;if(this.options.breaks){e.inline=A.breaks}else{e.inline=A.gfm}}this.tokenizer.rules=e}static get rules(){return{block:M,inline:A}}static lex(t,e){const o=new E(e);return o.lex(t)}static lexInline(t,e){const o=new E(e);return o.inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,"\n");this.blockTokens(t,this.tokens);let e;while(e=this.inlineQueue.shift()){this.inlineTokens(e.src,e.tokens)}return this.tokens}blockTokens(t,e=[]){if(this.options.pedantic){t=t.replace(/\t/g," ").replace(/^ +$/gm,"")}else{t=t.replace(/^( *)(\t+)/gm,((t,e,o)=>e+" ".repeat(o.length)))}let o;let r;let i;let n;while(t){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);if(o.raw.length===1&&e.length>0){e[e.length-1].raw+="\n"}else{e.push(o)}continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.raw;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else if(!this.tokens.links[o.tag]){this.tokens.links[o.tag]={href:o.href,title:o.title}}continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length);e.push(o);continue}i=t;if(this.options.extensions&&this.options.extensions.startBlock){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(this.state.top&&(o=this.tokenizer.paragraph(i))){r=e[e.length-1];if(n&&r.type==="paragraph"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}n=i.length!==t.length;t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&r.type==="text"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}this.state.top=true;return e}inline(t,e=[]){this.inlineQueue.push({src:t,tokens:e});return e}inlineTokens(t,e=[]){let o,r,i;let n=t;let s;let a,l;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0){while((s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null){if(t.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))){n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null){n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null){n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(t){if(!a){l=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.emStrong(t,n,l)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length);e.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length);e.push(o);continue}i=t;if(this.options.extensions&&this.options.extensions.startInline){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(o=this.tokenizer.inlineText(i)){t=t.substring(o.raw.length);if(o.raw.slice(-1)!=="_"){l=o.raw.slice(-1)}a=true;r=e[e.length-1];if(r&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}return e}}class I{options;constructor(t){this.options=t||a}code(t,e,o){const r=(e||"").match(/^\S*/)?.[0];t=t.replace(/\n$/,"")+"\n";if(!r){return"<pre><code>"+(o?t:f(t,true))+"</code></pre>\n"}return'<pre><code class="language-'+f(r)+'">'+(o?t:f(t,true))+"</code></pre>\n"}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t,e){return t}heading(t,e,o){return`<h${e}>${t}</h${e}>\n`}hr(){return"<hr>\n"}list(t,e,o){const r=e?"ol":"ul";const i=e&&o!==1?' start="'+o+'"':"";return"<"+r+i+">\n"+t+"</"+r+">\n"}listitem(t,e,o){return`<li>${t}</li>\n`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>\n`}table(t,e){if(e)e=`<tbody>${e}</tbody>`;return"<table>\n"+"<thead>\n"+t+"</thead>\n"+e+"</table>\n"}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e){const o=e.header?"th":"td";const r=e.align?`<${o} align="${e.align}">`:`<${o}>`;return r+t+`</${o}>\n`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,o){const r=k(t);if(r===null){return o}t=r;let i='<a href="'+t+'"';if(e){i+=' title="'+e+'"'}i+=">"+o+"</a>";return i}image(t,e,o){const r=k(t);if(r===null){return o}t=r;let i=`<img src="${t}" alt="${o}"`;if(e){i+=` title="${e}"`}i+=">";return i}text(t){return t}}class R{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,o){return""+o}image(t,e,o){return""+o}br(){return""}}class T{options;renderer;textRenderer;constructor(t){this.options=t||a;this.options.renderer=this.options.renderer||new I;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new R}static parse(t,e){const o=new T(e);return o.parse(t)}static parseInline(t,e){const o=new T(e);return o.parseInline(t)}parse(t,e=true){let o="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=i;const e=this.options.extensions.renderers[t.type].call({parser:this},t);if(e!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){o+=e||"";continue}}switch(i.type){case"space":{continue}case"hr":{o+=this.renderer.hr();continue}case"heading":{const t=i;o+=this.renderer.heading(this.parseInline(t.tokens),t.depth,g(this.parseInline(t.tokens,this.textRenderer)));continue}case"code":{const t=i;o+=this.renderer.code(t.text,t.lang,!!t.escaped);continue}case"table":{const t=i;let e="";let r="";for(let e=0;e<t.header.length;e++){r+=this.renderer.tablecell(this.parseInline(t.header[e].tokens),{header:true,align:t.align[e]})}e+=this.renderer.tablerow(r);let n="";for(let e=0;e<t.rows.length;e++){const o=t.rows[e];r="";for(let e=0;e<o.length;e++){r+=this.renderer.tablecell(this.parseInline(o[e].tokens),{header:false,align:t.align[e]})}n+=this.renderer.tablerow(r)}o+=this.renderer.table(e,n);continue}case"blockquote":{const t=i;const e=this.parse(t.tokens);o+=this.renderer.blockquote(e);continue}case"list":{const t=i;const e=t.ordered;const r=t.start;const n=t.loose;let s="";for(let e=0;e<t.items.length;e++){const o=t.items[e];const r=o.checked;const i=o.task;let a="";if(o.task){const t=this.renderer.checkbox(!!r);if(n){if(o.tokens.length>0&&o.tokens[0].type==="paragraph"){o.tokens[0].text=t+" "+o.tokens[0].text;if(o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"){o.tokens[0].tokens[0].text=t+" "+o.tokens[0].tokens[0].text}}else{o.tokens.unshift({type:"text",text:t+" "})}}else{a+=t+" "}}a+=this.parse(o.tokens,n);s+=this.renderer.listitem(a,i,!!r)}o+=this.renderer.list(s,e,r);continue}case"html":{const t=i;o+=this.renderer.html(t.text,t.block);continue}case"paragraph":{const t=i;o+=this.renderer.paragraph(this.parseInline(t.tokens));continue}case"text":{let n=i;let s=n.tokens?this.parseInline(n.tokens):n.text;while(r+1<t.length&&t[r+1].type==="text"){n=t[++r];s+="\n"+(n.tokens?this.parseInline(n.tokens):n.text)}o+=e?this.renderer.paragraph(s):s;continue}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}parseInline(t,e){e=e||this.renderer;let o="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(t!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){o+=t||"";continue}}switch(i.type){case"escape":{const t=i;o+=e.text(t.text);break}case"html":{const t=i;o+=e.html(t.text);break}case"link":{const t=i;o+=e.link(t.href,t.title,this.parseInline(t.tokens,e));break}case"image":{const t=i;o+=e.image(t.href,t.title,t.text);break}case"strong":{const t=i;o+=e.strong(this.parseInline(t.tokens,e));break}case"em":{const t=i;o+=e.em(this.parseInline(t.tokens,e));break}case"codespan":{const t=i;o+=e.codespan(t.text);break}case"br":{o+=e.br();break}case"del":{const t=i;o+=e.del(this.parseInline(t.tokens,e));break}case"text":{const t=i;o+=e.text(t.text);break}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}}class j{options;constructor(t){this.options=t||a}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}class F{defaults=s();options=this.setOptions;parse=this.#t(E.lex,T.parse);parseInline=this.#t(E.lexInline,T.parseInline);Parser=T;Renderer=I;TextRenderer=R;Lexer=E;Tokenizer=S;Hooks=j;constructor(...t){this.use(...t)}walkTokens(t,e){let o=[];for(const r of t){o=o.concat(e.call(this,r));switch(r.type){case"table":{const t=r;for(const r of t.header){o=o.concat(this.walkTokens(r.tokens,e))}for(const r of t.rows){for(const t of r){o=o.concat(this.walkTokens(t.tokens,e))}}break}case"list":{const t=r;o=o.concat(this.walkTokens(t.items,e));break}default:{const t=r;if(this.defaults.extensions?.childTokens?.[t.type]){this.defaults.extensions.childTokens[t.type].forEach((r=>{o=o.concat(this.walkTokens(t[r],e))}))}else if(t.tokens){o=o.concat(this.walkTokens(t.tokens,e))}}}}return o}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const o={...t};o.async=this.defaults.async||o.async||false;if(t.extensions){t.extensions.forEach((t=>{if(!t.name){throw new Error("extension name required")}if("renderer"in t){const o=e.renderers[t.name];if(o){e.renderers[t.name]=function(...e){let r=t.renderer.apply(this,e);if(r===false){r=o.apply(this,e)}return r}}else{e.renderers[t.name]=t.renderer}}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const o=e[t.level];if(o){o.unshift(t.tokenizer)}else{e[t.level]=[t.tokenizer]}if(t.start){if(t.level==="block"){if(e.startBlock){e.startBlock.push(t.start)}else{e.startBlock=[t.start]}}else if(t.level==="inline"){if(e.startInline){e.startInline.push(t.start)}else{e.startInline=[t.start]}}}}if("childTokens"in t&&t.childTokens){e.childTokens[t.name]=t.childTokens}}));o.extensions=e}if(t.renderer){const e=this.defaults.renderer||new I(this.defaults);for(const o in t.renderer){const r=t.renderer[o];const i=o;const n=e[i];e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o||""}}o.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new S(this.defaults);for(const o in t.tokenizer){const r=t.tokenizer[o];const i=o;const n=e[i];e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o}}o.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new j;for(const o in t.hooks){const r=t.hooks[o];const i=o;const n=e[i];if(j.passThroughHooks.has(o)){e[i]=t=>{if(this.defaults.async){return Promise.resolve(r.call(e,t)).then((t=>n.call(e,t)))}const o=r.call(e,t);return n.call(e,o)}}else{e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o}}}o.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens;const r=t.walkTokens;o.walkTokens=function(t){let o=[];o.push(r.call(this,t));if(e){o=o.concat(e.call(this,t))}return o}}this.defaults={...this.defaults,...o}}));return this}setOptions(t){this.defaults={...this.defaults,...t};return this}lexer(t,e){return E.lex(t,e??this.defaults)}parser(t,e){return T.parse(t,e??this.defaults)}#t(t,e){return(o,r)=>{const i={...r};const n={...this.defaults,...i};if(this.defaults.async===true&&i.async===false){if(!n.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}n.async=true}const s=this.#e(!!n.silent,!!n.async);if(typeof o==="undefined"||o===null){return s(new Error("marked(): input parameter is undefined or null"))}if(typeof o!=="string"){return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"))}if(n.hooks){n.hooks.options=n}if(n.async){return Promise.resolve(n.hooks?n.hooks.preprocess(o):o).then((e=>t(e,n))).then((t=>n.walkTokens?Promise.all(this.walkTokens(t,n.walkTokens)).then((()=>t)):t)).then((t=>e(t,n))).then((t=>n.hooks?n.hooks.postprocess(t):t)).catch(s)}try{if(n.hooks){o=n.hooks.preprocess(o)}const r=t(o,n);if(n.walkTokens){this.walkTokens(r,n.walkTokens)}let i=e(r,n);if(n.hooks){i=n.hooks.postprocess(i)}return i}catch(t){return s(t)}}}#e(t,e){return o=>{o.message+="\nPlease report this to https://github.com/markedjs/marked.";if(t){const t="<p>An error occurred:</p><pre>"+f(o.message+"",true)+"</pre>";if(e){return Promise.resolve(t)}return t}if(e){return Promise.reject(o)}throw o}}}const q=new F;function L(t,e){return q.parse(t,e)}L.options=L.setOptions=function(t){q.setOptions(t);L.defaults=q.defaults;l(L.defaults);return L};L.getDefaults=s;L.defaults=a;L.use=function(...t){q.use(...t);L.defaults=q.defaults;l(L.defaults);return L};L.walkTokens=function(t,e){return q.walkTokens(t,e)};L.parseInline=q.parseInline;L.Parser=T;L.parser=T.parse;L.Renderer=I;L.TextRenderer=R;L.Lexer=E;L.lexer=E.lex;L.Tokenizer=S;L.Hooks=j;L.parse=L;const U=':host{display:block;width:100%}.message-round{margin-bottom:16px;width:100%}.user-message-container{display:flex;flex-direction:column;align-items:flex-end;margin-bottom:8px}.assistant-message-container{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:8px}.message-bubble{padding:7px 18px;max-width:80%;position:relative}.user-message{background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);font-weight:600;font-size:14px;color:#FFFFFF;border-radius:14px 0 14px 14px}.assistant-message{background-color:#0000000f;border-radius:0 14px 14px 14px;font-weight:600;font-size:14px;color:#00000099}.message-time{font-size:12px;color:#999;margin-top:4px}.user-message-container .message-time{color:rgba(255, 255, 255, 0.7)}.loading-dots{display:flex;align-items:center;padding:12px 16px;background-color:#f0f0f0;border-radius:18px;border-top-left-radius:4px}.loading-dots span{width:8px;height:8px;margin:0 3px;background-color:#999;border-radius:50%;display:inline-block;animation:dot-pulse 1.5s infinite ease-in-out}.loading-dots span:nth-child(2){animation-delay:0.2s}.loading-dots span:nth-child(3){animation-delay:0.4s}@keyframes dot-pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.2);opacity:1}}.file-view{margin-top:8px;padding:8px;background-color:#f5f5f5;border-radius:4px;font-size:14px;word-break:break-all}.input-view{margin-top:8px;border:1px solid #eee;border-radius:4px;overflow:hidden}.input-label{padding:4px 8px;background-color:#f5f5f5;font-size:12px;font-weight:500}.input-value{padding:8px;font-size:14px}.input-metadata{font-size:0.875rem;margin-top:4px}.markdown-body{--base-size-4:0.25rem;--base-size-8:0.5rem;--base-size-16:1rem;--base-size-24:1.5rem;--base-size-40:2.5rem;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#1f6feb;--fgColor-default:#f0f6fc;--fgColor-muted:#9198a1;--fgColor-accent:#4493f8;--fgColor-success:#3fb950;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-done:#ab7df8;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--bgColor-attention-muted:#bb800926;--borderColor-default:#3d444d;--borderColor-muted:#3d444db3;--borderColor-neutral-muted:#3d444db3;--borderColor-accent-emphasis:#1f6feb;--borderColor-success-emphasis:#238636;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-done-emphasis:#8957e5;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-variable:#ffa657;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-invalid-illegal-text:#f0f6fc;--color-prettylights-syntax-invalid-illegal-bg:#8e1519;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.message-actions{position:absolute;top:8px;right:8px;opacity:0;transition:opacity 0.2s ease}.assistant-message:hover .message-actions{opacity:1}.copy-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#6e6e80;display:flex;align-items:center;justify-content:center}.copy-button:hover{background-color:rgba(0, 0, 0, 0.05);color:#000}.copy-button svg{width:16px;height:16px}';const Z=class{message;messageChange;get hostElement(){return t(this)}constructor(t){e(this,t);this.messageChange=o(this,"messageChange");L.setOptions({breaks:true,gfm:true})}copyMessageContent(){if(this.message.answer){navigator.clipboard.writeText(this.message.answer).then((()=>{console.log("内容已复制到剪贴板")})).catch((t=>{console.error("复制失败:",t)}))}}renderUserMessage(){if(!this.message?.query?.trim())return null;return r("div",{class:"user-message-container"},r("div",{class:"message-bubble user-message"},r("p",null,this.message.query),this.renderInputs()))}renderAssistantMessage(){if(!this.message.answer&&!this.message.isStreaming)return null;const t=this.message.isStreaming&&!this.message.answer;const e=this.message.answer?L(this.message.answer):"";return r("div",{class:"assistant-message-container"},r("div",{class:"message-bubble assistant-message"},r("div",{class:"markdown-content markdown-body",innerHTML:t?`请稍等...`:e})),!t&&this.message.answer&&r("div",{class:"message-actions"},r("button",{class:"copy-button",onClick:()=>this.copyMessageContent(),title:"复制内容"},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},r("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),r("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})))))}renderInputs(){if(!this.message.inputs)return null;return r("div",null,Object.keys(this.message.inputs).map(((t,e)=>{const o=this.message.inputs[t];if(o&&!t.startsWith("hide_")&&t!=="answer"){if(t==="file_url"){return r("div",{key:e,class:"file-view"},o)}else if(t==="file_urls"||t==="fileUrls"){const t=o.split(",");return r("div",{key:e,class:"flex flex-wrap"},t.map(((t,e)=>r("div",{key:e,class:"file-view"},t))))}else if(t==="job_info"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"职位信息"),r("div",{class:"input-value"},o))}else if(t==="rule"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"评估规则"),r("div",{class:"input-value"},o))}else{return r("div",{key:e,class:"input-metadata"},t,": ",`${o}`)}}return null})))}render(){return r("div",{key:"5748f17414b9442b9b791955de38437184fa2f7e",class:"message-round"},this.renderUserMessage(),this.renderAssistantMessage())}};Z.style=U;const P=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.file-name{font-size:13px;color:#333;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:1rem 1rem;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{border:2px dashed #ddd;border-radius:8px;padding:1rem;cursor:pointer;transition:all 0.3s ease}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.function-select{margin-top:2rem}.function-options{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:1rem}.function-button{padding:0.5rem 1rem;border:1px solid #ddd;border-radius:4px;background:white;cursor:pointer;transition:all 0.3s ease}.function-button:hover{border-color:#1890ff;color:#1890ff}.function-button.selected{background:#1890ff;color:white;border-color:#1890ff}.submit-button{margin-top:1rem;padding:0.8rem 2rem;background:#1890ff;color:white;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all 0.3s ease;width:95%}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;bottom:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:0.8rem;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:1rem;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}";const B=class{constructor(t){e(this,t);this.modalClosed=o(this,"modalClosed");this.streamComplete=o(this,"streamComplete");this.interviewComplete=o(this,"interviewComplete");this.recordingError=o(this,"recordingError");this.recordingStatusChange=o(this,"recordingStatusChange")}modalTitle="在线客服";apiKey="";isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;botId;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return t(this)}streamComplete;selectedFile=null;isUploading=false;uploadedFileInfo=[];defaultQuery="";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;recordingMaxTime=120;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=10;videoRef=null;totalQuestions=2;currentQuestionNumber=0;isInterviewComplete=false;interviewComplete;SCROLL_THRESHOLD=30;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;email="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;welcomeMessage;recordingError;recordingStatusChange;enableVoice=true;handleClose=()=>{this.isOpen=false;this.stopRecording();this.modalClosed.emit()};handleFileChange=async t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const t=new FormData;t.append("file",this.selectedFile);const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:t});const o=await e.json();if(!e.ok){throw new Error(o.message||"文件上传失败")}if(o){this.uploadedFileInfo=[{cos_key:o.cos_key,filename:o.filename,ext:o.ext,presigned_url:o.presigned_url}]}}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();alert(t instanceof Error?t.message:"文件上传失败,请重试")}finally{this.isUploading=false}}handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async sendMessageToAPI(t){this.isLoading=true;let e="";let o="";const r=new Date;const n=`${r.getHours()}:${r.getMinutes().toString().padStart(2,"0")}`;const s=t.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const a=this.messages.length>0?this.messages[this.messages.length-1]:null;if(a&&this.conversationId&&t!=="下一题"){this.saveAnswer(this.conversationId,"1234567890",a.answer,s)}const l=this.currentQuestionNumber>=this.totalQuestions&&t==="下一题";const d={id:`temp-${Date.now()}`,time:n,query:s,answer:"",bot_id:this.botId,isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=d;this.shouldAutoScroll=true;this.scrollToBottom();if(l){this.messages=[...this.messages,d];this.currentStreamingMessage=null;this.isLoading=false;this.isInterviewComplete=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const c={bot_id:this.botId,response_mode:"streaming",conversation_id:this.conversationId,query:s,user:"1234567890"};c.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.email};if(this.uploadedFileInfo.length>0){const t=this.uploadedFileInfo.map((t=>t.cos_key)).join(",");c.inputs.file_urls=t}await i({url:`https://pcm_api.ylzhaopin.com/external/v1/chat-messages`,method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:c,onMessage:t=>{console.log("收到Stream数据:",t);if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.updateUrlWithConversationId(t.conversation_id)}if(t.event==="node_finished"&&t.data.inputs&&t.data.inputs.LLMText){o=t.data.inputs.LLMText;console.log("获取到 LLMText:",o)}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){e+=t.answer;const o={...this.currentStreamingMessage,answer:e,isStreaming:true};this.currentStreamingMessage=o;this.scrollToBottom()}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:t=>{console.error("发生错误:",t);alert(t instanceof Error?t.message:"消息发送失败,请稍后再试");this.messages=[...this.messages,{...d,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{console.log("请求完成");this.isLoading=false;const e=this.currentStreamingMessage;this.messages=[...this.messages,this.currentStreamingMessage];this.currentStreamingMessage=null;if(t==="下一题"||this.currentQuestionNumber===0){this.currentQuestionNumber++}console.log(this.currentQuestionNumber);console.log(t);if(e&&e.answer){const t=o||e.answer;if(t){const e=await this.synthesizeAudio(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}}})}async saveAnswer(t,e,o,r){try{await n({url:"https://pcm_api.ylzhaopin.com/agents/hr_competition/answer",method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:t,user:e,question:o,answer:r}})}catch(t){console.error("保存答案失败:",t)}}handleScroll=()=>{const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:r}=t;const i=o-e-r;this.shouldAutoScroll=i<=this.SCROLL_THRESHOLD};scrollToBottom(){if(!this.shouldAutoScroll)return;const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}componentDidRender(){if(this.isLoadingHistory||this.shouldAutoScroll&&this.isOpen){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.scrollTop=t.scrollHeight}}}updateUrlWithConversationId(t){const e=new URLSearchParams(window.location.search);if(!e.get("conversation_id")){const e=new URL(window.location.href);e.searchParams.set("conversation_id",t);window.history.replaceState({},"",e)}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;console.log("加载历史消息...");try{await n({url:`https://pcm_api.ylzhaopin.com/external/v1/messages`,method:"GET",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,bot_id:this.botId,user:"1234567890",limit:20},onMessage:t=>{if(t.data){const e=t.data||[];const o=e.map((t=>{const e=new Date(t.created_at*1e3);const o=e.getHours().toString().padStart(2,"0");const r=e.getMinutes().toString().padStart(2,"0");const i=`${o}:${r}`;const{inputs:n,...s}=t;return{...s,time:i,bot_id:this.botId,isStreaming:false,status:t.status==="error"?"error":"normal"}}));this.messages=o;this.isLoadingHistory=false;requestAnimationFrame((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}))}else{this.isLoadingHistory=false}},onError:t=>{console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false},onComplete:()=>{this.isLoadingHistory=false}})}catch(t){console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false}}async handleIsOpenChange(t){if(t){if(this.conversationId){await this.loadHistoryMessages()}else if(this.welcomeMessage){alert(this.welcomeMessage)}}}handleJobCategorySelect=t=>{this.selectedJobCategory=t};handleDimensionSelect=t=>{if(this.selectedDimensions.includes(t)){this.selectedDimensions=this.selectedDimensions.filter((e=>e!==t))}else{this.selectedDimensions=[...this.selectedDimensions,t]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}const t=confirm('如果您已做好准备请点击"确定"开始面试。');if(!t){return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=10;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const t=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=t;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(t);const e=this.getSupportedMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e})}catch(e){console.warn("指定的MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t)}catch(t){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:t});this.showRecordingUI=false;return}}this.mediaRecorder=o;const r=[];o.ondataavailable=t=>{if(t.data.size>0){r.push(t.data)}};o.onerror=t=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:t});this.stopRecording()};o.onstop=()=>{try{const t=e||"video/mp4";const o=new Blob(r,{type:t});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(t){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:t});this.showRecordingUI=false}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(t){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:t});this.showRecordingUI=false;return}this.recordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-t);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(t){console.error("无法访问摄像头或麦克风:",t);this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:t});this.showRecordingUI=false}}setupVideoPreview(t){setTimeout((()=>{const e=this.hostElement.shadowRoot?.querySelector("video");if(e&&t){try{e.srcObject=t;e.play().catch((t=>{console.error("视频播放失败:",t)}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(t);e.src=o;e.onended=()=>{URL.revokeObjectURL(o)}}catch(t){console.error("创建对象URL失败:",t)}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const t=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){console.log("使用支持的MIME类型:",e);return e}}catch(t){console.warn(`检查MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((t=>t.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const t=this.recordedBlob.type.includes("webm")?"webm":"mp4";const e=`answer.${t}`;const o=new FormData;o.append("file",this.recordedBlob,e);const r=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:o});const i=await r.json();console.log("视频上传结果:",i);if(i&&i.cos_key){await this.saveVideoAnswer(i.cos_key);this.sendNextQuestion()}else{throw new Error("视频上传失败")}}catch(t){console.error("视频上传错误:",t);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:t})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(t){if(!this.conversationId)return;try{const e=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!e)return;await n({url:"https://pcm_api.ylzhaopin.com/agents/hr_competition/answer",method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,user:"1234567890",question:e.answer,file_url:t}})}catch(t){console.error("保存视频答案失败:",t)}}sendNextQuestion(){this.sendMessageToAPI("下一题")}async completeInterview(){if(!this.conversationId)return;try{await n({url:`https://pcm_api.ylzhaopin.com/agents/hr_competition/${this.conversationId}/end`,method:"POST",headers:{authorization:"Bearer "+this.apiKey}})}catch(t){console.error("发送面试完成请求失败:",t)}}async synthesizeAudio(t){try{const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/tts/synthesize_audio",{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+this.apiKey},body:JSON.stringify({text:t})});if(!e.ok){throw new Error("语音合成失败")}const o=await e.blob();return URL.createObjectURL(o)}catch(t){console.error("语音合成错误:",t);throw t}}playAudio(t){return new Promise((e=>{this.isPlayingAudio=true;this.audioUrl=t;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=t;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.play().catch((t=>{console.error("音频播放失败:",t);this.isPlayingAudio=false;this.audioUrl=null;e()}))}))}disconnectedCallback(){if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording()}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const i=()=>r("div",{class:"video-preview"},r("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:t=>{if(t&&this.recordingStream&&!this.videoRef){this.videoRef=t}}}),r("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},r("span",{class:"recording-dot"}),r("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isPlayingAudio){return r("div",{class:"placeholder-status"},r("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return r("div",{class:"placeholder-status"},r("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return r("div",{class:"placeholder-status"},r("p",null,"请等待题目..."))}if(this.waitingToRecord){return r("div",{class:"placeholder-status"},r("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return r("div",{class:"placeholder-status default-status"},r("p",null,"准备中..."))};return r("div",{class:o,style:t},r("div",{class:e},this.isShowHeader&&r("div",{class:"modal-header"},r("div",{class:"header-left"},this.icon&&r("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),r("div",null,this.modalTitle)),this.isNeedClose&&r("button",{class:"close-button",onClick:this.handleClose},r("span",null,"×"))),this.showInitialUpload?r("div",{class:"initial-upload"},r("div",{class:"upload-section"},this.requireResume&&r(r.Fragment,null,r("h3",null,"开始前,请上传您的简历"),r("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?r("div",{class:"file-info"},r("span",null,this.selectedFile.name),r("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):r("div",{class:"upload-placeholder"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",width:"48",height:"48"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m0-16l-4 4m4-4l4 4"})),r("p",null,"点击上传简历"),r("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),r("div",{class:"category-select"},r("h3",null,"请选择您的职能类别(单选)"),r("div",{class:"category-options"},this.jobCategories.map((t=>r("button",{class:{"category-button":true,selected:this.selectedJobCategory===t},onClick:()=>this.handleJobCategorySelect(t)},t))))),r("div",{class:"dimension-select"},r("h3",null,"请选择关注的模块(可多选)"),r("div",{class:"dimension-options"},this.dimensions.map((t=>r("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(t)},onClick:()=>this.handleDimensionSelect(t)},t))))),r("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&r("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):r("div",{style:{height:"100%"}},r("div",{class:"chat-history",onScroll:this.handleScroll},this.isLoadingHistory?r("div",{class:"loading-container"},r("div",{class:"loading-spinner"}),r("p",null,"加载历史消息中...")):r("div",null,this.messages.map((t=>r("div",{id:`message_${t.id}`,key:t.id},r("pcm-chat-message",{message:t,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&r("div",{id:`message_${this.currentStreamingMessage.id}`},r("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&r("div",{class:"empty-state"},r("p",null,"请上传简历开始面试")))),r("div",{class:"recording-section"},r("div",{class:"recording-container"},r("div",{class:"video-area"},this.showRecordingUI?i():r("div",{class:"video-preview placeholder"},n())),r("div",{class:"recording-controls"},this.showRecordingUI?r("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):r("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return r("div",{class:"play-audio-container",onClick:this.handlePlayAudio},r("p",null,r("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},r("path",{d:"M8 5v14l11-7z"})),r("span",{style:{verticalAlign:"middle"}},"播放题目")))}return r("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{isOpen:["handleIsOpenChange"]}}};B.style=P;export{Z as pcm_chat_message,B as pcm_hr_chat_modal};
2
+ //# sourceMappingURL=p-f8a52c86.entry.js.map