deepseek-pc/dist/ai-CHrumffn.js

62 lines
98 KiB
JavaScript
Raw Normal View History

2025-03-04 12:26:10 +08:00
var Yt=Object.defineProperty;var en=(s,e,t)=>e in s?Yt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var T=(s,e,t)=>en(s,typeof e!="symbol"?e+"":e,t);import{d as tn,r as j,e as nn,f as sn,g as rn,h as on,c as P,a as b,i as U,F as ln,j as an,b as Ee,n as cn,w as un,v as pn,k as hn,l as fn,m as dn,p as Ae,t as Ke,q as Qe,s as Xe,x as gn,o as $}from"./index-D76U6LGa.js";import{_ as mn}from"./ai-logo-BtlK3AB1.js";function bt(s,e){return function(){return s.apply(e,arguments)}}const{toString:bn}=Object.prototype,{getPrototypeOf:Fe}=Object,we=(s=>e=>{const t=bn.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),M=s=>(s=s.toLowerCase(),e=>we(e)===s),ke=s=>e=>typeof e===s,{isArray:Q}=Array,ie=ke("undefined");function wn(s){return s!==null&&!ie(s)&&s.constructor!==null&&!ie(s.constructor)&&F(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const wt=M("ArrayBuffer");function kn(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&wt(s.buffer),e}const Cn=ke("string"),F=ke("function"),kt=ke("number"),Ce=s=>s!==null&&typeof s=="object",xn=s=>s===!0||s===!1,ue=s=>{if(we(s)!=="object")return!1;const e=Fe(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},yn=M("Date"),Sn=M("File"),Rn=M("Blob"),Tn=M("FileList"),En=s=>Ce(s)&&F(s.pipe),An=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||F(s.append)&&((e=we(s))==="formdata"||e==="object"&&F(s.toString)&&s.toString()==="[object FormData]"))},_n=M("URLSearchParams"),[vn,Ln,On,Pn]=["ReadableStream","Request","Response","Headers"].map(M),$n=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function oe(s,e,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let n,r;if(typeof s!="object"&&(s=[s]),Q(s))for(n=0,r=s.length;n<r;n++)e.call(null,s[n],n,s);else{const i=t?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length;let l;for(n=0;n<o;n++)l=i[n],e.call(null,s[l],l,s)}}function Ct(s,e){e=e.toLowerCase();const t=Object.keys(s);let n=t.length,r;for(;n-- >0;)if(r=t[n],e===r.toLowerCase())return r;return null}const J=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xt=s=>!ie(s)&&s!==J;function Oe(){const{caseless:s}=xt(this)&&this||{},e={},t=(n,r)=>{const i=s&&Ct(e,r)||r;ue(e[i])&&ue(n)?e[i]=Oe(e[i],n):ue(n)?e[i]=Oe({},n):Q(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&oe(arguments[n],t);return e}const zn=(s,e,t,{allOwnKeys:n}={})=>(oe(e,(r,i)=>{t&&F(r)?s[i]=bt(r,t):s[i]=r},{allOwnKeys:n}),s),Bn=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),Nn=(s,e,t,n)=>{s.prototype=Object.create(e.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t)},Dn=(s,e,t,n)=>{let r,i,o;const l={};if(e=e||{},s==null)return e;do{for(r=Object.getOwnPropertyNames(s),i=r.length;i-- >0;)o=r[i],(!n||n(o,s,e))&&!l[o]&&(e[o]=s[o],l[o]=!0);s=t!==!1&&Fe(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},Fn=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;const n=s.indexOf(e,t);return n!==-1&&n===t},In=s=>{if(!s)return null;if(Q(s))return s;let e=s.length;if(!kt(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},qn=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&Fe(Uint8Array)),Un=(s,e)=>{const n=(s&&s[Symbol.iterator]).call(s);let r;for(;(r=n.next())&&!r.done;){const i=r.value;e.call(s,i[0],i[1])}},Mn=(s,e)=>{let t;const n=[];for(;(t=s.exec(e))!==null;)n.push(t);return n},jn=M("HTMLFormElement"),Hn=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),Ye=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),Zn=M("RegExp"),yt=(s,e)=>{const t=Object.getOwnPropertyDescriptors(s),n={};oe(t,(r,i)=>{let o;(o=e(r,i,s))!==!1&&(n[i]=o||r)}),Object.defineProperties(s,n)},Jn=s=>{yt(s,(e,t)=>{if(F(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=s[t];if(F(n)){if(e.enumerable=!1,
`).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!t||e[t]&&bs[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},st=Symbol("internals");function Y(s){return s&&String(s).trim().toLowerCase()}function pe(s){return s===!1||s==null?s:p.isArray(s)?s.map(pe):String(s)}function ks(s){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(s);)e[n[1]]=n[2];return e}const Cs=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function _e(s,e,t,n,r){if(p.isFunction(n))return n.call(this,e,t);if(r&&(e=t),!!p.isString(e)){if(p.isString(n))return e.indexOf(n)!==-1;if(p.isRegExp(n))return n.test(e)}}function xs(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ys(s,e){const t=p.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+t,{value:function(r,i,o){return this[n].call(this,e,r,i,o)},configurable:!0})})}let N=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(l,u,a){const c=Y(u);if(!c)throw new Error("header name must be a non-empty string");const h=p.findKey(r,c);(!h||r[h]===void 0||a===!0||a===void 0&&r[h]!==!1)&&(r[h||u]=pe(l))}const o=(l,u)=>p.forEach(l,(a,c)=>i(a,c,u));if(p.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(p.isString(e)&&(e=e.trim())&&!Cs(e))o(ws(e),t);else if(p.isHeaders(e))for(const[l,u]of e.entries())i(u,l,n);else e!=null&&i(t,e,n);return this}get(e,t){if(e=Y(e),e){const n=p.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return ks(r);if(p.isFunction(t))return t.call(this,r,n);if(p.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Y(e),e){const n=p.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||_e(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function i(o){if(o=Y(o),o){const l=p.findKey(n,o);l&&(!t||_e(n,n[l],l,t))&&(delete n[l],r=!0)}}return p.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];(!e||_e(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return p.forEach(this,(r,i)=>{const o=p.findKey(n,i);if(o){t[o]=pe(r),delete t[i];return}const l=e?xs(i):String(i).trim();l!==i&&delete t[i],t[l]=pe(r),n[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return p.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&p.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[st]=this[st]={accessors:{}}).accessors,r=this.prototype;function i(o){const l=Y(o);n[l]||(ys(r,o),n[l]=!0)}return p.isArray(e)?e.forEach(i):i(e),this}};N.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(N.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(n){this[t]=n}}});p.freezeMethods(N);function ve(s,e){const t=this||le,n=e||t,r=N.from(n.headers);let i=n.data;return p.forEach(s,function(l){i=l.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Ot(s){return!!(s&&s.__CANCEL__)}function X(s,e,t){C.call(this,s??"canceled",C.ERR_CANCELED,e,t),this.name="CanceledError"}p.inherits(X,C,{__CANCEL__:!0});function Pt(s,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?s(t):e(new C("Request failed with status code "+t.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Ss(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function Rs(s,e){s=s||10;const t=new Array(s),n=new Array(s);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const a=Date.now(),c=n[i];o||(o=a),t[r]=u,n[r]=a;let h=i,d=0;for(;h!==r;)d+=t[h++],h=h%s;if(r=(r+1)%s,r===i&&(i=(i+1)%s),a-o<e)return;const w=c&&a-c;return w?Math.round(d*1e3/w):void 0}}function Ts(s,e){let t=0,n=1e3/e,r,i;const o=(a,c=Date.now())=>{t=c,r=null,i&&(clearTimeout(i),i=null),s.apply(null,a)};return[(...a)=>{const c=Date.now(),h=c-t;h>=n?o(a,c):(r=a,i||(i=setTimeout(()=>{i=null,o(r)},n-h)))},()=>r&&o(r)]}const fe=(s,e,t=3)=>{let n=0;const r=Rs(50,250);return Ts(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,u=o-n,a=r(u),c=o<=l;n=o;const h={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:a||void 0,estimated:a&&l&&c?(l-o)/a:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};s(h)},t)},rt=(s,e)=>{const t=s!=null;return[n=>e[0]({lengthComputable:t,total:s,loaded:n}),e[1]]},it=s=>(...e)=>p.asap(()=>s(...e)),Es=O.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,O.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,As=O.hasStandardBrowserEnv?{write(s,e,t,n,r,i){const o=[s+"="+encodeURIComponent(e)];p.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),p.isString(n)&&o.push("path="+n),p.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function _s(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function vs(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function $t(s,e,t){let n=!_s(e);return s&&n||t==!1?vs(s,e):e}const ot=s=>s instanceof N?{...s}:s;function G(s,e){e=e||{};const t={};function n(a,c,h,d){return p.isPlainObject(a)&&p.isPlainObject(c)?p.merge.call({caseless:d},a,c):p.isPlainObject(c)?p.merge({},c):p.isArray(c)?c.slice():c}function r(a,c,h,d){if(p.isUndefined(c)){if(!p.isUndefined(a))return n(void 0,a,h,d)}else return n(a,c,h,d)}function i(a,c){if(!p.isUndefined(c))return n(void 0,c)}function o(a,c){if(p.isUndefined(c)){if(!p.isUndefined(a))return n(void 0,a)}else return n(void 0,c)}function l(a,c,h){if(h in e)return n(a,c);if(h in s)return n(void 0,a)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(a,c,h)=>
`+i.map(ct).join(`
`):" "+ct(i[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Be};function Le(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new X(null,s)}function ut(s){return Le(s),s.headers=N.from(s.headers),s.data=ve.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Dt.getAdapter(s.adapter||le.adapter)(s).then(function(n){return Le(s),n.data=ve.call(s,s.transformResponse,n),n.headers=N.from(n.headers),n},function(n){return Ot(n)||(Le(s),n&&n.response&&(n.response.data=ve.call(s,s.transformResponse,n.response),n.response.headers=N.from(n.response.headers))),Promise.reject(n)})}const Ft="1.8.1",Se={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Se[s]=function(n){return typeof n===s||"a"+(e<1?"n ":" ")+s}});const pt={};Se.transitional=function(e,t,n){function r(i,o){return"[Axios v"+Ft+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,l)=>{if(e===!1)throw new C(r(o," has been removed"+(t?" in "+t:"")),C.ERR_DEPRECATED);return t&&!pt[o]&&(pt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,l):!0}};Se.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ms(s,e,t){if(typeof s!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let r=n.length;for(;r-- >0;){const i=n[r],o=e[i];if(o){const l=s[i],u=l===void 0||o(l,i,s);if(u!==!0)throw new C("option "+i+" must be "+u,C.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new C("Unknown option "+i,C.ERR_BAD_OPTION)}}const he={assertOptions:Ms,validators:Se},H=he.validators;let V=class{constructor(e){this.defaults=e,this.interceptors={request:new nt,response:new nt}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=G(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&he.assertOptions(n,{silentJSONParsing:H.transitional(H.boolean),forcedJSONParsing:H.transitional(H.boolean),clarifyTimeoutError:H.transitional(H.boolean)},!1),r!=null&&(p.isFunction(r)?t.paramsSerializer={serialize:r}:he.assertOptions(r,{encode:H.function,serialize:H.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),he.assertOptions(t,{baseUrl:H.spelling("baseURL"),withXsrfToken:H.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&p.merge(i.common,i[t.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=N.concat(o,i);const l=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(u=u&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const a=[];this.interceptors.response.forEach(function(g){a.push(g.fulfilled,g.rejected)});let c,h=0,d;if(!u){const f=[ut.bind(this),void 0];for(f.unshift.apply(f,l),f.push.apply(f,a),d=f.length,c=Promise.resolve(t);h<d;)c=c.then(f[h++],f[h++]);return c}d=l.length;let w=t;for(h=0;h<d;){const f=l[h++],g=l[h++];try{w=f(w)}catch(m){g.call(this,m);break}}try{c=ut.call(this,w)}catch(f){return Promise.reject(f)}for(h=0,d=a.length;h<d;)c=c.then(a[h++],a[h++]);return c}getUri(e){e=G(this.defaults,e);const t=$t(e.baseURL,e.url,e.allowAbsoluteUrls);return _t(t,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){V.prototype[e]=function(t,n){return this.request(G(n||{},{method:e,url:t,data:(n||{}).data}))}});p.forEach(["post","put","patch"],function(e){function t(n){return function(i,o,l){return this.request(G(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}V.prototype[e]=t(),V.prototype[e+"Form"]=t(!0)});let js=class It{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(l=>{n.subscribe(l),i=l}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,l){n.reason||(n.reason=new X(i,o,l),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new It(function(r){e=r}),cancel:e}}};function Hs(s){return function(t){return s.apply(null,t)}}function Zs(s){return p.isObject(s)&&s.isAxiosError===!0}const Ne={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,Unavailab
]`).replace("lheading",Ht).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ar=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jt=/^( {2,}|\\)\n(?!\s*$)/,cr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Te=/[\p{P}\p{S}]/u,Ve=/[\s\p{P}\p{S}]/u,Vt=/[^\s\p{P}\p{S}]/u,ur=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ve).getRegex(),Gt=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,hr=/(?:[^\s\p{P}\p{S}]|~)/u,fr=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Wt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dr=S(Wt,"u").replace(/punct/g,Te).getRegex(),gr=S(Wt,"u").replace(/punct/g,Gt).getRegex(),Kt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mr=S(Kt,"gu").replace(/notPunctSpace/g,Vt).replace(/punctSpace/g,Ve).replace(/punct/g,Te).getRegex(),br=S(Kt,"gu").replace(/notPunctSpace/g,hr).replace(/punctSpace/g,pr).replace(/punct/g,Gt).getRegex(),wr=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Vt).replace(/punctSpace/g,Ve).replace(/punct/g,Te).getRegex(),kr=S(/\\(punct)/,"gu").replace(/punct/g,Te).getRegex(),Cr=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(),xr=S(Ze).replace("(?:-->|$)","-->").getRegex(),yr=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ge=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sr=S(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ge).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",ge).replace("ref",He).getRegex(),Xt=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",He).getRegex(),Rr=S("reflink|nolink(?!\\()","g").replace("reflink",Qt).replace("nolink",Xt).getRegex(),Ge={_backpedal:se,anyPunctuation:kr,autolink:Cr,blockSkip:fr,br:Jt,code:ar,del:se,emStrongLDelim:dr,emStrongRDelimAst:mr,emStrongRDelimUnd:wr,escape:lr,link:Sr,nolink:Xt,punctuation:ur,reflink:Qt,reflinkSearch:Rr,tag:yr,text:cr,url:se},Tr={...Ge,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",ge).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge).getRegex()},De={...Ge,emStrongRDelimAst:br,emStrongLDelim:gr,url:S(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Er={...De,br:S(Jt).replace("{2,}","*").getRegex(),text:S(De.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ce={normal:Je,gfm:ir,pedantic:or},ee={normal:Ge,gfm:De,breaks:Er,pedantic:Tr},Ar={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ft=s=>Ar[s];function Z(s,e){if(e){if(z.escapeTest.test(s)
`).map(i=>{const o=i.match(t.other.beginningSpace);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
`)}class me{constructor(e){T(this,"options");T(this,"rules");T(this,"lexer");this.options=e||K}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:te(n,`
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=vr(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=te(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:te(t[0],`
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=te(t[0],`
`).split(`
`),r="",i="";const o=[];for(;n.length>0;){let l=!1;const u=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))u.push(n[a]),l=!0;else if(!l)u.push(n[a]);else break;n=n.slice(a);const c=u.join(`
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
${c}`:c,i=i?`${i}
${h}`:h;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,o,!0),this.lexer.state.top=d,n.length===0)break;const w=o.at(-1);if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){const f=w,g=f.raw+`
`+n.join(`
`),m=this.blockquote(g);o[o.length-1]=m,r=r.substring(0,r.length-f.raw.length)+m.raw,i=i.substring(0,i.length-f.text.length)+m.text;break}else if((w==null?void 0:w.type)==="list"){const f=w,g=f.raw+`
`+n.join(`
`),m=this.list(g);o[o.length-1]=m,r=r.substring(0,r.length-w.raw.length)+m.raw,i=i.substring(0,i.length-f.raw.length)+m.raw,n=g.substring(o.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={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 o=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let a=!1,c="",h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let d=t[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),w=e.split(`
`,1)[0],f=!d.trim(),g=0;if(this.options.pedantic?(g=2,h=d.trimStart()):f?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=d.slice(g),g+=t[1].length),f&&this.rules.other.blankLine.test(w)&&(c+=w+`
`,e=e.substring(w.length+1),a=!0),!a){const A=this.rules.other.nextBulletRegex(g),_=this.rules.other.hrRegex(g),B=this.rules.other.fencesBeginRegex(g),x=this.rules.other.headingBeginRegex(g),k=this.rules.other.htmlBeginRegex(g);for(;e;){const v=e.split(`
`,1)[0];let y;if(w=v,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),y=w):y=w.replace(this.rules.other.tabCharGlobal," "),B.test(w)||x.test(w)||k.test(w)||A.test(w)||_.test(w))break;if(y.search(this.rules.other.nonSpaceChar)>=g||!w.trim())h+=`
`+y.slice(g);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(d)||x.test(d)||_.test(d))break;h+=`
`+w}!f&&!w.trim()&&(f=!0),c+=v+`
`,e=e.substring(v.length+1),d=y.slice(g)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let m=null,E;this.options.gfm&&(m=this.rules.other.listIsTask.exec(h),m&&(E=m[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:c,task:!!m,checked:E,loose:!1,text:h,tokens:[]}),i.raw+=c}const u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let a=0;a<i.items.length;a++)if(this.lexer.state.top=!1,i.items[a].tokens=this.lexer.blockTokens(i.items[a].text,[]),!i.loose){const c=i.items[a].tokens.filter(d=>d.type==="space"),h=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=h}if(i.loose)for(let a=0;a<i.items.length;a++)i.items[a].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=gt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const u of r)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<n.length;u++)o.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:o.align[u]});for(const u of i)o.rows.push(gt(u,o.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[c]})));return o}}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 n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}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 n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=te(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=_r(t[2],"()");if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),mt(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},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 r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return mt(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let l,u,a=o,c=0;const h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+o);(r=h.exec(t))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(u=[...l].length,r[3]||r[4]){a+=u;continue}else if((r[5]||r[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+c);const d=[...r[0]][0].length,w=e.slice(0,o+r.index+d+u);if(Math.min(o,u)%2){const g=w.slice(1,-1);return{type:"em",raw:w,text:g,tokens:this.lexer.inlineTokens(g)}}const f=w.slice(2,-2);return{type:"strong",raw:w,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}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 n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(z.tabCharGlobal," ").replace(z.spaceLine,""));e;){let l;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(a=>(l=a.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const a=t.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
`:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let u=e;if((o=this.options.extensions)!=null&&o.startBlock){let a=1/0;const c=e.slice(1);let h;this.options.extensions.startBlock.forEach(d=>{h=d.call({lexer:this},c),typeof h=="number"&&h>=0&&(a=Math.min(a,h))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){const a=t.at(-1);n&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l),n=u.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
`+l.raw,a.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,u,a;let n=e,r=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.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(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,o="";for(;e;){i||(o=""),i=!1;let c;if((u=(l=this.options.extensions)==null?void 0:l.inline)!=null&&u.some(d=>(c=d.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const d=t.at(-1);c.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=c.raw,d.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let h=e;if((a=this.options.extensions)!=null&&a.startInline){let d=1/0;const w=e.slice(1);let f;this.options.extensions.startInline.forEach(g=>{f=g.call({lexer:this},w),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(h=e.substring(0,d+1))}if(c=this.tokenizer.inlineText(h)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),i=!0;const d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=c.raw,d.text+=c.text):t.push(c);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class be{constructor(e){T(this,"options");T(this,"parser");this.options=e||K}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(z.notSpaceStart))==null?void 0:o[0],i=e.replace(z.endingNewline,"")+`
`;return r?'<pre><code class="language-'+Z(r)+'">'+(n?i:Z(i,!0))+`</code></pre>
`:"<pre><code>"+(n?i:Z(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){const t=e.ordered,n=e.start;let r="";for(let l=0;l<e.items.length;l++){const u=e.items[l];r+=this.listitem(u)}const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
`+r+"</"+i+`>
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Z(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){const o=e.rows[i];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+r+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}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`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Z(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=dt(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+Z(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n}){const r=dt(e);if(r===null)return Z(n);e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${Z(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Z(e.text)}}class We{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class q{constructor(e){T(this,"options");T(this,"renderer");T(this,"textRenderer");this.options=e||K,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new We}static parse(e,t){return new q(t).parse(e)}static parseInline(e,t){return new q(t).parseInline(e)}parse(e,t=!0){var r,i;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const a=l,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=c||"";continue}}const u=l;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let a=u,c=this.renderer.text(a);for(;o+1<e.length&&e[o+1].type==="text";)a=e[++o],c+=`
`+this.renderer.text(a);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t=this.renderer){var r,i;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=a||"";continue}}const u=l;switch(u.type){case"escape":{n+=t.text(u);break}case"html":{n+=t.html(u);break}case"link":{n+=t.link(u);break}case"image":{n+=t.image(u);break}case"strong":{n+=t.strong(u);break}case"em":{n+=t.em(u);break}case"codespan":{n+=t.codespan(u);break}case"br":{n+=t.br(u);break}case"del":{n+=t.del(u);break}case"text":{n+=t.text(u);break}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class re{constructor(e){T(this,"options");T(this,"block");this.options=e||K}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?I.lex:I.lexInline}provideParser(){return this.block?q.parse:q.parseInline}}T(re,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Lr{constructor(...e){T(this,"defaults",Ue());T(this,"options",this.setOptions);T(this,"parse",this.parseMarkdown(!0));T(this,"parseInline",this.parseMarkdown(!1));T(this,"Parser",q);T(this,"Renderer",be);T(this,"TextRenderer",We);T(this,"Lexer",I);T(this,"Tokenizer",me);T(this,"Hooks",re);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const l=o;for(const u of l.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of l.rows)for(const a of u)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const l=o;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[l.type]?this.defaults.extensions.childTokens[l.type].forEach(u=>{const a=l[u].flat(1/0);n=n.concat(this.walkTokens(a,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let u=i.renderer.apply(this,l);return u===!1&&(u=o.apply(this,l)),u}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new be(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const l=o,u=n.renderer[l],a=i[l];i[l]=(...c)=>{let h=u.apply(i,c);return h===!1&&(h=a.apply(i,c)),h||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new me(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const l=o,u=n.tokenizer[l],a=i[l];i[l]=(...c)=>{let h=u.apply(i,c);return h===!1&&(h=a.apply(i,c)),h}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new re;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options"
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+Z(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}const W=new Lr;function R(s,e){return W.parse(s,e)}R.options=R.setOptions=function(s){return W.setOptions(s),R.defaults=W.defaults,Mt(R.defaults),R};R.getDefaults=Ue;R.defaults=K;R.use=function(...s){return W.use(...s),R.defaults=W.defaults,Mt(R.defaults),R};R.walkTokens=function(s,e){return W.walkTokens(s,e)};R.parseInline=W.parseInline;R.Parser=q;R.parser=q.parse;R.Renderer=be;R.TextRenderer=We;R.Lexer=I;R.lexer=I.lex;R.Tokenizer=me;R.Hooks=re;R.parse=R;R.options;R.setOptions;R.use;R.walkTokens;R.parseInline;q.parse;I.lex;const Or={id:"root"},Pr={class:"cb86951c"},$r={class:"c3ecdb44"},zr={class:"f2eea526"},Br={class:"a5cd95be"},Nr={class:"b83ee326"},Dr={class:"f6004764"},Fr={key:0,class:"fa81"},Ir={class:"fbb737a4"},qr={class:"ds-flex e0558cb1",style:{position:"absolute",right:"calc(100% + 18px)",top:"12px",gap:"12px"}},Ur={class:"ds-icon-button",tabindex:"0",style:{"--ds-icon-button-text-color":"#909090","--ds-icon-button-size":"20px"}},Mr=["onClick"],jr={viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Hr={key:1,class:"f9bf7997 d7dc56a8 c05b5566"},Zr={class:"edb250b1"},Jr={key:0,class:"a6d716f5 db5991dd"},Vr={key:1,class:"a6d716f5 db5991dd"},Gr={key:2,class:"ds-loading b4e4476b",style:{"font-size":"20px"}},Wr={key:3,class:"e1675d8b"},Kr={class:"ba94db8a"},Qr={class:"ds-markdown ds-markdown--block",style:{"--ds-md-zoom":"1.143"}},Xr=["innerHTML"],Yr={class:"ds-flex",style:{"margin-top":"12px",height:"20px","align-items":"center",gap:"12px"}},ei={class:"ds-flex abe97156",style:{"align-items":"center",gap:"12px"}},ti={class:"ds-icon-button",tabindex:"0",style:{"--ds-icon-button-text-color":"#909090","--ds-icon-button-size":"20px"}},ni=["onClick"],si={viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},ri={key:1,class:"a85a674a"},ii={class:"aaff8b8f"},oi={class:"cefa5c26"},li={class:"fad49dec"},ai=["onKeyup"],ci={class:"ec4f5d61"},ui={class:"bf38813a"},Pi=tn({__name:"ai",setup(s){const e=j(""),t=j(!1),n=j(""),r=j([]),i=nn({page:1,limit:1}),o=j(new Set),l=j(null),u=j(!1),a=j(!0),c=async()=>{await dn(),setTimeout(()=>{const x=l.value;x&&(!u.value||a.value)&&(x.scrollTop=x.scrollHeight)},100)},h=x=>{const k=x.currentTarget,v=Math.abs(k.scrollHeight-k.scrollTop-k.clientHeight)<50;console.log(k.scrollHeight-k.scrollTop-k.clientHeight),v?u.value=!1:u.value=!0};sn(()=>{e.value=Date.now().toString()});const d=()=>{if(w.value==!0){w.value=!1,a.value=!0;return}const x=r.value.length-1;if(r.value[x].role!="assistant"&&r.value.push({role:"assistant",sk:"",content:"",skLong:!1,msgCode:1}),r.value[x].msgCode==0){w.value=!1,a.value=!0;return}Gs({key:e.value,page:i.page,limit:i.limit}).then(k=>{if(k.code==1){for(let v=0;v<k.data.list.length;v++){const y=k.data.list[v];if(!o.value.has(y.id)){o.value.add(y.id);const D=r.value.length-1;y.reasoning==1?(r.value[D].skLong=!0,r.value[D].sk+=y.content):(r.value[D].skLong=!1,r.value[D].content+=y.content)}if(y.usage_json.length>0||y.usage_json.prompt_tokens){const D=r.value.length-1;r.value[D].content=R(r.value[D].content),r.value[D].skLong=!1,a.value=!0;return}c()}k.data.list.length==i.limit&&i.page++,d()}})},w=j(!1),f=()=>{if(!(!n.value||n.value.trim()==="")&&(console.log(a.value),a.value==!0)){t.value=!0,r.value.push({role:"user",content:n.value}),e.value=Date.now().toString(),i.page=1,o.value.clear(),n.value="",a.value=!1,u.value=!1;let x=r.value.at(-1);x.role=="assistant"&&x.content==""&&r.value.pop(),c(),Vs({key:e.value,messages:JSON.stringify(r.value)}).then(k=>{if(console.log(k),k.code==0){const v=r.value.length-1;r.value[v].skLong=!1,r.value[v].msgCode=0}}),d()}},g=()=>{window.location.reload()};rn(()=>{o.value.clear(),i.page=1});const m=x=>{navigator.clipboard.writeText(x)};on(()=>"10%");const E=x=>{x.shiftKey||(x.preventDefault(),f())},A=x=>x&&x.trim().replace(/[