(()=>{"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let t={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function n(e){t=e}const r={exec:()=>null};function s(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(i.caret,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}const i={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,a=/(?:[*+-]|\d{1,9}[.)])/,l=s(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,a).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),c=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,p=s(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),d=s(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,a).getRegex(),u="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",g=/|$))/,f=s("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",g).replace("tag",u).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),b=s(c).replace("hr",o).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",u).getRegex(),x={blockquote:s(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",b).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:p,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:f,lheading:l,list:d,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:b,table:r,text:/^[^\n]+/},k=s("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",u).getRegex(),w={...x,table:k,paragraph:s(c).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",u).getRegex()},m={...x,html:s("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",g).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:s(c).replace("hr",o).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},y=/^( {2,}|\\)\n(?!\s*$)/,v=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,S=/[^\s\p{P}\p{S}]/u,$=s(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),z=/(?!~)[\p{P}\p{S}]/u,T=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A=s(T,"u").replace(/punct/g,v).getRegex(),R=s(T,"u").replace(/punct/g,z).getRegex(),E="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",L=s(E,"gu").replace(/notPunctSpace/g,S).replace(/punctSpace/g,_).replace(/punct/g,v).getRegex(),I=s(E,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,z).getRegex(),C=s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,S).replace(/punctSpace/g,_).replace(/punct/g,v).getRegex(),B=s(/\\(punct)/,"gu").replace(/punct/g,v).getRegex(),P=s(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),q=s(g).replace("(?:--\x3e|$)","--\x3e").getRegex(),j=s("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",q).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,N=s(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O=s(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",h).getRegex(),D=s(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),Z={_backpedal:r,anyPunctuation:B,autolink:P,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:y,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:r,emStrongLDelim:A,emStrongRDelimAst:L,emStrongRDelimUnd:C,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:N,nolink:D,punctuation:$,reflink:O,reflinkSearch:s("reflink|nolink(?!\\()","g").replace("reflink",O).replace("nolink",D).getRegex(),tag:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},X=e=>V[e];function Y(e,t){if(t){if(i.escapeTest.test(e))return e.replace(i.escapeReplace,X)}else if(i.escapeTestNoEncode.test(e))return e.replace(i.escapeReplaceNoEncode,X);return e}function W(e){try{e=encodeURI(e).replace(i.percentDecode,"%")}catch{return null}return e}function F(e,t){const n=e.replace(i.findPipe,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(i.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:K(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const s=r[1];return t.split("\n").map((e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=K(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:K(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],"\n").split("\n"),n="",r="";const s=[];for(;e.length>0;){let t=!1;const i=[];let o;for(o=0;o1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let n=!1,r="",a="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):h?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=t[1].length),h&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),s=this.rules.other.fencesBeginRegex(p),i=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p);for(;e;){const d=e.split("\n",1)[0];let u;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),s.test(c))break;if(i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+u.slice(p);else{if(h)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(s.test(l))break;if(i.test(l))break;if(n.test(l))break;a+="\n"+c}h||c.trim()||(h=!0),r+=d+"\n",e=e.substring(d.length+1),l=u.slice(p)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let d,u=null;this.options.gfm&&(u=this.rules.other.listIsTask.exec(a),u&&(d="[ ] "!==u[0],a=a.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:r,task:!!u,checked:d,loose:!1,text:a,tokens:[]}),s.raw+=r}const a=s.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=K(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ee(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ee(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,i,o=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class ne{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:i,block:J.normal,inline:U.normal};this.options.pedantic?(n.block=J.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=J.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:J,inline:U}}static lex(e,t){return new ne(t).lex(e)}static lexInline(e,t){return new ne(t).inlineTokens(e)}lex(e){e=e.replace(i.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){const i=t.at(-1);n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s=!1,i="";for(;e;){let r;if(s||(i=""),s=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,i)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(i=r.raw.slice(-1)),s=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}}class re{options;parser;constructor(e){this.options=e||t}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(i.notSpaceStart)?.[0],s=e.replace(i.endingNewline,"")+"\n";return r?'
'+(n?s:Y(s,!0))+"
\n":"
"+(n?s:Y(s,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Y(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Y(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=W(e);if(null===s)return r;let i='
    ",i}image({href:e,title:t,text:n}){const r=W(e);if(null===r)return Y(n);let s=`${n}{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new re(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,s=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new te(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new oe;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,s=e.hooks[r],i=t[r];oe.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ne.lex(e,t??this.defaults)}parser(e,t){return ie.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);const o=s.hooks?s.hooks.provideLexer():e?ne.lex:ne.lexInline,a=s.hooks?s.hooks.provideParser():e?ie.parse:ie.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then((e=>o(e,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>a(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let e=o(t,s);s.hooks&&(e=s.hooks.processAllTokens(e)),s.walkTokens&&this.walkTokens(e,s.walkTokens);let n=a(e,s);return s.hooks&&(n=s.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+Y(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function le(e,t){return ae.parse(e,t)}le.options=le.setOptions=function(e){return ae.setOptions(e),le.defaults=ae.defaults,n(le.defaults),le},le.getDefaults=e,le.defaults=t,le.use=function(...e){return ae.use(...e),le.defaults=ae.defaults,n(le.defaults),le},le.walkTokens=function(e,t){return ae.walkTokens(e,t)},le.parseInline=ae.parseInline,le.Parser=ie,le.parser=ie.parse,le.Renderer=re,le.TextRenderer=se,le.Lexer=ne,le.lexer=ne.lex,le.Tokenizer=te,le.Hooks=oe,le.parse=le;le.options,le.setOptions,le.use,le.walkTokens,le.parseInline,ie.parse,ne.lex;const ce="https://apid.launchstrategies.ru";let he,pe=!1;const de=document.createElement("div");function ue(e,t="",n){const r=document.createElement("div");return r.className="flex mb-3"+(n?" justify-end":""),r.innerHTML=`
    ${function(e){return e.replace(/\+?\d[\d\-\(\) ]{9,}\d/g,(e=>`${e}`))}(t)}
    `,e.appendChild(r),e.scrollTop=e.scrollHeight,r}async function ge(e,t){const n=document.querySelector("#lswidget-typing-indicator");n?.parentElement?.parentElement&&n.parentElement.parentElement.removeChild(n.parentElement);const r=document.getElementById("chat-input"),s=document.getElementById("wls_chat-messages");if(s){if(r&&(r.value=""),"object"==typeof e&&e instanceof EventSource){let t;return e.addEventListener("textCreated",(()=>{t=ue(s)})),e.addEventListener("textDelta",(({data:e})=>{const n=t.querySelector("div");n&&(n.innerHTML=le.parse(n.innerText+e).toString(),s.scrollTop=s.scrollHeight)})),void e.addEventListener("messageDone",(({data:n})=>{const r=t.querySelector("div");if(!r)return;const s=JSON.parse(n);r.innerHTML=le.parse(s.content[0].text.value).toString(),async function(e,t){let n=!1;const r="string"==typeof e?e:e.content,s=localStorage.getItem("aiwi_messages"),i=s?JSON.parse(s):[];i.length&&(n=!0),i.push({role:t?"user":"assistant",content:r,date:"string"==typeof e?(new Date).valueOf():e.date}),localStorage.setItem("aiwi_messages",JSON.stringify(i));const o=localStorage.getItem("aiwi_thread_id");n&&o&&await fetch(`${ce}/widget/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({thread:o})}).then((e=>e.json())).catch((e=>console.error("error chat notify",e.message)))}(s.content[0].text.value),e.close()}))}("string"!=typeof e&&e?e:[{role:t?"user":"assistant",content:e}]).forEach((t=>{let n="user"==t.role;if(t.content&&ue(s,le.parse(t.content).toString(),n),e){const r=localStorage.getItem("aiwiadd_messages"),s=r?JSON.parse(r):[];s.push({role:n?"user":"assistant",content:t.content}),"string"==typeof e&&localStorage.setItem("aiwi_messages",JSON.stringify(s))}}))}}async function fe(){if(he)return;const e=localStorage.getItem("aiwi_thread_id");e&&(he=new EventSource(`${ce}/widget/listen/`+e),he.addEventListener("operatorMessage",(({data:e})=>{pe=!0,ge(e)})),he.addEventListener("operatorDisconnected",(({data:e})=>{pe=!1})))}async function be(){const e=localStorage.getItem("aiwi_thread_id"),t=localStorage.getItem("aiwi_messages");if(e)return t&&(!function(){const e=document.getElementById("wls_chat-messages");e&&(e.innerHTML="")}(),ge(JSON.parse(t))),t?null:e;const n=new Headers;n.append("Content-Type","application/json");const r=JSON.stringify({messages:[{role:"assistant",content:"Вас приветствует ассистент ИИ компании NELSIT"}],assistant_id:"67bc28f9daf2dc7d4aa81004"}),s=await fetch(`${ce}/assistants/threads`,{method:"POST",headers:n,body:r}).then((e=>e.json())).catch((e=>console.log("error",e)));return s?.id?(localStorage.setItem("aiwi_thread_id",s.id),fe(),s.id):void 0}de.id="lswidget-typing-indicator",de.classList.add("typing-indicator"),de.classList.add("flex"),de.classList.add("items-center"),de.classList.add("space-x-1"),de.innerHTML='
    \n
    \n
    ';let xe=!1;const ke=[-20,63];let we,me;!function(){const e=document.createElement("style");e.innerHTML="\n #lsw_chat-widget-container *,\n #lsw_chat-widget-container ::after,\n #lsw_chat-widget-container ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n #lsw_chat-widget-container .border-t {\n border-top-width: 1px\n }\n #lsw_chat-widget-container .bg-gray-800 {\n --tw-bg-opacity: 1;\n background-color: rgba(31, 41, 55, var(--tw-bg-opacity))\n }\n #lsw_chat-widget-container .text-white {\n --tw-text-opacity: 1;\n color: rgba(255, 255, 255, var(--tw-text-opacity))\n }\n .flex {\n display:flex\n }\n .m-0 {\n margin: 0\n }\n .bg-transparent {\n background-color: transparent\n }\n .h-6 {\n height: 1.5rem\n }\n .flex-1 {\n flex: 1 1 0%\n }\n .p-4 {\n padding: 1rem\n }\n .bg-white {\n --tw-bg-opacity: 1;\n background-color: rgba(255, 255, 255, var(--tw-bg-opacity))\n }\n .justify-center {\n justify-content: center\n }\n #lsw_chat-widget-container .rounded-full {\n border-radius: 9999px\n }\n .items-center {\n align-items: center\n }\n .cursor-pointer {\n cursor: pointer\n }\n .absolute {\n position: absolute\n }\n .right-0 {\n right: 0\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n }\n .flex-col {\n flex-direction: column\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms\n }\n .justify-between {\n justify-content: space-between\n }\n #lsw_chat-widget-container .border-none {\n border-style: none\n }\n .w-6 {\n width: 1.5rem\n }\n .overflow-y-auto {\n overflow-y: auto\n }\n .scroll-smooth {\n scroll-behavior: smooth;\n }\n .border-t {\n border-top-width: 1px\n }\n #lsw_chat-widget-container .border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity))\n }\n .space-x-4>:not([hidden])~:not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(1rem * var(--tw-space-x-reverse));\n margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)))\n }\n #lsw_chat-widget-container .border {\n border-width: 1px\n }\n #lsw_chat-widget-container .border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgba(209, 213, 219, var(--tw-border-opacity))\n }\n #lsw_chat-widget-container .rounded-md {\n border-radius: .375rem\n }\n #lsw_chat-widget-container .px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n }\n #lsw_chat-widget-container .py-2 {\n padding-top: .5rem;\n padding-bottom: .5rem\n }\n #lsw_chat-widget-container .outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px\n }\n .w-3\\/4 {\n width: 75%\n }\n .p-6 {\n padding: 1.5rem\n }\n #lsw_chat-widget-container .rounded-lg, #lsw_lead_catcher .rounded-lg {\n border-radius: .5rem\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n }\n .relative {\n position: relative\n }\n #lsw_chat-widget-container .bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgba(229, 231, 235, var(--tw-bg-opacity))\n }\n .fixed {\n position: fixed\n }\n .inset-0 {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0\n }\n .bg-black {\n --tw-bg-opacity: 1;\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity))\n }\n .bg-opacity-25 {\n --tw-bg-opacity: 0.25\n }\n .mb-3 {\n margin-bottom: .75rem\n }\n \n #chat-popup button {\n padding: 0\n }\n #chat-popup button:hover {\n background-color: transparent\n }\n ",document.head.appendChild(e);const t=document.createElement("style");t.innerHTML=' \n #lsw_chat-widget-container {\n position: fixed;\n flex-direction: column;\n z-index: 10000000;\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n }\n #lsw_chat-widget-container p {\n margin: 0;\n }\n #chat-popup {\n height: 70vh;\n max-height: 70vh;\n transition: all 0.3s;\n overflow: hidden;\n width: 28em;\n bottom: 6em;\n -webkit-text-size-adjust: 100%;\n -webkit-appearance: none;\n }\n #chat-popup input{\n -webkit-appearance: none;\n }\n @media (max-width: 600px) {\n #chat-popup {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100vw;\n max-width: 100%;\n height: auto;\n max-height: 100vh;\n border-radius: 0;\n }\n }\n \n @keyframes bounce {\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n }\n \n .typing-indicator .dot {\n animation: bounce 1.4s infinite ease-in-out both;\n }\n \n .typing-indicator .dot:nth-child(1) {\n animation-delay: -0.32s;\n }\n \n .typing-indicator .dot:nth-child(2) {\n animation-delay: -0.16s;\n }\n \n .typing-indicator .dot:nth-child(3) {\n animation-delay: 0s;\n }\n \n .hidden {\n display: none;\n }\n\n ',document.head.appendChild(t)}();{let e=function(){const e=document.createElement("div");e.id="lsw_chat-widget-container",e.style[ke[0]>0?"left":"right"]=Math.abs(ke[0])+"px",e.style[ke[1]>0?"bottom":"top"]=Math.abs(ke[1])+"px",e.style.color="black",e.style.display="flex",e.style.alignItems="flex-end",e.style.flexDirection="row",e.style.gap="10px",e.style.fontSize="100%",document.body.appendChild(e),e.innerHTML=`\n
    \n \n \n \n
    \n `;const t=document.getElementById("chat-input"),n=document.getElementById("chat-submit"),r=document.getElementById("wls_chat-messages"),s=document.getElementById("chat-bubble"),i=document.getElementById("chat-popup"),o=document.getElementById("close-popup");async function a(){i&&(i.classList.toggle("hidden"),!i.classList.contains("hidden"))&&(t.focus(),await be()&&ge("Вас приветствует ассистент ИИ компании NELSIT"))}return r&&r.addEventListener("wheel",(e=>{if(!e.target)return;e.preventDefault(),e.stopPropagation();const t=2*e.deltaY;r.scrollBy(0,t)}),{passive:!1}),n&&t&&(n.addEventListener("click",(async function(){if(xe)return;const e=t.value.trim();if(!e)return;xe=!0,ge(e,!0);const n=await async function(e){const t=localStorage.getItem("aiwi_thread_id");if(!t)return"Не могу ответить. Попробуйте позже. ";const n=new Headers;if(n.append("Content-Type","application/json"),pe){const r=await fetch(`${ce}/widget/request`,{method:"POST",headers:n,body:JSON.stringify({thread_id:t,message:e})}).then((e=>e.json())).catch((e=>console.log("error",e)));return r&&404!=r.statusCode||(pe=!1),""}{ge();const r=await fetch(`${ce}/assistants/threads/${t}/messages`,{method:"POST",headers:n,body:JSON.stringify({role:"user",content:e})}).then((e=>e.json())).catch((e=>console.log("error",e)));if(r?.id)return new EventSource(`${ce}/assistants/threads/${t}/runs/67bc28f9daf2dc7d4aa81004`);if(r?.sent_at)return""}return"Что-то идет не так. Попробуйте позже."}(e);xe=!1,n&&ge(n)})),t.addEventListener("keyup",(function(e){"Enter"===e.key&&n.click()}))),s&&s.addEventListener("click",(function(){a()})),o&&o.addEventListener("click",(function(){a()})),fe(),be(),[e,ke[0]>0]}();we=e[0],me=e[1]}(function(){const e=document.createElement("style");e.innerHTML='\n #lsw_lead_catcher a{ \n text-decoration:none;\n color:inherit;\n }\n #lsw_lead_catcher .i-lh-close-cross {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n -webkit-box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n -moz-box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAABkUlEQVQ4je2SMWvbQBiGn4sQyNVyHjMbSglETRzlZzTbQUct9pYYOpRC90LJYDvZjAeDhw7a46HpLyg2mkTbP9D1piTYwtfBElUcWZbn5N3uvuPhu+974CVpRP7QarXeA6+11pdhGN5XASilavV6/eNyufwzHA6/Zfd7+UfGmAPgTErZV0rVqkCllH1jzDshxJt87RE4SZIvwE+gKaW8brfbrzZBgyBwpJRdoAlEQoiv+bqVP0RRlHie98OyrEPgBDj2ff92Op0u1qG2bfcAP4VeDAaDu43gKvAqUFhbXkFXXeA0A8zn82UVaCkY/i+H1Rxn6XUTmGmtO2XmPBlFPnEcJ57nfU/H4gP7aaed8XhcquNeWTGX0p8VpbRjpVTNdd0rVkucAX+BY+Bto9G4jeM42RkcBIHjum4vhUZCiM5isbjJxuI4TrNIxVLwJqWqel4I3uZpVbi1C3QX+CMrbNv+nEJnWuvzTfIDjEajB631B1ZLPQI+5evruv0CJtvkzxKG4b3WugNMjDG/t71/pvkHkaHKyfDtLb4AAAAASUVORK5CYII=");\n background-position-x: 0%;\n background-position-y: 0%;\n background-repeat: repeat;\n background-size: auto;\n background-size: 16px;\n background-repeat: no-repeat;\n background-position: 50%;\n }\n #lsw_lead_catcher .i-lh-close {\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 999;\n }\n #lsw_lead_catcher .i-lh-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 350px;\n background: #fff;\n overflow: hidden;\n position: relative;\n display: flex;\n flex-direction: column;\n }\n #lsw_lead_catcher .i-lh-main-desktop {\n min-width: 350px !important;\n }\n #lsw_lead_catcher .i-lh-header {\n font-size: 24px;\n line-height: 1.3 !important;\n margin-bottom: 12px;\n padding-top: 20px;\n }\n #lsw_lead_catcher .i-lh-description {\n font-size: 16px;\n line-height: 1.4 !important;\n color: #475155;\n margin-bottom: 20px;\n width: 300px;\n }\n #lsw_lead_catcher .full-width {\n width: 100%;\n }\n #lsw_lead_catcher .i-lh-vertical {\n width: 100%;\n }\n #lsw_lead_catcher .i-lh-form {\n margin-bottom: 10px;\n }\n #lsw_lead_catcher .i-lh-form .i-lh-field {\n vertical-align: top;\n padding-bottom: 10px;\n }\n #lsw_lead_catcher .lsw_vertical {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 300px;\n margin: 0 auto;\n }\n #lsw_lead_catcher .i-lh-input-wrapper {\n position: relative;\n }\n #lsw_lead_catcher .i-lh-icon-wrapper {\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n left: 9px;\n font-size: 14px;\n }\n \n #lsw_lead_catcher .i-lh-input {\n padding: 0 10px;\n padding-left: 10px;\n min-width: 216px;\n width: 100%;\n height: 40px;\n background: #fff;\n border-radius: 4px;\n border: 1px solid rgba(27,42,48,.2);\n border-top-width: 1px;\n border-top-color: rgba(27, 42, 48, 0.2);\n border-right-width: 1px;\n border-right-color: rgba(27, 42, 48, 0.2);\n border-bottom-width: 1px;\n border-bottom-color: rgba(27, 42, 48, 0.2);\n border-left-width: 1px;\n border-left-color: rgba(27, 42, 48, 0.2);\n font-size: 15px;\n }\n #lsw_lead_catcher *,\n #lsw_lead_catcher ::after,\n #lsw_lead_catcher ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n #lsw_lead_catcher .i-lh-input-iconed {\n padding-left: 30px !important;\n }\n #lsw_lead_catcher .agreement-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n }\n #lsw_lead_catcher .button-wrapper {\n position: relative;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 300px;\n margin: 0 auto;\n max-width: 100%;\n }\n #lsw_lead_catcher svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n }\n #lsw_lead_catcher .svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n #lsw_lead_catcher .i-lh-agreement {\n border-collapse: collapse;\n }\n #lsw_lead_catcher .checkbox {\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 3px;\n margin-top: 3px;\n border: 1px solid grey;\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n }\n #lsw_lead_catcher .i-lh-agreement .i-lh-text {\n font-size: 12px;\n line-height: 16px;\n color: #bbb;\n padding: 2px 0 0 6px;\n cursor: pointer;\n white-space: normal;\n text-align: justify;\n }\n #lsw_lead_catcher .i-lh-input.i-lh-material {\n box-shadow: none !important;\n background: transparent !important;\n border-radius: 0 !important;\n border-top-color: transparent !important;\n border-right-color: transparent !important;\n border-left-color: transparent !important;\n }\n #lsw_lead_catcher .i-lh-footer-text {\n opacity: .3;\n }\n #lsw_lead_catcher .i-lh-footer {\n background: #f3f4f4;\n height: 28px;\n padding: 0 20px;\n font-size: 12px;\n line-height: 28px;\n }\n #lsw_lead_catcher .i-lh-input:focus {\n color: rgba(30, 25, 28);\n outline: 0;\n }\n #lsw_lead_catcher .i-lh-checkbox-wrapper {\n vertical-align: baseline;\n }\n #lsw_lead_catcher .checkbox-active {\n background: #3c87fd;\n color: #fff;\n font-size: 11px;\n text-align: center;\n padding: 1px;\n border: none;\n border-radius: 3px;\n color: rgb(255, 255, 255);\n background: rgb(54 56 59);\n }\n ',document.head.appendChild(e);{const t=document.createElement("div");function n(){t&&t.classList.add("hidden")}t.id="lsw_lead_catcher",t.classList.add("fixed","inset-0","bg-black","bg-opacity-25","flex","items-center","justify-center","hidden"),t.style.zIndex="100",t.style.boxShadow="-3px -1px 50px 19px rgba(34, 60, 80, 0.25)",t.innerHTML='\n \x3c!-- Форма --\x3e\n
    \n \x3c!-- Кнопка закрытия --\x3e\n
    \n
    \n
    \n
    У вас есть вопросы?
    \n
    Давайте мы перезвоним вам и все расскажем
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    ';const r=t.querySelector("#wls_closeModalBtn");r&&(r.addEventListener("click",(()=>{n()})),window.addEventListener("click",(e=>{e.target===t&&n()})));const s=t.querySelector("#lsw_waitCall");function i(e){console.log("mask",i);const t=e.target;let n=0,r=t.value.replace(/\D/g,"").replace(/^8/,"7");var o,a;s.disabled=r.length<11,t.value="+_ (___) ___-__-__".replace(/./g,(function(e){return/[_\d]/.test(e)&&n=r.length?"":e})),"blur"==e.type?2==t.value.length&&(t.value=""):(o=t,a=t.value.length,o.focus(),o.setSelectionRange&&o.setSelectionRange(a,a))}const o=t.querySelector('input[name="wls_phoneNumber"]');o&&(o.addEventListener("input",i,!1),o.addEventListener("focus",i,!1),o.addEventListener("blur",i,!1),o.addEventListener("keydown",i,!1));const a=t.querySelector('input[name="wls_name"]');s&&s.addEventListener("click",(async e=>{if(await fetch("https://apid.launchstrategies.ru/widget/lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistant:"67bc28f9daf2dc7d4aa81004",phone:o?o.value:"",name:a?a.value:"",url:window.location.href})}).then((e=>e.json())).catch((e=>console.log("error",e)))){const e=document.querySelectorAll("#lsw_lead_catcher .i-lh-main-desktop");e?.length&&(e[0].style.display="none",e[1].style.display="")}})),document.body.appendChild(t);const l=e=>{const n=e.clientY,r=!!document.getElementById("stay-on-site-form");n<=10&&!r&&(t&&t.classList.remove("hidden"),document.removeEventListener("mousemove",l),clearTimeout(c))};document.addEventListener("mousemove",l);const c=setTimeout((()=>{console.log("insterting lead catcher'",t),t&&t.classList.remove("hidden"),document.removeEventListener("mousemove",l)}),3e4),h=document.querySelector("#wls_ppach");h&&h.addEventListener("click",(e=>{const t=h.querySelector(".checkbox");t&&t.classList.toggle("checkbox-active")}))}})()})();