nextclaw 0.8.32 → 0.8.33

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.
Files changed (33) hide show
  1. package/package.json +2 -2
  2. package/templates/USAGE.md +18 -0
  3. package/ui-dist/assets/ChannelsList-TFFw4Cem.js +1 -0
  4. package/ui-dist/assets/ChatPage-BUm3UPap.js +32 -0
  5. package/ui-dist/assets/CronConfig-9dYfTRJl.js +1 -0
  6. package/ui-dist/assets/{DocBrowser-C35MebbI.js → DocBrowser-BIV0vpA0.js} +1 -1
  7. package/ui-dist/assets/{MarketplacePage-HjEQ8sFt.js → MarketplacePage-2Zi0JSVi.js} +1 -1
  8. package/ui-dist/assets/{ModelConfig-BpBoi1sz.js → ModelConfig-h21P5rV0.js} +1 -1
  9. package/ui-dist/assets/ProvidersList-DEaK1a3y.js +1 -0
  10. package/ui-dist/assets/RuntimeConfig-DXMzf-gF.js +1 -0
  11. package/ui-dist/assets/SessionsConfig-SdXvn_9E.js +2 -0
  12. package/ui-dist/assets/{action-link-CSScZ_id.js → action-link-C9xMkxl2.js} +1 -1
  13. package/ui-dist/assets/{card-Cj58-DCd.js → card-Cnqfntk5.js} +1 -1
  14. package/ui-dist/assets/chat-message-B7oqvJ2d.js +3 -0
  15. package/ui-dist/assets/{dialog-Ce8jNftN.js → dialog-DJs630RE.js} +2 -2
  16. package/ui-dist/assets/index-CrUDzcei.js +2 -0
  17. package/ui-dist/assets/index-Zy7fAOe1.css +1 -0
  18. package/ui-dist/assets/{label-CQdP2NhF.js → label-CXGuE6Oa.js} +1 -1
  19. package/ui-dist/assets/{page-layout-Byyxptub.js → page-layout-BVZlyPFt.js} +1 -1
  20. package/ui-dist/assets/{switch-ChJzdp0x.js → switch-BLF45eI3.js} +1 -1
  21. package/ui-dist/assets/{tabs-custom-DWlAbbCy.js → tabs-custom-DQ0GpEV5.js} +1 -1
  22. package/ui-dist/assets/{useConfig-8lC_4LwH.js → useConfig-vFQvF4kn.js} +1 -1
  23. package/ui-dist/assets/{useConfirmDialog-B7iWHb5k.js → useConfirmDialog-CK7KAyDf.js} +1 -1
  24. package/ui-dist/assets/{vendor-Dz2q6Qmc.js → vendor-RXIbhDBC.js} +87 -62
  25. package/ui-dist/index.html +3 -3
  26. package/ui-dist/assets/ChannelsList-DqgRRdUH.js +0 -1
  27. package/ui-dist/assets/ChatPage-BQyomkth.js +0 -1
  28. package/ui-dist/assets/CronConfig-Bmg449JI.js +0 -1
  29. package/ui-dist/assets/ProvidersList-0tYTV40v.js +0 -1
  30. package/ui-dist/assets/RuntimeConfig-B_WI-DHf.js +0 -1
  31. package/ui-dist/assets/SessionsConfig-BEt-f6WS.js +0 -2
  32. package/ui-dist/assets/index-CPFSdkyQ.css +0 -1
  33. package/ui-dist/assets/index-C_z1Na9N.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextclaw",
3
- "version": "0.8.32",
3
+ "version": "0.8.33",
4
4
  "description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "chokidar": "^3.6.0",
40
40
  "commander": "^12.1.0",
41
41
  "@nextclaw/core": "^0.6.34",
42
- "@nextclaw/server": "^0.5.16",
42
+ "@nextclaw/server": "^0.5.17",
43
43
  "@nextclaw/openclaw-compat": "^0.1.28"
44
44
  },
45
45
  "devDependencies": {
@@ -352,6 +352,24 @@ NextClaw UI now provides an OpenClaw-aligned session operations panel (**Session
352
352
 
353
353
  This is useful when running multi-agent routing and channel operations long term, because you can clean or retarget problematic sessions without hand-editing files.
354
354
 
355
+ ## Agent chat in UI
356
+
357
+ NextClaw UI includes a first-class **Chat** tab so you can talk to your agent directly from browser:
358
+
359
+ - create/switch/delete sessions from the left panel
360
+ - inspect complete session history in the thread panel
361
+ - choose target agent before sending message
362
+ - send messages with Enter (Shift+Enter for newline)
363
+ - keep using the same session for multi-turn context
364
+ - render assistant replies as Markdown (tables/code blocks/links)
365
+ - show tool calls/results as structured tool cards
366
+ - merge consecutive same-role messages into grouped chat blocks for better readability
367
+
368
+ Notes:
369
+
370
+ - if provider credentials are missing, chat API will return a clear runtime error telling you to configure provider keys first
371
+ - session data is persisted in the same session store used by runtime/channels
372
+
355
373
  ---
356
374
 
357
375
  ## Workspace
@@ -0,0 +1 @@
1
+ import{r as v,j as a,ac as ae,M as S,ad as M,ae as N,aa as te,_ as ne,ab as le,af as se,ag as oe,n as H,ah as re,ai as ce,aj as ie}from"./vendor-RXIbhDBC.js";import{u as _,a as q,i as me,j as pe,I as D,g as de}from"./useConfig-vFQvF4kn.js";import{t as e,c as G,u as J,S as be,b as ue,d as ge,e as ye,g as xe}from"./index-CrUDzcei.js";import{D as he,a as fe,b as we,c as je,d as ve,e as ke}from"./dialog-DJs630RE.js";import{B as F,P as Ce,a as Pe}from"./page-layout-BVZlyPFt.js";import{L as Ne}from"./label-CXGuE6Oa.js";import{S as Se}from"./switch-BLF45eI3.js";import{h as T}from"./config-hints-CApS3K_7.js";import{T as Ie}from"./tabs-custom-DQ0GpEV5.js";import{C as De,a as Fe,L as Te,d as Me,S as Ae,b as Le,c as Ue,A as Ee}from"./action-link-C9xMkxl2.js";function Be({value:n,onChange:d,className:i,placeholder:m=""}){const[c,y]=v.useState(""),b=u=>{u.key==="Enter"&&c.trim()?(u.preventDefault(),d([...n,c.trim()]),y("")):u.key==="Backspace"&&!c&&n.length>0&&d(n.slice(0,-1))},f=u=>{d(n.filter((o,g)=>g!==u))};return a.jsxs("div",{className:G("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",i),children:[n.map((u,o)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[u,a.jsx("button",{type:"button",onClick:()=>f(o),className:"hover:text-red-300 transition-colors",children:a.jsx(ae,{className:"h-3 w-3"})})]},o)),a.jsx("input",{type:"text",value:c,onChange:u=>y(u.target.value),onKeyDown:b,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:m||e("enterTag")})]})}const U=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],E=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],Oe=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}],$e=n=>n.includes("token")||n.includes("secret")||n.includes("password")?a.jsx(te,{className:"h-3.5 w-3.5 text-gray-500"}):n.includes("url")||n.includes("host")?a.jsx(ne,{className:"h-3.5 w-3.5 text-gray-500"}):n.includes("email")||n.includes("mail")?a.jsx(M,{className:"h-3.5 w-3.5 text-gray-500"}):n.includes("id")||n.includes("from")?a.jsx(le,{className:"h-3.5 w-3.5 text-gray-500"}):n==="enabled"||n==="consentGranted"?a.jsx(se,{className:"h-3.5 w-3.5 text-gray-500"}):a.jsx(oe,{className:"h-3.5 w-3.5 text-gray-500"});function B(){return{telegram:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"proxy",type:"text",label:e("proxy")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:U},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:E},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"gatewayUrl",type:"text",label:e("gatewayUrl")},{name:"intents",type:"number",label:e("intents")},{name:"proxy",type:"text",label:e("proxy")},{name:"mediaMaxMb",type:"number",label:e("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:e("streamingMode"),options:Oe},{name:"draftChunk",type:"json",label:e("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:e("textChunkLimit")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:U},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:E},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"bridgeUrl",type:"text",label:e("bridgeUrl")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"appSecret",type:"password",label:e("appSecret")},{name:"encryptKey",type:"password",label:e("encryptKey")},{name:"verificationToken",type:"password",label:e("verificationToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"clientId",type:"text",label:e("clientId")},{name:"clientSecret",type:"password",label:e("clientSecret")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"corpId",type:"text",label:e("corpId")},{name:"agentId",type:"text",label:e("agentId")},{name:"secret",type:"password",label:e("secret")},{name:"token",type:"password",label:e("token")},{name:"callbackPort",type:"number",label:e("callbackPort")},{name:"callbackPath",type:"text",label:e("callbackPath")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"mode",type:"text",label:e("mode")},{name:"webhookPath",type:"text",label:e("webhookPath")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"botToken",type:"password",label:e("botToken")},{name:"appToken",type:"password",label:e("appToken")}],email:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"consentGranted",type:"boolean",label:e("consentGranted")},{name:"imapHost",type:"text",label:e("imapHost")},{name:"imapPort",type:"number",label:e("imapPort")},{name:"imapUsername",type:"text",label:e("imapUsername")},{name:"imapPassword",type:"password",label:e("imapPassword")},{name:"fromAddress",type:"email",label:e("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"baseUrl",type:"text",label:e("baseUrl")},{name:"clawToken",type:"password",label:e("clawToken")},{name:"agentUserId",type:"text",label:e("agentUserId")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"secret",type:"password",label:e("appSecret")},{name:"markdownSupport",type:"boolean",label:e("markdownSupport")},{name:"allowFrom",type:"tags",label:e("allowFrom")}]}}const O={telegram:S,slack:S,email:M,default:S},$={telegram:"from-primary-300 to-primary-600",slack:"from-primary-200 to-primary-500",email:"from-primary-100 to-primary-400",default:"from-gray-300 to-gray-500"};function I(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function K(n,d){const i={...n};for(const[m,c]of Object.entries(d)){const y=i[m];if(I(y)&&I(c)){i[m]=K(y,c);continue}i[m]=c}return i}function Re(n,d){const i=n.split("."),m={};let c=m;for(let y=0;y<i.length-1;y+=1){const b=i[y];c[b]={},c=c[b]}return c[i[i.length-1]]=d,m}function He(){var A,L;const{channelModal:n,closeChannelModal:d}=J(),{data:i}=_(),{data:m}=q(),c=me(),y=pe(),[b,f]=v.useState({}),[u,o]=v.useState({}),[g,x]=v.useState(null),l=n.channel,w=l?i==null?void 0:i.channels[l]:null,k=l?B()[l]??[]:[],C=m==null?void 0:m.uiHints,P=l?`channels.${l}`:null,z=((A=m==null?void 0:m.actions)==null?void 0:A.filter(t=>t.scope===P))??[],V=l&&(((L=T(`channels.${l}`,C))==null?void 0:L.label)??l);v.useEffect(()=>{if(w){f({...w});const t={};(l?B()[l]??[]:[]).filter(r=>r.type==="json").forEach(r=>{const h=w[r.name];t[r.name]=JSON.stringify(h??{},null,2)}),o(t)}else f({}),o({})},[w,l]);const j=(t,s)=>{f(r=>({...r,[t]:s}))},Y=t=>{if(t.preventDefault(),!l)return;const s={...b};for(const r of k){if(r.type!=="json")continue;const h=u[r.name]??"";try{s[r.name]=h.trim()?JSON.parse(h):{}}catch{N.error(`${e("invalidJson")}: ${r.name}`);return}}c.mutate({channel:l,data:s},{onSuccess:()=>d()})},W=t=>{if(!t||!l)return;const s=t.channels;if(!I(s))return;const r=s[l];I(r)&&f(h=>K(h,r))},X=async t=>{if(!(!l||!P)){x(t.id);try{let s={...b};t.saveBeforeRun&&(s={...s,...t.savePatch??{}},f(s),await c.mutateAsync({channel:l,data:s}));const r=await y.mutateAsync({actionId:t.id,data:{scope:P,draftConfig:Re(P,s)}});W(r.patch),r.ok?N.success(r.message||e("success")):N.error(r.message||e("error"))}catch(s){const r=s instanceof Error?s.message:String(s);N.error(`${e("error")}: ${r}`)}finally{x(null)}}},Q=O[l||""]||O.default,Z=$[l||""]||$.default;return a.jsx(he,{open:n.open,onOpenChange:d,children:a.jsxs(fe,{className:"sm:max-w-[550px] max-h-[85vh] overflow-hidden flex flex-col",children:[a.jsx(we,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`h-10 w-10 rounded-xl bg-gradient-to-br ${Z} flex items-center justify-center`,children:a.jsx(Q,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx(je,{className:"capitalize",children:V}),a.jsx(ve,{children:e("configureMessageChannelParameters")})]})]})}),a.jsxs("form",{onSubmit:Y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar py-2 pr-2 space-y-5",children:k.map(t=>{const s=l?T(`channels.${l}.${t.name}`,C):void 0,r=(s==null?void 0:s.label)??t.label,h=s==null?void 0:s.placeholder;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs(Ne,{htmlFor:t.name,className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[$e(t.name),r]}),t.type==="boolean"&&a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-gray-50",children:[a.jsx("span",{className:"text-sm text-gray-500",children:b[t.name]?e("enabled"):e("disabled")}),a.jsx(Se,{id:t.name,checked:b[t.name]||!1,onCheckedChange:p=>j(t.name,p),className:"data-[state=checked]:bg-emerald-500"})]}),(t.type==="text"||t.type==="email")&&a.jsx(D,{id:t.name,type:t.type,value:b[t.name]||"",onChange:p=>j(t.name,p.target.value),placeholder:h,className:"rounded-xl"}),t.type==="password"&&a.jsx(D,{id:t.name,type:"password",value:b[t.name]||"",onChange:p=>j(t.name,p.target.value),placeholder:h??e("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),t.type==="number"&&a.jsx(D,{id:t.name,type:"number",value:b[t.name]||0,onChange:p=>j(t.name,parseInt(p.target.value)||0),placeholder:h,className:"rounded-xl"}),t.type==="tags"&&a.jsx(Be,{value:b[t.name]||[],onChange:p=>j(t.name,p)}),t.type==="select"&&a.jsxs(be,{value:b[t.name]||"",onValueChange:p=>j(t.name,p),children:[a.jsx(ue,{className:"rounded-xl",children:a.jsx(ge,{})}),a.jsx(ye,{children:(t.options??[]).map(p=>a.jsx(xe,{value:p.value,children:p.label},p.value))})]}),t.type==="json"&&a.jsx("textarea",{id:t.name,value:u[t.name]??"{}",onChange:p=>o(ee=>({...ee,[t.name]:p.target.value})),className:"min-h-[120px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},t.name)})}),a.jsxs(ke,{className:"pt-4 flex-shrink-0",children:[a.jsx(F,{type:"button",variant:"outline",onClick:d,children:e("cancel")}),a.jsx(F,{type:"submit",disabled:c.isPending||!!g,children:c.isPending?e("saving"):e("save")}),z.filter(t=>t.trigger==="manual").map(t=>a.jsx(F,{type:"button",onClick:()=>X(t),disabled:c.isPending||!!g,variant:"secondary",children:g===t.id?e("connecting"):t.title},t.id))]})]})]})})}const R={telegram:S,slack:ce,email:M,webhook:re,default:H},_e={telegram:"channelDescTelegram",slack:"channelDescSlack",email:"channelDescEmail",webhook:"channelDescWebhook",discord:"channelDescDiscord",feishu:"channelDescFeishu"};function Ze(){const{data:n}=_(),{data:d}=de(),{data:i}=q(),{openChannelModal:m}=J(),[c,y]=v.useState("active"),b=i==null?void 0:i.uiHints;if(!n||!d)return a.jsx("div",{className:"p-8 text-gray-400",children:e("channelsLoading")});const f=[{id:"active",label:e("channelsTabEnabled"),count:d.channels.filter(o=>{var g;return(g=n.channels[o.name])==null?void 0:g.enabled}).length},{id:"all",label:e("channelsTabAll"),count:d.channels.length}],u=d.channels.filter(o=>{var x;const g=((x=n.channels[o.name])==null?void 0:x.enabled)||!1;return c==="all"||g});return a.jsxs(Ce,{children:[a.jsx(Pe,{title:e("channelsPageTitle")}),a.jsx(Ie,{tabs:f,activeTab:c,onChange:y}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:u.map(o=>{const g=n.channels[o.name],x=(g==null?void 0:g.enabled)||!1,l=R[o.name]||R.default,w=T(`channels.${o.name}`,b),k=(w==null?void 0:w.help)||e(_e[o.name]||"channelDescriptionDefault");return a.jsxs(De,{onClick:()=>m(o.name),children:[a.jsxs(Fe,{children:[a.jsx(Te,{name:o.name,src:Me(o.name),className:G("h-11 w-11 rounded-xl border transition-all",x?"bg-white border-primary/30":"bg-white border-gray-200/60 group-hover:border-gray-300"),imgClassName:"h-5 w-5",fallback:a.jsx(l,{className:"h-5 w-5"})}),a.jsx(Ae,{status:x?"active":"inactive",label:x?e("statusActive"):e("statusInactive")})]}),a.jsx(Le,{title:o.displayName||o.name,description:k}),a.jsxs(Ue,{children:[a.jsx(Ee,{label:x?e("actionConfigure"):e("actionEnable")}),o.tutorialUrl&&a.jsx("a",{href:o.tutorialUrl,target:"_blank",rel:"noreferrer",onClick:C=>C.stopPropagation(),className:"flex items-center justify-center h-6 w-6 rounded-md text-gray-300 hover:text-gray-500 hover:bg-gray-100/60 transition-colors",title:e("channelsGuideTitle"),children:a.jsx(ie,{className:"h-3.5 w-3.5"})})]})]},o.name)})}),u.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-14 w-14 flex items-center justify-center rounded-xl bg-gray-100/80 mb-4",children:a.jsx(H,{className:"h-6 w-6 text-gray-300"})}),a.jsx("h3",{className:"text-[14px] font-semibold text-gray-900 mb-1.5",children:e("channelsEmptyTitle")}),a.jsx("p",{className:"text-[13px] text-gray-400 max-w-sm",children:e("channelsEmptyDescription")})]}),a.jsx(He,{})]})}export{Ze as ChannelsList};
@@ -0,0 +1,32 @@
1
+ import{O as xr,j as S,r as J,U as Oi,W as Mi,X as yr,Y as Bi,Z as kr,_ as Hi,a0 as Ui,a1 as qi,a2 as $i,a3 as kn,a4 as bn,a5 as wn,a6 as Vi,a7 as Wi}from"./vendor-RXIbhDBC.js";import{u as Ki,c as Qi,d as Xi,e as Yi,f as Gi,I as Ji}from"./useConfig-vFQvF4kn.js";import{u as Zi}from"./useConfirmDialog-CK7KAyDf.js";import{P as el,a as tl,B as Fe}from"./page-layout-BVZlyPFt.js";import{a as br,c as he,t as q,S as nl,b as rl,d as il,e as ll,g as ol}from"./index-CrUDzcei.js";import{g as al,e as sl,a as ul}from"./chat-message-B7oqvJ2d.js";import"./dialog-DJs630RE.js";function cl(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const fl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pl={};function Sn(e,n){return(pl.jsx?hl:fl).test(e)}const ml=/[ \t\n\f\r]/g;function dl(e){return typeof e=="object"?e.type==="text"?Cn(e.value):!1:Cn(e)}function Cn(e){return e.replace(ml,"")===""}class tt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}tt.prototype.normal={};tt.prototype.property={};tt.prototype.space=void 0;function wr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new tt(t,r,n)}function jt(e){return e.toLowerCase()}class re{constructor(n,t){this.attribute=t,this.property=n}}re.prototype.attribute="";re.prototype.booleanish=!1;re.prototype.boolean=!1;re.prototype.commaOrSpaceSeparated=!1;re.prototype.commaSeparated=!1;re.prototype.defined=!1;re.prototype.mustUseProperty=!1;re.prototype.number=!1;re.prototype.overloadedBoolean=!1;re.prototype.property="";re.prototype.spaceSeparated=!1;re.prototype.space=void 0;let gl=0;const j=De(),X=De(),Ot=De(),I=De(),Q=De(),Oe=De(),le=De();function De(){return 2**++gl}const Mt=Object.freeze(Object.defineProperty({__proto__:null,boolean:j,booleanish:X,commaOrSpaceSeparated:le,commaSeparated:Oe,number:I,overloadedBoolean:Ot,spaceSeparated:Q},Symbol.toStringTag,{value:"Module"})),kt=Object.keys(Mt);class Xt extends re{constructor(n,t,r,i){let o=-1;if(super(n,t),En(this,"space",i),typeof r=="number")for(;++o<kt.length;){const l=kt[o];En(this,kt[o],(r&Mt[l])===Mt[l])}}}Xt.prototype.defined=!0;function En(e,n,t){t&&(e[n]=t)}function Be(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new Xt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[jt(r)]=r,t[jt(o.attribute)]=r}return new tt(n,t,e.space)}const Sr=Be({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:Q,ariaCurrent:null,ariaDescribedBy:Q,ariaDetails:null,ariaDisabled:X,ariaDropEffect:Q,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:Q,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Q,ariaLevel:I,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:Q,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:Q,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:X,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Cr(e,n){return n in e?e[n]:n}function Er(e,n){return Cr(e,n.toLowerCase())}const xl=Be({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:Q,accessKey:Q,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:Q,autoFocus:j,autoPlay:j,blocking:Q,capture:null,charSet:null,checked:j,cite:null,className:Q,cols:I,colSpan:null,content:null,contentEditable:X,controls:j,controlsList:Q,coords:I|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:Ot,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:Q,height:I,hidden:Ot,high:I,href:null,hrefLang:null,htmlFor:Q,httpEquiv:Q,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:Q,itemRef:Q,itemScope:j,itemType:Q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,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:j,optimum:I,pattern:null,ping:Q,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:Q,required:j,reversed:j,rows:I,rowSpan:I,sandbox:Q,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:X,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Q,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:j,disableRemotePlayback:j,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:Er}),yl=Be({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:le,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:Q,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,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:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:le,rev:le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:le,requiredFeatures:le,requiredFonts:le,requiredFormats:le,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:le,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Cr}),Ir=Be({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),vr=Be({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Er}),Ar=Be({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),kl={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"},bl=/[A-Z]/g,In=/-[a-z]/g,wl=/^data[-\w.:]+$/i;function Sl(e,n){const t=jt(n);let r=n,i=re;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&wl.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(In,El);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!In.test(o)){let l=o.replace(bl,Cl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Xt}return new i(r,n)}function Cl(e){return"-"+e.toLowerCase()}function El(e){return e.charAt(1).toUpperCase()}const Il=wr([Sr,xl,Ir,vr,Ar],"html"),Yt=wr([Sr,yl,Ir,vr,Ar],"svg");function vl(e){return e.join(" ").trim()}var Re={},bt,vn;function Al(){if(vn)return bt;vn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
2
+ `,s="/",f="*",c="",p="comment",h="declaration";function g(C,x){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];x=x||{};var v=1,E=1;function R(z){var T=z.match(n);T&&(v+=T.length);var H=z.lastIndexOf(u);E=~H?z.length-H:E+z.length}function F(){var z={line:v,column:E};return function(T){return T.position=new k(z),B(),T}}function k(z){this.start=z,this.end={line:v,column:E},this.source=x.source}k.prototype.content=C;function O(z){var T=new Error(x.source+":"+v+":"+E+": "+z);if(T.reason=z,T.filename=x.source,T.line=v,T.column=E,T.source=C,!x.silent)throw T}function V(z){var T=z.exec(C);if(T){var H=T[0];return R(H),C=C.slice(H.length),T}}function B(){V(t)}function y(z){var T;for(z=z||[];T=D();)T!==!1&&z.push(T);return z}function D(){var z=F();if(!(s!=C.charAt(0)||f!=C.charAt(1))){for(var T=2;c!=C.charAt(T)&&(f!=C.charAt(T)||s!=C.charAt(T+1));)++T;if(T+=2,c===C.charAt(T-1))return O("End of comment missing");var H=C.slice(2,T-2);return E+=2,R(H),C=C.slice(T),E+=2,z({type:p,comment:H})}}function L(){var z=F(),T=V(r);if(T){if(D(),!V(i))return O("property missing ':'");var H=V(o),Y=z({type:h,property:w(T[0].replace(e,c)),value:H?w(H[0].replace(e,c)):c});return V(l),Y}}function P(){var z=[];y(z);for(var T;T=L();)T!==!1&&(z.push(T),y(z));return z}return B(),P()}function w(C){return C?C.replace(a,c):c}return bt=g,bt}var An;function Tl(){if(An)return Re;An=1;var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=t;const n=e(Al());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return Re}var Ve={},Tn;function Pl(){if(Tn)return Ve;Tn=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||t.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,l))};return Ve.camelCase=u,Ve}var We,Pn;function Dl(){if(Pn)return We;Pn=1;var e=We&&We.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Tl()),t=Pl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(l[(0,t.camelCase)(a,o)]=u)}),l}return r.default=r,We=r,We}var Ll=Dl();const zl=xr(Ll),Tr=Pr("end"),Gt=Pr("start");function Pr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Dr(e){const n=Gt(e),t=Tr(e);if(n&&t)return{start:n,end:t}}function Xe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dn(e.position):"start"in e||"end"in e?Dn(e):"line"in e||"column"in e?Bt(e):""}function Bt(e){return Ln(e&&e.line)+":"+Ln(e&&e.column)}function Dn(e){return Bt(e&&e.start)+"-"+Bt(e&&e.end)}function Ln(e){return e&&typeof e=="number"?e:1}class ee extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Xe(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ee.prototype.file="";ee.prototype.name="";ee.prototype.reason="";ee.prototype.message="";ee.prototype.stack="";ee.prototype.column=void 0;ee.prototype.line=void 0;ee.prototype.ancestors=void 0;ee.prototype.cause=void 0;ee.prototype.fatal=void 0;ee.prototype.place=void 0;ee.prototype.ruleId=void 0;ee.prototype.source=void 0;const Jt={}.hasOwnProperty,Nl=new Map,Fl=/[A-Z]/g,Rl=new Set(["table","tbody","thead","tfoot","tr"]),_l=new Set(["td","th"]),Lr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jl(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Vl(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$l(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Yt:Il,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=zr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function zr(e,n,t){if(n.type==="element")return Ol(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ml(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Hl(e,n,t);if(n.type==="mdxjsEsm")return Bl(e,n);if(n.type==="root")return Ul(e,n,t);if(n.type==="text")return ql(e,n)}function Ol(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yt,e.schema=i),e.ancestors.push(n);const o=Fr(e,n.tagName,!1),l=Wl(e,n);let a=en(e,n);return Rl.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!dl(u):!0})),Nr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Ml(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Je(e,n.position)}function Bl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Je(e,n.position)}function Hl(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Yt,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Fr(e,n.name,!0),l=Kl(e,n),a=en(e,n);return Nr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Ul(e,n,t){const r={};return Zt(r,en(e,n)),e.create(n,e.Fragment,r,t)}function ql(e,n){return n.value}function Nr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Zt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function $l(e,n,t){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?t:n;return a?s(o,l,a):s(o,l)}}function Vl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),u=Gt(r);return n(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Wl(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Jt.call(n.properties,i)){const o=Ql(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&_l.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Kl(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Je(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Je(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function en(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Nl;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=zr(e,o,l);a!==void 0&&t.push(a)}return t}function Ql(e,n,t){const r=Sl(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?cl(t):vl(t)),r.property==="style"){let i=typeof t=="object"?t:Xl(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Yl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?kl[r.property]||r.property:r.attribute,t]}}function Xl(e,n){try{return zl(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ee("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Lr+"#cannot-parse-style-attribute",i}}function Fr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=Sn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Sn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Jt.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Je(e)}function Je(e,n){const t=new ee("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Lr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Yl(e){const n={};let t;for(t in e)Jt.call(e,t)&&(n[Gl(t)]=e[t]);return n}function Gl(e){let n=e.replace(Fl,Jl);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Jl(e){return"-"+e.toLowerCase()}const wt={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"]},Zl={};function tn(e,n){const t=Zl,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Rr(e,r,i)}function Rr(e,n,t){if(eo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zn(e.children,n,t)}return Array.isArray(e)?zn(e,n,t):""}function zn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Rr(e[i],n,t);return r.join("")}function eo(e){return!!(e&&typeof e=="object")}const Nn=document.createElement("i");function nn(e){const n="&"+e+";";Nn.innerHTML=n;const t=Nn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function oe(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function ae(e,n){return e.length>0?(oe(e,e.length,0,n),e):n}const Fn={}.hasOwnProperty;function _r(e){const n={};let t=-1;for(;++t<e.length;)to(n,e[t]);return n}function to(e,n){let t;for(t in n){const i=(Fn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){Fn.call(i,l)||(i[l]=[]);const a=o[l];no(i[l],Array.isArray(a)?a:a?[a]:[])}}}function no(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);oe(e,0,0,r)}function jr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const te=Ee(/[A-Za-z]/),Z=Ee(/[\dA-Za-z]/),ro=Ee(/[#-'*+\--9=?A-Z^-~]/);function ft(e){return e!==null&&(e<32||e===127)}const Ht=Ee(/\d/),io=Ee(/[\dA-Fa-f]/),lo=Ee(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function K(e){return e!==null&&(e<0||e===32)}function M(e){return e===-2||e===-1||e===32}const mt=Ee(new RegExp("\\p{P}|\\p{S}","u")),Pe=Ee(/\s/);function Ee(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function He(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&Z(e.charCodeAt(t+1))&&Z(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function $(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return M(u)?(e.enter(t),a(u)):n(u)}function a(u){return M(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}const oo={tokenize:ao};function ao(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),$(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const so={tokenize:uo},Rn={tokenize:co};function uo(e){const n=this,t=[];let r=0,i,o,l;return a;function a(E){if(r<t.length){const R=t[r];return n.containerState=R[1],e.attempt(R[0].continuation,u,s)(E)}return s(E)}function u(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const R=n.events.length;let F=R,k;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){k=n.events[F][1].end;break}x(r);let O=R;for(;O<n.events.length;)n.events[O][1].end={...k},O++;return oe(n.events,F+1,0,n.events.slice(R)),n.events.length=O,s(E)}return a(E)}function s(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Rn,f,c)(E)}function f(E){return i&&v(),x(r),p(E)}function c(E){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(E)}function p(E){return n.containerState={},e.attempt(Rn,h,g)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function g(E){if(E===null){i&&v(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(E)}function w(E){if(E===null){C(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return N(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),w)}function C(E,R){const F=n.sliceStream(E);if(R&&F.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(F),n.parser.lazy[E.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<l&&(!i.events[k][1].end||i.events[k][1].end.offset>l))return;const O=n.events.length;let V=O,B,y;for(;V--;)if(n.events[V][0]==="exit"&&n.events[V][1].type==="chunkFlow"){if(B){y=n.events[V][1].end;break}B=!0}for(x(r),k=O;k<n.events.length;)n.events[k][1].end={...y},k++;oe(n.events,V+1,0,n.events.slice(O)),n.events.length=k}}function x(E){let R=t.length;for(;R-- >E;){const F=t[R];n.containerState=F[1],F[0].exit.call(n,e)}t.length=E}function v(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function co(e,n,t){return $(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Me(e){if(e===null||K(e)||Pe(e))return 1;if(mt(e))return 2}function dt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const Ut={name:"attention",resolveAll:fo,tokenize:ho};function fo(e,n){let t=-1,r,i,o,l,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};_n(c,-u),_n(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ae(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=ae(s,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),s=ae(s,dt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ae(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=ae(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,oe(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ho(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Me(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Me(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),n(u)}}function _n(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const po={name:"autolink",tokenize:mo};function mo(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return te(h)?(e.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||Z(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||Z(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||ft(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):ro(h)?(e.consume(h),s):t(h)}function f(h){return Z(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||Z(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const nt={partial:!0,tokenize:go};function go(e,n,t){return r;function r(o){return M(o)?$(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||N(o)?n(o):t(o)}}const Or={continuation:{tokenize:yo},exit:ko,name:"blockQuote",tokenize:xo};function xo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return M(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function yo(e,n,t){const r=this;return i;function i(l){return M(l)?$(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Or,n,t)(l)}}function ko(e){e.exit("blockQuote")}const Mr={name:"characterEscape",tokenize:bo};function bo(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return lo(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const Br={name:"characterReference",tokenize:wo};function wo(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=Z,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=io,f):(e.enter("characterReferenceValue"),o=7,l=Ht,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===Z&&!nn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const jn={partial:!0,tokenize:Co},On={concrete:!0,name:"codeFenced",tokenize:So};function So(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return u;function u(k){return s(k)}function s(k){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===a?(l++,e.consume(k),f):l<3?t(k):(e.exit("codeFencedFenceSequence"),M(k)?$(e,c,"whitespace")(k):c(k))}function c(k){return k===null||N(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(jn,w,R)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||N(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(k)):M(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$(e,h,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),p)}function h(k){return k===null||N(k)?c(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||N(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(k)):k===96&&k===a?t(k):(e.consume(k),g)}function w(k){return e.attempt(i,R,C)(k)}function C(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return o>0&&M(k)?$(e,v,"linePrefix",o+1)(k):v(k)}function v(k){return k===null||N(k)?e.check(jn,w,R)(k):(e.enter("codeFlowValue"),E(k))}function E(k){return k===null||N(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),E)}function R(k){return e.exit("codeFenced"),n(k)}function F(k,O,V){let B=0;return y;function y(T){return k.enter("lineEnding"),k.consume(T),k.exit("lineEnding"),D}function D(T){return k.enter("codeFencedFence"),M(T)?$(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):L(T)}function L(T){return T===a?(k.enter("codeFencedFenceSequence"),P(T)):V(T)}function P(T){return T===a?(B++,k.consume(T),P):B>=l?(k.exit("codeFencedFenceSequence"),M(T)?$(k,z,"whitespace")(T):z(T)):V(T)}function z(T){return T===null||N(T)?(k.exit("codeFencedFence"),O(T)):V(T)}}}function Co(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const St={name:"codeIndented",tokenize:Io},Eo={partial:!0,tokenize:vo};function Io(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),$(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?u(s):N(s)?e.attempt(Eo,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||N(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function vo(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):$(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):N(l)?i(l):t(l)}}const Ao={name:"codeText",previous:Po,resolve:To,tokenize:Do};function To(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function Po(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Do(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):N(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||N(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Lo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ke(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ke(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ke(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Ke(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ke(this.left,t.reverse())}}}function Ke(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Hr(e){const n={};let t=-1,r,i,o,l,a,u,s;const f=new Lo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,zo(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return oe(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function zo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=t,g=0,w=0;const C=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,C.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const x=a.slice(C[p],C[p+1]),v=o.pop();u.push([v,v+x.length-1]),e.splice(v,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const No={resolve:Ro,tokenize:_o},Fo={partial:!0,tokenize:jo};function Ro(e){return Hr(e),e}function _o(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):N(a)?e.check(Fo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function jo(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),$(e,o,"linePrefix")}function o(l){if(l===null||N(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Ur(e,n,t,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||ft(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||N(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function w(x){return!f&&(x===null||x===41||K(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<s&&x===40?(e.consume(x),f++,w):x===41?(e.consume(x),f--,w):x===null||x===32||x===40||ft(x)?t(x):(e.consume(x),x===92?C:w)}function C(x){return x===40||x===41||x===92?(e.consume(x),w):w(x)}}function qr(e,n,t,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):N(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||N(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!M(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function $r(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):t(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?t(p):N(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),$(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||N(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ye(e,n){let t;return r;function r(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):M(i)?$(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Oo={name:"definition",tokenize:Bo},Mo={partial:!0,tokenize:Ho};function Bo(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return qr.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return K(h)?Ye(e,s)(h):s(h)}function s(h){return Ur(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Mo,c,c)(h)}function c(h){return M(h)?$(e,p,"whitespace")(h):p(h)}function p(h){return h===null||N(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Ho(e,n,t){return r;function r(a){return K(a)?Ye(e,i)(a):t(a)}function i(a){return $r(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return M(a)?$(e,l,"whitespace")(a):l(a)}function l(a){return a===null||N(a)?n(a):t(a)}}const Uo={name:"hardBreakEscape",tokenize:qo};function qo(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return N(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const $o={name:"headingAtx",resolve:Vo,tokenize:Wo};function Vo(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},oe(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function Wo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||K(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||N(f)?(e.exit("atxHeading"),n(f)):M(f)?$(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||K(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Ko=["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"],Mn=["pre","script","style","textarea"],Qo={concrete:!0,name:"htmlFlow",resolveTo:Go,tokenize:Jo},Xo={partial:!0,tokenize:ea},Yo={partial:!0,tokenize:Zo};function Go(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Jo(e,n,t){const r=this;let i,o,l,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?n:m):te(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):te(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ce="CDATA[";return d===ce.charCodeAt(a++)?(e.consume(d),a===ce.length?r.interrupt?n:L:g):t(d)}function w(d){return te(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function C(d){if(d===null||d===47||d===62||K(d)){const ce=d===47,Ie=l.toLowerCase();return!ce&&!o&&Mn.includes(Ie)?(i=1,r.interrupt?n(d):L(d)):Ko.includes(l.toLowerCase())?(i=6,ce?(e.consume(d),x):r.interrupt?n(d):L(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?v(d):E(d))}return d===45||Z(d)?(e.consume(d),l+=String.fromCharCode(d),C):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:L):t(d)}function v(d){return M(d)?(e.consume(d),v):y(d)}function E(d){return d===47?(e.consume(d),y):d===58||d===95||te(d)?(e.consume(d),R):M(d)?(e.consume(d),E):y(d)}function R(d){return d===45||d===46||d===58||d===95||Z(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),k):M(d)?(e.consume(d),F):E(d)}function k(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,O):M(d)?(e.consume(d),k):V(d)}function O(d){return d===u?(e.consume(d),u=null,B):d===null||N(d)?t(d):(e.consume(d),O)}function V(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||K(d)?F(d):(e.consume(d),V)}function B(d){return d===47||d===62||M(d)?E(d):t(d)}function y(d){return d===62?(e.consume(d),D):t(d)}function D(d){return d===null||N(d)?L(d):M(d)?(e.consume(d),D):t(d)}function L(d){return d===45&&i===2?(e.consume(d),H):d===60&&i===1?(e.consume(d),Y):d===62&&i===4?(e.consume(d),ue):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ge):N(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Xo,xe,P)(d)):d===null||N(d)?(e.exit("htmlFlowData"),P(d)):(e.consume(d),L)}function P(d){return e.check(Yo,z,xe)(d)}function z(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||N(d)?P(d):(e.enter("htmlFlowData"),L(d))}function H(d){return d===45?(e.consume(d),m):L(d)}function Y(d){return d===47?(e.consume(d),l="",se):L(d)}function se(d){if(d===62){const ce=l.toLowerCase();return Mn.includes(ce)?(e.consume(d),ue):L(d)}return te(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):L(d)}function ge(d){return d===93?(e.consume(d),m):L(d)}function m(d){return d===62?(e.consume(d),ue):d===45&&i===2?(e.consume(d),m):L(d)}function ue(d){return d===null||N(d)?(e.exit("htmlFlowData"),xe(d)):(e.consume(d),ue)}function xe(d){return e.exit("htmlFlow"),n(d)}}function Zo(e,n,t){const r=this;return i;function i(l){return N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function ea(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nt,n,t)}}const ta={name:"htmlText",tokenize:na};function na(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),E):te(m)?(e.consume(m),V):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):te(m)?(e.consume(m),v):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):N(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?H(m):m===45?p(m):c(m)}function g(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?w:g):t(m)}function w(m){return m===null?t(m):m===93?(e.consume(m),C):N(m)?(l=w,Y(m)):(e.consume(m),w)}function C(m){return m===93?(e.consume(m),x):w(m)}function x(m){return m===62?H(m):m===93?(e.consume(m),x):w(m)}function v(m){return m===null||m===62?H(m):N(m)?(l=v,Y(m)):(e.consume(m),v)}function E(m){return m===null?t(m):m===63?(e.consume(m),R):N(m)?(l=E,Y(m)):(e.consume(m),E)}function R(m){return m===62?H(m):E(m)}function F(m){return te(m)?(e.consume(m),k):t(m)}function k(m){return m===45||Z(m)?(e.consume(m),k):O(m)}function O(m){return N(m)?(l=O,Y(m)):M(m)?(e.consume(m),O):H(m)}function V(m){return m===45||Z(m)?(e.consume(m),V):m===47||m===62||K(m)?B(m):t(m)}function B(m){return m===47?(e.consume(m),H):m===58||m===95||te(m)?(e.consume(m),y):N(m)?(l=B,Y(m)):M(m)?(e.consume(m),B):H(m)}function y(m){return m===45||m===46||m===58||m===95||Z(m)?(e.consume(m),y):D(m)}function D(m){return m===61?(e.consume(m),L):N(m)?(l=D,Y(m)):M(m)?(e.consume(m),D):B(m)}function L(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,P):N(m)?(l=L,Y(m)):M(m)?(e.consume(m),L):(e.consume(m),z)}function P(m){return m===i?(e.consume(m),i=void 0,T):m===null?t(m):N(m)?(l=P,Y(m)):(e.consume(m),P)}function z(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||K(m)?B(m):(e.consume(m),z)}function T(m){return m===47||m===62||K(m)?B(m):t(m)}function H(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return M(m)?$(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ge(m)}function ge(m){return e.enter("htmlTextData"),l(m)}}const rn={name:"labelEnd",resolveAll:oa,resolveTo:aa,tokenize:sa},ra={tokenize:ua},ia={tokenize:ca},la={tokenize:fa};function oa(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&oe(e,0,e.length,t),e}function aa(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=ae(a,e.slice(o+1,o+r+3)),a=ae(a,[["enter",f,n]]),a=ae(a,dt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=ae(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=ae(a,e.slice(l+1)),a=ae(a,[["exit",u,n]]),oe(e,o,e.length,a),e}function sa(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(pe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(ra,f,l?f:c)(p):p===91?e.attempt(ia,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(la,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function ua(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return K(c)?Ye(e,o)(c):o(c)}function o(c){return c===41?f(c):Ur(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return K(c)?Ye(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?$r(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return K(c)?Ye(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function ca(e,n,t){const r=this;return i;function i(a){return qr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function fa(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ha={name:"labelStartImage",resolveAll:rn.resolveAll,tokenize:pa};function pa(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const ma={name:"labelStartLink",resolveAll:rn.resolveAll,tokenize:da};function da(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Ct={name:"lineEnding",tokenize:ga};function ga(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$(e,n,"linePrefix")}}const ct={name:"thematicBreak",tokenize:xa};function xa(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||N(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),M(s)?$(e,a,"whitespace")(s):a(s))}}const ne={continuation:{tokenize:wa},exit:Ca,name:"list",tokenize:ba},ya={partial:!0,tokenize:Ea},ka={partial:!0,tokenize:Sa};function ba(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ht(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(ct,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return Ht(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(nt,r.interrupt?t:f,e.attempt(ya,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return M(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function wa(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(nt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!M(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ka,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(ne,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Sa(e,n,t){const r=this;return $(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Ca(e){e.exit(this.containerState.type)}function Ea(e,n,t){const r=this;return $(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!M(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const Bn={name:"setextUnderline",resolveTo:Ia,tokenize:va};function Ia(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function va(e,n,t){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),M(s)?$(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||N(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const Aa={tokenize:Ta};function Ta(e){const n=this,t=e.attempt(nt,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(No,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Pa={resolveAll:Wr()},Da=Vr("string"),La=Vr("text");function Vr(e){return{resolveAll:Wr(e==="text"?za:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Wr(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function za(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Na={42:ne,43:ne,45:ne,48:ne,49:ne,50:ne,51:ne,52:ne,53:ne,54:ne,55:ne,56:ne,57:ne,62:Or},Fa={91:Oo},Ra={[-2]:St,[-1]:St,32:St},_a={35:$o,42:ct,45:[Bn,ct],60:Qo,61:Bn,95:ct,96:On,126:On},ja={38:Br,92:Mr},Oa={[-5]:Ct,[-4]:Ct,[-3]:Ct,33:ha,38:Br,42:Ut,60:[po,ta],91:ma,92:[Uo,Mr],93:rn,95:Ut,96:Ao},Ma={null:[Ut,Pa]},Ba={null:[42,95]},Ha={null:[]},Ua=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ba,contentInitial:Fa,disable:Ha,document:Na,flow:_a,flowInitial:Ra,insideSpan:Ma,string:ja,text:Oa},Symbol.toStringTag,{value:"Module"}));function qa(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:O(F),check:O(k),consume:v,enter:E,exit:R,interrupt:O(k,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(D){return l=ae(l,D),C(),l[l.length-1]!==null?[]:(V(n,0),s.events=dt(o,s.events,s),s.events)}function p(D,L){return Va(h(D),L)}function h(D){return $a(l,D)}function g(){const{_bufferIndex:D,_index:L,line:P,column:z,offset:T}=r;return{_bufferIndex:D,_index:L,line:P,column:z,offset:T}}function w(D){i[D.line]=D.column,y()}function C(){let D;for(;r._index<l.length;){const L=l[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(D){f=f(D)}function v(D){N(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,y()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=D}function E(D,L){const P=L||{};return P.type=D,P.start=g(),s.events.push(["enter",P,s]),a.push(P),P}function R(D){const L=a.pop();return L.end=g(),s.events.push(["exit",L,s]),L}function F(D,L){V(D,L.from)}function k(D,L){L.restore()}function O(D,L){return P;function P(z,T,H){let Y,se,ge,m;return Array.isArray(z)?xe(z):"tokenize"in z?xe([z]):ue(z);function ue(G){return Ue;function Ue(we){const Le=we!==null&&G[we],ze=we!==null&&G.null,lt=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(ze)?ze:ze?[ze]:[]];return xe(lt)(we)}}function xe(G){return Y=G,se=0,G.length===0?H:d(G[se])}function d(G){return Ue;function Ue(we){return m=B(),ge=G,G.partial||(s.currentConstruct=G),G.name&&s.parser.constructs.disable.null.includes(G.name)?Ie():G.tokenize.call(L?Object.assign(Object.create(s),L):s,u,ce,Ie)(we)}}function ce(G){return D(ge,m),T}function Ie(G){return m.restore(),++se<Y.length?d(Y[se]):H}}}function V(D,L){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&oe(s.events,L,s.events.length-L,D.resolve(s.events.slice(L),s)),D.resolveTo&&(s.events=D.resolveTo(s.events,s))}function B(){const D=g(),L=s.previous,P=s.currentConstruct,z=s.events.length,T=Array.from(a);return{from:z,restore:H};function H(){r=D,s.previous=L,s.currentConstruct=P,s.events.length=z,a=T,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $a(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Va(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
3
+ `;break}case-3:{l=`\r
4
+ `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Wa(e){const r={constructs:_r([Ua,...(e||{}).extensions||[]]),content:i(oo),defined:[],document:i(so),flow:i(Aa),lazy:{},string:i(Da),text:i(La)};return r;function i(o){return l;function l(a){return qa(r,o,a)}}}function Ka(e){for(;!Hr(e););return e}const Hn=/[\0\t\n\r]/g;function Qa(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(Hn.lastIndex=c,s=Hn.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){n=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const Xa=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ya(e){return e.replace(Xa,Ga)}function Ga(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return jr(t.slice(o?2:1),o?16:10)}return nn(t)||e}const Kr={}.hasOwnProperty;function Ja(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Za(t)(Ka(Wa(t).document().write(Qa()(e,n,!0))))}function Za(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(xn),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(mn),blockQuote:o(ze),characterEscape:B,characterReference:B,codeFenced:o(lt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(lt,l),codeText:o(Pi,l),codeTextData:B,data:B,codeFlowValue:B,definition:o(Di),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Li),hardBreakEscape:o(dn),hardBreakTrailing:o(dn),htmlFlow:o(gn,l),htmlFlowData:B,htmlText:o(gn,l),htmlTextData:B,image:o(zi),label:l,link:o(xn),listItem:o(Ni),listItemValue:p,listOrdered:o(yn,c),listUnordered:o(yn),paragraph:o(Fi),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(mn),strong:o(Ri),thematicBreak:o(ji)},exit:{atxHeading:u(),atxHeadingSequence:F,autolink:u(),autolinkEmail:Le,autolinkProtocol:we,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:G,characterReference:Ue,codeFenced:u(C),codeFencedFence:w,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:u(x),codeText:u(T),codeTextData:y,data:y,definition:u(),definitionDestinationString:R,definitionLabelString:v,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(P),htmlFlowData:y,htmlText:u(z),htmlTextData:y,image:u(Y),label:ge,labelText:se,lineEnding:D,link:u(H),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:m,resourceTitleString:ue,resource:xe,setextHeading:u(V),setextHeadingLineSequence:O,setextHeadingText:k,strong:u(),thematicBreak:u()}};Qr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(b){let A={type:"root",children:[]};const _={stack:[A],tokenStack:[],config:n,enter:a,exit:s,buffer:l,resume:f,data:t},U=[];let W=-1;for(;++W<b.length;)if(b[W][1].type==="listOrdered"||b[W][1].type==="listUnordered")if(b[W][0]==="enter")U.push(W);else{const fe=U.pop();W=i(b,fe,W)}for(W=-1;++W<b.length;){const fe=n[b[W][0]];Kr.call(fe,b[W][1].type)&&fe[b[W][1].type].call(Object.assign({sliceSerialize:b[W][2].sliceSerialize},_),b[W][1])}if(_.tokenStack.length>0){const fe=_.tokenStack[_.tokenStack.length-1];(fe[1]||Un).call(_,void 0,fe[0])}for(A.position={start:Se(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:Se(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},W=-1;++W<n.transforms.length;)A=n.transforms[W](A)||A;return A}function i(b,A,_){let U=A-1,W=-1,fe=!1,ve,ye,qe,$e;for(;++U<=_;){const ie=b[U];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ie[0]==="enter"?W++:W--,$e=void 0;break}case"lineEndingBlank":{ie[0]==="enter"&&(ve&&!$e&&!W&&!qe&&(qe=U),$e=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$e=void 0}if(!W&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||W===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(ve){let Ne=U;for(ye=void 0;Ne--;){const ke=b[Ne];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;ye&&(b[ye][1].type="lineEndingBlank",fe=!0),ke[1].type="lineEnding",ye=Ne}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}qe&&(!ye||qe<ye)&&(ve._spread=!0),ve.end=Object.assign({},ye?b[ye][1].start:ie[1].end),b.splice(ye||U,0,["exit",ve,ie[2]]),U++,_++}if(ie[1].type==="listItemPrefix"){const Ne={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};ve=Ne,b.splice(U,0,["enter",Ne,ie[2]]),U++,_++,qe=void 0,$e=!0}}}return b[A][1]._spread=fe,_}function o(b,A){return _;function _(U){a.call(this,b(U),U),A&&A.call(this,U)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(b,A,_){this.stack[this.stack.length-1].children.push(b),this.stack.push(b),this.tokenStack.push([A,_||void 0]),b.position={start:Se(A.start),end:void 0}}function u(b){return A;function A(_){b&&b.call(this,_),s.call(this,_)}}function s(b,A){const _=this.stack.pop(),U=this.tokenStack.pop();if(U)U[0].type!==b.type&&(A?A.call(this,b,U[0]):(U[1]||Un).call(this,b,U[0]));else throw new Error("Cannot close `"+b.type+"` ("+Xe({start:b.start,end:b.end})+"): it’s not open");_.position.end=Se(b.end)}function f(){return tn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(b){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(b),10),this.data.expectingFirstListItemValue=void 0}}function h(){const b=this.resume(),A=this.stack[this.stack.length-1];A.lang=b}function g(){const b=this.resume(),A=this.stack[this.stack.length-1];A.meta=b}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b.replace(/(\r?\n|\r)$/g,"")}function v(b){const A=this.resume(),_=this.stack[this.stack.length-1];_.label=A,_.identifier=pe(this.sliceSerialize(b)).toLowerCase()}function E(){const b=this.resume(),A=this.stack[this.stack.length-1];A.title=b}function R(){const b=this.resume(),A=this.stack[this.stack.length-1];A.url=b}function F(b){const A=this.stack[this.stack.length-1];if(!A.depth){const _=this.sliceSerialize(b).length;A.depth=_}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function O(b){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(b).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function B(b){const _=this.stack[this.stack.length-1].children;let U=_[_.length-1];(!U||U.type!=="text")&&(U=_i(),U.position={start:Se(b.start),end:void 0},_.push(U)),this.stack.push(U)}function y(b){const A=this.stack.pop();A.value+=this.sliceSerialize(b),A.position.end=Se(b.end)}function D(b){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _=A.children[A.children.length-1];_.position.end=Se(b.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(A.type)&&(B.call(this,b),y.call(this,b))}function L(){this.data.atHardBreak=!0}function P(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function z(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function T(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function H(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=A,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function Y(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=A,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function se(b){const A=this.sliceSerialize(b),_=this.stack[this.stack.length-2];_.label=Ya(A),_.identifier=pe(A).toLowerCase()}function ge(){const b=this.stack[this.stack.length-1],A=this.resume(),_=this.stack[this.stack.length-1];if(this.data.inReference=!0,_.type==="link"){const U=b.children;_.children=U}else _.alt=A}function m(){const b=this.resume(),A=this.stack[this.stack.length-1];A.url=b}function ue(){const b=this.resume(),A=this.stack[this.stack.length-1];A.title=b}function xe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ce(b){const A=this.resume(),_=this.stack[this.stack.length-1];_.label=A,_.identifier=pe(this.sliceSerialize(b)).toLowerCase(),this.data.referenceType="full"}function Ie(b){this.data.characterReferenceType=b.type}function G(b){const A=this.sliceSerialize(b),_=this.data.characterReferenceType;let U;_?(U=jr(A,_==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):U=nn(A);const W=this.stack[this.stack.length-1];W.value+=U}function Ue(b){const A=this.stack.pop();A.position.end=Se(b.end)}function we(b){y.call(this,b);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(b)}function Le(b){y.call(this,b);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(b)}function ze(){return{type:"blockquote",children:[]}}function lt(){return{type:"code",lang:null,meta:null,value:""}}function Pi(){return{type:"inlineCode",value:""}}function Di(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Li(){return{type:"emphasis",children:[]}}function mn(){return{type:"heading",depth:0,children:[]}}function dn(){return{type:"break"}}function gn(){return{type:"html",value:""}}function zi(){return{type:"image",title:null,url:"",alt:null}}function xn(){return{type:"link",title:null,url:"",children:[]}}function yn(b){return{type:"list",ordered:b.type==="listOrdered",start:null,spread:b._spread,children:[]}}function Ni(b){return{type:"listItem",spread:b._spread,checked:null,children:[]}}function Fi(){return{type:"paragraph",children:[]}}function Ri(){return{type:"strong",children:[]}}function _i(){return{type:"text",value:""}}function ji(){return{type:"thematicBreak"}}}function Se(e){return{line:e.line,column:e.column,offset:e.offset}}function Qr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Qr(e,r):es(e,r)}}function es(e,n){let t;for(t in n)if(Kr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Un(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Xe({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Xe({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Xe({start:n.start,end:n.end})+") is still open")}function ts(e){const n=this;n.parser=t;function t(r){return Ja(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function ns(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function rs(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
+ `}]}function is(e,n){const t=n.value?n.value+`
6
+ `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function ls(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function os(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function as(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=He(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)}function ss(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function us(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Xr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function cs(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Xr(e,n);const i={src:He(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function fs(e,n){const t={src:He(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function hs(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function ps(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Xr(e,n);const i={href:He(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function ms(e,n){const t={href:He(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ds(e,n,t){const r=e.all(n),i=t?gs(t):Yr(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
7
+ `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
8
+ `});const s={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,s),e.applyData(n,s)}function gs(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=Yr(t[r])}return n}function Yr(e){const n=e.spread;return n??e.children.length>1}function xs(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function ys(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ks(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function bs(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ws(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Gt(n.children[1]),u=Tr(n.children[n.children.length-1]);a&&u&&(l.position={start:a,end:u}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function Ss(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let u=-1;const s=[];for(;++u<a;){const c=n.children[u],p={},h=l?l[u]:void 0;h&&(p.align=h);let g={type:"element",tagName:o,properties:p,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),s.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,f),e.applyData(n,f)}function Cs(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const qn=9,$n=32;function Es(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(Vn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(Vn(n.slice(i),i>0,!1)),o.join("")}function Vn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===qn||o===$n;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===qn||o===$n;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Is(e,n){const t={type:"text",value:Es(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function vs(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const As={blockquote:ns,break:rs,code:is,delete:ls,emphasis:os,footnoteReference:as,heading:ss,html:us,imageReference:cs,image:fs,inlineCode:hs,linkReference:ps,link:ms,listItem:ds,list:xs,paragraph:ys,root:ks,strong:bs,table:ws,tableCell:Cs,tableRow:Ss,text:Is,thematicBreak:vs,toml:ot,yaml:ot,definition:ot,footnoteDefinition:ot};function ot(){}const Gr=-1,gt=0,Ge=1,ht=2,ln=3,on=4,an=5,sn=6,Jr=7,Zr=8,Wn=typeof self=="object"?self:globalThis,Ts=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case gt:case Gr:return t(l,i);case Ge:{const a=t([],i);for(const u of l)a.push(r(u));return a}case ht:{const a=t({},i);for(const[u,s]of l)a[r(u)]=r(s);return a}case ln:return t(new Date(l),i);case on:{const{source:a,flags:u}=l;return t(new RegExp(a,u),i)}case an:{const a=t(new Map,i);for(const[u,s]of l)a.set(r(u),r(s));return a}case sn:{const a=t(new Set,i);for(const u of l)a.add(r(u));return a}case Jr:{const{name:a,message:u}=l;return t(new Wn[a](u),i)}case Zr:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Wn[o](l),i)};return r},Kn=e=>Ts(new Map,e)(0),_e="",{toString:Ps}={},{keys:Ds}=Object,Qe=e=>{const n=typeof e;if(n!=="object"||!e)return[gt,n];const t=Ps.call(e).slice(8,-1);switch(t){case"Array":return[Ge,_e];case"Object":return[ht,_e];case"Date":return[ln,_e];case"RegExp":return[on,_e];case"Map":return[an,_e];case"Set":return[sn,_e];case"DataView":return[Ge,t]}return t.includes("Array")?[Ge,t]:t.includes("Error")?[Jr,t]:[ht,t]},at=([e,n])=>e===gt&&(n==="function"||n==="symbol"),Ls=(e,n,t,r)=>{const i=(l,a)=>{const u=r.push(l)-1;return t.set(a,u),u},o=l=>{if(t.has(l))return t.get(l);let[a,u]=Qe(l);switch(a){case gt:{let f=l;switch(u){case"bigint":a=Zr,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Gr],l)}return i([a,f],l)}case Ge:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const f=[],c=i([a,f],l);for(const p of l)f.push(o(p));return c}case ht:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const p of Ds(l))(e||!at(Qe(l[p])))&&f.push([o(p),o(l[p])]);return c}case ln:return i([a,l.toISOString()],l);case on:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case an:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(at(Qe(p))||at(Qe(h))))&&f.push([o(p),o(h)]);return c}case sn:{const f=[],c=i([a,f],l);for(const p of l)(e||!at(Qe(p)))&&f.push(o(p));return c}}const{message:s}=l;return i([a,{name:u,message:s}],l)};return o},Qn=(e,{json:n,lossy:t}={})=>{const r=[];return Ls(!(n||t),!!n,new Map,r)(e),r},Ze=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Kn(Qn(e,n)):structuredClone(e):(e,n)=>Kn(Qn(e,n));function zs(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Ns(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Fs(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||zs,r=e.options.footnoteBackLabel||Ns,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[u]);if(!s)continue;const f=e.all(s),c=String(s.identifier).toUpperCase(),p=He(c.toLowerCase());let h=0;const g=[],w=e.footnoteCounts.get(c);for(;w!==void 0&&++h<=w;){g.length>0&&g.push({type:"text",value:" "});let v=typeof t=="string"?t:t(u,h);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const v=C.children[C.children.length-1];v&&v.type==="text"?v.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else f.push(...g);const x={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(s,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ze(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
10
+ `}]}}const xt=(function(e){if(e==null)return Os;if(typeof e=="function")return yt(e);if(typeof e=="object")return Array.isArray(e)?Rs(e):_s(e);if(typeof e=="string")return js(e);throw new Error("Expected function, string, or object as test")});function Rs(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=xt(e[t]);return yt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function _s(e){const n=e;return yt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function js(e){return yt(n);function n(t){return t&&t.type===e}}function yt(e){return n;function n(t,r,i){return!!(Ms(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Os(){return!0}function Ms(e){return e!==null&&typeof e=="object"&&"type"in e}const ei=[],Bs=!0,qt=!1,Hs="skip";function ti(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=xt(i),l=r?-1:1;a(e,void 0,[])();function a(u,s,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ei,g,w,C;if((!n||o(u,s,f[f.length-1]||void 0))&&(h=Us(t(u,f)),h[0]===qt))return h;if("children"in u&&u.children){const x=u;if(x.children&&h[0]!==Hs)for(w=(r?x.children.length:-1)+l,C=f.concat(x);w>-1&&w<x.children.length;){const v=x.children[w];if(g=a(v,w,C)(),g[0]===qt)return g;w=typeof g[1]=="number"?g[1]:w+l}}return h}}}function Us(e){return Array.isArray(e)?e:typeof e=="number"?[Bs,e]:e==null?ei:[e]}function un(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),ti(e,o,a,i);function a(u,s){const f=s[s.length-1],c=f?f.children.indexOf(u):void 0;return l(u,c,f)}}const $t={}.hasOwnProperty,qs={};function $s(e,n){const t=n||qs,r=new Map,i=new Map,o=new Map,l={...As,...t.handlers},a={all:s,applyData:Ws,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:u,options:t,patch:Vs,wrap:Qs};return un(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function u(f,c){const p=f.type,h=a.handlers[p];if($t.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:w,...C}=f,x=Ze(C);return x.children=a.all(f),x}return Ze(f)}return(a.options.unknownHandler||Ks)(a,f,c)}function s(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const g=a.one(p[h],f);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Xn(g.value)),!Array.isArray(g)&&g.type==="element")){const w=g.children[0];w&&w.type==="text"&&(w.value=Xn(w.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function Vs(e,n){e.position&&(n.position=Dr(e))}function Ws(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,Ze(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Ks(e,n){const t=n.data||{},r="value"in n&&!($t.call(t,"hProperties")||$t.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Qs(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
11
+ `});++r<e.length;)r&&t.push({type:"text",value:`
12
+ `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
13
+ `}),t}function Xn(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Yn(e,n){const t=$s(e,n),r=t.one(e,void 0),i=Fs(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
14
+ `},i),o}function Xs(e,n){return e&&"run"in e?async function(t,r){const i=Yn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Yn(t,{file:r,...e||n})}}function Gn(e){if(e)throw e}var Et,Jn;function Ys(){if(Jn)return Et;Jn=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},o=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),c=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!c)return!1;var p;for(p in s);return typeof p>"u"||e.call(s,p)},l=function(s,f){t&&f.name==="__proto__"?t(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return Et=function u(){var s,f,c,p,h,g,w=arguments[0],C=1,x=arguments.length,v=!1;for(typeof w=="boolean"&&(v=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<x;++C)if(s=arguments[C],s!=null)for(f in s)c=a(w,f),p=a(s,f),w!==p&&(v&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(w,{name:f,newValue:u(v,g,p)})):typeof p<"u"&&l(w,{name:f,newValue:p}));return w},Et}var Gs=Ys();const It=xr(Gs);function Vt(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Js(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?Zs(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Zs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const me={basename:eu,dirname:tu,extname:nu,join:ru,sep:"/"};function eu(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');rt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function tu(e){if(rt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function nu(e){rt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function ru(...e){let n=-1,t;for(;++n<e.length;)rt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":iu(t)}function iu(e){rt(e);const n=e.codePointAt(0)===47;let t=lu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function lu(e,n){let t="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function rt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ou={cwd:au};function au(){return"/"}function Wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function su(e){if(typeof e=="string")e=new URL(e);else if(!Wt(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return uu(e)}function uu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const vt=["history","path","basename","stem","extname","dirname"];class ni{constructor(n){let t;n?Wt(n)?t={path:n}:typeof n=="string"||cu(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":ou.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vt.length;){const o=vt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)vt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?me.basename(this.path):void 0}set basename(n){Tt(n,"basename"),At(n,"basename"),this.path=me.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?me.dirname(this.path):void 0}set dirname(n){Zn(this.basename,"dirname"),this.path=me.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?me.extname(this.path):void 0}set extname(n){if(At(n,"extname"),Zn(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=me.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Wt(n)&&(n=su(n)),Tt(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?me.basename(this.path,this.extname):void 0}set stem(n){Tt(n,"stem"),At(n,"stem"),this.path=me.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new ee(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function At(e,n){if(e&&e.includes(me.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+me.sep+"`")}function Tt(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Zn(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function cu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fu=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),hu={}.hasOwnProperty;class cn extends fu{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Js()}copy(){const n=new cn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(It(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Lt("data",this.frozen),this.namespace[n]=t,this):hu.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Lt("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=st(n),r=this.parser||this.Parser;return Pt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Pt("process",this.parser||this.Parser),Dt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=st(n),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);du(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Pt("processSync",this.parser||this.Parser),Dt("processSync",this.compiler||this.Compiler),this.process(n,i),tr("processSync","process",t),r;function i(o,l){t=!0,Gn(o),r=l}}run(n,t,r){er(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=st(t);i.run(n,u,s);function s(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),tr("runSync","run",r),i;function o(l,a){Gn(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=st(t),i=this.compiler||this.Compiler;return Dt("stringify",i),er(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Lt("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(s.plugins),s.settings&&(i.settings=It(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const w=r[p][1];Vt(w)&&Vt(h)&&(h=It(!0,w,h)),r[p]=[s,h,...g]}}}}const pu=new cn().freeze();function Pt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function er(e){if(!Vt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function st(e){return mu(e)?e:new ni(e)}function mu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function du(e){return typeof e=="string"||gu(e)}function gu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nr=[],rr={allowDangerousHtml:!0},yu=/^(https?|ircs?|mailto|xmpp)$/i,ku=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function bu(e){const n=wu(e),t=Su(e);return Cu(n.runSync(n.parse(t),t),e)}function wu(e){const n=e.rehypePlugins||nr,t=e.remarkPlugins||nr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rr}:rr;return pu().use(ts).use(t).use(Xs,r).use(n)}function Su(e){const n=e.children||"",t=new ni;return typeof n=="string"&&(t.value=n),t}function Cu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||Eu;for(const f of ku)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+xu+f.id,void 0);return un(e,s),jl(e,{Fragment:S.Fragment,components:i,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function s(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in wt)if(Object.hasOwn(wt,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],w=wt[h];(w===null||w.includes(f.tagName))&&(f.properties[h]=u(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Eu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||yu.test(e.slice(0,n))?e:""}const Ae=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ir={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ae,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ae],h2:[["className","sr-only"]],img:[...Ae,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ae,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ae],table:[...Ae],ul:[...Ae,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Ce={}.hasOwnProperty;function Iu(e,n){let t={type:"root",children:[]};const r={schema:n?{...ir,...n}:ir,stack:[]},i=ri(r,e);return i&&(Array.isArray(i)?i.length===1?t=i[0]:t.children=i:t=i),t}function ri(e,n){if(n&&typeof n=="object"){const t=n;switch(typeof t.type=="string"?t.type:""){case"comment":return vu(e,t);case"doctype":return Au(e,t);case"element":return Tu(e,t);case"root":return Pu(e,t);case"text":return Du(e,t)}}}function vu(e,n){if(e.schema.allowComments){const t=typeof n.value=="string"?n.value:"",r=t.indexOf("-->"),o={type:"comment",value:r<0?t:t.slice(0,r)};return it(o,n),o}}function Au(e,n){if(e.schema.allowDoctypes){const t={type:"doctype"};return it(t,n),t}}function Tu(e,n){const t=typeof n.tagName=="string"?n.tagName:"";e.stack.push(t);const r=ii(e,n.children),i=Lu(e,n.properties);e.stack.pop();let o=!1;if(t&&t!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(t))&&(o=!0,e.schema.ancestors&&Ce.call(e.schema.ancestors,t))){const a=e.schema.ancestors[t];let u=-1;for(o=!1;++u<a.length;)e.stack.includes(a[u])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(t)?r:void 0;const l={type:"element",tagName:t,properties:i,children:r};return it(l,n),l}function Pu(e,n){const r={type:"root",children:ii(e,n.children)};return it(r,n),r}function Du(e,n){const r={type:"text",value:typeof n.value=="string"?n.value:""};return it(r,n),r}function ii(e,n){const t=[];if(Array.isArray(n)){const r=n;let i=-1;for(;++i<r.length;){const o=ri(e,r[i]);o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}function Lu(e,n){const t=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&Ce.call(r,t)?r[t]:void 0,l=r&&Ce.call(r,"*")?r["*"]:void 0,a=n&&typeof n=="object"?n:{},u={};let s;for(s in a)if(Ce.call(a,s)){const f=a[s];let c=lr(e,or(o,s),s,f);c==null&&(c=lr(e,or(l,s),s,f)),c!=null&&(u[s]=c)}if(i&&Ce.call(i,t)){const f=i[t];for(s in f)Ce.call(f,s)&&!Ce.call(u,s)&&(u[s]=f[s])}return u}function lr(e,n,t,r){return n?Array.isArray(r)?zu(e,n,t,r):li(e,n,t,r):void 0}function zu(e,n,t,r){let i=-1;const o=[];for(;++i<r.length;){const l=li(e,n,t,r[i]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function li(e,n,t,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Nu(e,t,r)){if(typeof n=="object"&&n.length>1){let i=!1,o=0;for(;++o<n.length;){const l=n[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(t)?e.schema.clobberPrefix+r:r}}function Nu(e,n,t){const r=e.schema.protocols&&Ce.call(e.schema.protocols,n)?e.schema.protocols[n]:void 0;if(!r||r.length===0)return!0;const i=String(t),o=i.indexOf(":"),l=i.indexOf("?"),a=i.indexOf("#"),u=i.indexOf("/");if(o<0||u>-1&&o>u||l>-1&&o>l||a>-1&&o>a)return!0;let s=-1;for(;++s<r.length;){const f=r[s];if(o===f.length&&i.slice(0,f.length)===f)return!0}return!1}function it(e,n){const t=Dr(n);n.data&&(e.data=Ze(n.data)),t&&(e.position=t)}function or(e,n){let t,r=-1;if(e)for(;++r<e.length;){const i=e[r],o=typeof i=="string"?i:i[0];if(o===n)return i;o==="data*"&&(t=i)}if(n.length>4&&n.slice(0,4).toLowerCase()==="data")return t}function Fu(e){return function(n){return Iu(n,e)}}function ar(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function Ru(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _u(e,n,t){const i=xt((t||{}).ignore||[]),o=ju(n);let l=-1;for(;++l<o.length;)ti(e,"text",a);function a(s,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return u(s,f)}function u(s,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const C=c.children.indexOf(s);let x=!1,v=[];p.lastIndex=0;let E=p.exec(s.value);for(;E;){const R=E.index,F={index:E.index,input:E.input,stack:[...f,s]};let k=h(...E,F);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=R+1:(g!==R&&v.push({type:"text",value:s.value.slice(g,R)}),Array.isArray(k)?v.push(...k):k&&v.push(k),g=R+E[0].length,x=!0),!p.global)break;E=p.exec(s.value)}return x?(g<s.value.length&&v.push({type:"text",value:s.value.slice(g)}),c.children.splice(C,1,...v)):v=[s],C+v.length}}function ju(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([Ou(i[0]),Mu(i[1])])}return n}function Ou(e){return typeof e=="string"?new RegExp(Ru(e),"g"):e}function Mu(e){return typeof e=="function"?e:function(){return e}}const zt="phrasing",Nt=["autolink","link","image","label"];function Bu(){return{transforms:[Ku],enter:{literalAutolink:Uu,literalAutolinkEmail:Ft,literalAutolinkHttp:Ft,literalAutolinkWww:Ft},exit:{literalAutolink:Wu,literalAutolinkEmail:Vu,literalAutolinkHttp:qu,literalAutolinkWww:$u}}}function Hu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zt,notInConstruct:Nt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zt,notInConstruct:Nt},{character:":",before:"[ps]",after:"\\/",inConstruct:zt,notInConstruct:Nt}]}}function Uu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ft(e){this.config.enter.autolinkProtocol.call(this,e)}function qu(e){this.config.exit.autolinkProtocol.call(this,e)}function $u(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Vu(e){this.config.exit.autolinkEmail.call(this,e)}function Wu(e){this.exit(e)}function Ku(e){_u(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Xu]],{ignore:["link","linkReference"]})}function Qu(e,n,t,r,i){let o="";if(!oi(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!Yu(t)))return!1;const l=Gu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function Xu(e,n,t,r){return!oi(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Yu(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Gu(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=ar(e,"(");let o=ar(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function oi(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Pe(t)||mt(t))&&(!n||t!==47)}ai.peek=oc;function Ju(){this.buffer()}function Zu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ec(){this.buffer()}function tc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=pe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function rc(e){this.exit(e)}function ic(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=pe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function lc(e){this.exit(e)}function oc(){return"["}function ai(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function ac(){return{enter:{gfmFootnoteCallString:Ju,gfmFootnoteCall:Zu,gfmFootnoteDefinitionLabelString:ec,gfmFootnoteDefinition:tc},exit:{gfmFootnoteCallString:nc,gfmFootnoteCall:rc,gfmFootnoteDefinitionLabelString:ic,gfmFootnoteDefinition:lc}}}function sc(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:ai},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let u=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
15
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),n?si:uc))),s(),u}}function uc(e,n,t){return n===0?e:si(e,n,t)}function si(e,n,t){return(t?"":" ")+e}const cc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ui.peek=dc;function fc(){return{canContainEols:["delete"],enter:{strikethrough:pc},exit:{strikethrough:mc}}}function hc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:cc}],handlers:{delete:ui}}}function pc(e){this.enter({type:"delete",children:[]},e)}function mc(e){this.exit(e)}function ui(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function dc(){return"~"}function gc(e){return e.length}function xc(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||gc,o=[],l=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const w=[],C=[];let x=-1;for(e[f].length>s&&(s=e[f].length);++x<e[f].length;){const v=yc(e[f][x]);if(t.alignDelimiters!==!1){const E=i(v);C[x]=E,(u[x]===void 0||E>u[x])&&(u[x]=E)}w.push(v)}l[f]=w,a[f]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)o[c]=sr(r[c]);else{const w=sr(r);for(;++c<s;)o[c]=w}c=-1;const p=[],h=[];for(;++c<s;){const w=o[c];let C="",x="";w===99?(C=":",x=":"):w===108?C=":":w===114&&(x=":");let v=t.alignDelimiters===!1?1:Math.max(1,u[c]-C.length-x.length);const E=C+"-".repeat(v)+x;t.alignDelimiters!==!1&&(v=C.length+v+x.length,v>u[c]&&(u[c]=v),h[c]=v),p[c]=E}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const w=l[f],C=a[f];c=-1;const x=[];for(;++c<s;){const v=w[c]||"";let E="",R="";if(t.alignDelimiters!==!1){const F=u[c]-(C[c]||0),k=o[c];k===114?E=" ".repeat(F):k===99?F%2?(E=" ".repeat(F/2+.5),R=" ".repeat(F/2-.5)):(E=" ".repeat(F/2),R=E):R=" ".repeat(F)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(E),x.push(v),t.alignDelimiters!==!1&&x.push(R),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&x.push("|")}g.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
16
+ `)}function yc(e){return e==null?"":String(e)}function sr(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function kc(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),bc);return i(),l}function bc(e,n,t){return">"+(t?"":" ")+e}function wc(e,n){return ur(e,n.inConstruct,!0)&&!ur(e,n.notInConstruct,!1)}function ur(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function cr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
17
+ `&&wc(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
+ `}function Sc(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function Cc(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ec(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Ic(e,n,t,r){const i=Ec(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Cc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,vc);return c(),p}const a=t.createTracker(r),u=i.repeat(Math.max(Sc(o,i)+1,3)),s=t.enter("codeFenced");let f=a.move(u);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
19
+ `,encode:["`"],...a.current()})),c()}return f+=a.move(`
20
+ `),o&&(f+=a.move(o+`
21
+ `)),f+=a.move(u),s(),f}function vc(e,n,t){return(t?"":" ")+e}function fn(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Ac(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("[");return s+=u.move(t.safe(t.associationId(e),{before:s,after:"]",...u.current()})),s+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":`
22
+ `,...u.current()}))),a(),e.title&&(a=t.enter(`title${o}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),l(),s}function Tc(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function et(e){return"&#x"+e.toString(16).toUpperCase()+";"}function pt(e,n,t){const r=Me(e),i=Me(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ci.peek=Pc;function ci(e,n,t,r){const i=Tc(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let u=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=pt(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=et(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=pt(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+et(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function Pc(e,n,t){return t.options.emphasis||"*"}function Dc(e,n){let t=!1;return un(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,qt}),!!((!e.depth||e.depth<3)&&tn(e)&&(n.options.setext||t))}function Lc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(Dc(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
23
+ `,after:`
24
+ `});return c(),f(),p+`
25
+ `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
26
+ `))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");o.move(l+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
27
+ `,...o.current()});return/^[\t ]/.test(s)&&(s=et(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,t.options.closeAtx&&(s+=" "+l),u(),a(),s}fi.peek=zc;function fi(e){return e.value||""}function zc(){return"<"}hi.peek=Nc;function hi(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("![");return s+=u.move(t.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=t.enter(`title${o}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),s+=u.move(")"),l(),s}function Nc(){return"!"}pi.peek=Fc;function pi(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let u=a.move("![");const s=t.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Fc(){return"!"}mi.peek=Rc;function mi(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let u;if(l.atBreak)for(;u=a.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return i+r+i}function Rc(){return"`"}function di(e,n){const t=tn(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}gi.peek=_c;function gi(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,u;if(di(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=t.enter("link"),u=t.enter("label");let s=l.move("[");return s+=l.move(t.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(t.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(u=t.enter("destinationRaw"),s+=l.move(t.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=t.enter(`title${o}`),s+=l.move(" "+i),s+=l.move(t.safe(e.title,{before:s,after:i,...l.current()})),s+=l.move(i),u()),s+=l.move(")"),a(),s}function _c(e,n,t){return di(e,t)?"<":"["}xi.peek=jc;function xi(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let u=a.move("[");const s=t.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function jc(){return"["}function hn(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Oc(e){const n=hn(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Mc(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function yi(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Bc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?Mc(t):hn(t);const a=e.ordered?l==="."?")":".":Oc(t);let u=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),yi(t)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=a),t.bulletCurrent=l;const s=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),s}function Hc(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Uc(e,n,t,r){const i=Hc(t);let o=t.bulletCurrent||hn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const u=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),f);return u(),s;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function qc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const $c=xt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Vc(e,n,t,r){return(e.children.some(function(l){return $c(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Wc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}ki.peek=Kc;function ki(e,n,t,r){const i=Wc(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let u=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=pt(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=et(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=pt(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+et(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function Kc(e,n,t){return t.options.strong||"*"}function Qc(e,n,t,r){return t.safe(e.value,r)}function Xc(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Yc(e,n,t){const r=(yi(t)+(t.options.ruleSpaces?" ":"")).repeat(Xc(t));return t.options.ruleSpaces?r.slice(0,-1):r}const bi={blockquote:kc,break:cr,code:Ic,definition:Ac,emphasis:ci,hardBreak:cr,heading:Lc,html:fi,image:hi,imageReference:pi,inlineCode:mi,link:gi,linkReference:xi,list:Bc,listItem:Uc,paragraph:qc,root:Vc,strong:ki,text:Qc,thematicBreak:Yc};function Gc(){return{enter:{table:Jc,tableData:fr,tableHeader:fr,tableRow:ef},exit:{codeText:tf,table:Zc,tableData:Rt,tableHeader:Rt,tableRow:Rt}}}function Jc(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Zc(e){this.exit(e),this.data.inTable=void 0}function ef(e){this.enter({type:"tableRow",children:[]},e)}function Rt(e){this.exit(e)}function fr(e){this.enter({type:"tableCell",children:[]},e)}function tf(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,nf));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function nf(e,n){return n==="|"?n:e}function rf(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:u,tableRow:a}};function l(h,g,w,C){return s(f(h,w,C),h.align)}function a(h,g,w,C){const x=c(h,w,C),v=s([x]);return v.slice(0,v.indexOf(`
29
+ `))}function u(h,g,w,C){const x=w.enter("tableCell"),v=w.enter("phrasing"),E=w.containerPhrasing(h,{...C,before:o,after:o});return v(),x(),E}function s(h,g){return xc(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,w){const C=h.children;let x=-1;const v=[],E=g.enter("table");for(;++x<C.length;)v[x]=c(C[x],g,w);return E(),v}function c(h,g,w){const C=h.children;let x=-1;const v=[],E=g.enter("tableRow");for(;++x<C.length;)v[x]=u(C[x],h,g,w);return E(),v}function p(h,g,w){let C=bi.inlineCode(h,g,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function lf(){return{exit:{taskListCheckValueChecked:hr,taskListCheckValueUnchecked:hr,paragraph:af}}}function of(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:sf}}}function hr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function af(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function sf(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let u=bi.listItem(e,n,t,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+l}}function uf(){return[Bu(),ac(),fc(),Gc(),lf()]}function cf(e){return{extensions:[Hu(),sc(e),hc(),rf(e),of()]}}const ff={tokenize:xf,partial:!0},wi={tokenize:yf,partial:!0},Si={tokenize:kf,partial:!0},Ci={tokenize:bf,partial:!0},hf={tokenize:wf,partial:!0},Ei={name:"wwwAutolink",tokenize:df,previous:vi},Ii={name:"protocolAutolink",tokenize:gf,previous:Ai},be={name:"emailAutolink",tokenize:mf,previous:Ti},de={};function pf(){return{text:de}}let Te=48;for(;Te<123;)de[Te]=be,Te++,Te===58?Te=65:Te===91&&(Te=97);de[43]=be;de[45]=be;de[46]=be;de[95]=be;de[72]=[be,Ii];de[104]=[be,Ii];de[87]=[be,Ei];de[119]=[be,Ei];function mf(e,n,t){const r=this;let i,o;return l;function l(c){return!Kt(c)||!Ti.call(r,r.previous)||pn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Kt(c)?(e.consume(c),a):c===64?(e.consume(c),u):t(c)}function u(c){return c===46?e.check(hf,f,s)(c):c===45||c===95||Z(c)?(o=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&te(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function df(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!vi.call(r,r.previous)||pn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ff,e.attempt(wi,e.attempt(Si,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function gf(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Ai.call(r,r.previous)&&!pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(te(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),u}return t(c)}function u(c){return c===47?(e.consume(c),o?s:(o=!0,u)):t(c)}function s(c){return c===null||ft(c)||K(c)||Pe(c)||mt(c)?t(c):e.attempt(wi,e.attempt(Si,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function xf(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function yf(e,n,t){let r,i,o;return l;function l(s){return s===46||s===95?e.check(Ci,u,a)(s):s===null||K(s)||Pe(s)||s!==45&&mt(s)?u(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function u(s){return i||r||!o?t(s):n(s)}}function kf(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Ci,n,o)(l):l===null||K(l)||Pe(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function bf(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||K(a)||Pe(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||K(a)||Pe(a)?n(a):r(a)}function o(a){return te(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):te(a)?(e.consume(a),l):t(a)}}function wf(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return Z(o)?t(o):n(o)}}function vi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||K(e)}function Ai(e){return!te(e)}function Ti(e){return!(e===47||Kt(e))}function Kt(e){return e===43||e===45||e===46||e===95||Z(e)}function pn(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Sf={tokenize:Df,partial:!0};function Cf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Af,continuation:{tokenize:Tf},exit:Pf}},text:{91:{name:"gfmFootnoteCall",tokenize:vf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ef,resolveTo:If}}}}function Ef(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!l||!l._balanced)return t(u);const s=pe(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?t(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function If(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function vf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(o>999||c===93&&!l||c===null||c===91||K(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(pe(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return K(c)||(l=!0),o++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function Af(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||K(g))return t(g);if(g===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=pe(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return K(g)||(a=!0),l++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),$(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function Tf(e,n,t){return e.check(nt,n,e.attempt(Sf,n,t))}function Pf(e){e.exit("gfmFootnoteDefinition")}function Df(e,n,t){const r=this;return $(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function Lf(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},c={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&oe(p,p.length,0,dt(h,l.slice(s+1,u),a)),oe(p,p.length,0,[["exit",c,a],["enter",l[u][1],a],["exit",l[u][1],a],["exit",f,a]]),oe(l,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function o(l,a,u){const s=this.previous,f=this.events;let c=0;return p;function p(g){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const w=Me(s);if(g===126)return c>1?u(g):(l.consume(g),c++,h);if(c<2&&!t)return u(g);const C=l.exit("strikethroughSequenceTemporary"),x=Me(g);return C._open=!x||x===2&&!!w,C._close=!w||w===2&&!!x,a(g)}}}class zf{constructor(){this.map=[]}add(n,t,r){Nf(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function Nf(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===n){e.map[i][1]+=t,e.map[i][2].push(...r);return}i+=1}e.map.push([n,t,r])}}function Ff(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Rf(){return{flow:{null:{name:"table",tokenize:_f,resolveAll:jf}}}}function _f(e,n,t){const r=this;let i=0,o=0,l;return a;function a(y){let D=r.events.length-1;for(;D>-1;){const z=r.events[D][1].type;if(z==="lineEnding"||z==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,P=L==="tableHead"||L==="tableRow"?k:u;return P===k&&r.parser.lazy[r.now().line]?t(y):P(y)}function u(y){return e.enter("tableHead"),e.enter("tableRow"),s(y)}function s(y){return y===124||(l=!0,o+=1),f(y)}function f(y){return y===null?t(y):N(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):t(y):M(y)?$(e,f,"whitespace")(y):(o+=1,l&&(l=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||K(y)?(e.exit("data"),f(y)):(e.consume(y),y===92?p:c)}function p(y){return y===92||y===124?(e.consume(y),c):c(y)}function h(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(y):(e.enter("tableDelimiterRow"),l=!1,M(y)?$(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):g(y))}function g(y){return y===45||y===58?C(y):y===124?(l=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),w):F(y)}function w(y){return M(y)?$(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),x):y===45?(o+=1,x(y)):y===null||N(y)?R(y):F(y)}function x(y){return y===45?(e.enter("tableDelimiterFiller"),v(y)):F(y)}function v(y){return y===45?(e.consume(y),v):y===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(y))}function E(y){return M(y)?$(e,R,"whitespace")(y):R(y)}function R(y){return y===124?g(y):y===null||N(y)?!l||i!==o?F(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(y)):F(y)}function F(y){return t(y)}function k(y){return e.enter("tableRow"),O(y)}function O(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),O):y===null||N(y)?(e.exit("tableRow"),n(y)):M(y)?$(e,O,"whitespace")(y):(e.enter("data"),V(y))}function V(y){return y===null||y===124||K(y)?(e.exit("data"),O(y)):(e.consume(y),y===92?B:V)}function B(y){return y===92||y===124?(e.consume(y),V):V(y)}}function jf(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,u=0,s,f,c;const p=new zf;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,u!==0&&(pr(p,n,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",s,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=ut(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=ut(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,u=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=t,o[1]!==0?(l[0]=l[1],c=ut(p,n,o,i,t,c)):l[1]!==0&&(c=ut(p,n,l,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&pr(p,n,u,s,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Ff(n.events,t))}return e}function ut(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},je(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const u=je(n.events,t[1]);if(o={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const s=je(n.events,t[2]),f=je(n.events,t[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,w=t[3]-t[2]-1;e.add(g,w,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},je(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function pr(e,n,t,r,i){const o=[],l=je(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function je(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Of={name:"tasklistCheck",tokenize:Bf};function Mf(){return{text:{91:Of}}}function Bf(e,n,t){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return K(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(u)}function a(u){return N(u)?n(u):M(u)?e.check({tokenize:Hf},n,t)(u):t(u)}}function Hf(e,n,t){return $(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Uf(e){return _r([pf(),Cf(),Lf(e),Rf(),Mf()])}const qf={};function $f(e){const n=this,t=e||qf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Uf(t)),o.push(uf()),l.push(cf(t))}const mr=14e4,dr=220;function Vf(e){return e.length<=mr?e:`${e.slice(0,mr)}
30
+
31
+ …`}function Wf(e){return e==="user"?q("chatRoleUser"):e==="assistant"?q("chatRoleAssistant"):e==="tool"?q("chatRoleTool"):e==="system"?q("chatRoleSystem"):q("chatRoleMessage")}function Kf(e){const n=e.toLowerCase();return n.includes("exec")||n.includes("shell")||n.includes("command")?S.jsx(Bi,{className:"h-3.5 w-3.5"}):n.includes("search")?S.jsx(kr,{className:"h-3.5 w-3.5"}):n.includes("fetch")||n.includes("http")||n.includes("web")?S.jsx(Hi,{className:"h-3.5 w-3.5"}):n.includes("read")||n.includes("file")?S.jsx(Ui,{className:"h-3.5 w-3.5"}):n.includes("message")||n.includes("send")?S.jsx(qi,{className:"h-3.5 w-3.5"}):n.includes("cron")||n.includes("schedule")?S.jsx($i,{className:"h-3.5 w-3.5"}):S.jsx(yr,{className:"h-3.5 w-3.5"})}function _t({role:e}){return e==="user"?S.jsx("div",{className:"h-8 w-8 rounded-full bg-primary text-white flex items-center justify-center shadow-sm",children:S.jsx(Oi,{className:"h-4 w-4"})}):e==="assistant"?S.jsx("div",{className:"h-8 w-8 rounded-full bg-slate-900 text-white flex items-center justify-center shadow-sm",children:S.jsx(Mi,{className:"h-4 w-4"})}):S.jsx("div",{className:"h-8 w-8 rounded-full bg-amber-100 text-amber-700 flex items-center justify-center shadow-sm",children:S.jsx(yr,{className:"h-4 w-4"})})}function Qf({text:e,role:n}){const t=n==="user";return S.jsx("div",{className:he("chat-markdown",t?"chat-markdown-user":"chat-markdown-assistant"),children:S.jsx(bu,{remarkPlugins:[$f],rehypePlugins:[Fu],components:{a:({...r})=>S.jsx("a",{...r,target:"_blank",rel:"noreferrer noopener"})},children:Vf(e)})})}function Xf({card:e}){var o;const n=e.kind==="call"?q("chatToolCall"):q("chatToolResult"),t=((o=e.text)==null?void 0:o.trim())??"",r=t.length>dr||t.includes(`
32
+ `),i=r?`${t.slice(0,dr)}…`:t;return S.jsxs("div",{className:"rounded-xl border border-amber-200/80 bg-amber-50/60 px-3 py-2.5",children:[S.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-800 font-semibold",children:[Kf(e.name),S.jsx("span",{children:n}),S.jsx("span",{className:"font-mono text-[11px] text-amber-900/80",children:e.name})]}),e.detail&&S.jsx("div",{className:"mt-1 text-[11px] text-amber-800/90 font-mono break-words",children:e.detail}),e.kind==="result"&&S.jsx("div",{className:"mt-2",children:t?r?S.jsxs("details",{className:"group",children:[S.jsx("summary",{className:"cursor-pointer text-[11px] text-amber-700",children:q("chatToolOutput")}),S.jsx("pre",{className:"mt-2 rounded-lg border border-amber-200 bg-amber-100/40 p-2 text-[11px] whitespace-pre-wrap break-words text-amber-900",children:t})]}):S.jsx("pre",{className:"rounded-lg border border-amber-200 bg-amber-100/40 p-2 text-[11px] whitespace-pre-wrap break-words text-amber-900",children:i}):S.jsx("div",{className:"text-[11px] text-amber-700/80",children:q("chatToolNoOutput")})})]})}function Yf({message:e,role:n}){const t=sl(e.content).trim(),r=ul(e),i=typeof e.reasoning_content=="string"?e.reasoning_content.trim():"",o=!!t&&!(n==="tool"&&r.length>0),l=n==="user";return S.jsxs("div",{className:he("rounded-2xl border px-4 py-3 shadow-sm",l?"bg-primary text-white border-primary":n==="assistant"?"bg-white text-gray-900 border-gray-200":"bg-orange-50/70 text-gray-900 border-orange-200/80"),children:[o&&S.jsx(Qf,{text:t,role:n}),i&&S.jsxs("details",{className:"mt-3",children:[S.jsx("summary",{className:he("cursor-pointer text-xs",l?"text-primary-100":"text-gray-500"),children:q("chatReasoning")}),S.jsx("pre",{className:he("mt-2 text-[11px] whitespace-pre-wrap break-words rounded-lg p-2",l?"bg-primary-700/60":"bg-gray-100"),children:i})]}),r.length>0&&S.jsx("div",{className:"mt-3 space-y-2",children:r.map((a,u)=>S.jsx(Xf,{card:a},`${a.kind}-${a.name}-${a.callId??u}`))})]})}function Gf({messages:e,isSending:n,className:t}){const r=J.useMemo(()=>al(e),[e]);return S.jsxs("div",{className:he("space-y-5",t),children:[r.map(i=>{const o=i.role==="user";return S.jsxs("div",{className:he("flex gap-3",o?"justify-end":"justify-start"),children:[!o&&S.jsx(_t,{role:i.role}),S.jsxs("div",{className:he("max-w-[88%] min-w-[280px] space-y-2",o&&"flex flex-col items-end"),children:[i.messages.map((l,a)=>S.jsx(Yf,{message:l,role:i.role},`${i.key}-${a}`)),S.jsxs("div",{className:he("text-[11px] px-1",o?"text-primary-300":"text-gray-400"),children:[Wf(i.role)," · ",br(i.timestamp)]})]}),o&&S.jsx(_t,{role:i.role})]},i.key)}),n&&S.jsxs("div",{className:"flex gap-3 justify-start",children:[S.jsx(_t,{role:"assistant"}),S.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500 shadow-sm",children:q("chatTyping")})]})]})}const Qt="nextclaw.ui.chat.activeSession";function Jf(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Qt);return e&&e.trim().length>0?e:null}catch{return null}}function Zf(e){if(!(typeof window>"u"))try{if(!e){window.localStorage.removeItem(Qt);return}window.localStorage.setItem(Qt,e)}catch{}}function eh(e){var r;const n=/^agent:([^:]+):/i.exec(e.trim());if(!n)return null;const t=(r=n[1])==null?void 0:r.trim();return t||null}function gr(e){const n=Math.random().toString(36).slice(2,8);return`agent:${e}:ui:direct:web-${Date.now().toString(36)}${n}`}function th(e){if(e.label&&e.label.trim())return e.label.trim();const n=e.key.split(":");return n[n.length-1]||e.key}function uh(){var y,D,L;const[e,n]=J.useState(""),[t,r]=J.useState(""),[i,o]=J.useState(()=>Jf()),[l,a]=J.useState("main"),[u,s]=J.useState(null),{confirm:f,ConfirmDialog:c}=Zi(),p=J.useRef(null),h=Ki(),g=Qi({q:e.trim()||void 0,limit:120,activeMinutes:0}),w=Xi(i,300),C=Yi(),x=Gi(),v=J.useMemo(()=>{var T;const P=((T=h.data)==null?void 0:T.agents.list)??[],z=new Set(["main"]);for(const H of P)typeof H.id=="string"&&H.id.trim().length>0&&z.add(H.id.trim().toLowerCase());return Array.from(z)},[(y=h.data)==null?void 0:y.agents.list]),E=J.useMemo(()=>{var P;return((P=g.data)==null?void 0:P.sessions)??[]},[(D=g.data)==null?void 0:D.sessions]),R=J.useMemo(()=>E.find(P=>P.key===i)??null,[i,E]),F=J.useMemo(()=>{var P;return((P=w.data)==null?void 0:P.messages)??[]},[(L=w.data)==null?void 0:L.messages]),k=J.useMemo(()=>u?[...F,u]:F,[F,u]);J.useEffect(()=>{!i&&E.length>0&&o(E[0].key)},[i,E]),J.useEffect(()=>{Zf(i)},[i]),J.useEffect(()=>{const P=i?eh(i):null;P&&l!==P&&a(P)},[l,i]),J.useEffect(()=>{const P=p.current;P&&(P.scrollTop=P.scrollHeight)},[k.length,x.isPending,i]);const O=()=>{const P=gr(l);o(P),s(null)},V=async()=>{!i||!await f({title:q("chatDeleteSessionConfirm"),variant:"destructive",confirmLabel:q("delete")})||C.mutate({key:i},{onSuccess:async()=>{o(null),s(null),await g.refetch()}})},B=async()=>{const P=t.trim();if(!P||x.isPending)return;const z=!!i,T=i??gr(l);i||o(T),r(""),s({role:"user",content:P,timestamp:new Date().toISOString()});try{const H=await x.mutateAsync({data:{message:P,sessionKey:T,agentId:l,channel:"ui",chatId:"web-ui"}});s(null),H.sessionKey!==T&&o(H.sessionKey),await g.refetch(),z&&await w.refetch()}catch{s(null),r(P)}};return S.jsxs(el,{fullHeight:!0,children:[S.jsx(tl,{title:q("chatPageTitle"),description:q("chatPageDescription"),actions:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>w.refetch(),className:"rounded-lg",children:[S.jsx(kn,{className:he("h-3.5 w-3.5 mr-1.5",w.isFetching&&"animate-spin")}),q("chatRefresh")]}),S.jsxs(Fe,{variant:"primary",size:"sm",onClick:O,className:"rounded-lg",children:[S.jsx(bn,{className:"h-3.5 w-3.5 mr-1.5"}),q("chatNewSession")]})]})}),S.jsxs("div",{className:"flex-1 min-h-0 flex gap-4 max-lg:flex-col",children:[S.jsxs("aside",{className:"w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0",children:[S.jsxs("div",{className:"p-4 border-b border-gray-100 space-y-3",children:[S.jsxs("div",{className:"relative",children:[S.jsx(kr,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),S.jsx(Ji,{value:e,onChange:P=>n(P.target.value),placeholder:q("chatSearchSessionPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]}),S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs(Fe,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>g.refetch(),children:[S.jsx(kn,{className:he("h-3.5 w-3.5 mr-1.5",g.isFetching&&"animate-spin")}),q("chatRefresh")]}),S.jsxs(Fe,{variant:"subtle",size:"sm",className:"rounded-lg",onClick:O,children:[S.jsx(bn,{className:"h-3.5 w-3.5 mr-1.5"}),q("chatNewSession")]})]})]}),S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2",children:g.isLoading?S.jsx("div",{className:"text-sm text-gray-500 p-4",children:q("sessionsLoading")}):E.length===0?S.jsxs("div",{className:"p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500",children:[S.jsx(wn,{className:"h-7 w-7 mx-auto mb-2 text-gray-300"}),q("sessionsEmpty")]}):S.jsx("div",{className:"space-y-1",children:E.map(P=>{const z=i===P.key;return S.jsxs("button",{onClick:()=>o(P.key),className:he("w-full rounded-xl border px-3 py-2.5 text-left transition-all",z?"border-primary/30 bg-primary/5":"border-transparent hover:border-gray-200 hover:bg-gray-50"),children:[S.jsx("div",{className:"text-sm font-semibold text-gray-900 truncate",children:th(P)}),S.jsx("div",{className:"mt-1 text-[11px] text-gray-500 truncate",children:P.key}),S.jsxs("div",{className:"mt-1 text-[11px] text-gray-400",children:[P.messageCount," · ",br(P.updatedAt)]})]},P.key)})})})]}),S.jsxs("section",{className:"flex-1 min-h-0 rounded-2xl border border-gray-200 bg-gradient-to-b from-gray-50/60 to-white shadow-card flex flex-col overflow-hidden",children:[S.jsxs("div",{className:"px-5 py-4 border-b border-gray-200/80 bg-white/80 backdrop-blur-sm flex flex-wrap items-center gap-3",children:[S.jsxs("div",{className:"min-w-[220px] max-w-[320px]",children:[S.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:q("chatAgentLabel")}),S.jsxs(nl,{value:l,onValueChange:a,children:[S.jsx(rl,{className:"h-9 rounded-lg",children:S.jsx(il,{placeholder:q("chatSelectAgent")})}),S.jsx(ll,{children:v.map(P=>S.jsx(ol,{value:P,children:P},P))})]})]}),S.jsxs("div",{className:"flex-1 min-w-[260px]",children:[S.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:q("chatSessionLabel")}),S.jsx("div",{className:"h-9 rounded-lg border border-gray-200 bg-white px-3 text-xs text-gray-600 flex items-center truncate",children:i??q("chatNoSession")})]}),S.jsxs(Fe,{variant:"outline",size:"sm",className:"rounded-lg self-end",onClick:V,disabled:!R||C.isPending,children:[S.jsx(Vi,{className:"h-3.5 w-3.5 mr-1.5"}),q("chatDeleteSession")]})]}),S.jsx("div",{ref:p,className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar px-5 py-5",children:i?w.isLoading?S.jsx("div",{className:"text-sm text-gray-500",children:q("chatHistoryLoading")}):S.jsx(S.Fragment,{children:k.length===0?S.jsx("div",{className:"text-sm text-gray-500",children:q("chatNoMessages")}):S.jsx(Gf,{messages:k,isSending:x.isPending})}):S.jsx("div",{className:"h-full flex items-center justify-center",children:S.jsxs("div",{className:"text-center text-gray-500",children:[S.jsx(wn,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),S.jsx("div",{className:"text-sm font-medium",children:q("chatNoSession")}),S.jsx("div",{className:"text-xs mt-1",children:q("chatNoSessionHint")})]})})}),S.jsx("div",{className:"border-t border-gray-200 bg-white p-4",children:S.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-2",children:[S.jsx("textarea",{value:t,onChange:P=>r(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),B())},placeholder:q("chatInputPlaceholder"),className:"w-full min-h-[68px] max-h-[220px] resize-y bg-transparent outline-none text-sm px-2 py-1.5 text-gray-800 placeholder:text-gray-400",disabled:x.isPending}),S.jsxs("div",{className:"flex items-center justify-between px-2 pb-1",children:[S.jsx("div",{className:"text-[11px] text-gray-400",children:q("chatInputHint")}),S.jsxs(Fe,{size:"sm",className:"rounded-lg",onClick:()=>void B(),disabled:x.isPending||t.trim().length===0,children:[S.jsx(Wi,{className:"h-3.5 w-3.5 mr-1.5"}),x.isPending?q("chatSending"):q("chatSend")]})]})]})})]})]}),S.jsx(c,{})]})}export{uh as ChatPage};