@alicloud/appflow-chat 0.0.4-alpha.7 → 0.0.4-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appflow-chat.cjs.js +2 -2
- package/dist/appflow-chat.esm.js +11 -11
- package/package.json +1 -1
- package/src/services/ChatService.ts +17 -14
package/dist/appflow-chat.cjs.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
`),o=s===-1?-1:i.indexOf(`
|
|
8
8
|
`,s+1),u=o===-1?"":i.slice(o+1);String(n.stack).endsWith(u)||(n.stack+=`
|
|
9
9
|
`+i)}}catch(s){}}throw n}})}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Sn(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&Ji.assertOptions(n,{silentJSONParsing:Gt.transitional(Gt.boolean),forcedJSONParsing:Gt.transitional(Gt.boolean),clarifyTimeoutError:Gt.transitional(Gt.boolean),legacyInterceptorReqResOrdering:Gt.transitional(Gt.boolean)},!1),a!=null&&(j.isFunction(a)?r.paramsSerializer={serialize:a}:Ji.assertOptions(a,{encode:Gt.function,serialize:Gt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ji.assertOptions(r,{baseUrl:Gt.spelling("baseURL"),withXsrfToken:Gt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&j.merge(i.common,i[r.method]);i&&j.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=Bt.concat(s,i);const o=[];let u=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;u=u&&y.synchronous;const E=r.transitional||qu;E&&E.legacyInterceptorReqResOrdering?o.unshift(y.fulfilled,y.rejected):o.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let c,f=0,p;if(!u){const b=[vc.bind(this),void 0];for(b.unshift(...o),b.push(...l),p=b.length,c=Promise.resolve(r);f<p;)c=c.then(b[f++],b[f++]);return c}p=o.length;let h=r;for(;f<p;){const b=o[f++],y=o[f++];try{h=b(h)}catch(E){y.call(this,E);break}}try{c=vc.call(this,h)}catch(b){return Promise.reject(b)}for(f=0,p=l.length;f<p;)c=c.then(l[f++],l[f++]);return c}getUri(t){t=Sn(this.defaults,t);const r=th(t.baseURL,t.url,t.allowAbsoluteUrls);return Qd(r,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){Tn.prototype[t]=function(r,n){return this.request(Sn(n||{},{method:t,url:r,data:(n||{}).data}))}});j.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,o){return this.request(Sn(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Tn.prototype[t]=r(),Tn.prototype[t+"Form"]=r(!0)});let C6=class sh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(o=>{n.subscribe(o),i=o}).then(a);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,o){n.reason||(n.reason=new di(i,s,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new sh(function(a){t=a}),cancel:t}}};function I6(e){return function(r){return e.apply(null,r)}}function _6(e){return j.isObject(e)&&e.isAxiosError===!0}const Ro={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,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ro).forEach(([e,t])=>{Ro[t]=e});function oh(e){const t=new Tn(e),r=Hd(Tn.prototype.request,t);return j.extend(r,Tn.prototype,t,{allOwnKeys:!0}),j.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return oh(Sn(e,a))},r}const lt=oh(fi);lt.Axios=Tn;lt.CanceledError=di;lt.CancelToken=C6;lt.isCancel=Zd;lt.VERSION=ih;lt.toFormData=Ps;lt.AxiosError=Ae;lt.Cancel=lt.CanceledError;lt.all=function(t){return Promise.all(t)};lt.spread=I6;lt.isAxiosError=_6;lt.mergeConfig=Sn;lt.AxiosHeaders=Bt;lt.formToJSON=e=>Jd(j.isHTMLForm(e)?new FormData(e):e);lt.getAdapter=ah.getAdapter;lt.HttpStatusCode=Ro;lt.default=lt;const{Axios:HO,AxiosError:UO,CanceledError:jO,isCancel:$O,CancelToken:qO,VERSION:YO,all:WO,Cancel:VO,isAxiosError:GO,spread:XO,toFormData:KO,AxiosHeaders:QO,HttpStatusCode:JO,formToJSON:ZO,getAdapter:eR,mergeConfig:tR}=lt,N6=(e,t)=>new Promise((r,n)=>{lt.put(t,e,{headers:{"Content-Type":"application/octet-stream","x-oss-object-acl":"private"}}).then(()=>{r({})}).catch(a=>n(a))});/*! js-cookie v3.0.5 | MIT */function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var O6={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Do(e,t){function r(a,i,s){if(typeof document!="undefined"){s=_i({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var u in s)s[u]&&(o+="; "+u,s[u]!==!0&&(o+="="+s[u].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+o}}function n(a){if(!(typeof document=="undefined"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],s={},o=0;o<i.length;o++){var u=i[o].split("="),l=u.slice(1).join("=");try{var c=decodeURIComponent(u[0]);if(s[c]=e.read(l,c),a===c)break}catch(f){}}return a?s[a]:s}}return Object.create({set:r,get:n,remove:function(a,i){r(a,"",_i({},i,{expires:-1}))},withAttributes:function(a){return Do(this.converter,_i({},this.attributes,a))},withConverter:function(a){return Do(_i({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Ni=Do(O6,{path:"/"});class uh{constructor(){Fn(this,"config",null);Fn(this,"setupConfig",null);Fn(this,"sessionId","");Fn(this,"currentController",null);Fn(this,"isInitialized",!1)}setup(t){return Fe(this,null,function*(){this.setupConfig=t,typeof window!="undefined"&&(window.__APPFLOW_CHAT_SERVICE_CONFIG__={integrateConfig:{integrateId:t.integrateId,domain:t.domain?{requestDomain:t.domain}:void 0,access_session_token:t.access_session_token}}),t.access_session_token&&Ni.remove("appflow_chat_ticket"),yield this.initTicket();const r=yield this.fetchConfig(t.integrateId);return this.config=r,this.isInitialized=!0,r})}initTicket(){return Fe(this,null,function*(){var n,a,i;const t=((n=this.setupConfig)==null?void 0:n.domain)||"";if(!Ni.get("appflow_chat_ticket"))try{const o=yield(yield fetch(`${t}/webhook/login/init/ticket`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({loginType:"chatbot_integrate",integrateId:(a=this.setupConfig)==null?void 0:a.integrateId,accessSessionToken:(i=this.setupConfig)==null?void 0:i.access_session_token})})).json();o!=null&&o.data&&(o==null?void 0:o.code)==="200"&&Ni.set("appflow_chat_ticket",o.data,{expires:7})}catch(s){console.error("初始化ticket失败:",s)}})}fetchConfig(t){return Fe(this,null,function*(){var n,a,i,s,o,u;const r=((n=this.setupConfig)==null?void 0:n.domain)||"";try{const{token:l,ticket:c}=yield this.getRequestToken(),p=yield(yield fetch(`${r}/webhook/chatbot/integrate/${t}`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":l,"X-Account-Session-Ticket":c}})).json();if((p==null?void 0:p.httpStatusCode)===200&&(p!=null&&p.data)){const h=p.data,b=h.integrateConfig,y=b?JSON.parse(b):{},E=(h.models||[]).map(T=>{var A,k,F,B,O,M,z,U,L;return{id:T.chatbotModelId||T.ChatbotModelId,name:T.modelName||T.ModelName||T.chatbotModelId,config:{image:((A=T.config)==null?void 0:A.image)||((k=T.Config)==null?void 0:k.image)||((F=T.Config)==null?void 0:F.Image),file:((B=T.config)==null?void 0:B.file)||((O=T.Config)==null?void 0:O.file)||((M=T.Config)==null?void 0:M.File),webSearch:((z=T.config)==null?void 0:z.webSearch)||((U=T.Config)==null?void 0:U.webSearch)||((L=T.Config)==null?void 0:L.WebSearch)}}});return{welcome:((a=y==null?void 0:y.message)==null?void 0:a.welcome)||"欢迎使用AI助手",questions:((i=y==null?void 0:y.config)==null?void 0:i.questions)||[],models:E,features:{image:((s=y==null?void 0:y.message)==null?void 0:s.imageEnabled)||!1,file:((o=y==null?void 0:y.message)==null?void 0:o.fileEnabled)||!1,audio:((u=y==null?void 0:y.message)==null?void 0:u.audioEnabled)||!1,webSearch:E.some(T=>{var A;return(A=T.config)==null?void 0:A.webSearch})},chatbotId:h.chatbotId,integrateId:t}}throw new Error("获取配置失败")}catch(l){return console.error("获取配置失败:",l),{welcome:"欢迎使用AI助手",questions:[],models:[],features:{image:!1,file:!1,audio:!1,webSearch:!1},chatbotId:"",integrateId:t}}})}getRequestToken(){return Fe(this,null,function*(){var s;const t=((s=this.setupConfig)==null?void 0:s.domain)||"",r=Ni.get("appflow_chat_ticket")||"";if(!r)throw new Error("未找到认证票据,请先调用setup");const a=yield(yield fetch(`${t}/webhook/request/token/acquireRequestToken`,{method:"POST",headers:{"Content-Type":"application/json","X-Account-Session-Ticket":r}})).json(),i=a==null?void 0:a.data;if(!i)throw new Error("获取请求令牌失败");return{token:i,ticket:r}})}chat(t){if(!this.isInitialized||!this.config)throw new Error("请先调用 setup() 初始化SDK");const r={};this.sendMessage(t,r);const n={onMessage:a=>(r.onMessage=a,n),onError:a=>(r.onError=a,n)};return n}sendMessage(t,r){return Fe(this,null,function*(){var o,u,l,c,f,p,h,b,y;const n=((o=this.setupConfig)==null?void 0:o.domain)||"",a=((u=this.config)==null?void 0:u.integrateId)||"",i=t.modelId||((c=(l=this.config)==null?void 0:l.models[0])==null?void 0:c.id);this.currentController=new AbortController;let s="";try{const{token:E,ticket:T}=yield this.getRequestToken(),A={chatbotId:(f=this.config)==null?void 0:f.chatbotId,chatbotModelId:i,sessionId:this.sessionId};if(t.audio)A.messageType="audio",A.audio={mediaUrl:t.audio,mediaType:"wav"};else if(t.images&&t.images.length>0||t.files&&t.files.length>0){A.messageType="rich";const k=[];t.text&&k.push({type:"text",content:t.text}),(p=t.images)==null||p.forEach(F=>{k.push({type:"image",mediaUrl:F})}),(h=t.files)==null||h.forEach(F=>{k.push({type:"file",mediaUrl:F})}),A.richText=k}else A.messageType="text",A.text={content:t.text||""};t.webSearch&&(A.config={webSearch:!0}),yield G4(`${n}/webhook/chatbot/chat/${a}`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":E,"X-Account-Session-Ticket":T},body:JSON.stringify(A),signal:this.currentController.signal,timeout:150*1e3,onopen:k=>Fe(this,null,function*(){if(!k.ok&&k.status!==200){const F=yield k.text();throw new Error(F)}}),onmessage:k=>{var F;try{const B=JSON.parse(k.data);if(B.sessionId&&(this.sessionId=B.sessionId),B.messageType==="event")return;s=B.content||"";const O=B.status!=="Running",M={status:B.status,references:B.references,sessionId:B.sessionId,messageType:B.messageType,messageId:B.messageId};if(B.messageType==="card"){M.sessionWebhook=B.sessionWebhook;try{const z=JSON.parse(B.content);if(M.cardType=z.type,M.cardData=z.data,M.cardDisplayContent=z.content,z.type==="chatbot_input"){const U=z.data;if(M.verifyId=U==null?void 0:U.verifyId,U){for(const L in U)if(U[L]&&typeof U[L]=="object"&&U[L].AssociationProperty==="CustomParams"){M.customParamsKey=L,M.customParams=U[L];break}}}if(z.type==="update_chatbot_input"){const U=z.data;M.approvedMessageId=U==null?void 0:U.messageId,M.approvedStatus=U==null?void 0:U.status}}catch(z){console.error("解析 card content 失败:",z)}}(F=r.onMessage)==null||F.call(r,s,O,M)}catch(B){console.error("解析消息失败:",B)}},onclose:()=>{var k;(k=r.onMessage)==null||k.call(r,s,!0)},onerror:k=>{var F;(F=r.onError)==null||F.call(r,new Error((k==null?void 0:k.message)||"请求失败"))}})}catch(E){(E==null?void 0:E.name)==="AbortError"?(b=r.onMessage)==null||b.call(r,s||"",!0,{status:"Cancelled"}):(y=r.onError)==null||y.call(r,E)}})}upload(t){return Fe(this,null,function*(){var a,i,s;if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const r=((a=this.setupConfig)==null?void 0:a.domain)||"",n=((i=this.config)==null?void 0:i.integrateId)||"";try{const{token:o,ticket:u}=yield this.getRequestToken(),c=(s=(yield fetch(`${r}/webhook/chatbot/chat/${n}`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":o,"X-Account-Session-Ticket":u},body:JSON.stringify({messageType:"event",event:{eventType:"uploadToken",content:JSON.stringify({fileName:t.name})}})})).body)==null?void 0:s.getReader();if(!c)throw new Error("无法读取响应");let f=null;const p=new TextDecoder;let h="";for(;;){const{done:y,value:E}=yield c.read();if(y)break;h+=p.decode(E,{stream:!0});const T=h.split(`
|
|
10
|
-
`);h=T.pop()||"";for(const A of T){const k=A.trim();if(k.startsWith("data:"))try{const F=k.slice(5).trim();if(F){const B=JSON.parse(F);if(B.content){const O=typeof B.content=="string"?JSON.parse(B.content):B.content;O.uploadUrl&&(f=O)}}}catch(F){console.debug("解析SSE行失败:",A,F)}}}if(h.trim().startsWith("data:"))try{const y=h.trim().slice(5).trim();if(y){const E=JSON.parse(y);if(E.content){const T=typeof E.content=="string"?JSON.parse(E.content):E.content;T.uploadUrl&&(f=T)}}}catch(y){console.debug("解析SSE剩余数据失败:",h,y)}if(!(f!=null&&f.uploadUrl))throw console.error("获取上传URL失败,uploadInfo:",f),new Error("获取上传URL失败");const b=new Blob([t],{type:t.type||"application/octet-stream"});if(yield N6(b,f.uploadUrl),!f.downloadUrl)throw console.error("downloadUrl为空,uploadInfo:",f),new Error("获取下载URL失败");return f.downloadUrl}catch(o){throw console.error("上传文件失败:",o),o}})}clear(){this.sessionId="",this.cancel()}cancel(){this.currentController&&(this.currentController.abort(),this.currentController=null)}getConfig(){return this.config}getSessionId(){return this.sessionId}getModelCapabilities(t){var a,i,s,o;if(!this.config)return{image:!1,file:!1,audio:!1,webSearch:!1};const r=t?this.config.models.find(u=>u.id===t):this.config.models[0];if(!r)return{image:!1,file:!1,audio:!1,webSearch:!1};let n;if((a=r.config)!=null&&a.fileConfig)try{n=JSON.parse(r.config.fileConfig)}catch(u){}return{image:!!(this.config.features.image&&((i=r.config)!=null&&i.image)),file:!!(this.config.features.file&&((s=r.config)!=null&&s.file)),audio:!!this.config.features.audio,webSearch:!!((o=r.config)!=null&&o.webSearch),fileConfig:n}}hasCapability(t,r){return this.getModelCapabilities(r)[t]}setSessionId(t){this.sessionId=t}getHistory(t){return Fe(this,null,function*(){var i,s;if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const r=((i=this.setupConfig)==null?void 0:i.domain)||"",n=((s=this.config)==null?void 0:s.integrateId)||"",a=t||this.sessionId;try{const{token:o,ticket:u}=yield this.getRequestToken(),c=yield(yield fetch(`${r}/webhook/chatbot/integrate/${n}/message`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":o,"X-Account-Session-Ticket":u},body:a?JSON.stringify({sessionId:a}):void 0})).json();if((c==null?void 0:c.httpStatusCode)===200&&(c!=null&&c.data)){const f=[],p=c.data;if(Array.isArray(p))for(const h of p){if(h.message!==void 0&&h.message!==null){const b=h.messageType||"text";let y="",E,T;if(b==="rich"&&Array.isArray(h.message)){const k=[],F=[],B=[];for(const O of h.message)O.type==="text"&&O.content?k.push(O.content):O.type==="image"&&O.mediaUrl?F.push(O.mediaUrl):O.type==="file"&&O.mediaUrl&&B.push({name:O.mediaName||"文件",url:O.mediaUrl});y=k.join(`
|
|
11
|
-
`),F.length>0&&(E=F),B.length>0&&(T=B)}else typeof h.message=="string"&&(y=h.message);const A=b==="audio";f.push({id:h.id||`user_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,role:"user",content:A?"":y,messageType:b,gmtCreate:h.gmtCreate,sessionId:h.sessionId,images:E,files:T,audio:A?y:void 0})}if(h.assistant&&Array.isArray(h.assistant)&&h.assistant.length>0){const b=h.assistant[0];f.push({id:b.messageId||`assistant_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,role:"assistant",content:b.content||"",messageType:b.messageType||"text",gmtCreate:h.gmtCreate,sessionId:b.sessionId||h.sessionId})}}return f.reverse()}return[]}catch(o){throw console.error("获取历史记录失败:",o),o}})}getSessions(){return Fe(this,null,function*(){var n,a;if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const t=((n=this.setupConfig)==null?void 0:n.domain)||"",r=((a=this.config)==null?void 0:a.integrateId)||"";try{const{token:i,ticket:s}=yield this.getRequestToken(),u=yield(yield fetch(`${t}/webhook/chatbot/integrate/${r}/message`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":i,"X-Account-Session-Ticket":s}})).json();return(u==null?void 0:u.httpStatusCode)===200&&(u!=null&&u.data)?(u.data||[]).map(c=>({id:c.id,sessionId:c.sessionId,title:c.title||"未命名会话",gmtCreate:c.gmtCreate,gmtModified:c.gmtModified})):[]}catch(i){throw console.error("获取会话列表失败:",i),i}})}sendEventCallback(t){return Fe(this,null,function*(){if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const{sessionWebhook:r,content:n}=t;if(!r)throw new Error("sessionWebhook 不能为空");try{const{token:a,ticket:i}=yield this.getRequestToken(),s=yield fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":a,"X-Account-Session-Ticket":i},body:JSON.stringify(n)});if(!s.ok){const o=yield s.text();throw new Error(`发送事件回调失败: ${s.status} ${o}`)}}catch(a){throw console.error("发送事件回调失败:",a),a}})}submitHumanVerify(t){return Fe(this,null,function*(){const{verifyId:r,sessionWebhook:n,status:a,customParams:i,customParamsKey:s="customParams"}=t;if(!r)throw new Error("verifyId 不能为空");const o={verifyId:r,status:a};return i&&(o[s]=i),this.sendEventCallback({sessionWebhook:n,content:o})})}}const R6=new uh;var Qe="-ms-",Fa="-moz-",Ue="-webkit-",lh="comm",Bs="rule",Vu="decl",D6="@import",L6="@namespace",ch="@keyframes",M6="@layer",fh=Math.abs,Gu=String.fromCharCode,Lo=Object.assign;function P6(e,t){return bt(e,0)^45?(((t<<2^bt(e,0))<<2^bt(e,1))<<2^bt(e,2))<<2^bt(e,3):0}function dh(e){return e.trim()}function Sr(e,t){return(e=t.exec(e))?e[0]:e}function Re(e,t,r){return e.replace(t,r)}function Zi(e,t,r){return e.indexOf(t,r)}function bt(e,t){return e.charCodeAt(t)|0}function kn(e,t,r){return e.slice(t,r)}function rr(e){return e.length}function hh(e){return e.length}function Oa(e,t){return t.push(e),e}function F6(e,t){return e.map(t).join("")}function Ac(e,t){return e.filter(function(r){return!Sr(r,t)})}var zs=1,Xn=1,mh=0,Jt=0,ft=0,ua="";function Hs(e,t,r,n,a,i,s,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:zs,column:Xn,length:s,return:"",siblings:o}}function $r(e,t){return Lo(Hs("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function zn(e){for(;e.root;)e=$r(e.root,{children:[e]});Oa(e,e.siblings)}function B6(){return ft}function z6(){return ft=Jt>0?bt(ua,--Jt):0,Xn--,ft===10&&(Xn=1,zs--),ft}function ar(){return ft=Jt<mh?bt(ua,Jt++):0,Xn++,ft===10&&(Xn=1,zs++),ft}function Vr(){return bt(ua,Jt)}function es(){return Jt}function Us(e,t){return kn(ua,e,t)}function Ka(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function H6(e){return zs=Xn=1,mh=rr(ua=e),Jt=0,[]}function U6(e){return ua="",e}function R0(e){return dh(Us(Jt-1,Mo(e===91?e+2:e===40?e+1:e)))}function j6(e){for(;(ft=Vr())&&ft<33;)ar();return Ka(e)>2||Ka(ft)>3?"":" "}function $6(e,t){for(;--t&&ar()&&!(ft<48||ft>102||ft>57&&ft<65||ft>70&&ft<97););return Us(e,es()+(t<6&&Vr()==32&&ar()==32))}function Mo(e){for(;ar();)switch(ft){case e:return Jt;case 34:case 39:e!==34&&e!==39&&Mo(ft);break;case 40:e===41&&Mo(e);break;case 92:ar();break}return Jt}function q6(e,t){for(;ar()&&e+ft!==57;)if(e+ft===84&&Vr()===47)break;return"/*"+Us(t,Jt-1)+"*"+Gu(e===47?e:ar())}function Y6(e){for(;!Ka(Vr());)ar();return Us(e,Jt)}function W6(e){return U6(ts("",null,null,null,[""],e=H6(e),0,[0],e))}function ts(e,t,r,n,a,i,s,o,u){for(var l=0,c=0,f=s,p=0,h=0,b=0,y=1,E=1,T=1,A=0,k="",F=a,B=i,O=n,M=k;E;)switch(b=A,A=ar()){case 40:if(b!=108&&bt(M,f-1)==58){Zi(M+=Re(R0(A),"&","&\f"),"&\f",fh(l?o[l-1]:0))!=-1&&(T=-1);break}case 34:case 39:case 91:M+=R0(A);break;case 9:case 10:case 13:case 32:M+=j6(b);break;case 92:M+=$6(es()-1,7);continue;case 47:switch(Vr()){case 42:case 47:Oa(V6(q6(ar(),es()),t,r,u),u),(Ka(b||1)==5||Ka(Vr()||1)==5)&&rr(M)&&kn(M,-1,void 0)!==" "&&(M+=" ");break;default:M+="/"}break;case 123*y:o[l++]=rr(M)*T;case 125*y:case 59:case 0:switch(A){case 0:case 125:E=0;case 59+c:T==-1&&(M=Re(M,/\f/g,"")),h>0&&(rr(M)-f||y===0&&b===47)&&Oa(h>32?kc(M+";",n,r,f-1,u):kc(Re(M," ","")+";",n,r,f-2,u),u);break;case 59:M+=";";default:if(Oa(O=Sc(M,t,r,l,c,a,o,k,F=[],B=[],f,i),i),A===123)if(c===0)ts(M,t,O,O,F,i,f,o,B);else{switch(p){case 99:if(bt(M,3)===110)break;case 108:if(bt(M,2)===97)break;default:c=0;case 100:case 109:case 115:}c?ts(e,O,O,n&&Oa(Sc(e,O,O,0,0,a,o,k,a,F=[],f,B),B),a,B,f,o,n?F:B):ts(M,O,O,O,[""],B,0,o,B)}}l=c=h=0,y=T=1,k=M="",f=s;break;case 58:f=1+rr(M),h=b;default:if(y<1){if(A==123)--y;else if(A==125&&y++==0&&z6()==125)continue}switch(M+=Gu(A),A*y){case 38:T=c>0?1:(M+="\f",-1);break;case 44:o[l++]=(rr(M)-1)*T,T=1;break;case 64:Vr()===45&&(M+=R0(ar())),p=Vr(),c=f=rr(k=M+=Y6(es())),A++;break;case 45:b===45&&rr(M)==2&&(y=0)}}return i}function Sc(e,t,r,n,a,i,s,o,u,l,c,f){for(var p=a-1,h=a===0?i:[""],b=hh(h),y=0,E=0,T=0;y<n;++y)for(var A=0,k=kn(e,p+1,p=fh(E=s[y])),F=e;A<b;++A)(F=dh(E>0?h[A]+" "+k:Re(k,/&\f/g,h[A])))&&(u[T++]=F);return Hs(e,t,r,a===0?Bs:o,u,l,c,f)}function V6(e,t,r,n){return Hs(e,t,r,lh,Gu(B6()),kn(e,2,-2),0,n)}function kc(e,t,r,n,a){return Hs(e,t,r,Vu,kn(e,0,n),kn(e,n+1,-1),n,a)}function ph(e,t,r){switch(P6(e,t)){case 5103:return Ue+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return Ue+e+e;case 4855:return Ue+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Fa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ue+e+Fa+e+Qe+e+e;case 5936:switch(bt(e,t+11)){case 114:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ue+e+Qe+e+e;case 6165:return Ue+e+Qe+"flex-"+e+e;case 5187:return Ue+e+Re(e,/(\w+).+(:[^]+)/,Ue+"box-$1$2"+Qe+"flex-$1$2")+e;case 5443:return Ue+e+Qe+"flex-item-"+Re(e,/flex-|-self/g,"")+(Sr(e,/flex-|baseline/)?"":Qe+"grid-row-"+Re(e,/flex-|-self/g,""))+e;case 4675:return Ue+e+Qe+"flex-line-pack"+Re(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ue+e+Qe+Re(e,"shrink","negative")+e;case 5292:return Ue+e+Qe+Re(e,"basis","preferred-size")+e;case 6060:return Ue+"box-"+Re(e,"-grow","")+Ue+e+Qe+Re(e,"grow","positive")+e;case 4554:return Ue+Re(e,/([^-])(transform)/g,"$1"+Ue+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,Ue+"$1"),/(image-set)/,Ue+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,Ue+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,Ue+"box-pack:$3"+Qe+"flex-pack:$3"),/space-between/,"justify")+Ue+e+e;case 4200:if(!Sr(e,/flex-|baseline/))return Qe+"grid-column-align"+kn(e,t)+e;break;case 2592:case 3360:return Qe+Re(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,a){return t=a,Sr(n.props,/grid-\w+-end/)})?~Zi(e+(r=r[t].value),"span",0)?e:Qe+Re(e,"-start","")+e+Qe+"grid-row-span:"+(~Zi(r,"span",0)?Sr(r,/\d+/):+Sr(r,/\d+/)-+Sr(e,/\d+/))+";":Qe+Re(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return Sr(n.props,/grid-\w+-start/)})?e:Qe+Re(Re(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,Ue+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(rr(e)-1-t>6)switch(bt(e,t+1)){case 109:if(bt(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+Ue+"$2-$3$1"+Fa+(bt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Zi(e,"stretch",0)?ph(Re(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return Re(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,a,i,s,o,u,l){return Qe+a+":"+i+l+(s?Qe+a+"-span:"+(o?u:+u-+i)+l:"")+e});case 4949:if(bt(e,t+6)===121)return Re(e,":",":"+Ue)+e;break;case 6444:switch(bt(e,bt(e,14)===45?18:11)){case 120:return Re(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ue+(bt(e,14)===45?"inline-":"")+"box$3$1"+Ue+"$2$3$1"+Qe+"$2box$3")+e;case 100:return Re(e,":",":"+Qe)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Re(e,"scroll-","scroll-snap-")+e}return e}function ms(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function G6(e,t,r,n){switch(e.type){case M6:if(e.children.length)break;case D6:case L6:case Vu:return e.return=e.return||e.value;case lh:return"";case ch:return e.return=e.value+"{"+ms(e.children,n)+"}";case Bs:if(!rr(e.value=e.props.join(",")))return""}return rr(r=ms(e.children,n))?e.return=e.value+"{"+r+"}":""}function X6(e){var t=hh(e);return function(r,n,a,i){for(var s="",o=0;o<t;o++)s+=e[o](r,n,a,i)||"";return s}}function K6(e){return function(t){t.root||(t=t.return)&&e(t)}}function Q6(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Vu:e.return=ph(e.value,e.length,r);return;case ch:return ms([$r(e,{value:Re(e.value,"@","@"+Ue)})],n);case Bs:if(e.length)return F6(r=e.props,function(a){switch(Sr(a,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zn($r(e,{props:[Re(a,/:(read-\w+)/,":"+Fa+"$1")]})),zn($r(e,{props:[a]})),Lo(e,{props:Ac(r,n)});break;case"::placeholder":zn($r(e,{props:[Re(a,/:(plac\w+)/,":"+Ue+"input-$1")]})),zn($r(e,{props:[Re(a,/:(plac\w+)/,":"+Fa+"$1")]})),zn($r(e,{props:[Re(a,/:(plac\w+)/,Qe+"input-$1")]})),zn($r(e,{props:[a]})),Lo(e,{props:Ac(r,n)});break}return""})}}var D0,L0;const Kn=typeof process!="undefined"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",gh="active",bh="data-styled-version",js="6.4.1",Xu=`/*!sc*/
|
|
10
|
+
`);h=T.pop()||"";for(const A of T){const k=A.trim();if(k.startsWith("data:"))try{const F=k.slice(5).trim();if(F){const B=JSON.parse(F);if(B.content){const O=typeof B.content=="string"?JSON.parse(B.content):B.content;O.uploadUrl&&(f=O)}}}catch(F){console.debug("解析SSE行失败:",A,F)}}}if(h.trim().startsWith("data:"))try{const y=h.trim().slice(5).trim();if(y){const E=JSON.parse(y);if(E.content){const T=typeof E.content=="string"?JSON.parse(E.content):E.content;T.uploadUrl&&(f=T)}}}catch(y){console.debug("解析SSE剩余数据失败:",h,y)}if(!(f!=null&&f.uploadUrl))throw console.error("获取上传URL失败,uploadInfo:",f),new Error("获取上传URL失败");const b=new Blob([t],{type:t.type||"application/octet-stream"});if(yield N6(b,f.uploadUrl),!f.downloadUrl)throw console.error("downloadUrl为空,uploadInfo:",f),new Error("获取下载URL失败");return f.downloadUrl}catch(o){throw console.error("上传文件失败:",o),o}})}clear(){this.sessionId="",this.cancel()}cancel(){this.currentController&&(this.currentController.abort(),this.currentController=null)}getConfig(){return this.config}getSessionId(){return this.sessionId}getModelCapabilities(t){var a,i,s,o;if(!this.config)return{image:!1,file:!1,audio:!1,webSearch:!1};const r=t?this.config.models.find(u=>u.id===t):this.config.models[0];if(!r)return{image:!1,file:!1,audio:!1,webSearch:!1};let n;if((a=r.config)!=null&&a.fileConfig)try{n=JSON.parse(r.config.fileConfig)}catch(u){}return{image:!!(this.config.features.image&&((i=r.config)!=null&&i.image)),file:!!(this.config.features.file&&((s=r.config)!=null&&s.file)),audio:!!this.config.features.audio,webSearch:!!((o=r.config)!=null&&o.webSearch),fileConfig:n}}hasCapability(t,r){return this.getModelCapabilities(r)[t]}setSessionId(t){this.sessionId=t}getHistory(t){return Fe(this,null,function*(){var i,s;if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const r=((i=this.setupConfig)==null?void 0:i.domain)||"",n=((s=this.config)==null?void 0:s.integrateId)||"",a=t||this.sessionId;try{const{token:o,ticket:u}=yield this.getRequestToken(),c=yield(yield fetch(`${r}/webhook/chatbot/integrate/${n}/message`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":o,"X-Account-Session-Ticket":u},body:a?JSON.stringify({sessionId:a}):void 0})).json();if((c==null?void 0:c.httpStatusCode)===200&&(c!=null&&c.data)){const f=[],p=c.data;if(Array.isArray(p))for(const h of p){if(h.assistant&&Array.isArray(h.assistant)&&h.assistant.length>0){const b=h.assistant[0];f.push({id:b.messageId||`assistant_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,role:"assistant",content:b.content||"",messageType:b.messageType||"text",gmtCreate:h.gmtCreate,sessionId:b.sessionId||h.sessionId})}if(h.message!==void 0&&h.message!==null){const b=h.messageType||"text";let y="",E,T;if(b==="rich"&&Array.isArray(h.message)){const k=[],F=[],B=[];for(const O of h.message)O.type==="text"&&O.content?k.push(O.content):O.type==="image"&&O.mediaUrl?F.push(O.mediaUrl):O.type==="file"&&O.mediaUrl&&B.push({name:O.mediaName||"文件",url:O.mediaUrl});y=k.join(`
|
|
11
|
+
`),F.length>0&&(E=F),B.length>0&&(T=B)}else typeof h.message=="string"&&(y=h.message);const A=b==="audio";f.push({id:h.id||`user_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,role:"user",content:A?"":y,messageType:b,gmtCreate:h.gmtCreate,sessionId:h.sessionId,images:E,files:T,audio:A?y:void 0})}}return f.reverse()}return[]}catch(o){throw console.error("获取历史记录失败:",o),o}})}getSessions(){return Fe(this,null,function*(){var n,a;if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const t=((n=this.setupConfig)==null?void 0:n.domain)||"",r=((a=this.config)==null?void 0:a.integrateId)||"";try{const{token:i,ticket:s}=yield this.getRequestToken(),u=yield(yield fetch(`${t}/webhook/chatbot/integrate/${r}/message`,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":i,"X-Account-Session-Ticket":s}})).json();return(u==null?void 0:u.httpStatusCode)===200&&(u!=null&&u.data)?(u.data||[]).map(c=>({id:c.id,sessionId:c.sessionId,title:c.title||"未命名会话",gmtCreate:c.gmtCreate,gmtModified:c.gmtModified})):[]}catch(i){throw console.error("获取会话列表失败:",i),i}})}sendEventCallback(t){return Fe(this,null,function*(){if(!this.isInitialized)throw new Error("请先调用 setup() 初始化SDK");const{sessionWebhook:r,content:n}=t;if(!r)throw new Error("sessionWebhook 不能为空");try{const{token:a,ticket:i}=yield this.getRequestToken(),s=yield fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Request-Token":a,"X-Account-Session-Ticket":i},body:JSON.stringify(n)});if(!s.ok){const o=yield s.text();throw new Error(`发送事件回调失败: ${s.status} ${o}`)}}catch(a){throw console.error("发送事件回调失败:",a),a}})}submitHumanVerify(t){return Fe(this,null,function*(){const{verifyId:r,sessionWebhook:n,status:a,customParams:i,customParamsKey:s="customParams"}=t;if(!r)throw new Error("verifyId 不能为空");const o={verifyId:r,status:a};return i&&(o[s]=i),this.sendEventCallback({sessionWebhook:n,content:o})})}}const R6=new uh;var Qe="-ms-",Fa="-moz-",Ue="-webkit-",lh="comm",Bs="rule",Vu="decl",D6="@import",L6="@namespace",ch="@keyframes",M6="@layer",fh=Math.abs,Gu=String.fromCharCode,Lo=Object.assign;function P6(e,t){return bt(e,0)^45?(((t<<2^bt(e,0))<<2^bt(e,1))<<2^bt(e,2))<<2^bt(e,3):0}function dh(e){return e.trim()}function Sr(e,t){return(e=t.exec(e))?e[0]:e}function Re(e,t,r){return e.replace(t,r)}function Zi(e,t,r){return e.indexOf(t,r)}function bt(e,t){return e.charCodeAt(t)|0}function kn(e,t,r){return e.slice(t,r)}function rr(e){return e.length}function hh(e){return e.length}function Oa(e,t){return t.push(e),e}function F6(e,t){return e.map(t).join("")}function Ac(e,t){return e.filter(function(r){return!Sr(r,t)})}var zs=1,Xn=1,mh=0,Jt=0,ft=0,ua="";function Hs(e,t,r,n,a,i,s,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:zs,column:Xn,length:s,return:"",siblings:o}}function $r(e,t){return Lo(Hs("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function zn(e){for(;e.root;)e=$r(e.root,{children:[e]});Oa(e,e.siblings)}function B6(){return ft}function z6(){return ft=Jt>0?bt(ua,--Jt):0,Xn--,ft===10&&(Xn=1,zs--),ft}function ar(){return ft=Jt<mh?bt(ua,Jt++):0,Xn++,ft===10&&(Xn=1,zs++),ft}function Vr(){return bt(ua,Jt)}function es(){return Jt}function Us(e,t){return kn(ua,e,t)}function Ka(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function H6(e){return zs=Xn=1,mh=rr(ua=e),Jt=0,[]}function U6(e){return ua="",e}function R0(e){return dh(Us(Jt-1,Mo(e===91?e+2:e===40?e+1:e)))}function j6(e){for(;(ft=Vr())&&ft<33;)ar();return Ka(e)>2||Ka(ft)>3?"":" "}function $6(e,t){for(;--t&&ar()&&!(ft<48||ft>102||ft>57&&ft<65||ft>70&&ft<97););return Us(e,es()+(t<6&&Vr()==32&&ar()==32))}function Mo(e){for(;ar();)switch(ft){case e:return Jt;case 34:case 39:e!==34&&e!==39&&Mo(ft);break;case 40:e===41&&Mo(e);break;case 92:ar();break}return Jt}function q6(e,t){for(;ar()&&e+ft!==57;)if(e+ft===84&&Vr()===47)break;return"/*"+Us(t,Jt-1)+"*"+Gu(e===47?e:ar())}function Y6(e){for(;!Ka(Vr());)ar();return Us(e,Jt)}function W6(e){return U6(ts("",null,null,null,[""],e=H6(e),0,[0],e))}function ts(e,t,r,n,a,i,s,o,u){for(var l=0,c=0,f=s,p=0,h=0,b=0,y=1,E=1,T=1,A=0,k="",F=a,B=i,O=n,M=k;E;)switch(b=A,A=ar()){case 40:if(b!=108&&bt(M,f-1)==58){Zi(M+=Re(R0(A),"&","&\f"),"&\f",fh(l?o[l-1]:0))!=-1&&(T=-1);break}case 34:case 39:case 91:M+=R0(A);break;case 9:case 10:case 13:case 32:M+=j6(b);break;case 92:M+=$6(es()-1,7);continue;case 47:switch(Vr()){case 42:case 47:Oa(V6(q6(ar(),es()),t,r,u),u),(Ka(b||1)==5||Ka(Vr()||1)==5)&&rr(M)&&kn(M,-1,void 0)!==" "&&(M+=" ");break;default:M+="/"}break;case 123*y:o[l++]=rr(M)*T;case 125*y:case 59:case 0:switch(A){case 0:case 125:E=0;case 59+c:T==-1&&(M=Re(M,/\f/g,"")),h>0&&(rr(M)-f||y===0&&b===47)&&Oa(h>32?kc(M+";",n,r,f-1,u):kc(Re(M," ","")+";",n,r,f-2,u),u);break;case 59:M+=";";default:if(Oa(O=Sc(M,t,r,l,c,a,o,k,F=[],B=[],f,i),i),A===123)if(c===0)ts(M,t,O,O,F,i,f,o,B);else{switch(p){case 99:if(bt(M,3)===110)break;case 108:if(bt(M,2)===97)break;default:c=0;case 100:case 109:case 115:}c?ts(e,O,O,n&&Oa(Sc(e,O,O,0,0,a,o,k,a,F=[],f,B),B),a,B,f,o,n?F:B):ts(M,O,O,O,[""],B,0,o,B)}}l=c=h=0,y=T=1,k=M="",f=s;break;case 58:f=1+rr(M),h=b;default:if(y<1){if(A==123)--y;else if(A==125&&y++==0&&z6()==125)continue}switch(M+=Gu(A),A*y){case 38:T=c>0?1:(M+="\f",-1);break;case 44:o[l++]=(rr(M)-1)*T,T=1;break;case 64:Vr()===45&&(M+=R0(ar())),p=Vr(),c=f=rr(k=M+=Y6(es())),A++;break;case 45:b===45&&rr(M)==2&&(y=0)}}return i}function Sc(e,t,r,n,a,i,s,o,u,l,c,f){for(var p=a-1,h=a===0?i:[""],b=hh(h),y=0,E=0,T=0;y<n;++y)for(var A=0,k=kn(e,p+1,p=fh(E=s[y])),F=e;A<b;++A)(F=dh(E>0?h[A]+" "+k:Re(k,/&\f/g,h[A])))&&(u[T++]=F);return Hs(e,t,r,a===0?Bs:o,u,l,c,f)}function V6(e,t,r,n){return Hs(e,t,r,lh,Gu(B6()),kn(e,2,-2),0,n)}function kc(e,t,r,n,a){return Hs(e,t,r,Vu,kn(e,0,n),kn(e,n+1,-1),n,a)}function ph(e,t,r){switch(P6(e,t)){case 5103:return Ue+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return Ue+e+e;case 4855:return Ue+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Fa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ue+e+Fa+e+Qe+e+e;case 5936:switch(bt(e,t+11)){case 114:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ue+e+Qe+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ue+e+Qe+e+e;case 6165:return Ue+e+Qe+"flex-"+e+e;case 5187:return Ue+e+Re(e,/(\w+).+(:[^]+)/,Ue+"box-$1$2"+Qe+"flex-$1$2")+e;case 5443:return Ue+e+Qe+"flex-item-"+Re(e,/flex-|-self/g,"")+(Sr(e,/flex-|baseline/)?"":Qe+"grid-row-"+Re(e,/flex-|-self/g,""))+e;case 4675:return Ue+e+Qe+"flex-line-pack"+Re(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ue+e+Qe+Re(e,"shrink","negative")+e;case 5292:return Ue+e+Qe+Re(e,"basis","preferred-size")+e;case 6060:return Ue+"box-"+Re(e,"-grow","")+Ue+e+Qe+Re(e,"grow","positive")+e;case 4554:return Ue+Re(e,/([^-])(transform)/g,"$1"+Ue+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,Ue+"$1"),/(image-set)/,Ue+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,Ue+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,Ue+"box-pack:$3"+Qe+"flex-pack:$3"),/space-between/,"justify")+Ue+e+e;case 4200:if(!Sr(e,/flex-|baseline/))return Qe+"grid-column-align"+kn(e,t)+e;break;case 2592:case 3360:return Qe+Re(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,a){return t=a,Sr(n.props,/grid-\w+-end/)})?~Zi(e+(r=r[t].value),"span",0)?e:Qe+Re(e,"-start","")+e+Qe+"grid-row-span:"+(~Zi(r,"span",0)?Sr(r,/\d+/):+Sr(r,/\d+/)-+Sr(e,/\d+/))+";":Qe+Re(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return Sr(n.props,/grid-\w+-start/)})?e:Qe+Re(Re(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,Ue+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(rr(e)-1-t>6)switch(bt(e,t+1)){case 109:if(bt(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+Ue+"$2-$3$1"+Fa+(bt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Zi(e,"stretch",0)?ph(Re(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return Re(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,a,i,s,o,u,l){return Qe+a+":"+i+l+(s?Qe+a+"-span:"+(o?u:+u-+i)+l:"")+e});case 4949:if(bt(e,t+6)===121)return Re(e,":",":"+Ue)+e;break;case 6444:switch(bt(e,bt(e,14)===45?18:11)){case 120:return Re(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ue+(bt(e,14)===45?"inline-":"")+"box$3$1"+Ue+"$2$3$1"+Qe+"$2box$3")+e;case 100:return Re(e,":",":"+Qe)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Re(e,"scroll-","scroll-snap-")+e}return e}function ms(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function G6(e,t,r,n){switch(e.type){case M6:if(e.children.length)break;case D6:case L6:case Vu:return e.return=e.return||e.value;case lh:return"";case ch:return e.return=e.value+"{"+ms(e.children,n)+"}";case Bs:if(!rr(e.value=e.props.join(",")))return""}return rr(r=ms(e.children,n))?e.return=e.value+"{"+r+"}":""}function X6(e){var t=hh(e);return function(r,n,a,i){for(var s="",o=0;o<t;o++)s+=e[o](r,n,a,i)||"";return s}}function K6(e){return function(t){t.root||(t=t.return)&&e(t)}}function Q6(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Vu:e.return=ph(e.value,e.length,r);return;case ch:return ms([$r(e,{value:Re(e.value,"@","@"+Ue)})],n);case Bs:if(e.length)return F6(r=e.props,function(a){switch(Sr(a,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zn($r(e,{props:[Re(a,/:(read-\w+)/,":"+Fa+"$1")]})),zn($r(e,{props:[a]})),Lo(e,{props:Ac(r,n)});break;case"::placeholder":zn($r(e,{props:[Re(a,/:(plac\w+)/,":"+Ue+"input-$1")]})),zn($r(e,{props:[Re(a,/:(plac\w+)/,":"+Fa+"$1")]})),zn($r(e,{props:[Re(a,/:(plac\w+)/,Qe+"input-$1")]})),zn($r(e,{props:[a]})),Lo(e,{props:Ac(r,n)});break}return""})}}var D0,L0;const Kn=typeof process!="undefined"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",gh="active",bh="data-styled-version",js="6.4.1",Xu=`/*!sc*/
|
|
12
12
|
`,Ba=typeof window!="undefined"&&typeof document!="undefined";function Cc(e){if(typeof process!="undefined"&&process.env!==void 0){const t=process.env[e];if(t!==void 0&&t!=="")return t!=="false"}}const J6=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:(L0=(D0=Cc("REACT_APP_SC_DISABLE_SPEEDY"))!==null&&D0!==void 0?D0:Cc("SC_DISABLE_SPEEDY"))!==null&&L0!==void 0?L0:typeof process=="undefined"||process.env===void 0),yh="sc-keyframes-";function hi(e,...t){return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`)}let rs=new Map,ps=new Map,ns=1;const Ra=e=>{if(rs.has(e))return rs.get(e);for(;ps.has(ns);)ns++;const t=ns++;return rs.set(e,t),ps.set(t,e),t},Z6=e=>ps.get(e),e5=(e,t)=>{ns=t+1,rs.set(e,t),ps.set(t,e)},Ku=Object.freeze([]),Qn=Object.freeze({});function t5(e,t,r=Qn){return e.theme!==r.theme&&e.theme||t||r.theme}const r5=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,n5=/(^-|-$)/g;function xh(e){return e.replace(r5,"-").replace(n5,"")}const a5=/(a)(d)/gi,Ic=e=>String.fromCharCode(e+(e>25?39:97));function Qu(e){let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Ic(t%52)+r;return(Ic(t%52)+r).replace(a5,"$1-$2")}const Po=5381,vn=(e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e},Eh=e=>vn(Po,e);function Th(e){return Qu(Eh(e)>>>0)}function i5(e){return e.displayName||e.name||"Component"}function Fo(e){return typeof e=="string"&&!0}function s5(e){return Fo(e)?`styled.${e}`:`Styled(${i5(e)})`}const vh=Symbol.for("react.memo"),o5=Symbol.for("react.forward_ref"),u5={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},l5={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wh={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c5={[o5]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[vh]:wh};function _c(e){return("type"in(t=e)&&t.type.$$typeof)===vh?wh:"$$typeof"in e?c5[e.$$typeof]:u5;var t}const f5=Object.defineProperty,d5=Object.getOwnPropertyNames,h5=Object.getOwnPropertySymbols,m5=Object.getOwnPropertyDescriptor,p5=Object.getPrototypeOf,g5=Object.prototype;function Ah(e,t,r){if(typeof t!="string"){const n=p5(t);n&&n!==g5&&Ah(e,n,r);const a=d5(t).concat(h5(t)),i=_c(e),s=_c(t);for(let o=0;o<a.length;++o){const u=a[o];if(!(u in l5||r&&r[u]||s&&u in s||i&&u in i)){const l=m5(t,u);try{f5(e,u,l)}catch(c){}}}}return e}function $s(e){return typeof e=="function"}function Sh(e){return typeof e=="object"&&"styledComponentId"in e}function Da(e,t){return e&&t?e+" "+t:e||t||""}function Bo(e,t){return e.join("")}function Qa(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function zo(e,t,r=!1){if(!r&&!Qa(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let n=0;n<t.length;n++)e[n]=zo(e[n],t[n]);else if(Qa(t))for(const n in t)e[n]=zo(e[n],t[n]);return e}function Ju(e,t){Object.defineProperty(e,"toString",{value:t})}const b5=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let r=this._cGroup;r<e;r++)t+=this.groupSizes[r];else for(let r=this._cGroup-1;r>=e;r--)t-=this.groupSizes[r];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const a=this.groupSizes,i=a.length;let s=i;for(;e>=s;)if(s<<=1,s<0)throw hi(16,`${e}`);this.groupSizes=new Uint32Array(s),this.groupSizes.set(a),this.length=s;for(let o=i;o<s;o++)this.groupSizes[o]=0}let r=this.indexOfGroup(e+1),n=0;for(let a=0,i=t.length;a<i;a++)this.tag.insertRule(r,t[a])&&(this.groupSizes[e]++,r++,n++);n>0&&this._cGroup>e&&(this._cIndex+=n)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(let a=r;a<n;a++)this.tag.deleteRule(r);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||this.groupSizes[e]===0)return t;const r=this.groupSizes[e],n=this.indexOfGroup(e),a=n+r;for(let i=n;i<a;i++)t+=this.tag.getRule(i)+Xu;return t}},y5=`style[${Kn}][${bh}="${js}"]`,x5=new RegExp(`^${Kn}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),Nc=e=>typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot||"host"in e&&e.nodeType===11,Ho=e=>{if(!e)return document;if(Nc(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(Nc(t))return t}return document},E5=(e,t,r)=>{const n=r.split(",");let a;for(let i=0,s=n.length;i<s;i++)(a=n[i])&&e.registerName(t,a)},T5=(e,t)=>{var r;const n=((r=t.textContent)!==null&&r!==void 0?r:"").split(Xu),a=[];for(let i=0,s=n.length;i<s;i++){const o=n[i].trim();if(!o)continue;const u=o.match(x5);if(u){const l=0|parseInt(u[1],10),c=u[2];l!==0&&(e5(c,l),E5(e,c,u[3]),e.getTag().insertRules(l,a)),a.length=0}else a.push(o)}},M0=e=>{const t=Ho(e.options.target).querySelectorAll(y5);for(let r=0,n=t.length;r<n;r++){const a=t[r];a&&a.getAttribute(Kn)!==gh&&(T5(e,a),a.parentNode&&a.parentNode.removeChild(a))}};let Sa=!1;function v5(){if(Sa!==!1)return Sa;if(typeof document!="undefined"){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return Sa=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return Sa=t.getAttribute("content")||void 0}return Sa=typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0}const kh=(e,t)=>{const r=document.head,n=e||r,a=document.createElement("style"),i=(u=>{const l=Array.from(u.querySelectorAll(`style[${Kn}]`));return l[l.length-1]})(n),s=i!==void 0?i.nextSibling:null;a.setAttribute(Kn,gh),a.setAttribute(bh,js);const o=t||v5();return o&&a.setAttribute("nonce",o),n.insertBefore(a,s),a},w5=class{constructor(e,t){this.element=kh(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(r=>{var n;if(r.sheet)return r.sheet;const a=(n=r.getRootNode().styleSheets)!==null&&n!==void 0?n:document.styleSheets;for(let i=0,s=a.length;i<s;i++){const o=a[i];if(o.ownerNode===r)return o}throw hi(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(r){return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}},A5=class{constructor(e,t){this.element=kh(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}};let Oc=Ba;const S5={isServer:!Ba,useCSSOMInjection:!J6};class qs{static registerId(t){return Ra(t)}constructor(t=Qn,r={},n){this.options=Object.assign(Object.assign({},S5),t),this.gs=r,this.keyframeIds=new Set,this.names=new Map(n),this.server=!!t.isServer,!this.server&&Ba&&Oc&&(Oc=!1,M0(this)),Ju(this,()=>(a=>{const i=a.getTag(),{length:s}=i;let o="";for(let u=0;u<s;u++){const l=Z6(u);if(l===void 0)continue;const c=a.names.get(l);if(c===void 0||!c.size)continue;const f=i.getGroup(u);if(f.length===0)continue;const p=Kn+".g"+u+'[id="'+l+'"]';let h="";for(const b of c)b.length>0&&(h+=b+",");o+=f+p+'{content:"'+h+'"}'+Xu}return o})(this))}rehydrate(){!this.server&&Ba&&M0(this)}reconstructWithOptions(t,r=!0){const n=new qs(Object.assign(Object.assign({},this.options),t),this.gs,r&&this.names||void 0);return n.keyframeIds=new Set(this.keyframeIds),!this.server&&Ba&&t.target!==this.options.target&&Ho(this.options.target)!==Ho(t.target)&&M0(n),n}allocateGSInstance(t){return this.gs[t]=(this.gs[t]||0)+1}getTag(){return this.tag||(this.tag=(t=(({useCSSOMInjection:r,target:n,nonce:a})=>r?new w5(n,a):new A5(n,a))(this.options),new b5(t)));var t}hasNameForId(t,r){var n,a;return(a=(n=this.names.get(t))===null||n===void 0?void 0:n.has(r))!==null&&a!==void 0&&a}registerName(t,r){Ra(t),t.startsWith(yh)&&this.keyframeIds.add(t);const n=this.names.get(t);n?n.add(r):this.names.set(t,new Set([r]))}insertRules(t,r,n){this.registerName(t,r),this.getTag().insertRules(Ra(t),n)}clearNames(t){this.names.has(t)&&this.names.get(t).clear()}clearRules(t){this.getTag().clearGroup(Ra(t)),this.clearNames(t)}clearTag(){this.tag=void 0}}const Ch=new WeakSet,k5={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function C5(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in k5||e.startsWith("--")?String(t).trim():t+"px"}const bn=47;function Rc(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t+=n>=65&&n<=90?"-"+String.fromCharCode(n+32):e[r]}return t.startsWith("ms-")?"-"+t:t}const Ih=Symbol.for("sc-keyframes");function I5(e){return typeof e=="object"&&e!==null&&Ih in e}function _h(e){return $s(e)&&!(e.prototype&&e.prototype.isReactComponent)}const Nh=e=>e==null||e===!1||e==="",_5=Symbol.for("react.client.reference");function Dc(e){return e.$$typeof===_5}function Oh(e,t){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&!Nh(n)&&(Array.isArray(n)&&Ch.has(n)||$s(n)?t.push(Rc(r)+":",n,";"):Qa(n)?(t.push(r+" {"),Oh(n,t),t.push("}")):t.push(Rc(r)+": "+C5(r,n)+";"))}}function wn(e,t,r,n,a=[]){if(Nh(e))return a;const i=typeof e;if(i==="string")return a.push(e),a;if(i==="function"){if(Dc(e))return a;if(_h(e)&&t){const s=e(t);return wn(s,t,r,n,a)}return a.push(e),a}if(Array.isArray(e)){for(let s=0;s<e.length;s++)wn(e[s],t,r,n,a);return a}return Sh(e)?(a.push(`.${e.styledComponentId}`),a):I5(e)?(r?(e.inject(r,n),a.push(e.getName(n))):a.push(e),a):Dc(e)?a:Qa(e)?(Oh(e,a),a):(a.push(e.toString()),a)}const N5=Eh(js);class O5{constructor(t,r,n){this.rules=t,this.componentId=r,this.baseHash=vn(N5,r),this.baseStyle=n,qs.registerId(r)}generateAndInjectStyles(t,r,n){let a=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";{let i="";for(let s=0;s<this.rules.length;s++){const o=this.rules[s];if(typeof o=="string")i+=o;else if(o)if(_h(o)){const u=o(t);typeof u=="string"?i+=u:u!=null&&u!==!1&&(i+=Bo(wn(u,t,r,n)))}else i+=Bo(wn(o,t,r,n))}if(i){this.dynamicNameCache||(this.dynamicNameCache=new Map);const s=n.hash?n.hash+i:i;let o=this.dynamicNameCache.get(s);if(!o){if(o=Qu(vn(vn(this.baseHash,n.hash),i)>>>0),this.dynamicNameCache.size>=200){const u=this.dynamicNameCache.keys().next().value;u!==void 0&&this.dynamicNameCache.delete(u)}this.dynamicNameCache.set(s,o)}if(!r.hasNameForId(this.componentId,o)){const u=n(i,"."+o,void 0,this.componentId);r.insertRules(this.componentId,o,u)}a=Da(a,o)}}return a}}const R5=/&/g;function Rh(e,t){let r=0;for(;--t>=0&&e.charCodeAt(t)===92;)r++;return!(1&~r)}function P0(e){const t=e.length;let r="",n=0,a=0,i=0,s=!1,o=!1;for(let u=0;u<t;u++){const l=e.charCodeAt(u);if(i!==0||s||l!==bn||e.charCodeAt(u+1)!==42)if(s)l===42&&e.charCodeAt(u+1)===bn&&(s=!1,u++);else if(l!==34&&l!==39||Rh(e,u)){if(i===0)if(l===123)a++;else if(l===125){if(a--,a<0){o=!0;let c=u+1;for(;c<t;){const f=e.charCodeAt(c);if(f===59||f===10)break;c++}c<t&&e.charCodeAt(c)===59&&c++,a=0,u=c-1,n=c;continue}a===0&&(r+=e.substring(n,u+1),n=u+1)}else l===59&&a===0&&(r+=e.substring(n,u+1),n=u+1)}else i===0?i=l:i===l&&(i=0);else s=!0,u++}return o||a!==0||i!==0?(n<t&&a===0&&i===0&&(r+=e.substring(n)),r):e}function Dh(e,t){const r=t+" ",n=","+r;for(let a=0;a<e.length;a++){const i=e[a];if(i.type==="rule"){i.value=(r+i.value).replaceAll(",",n);const s=i.props,o=[];for(let u=0;u<s.length;u++)o[u]=r+s[u];i.props=o}Array.isArray(i.children)&&i.type!=="@keyframes"&&Dh(i.children,t)}return e}function D5({options:e=Qn,plugins:t=Ku}=Qn){let r,n,a;const i=(p,h,b)=>b.startsWith(n)&&b.endsWith(n)&&b.replaceAll(n,"").length>0?`.${r}`:p,s=t.slice();s.push(p=>{p.type===Bs&&p.value.includes("&")&&(a||(a=new RegExp(`\\${n}\\b`,"g")),p.props[0]=p.props[0].replace(R5,n).replace(a,i))}),e.prefix&&s.push(Q6),s.push(G6);let o=[];const u=X6(s.concat(K6(p=>o.push(p)))),l=(p,h="",b="",y="&")=>{r=y,n=h,a=void 0;const E=function(A){const k=A.indexOf("//")!==-1,F=A.indexOf("}")!==-1;if(!k&&!F)return A;if(!k)return P0(A);const B=A.length;let O="",M=0,z=0,U=0,L=0,$=0,te=!1;for(;z<B;){const ge=A.charCodeAt(z);if(ge!==34&&ge!==39||Rh(A,z))if(U===0)if(ge===bn&&z+1<B&&A.charCodeAt(z+1)===42){for(z+=2;z+1<B&&(A.charCodeAt(z)!==42||A.charCodeAt(z+1)!==bn);)z++;z+=2}else if(ge!==40)if(ge!==41)if(L>0)z++;else if(ge===42&&z+1<B&&A.charCodeAt(z+1)===bn)O+=A.substring(M,z),z+=2,M=z,te=!0;else if(ge===bn&&z+1<B&&A.charCodeAt(z+1)===bn){for(O+=A.substring(M,z);z<B&&A.charCodeAt(z)!==10;)z++;M=z,te=!0}else ge===123?$++:ge===125&&$--,z++;else L>0&&L--,z++;else L++,z++;else z++;else U===0?U=ge:U===ge&&(U=0),z++}return te?(M<B&&(O+=A.substring(M)),$===0?O:P0(O)):$===0?A:P0(A)}(p);let T=W6(b||h?b+" "+h+" { "+E+" }":E);return e.namespace&&(T=Dh(T,e.namespace)),o=[],ms(T,u),o},c=e;let f=Po;for(let p=0;p<t.length;p++)t[p].name||hi(15),f=vn(f,t[p].name);return c!=null&&c.namespace&&(f=vn(f,c.namespace)),c!=null&&c.prefix&&(f=vn(f,"p")),l.hash=f!==Po?f.toString():"",l}const L5=new qs,Uo=D5(),Lh=G.createContext({shouldForwardProp:void 0,styleSheet:L5,stylis:Uo,stylisPlugins:void 0});Lh.Consumer;function M5(){return G.useContext(Lh)}const Mh=G.createContext(void 0);Mh.Consumer;const Lc=Object.prototype.hasOwnProperty,F0={};function P5(e,t){const r=typeof e!="string"?"sc":xh(e);F0[r]=(F0[r]||0)+1;const n=r+"-"+Th(js+r+F0[r]);return t?t+"-"+n:n}function F5(e,t,r){const n=Sh(e),a=e,i=!Fo(e),{attrs:s=Ku,componentId:o=P5(t.displayName,t.parentComponentId),displayName:u=s5(e)}=t,l=t.displayName&&t.componentId?xh(t.displayName)+"-"+t.componentId:t.componentId||o,c=n&&a.attrs?a.attrs.concat(s).filter(Boolean):s;let{shouldForwardProp:f}=t;if(n&&a.shouldForwardProp){const y=a.shouldForwardProp;if(t.shouldForwardProp){const E=t.shouldForwardProp;f=(T,A)=>y(T,A)&&E(T,A)}else f=y}const p=new O5(r,l,n?a.componentStyle:void 0);function h(y,E){return function(T,A,k){const{attrs:F,componentStyle:B,defaultProps:O,foldedComponentIds:M,styledComponentId:z,target:U}=T,L=G.useContext(Mh),$=M5(),te=T.shouldForwardProp||$.shouldForwardProp,ge=t5(A,L,O)||Qn;let X,W;{const he=G.useRef(null),C=he.current;if(C!==null&&C[1]===ge&&C[2]===$.styleSheet&&C[3]===$.stylis&&C[7]===B&&function(K,Q,I){const me=K,ve=Q;let Ce=0;for(const He in ve)if(Lc.call(ve,He)&&(Ce++,me[He]!==ve[He]))return!1;return Ce===I}(C[0],A,C[4]))X=C[5],W=C[6];else{X=function(Q,I,me){const ve=Object.assign(Object.assign({},I),{className:void 0,theme:me}),Ce=Q.length>1;for(let He=0;He<Q.length;He++){const Ze=Q[He],qe=$s(Ze)?Ze(Ce?Object.assign({},ve):ve):Ze;for(const Be in qe)Be==="className"?ve.className=Da(ve.className,qe[Be]):Be==="style"?ve.style=Object.assign(Object.assign({},ve.style),qe[Be]):Be in I&&I[Be]===void 0||(ve[Be]=qe[Be])}return"className"in I&&typeof I.className=="string"&&(ve.className=Da(ve.className,I.className)),ve}(F,A,ge),W=function(Q,I,me,ve){return Q.generateAndInjectStyles(I,me,ve)}(B,X,$.styleSheet,$.stylis);let K=0;for(const Q in A)Lc.call(A,Q)&&K++;he.current=[A,ge,$.styleSheet,$.stylis,K,X,W,B]}}const V=X.as||U,ie=function(he,C,K,Q){const I={};for(const me in he)he[me]===void 0||me[0]==="$"||me==="as"||me==="theme"&&he.theme===K||(me==="forwardedAs"?I.as=he.forwardedAs:Q&&!Q(me,C)||(I[me]=he[me]));return I}(X,V,ge,te);let J=Da(M,z);return W&&(J+=" "+W),X.className&&(J+=" "+X.className),ie[Fo(V)&&V.includes("-")?"class":"className"]=J,k&&(ie.ref=k),G.createElement(V,ie)}(b,y,E)}h.displayName=u;let b=G.forwardRef(h);return b.attrs=c,b.componentStyle=p,b.displayName=u,b.shouldForwardProp=f,b.foldedComponentIds=n?Da(a.foldedComponentIds,a.styledComponentId):"",b.styledComponentId=l,b.target=n?a.target:e,Object.defineProperty(b,"defaultProps",{get(){return this._foldedDefaultProps},set(y){this._foldedDefaultProps=n?function(E,...T){for(const A of T)zo(E,A,!0);return E}({},a.defaultProps,y):y}}),Ju(b,()=>`.${b.styledComponentId}`),i&&Ah(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}var B5=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function Mc(e,t){const r=[e[0]];for(let n=0,a=t.length;n<a;n+=1)r.push(t[n],e[n+1]);return r}const Pc=e=>(Ch.add(e),e);function gs(e,...t){if($s(e)||Qa(e))return Pc(wn(Mc(Ku,[e,...t])));const r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?wn(r):Pc(wn(Mc(r,t)))}function jo(e,t,r=Qn){if(!t)throw hi(1,t);const n=(a,...i)=>e(t,r,gs(a,...i));return n.attrs=a=>jo(e,t,Object.assign(Object.assign({},r),{attrs:Array.prototype.concat(r.attrs,a).filter(Boolean)})),n.withConfig=a=>jo(e,t,Object.assign(Object.assign({},r),a)),n}const Ph=e=>jo(F5,e),ee=Ph;B5.forEach(e=>{ee[e]=Ph(e)});var Fh;let z5=class{constructor(t,r){this[Fh]=!0,this.inject=(n,a=Uo)=>{const i=this.getName(a);if(!n.hasNameForId(this.id,i)){const s=a(this.rules,i,"@keyframes");n.insertRules(this.id,i,s)}},this.name=t,this.id=yh+t,this.rules=r,Ra(this.id),Ju(this,()=>{throw hi(12,String(this.name))})}getName(t=Uo){return t.hash?this.name+Qu(+t.hash>>>0):this.name}};function H5(e,...t){const r=Bo(gs(e,...t)),n=Th(r);return new z5(n,r)}Fh=Ih;function Fc(e){const t=[],r=String(e||"");let n=r.indexOf(","),a=0,i=!1;for(;!i;){n===-1&&(n=r.length,i=!0);const s=r.slice(a,n).trim();(s||!i)&&t.push(s),a=n+1,n=r.indexOf(",",a)}return t}function Bh(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const U5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$5={};function Bc(e,t){return($5.jsx?j5:U5).test(e)}const q5=/[ \t\n\f\r]/g;function Y5(e){return typeof e=="object"?e.type==="text"?zc(e.value):!1:zc(e)}function zc(e){return e.replace(q5,"")===""}class mi{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}mi.prototype.normal={};mi.prototype.property={};mi.prototype.space=void 0;function zh(e,t){const r={},n={};for(const a of e)Object.assign(r,a.property),Object.assign(n,a.normal);return new mi(r,n,t)}function Ja(e){return e.toLowerCase()}class zt{constructor(t,r){this.attribute=r,this.property=t}}zt.prototype.attribute="";zt.prototype.booleanish=!1;zt.prototype.boolean=!1;zt.prototype.commaOrSpaceSeparated=!1;zt.prototype.commaSeparated=!1;zt.prototype.defined=!1;zt.prototype.mustUseProperty=!1;zt.prototype.number=!1;zt.prototype.overloadedBoolean=!1;zt.prototype.property="";zt.prototype.spaceSeparated=!1;zt.prototype.space=void 0;let W5=0;const _e=On(),ct=On(),$o=On(),ce=On(),Xe=On(),Yn=On(),Ut=On();function On(){return ic(2,++W5)}const qo=Object.freeze(Object.defineProperty({__proto__:null,boolean:_e,booleanish:ct,commaOrSpaceSeparated:Ut,commaSeparated:Yn,number:ce,overloadedBoolean:$o,spaceSeparated:Xe},Symbol.toStringTag,{value:"Module"})),B0=Object.keys(qo);class Zu extends zt{constructor(t,r,n,a){let i=-1;if(super(t,r),Hc(this,"space",a),typeof n=="number")for(;++i<B0.length;){const s=B0[i];Hc(this,B0[i],(n&qo[s])===qo[s])}}}Zu.prototype.defined=!0;function Hc(e,t,r){r&&(e[t]=r)}function la(e){const t={},r={};for(const[n,a]of Object.entries(e.properties)){const i=new Zu(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[Ja(n)]=n,r[Ja(i.attribute)]=n}return new mi(t,r,e.space)}const Hh=la({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:Xe,ariaCurrent:null,ariaDescribedBy:Xe,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:Xe,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:Xe,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xe,ariaLevel:ce,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:Xe,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:Xe,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:ct,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Uh(e,t){return t in e?e[t]:t}function jh(e,t){return Uh(e,t.toLowerCase())}const V5=la({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yn,acceptCharset:Xe,accessKey:Xe,action:null,allow:null,allowFullScreen:_e,allowPaymentRequest:_e,allowUserMedia:_e,alt:null,as:null,async:_e,autoCapitalize:null,autoComplete:Xe,autoFocus:_e,autoPlay:_e,blocking:Xe,capture:null,charSet:null,checked:_e,cite:null,className:Xe,cols:ce,colSpan:null,content:null,contentEditable:ct,controls:_e,controlsList:Xe,coords:ce|Yn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_e,defer:_e,dir:null,dirName:null,disabled:_e,download:$o,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_e,formTarget:null,headers:Xe,height:ce,hidden:$o,high:ce,href:null,hrefLang:null,htmlFor:Xe,httpEquiv:Xe,id:null,imageSizes:null,imageSrcSet:null,inert:_e,inputMode:null,integrity:null,is:null,isMap:_e,itemId:null,itemProp:Xe,itemRef:Xe,itemScope:_e,itemType:Xe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_e,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:_e,muted:_e,name:null,nonce:null,noModule:_e,noValidate:_e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_e,optimum:ce,pattern:null,ping:Xe,placeholder:null,playsInline:_e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_e,referrerPolicy:null,rel:Xe,required:_e,reversed:_e,rows:ce,rowSpan:ce,sandbox:Xe,scope:null,scoped:_e,seamless:_e,selected:_e,shadowRootClonable:_e,shadowRootDelegatesFocus:_e,shadowRootMode:null,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:_e,useMap:null,value:ct,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xe,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_e,declare:_e,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:_e,noHref:_e,noShade:_e,noWrap:_e,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_e,disableRemotePlayback:_e,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:jh}),G5=la({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ut,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:Xe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:_e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Yn,g2:Yn,glyphName:Yn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Ut,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ut,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ut,rev:Ut,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ut,requiredFeatures:Ut,requiredFonts:Ut,requiredFormats:Ut,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Ut,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ut,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ut,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Uh}),$h=la({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),qh=la({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jh}),Yh=la({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},K5=/[A-Z]/g,Uc=/-[a-z]/g,Q5=/^data[-\w.:]+$/i;function Ys(e,t){const r=Ja(t);let n=t,a=zt;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Q5.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Uc,Z5);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Uc.test(i)){let s=i.replace(K5,J5);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=Zu}return new a(n,t)}function J5(e){return"-"+e.toLowerCase()}function Z5(e){return e.charAt(1).toUpperCase()}const pi=zh([Hh,V5,$h,qh,Yh],"html"),nn=zh([Hh,G5,$h,qh,Yh],"svg");function jc(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Wh(e){return e.join(" ").trim()}var Za=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var el={},$c=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,eg=/\n/g,tg=/^\s*/,rg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ng=/^:\s*/,ag=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ig=/^[;\s]*/,sg=/^\s+|\s+$/g,og=`
|
|
13
13
|
`,qc="/",Yc="*",yn="",ug="comment",lg="declaration";function cg(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function a(b){var y=b.match(eg);y&&(r+=y.length);var E=b.lastIndexOf(og);n=~E?b.length-E:n+b.length}function i(){var b={line:r,column:n};return function(y){return y.position=new s(b),l(),y}}function s(b){this.start=b,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;function o(b){var y=new Error(t.source+":"+r+":"+n+": "+b);if(y.reason=b,y.filename=t.source,y.line=r,y.column=n,y.source=e,!t.silent)throw y}function u(b){var y=b.exec(e);if(y){var E=y[0];return a(E),e=e.slice(E.length),y}}function l(){u(tg)}function c(b){var y;for(b=b||[];y=f();)y!==!1&&b.push(y);return b}function f(){var b=i();if(!(qc!=e.charAt(0)||Yc!=e.charAt(1))){for(var y=2;yn!=e.charAt(y)&&(Yc!=e.charAt(y)||qc!=e.charAt(y+1));)++y;if(y+=2,yn===e.charAt(y-1))return o("End of comment missing");var E=e.slice(2,y-2);return n+=2,a(E),e=e.slice(y),n+=2,b({type:ug,comment:E})}}function p(){var b=i(),y=u(rg);if(y){if(f(),!u(ng))return o("property missing ':'");var E=u(ag),T=b({type:lg,property:Wc(y[0].replace($c,yn)),value:E?Wc(E[0].replace($c,yn)):yn});return u(ig),T}}function h(){var b=[];c(b);for(var y;y=p();)y!==!1&&(b.push(y),c(b));return b}return l(),h()}function Wc(e){return e?e.replace(sg,yn):yn}var fg=cg,dg=Za&&Za.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(el,"__esModule",{value:!0});el.default=mg;const hg=dg(fg);function mg(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,hg.default)(e),a=typeof t=="function";return n.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:o}=i;a?t(s,o,i):o&&(r=r||{},r[s]=o)}),r}var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.camelCase=void 0;var pg=/^--[a-zA-Z0-9_-]+$/,gg=/-([a-z])/g,bg=/^[^-]+$/,yg=/^-(webkit|moz|ms|o|khtml)-/,xg=/^-(ms)-/,Eg=function(e){return!e||bg.test(e)||pg.test(e)},Tg=function(e,t){return t.toUpperCase()},Vc=function(e,t){return"".concat(t,"-")},vg=function(e,t){return t===void 0&&(t={}),Eg(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(xg,Vc):e=e.replace(yg,Vc),e.replace(gg,Tg))};Vs.camelCase=vg;var wg=Za&&Za.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ag=wg(el),Sg=Vs;function Yo(e,t){var r={};return!e||typeof e!="string"||(0,Ag.default)(e,function(n,a){n&&a&&(r[(0,Sg.camelCase)(n,t)]=a)}),r}Yo.default=Yo;var kg=Yo;const Cg=Ws(kg),Gs=Vh("end"),br=Vh("start");function Vh(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Ig(e){const t=br(e),r=Gs(e);if(t&&r)return{start:t,end:r}}function za(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gc(e.position):"start"in e||"end"in e?Gc(e):"line"in e||"column"in e?Wo(e):""}function Wo(e){return Xc(e&&e.line)+":"+Xc(e&&e.column)}function Gc(e){return Wo(e&&e.start)+"-"+Wo(e&&e.end)}function Xc(e){return e&&typeof e=="number"?e:1}class kt extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i=se({},r)),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?i.ruleId=n:(i.source=n.slice(0,u),i.ruleId=n.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=za(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}kt.prototype.file="";kt.prototype.name="";kt.prototype.reason="";kt.prototype.message="";kt.prototype.stack="";kt.prototype.column=void 0;kt.prototype.line=void 0;kt.prototype.ancestors=void 0;kt.prototype.cause=void 0;kt.prototype.fatal=void 0;kt.prototype.place=void 0;kt.prototype.ruleId=void 0;kt.prototype.source=void 0;const tl={}.hasOwnProperty,_g=new Map,Ng=/[A-Z]/g,Og=new Set(["table","tbody","thead","tfoot","tr"]),Rg=new Set(["td","th"]),Gh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Dg(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Ug(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Hg(r,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?nn:pi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Xh(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function Xh(e,t,r){if(t.type==="element")return Lg(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Mg(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Fg(e,t,r);if(t.type==="mdxjsEsm")return Pg(e,t);if(t.type==="root")return Bg(e,t,r);if(t.type==="text")return zg(e,t)}function Lg(e,t,r){const n=e.schema;let a=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=nn,e.schema=a),e.ancestors.push(t);const i=Qh(e,t.tagName,!1),s=jg(e,t);let o=nl(e,t);return Og.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Y5(u):!0})),Kh(e,s,i,t),rl(s,o),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function Mg(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ei(e,t.position)}function Pg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ei(e,t.position)}function Fg(e,t,r){const n=e.schema;let a=n;t.name==="svg"&&n.space==="html"&&(a=nn,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:Qh(e,t.name,!0),s=$g(e,t),o=nl(e,t);return Kh(e,s,i,t),rl(s,o),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function Bg(e,t,r){const n={};return rl(n,nl(e,t)),e.create(t,e.Fragment,n,r)}function zg(e,t){return t.value}function Kh(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function rl(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Hg(e,t,r){return n;function n(a,i,s,o){const l=Array.isArray(s.children)?r:t;return o?l(i,s,o):l(i,s)}}function Ug(e,t){return r;function r(n,a,i,s){const o=Array.isArray(i.children),u=br(n);return t(a,i,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function jg(e,t){const r={};let n,a;for(a in t.properties)if(a!=="children"&&tl.call(t.properties,a)){const i=qg(e,a,t.properties[a]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Rg.has(t.tagName)?n=o:r[s]=o}}if(n){const i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function $g(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];i.type;const s=i.expression;s.type;const o=s.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else ei(e,t.position);else{const a=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const o=n.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else ei(e,t.position);else i=n.value===null?!0:n.value;r[a]=i}return r}function nl(e,t){const r=[];let n=-1;const a=e.passKeys?new Map:_g;for(;++n<t.children.length;){const i=t.children[n];let s;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const l=a.get(u)||0;s=u+"-"+l,a.set(u,l+1)}}const o=Xh(e,i,s);o!==void 0&&r.push(o)}return r}function qg(e,t,r){const n=Ys(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?Bh(r):Wh(r)),n.property==="style"){let a=typeof r=="object"?r:Yg(e,String(r));return e.stylePropertyNameCase==="css"&&(a=Wg(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&n.space?X5[n.property]||n.property:n.attribute,r]}}function Yg(e,t){try{return Cg(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,a=new kt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Gh+"#cannot-parse-style-attribute",a}}function Qh(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const o=Bc(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}n=s}else n=Bc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const a=n.value;return tl.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(n);ei(e)}function ei(e,t){const r=new kt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Gh+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Wg(e){const t={};let r;for(r in e)tl.call(e,r)&&(t[Vg(r)]=e[r]);return t}function Vg(e){let t=e.replace(Ng,Gg);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Gg(e){return"-"+e.toLowerCase()}const z0={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Xg={};function al(e,t){const r=Xg,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Jh(e,n,a)}function Jh(e,t,r){if(Kg(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kc(e.children,t,r)}return Array.isArray(e)?Kc(e,t,r):""}function Kc(e,t,r){const n=[];let a=-1;for(;++a<e.length;)n[a]=Jh(e[a],t,r);return n.join("")}function Kg(e){return!!(e&&typeof e=="object")}const Qc=document.createElement("i");function il(e){const t="&"+e+";";Qc.innerHTML=t;const r=Qc.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function jt(e,t,r,n){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);i<n.length;)s=n.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(jt(e,e.length,0,t),e):t}const Jc={}.hasOwnProperty;function Zh(e){const t={};let r=-1;for(;++r<e.length;)Qg(t,e[r]);return t}function Qg(e,t){let r;for(r in t){const a=(Jc.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let s;if(i)for(s in i){Jc.call(a,s)||(a[s]=[]);const o=i[s];Jg(a[s],Array.isArray(o)?o:o?[o]:[])}}}function Jg(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);jt(e,0,0,n)}function em(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function ir(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nt=an(/[A-Za-z]/),wt=an(/[\dA-Za-z]/),Zg=an(/[#-'*+\--9=?A-Z^-~]/);function bs(e){return e!==null&&(e<32||e===127)}const Vo=an(/\d/),eb=an(/[\dA-Fa-f]/),tb=an(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function Ve(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const Xs=an(new RegExp("\\p{P}|\\p{S}","u")),Cn=an(/\s/);function an(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ca(e){const t=[];let r=-1,n=0,a=0;for(;++r<e.length;){const i=e.charCodeAt(r);let s="";if(i===37&&wt(e.charCodeAt(r+1))&&wt(e.charCodeAt(r+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(r+1);i<56320&&o>56319&&o<57344?(s=String.fromCharCode(i,o),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+a+1,s=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function Me(e,t,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(u){return Pe(u)?(e.enter(r),o(u)):t(u)}function o(u){return Pe(u)&&i++<a?(e.consume(u),o):(e.exit(r),t(u))}}const rb={tokenize:nb};function nb(e){const t=e.attempt(this.parser.constructs.contentInitial,n,a);let r;return t;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Me(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return xe(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const ab={tokenize:ib},Zc={tokenize:sb};function ib(e){const t=this,r=[];let n=0,a,i,s;return o;function o(k){if(n<r.length){const F=r[n];return t.containerState=F[1],e.attempt(F[0].continuation,u,l)(k)}return l(k)}function u(k){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&A();const F=t.events.length;let B=F,O;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){O=t.events[B][1].end;break}T(n);let M=F;for(;M<t.events.length;)t.events[M][1].end=se({},O),M++;return jt(t.events,B+1,0,t.events.slice(F)),t.events.length=M,l(k)}return o(k)}function l(k){if(n===r.length){if(!a)return p(k);if(a.currentConstruct&&a.currentConstruct.concrete)return b(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zc,c,f)(k)}function c(k){return a&&A(),T(n),p(k)}function f(k){return t.parser.lazy[t.now().line]=n!==r.length,s=t.now().offset,b(k)}function p(k){return t.containerState={},e.attempt(Zc,h,b)(k)}function h(k){return n++,r.push([t.currentConstruct,t.containerState]),p(k)}function b(k){if(k===null){a&&A(),T(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),y(k)}function y(k){if(k===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(k);return}return xe(k)?(e.consume(k),E(e.exit("chunkFlow")),n=0,t.interrupt=void 0,o):(e.consume(k),y)}function E(k,F){const B=t.sliceStream(k);if(F&&B.push(null),k.previous=i,i&&(i.next=k),i=k,a.defineSkip(k.start),a.write(B),t.parser.lazy[k.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<s&&(!a.events[O][1].end||a.events[O][1].end.offset>s))return;const M=t.events.length;let z=M,U,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(U){L=t.events[z][1].end;break}U=!0}for(T(n),O=M;O<t.events.length;)t.events[O][1].end=se({},L),O++;jt(t.events,z+1,0,t.events.slice(M)),t.events.length=O}}function T(k){let F=r.length;for(;F-- >k;){const B=r[F];t.containerState=B[1],B[0].exit.call(t,e)}r.length=k}function A(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sb(e,t,r){return Me(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jn(e){if(e===null||Ve(e)||Cn(e))return 1;if(Xs(e))return 2}function Ks(e,t,r){const n=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}const Go={name:"attention",resolveAll:ob,tokenize:ub};function ob(e,t){let r=-1,n,a,i,s,o,u,l,c;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const f=se({},e[n][1].end),p=se({},e[r][1].start);e1(f,-u),e1(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:se({},e[n][1].end)},o={type:u>1?"strongSequence":"emphasisSequence",start:se({},e[r][1].start),end:p},i={type:u>1?"strongText":"emphasisText",start:se({},e[n][1].end),end:se({},e[r][1].start)},a={type:u>1?"strong":"emphasis",start:se({},s.start),end:se({},o.end)},e[n][1].end=se({},s.start),e[r][1].start=se({},o.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Xt(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Xt(l,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),l=Xt(l,Ks(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),l=Xt(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,l=Xt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,jt(e,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function ub(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,a=Jn(n);let i;return s;function s(u){return i=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===i)return e.consume(u),o;const l=e.exit("attentionSequence"),c=Jn(u),f=!c||c===2&&a||r.includes(u),p=!a||a===2&&c||r.includes(n);return l._open=!!(i===42?f:f&&(a||!p)),l._close=!!(i===42?p:p&&(c||!f)),t(u)}}function e1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lb={name:"autolink",tokenize:cb};function cb(e,t,r){let n=0;return a;function a(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return Nt(h)?(e.consume(h),s):h===64?r(h):l(h)}function s(h){return h===43||h===45||h===46||wt(h)?(n=1,o(h)):l(h)}function o(h){return h===58?(e.consume(h),n=0,u):(h===43||h===45||h===46||wt(h))&&n++<32?(e.consume(h),o):(n=0,l(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||bs(h)?r(h):(e.consume(h),u)}function l(h){return h===64?(e.consume(h),c):Zg(h)?(e.consume(h),l):r(h)}function c(h){return wt(h)?f(h):r(h)}function f(h){return h===46?(e.consume(h),n=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||wt(h))&&n++<63){const b=h===45?p:f;return e.consume(h),b}return r(h)}}const gi={partial:!0,tokenize:fb};function fb(e,t,r){return n;function n(i){return Pe(i)?Me(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||xe(i)?t(i):r(i)}}const tm={continuation:{tokenize:hb},exit:mb,name:"blockQuote",tokenize:db};function db(e,t,r){const n=this;return a;function a(s){if(s===62){const o=n.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return r(s)}function i(s){return Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function hb(e,t,r){const n=this;return a;function a(s){return Pe(s)?Me(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(tm,t,r)(s)}}function mb(e){e.exit("blockQuote")}const rm={name:"characterEscape",tokenize:pb};function pb(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return tb(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}const nm={name:"characterReference",tokenize:gb};function gb(e,t,r){const n=this;let a=0,i,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,s=wt,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=eb,c):(e.enter("characterReferenceValue"),i=7,s=Vo,c(f))}function c(f){if(f===59&&a){const p=e.exit("characterReferenceValue");return s===wt&&!il(n.sliceSerialize(p))?r(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&a++<i?(e.consume(f),c):r(f)}}const t1={partial:!0,tokenize:yb},r1={concrete:!0,name:"codeFenced",tokenize:bb};function bb(e,t,r){const n=this,a={partial:!0,tokenize:B};let i=0,s=0,o;return u;function u(O){return l(O)}function l(O){const M=n.events[n.events.length-1];return i=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(O)}function c(O){return O===o?(s++,e.consume(O),c):s<3?r(O):(e.exit("codeFencedFenceSequence"),Pe(O)?Me(e,f,"whitespace")(O):f(O))}function f(O){return O===null||xe(O)?(e.exit("codeFencedFence"),n.interrupt?t(O):e.check(t1,y,F)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||xe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(O)):Pe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,h,"whitespace")(O)):O===96&&O===o?r(O):(e.consume(O),p)}function h(O){return O===null||xe(O)?f(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||xe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(O)):O===96&&O===o?r(O):(e.consume(O),b)}function y(O){return e.attempt(a,F,E)(O)}function E(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return i>0&&Pe(O)?Me(e,A,"linePrefix",i+1)(O):A(O)}function A(O){return O===null||xe(O)?e.check(t1,y,F)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||xe(O)?(e.exit("codeFlowValue"),A(O)):(e.consume(O),k)}function F(O){return e.exit("codeFenced"),t(O)}function B(O,M,z){let U=0;return L;function L(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),$}function $(W){return O.enter("codeFencedFence"),Pe(W)?Me(O,te,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):te(W)}function te(W){return W===o?(O.enter("codeFencedFenceSequence"),ge(W)):z(W)}function ge(W){return W===o?(U++,O.consume(W),ge):U>=s?(O.exit("codeFencedFenceSequence"),Pe(W)?Me(O,X,"whitespace")(W):X(W)):z(W)}function X(W){return W===null||xe(W)?(O.exit("codeFencedFence"),M(W)):z(W)}}}function yb(e,t,r){const n=this;return a;function a(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}const H0={name:"codeIndented",tokenize:Eb},xb={partial:!0,tokenize:Tb};function Eb(e,t,r){const n=this;return a;function a(l){return e.enter("codeIndented"),Me(e,i,"linePrefix",5)(l)}function i(l){const c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):xe(l)?e.attempt(xb,s,u)(l):(e.enter("codeFlowValue"),o(l))}function o(l){return l===null||xe(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),o)}function u(l){return e.exit("codeIndented"),t(l)}}function Tb(e,t,r){const n=this;return a;function a(s){return n.parser.lazy[n.now().line]?r(s):xe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):Me(e,i,"linePrefix",5)(s)}function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):xe(s)?a(s):r(s)}}const vb={name:"codeText",previous:Ab,resolve:wb,tokenize:Sb};function wb(e){let t=e.length-4,r=3,n,a;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)a===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(a=n):(n===t||e[n][1].type==="lineEnding")&&(e[a][1].type="codeTextData",n!==a+2&&(e[a][1].end=e[n-1][1].end,e.splice(a+2,n-a-2),t-=n-a-2,n=a+2),a=void 0);return e}function Ab(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sb(e,t,r){let n=0,a,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),n++,o):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?r(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),a=0,c(f)):xe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(f))}function l(f){return f===null||f===32||f===96||xe(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),l)}function c(f){return f===96?(e.consume(f),a++,c):a===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",l(f))}}class kb{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r==null?Number.POSITIVE_INFINITY:r;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const a=r||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return n&&ka(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ka(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ka(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);ka(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ka(this.left,r.reverse())}}}function ka(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function am(e){const t={};let r=-1,n,a,i,s,o,u,l;const c=new kb(e);for(;++r<c.length;){for(;r in t;)r=t[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Cb(c,r)),r=t[r],l=!0);else if(n[1]._container){for(i=r,a=void 0;i--;)if(s=c.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(c.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(n[1].end=se({},c.get(a)[1].start),o=c.slice(a,r),o.unshift(n),c.splice(a,r-a+1,o))}}return jt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Cb(e,t){const r=e.get(t)[1],n=e.get(t)[2];let a=t-1;const i=[];let s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,u=[],l={};let c,f,p=-1,h=r,b=0,y=0;const E=[y];for(;h;){for(;e.get(++a)[1]!==h;);i.push(a),h._tokenizer||(c=n.sliceStream(h),h.next||c.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=r;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(y=p+1,E.push(y),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),p=E.length;p--;){const T=o.slice(E[p],E[p+1]),A=i.pop();u.push([A,A+T.length-1]),e.splice(A,2,T)}for(u.reverse(),p=-1;++p<u.length;)l[b+u[p][0]]=b+u[p][1],b+=u[p][1]-u[p][0]-1;return l}const Ib={resolve:Nb,tokenize:Ob},_b={partial:!0,tokenize:Rb};function Nb(e){return am(e),e}function Ob(e,t){let r;return n;function n(o){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):xe(o)?e.check(_b,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function Rb(e,t,r){const n=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Me(e,i,"linePrefix")}function i(s){if(s===null||xe(s))return r(s);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function im(e,t,r,n,a,i,s,o,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(T){return T===60?(e.enter(n),e.enter(a),e.enter(i),e.consume(T),e.exit(i),p):T===null||T===32||T===41||bs(T)?r(T):(e.enter(n),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(T))}function p(T){return T===62?(e.enter(i),e.consume(T),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===62?(e.exit("chunkString"),e.exit(o),p(T)):T===null||T===60||xe(T)?r(T):(e.consume(T),T===92?b:h)}function b(T){return T===60||T===62||T===92?(e.consume(T),h):h(T)}function y(T){return!c&&(T===null||T===41||Ve(T))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(n),t(T)):c<l&&T===40?(e.consume(T),c++,y):T===41?(e.consume(T),c--,y):T===null||T===32||T===40||bs(T)?r(T):(e.consume(T),T===92?E:y)}function E(T){return T===40||T===41||T===92?(e.consume(T),y):y(T)}}function sm(e,t,r,n,a,i){const s=this;let o=0,u;return l;function l(h){return e.enter(n),e.enter(a),e.consume(h),e.exit(a),e.enter(i),c}function c(h){return o>999||h===null||h===91||h===93&&!u||h===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?r(h):h===93?(e.exit(i),e.enter(a),e.consume(h),e.exit(a),e.exit(n),t):xe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||xe(h)||o++>999?(e.exit("chunkString"),c(h)):(e.consume(h),u||(u=!Pe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function om(e,t,r,n,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(n),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,u):r(p)}function u(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(n),t):(e.enter(i),l(p))}function l(p){return p===s?(e.exit(i),u(s)):p===null?r(p):xe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Me(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||xe(p)?(e.exit("chunkString"),l(p)):(e.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(e.consume(p),c):c(p)}}function Ha(e,t){let r;return n;function n(a){return xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):Pe(a)?Me(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}const Db={name:"definition",tokenize:Mb},Lb={partial:!0,tokenize:Pb};function Mb(e,t,r){const n=this;let a;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return sm.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return a=ir(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):r(h)}function u(h){return Ve(h)?Ha(e,l)(h):l(h)}function l(h){return im(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(Lb,f,f)(h)}function f(h){return Pe(h)?Me(e,p,"whitespace")(h):p(h)}function p(h){return h===null||xe(h)?(e.exit("definition"),n.parser.defined.push(a),t(h)):r(h)}}function Pb(e,t,r){return n;function n(o){return Ve(o)?Ha(e,a)(o):r(o)}function a(o){return om(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Pe(o)?Me(e,s,"whitespace")(o):s(o)}function s(o){return o===null||xe(o)?t(o):r(o)}}const Fb={name:"hardBreakEscape",tokenize:Bb};function Bb(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return xe(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}const zb={name:"headingAtx",resolve:Hb,tokenize:Ub};function Hb(e,t){let r=e.length-2,n=3,a,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(a={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},jt(e,n,r-n+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function Ub(e,t,r){let n=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(e.consume(c),s):c===null||Ve(c)?(e.exit("atxHeadingSequence"),o(c)):r(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||xe(c)?(e.exit("atxHeading"),t(c)):Pe(c)?Me(e,o,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),o(c))}function l(c){return c===null||c===35||Ve(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),l)}}const jb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],n1=["pre","script","style","textarea"],$b={concrete:!0,name:"htmlFlow",resolveTo:Wb,tokenize:Vb},qb={partial:!0,tokenize:Xb},Yb={partial:!0,tokenize:Gb};function Wb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Vb(e,t,r){const n=this;let a,i,s,o,u;return l;function l(I){return c(I)}function c(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),p):I===47?(e.consume(I),i=!0,y):I===63?(e.consume(I),a=3,n.interrupt?t:C):Nt(I)?(e.consume(I),s=String.fromCharCode(I),E):r(I)}function p(I){return I===45?(e.consume(I),a=2,h):I===91?(e.consume(I),a=5,o=0,b):Nt(I)?(e.consume(I),a=4,n.interrupt?t:C):r(I)}function h(I){return I===45?(e.consume(I),n.interrupt?t:C):r(I)}function b(I){const me="CDATA[";return I===me.charCodeAt(o++)?(e.consume(I),o===me.length?n.interrupt?t:te:b):r(I)}function y(I){return Nt(I)?(e.consume(I),s=String.fromCharCode(I),E):r(I)}function E(I){if(I===null||I===47||I===62||Ve(I)){const me=I===47,ve=s.toLowerCase();return!me&&!i&&n1.includes(ve)?(a=1,n.interrupt?t(I):te(I)):jb.includes(s.toLowerCase())?(a=6,me?(e.consume(I),T):n.interrupt?t(I):te(I)):(a=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(I):i?A(I):k(I))}return I===45||wt(I)?(e.consume(I),s+=String.fromCharCode(I),E):r(I)}function T(I){return I===62?(e.consume(I),n.interrupt?t:te):r(I)}function A(I){return Pe(I)?(e.consume(I),A):L(I)}function k(I){return I===47?(e.consume(I),L):I===58||I===95||Nt(I)?(e.consume(I),F):Pe(I)?(e.consume(I),k):L(I)}function F(I){return I===45||I===46||I===58||I===95||wt(I)?(e.consume(I),F):B(I)}function B(I){return I===61?(e.consume(I),O):Pe(I)?(e.consume(I),B):k(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(e.consume(I),u=I,M):Pe(I)?(e.consume(I),O):z(I)}function M(I){return I===u?(e.consume(I),u=null,U):I===null||xe(I)?r(I):(e.consume(I),M)}function z(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ve(I)?B(I):(e.consume(I),z)}function U(I){return I===47||I===62||Pe(I)?k(I):r(I)}function L(I){return I===62?(e.consume(I),$):r(I)}function $(I){return I===null||xe(I)?te(I):Pe(I)?(e.consume(I),$):r(I)}function te(I){return I===45&&a===2?(e.consume(I),V):I===60&&a===1?(e.consume(I),ie):I===62&&a===4?(e.consume(I),K):I===63&&a===3?(e.consume(I),C):I===93&&a===5?(e.consume(I),he):xe(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(qb,Q,ge)(I)):I===null||xe(I)?(e.exit("htmlFlowData"),ge(I)):(e.consume(I),te)}function ge(I){return e.check(Yb,X,Q)(I)}function X(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),W}function W(I){return I===null||xe(I)?ge(I):(e.enter("htmlFlowData"),te(I))}function V(I){return I===45?(e.consume(I),C):te(I)}function ie(I){return I===47?(e.consume(I),s="",J):te(I)}function J(I){if(I===62){const me=s.toLowerCase();return n1.includes(me)?(e.consume(I),K):te(I)}return Nt(I)&&s.length<8?(e.consume(I),s+=String.fromCharCode(I),J):te(I)}function he(I){return I===93?(e.consume(I),C):te(I)}function C(I){return I===62?(e.consume(I),K):I===45&&a===2?(e.consume(I),C):te(I)}function K(I){return I===null||xe(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),K)}function Q(I){return e.exit("htmlFlow"),t(I)}}function Gb(e,t,r){const n=this;return a;function a(s){return xe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):r(s)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function Xb(e,t,r){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(gi,t,r)}}const Kb={name:"htmlText",tokenize:Qb};function Qb(e,t,r){const n=this;let a,i,s;return o;function o(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),u}function u(C){return C===33?(e.consume(C),l):C===47?(e.consume(C),B):C===63?(e.consume(C),k):Nt(C)?(e.consume(C),z):r(C)}function l(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),i=0,b):Nt(C)?(e.consume(C),A):r(C)}function c(C){return C===45?(e.consume(C),h):r(C)}function f(C){return C===null?r(C):C===45?(e.consume(C),p):xe(C)?(s=f,ie(C)):(e.consume(C),f)}function p(C){return C===45?(e.consume(C),h):f(C)}function h(C){return C===62?V(C):C===45?p(C):f(C)}function b(C){const K="CDATA[";return C===K.charCodeAt(i++)?(e.consume(C),i===K.length?y:b):r(C)}function y(C){return C===null?r(C):C===93?(e.consume(C),E):xe(C)?(s=y,ie(C)):(e.consume(C),y)}function E(C){return C===93?(e.consume(C),T):y(C)}function T(C){return C===62?V(C):C===93?(e.consume(C),T):y(C)}function A(C){return C===null||C===62?V(C):xe(C)?(s=A,ie(C)):(e.consume(C),A)}function k(C){return C===null?r(C):C===63?(e.consume(C),F):xe(C)?(s=k,ie(C)):(e.consume(C),k)}function F(C){return C===62?V(C):k(C)}function B(C){return Nt(C)?(e.consume(C),O):r(C)}function O(C){return C===45||wt(C)?(e.consume(C),O):M(C)}function M(C){return xe(C)?(s=M,ie(C)):Pe(C)?(e.consume(C),M):V(C)}function z(C){return C===45||wt(C)?(e.consume(C),z):C===47||C===62||Ve(C)?U(C):r(C)}function U(C){return C===47?(e.consume(C),V):C===58||C===95||Nt(C)?(e.consume(C),L):xe(C)?(s=U,ie(C)):Pe(C)?(e.consume(C),U):V(C)}function L(C){return C===45||C===46||C===58||C===95||wt(C)?(e.consume(C),L):$(C)}function $(C){return C===61?(e.consume(C),te):xe(C)?(s=$,ie(C)):Pe(C)?(e.consume(C),$):U(C)}function te(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),a=C,ge):xe(C)?(s=te,ie(C)):Pe(C)?(e.consume(C),te):(e.consume(C),X)}function ge(C){return C===a?(e.consume(C),a=void 0,W):C===null?r(C):xe(C)?(s=ge,ie(C)):(e.consume(C),ge)}function X(C){return C===null||C===34||C===39||C===60||C===61||C===96?r(C):C===47||C===62||Ve(C)?U(C):(e.consume(C),X)}function W(C){return C===47||C===62||Ve(C)?U(C):r(C)}function V(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):r(C)}function ie(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),J}function J(C){return Pe(C)?Me(e,he,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):he(C)}function he(C){return e.enter("htmlTextData"),s(C)}}const sl={name:"labelEnd",resolveAll:t8,resolveTo:r8,tokenize:n8},Jb={tokenize:a8},Zb={tokenize:i8},e8={tokenize:s8};function t8(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const a=n.type==="labelImage"?4:2;n.type="data",t+=a}}return e.length!==r.length&&jt(e,0,e.length,r),e}function r8(e,t){let r=e.length,n=0,a,i,s,o;for(;r--;)if(a=e[r][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=r,a.type!=="labelLink")){n=2;break}}else a.type==="labelEnd"&&(s=r);const u={type:e[i][1].type==="labelLink"?"link":"image",start:se({},e[i][1].start),end:se({},e[e.length-1][1].end)},l={type:"label",start:se({},e[i][1].start),end:se({},e[s][1].end)},c={type:"labelText",start:se({},e[i+n+2][1].end),end:se({},e[s-2][1].start)};return o=[["enter",u,t],["enter",l,t]],o=Xt(o,e.slice(i+1,i+n+3)),o=Xt(o,[["enter",c,t]]),o=Xt(o,Ks(t.parser.constructs.insideSpan.null,e.slice(i+n+4,s-3),t)),o=Xt(o,[["exit",c,t],e[s-2],e[s-1],["exit",l,t]]),o=Xt(o,e.slice(s+1)),o=Xt(o,[["exit",u,t]]),jt(e,i,e.length,o),e}function n8(e,t,r){const n=this;let a=n.events.length,i,s;for(;a--;)if((n.events[a][1].type==="labelImage"||n.events[a][1].type==="labelLink")&&!n.events[a][1]._balanced){i=n.events[a][1];break}return o;function o(p){return i?i._inactive?f(p):(s=n.parser.defined.includes(ir(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):r(p)}function u(p){return p===40?e.attempt(Jb,c,s?c:f)(p):p===91?e.attempt(Zb,c,s?l:f)(p):s?c(p):f(p)}function l(p){return e.attempt(e8,c,f)(p)}function c(p){return t(p)}function f(p){return i._balanced=!0,r(p)}}function a8(e,t,r){return n;function n(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return Ve(f)?Ha(e,i)(f):i(f)}function i(f){return f===41?c(f):im(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Ve(f)?Ha(e,u)(f):c(f)}function o(f){return r(f)}function u(f){return f===34||f===39||f===40?om(e,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return Ve(f)?Ha(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):r(f)}}function i8(e,t,r){const n=this;return a;function a(o){return sm.call(n,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return n.parser.defined.includes(ir(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(o):r(o)}function s(o){return r(o)}}function s8(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}const o8={name:"labelStartImage",resolveAll:sl.resolveAll,tokenize:u8};function u8(e,t,r){const n=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):r(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const l8={name:"labelStartLink",resolveAll:sl.resolveAll,tokenize:c8};function c8(e,t,r){const n=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}const U0={name:"lineEnding",tokenize:f8};function f8(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const as={name:"thematicBreak",tokenize:d8};function d8(e,t,r){let n=0,a;return i;function i(l){return e.enter("thematicBreak"),s(l)}function s(l){return a=l,o(l)}function o(l){return l===a?(e.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||xe(l))?(e.exit("thematicBreak"),t(l)):r(l)}function u(l){return l===a?(e.consume(l),n++,u):(e.exit("thematicBreakSequence"),Pe(l)?Me(e,o,"whitespace")(l):o(l))}}const Mt={continuation:{tokenize:g8},exit:y8,name:"list",tokenize:p8},h8={partial:!0,tokenize:x8},m8={partial:!0,tokenize:b8};function p8(e,t,r){const n=this,a=n.events[n.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(h){const b=n.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!n.containerState.marker||h===n.containerState.marker:Vo(h)){if(n.containerState.type||(n.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(as,r,l)(h):l(h);if(!n.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return r(h)}function u(h){return Vo(h)&&++s<10?(e.consume(h),u):(!n.interrupt||s<2)&&(n.containerState.marker?h===n.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),l(h)):r(h)}function l(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||h,e.check(gi,n.interrupt?r:c,e.attempt(h8,p,f))}function c(h){return n.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return Pe(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):r(h)}function p(h){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function g8(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(gi,a,i);function a(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Me(e,t,"listItemIndent",n.containerState.size+1)(o)}function i(o){return n.containerState.furtherBlankLines||!Pe(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(m8,t,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,Me(e,e.attempt(Mt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function b8(e,t,r){const n=this;return Me(e,a,"listItemIndent",n.containerState.size+1);function a(i){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(i):r(i)}}function y8(e){e.exit(this.containerState.type)}function x8(e,t,r){const n=this;return Me(e,a,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=n.events[n.events.length-1];return!Pe(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}const a1={name:"setextUnderline",resolveTo:E8,tokenize:T8};function E8(e,t){let r=e.length,n,a,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);const s={type:"setextHeading",start:se({},e[n][1].start),end:se({},e[e.length-1][1].end)};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=se({},e[i][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}function T8(e,t,r){const n=this;let a;return i;function i(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(e.enter("setextHeadingLine"),a=l,s(l)):r(l)}function s(l){return e.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===a?(e.consume(l),o):(e.exit("setextHeadingLineSequence"),Pe(l)?Me(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||xe(l)?(e.exit("setextHeadingLine"),t(l)):r(l)}}const v8={tokenize:w8};function w8(e){const t=this,r=e.attempt(gi,n,e.attempt(this.parser.constructs.flowInitial,a,Me(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Ib,a)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const A8={resolveAll:lm()},S8=um("string"),k8=um("text");function um(e){return{resolveAll:lm(e==="text"?C8:void 0),tokenize:t};function t(r){const n=this,a=this.parser.constructs[e],i=r.attempt(a,s,o);return s;function s(c){return l(c)?i(c):o(c)}function o(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),i(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;const f=a[c];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(n,n.previous))return!0}return!1}}}function lm(e){return t;function t(r,n){let a=-1,i;for(;++a<=r.length;)i===void 0?r[a]&&r[a][1].type==="data"&&(i=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==i+2&&(r[i][1].end=r[a-1][1].end,r.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(r,n):r}}function C8(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],a=t.sliceStream(n);let i=a.length,s=-1,o=0,u;for(;i--;){const l=a[i];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(l===-2)u=!0,o++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(o=0),o){const l={type:r===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:n.start._bufferIndex+s,_index:n.start._index+i,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:se({},n.end)};n.end=se({},l.start),n.start.offset===n.end.offset?Object.assign(n,l):(e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2)}r++}return e}const I8={42:Mt,43:Mt,45:Mt,48:Mt,49:Mt,50:Mt,51:Mt,52:Mt,53:Mt,54:Mt,55:Mt,56:Mt,57:Mt,62:tm},_8={91:Db},N8={[-2]:H0,[-1]:H0,32:H0},O8={35:zb,42:as,45:[a1,as],60:$b,61:a1,95:as,96:r1,126:r1},R8={38:nm,92:rm},D8={[-5]:U0,[-4]:U0,[-3]:U0,33:o8,38:nm,42:Go,60:[lb,Kb],91:l8,92:[Fb,rm],93:sl,95:Go,96:vb},L8={null:[Go,A8]},M8={null:[42,95]},P8={null:[]},F8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:M8,contentInitial:_8,disable:P8,document:I8,flow:O8,flowInitial:N8,insideSpan:L8,string:R8,text:D8},Symbol.toStringTag,{value:"Module"}));function B8(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const a={},i=[];let s=[],o=[];const u={attempt:M(B),check:M(O),consume:A,enter:k,exit:F,interrupt:M(O,{interrupt:!0})},l={code:null,containerState:{},defineSkip:y,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let c=t.tokenize.call(l,u);return t.resolveAll&&i.push(t),l;function f($){return s=Xt(s,$),E(),s[s.length-1]!==null?[]:(z(t,0),l.events=Ks(i,l.events,l),l.events)}function p($,te){return H8(h($),te)}function h($){return z8(s,$)}function b(){const{_bufferIndex:$,_index:te,line:ge,column:X,offset:W}=n;return{_bufferIndex:$,_index:te,line:ge,column:X,offset:W}}function y($){a[$.line]=$.column,L()}function E(){let $;for(;n._index<s.length;){const te=s[n._index];if(typeof te=="string")for($=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===$&&n._bufferIndex<te.length;)T(te.charCodeAt(n._bufferIndex));else T(te)}}function T($){c=c($)}function A($){xe($)?(n.line++,n.column=1,n.offset+=$===-3?2:1,L()):$!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),l.previous=$}function k($,te){const ge=te||{};return ge.type=$,ge.start=b(),l.events.push(["enter",ge,l]),o.push(ge),ge}function F($){const te=o.pop();return te.end=b(),l.events.push(["exit",te,l]),te}function B($,te){z($,te.from)}function O($,te){te.restore()}function M($,te){return ge;function ge(X,W,V){let ie,J,he,C;return Array.isArray(X)?Q(X):"tokenize"in X?Q([X]):K(X);function K(Ce){return He;function He(Ze){const qe=Ze!==null&&Ce[Ze],Be=Ze!==null&&Ce.null,pt=[...Array.isArray(qe)?qe:qe?[qe]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return Q(pt)(Ze)}}function Q(Ce){return ie=Ce,J=0,Ce.length===0?V:I(Ce[J])}function I(Ce){return He;function He(Ze){return C=U(),he=Ce,Ce.partial||(l.currentConstruct=Ce),Ce.name&&l.parser.constructs.disable.null.includes(Ce.name)?ve():Ce.tokenize.call(te?Object.assign(Object.create(l),te):l,u,me,ve)(Ze)}}function me(Ce){return $(he,C),W}function ve(Ce){return C.restore(),++J<ie.length?I(ie[J]):V}}}function z($,te){$.resolveAll&&!i.includes($)&&i.push($),$.resolve&&jt(l.events,te,l.events.length-te,$.resolve(l.events.slice(te),l)),$.resolveTo&&(l.events=$.resolveTo(l.events,l))}function U(){const $=b(),te=l.previous,ge=l.currentConstruct,X=l.events.length,W=Array.from(o);return{from:X,restore:V};function V(){n=$,l.previous=te,l.currentConstruct=ge,l.events.length=X,o=W,L()}}function L(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}function z8(e,t){const r=t.start._index,n=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(r===a)s=[e[r].slice(n,i)];else{if(s=e.slice(r,a),n>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function H8(e,t){let r=-1;const n=[];let a;for(;++r<e.length;){const i=e[r];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
14
14
|
`;break}case-3:{s=`\r
|
package/dist/appflow-chat.esm.js
CHANGED
|
@@ -2552,6 +2552,17 @@ class m5 {
|
|
|
2552
2552
|
const f = [], p = c.data;
|
|
2553
2553
|
if (Array.isArray(p))
|
|
2554
2554
|
for (const d of p) {
|
|
2555
|
+
if (d.assistant && Array.isArray(d.assistant) && d.assistant.length > 0) {
|
|
2556
|
+
const b = d.assistant[0];
|
|
2557
|
+
f.push({
|
|
2558
|
+
id: b.messageId || `assistant_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
2559
|
+
role: "assistant",
|
|
2560
|
+
content: b.content || "",
|
|
2561
|
+
messageType: b.messageType || "text",
|
|
2562
|
+
gmtCreate: d.gmtCreate,
|
|
2563
|
+
sessionId: b.sessionId || d.sessionId
|
|
2564
|
+
});
|
|
2565
|
+
}
|
|
2555
2566
|
if (d.message !== void 0 && d.message !== null) {
|
|
2556
2567
|
const b = d.messageType || "text";
|
|
2557
2568
|
let y = "", T, x;
|
|
@@ -2578,17 +2589,6 @@ class m5 {
|
|
|
2578
2589
|
audio: w ? y : void 0
|
|
2579
2590
|
});
|
|
2580
2591
|
}
|
|
2581
|
-
if (d.assistant && Array.isArray(d.assistant) && d.assistant.length > 0) {
|
|
2582
|
-
const b = d.assistant[0];
|
|
2583
|
-
f.push({
|
|
2584
|
-
id: b.messageId || `assistant_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
2585
|
-
role: "assistant",
|
|
2586
|
-
content: b.content || "",
|
|
2587
|
-
messageType: b.messageType || "text",
|
|
2588
|
-
gmtCreate: d.gmtCreate,
|
|
2589
|
-
sessionId: b.sessionId || d.sessionId
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
2592
|
}
|
|
2593
2593
|
return f.reverse();
|
|
2594
2594
|
}
|
package/package.json
CHANGED
|
@@ -696,6 +696,23 @@ class ChatService {
|
|
|
696
696
|
// 处理消息列表
|
|
697
697
|
if (Array.isArray(data)) {
|
|
698
698
|
for (const item of data) {
|
|
699
|
+
// 注意:接口返回数据是倒序的(最新在前),最终会 reverse()
|
|
700
|
+
// 因此这里先推入 AI 回复,再推入用户消息,reverse() 后顺序变为 user → assistant
|
|
701
|
+
|
|
702
|
+
// AI回复 - 在 assistant 数组中
|
|
703
|
+
if (item.assistant && Array.isArray(item.assistant) && item.assistant.length > 0) {
|
|
704
|
+
// 取第一个assistant回复
|
|
705
|
+
const assistantMsg = item.assistant[0];
|
|
706
|
+
messages.push({
|
|
707
|
+
id: assistantMsg.messageId || `assistant_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
708
|
+
role: 'assistant',
|
|
709
|
+
content: assistantMsg.content || '',
|
|
710
|
+
messageType: assistantMsg.messageType || 'text',
|
|
711
|
+
gmtCreate: item.gmtCreate,
|
|
712
|
+
sessionId: assistantMsg.sessionId || item.sessionId,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
|
|
699
716
|
// 用户消息 - 在 message 字段中
|
|
700
717
|
if (item.message !== undefined && item.message !== null) {
|
|
701
718
|
const messageType = item.messageType || 'text';
|
|
@@ -745,20 +762,6 @@ class ChatService {
|
|
|
745
762
|
audio: isAudioMessage ? content : undefined,
|
|
746
763
|
});
|
|
747
764
|
}
|
|
748
|
-
|
|
749
|
-
// AI回复 - 在 assistant 数组中
|
|
750
|
-
if (item.assistant && Array.isArray(item.assistant) && item.assistant.length > 0) {
|
|
751
|
-
// 取第一个assistant回复
|
|
752
|
-
const assistantMsg = item.assistant[0];
|
|
753
|
-
messages.push({
|
|
754
|
-
id: assistantMsg.messageId || `assistant_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
755
|
-
role: 'assistant',
|
|
756
|
-
content: assistantMsg.content || '',
|
|
757
|
-
messageType: assistantMsg.messageType || 'text',
|
|
758
|
-
gmtCreate: item.gmtCreate,
|
|
759
|
-
sessionId: assistantMsg.sessionId || item.sessionId,
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
765
|
}
|
|
763
766
|
}
|
|
764
767
|
|