db-studio 1.16.2 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +165 -102
- package/dist/index.js.map +1 -1
- package/dist/web-dist/assets/_pathlessLayout-D83hYFIC.js +1 -0
- package/dist/web-dist/assets/_pathlessLayout-DYRsUfs6.js +2 -0
- package/dist/web-dist/assets/_queryId-DmyRcSX-.js +1 -0
- package/dist/web-dist/assets/_table-CXzhHR9S.js +1 -0
- package/dist/web-dist/assets/_table-Cwy7lxKk.js +1 -0
- package/dist/web-dist/assets/_table-DaqO5XGq.js +1 -0
- package/dist/web-dist/assets/abap-Ds2wIDQc.js +1 -0
- package/dist/web-dist/assets/apex-DfqBN11z.js +1 -0
- package/dist/web-dist/assets/azcli-COqL1c-b.js +1 -0
- package/dist/web-dist/assets/badge-Ckwkbv_3.js +1 -0
- package/dist/web-dist/assets/bat-Nrlrgwbn.js +1 -0
- package/dist/web-dist/assets/bicep-DMqb4xTm.js +2 -0
- package/dist/web-dist/assets/browser-dcbfhXDu.js +1 -0
- package/dist/web-dist/assets/{bundle-mjs-g0oakdN9.js → bundle-mjs-DfrVkH8G.js} +1 -1
- package/dist/web-dist/assets/cameligo-DQX1RguE.js +1 -0
- package/dist/web-dist/assets/chat-sidebar-p9xpAAXQ.js +132 -0
- package/dist/web-dist/assets/clojure-CmnlCds-.js +1 -0
- package/dist/web-dist/assets/{code-editor-CTRHqZru.js → code-editor-DsRAUGQh.js} +2 -2
- package/dist/web-dist/assets/coffee-CgcM3HWm.js +1 -0
- package/dist/web-dist/assets/cpp-BnqpxZdA.js +1 -0
- package/dist/web-dist/assets/csharp-B8V_ECLX.js +1 -0
- package/dist/web-dist/assets/csp-Dzh7GjET.js +1 -0
- package/dist/web-dist/assets/css-BY0zxVqM.js +3 -0
- package/dist/web-dist/assets/cssMode-D_jEABO9.js +1 -0
- package/dist/web-dist/assets/cypher-D9AVJPko.js +1 -0
- package/dist/web-dist/assets/dart-vuJN5abD.js +1 -0
- package/dist/web-dist/assets/database.store-C0jTx_DA.js +57 -0
- package/dist/web-dist/assets/{dist-DlZR7Oow.js → dist-DmSgBrHs.js} +1 -1
- package/dist/web-dist/assets/dockerfile-Du-akT44.js +1 -0
- package/dist/web-dist/assets/ecl-C3XWQlLZ.js +1 -0
- package/dist/web-dist/assets/editor-1FQrmyyI.css +1 -0
- package/dist/web-dist/assets/editor.api-VeMVvGYa.js +865 -0
- package/dist/web-dist/assets/elixir-BzsCBGJ0.js +1 -0
- package/dist/web-dist/assets/esm-D_bQ4AdP.js +501 -0
- package/dist/web-dist/assets/flow9-z5gBTD0L.js +1 -0
- package/dist/web-dist/assets/freemarker2-B9XmkS8x.js +3 -0
- package/dist/web-dist/assets/fsharp-CMq6tChx.js +1 -0
- package/dist/web-dist/assets/go-ClPsEbRK.js +1 -0
- package/dist/web-dist/assets/graphql-7BvkEJ5O.js +1 -0
- package/dist/web-dist/assets/handlebars-sf8CVwlq.js +1 -0
- package/dist/web-dist/assets/hcl-DN6aCTHV.js +1 -0
- package/dist/web-dist/assets/highlighted-body-OFNGDK62-BU0nMuYA.js +1 -0
- package/dist/web-dist/assets/html-DI5TL_8H.js +1 -0
- package/dist/web-dist/assets/htmlMode-D_4DT2Lu.js +1 -0
- package/dist/web-dist/assets/{icons-wNdPUgHM.js → icons-BEkcNqUd.js} +1 -1
- package/dist/web-dist/assets/index-CK2sj4Xy.css +2 -0
- package/dist/web-dist/assets/index-b6Apx1z7.js +39 -0
- package/dist/web-dist/assets/indexes-Cv0o_HTj.js +1 -0
- package/dist/web-dist/assets/ini-Ba74TRs3.js +1 -0
- package/dist/web-dist/assets/java-B1OFDleH.js +1 -0
- package/dist/web-dist/assets/javascript-Cf3sZaZX.js +1 -0
- package/dist/web-dist/assets/json-editor-C9dFqjTV.js +1 -0
- package/dist/web-dist/assets/jsonMode-CQjwhzT5.js +7 -0
- package/dist/web-dist/assets/julia-CMywvhYA.js +1 -0
- package/dist/web-dist/assets/keys-o03XLuW4.js +1 -0
- package/dist/web-dist/assets/kotlin-BD6_sIY9.js +1 -0
- package/dist/web-dist/assets/less-BxdK-Aa1.js +2 -0
- package/dist/web-dist/assets/lexon-DCaYyeqi.js +1 -0
- package/dist/web-dist/assets/liquid-D7tk2apZ.js +1 -0
- package/dist/web-dist/assets/{logs-BnjjoFbl.js → logs-Ncb6EFEi.js} +1 -1
- package/dist/web-dist/assets/lspLanguageFeatures-DHxnBjVJ.js +4 -0
- package/dist/web-dist/assets/lua-DYwtBF6d.js +1 -0
- package/dist/web-dist/assets/m3-CogUFTfR.js +1 -0
- package/dist/web-dist/assets/markdown-COKMRj9K.js +1 -0
- package/dist/web-dist/assets/mdx-H6YCl9d8.js +1 -0
- package/dist/web-dist/assets/mermaid-GHXKKRXX-D3S70ynC.js +1 -0
- package/dist/web-dist/assets/{middleware-Bet3mw2T.js → middleware-CEqbkwLH.js} +1 -1
- package/dist/web-dist/assets/mips-BDOMMsh0.js +1 -0
- package/dist/web-dist/assets/module-CYndhtxW.js +2 -0
- package/dist/web-dist/assets/monaco-theme-BnSsSzUH.css +1 -0
- package/dist/web-dist/assets/monaco-theme-CyGd7xOU.js +64 -0
- package/dist/web-dist/assets/msdax-Bt2yooL5.js +1 -0
- package/dist/web-dist/assets/mysql-Bs8-d6RT.js +1 -0
- package/dist/web-dist/assets/objective-c-DZGYv99U.js +1 -0
- package/dist/web-dist/assets/pascal-FvUHIAld.js +1 -0
- package/dist/web-dist/assets/pascaligo-DEr9uXJO.js +1 -0
- package/dist/web-dist/assets/perl-DfX9jvgM.js +1 -0
- package/dist/web-dist/assets/personal-preferences.store-BIcu6qr5.js +1 -0
- package/dist/web-dist/assets/pgsql-B12f-wRt.js +1 -0
- package/dist/web-dist/assets/php-MynGtmh0.js +1 -0
- package/dist/web-dist/assets/pla-BSfIEgVT.js +1 -0
- package/dist/web-dist/assets/postiats-wriGJNMc.js +1 -0
- package/dist/web-dist/assets/powerquery-qTNF5irm.js +1 -0
- package/dist/web-dist/assets/powershell-Cr0AiP2J.js +1 -0
- package/dist/web-dist/assets/preload-helper-DICoZAvL.js +1 -0
- package/dist/web-dist/assets/protobuf-B5pCjOfx.js +2 -0
- package/dist/web-dist/assets/pug-BnGzsuEw.js +1 -0
- package/dist/web-dist/assets/python-Bd-J5HMt.js +1 -0
- package/dist/web-dist/assets/qsharp-C-Z8Szjm.js +1 -0
- package/dist/web-dist/assets/{queries.store-BlC7QGq6.js → queries.store-BbUkkWy1.js} +1 -1
- package/dist/web-dist/assets/{query-runner-CQWHEby5.js → query-runner-DBIufzsZ.js} +5 -5
- package/dist/web-dist/assets/r-lFEgLDol.js +1 -0
- package/dist/web-dist/assets/radix-ui-Bp71_UWp.js +51 -0
- package/dist/web-dist/assets/razor-BL-2JJuP.js +1 -0
- package/dist/web-dist/assets/react-BziCK5DU.js +1 -0
- package/dist/web-dist/assets/{react-dom-CnDfVSZQ.js → react-dom-ctQEFzyp.js} +5 -5
- package/dist/web-dist/assets/redis-CJPiZ1dc.js +1 -0
- package/dist/web-dist/assets/redis-value-rbj0L_ie.js +1 -0
- package/dist/web-dist/assets/redshift-D1FKNo6F.js +1 -0
- package/dist/web-dist/assets/restructuredtext-BdtNntNZ.js +1 -0
- package/dist/web-dist/assets/{rolldown-runtime-Y-txFyxk.js → rolldown-runtime-Ba77kUFP.js} +1 -1
- package/dist/web-dist/assets/ruby-C2uUAsPh.js +1 -0
- package/dist/web-dist/assets/runner-WhyDqbco.js +1 -0
- package/dist/web-dist/assets/rust-B22jVKPi.js +1 -0
- package/dist/web-dist/assets/sb-H5-MsoWu.js +1 -0
- package/dist/web-dist/assets/scala-JHuRLUuq.js +1 -0
- package/dist/web-dist/assets/{schema-C27u7buH.js → schema-DdnQO20v.js} +1 -1
- package/dist/web-dist/assets/scheme-CqKe-_5y.js +1 -0
- package/dist/web-dist/assets/scss-C9ckl5Lm.js +3 -0
- package/dist/web-dist/assets/select-Cg3fBZqb.js +1 -0
- package/dist/web-dist/assets/separator-B2Ii4cjw.js +1 -0
- package/dist/web-dist/assets/sheet-sidebar-D8BG4Pf9.js +1 -0
- package/dist/web-dist/assets/shell-C9lIrU5P.js +1 -0
- package/dist/web-dist/assets/solidity-BdsCByFb.js +1 -0
- package/dist/web-dist/assets/sophia-BiYQOR15.js +1 -0
- package/dist/web-dist/assets/sparql-CZhOhni4.js +1 -0
- package/dist/web-dist/assets/spinner-gvrX8mkL.js +1 -0
- package/dist/web-dist/assets/sql-DGoEI4nz.js +1 -0
- package/dist/web-dist/assets/st-DUBBkXkg.js +1 -0
- package/dist/web-dist/assets/swift-D_36y0eN.js +1 -0
- package/dist/web-dist/assets/systemverilog-BAtlR_WK.js +1 -0
- package/dist/web-dist/assets/{table-B1OYFDnr.js → table-Gq1Nd4WJ.js} +1 -1
- package/dist/web-dist/assets/tanstack-HxB2LyLp.js +8 -0
- package/dist/web-dist/assets/tcl-D05MO8B_.js +1 -0
- package/dist/web-dist/assets/tooltip-CIAbgIn7.js +12 -0
- package/dist/web-dist/assets/tsMode-4FmdP9_o.js +11 -0
- package/dist/web-dist/assets/twig-CPq3SV5E.js +1 -0
- package/dist/web-dist/assets/typescript-CEcdsK9n.js +1 -0
- package/dist/web-dist/assets/typespec-I6aAHcEc.js +1 -0
- package/dist/web-dist/assets/utils-CNXzeC6_.js +1 -0
- package/dist/web-dist/assets/vb-C6fWMOt8.js +1 -0
- package/dist/web-dist/assets/{visualizer-CITcnwJh.js → visualizer-Cxu0_nai.js} +1 -1
- package/dist/web-dist/assets/wgsl-CsswhpkD.js +298 -0
- package/dist/web-dist/assets/workers-CH8V5wKq.js +1 -0
- package/dist/web-dist/assets/xml-Clh3WxEv.js +1 -0
- package/dist/web-dist/assets/yaml--Kwp2ruw.js +1 -0
- package/dist/web-dist/index.html +22 -20
- package/package.json +8 -5
- package/dist/web-dist/assets/_pathlessLayout-C0MMCDcm.js +0 -1
- package/dist/web-dist/assets/_pathlessLayout-XjSpVK5x.js +0 -132
- package/dist/web-dist/assets/_queryId-OFkn9Oa-.js +0 -1
- package/dist/web-dist/assets/_table-DWUmdgY6.js +0 -1
- package/dist/web-dist/assets/_table-jJR4Ocv2.js +0 -1
- package/dist/web-dist/assets/badge-Bd7hbykP.js +0 -1
- package/dist/web-dist/assets/browser-B8_CLARX.js +0 -1
- package/dist/web-dist/assets/database.store-DJ10NZng.js +0 -57
- package/dist/web-dist/assets/format-cell-value-ClBO-Y4U.js +0 -1
- package/dist/web-dist/assets/highlighted-body-OFNGDK62-jkW4Egvm.js +0 -1
- package/dist/web-dist/assets/index-BANk_UGi.js +0 -36
- package/dist/web-dist/assets/index-Ir-8O5kw.css +0 -2
- package/dist/web-dist/assets/indexes-hgIGRB__.js +0 -1
- package/dist/web-dist/assets/mermaid-GHXKKRXX-BUBXMhKa.js +0 -1
- package/dist/web-dist/assets/monaco-editor-DxDiR4f3.js +0 -1252
- package/dist/web-dist/assets/monaco-editor-IL9D_L0g.css +0 -1
- package/dist/web-dist/assets/monitoring-DXY00d-N.js +0 -22
- package/dist/web-dist/assets/overlay.store-DzkuYBKd.js +0 -11
- package/dist/web-dist/assets/radix-ui-D3kd-zkB.js +0 -51
- package/dist/web-dist/assets/react-1w3eYWHr.js +0 -1
- package/dist/web-dist/assets/redis-value-D7lbyO7s.js +0 -1
- package/dist/web-dist/assets/runner-BqitD-mp.js +0 -1
- package/dist/web-dist/assets/schema-C8mAjJOp.js +0 -1
- package/dist/web-dist/assets/tanstack-BvmgSO8H.js +0 -11
- package/dist/web-dist/assets/use-database-engine-wK2YTpfJ.js +0 -1
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-jkW4Egvm.js","assets/rolldown-runtime-Y-txFyxk.js","assets/icons-wNdPUgHM.js","assets/radix-ui-D3kd-zkB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as Zi,r as Pr,t as qn}from"./rolldown-runtime-Y-txFyxk.js";import{S as Mr,T as gh,b as zs,d as Yn,h as Eh,n as Th,o as bh,r as xh,t as Ji,x as Vn,y as Vo}from"./tanstack-BvmgSO8H.js";import{C as kh,E as yh,G as Ch,H as Wo,I as _h,J as Ah,K as vh,N as Nh,O as $s,S as tn,T as es,U as Sh,V as Ih,X as wh,Y as Lh,_ as ts,bt as Rh,d as qs,f as Oh,h as Dh,ht as Ph,i as Mh,j as Bh,k as Ys,lt as Qo,m as Fh,mt as jh,n as Hh,o as ns,p as Uh,pt as zh,st as Vs,tt as $h,ut as ei,w as qh,x as Go,xt as Yh}from"./icons-wNdPUgHM.js";import{Ot as Vh,Tt as Ws,a as Wh,c as Qh,gt as Gh,i as Kh,kt as Xh,l as Zh,n as Jh,o as ed,r as td,s as nd,t as rd}from"./radix-ui-D3kd-zkB.js";import{n as ot}from"./dist-DlZR7Oow.js";import{n as Ko,t as Xo}from"./bundle-mjs-g0oakdN9.js";import{B as id,F as sd,G as ee,L as ad,V as ae,W as od,a as Rt,c as ld,n as Ot,o as ct,r as Dt,t as yt}from"./overlay.store-DzkuYBKd.js";import{$ as nn,E as cd,J as ud,O as hd,Q as rn,T as Zo,X as dd,Y as md,_ as fd,d as Jo,et as sn,f as pd,g as gd,h as Ed,j as Td,m as Qs,nt as an,p as qe,q as bd,rt as on,tt as ln,u as el,v as tl}from"./schema-C8mAjJOp.js";import{d as et,n as Gs,s as xd,t as kd}from"./badge-Bd7hbykP.js";import{t as rs}from"./database.store-DJ10NZng.js";import{r as yd}from"./monitoring-DXY00d-N.js";import{t as Ht}from"./use-database-engine-wK2YTpfJ.js";import{s as nl}from"./monaco-editor-DxDiR4f3.js";import{B as Wn,C as Cd,D as _d,E as Ad,F as vd,G as Je,H as rl,J as Nd,K as Sd,L as Qn,N as Id,O as wd,P as Br,R as Gn,S as Ld,T as Rd,U as Od,V as Kn,W as il,X as jn,Y as Dd,a as Pd,c as Md,g as Bd,h as Cr,i as Fd,k as jd,l as Qt,m as is,o as Gt,p as Hd,q as Ud,s as Ks,u as ss,v as zd,w as $d,z as ut}from"./index-BANk_UGi.js";import{t as Fr}from"./queries.store-BlC7QGq6.js";import{i as qd,n as ti,o as Yd,r as Vd,s as Wd}from"./redis-value-D7lbyO7s.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.16.2"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b6b3f901-5cfd-4edf-904c-0e028d77e0ce",e._sentryDebugIdIdentifier="sentry-dbid-b6b3f901-5cfd-4edf-904c-0e028d77e0ce")}catch{}})();var Qd=["Show me all tables in my database","What columns are in the users table?","Write a query to find all active users","How many orders were placed last month?","Find top 5 customers by total spend","Write a JOIN between users and orders","Users who haven't made any purchase yet","Generate monthly revenue summary query","Suggest useful indexes for better performance","Show schema of the products / inventory table","Latest 20 orders with customer names","Help me write a safe UPDATE query"],Xs={AUTHOR:"Hüsam 🥑 <husam@ql3.dev>",AUTHOR_NAME:"Hüsam",AUTHOR_AVATAR:"/avocado.png",AUTHOR_USERNAME:"husamql3",AUTHOR_GITHUB_LINK:"https://github.com/husamql3",SITE_DESCRIPTION:"The modern pgAdmin alternative that works with every database.",SITE_KEYWORDS:["pgadmin alternative","database client","database gui","database browser","sql editor","postgresql client","mysql client","table editor","ai sql","er diagram"],SITE_TITLE:"db-studio",SITE_NAME:"dbstudio.sh",SITE_URL:"https://dbstudio.sh",SITE_X_LINK:"https://x.com/dbstudio_sh",SITE_GITHUB_LINK:"https://github.com/husamql3/db-studio",SITE_GITHUB_NEW_ISSUE_LINK:"https://github.com/husamql3/db-studio/issues/new/choose",SITE_DOCS_LINK:"https://dbstudio.sh/docs",SITE_CHANGELOG_LINK:"https://dbstudio.sh/changelog",SITE_ROADMAP_LINK:"https://dbstudio.sh/roadmap",SITE_IMAGE:"https://dbstudio.sh/og-image.png",SITE_IMAGE_WIDTH:"1200",SITE_IMAGE_HEIGHT:"630",SITE_IMAGE_ALT:"dbstudio.sh – Modern database management studio",SITE_COLOR:"#1447e6"},jr=(function(e){if(e==null)return Zd;if(typeof e=="function")return Hr(e);if(typeof e=="object")return Array.isArray(e)?Gd(e):Kd(e);if(typeof e=="string")return Xd(e);throw new Error("Expected function, string, or object as test")});function Gd(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=jr(e[n]);return Hr(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Kd(e){const t=e;return Hr(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Xd(e){return Hr(t);function t(n){return n&&n.type===e}}function Hr(e){return t;function t(n,r,i){return!!(Jd(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Zd(){return!0}function Jd(e){return e!==null&&typeof e=="object"&&"type"in e}var sl=[];var Nn="skip";function as(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=jr(i),a=r?-1:1;o(e,void 0,[])();function o(l,h,m){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=sl,g,_,A;if((!t||s(l,h,m[m.length-1]||void 0))&&(p=em(n(l,m)),p[0]===!1))return p;if("children"in l&&l.children){const b=l;if(b.children&&p[0]!=="skip")for(_=(r?b.children.length:-1)+a,A=m.concat(b);_>-1&&_<b.children.length;){const v=b.children[_];if(g=o(v,_,A)(),g[0]===!1)return g;_=typeof g[1]=="number"?g[1]:_+a}}return p}}}function em(e){return Array.isArray(e)?e:typeof e=="number"?[!0,e]:e==null?sl:[e]}function tt(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),as(e,s,o,i);function o(l,h){const m=h[h.length-1],d=m?m.children.indexOf(l):void 0;return a(l,d,m)}}var E=Pr(Yh(),1),u=Xh(),cn={indicator:"indicator",textOnly:"text-only",remove:"remove"};function tm({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:a="text-gray-500",linkBlockPolicy:o=cn.indicator,imageBlockPolicy:l=cn.indicator}){const h=t.length&&!t.every(d=>d==="*"),m=n.length&&!n.every(d=>d==="*");if(!e&&(h||m))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return d=>{const f=om(e,t,n,r,i,s,a,o,l);al(d),tt(d,f)}}function Zs(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function nm(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}var rm=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),im=new Set(["javascript:","data:","file:","vbscript:"]);function Js(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const l=e.substring(5);if(l&&l.length>0&&l!=="invalid")return e}}catch{return null}return null}const a=Zs(e,n);if(!a||im.has(a.protocol)||!(rm.has(a.protocol)||s.includes(a.protocol)||s.includes("*")))return null;if(a.protocol==="mailto:"||!a.protocol.match(/^https?:$/))return a.href;const o=nm(e);return a&&t.some(l=>{const h=Zs(l,n);return!h||h.origin!==a.origin?!1:a.href.startsWith(h.href)})?o?a.pathname+a.search+a.hash:a.href:t.includes("*")?a.protocol!=="https:"&&a.protocol!=="http:"?null:o?a.pathname+a.search+a.hash:a.href:null}function al(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)al(t)}}var ni=Symbol("node-seen");function sm(e,t,n){return t===cn.remove?{type:"remove"}:t===cn.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function am(e,t,n){if(t===cn.remove)return{type:"remove"};if(t===cn.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}var om=(e,t,n,r,i,s,a,o,l)=>{const h=(m,d,f)=>{if(m.type!=="element"||m[ni])return!0;if(m.tagName==="a"){const p=Js(m.properties.href,t,e,!1,!1,i);if(p===null){if(m[ni]=!0,tt(m,h),f&&typeof d=="number"){const g=sm(m,o,a);if(g.type==="remove")return f.children.splice(d,1),[Nn,d];f.children[d]=g.element}return Nn}else return m.properties.href=p,m.properties.target="_blank",m.properties.rel="noopener noreferrer",!0}if(m.tagName==="img"){const p=Js(m.properties.src,n,e,r,!0,i);if(p===null){if(m[ni]=!0,tt(m,h),f&&typeof d=="number"){const g=am(m,l,s);if(g.type==="remove")return f.children.splice(d,1),[Nn,d];f.children[d]=g.element}return Nn}else return m.properties.src=p,!0}return!0};return h},ea=typeof self=="object"?self:globalThis,lm=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case 0:case-1:return n(a,i);case 1:{const o=n([],i);for(const l of a)o.push(r(l));return o}case 2:{const o=n({},i);for(const[l,h]of a)o[r(l)]=r(h);return o}case 3:return n(new Date(a),i);case 4:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case 5:{const o=n(new Map,i);for(const[l,h]of a)o.set(r(l),r(h));return o}case 6:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case 7:{const{name:o,message:l}=a;return n(new ea[o](l),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new ea[s](a),i)};return r},ta=e=>lm(new Map,e)(0),Kt="",{toString:cm}={},{keys:um}=Object,kn=e=>{const t=typeof e;if(t!=="object"||!e)return[0,t];const n=cm.call(e).slice(8,-1);switch(n){case"Array":return[1,Kt];case"Object":return[2,Kt];case"Date":return[3,Kt];case"RegExp":return[4,Kt];case"Map":return[5,Kt];case"Set":return[6,Kt];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},ur=([e,t])=>e===0&&(t==="function"||t==="symbol"),hm=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=kn(a);switch(o){case 0:{let m=a;switch(l){case"bigint":o=8,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);m=null;break;case"undefined":return i([-1],a)}return i([o,m],a)}case 1:{if(l){let f=a;return l==="DataView"?f=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(a)),i([l,[...f]],a)}const m=[],d=i([o,m],a);for(const f of a)m.push(s(f));return d}case 2:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const m=[],d=i([o,m],a);for(const f of um(a))(e||!ur(kn(a[f])))&&m.push([s(f),s(a[f])]);return d}case 3:return i([o,a.toISOString()],a);case 4:{const{source:m,flags:d}=a;return i([o,{source:m,flags:d}],a)}case 5:{const m=[],d=i([o,m],a);for(const[f,p]of a)(e||!(ur(kn(f))||ur(kn(p))))&&m.push([s(f),s(p)]);return d}case 6:{const m=[],d=i([o,m],a);for(const f of a)(e||!ur(kn(f)))&&m.push(s(f));return d}}const{message:h}=a;return i([o,{name:l,message:h}],a)};return s},na=(e,{json:t,lossy:n}={})=>{const r=[];return hm(!(t||n),!!t,new Map,r)(e),r},Bt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ta(na(e,t)):structuredClone(e):(e,t)=>ta(na(e,t));var Xn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Xn.prototype.normal={};Xn.prototype.property={};Xn.prototype.space=void 0;function ol(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Xn(n,r,t)}function Hn(e){return e.toLowerCase()}var Oe=class{constructor(e,t){this.attribute=t,this.property=e}};Oe.prototype.attribute="";Oe.prototype.booleanish=!1;Oe.prototype.boolean=!1;Oe.prototype.commaOrSpaceSeparated=!1;Oe.prototype.commaSeparated=!1;Oe.prototype.defined=!1;Oe.prototype.mustUseProperty=!1;Oe.prototype.number=!1;Oe.prototype.overloadedBoolean=!1;Oe.prototype.property="";Oe.prototype.spaceSeparated=!1;Oe.prototype.space=void 0;var Ni=Zi({boolean:()=>te,booleanish:()=>xe,commaOrSpaceSeparated:()=>Be,commaSeparated:()=>Jt,number:()=>H,overloadedBoolean:()=>Si,spaceSeparated:()=>me}),dm=0,te=Ut(),xe=Ut(),Si=Ut(),H=Ut(),me=Ut(),Jt=Ut(),Be=Ut();function Ut(){return 2**++dm}var ri=Object.keys(Ni),os=class extends Oe{constructor(e,t,n,r){let i=-1;if(super(e,t),ra(this,"space",r),typeof n=="number")for(;++i<ri.length;){const s=ri[i];ra(this,ri[i],(n&Ni[s])===Ni[s])}}};os.prototype.defined=!0;function ra(e,t,n){n&&(e[t]=n)}function dn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new os(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Hn(r)]=r,n[Hn(s.attribute)]=r}return new Xn(t,n,e.space)}var ll=dn({properties:{ariaActiveDescendant:null,ariaAtomic:xe,ariaAutoComplete:null,ariaBusy:xe,ariaChecked:xe,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:me,ariaCurrent:null,ariaDescribedBy:me,ariaDetails:null,ariaDisabled:xe,ariaDropEffect:me,ariaErrorMessage:null,ariaExpanded:xe,ariaFlowTo:me,ariaGrabbed:xe,ariaHasPopup:null,ariaHidden:xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:me,ariaLevel:H,ariaLive:null,ariaModal:xe,ariaMultiLine:xe,ariaMultiSelectable:xe,ariaOrientation:null,ariaOwns:me,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:xe,ariaReadOnly:xe,ariaRelevant:null,ariaRequired:xe,ariaRoleDescription:me,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:xe,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cl(e,t){return t in e?e[t]:t}function ul(e,t){return cl(e,t.toLowerCase())}var mm=dn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jt,acceptCharset:me,accessKey:me,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:me,autoFocus:te,autoPlay:te,blocking:me,capture:null,charSet:null,checked:te,cite:null,className:me,cols:H,colSpan:null,content:null,contentEditable:xe,controls:te,controlsList:me,coords:H|Jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:Si,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:me,height:H,hidden:Si,high:H,href:null,hrefLang:null,htmlFor:me,httpEquiv:me,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:me,itemRef:me,itemScope:te,itemType:me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:H,pattern:null,ping:me,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:me,required:te,reversed:te,rows:H,rowSpan:H,sandbox:me,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:xe,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:me,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:xe,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:te,disableRemotePlayback:te,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:ul}),fm=dn({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:Be,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:me,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:Jt,g2:Jt,glyphName:Jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Be,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Be,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Be,rev:Be,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Be,requiredFeatures:Be,requiredFonts:Be,requiredFormats:Be,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Be,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Be,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Be,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cl}),hl=dn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dl=dn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ul}),ml=dn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pm={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"},gm=/[A-Z]/g,ia=/-[a-z]/g,Em=/^data[-\w.:]+$/i;function Ur(e,t){const n=Hn(t);let r=t,i=Oe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Em.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(ia,bm);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!ia.test(s)){let a=s.replace(gm,Tm);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=os}return new i(r,t)}function Tm(e){return"-"+e.toLowerCase()}function bm(e){return e.charAt(1).toUpperCase()}var Zn=ol([ll,mm,hl,dl,ml],"html"),Ct=ol([ll,fm,hl,dl,ml],"svg");function sa(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function fl(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var aa=/[#.]/g;function xm(e,t){const n=e||"",r={};let i=0,s,a;for(;i<n.length;){aa.lastIndex=i;const o=aa.exec(n),l=n.slice(i,o?o.index:n.length);l&&(s?s==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:a=l,i+=l.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function oa(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function pl(e){return e.join(" ").trim()}function gl(e,t,n){const r=n?_m(n):void 0;function i(s,a,...o){let l;if(s==null){l={type:"root",children:[]};const h=a;o.unshift(h)}else{l=xm(s,t);const h=l.tagName.toLowerCase(),m=r?r.get(h):void 0;if(l.tagName=m||h,km(a))o.unshift(a);else for(const[d,f]of Object.entries(a))ym(e,l.properties,d,f)}for(const h of o)Ii(l.children,h);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function km(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function ym(e,t,n,r){const i=Ur(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=oa(r):i.commaSeparated?s=sa(r):i.commaOrSpaceSeparated?s=oa(sa(r).join(" ")):s=la(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Cm(r):String(r);if(Array.isArray(s)){const a=[];for(const o of s)a.push(la(i,i.property,o));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function Ii(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Ii(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Ii(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function la(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Hn(n)===Hn(t)))return!0}return n}function Cm(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function _m(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}var Am=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],vm=gl(Zn,"div"),Nm=gl(Ct,"g",Am);function Sm(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=ca(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const o=n[n.length-1],l=ca(t,o),h=l===-1?t.length+1:l+1;if(o===h)break;n.push(h)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function ca(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
3
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var Pt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},El={}.hasOwnProperty,Im=Object.prototype;function wm(e,t){const n=t||{};return ls({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ct:Zn,verbose:n.verbose||!1},e)}function ls(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},br(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Tl(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),a=Sm(s),o=a.toPoint(0),l=a.toPoint(s.length);n.position={start:o,end:l}}return n}case"#documentType":{const r=t;return n={type:"doctype"},br(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},br(e,r,n),n}default:return n=Lm(e,t),n}}function Tl(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=ls(e,t[n]);r.push(i)}return r}function Lm(e,t){const n=e.schema;e.schema=t.namespaceURI===Pt.svg?Ct:Zn;let r=-1;const i={};for(;++r<t.attrs.length;){const a=t.attrs[r],o=(a.prefix?a.prefix+":":"")+a.name;El.call(Im,o)||(i[o]=a.value)}const s=(e.schema.space==="svg"?Nm:vm)(t.tagName,i,Tl(e,t.childNodes));if(br(e,t,s),s.tagName==="template"){const a=t,o=a.sourceCodeLocation,l=o&&o.startTag&&Zt(o.startTag),h=o&&o.endTag&&Zt(o.endTag),m=ls(e,a.content);l&&h&&e.file&&(m.position={start:l.end,end:h.start}),s.content=m}return e.schema=n,s}function br(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Rm(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Rm(e,t,n){const r=Zt(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)El.call(n.attrs,a)&&(s[Ur(e.schema,a).property]=Zt(n.attrs[a]));n.startTag;const o=Zt(n.startTag),l=n.endTag?Zt(n.endTag):void 0,h={opening:o};l&&(h.closing=l),h.properties=s,t.data={position:h}}}return r}function Zt(e){const t=ua({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=ua({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function ua(e){return e.line&&e.column?e:void 0}var ha={}.hasOwnProperty;function bl(e,t){const n=t||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&ha.call(i,e)){const l=String(i[e]);a=ha.call(o,l)?o[l]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Om={},Dm={}.hasOwnProperty,xl=bl("type",{handlers:{root:Mm,element:Um,text:jm,comment:Hm,doctype:Fm}});function Pm(e,t){const n=(t||Om).space;return xl(e,n==="svg"?Ct:Zn)}function Mm(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=cs(e.children,n,t),mn(e,n),n}function Bm(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=cs(e.children,n,t),mn(e,n),n}function Fm(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return mn(e,t),t}function jm(e){const t={nodeName:"#text",value:e.value,parentNode:null};return mn(e,t),t}function Hm(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return mn(e,t),t}function Um(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ct);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&Dm.call(e.properties,s)){const l=zm(r,s,e.properties[s]);l&&i.push(l)}}const a=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Pt[a],childNodes:[],parentNode:null};return o.childNodes=cs(e.children,o,r),mn(e,o),e.tagName==="template"&&e.content&&(o.content=Bm(e.content,r)),o}function zm(e,t,n){const r=Ur(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?fl(n):pl(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=Pt[r.space]}return i}function cs(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=xl(e[r],n);s.parentNode=t,i.push(s)}return i}function mn(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var $m=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],qm=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));var Le={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function kl(e){return e>=55296&&e<=57343}function Ym(e){return e>=56320&&e<=57343}function Vm(e,t){return(e-55296)*1024+9216+t}function yl(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Cl(e){return e>=64976&&e<=65007||qm.has(e)}var O;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(O||(O={}));var Wm=65536,Qm=class{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Wm,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){const{line:n,col:r,offset:i}=this,s=r+t,a=i+t;return{code:e,startLine:n,endLine:n,startCol:s,endCol:s,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(Ym(t))return this.pos++,this._addGap(),Vm(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(O.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let n=0;n<e.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==e.charCodeAt(n))return!1;return!0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const n=this.html.charCodeAt(t);return n===T.CARRIAGE_RETURN?T.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let e=this.html.charCodeAt(this.pos);return e===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):e===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,kl(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===T.LINE_FEED||e===T.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){yl(e)?this._err(O.controlCharacterInInputStream):Cl(e)&&this._err(O.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},ne;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(ne||(ne={}));function _l(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var Gm=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ii,Km=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),qv=(ii=String.fromCodePoint)!==null&&ii!==void 0?ii:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Xm(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Km.get(e))!==null&&t!==void 0?t:e}var ye;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ye||(ye={}));var Zm=32,bt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bt||(bt={}));function wi(e){return e>=ye.ZERO&&e<=ye.NINE}function Jm(e){return e>=ye.UPPER_A&&e<=ye.UPPER_F||e>=ye.LOWER_A&&e<=ye.LOWER_F}function ef(e){return e>=ye.UPPER_A&&e<=ye.UPPER_Z||e>=ye.LOWER_A&&e<=ye.LOWER_Z||wi(e)}function tf(e){return e===ye.EQUALS||ef(e)}var ke;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ke||(ke={}));var lt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(lt||(lt={}));var nf=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ke.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=lt.Strict}startEntity(e){this.decodeMode=e,this.state=ke.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ke.EntityStart:return e.charCodeAt(t)===ye.NUM?(this.state=ke.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ke.NamedEntity,this.stateNamedEntity(e,t));case ke.NumericStart:return this.stateNumericStart(e,t);case ke.NumericDecimal:return this.stateNumericDecimal(e,t);case ke.NumericHex:return this.stateNumericHex(e,t);case ke.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Zm)===ye.LOWER_X?(this.state=ke.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ke.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(wi(r)||Jm(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(wi(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ye.SEMI)this.consumed+=1;else if(this.decodeMode===lt.Strict)return 0;return this.emitCodePoint(Xm(this.result),this.consumed),this.errors&&(e!==ye.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&bt.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=rf(n,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===lt.Attribute&&(i===0||tf(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&bt.VALUE_LENGTH)>>14,i!==0){if(s===ye.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==lt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&bt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~bt.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ke.NamedEntity:return this.result!==0&&(this.decodeMode!==lt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ke.NumericDecimal:return this.emitNumericEntity(0,2);case ke.NumericHex:return this.emitNumericEntity(0,3);case ke.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ke.EntityStart:return 0}}};function rf(e,t,n,r){const i=(t&bt.BRANCH_LENGTH)>>7,s=t&bt.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:e[n+l]-1}let a=n,o=a+i-1;for(;a<=o;){const l=a+o>>>1,h=e[l];if(h<r)a=l+1;else if(h>r)o=l-1;else return e[l+i]}return-1}var B;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(B||(B={}));var Mt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Mt||(Mt={}));var Ue;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ue||(Ue={}));var L;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(L||(L={}));var c;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(c||(c={}));var sf=new Map([[L.A,c.A],[L.ADDRESS,c.ADDRESS],[L.ANNOTATION_XML,c.ANNOTATION_XML],[L.APPLET,c.APPLET],[L.AREA,c.AREA],[L.ARTICLE,c.ARTICLE],[L.ASIDE,c.ASIDE],[L.B,c.B],[L.BASE,c.BASE],[L.BASEFONT,c.BASEFONT],[L.BGSOUND,c.BGSOUND],[L.BIG,c.BIG],[L.BLOCKQUOTE,c.BLOCKQUOTE],[L.BODY,c.BODY],[L.BR,c.BR],[L.BUTTON,c.BUTTON],[L.CAPTION,c.CAPTION],[L.CENTER,c.CENTER],[L.CODE,c.CODE],[L.COL,c.COL],[L.COLGROUP,c.COLGROUP],[L.DD,c.DD],[L.DESC,c.DESC],[L.DETAILS,c.DETAILS],[L.DIALOG,c.DIALOG],[L.DIR,c.DIR],[L.DIV,c.DIV],[L.DL,c.DL],[L.DT,c.DT],[L.EM,c.EM],[L.EMBED,c.EMBED],[L.FIELDSET,c.FIELDSET],[L.FIGCAPTION,c.FIGCAPTION],[L.FIGURE,c.FIGURE],[L.FONT,c.FONT],[L.FOOTER,c.FOOTER],[L.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[L.FORM,c.FORM],[L.FRAME,c.FRAME],[L.FRAMESET,c.FRAMESET],[L.H1,c.H1],[L.H2,c.H2],[L.H3,c.H3],[L.H4,c.H4],[L.H5,c.H5],[L.H6,c.H6],[L.HEAD,c.HEAD],[L.HEADER,c.HEADER],[L.HGROUP,c.HGROUP],[L.HR,c.HR],[L.HTML,c.HTML],[L.I,c.I],[L.IMG,c.IMG],[L.IMAGE,c.IMAGE],[L.INPUT,c.INPUT],[L.IFRAME,c.IFRAME],[L.KEYGEN,c.KEYGEN],[L.LABEL,c.LABEL],[L.LI,c.LI],[L.LINK,c.LINK],[L.LISTING,c.LISTING],[L.MAIN,c.MAIN],[L.MALIGNMARK,c.MALIGNMARK],[L.MARQUEE,c.MARQUEE],[L.MATH,c.MATH],[L.MENU,c.MENU],[L.META,c.META],[L.MGLYPH,c.MGLYPH],[L.MI,c.MI],[L.MO,c.MO],[L.MN,c.MN],[L.MS,c.MS],[L.MTEXT,c.MTEXT],[L.NAV,c.NAV],[L.NOBR,c.NOBR],[L.NOFRAMES,c.NOFRAMES],[L.NOEMBED,c.NOEMBED],[L.NOSCRIPT,c.NOSCRIPT],[L.OBJECT,c.OBJECT],[L.OL,c.OL],[L.OPTGROUP,c.OPTGROUP],[L.OPTION,c.OPTION],[L.P,c.P],[L.PARAM,c.PARAM],[L.PLAINTEXT,c.PLAINTEXT],[L.PRE,c.PRE],[L.RB,c.RB],[L.RP,c.RP],[L.RT,c.RT],[L.RTC,c.RTC],[L.RUBY,c.RUBY],[L.S,c.S],[L.SCRIPT,c.SCRIPT],[L.SEARCH,c.SEARCH],[L.SECTION,c.SECTION],[L.SELECT,c.SELECT],[L.SOURCE,c.SOURCE],[L.SMALL,c.SMALL],[L.SPAN,c.SPAN],[L.STRIKE,c.STRIKE],[L.STRONG,c.STRONG],[L.STYLE,c.STYLE],[L.SUB,c.SUB],[L.SUMMARY,c.SUMMARY],[L.SUP,c.SUP],[L.TABLE,c.TABLE],[L.TBODY,c.TBODY],[L.TEMPLATE,c.TEMPLATE],[L.TEXTAREA,c.TEXTAREA],[L.TFOOT,c.TFOOT],[L.TD,c.TD],[L.TH,c.TH],[L.THEAD,c.THEAD],[L.TITLE,c.TITLE],[L.TR,c.TR],[L.TRACK,c.TRACK],[L.TT,c.TT],[L.U,c.U],[L.UL,c.UL],[L.SVG,c.SVG],[L.VAR,c.VAR],[L.WBR,c.WBR],[L.XMP,c.XMP]]);function fn(e){var t;return(t=sf.get(e))!==null&&t!==void 0?t:c.UNKNOWN}var F=c,af={[B.HTML]:new Set([F.ADDRESS,F.APPLET,F.AREA,F.ARTICLE,F.ASIDE,F.BASE,F.BASEFONT,F.BGSOUND,F.BLOCKQUOTE,F.BODY,F.BR,F.BUTTON,F.CAPTION,F.CENTER,F.COL,F.COLGROUP,F.DD,F.DETAILS,F.DIR,F.DIV,F.DL,F.DT,F.EMBED,F.FIELDSET,F.FIGCAPTION,F.FIGURE,F.FOOTER,F.FORM,F.FRAME,F.FRAMESET,F.H1,F.H2,F.H3,F.H4,F.H5,F.H6,F.HEAD,F.HEADER,F.HGROUP,F.HR,F.HTML,F.IFRAME,F.IMG,F.INPUT,F.LI,F.LINK,F.LISTING,F.MAIN,F.MARQUEE,F.MENU,F.META,F.NAV,F.NOEMBED,F.NOFRAMES,F.NOSCRIPT,F.OBJECT,F.OL,F.P,F.PARAM,F.PLAINTEXT,F.PRE,F.SCRIPT,F.SECTION,F.SELECT,F.SOURCE,F.STYLE,F.SUMMARY,F.TABLE,F.TBODY,F.TD,F.TEMPLATE,F.TEXTAREA,F.TFOOT,F.TH,F.THEAD,F.TITLE,F.TR,F.TRACK,F.UL,F.WBR,F.XMP]),[B.MATHML]:new Set([F.MI,F.MO,F.MN,F.MS,F.MTEXT,F.ANNOTATION_XML]),[B.SVG]:new Set([F.TITLE,F.FOREIGN_OBJECT,F.DESC]),[B.XLINK]:new Set,[B.XML]:new Set,[B.XMLNS]:new Set},Li=new Set([F.H1,F.H2,F.H3,F.H4,F.H5,F.H6]),Yv=new Set([L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT]),x;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(x||(x={}));var be={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function of(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function Sn(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function lf(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function pt(e){return lf(e)||Sn(e)}function da(e){return pt(e)||of(e)}function hr(e){return e+32}function Al(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function ma(e){return Al(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function cf(e){return e===T.NULL?O.nullCharacterReference:e>1114111?O.characterReferenceOutsideUnicodeRange:kl(e)?O.surrogateCharacterReference:Cl(e)?O.noncharacterCharacterReference:yl(e)||e===T.CARRIAGE_RETURN?O.controlCharacterReference:null}var uf=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Qm(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new nf(Gm,(n,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(n)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(O.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(O.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const r=cf(n);r&&this._err(r,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)===null||r===void 0||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ne.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ne.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ne.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ne.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const n=this.currentToken;if(_l(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){const r=(e=(t=n.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(O.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=fn(e.tagName),e.type===ne.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(O.endTagWithAttributes),e.selfClosing&&this._err(O.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ne.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case ne.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case ne.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ne.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){const t=Al(e)?ne.WHITESPACE_CHARACTER:e===T.NULL?ne.NULL_CHARACTER:ne.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ne.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?lt.Attribute:lt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:this._stateData(e);break;case x.RCDATA:this._stateRcdata(e);break;case x.RAWTEXT:this._stateRawtext(e);break;case x.SCRIPT_DATA:this._stateScriptData(e);break;case x.PLAINTEXT:this._statePlaintext(e);break;case x.TAG_OPEN:this._stateTagOpen(e);break;case x.END_TAG_OPEN:this._stateEndTagOpen(e);break;case x.TAG_NAME:this._stateTagName(e);break;case x.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case x.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case x.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case x.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case x.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case x.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case x.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case x.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case x.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case x.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case x.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case x.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case x.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case x.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case x.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case x.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case x.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case x.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case x.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case x.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case x.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case x.BOGUS_COMMENT:this._stateBogusComment(e);break;case x.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case x.COMMENT_START:this._stateCommentStart(e);break;case x.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case x.COMMENT:this._stateComment(e);break;case x.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case x.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case x.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case x.COMMENT_END:this._stateCommentEnd(e);break;case x.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case x.DOCTYPE:this._stateDoctype(e);break;case x.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case x.DOCTYPE_NAME:this._stateDoctypeName(e);break;case x.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case x.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case x.CDATA_SECTION:this._stateCdataSection(e);break;case x.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case x.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case x.CHARACTER_REFERENCE:this._stateCharacterReference();break;case x.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case T.LESS_THAN_SIGN:this.state=x.TAG_OPEN;break;case T.AMPERSAND:this._startCharacterReference();break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitCodePoint(e);break;case T.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case T.AMPERSAND:this._startCharacterReference();break;case T.LESS_THAN_SIGN:this.state=x.RCDATA_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case T.LESS_THAN_SIGN:this.state=x.RAWTEXT_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(pt(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case T.EXCLAMATION_MARK:this.state=x.MARKUP_DECLARATION_OPEN;break;case T.SOLIDUS:this.state=x.END_TAG_OPEN;break;case T.QUESTION_MARK:this._err(O.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break;case T.EOF:this._err(O.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(O.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(pt(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case T.GREATER_THAN_SIGN:this._err(O.missingEndTagName),this.state=x.DATA;break;case T.EOF:this._err(O.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(O.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.BEFORE_ATTRIBUTE_NAME;break;case T.SOLIDUS:this.state=x.SELF_CLOSING_START_TAG;break;case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentTagToken();break;case T.NULL:this._err(O.unexpectedNullCharacter),t.tagName+="�";break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(Sn(e)?hr(e):e)}}_stateRcdataLessThanSign(e){e===T.SOLIDUS?this.state=x.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){pt(e)?(this.state=x.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=x.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=x.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=x.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===T.SOLIDUS?this.state=x.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){pt(e)?(this.state=x.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case T.SOLIDUS:this.state=x.SCRIPT_DATA_END_TAG_OPEN;break;case T.EXCLAMATION_MARK:this.state=x.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=x.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){pt(e)?(this.state=x.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===T.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===T.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case T.HYPHEN_MINUS:this.state=x.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case T.HYPHEN_MINUS:this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case T.GREATER_THAN_SIGN:this.state=x.SCRIPT_DATA,this._emitChars(">");break;case T.NULL:this._err(O.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===T.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:pt(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){pt(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Le.SCRIPT,!1)&&ma(this.preprocessor.peek(Le.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Le.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case T.HYPHEN_MINUS:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case T.NULL:this._err(O.unexpectedNullCharacter),this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case T.HYPHEN_MINUS:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case T.NULL:this._err(O.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:this._emitChars("-");break;case T.LESS_THAN_SIGN:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case T.GREATER_THAN_SIGN:this.state=x.SCRIPT_DATA,this._emitChars(">");break;case T.NULL:this._err(O.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case T.EOF:this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===T.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Le.SCRIPT,!1)&&ma(this.preprocessor.peek(Le.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Le.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case T.EQUALS_SIGN:this._err(O.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=x.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:this._leaveAttrName(),this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case T.EQUALS_SIGN:this._leaveAttrName(),this.state=x.BEFORE_ATTRIBUTE_VALUE;break;case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:this._err(O.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case T.NULL:this._err(O.unexpectedNullCharacter),this.currentAttr.name+="�";break;default:this.currentAttr.name+=String.fromCodePoint(Sn(e)?hr(e):e)}}_stateAfterAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:this.state=x.SELF_CLOSING_START_TAG;break;case T.EQUALS_SIGN:this.state=x.BEFORE_ATTRIBUTE_VALUE;break;case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentTagToken();break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:this.state=x.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case T.APOSTROPHE:this.state=x.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case T.GREATER_THAN_SIGN:this._err(O.missingAttributeValue),this.state=x.DATA,this.emitCurrentTagToken();break;default:this.state=x.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case T.QUOTATION_MARK:this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case T.AMPERSAND:this._startCharacterReference();break;case T.NULL:this._err(O.unexpectedNullCharacter),this.currentAttr.value+="�";break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case T.APOSTROPHE:this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case T.AMPERSAND:this._startCharacterReference();break;case T.NULL:this._err(O.unexpectedNullCharacter),this.currentAttr.value+="�";break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break;case T.AMPERSAND:this._startCharacterReference();break;case T.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break;case T.NULL:this._err(O.unexpectedNullCharacter),this.currentAttr.value+="�";break;case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:this._err(O.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break;case T.SOLIDUS:this._leaveAttrValue(),this.state=x.SELF_CLOSING_START_TAG;break;case T.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break;case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this._err(O.missingWhitespaceBetweenAttributes),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case T.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=x.DATA,this.emitCurrentTagToken();break}case T.EOF:this._err(O.eofInTag),this._emitEOFToken();break;default:this._err(O.unexpectedSolidusInTag),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentComment(t);break;case T.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case T.NULL:this._err(O.unexpectedNullCharacter),t.data+="�";break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Le.DASH_DASH,!0)?(this._createCommentToken(Le.DASH_DASH.length+1),this.state=x.COMMENT_START):this._consumeSequenceIfMatch(Le.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Le.DOCTYPE.length+1),this.state=x.DOCTYPE):this._consumeSequenceIfMatch(Le.CDATA_START,!0)?this.inForeignNode?this.state=x.CDATA_SECTION:(this._err(O.cdataInHtmlContent),this._createCommentToken(Le.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=x.BOGUS_COMMENT):this._ensureHibernation()||(this._err(O.incorrectlyOpenedComment),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case T.HYPHEN_MINUS:this.state=x.COMMENT_START_DASH;break;case T.GREATER_THAN_SIGN:{this._err(O.abruptClosingOfEmptyComment),this.state=x.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:this.state=x.COMMENT_END;break;case T.GREATER_THAN_SIGN:this._err(O.abruptClosingOfEmptyComment),this.state=x.DATA,this.emitCurrentComment(t);break;case T.EOF:this._err(O.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:this.state=x.COMMENT_END_DASH;break;case T.LESS_THAN_SIGN:t.data+="<",this.state=x.COMMENT_LESS_THAN_SIGN;break;case T.NULL:this._err(O.unexpectedNullCharacter),t.data+="�";break;case T.EOF:this._err(O.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case T.EXCLAMATION_MARK:t.data+="!",this.state=x.COMMENT_LESS_THAN_SIGN_BANG;break;case T.LESS_THAN_SIGN:t.data+="<";break;default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===T.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=x.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===T.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=x.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==T.GREATER_THAN_SIGN&&e!==T.EOF&&this._err(O.nestedComment),this.state=x.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:this.state=x.COMMENT_END;break;case T.EOF:this._err(O.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentComment(t);break;case T.EXCLAMATION_MARK:this.state=x.COMMENT_END_BANG;break;case T.HYPHEN_MINUS:t.data+="-";break;case T.EOF:this._err(O.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:t.data+="--!",this.state=x.COMMENT_END_DASH;break;case T.GREATER_THAN_SIGN:this._err(O.incorrectlyClosedComment),this.state=x.DATA,this.emitCurrentComment(t);break;case T.EOF:this._err(O.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--!",this.state=x.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.BEFORE_DOCTYPE_NAME;break;case T.GREATER_THAN_SIGN:this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case T.EOF:{this._err(O.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(O.missingWhitespaceBeforeDoctypeName),this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Sn(e))this._createDoctypeToken(String.fromCharCode(hr(e))),this.state=x.DOCTYPE_NAME;else switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:this._err(O.unexpectedNullCharacter),this._createDoctypeToken("�"),this.state=x.DOCTYPE_NAME;break;case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=x.DATA;break}case T.EOF:{this._err(O.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=x.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.AFTER_DOCTYPE_NAME;break;case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.NULL:this._err(O.unexpectedNullCharacter),t.name+="�";break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(Sn(e)?hr(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(Le.PUBLIC,!1)?this.state=x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Le.SYSTEM,!1)?this.state=x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(O.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case T.QUOTATION_MARK:this._err(O.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:this._err(O.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case T.GREATER_THAN_SIGN:this._err(O.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:t.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:t.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case T.GREATER_THAN_SIGN:this._err(O.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case T.QUOTATION_MARK:this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case T.NULL:this._err(O.unexpectedNullCharacter),t.publicId+="�";break;case T.GREATER_THAN_SIGN:this._err(O.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case T.APOSTROPHE:this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case T.NULL:this._err(O.unexpectedNullCharacter),t.publicId+="�";break;case T.GREATER_THAN_SIGN:this._err(O.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case T.GREATER_THAN_SIGN:this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.QUOTATION_MARK:this._err(O.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:this._err(O.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.QUOTATION_MARK:t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:this.state=x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case T.QUOTATION_MARK:this._err(O.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:this._err(O.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case T.GREATER_THAN_SIGN:this._err(O.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case T.APOSTROPHE:t.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case T.GREATER_THAN_SIGN:this._err(O.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(t);break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case T.QUOTATION_MARK:this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case T.NULL:this._err(O.unexpectedNullCharacter),t.systemId+="�";break;case T.GREATER_THAN_SIGN:this._err(O.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case T.APOSTROPHE:this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case T.NULL:this._err(O.unexpectedNullCharacter),t.systemId+="�";break;case T.GREATER_THAN_SIGN:this._err(O.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.EOF:this._err(O.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(O.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=x.DATA;break;case T.NULL:this._err(O.unexpectedNullCharacter);break;case T.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case T.RIGHT_SQUARE_BRACKET:this.state=x.CDATA_SECTION_BRACKET;break;case T.EOF:this._err(O.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===T.RIGHT_SQUARE_BRACKET?this.state=x.CDATA_SECTION_END:(this._emitChars("]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case T.GREATER_THAN_SIGN:this.state=x.DATA;break;case T.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&da(this.preprocessor.peek(1))?x.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){da(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===T.SEMICOLON&&this._err(O.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},vl=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),fa=new Set([...vl,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),_r=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),hf=new Set([..._r,c.OL,c.UL]),df=new Set([..._r,c.BUTTON]),pa=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),ga=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),mf=new Set([c.TR,c.TEMPLATE,c.HTML]),ff=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),pf=new Set([c.TABLE,c.TEMPLATE,c.HTML]),gf=new Set([c.TD,c.TH]),Ef=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===B.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==B.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Li,B.HTML)}popUntilTableCellPopped(){this.popUntilPopped(gf,B.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(pf,B.HTML)}clearBackToTableBodyContext(){this.clearBackTo(ff,B.HTML)}clearBackToTableRowContext(){this.clearBackTo(mf,B.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case B.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case B.SVG:if(ga.has(r))return!1;break;case B.MATHML:if(pa.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,_r)}hasInListItemScope(e){return this.hasInDynamicScope(e,hf)}hasInButtonScope(e){return this.hasInDynamicScope(e,df)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case B.HTML:if(Li.has(t))return!0;if(_r.has(t))return!1;break;case B.SVG:if(ga.has(t))return!1;break;case B.MATHML:if(pa.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===B.HTML)switch(this.tagIDs[t]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===B.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===B.HTML)switch(this.tagIDs[t]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&vl.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fa.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&fa.has(this.currentTagId);)this.pop()}},si=3,Ze;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ze||(Ze={}));var Ea={type:Ze.Marker},Tf=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,i=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let a=0;a<this.entries.length;a++){const o=this.entries[a];if(o.type===Ze.Marker)break;const{element:l}=o;if(this.treeAdapter.getTagName(l)===i&&this.treeAdapter.getNamespaceURI(l)===s){const h=this.treeAdapter.getAttrList(l);h.length===r&&n.push({idx:a,attrs:h})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<si)return;const t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<si)return;const r=new Map(t.map(s=>[s.name,s.value]));let i=0;for(let s=0;s<n.length;s++){const a=n[s];a.attrs.every(o=>r.get(o.name)===o.value)&&(i+=1,i>=si&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(Ea)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Ze.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Ze.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(Ea);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find(n=>n.type===Ze.Marker||this.treeAdapter.getTagName(n.element)===e);return t&&t.type===Ze.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Ze.Element&&t.element===e)}},gt={createDocument(){return{nodeName:"#document",mode:Ue.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};gt.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(gt.isTextNode(n)){n.value+=t;return}}gt.appendChild(e,gt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&>.isTextNode(r)?r.value+=t:gt.insertBefore(e,gt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Nl="html",bf="about:legacy-compat",xf="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Sl=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],kf=[...Sl,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],yf=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Il=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Cf=[...Il,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ta(e,t){return t.some(n=>e.startsWith(n))}function _f(e){return e.name===Nl&&e.publicId===null&&(e.systemId===null||e.systemId===bf)}function Af(e){if(e.name!==Nl)return Ue.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xf)return Ue.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),yf.has(n))return Ue.QUIRKS;let r=t===null?kf:Sl;if(Ta(n,r))return Ue.QUIRKS;if(r=t===null?Il:Cf,Ta(n,r))return Ue.LIMITED_QUIRKS}return Ue.NO_QUIRKS}var ba={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},vf="definitionurl",Nf="definitionURL",Sf=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),If=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:B.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:B.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:B.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:B.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:B.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:B.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:B.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:B.XML}],["xml:space",{prefix:"xml",name:"space",namespace:B.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:B.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:B.XMLNS}]]),wf=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Lf=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function Rf(e){const t=e.tagID;return t===c.FONT&&e.attrs.some(({name:n})=>n===Mt.COLOR||n===Mt.SIZE||n===Mt.FACE)||Lf.has(t)}function wl(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===vf){e.attrs[t].name=Nf;break}}function Ll(e){for(let t=0;t<e.attrs.length;t++){const n=Sf.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function us(e){for(let t=0;t<e.attrs.length;t++){const n=If.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Of(e){const t=wf.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=fn(e.tagName))}function Df(e,t){return t===B.MATHML&&(e===c.MI||e===c.MO||e===c.MN||e===c.MS||e===c.MTEXT)}function Pf(e,t,n){if(t===B.MATHML&&e===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Mt.ENCODING){const i=n[r].value.toLowerCase();return i===ba.TEXT_HTML||i===ba.APPLICATION_XML}}return t===B.SVG&&(e===c.FOREIGN_OBJECT||e===c.DESC||e===c.TITLE)}function Mf(e,t,n,r){return(!r||r===B.HTML)&&Pf(e,t,n)||(!r||r===B.MATHML)&&Df(e,t)}var Bf="hidden",Ff=8,jf=3,k;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(k||(k={}));var Hf={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Rl=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),xa={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:gt,onParseError:null},ka=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=k.INITIAL,this.originalInsertionMode=k.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...xa,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new uf(this.options,this),this.activeFormattingElements=new Tf(this.treeAdapter),this.fragmentContextID=n?fn(this.treeAdapter.getTagName(n)):c.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Ef(this.document,this.treeAdapter,this)}static parse(e,t){const n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){const n={...xa,...t};e!=null||(e=n.treeAdapter.createElement(L.TEMPLATE,B.HTML,[]));const r=n.treeAdapter.createElement("documentmock",B.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===c.TEMPLATE&&i.tmplInsertionModeStack.unshift(k.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){var r;if(!this.onParseError)return;const i=(r=e.location)!==null&&r!==void 0?r:Hf,s={code:t,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(s)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)===null||i===void 0||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)===null||r===void 0||r.call(n,e,this.openElements.current),t){let i,s;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,s=this.fragmentContextID):{current:i,currentTagId:s}=this.openElements,this._setContextModes(i,s)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===B.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,B.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=k.TEXT}switchToPlaintextParsing(){this.insertionMode=k.TEXT,this.originalInsertionMode=k.IN_BODY,this.tokenizer.state=be.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==B.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:this.tokenizer.state=be.RCDATA;break;case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:this.tokenizer.state=be.RAWTEXT;break;case c.SCRIPT:this.tokenizer.state=be.SCRIPT_DATA;break;case c.PLAINTEXT:this.tokenizer.state=be.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,B.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,B.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(L.HTML,B.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:s,endCol:a,endOffset:o}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:s,endCol:a,endOffset:o})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===ne.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(t)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===B.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,B.HTML)}_processToken(e){switch(e.type){case ne.CHARACTER:this.onCharacter(e);break;case ne.NULL_CHARACTER:this.onNullCharacter(e);break;case ne.COMMENT:this.onComment(e);break;case ne.DOCTYPE:this.onDoctype(e);break;case ne.START_TAG:this._processStartTag(e);break;case ne.END_TAG:this.onEndTag(e);break;case ne.EOF:this.onEof(e);break;case ne.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){const r=this.treeAdapter.getNamespaceURI(t),i=this.treeAdapter.getAttrList(t);return Mf(e,r,i,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(r=>r.type===Ze.Marker||this.openElements.contains(r.element)),n=t===-1?e-1:t-1;for(let r=n;r>=0;r--){const i=this.activeFormattingElements.entries[r];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=k.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:this.insertionMode=k.IN_ROW;return;case c.TBODY:case c.THEAD:case c.TFOOT:this.insertionMode=k.IN_TABLE_BODY;return;case c.CAPTION:this.insertionMode=k.IN_CAPTION;return;case c.COLGROUP:this.insertionMode=k.IN_COLUMN_GROUP;return;case c.TABLE:this.insertionMode=k.IN_TABLE;return;case c.BODY:this.insertionMode=k.IN_BODY;return;case c.FRAMESET:this.insertionMode=k.IN_FRAMESET;return;case c.SELECT:this._resetInsertionModeForSelect(e);return;case c.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case c.HTML:this.insertionMode=this.headElement?k.AFTER_HEAD:k.BEFORE_HEAD;return;case c.TD:case c.TH:if(e>0){this.insertionMode=k.IN_CELL;return}break;case c.HEAD:if(e>0){this.insertionMode=k.IN_HEAD;return}}this.insertionMode=k.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const n=this.openElements.tagIDs[t];if(n===c.TEMPLATE)break;if(n===c.TABLE){this.insertionMode=k.IN_SELECT_IN_TABLE;return}}this.insertionMode=k.IN_SELECT}_isElementCausesFosterParenting(e){return Rl.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===B.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case c.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return af[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gg(this,e);return}switch(this.insertionMode){case k.INITIAL:yn(this,e);break;case k.BEFORE_HTML:Ln(this,e);break;case k.BEFORE_HEAD:Rn(this,e);break;case k.IN_HEAD:On(this,e);break;case k.IN_HEAD_NO_SCRIPT:Dn(this,e);break;case k.AFTER_HEAD:Pn(this,e);break;case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:Dl(this,e);break;case k.TEXT:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:ai(this,e);break;case k.IN_TABLE_TEXT:Hl(this,e);break;case k.IN_COLUMN_GROUP:Ar(this,e);break;case k.AFTER_BODY:vr(this,e);break;case k.AFTER_AFTER_BODY:xr(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){pg(this,e);return}switch(this.insertionMode){case k.INITIAL:yn(this,e);break;case k.BEFORE_HTML:Ln(this,e);break;case k.BEFORE_HEAD:Rn(this,e);break;case k.IN_HEAD:On(this,e);break;case k.IN_HEAD_NO_SCRIPT:Dn(this,e);break;case k.AFTER_HEAD:Pn(this,e);break;case k.TEXT:this._insertCharacters(e);break;case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:ai(this,e);break;case k.IN_COLUMN_GROUP:Ar(this,e);break;case k.AFTER_BODY:vr(this,e);break;case k.AFTER_AFTER_BODY:xr(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ri(this,e);return}switch(this.insertionMode){case k.INITIAL:case k.BEFORE_HTML:case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_TEMPLATE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:Ri(this,e);break;case k.IN_TABLE_TEXT:Cn(this,e);break;case k.AFTER_BODY:Wf(this,e);break;case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:Qf(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case k.INITIAL:Gf(this,e);break;case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:this._err(e,O.misplacedDoctype);break;case k.IN_TABLE_TEXT:Cn(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,O.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Eg(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case k.INITIAL:yn(this,e);break;case k.BEFORE_HTML:Kf(this,e);break;case k.BEFORE_HEAD:Zf(this,e);break;case k.IN_HEAD:We(this,e);break;case k.IN_HEAD_NO_SCRIPT:tp(this,e);break;case k.AFTER_HEAD:rp(this,e);break;case k.IN_BODY:_e(this,e);break;case k.IN_TABLE:un(this,e);break;case k.IN_TABLE_TEXT:Cn(this,e);break;case k.IN_CAPTION:Jp(this,e);break;case k.IN_COLUMN_GROUP:ms(this,e);break;case k.IN_TABLE_BODY:qr(this,e);break;case k.IN_ROW:Yr(this,e);break;case k.IN_CELL:ng(this,e);break;case k.IN_SELECT:$l(this,e);break;case k.IN_SELECT_IN_TABLE:ig(this,e);break;case k.IN_TEMPLATE:ag(this,e);break;case k.AFTER_BODY:lg(this,e);break;case k.IN_FRAMESET:cg(this,e);break;case k.AFTER_FRAMESET:hg(this,e);break;case k.AFTER_AFTER_BODY:mg(this,e);break;case k.AFTER_AFTER_FRAMESET:fg(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Tg(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case k.INITIAL:yn(this,e);break;case k.BEFORE_HTML:Xf(this,e);break;case k.BEFORE_HEAD:Jf(this,e);break;case k.IN_HEAD:ep(this,e);break;case k.IN_HEAD_NO_SCRIPT:np(this,e);break;case k.AFTER_HEAD:ip(this,e);break;case k.IN_BODY:$r(this,e);break;case k.TEXT:$p(this,e);break;case k.IN_TABLE:Un(this,e);break;case k.IN_TABLE_TEXT:Cn(this,e);break;case k.IN_CAPTION:eg(this,e);break;case k.IN_COLUMN_GROUP:tg(this,e);break;case k.IN_TABLE_BODY:Oi(this,e);break;case k.IN_ROW:zl(this,e);break;case k.IN_CELL:rg(this,e);break;case k.IN_SELECT:ql(this,e);break;case k.IN_SELECT_IN_TABLE:sg(this,e);break;case k.IN_TEMPLATE:og(this,e);break;case k.AFTER_BODY:Vl(this,e);break;case k.IN_FRAMESET:ug(this,e);break;case k.AFTER_FRAMESET:dg(this,e);break;case k.AFTER_AFTER_BODY:xr(this,e)}}onEof(e){switch(this.insertionMode){case k.INITIAL:yn(this,e);break;case k.BEFORE_HTML:Ln(this,e);break;case k.BEFORE_HEAD:Rn(this,e);break;case k.IN_HEAD:On(this,e);break;case k.IN_HEAD_NO_SCRIPT:Dn(this,e);break;case k.AFTER_HEAD:Pn(this,e);break;case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:Fl(this,e);break;case k.TEXT:qp(this,e);break;case k.IN_TABLE_TEXT:Cn(this,e);break;case k.IN_TEMPLATE:Yl(this,e);break;case k.AFTER_BODY:case k.IN_FRAMESET:case k.AFTER_FRAMESET:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:ds(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===T.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.TEXT:case k.IN_COLUMN_GROUP:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:this._insertCharacters(e);break;case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:case k.AFTER_BODY:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:Ol(this,e);break;case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:ai(this,e);break;case k.IN_TABLE_TEXT:jl(this,e)}}};function Uf(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Bl(e,t),n}function zf(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function $f(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&s>=jf;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=qf(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function qf(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Yf(e,t,n){const r=e.treeAdapter.getTagName(t),i=fn(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===c.TEMPLATE&&s===B.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Vf(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function hs(e,t){for(let n=0;n<Ff;n++){const r=Uf(e,t);if(!r)break;const i=zf(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=$f(e,i,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),a&&Yf(e,a,s),Vf(e,i,r)}}function Ri(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Wf(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Qf(e,t){e._appendCommentNode(t,e.document)}function ds(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function Gf(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ue.QUIRKS:Af(t);_f(t)||e._err(t,O.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=k.BEFORE_HTML}function yn(e,t){e._err(t,O.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ue.QUIRKS),e.insertionMode=k.BEFORE_HTML,e._processToken(t)}function Kf(e,t){t.tagID===c.HTML?(e._insertElement(t,B.HTML),e.insertionMode=k.BEFORE_HEAD):Ln(e,t)}function Xf(e,t){const n=t.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Ln(e,t)}function Ln(e,t){e._insertFakeRootElement(),e.insertionMode=k.BEFORE_HEAD,e._processToken(t)}function Zf(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.HEAD:e._insertElement(t,B.HTML),e.headElement=e.openElements.current,e.insertionMode=k.IN_HEAD;break;default:Rn(e,t)}}function Jf(e,t){const n=t.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Rn(e,t):e._err(t,O.endTagWithoutMatchingOpenElement)}function Rn(e,t){e._insertFakeElement(L.HEAD,c.HEAD),e.headElement=e.openElements.current,e.insertionMode=k.IN_HEAD,e._processToken(t)}function We(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break;case c.TITLE:e._switchToTextParsing(t,be.RCDATA);break;case c.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,be.RAWTEXT):(e._insertElement(t,B.HTML),e.insertionMode=k.IN_HEAD_NO_SCRIPT);break;case c.NOFRAMES:case c.STYLE:e._switchToTextParsing(t,be.RAWTEXT);break;case c.SCRIPT:e._switchToTextParsing(t,be.SCRIPT_DATA);break;case c.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=k.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(k.IN_TEMPLATE);break;case c.HEAD:e._err(t,O.misplacedStartTagForHeadElement);break;default:On(e,t)}}function ep(e,t){switch(t.tagID){case c.HEAD:e.openElements.pop(),e.insertionMode=k.AFTER_HEAD;break;case c.BODY:case c.BR:case c.HTML:On(e,t);break;case c.TEMPLATE:zt(e,t);break;default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function zt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==c.TEMPLATE&&e._err(t,O.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(c.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,O.endTagWithoutMatchingOpenElement)}function On(e,t){e.openElements.pop(),e.insertionMode=k.AFTER_HEAD,e._processToken(t)}function tp(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:We(e,t);break;case c.NOSCRIPT:e._err(t,O.nestedNoscriptInHead);break;default:Dn(e,t)}}function np(e,t){switch(t.tagID){case c.NOSCRIPT:e.openElements.pop(),e.insertionMode=k.IN_HEAD;break;case c.BR:Dn(e,t);break;default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function Dn(e,t){const n=t.type===ne.EOF?O.openElementsLeftAfterEof:O.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=k.IN_HEAD,e._processToken(t)}function rp(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.BODY:e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=k.IN_BODY;break;case c.FRAMESET:e._insertElement(t,B.HTML),e.insertionMode=k.IN_FRAMESET;break;case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:e._err(t,O.abandonedHeadElementChild),e.openElements.push(e.headElement,c.HEAD),We(e,t),e.openElements.remove(e.headElement);break;case c.HEAD:e._err(t,O.misplacedStartTagForHeadElement);break;default:Pn(e,t)}}function ip(e,t){switch(t.tagID){case c.BODY:case c.HTML:case c.BR:Pn(e,t);break;case c.TEMPLATE:zt(e,t);break;default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function Pn(e,t){e._insertFakeElement(L.BODY,c.BODY),e.insertionMode=k.IN_BODY,zr(e,t)}function zr(e,t){switch(t.type){case ne.CHARACTER:Dl(e,t);break;case ne.WHITESPACE_CHARACTER:Ol(e,t);break;case ne.COMMENT:Ri(e,t);break;case ne.START_TAG:_e(e,t);break;case ne.END_TAG:$r(e,t);break;case ne.EOF:Fl(e,t)}}function Ol(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Dl(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function sp(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ap(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function op(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_FRAMESET)}function lp(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML)}function cp(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Li.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,B.HTML)}function up(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function hp(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML),n||(e.formElement=e.openElements.current))}function dp(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===c.LI&&i===c.LI||(n===c.DD||n===c.DT)&&(i===c.DD||i===c.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==c.ADDRESS&&i!==c.DIV&&i!==c.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML)}function mp(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.tokenizer.state=be.PLAINTEXT}function fp(e,t){e.openElements.hasInScope(c.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.framesetOk=!1}function pp(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&(hs(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gp(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ep(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(c.NOBR)&&(hs(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Tp(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function bp(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ue.QUIRKS&&e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=k.IN_TABLE}function Pl(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,B.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ml(e){const t=_l(e,Mt.TYPE);return t!=null&&t.toLowerCase()===Bf}function xp(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,B.HTML),Ml(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function kp(e,t){e._appendElement(t,B.HTML),t.ackSelfClosing=!0}function yp(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._appendElement(t,B.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Cp(e,t){t.tagName=L.IMG,t.tagID=c.IMG,Pl(e,t)}function _p(e,t){e._insertElement(t,B.HTML),e.skipNextNewLine=!0,e.tokenizer.state=be.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=k.TEXT}function Ap(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,be.RAWTEXT)}function vp(e,t){e.framesetOk=!1,e._switchToTextParsing(t,be.RAWTEXT)}function ya(e,t){e._switchToTextParsing(t,be.RAWTEXT)}function Np(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===k.IN_TABLE||e.insertionMode===k.IN_CAPTION||e.insertionMode===k.IN_TABLE_BODY||e.insertionMode===k.IN_ROW||e.insertionMode===k.IN_CELL?k.IN_SELECT_IN_TABLE:k.IN_SELECT}function Sp(e,t){e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML)}function Ip(e,t){e.openElements.hasInScope(c.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,B.HTML)}function wp(e,t){e.openElements.hasInScope(c.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(c.RTC),e._insertElement(t,B.HTML)}function Lp(e,t){e._reconstructActiveFormattingElements(),wl(t),us(t),t.selfClosing?e._appendElement(t,B.MATHML):e._insertElement(t,B.MATHML),t.ackSelfClosing=!0}function Rp(e,t){e._reconstructActiveFormattingElements(),Ll(t),us(t),t.selfClosing?e._appendElement(t,B.SVG):e._insertElement(t,B.SVG),t.ackSelfClosing=!0}function Ca(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML)}function _e(e,t){switch(t.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:gp(e,t);break;case c.A:pp(e,t);break;case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:cp(e,t);break;case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:lp(e,t);break;case c.LI:case c.DD:case c.DT:dp(e,t);break;case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:Pl(e,t);break;case c.HR:yp(e,t);break;case c.RB:case c.RTC:Ip(e,t);break;case c.RT:case c.RP:wp(e,t);break;case c.PRE:case c.LISTING:up(e,t);break;case c.XMP:Ap(e,t);break;case c.SVG:Rp(e,t);break;case c.HTML:sp(e,t);break;case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:We(e,t);break;case c.BODY:ap(e,t);break;case c.FORM:hp(e,t);break;case c.NOBR:Ep(e,t);break;case c.MATH:Lp(e,t);break;case c.TABLE:bp(e,t);break;case c.INPUT:xp(e,t);break;case c.PARAM:case c.TRACK:case c.SOURCE:kp(e,t);break;case c.IMAGE:Cp(e,t);break;case c.BUTTON:fp(e,t);break;case c.APPLET:case c.OBJECT:case c.MARQUEE:Tp(e,t);break;case c.IFRAME:vp(e,t);break;case c.SELECT:Np(e,t);break;case c.OPTION:case c.OPTGROUP:Sp(e,t);break;case c.NOEMBED:case c.NOFRAMES:ya(e,t);break;case c.FRAMESET:op(e,t);break;case c.TEXTAREA:_p(e,t);break;case c.NOSCRIPT:e.options.scriptingEnabled?ya(e,t):Ca(e,t);break;case c.PLAINTEXT:mp(e,t);break;case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:Ca(e,t)}}function Op(e,t){if(e.openElements.hasInScope(c.BODY)&&(e.insertionMode=k.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Dp(e,t){e.openElements.hasInScope(c.BODY)&&(e.insertionMode=k.AFTER_BODY,Vl(e,t))}function Pp(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Mp(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(c.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(c.FORM):n&&e.openElements.remove(n))}function Bp(e){e.openElements.hasInButtonScope(c.P)||e._insertFakeElement(L.P,c.P),e._closePElement()}function Fp(e){e.openElements.hasInListItemScope(c.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(c.LI),e.openElements.popUntilTagNamePopped(c.LI))}function jp(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Hp(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Up(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function zp(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(L.BR,c.BR),e.openElements.pop(),e.framesetOk=!1}function Bl(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],a=e.openElements.tagIDs[i];if(r===a&&(r!==c.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,a))break}}function $r(e,t){switch(t.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:hs(e,t);break;case c.P:Bp(e);break;case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:Pp(e,t);break;case c.LI:Fp(e);break;case c.DD:case c.DT:jp(e,t);break;case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:Hp(e);break;case c.BR:zp(e);break;case c.BODY:Op(e,t);break;case c.HTML:Dp(e,t);break;case c.FORM:Mp(e);break;case c.APPLET:case c.OBJECT:case c.MARQUEE:Up(e,t);break;case c.TEMPLATE:zt(e,t);break;default:Bl(e,t)}}function Fl(e,t){e.tmplInsertionModeStack.length>0?Yl(e,t):ds(e,t)}function $p(e,t){var n;t.tagID===c.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function qp(e,t){e._err(t,O.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ai(e,t){if(e.openElements.currentTagId!==void 0&&Rl.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=k.IN_TABLE_TEXT,t.type){case ne.CHARACTER:Hl(e,t);break;case ne.WHITESPACE_CHARACTER:jl(e,t)}else Jn(e,t)}function Yp(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_CAPTION}function Vp(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_COLUMN_GROUP}function Wp(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(L.COLGROUP,c.COLGROUP),e.insertionMode=k.IN_COLUMN_GROUP,ms(e,t)}function Qp(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_TABLE_BODY}function Gp(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(L.TBODY,c.TBODY),e.insertionMode=k.IN_TABLE_BODY,qr(e,t)}function Kp(e,t){e.openElements.hasInTableScope(c.TABLE)&&(e.openElements.popUntilTagNamePopped(c.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Xp(e,t){Ml(t)?e._appendElement(t,B.HTML):Jn(e,t),t.ackSelfClosing=!0}function Zp(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,B.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function un(e,t){switch(t.tagID){case c.TD:case c.TH:case c.TR:Gp(e,t);break;case c.STYLE:case c.SCRIPT:case c.TEMPLATE:We(e,t);break;case c.COL:Wp(e,t);break;case c.FORM:Zp(e,t);break;case c.TABLE:Kp(e,t);break;case c.TBODY:case c.TFOOT:case c.THEAD:Qp(e,t);break;case c.INPUT:Xp(e,t);break;case c.CAPTION:Yp(e,t);break;case c.COLGROUP:Vp(e,t);break;default:Jn(e,t)}}function Un(e,t){switch(t.tagID){case c.TABLE:e.openElements.hasInTableScope(c.TABLE)&&(e.openElements.popUntilTagNamePopped(c.TABLE),e._resetInsertionMode());break;case c.TEMPLATE:zt(e,t);break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Jn(e,t)}}function Jn(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,zr(e,t),e.fosterParentingEnabled=n}function jl(e,t){e.pendingCharacterTokens.push(t)}function Hl(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Cn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Jn(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Ul=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function Jp(e,t){const n=t.tagID;Ul.has(n)?e.openElements.hasInTableScope(c.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_TABLE,un(e,t)):_e(e,t)}function eg(e,t){const n=t.tagID;switch(n){case c.CAPTION:case c.TABLE:e.openElements.hasInTableScope(c.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_TABLE,n===c.TABLE&&Un(e,t));break;case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:$r(e,t)}}function ms(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.COL:e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break;case c.TEMPLATE:We(e,t);break;default:Ar(e,t)}}function tg(e,t){switch(t.tagID){case c.COLGROUP:e.openElements.currentTagId===c.COLGROUP&&(e.openElements.pop(),e.insertionMode=k.IN_TABLE);break;case c.TEMPLATE:zt(e,t);break;case c.COL:break;default:Ar(e,t)}}function Ar(e,t){e.openElements.currentTagId===c.COLGROUP&&(e.openElements.pop(),e.insertionMode=k.IN_TABLE,e._processToken(t))}function qr(e,t){switch(t.tagID){case c.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_ROW;break;case c.TH:case c.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(L.TR,c.TR),e.insertionMode=k.IN_ROW,Yr(e,t);break;case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE,un(e,t));break;default:un(e,t)}}function Oi(e,t){const n=t.tagID;switch(t.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE);break;case c.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE,Un(e,t));break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Un(e,t)}}function Yr(e,t){switch(t.tagID){case c.TH:case c.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,B.HTML),e.insertionMode=k.IN_CELL,e.activeFormattingElements.insertMarker();break;case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,qr(e,t));break;default:un(e,t)}}function zl(e,t){switch(t.tagID){case c.TR:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY);break;case c.TABLE:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,Oi(e,t));break;case c.TBODY:case c.TFOOT:case c.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(c.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,Oi(e,t));break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Un(e,t)}}function ng(e,t){const n=t.tagID;Ul.has(n)?(e.openElements.hasInTableScope(c.TD)||e.openElements.hasInTableScope(c.TH))&&(e._closeTableCell(),Yr(e,t)):_e(e,t)}function rg(e,t){const n=t.tagID;switch(n){case c.TD:case c.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_ROW);break;case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),zl(e,t));break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:$r(e,t)}}function $l(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.OPTION:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e._insertElement(t,B.HTML);break;case c.OPTGROUP:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop(),e._insertElement(t,B.HTML);break;case c.HR:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop(),e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break;case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:e.openElements.hasInSelectScope(c.SELECT)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),t.tagID!==c.SELECT&&e._processStartTag(t));break;case c.SCRIPT:case c.TEMPLATE:We(e,t)}}function ql(e,t){switch(t.tagID){case c.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===c.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===c.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop();break;case c.OPTION:e.openElements.currentTagId===c.OPTION&&e.openElements.pop();break;case c.SELECT:e.openElements.hasInSelectScope(c.SELECT)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode());break;case c.TEMPLATE:zt(e,t)}}function ig(e,t){const n=t.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),e._processStartTag(t)):$l(e,t)}function sg(e,t){const n=t.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ql(e,t)}function ag(e,t){switch(t.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:We(e,t);break;case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:e.tmplInsertionModeStack[0]=k.IN_TABLE,e.insertionMode=k.IN_TABLE,un(e,t);break;case c.COL:e.tmplInsertionModeStack[0]=k.IN_COLUMN_GROUP,e.insertionMode=k.IN_COLUMN_GROUP,ms(e,t);break;case c.TR:e.tmplInsertionModeStack[0]=k.IN_TABLE_BODY,e.insertionMode=k.IN_TABLE_BODY,qr(e,t);break;case c.TD:case c.TH:e.tmplInsertionModeStack[0]=k.IN_ROW,e.insertionMode=k.IN_ROW,Yr(e,t);break;default:e.tmplInsertionModeStack[0]=k.IN_BODY,e.insertionMode=k.IN_BODY,_e(e,t)}}function og(e,t){t.tagID===c.TEMPLATE&&zt(e,t)}function Yl(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(c.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ds(e,t)}function lg(e,t){t.tagID===c.HTML?_e(e,t):vr(e,t)}function Vl(e,t){var n;if(t.tagID===c.HTML){if(e.fragmentContext||(e.insertionMode=k.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===c.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else vr(e,t)}function vr(e,t){e.insertionMode=k.IN_BODY,zr(e,t)}function cg(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.FRAMESET:e._insertElement(t,B.HTML);break;case c.FRAME:e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break;case c.NOFRAMES:We(e,t)}}function ug(e,t){t.tagID===c.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==c.FRAMESET&&(e.insertionMode=k.AFTER_FRAMESET))}function hg(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.NOFRAMES:We(e,t)}}function dg(e,t){t.tagID===c.HTML&&(e.insertionMode=k.AFTER_AFTER_FRAMESET)}function mg(e,t){t.tagID===c.HTML?_e(e,t):xr(e,t)}function xr(e,t){e.insertionMode=k.IN_BODY,zr(e,t)}function fg(e,t){switch(t.tagID){case c.HTML:_e(e,t);break;case c.NOFRAMES:We(e,t)}}function pg(e,t){t.chars="�",e._insertCharacters(t)}function gg(e,t){e._insertCharacters(t),e.framesetOk=!1}function Wl(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==B.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Eg(e,t){if(Rf(t))Wl(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===B.MATHML?wl(t):r===B.SVG&&(Of(t),Ll(t)),us(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Tg(e,t){if(t.tagID===c.P||t.tagID===c.BR){Wl(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===B.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var Vv=new Set([L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR]),Vr=Ql("end"),nt=Ql("start");function Ql(e){return t;function t(n){const r=n&&n.position&&n.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 Gl(e){const t=nt(e),n=Vr(e);if(t&&n)return{start:t,end:n}}var bg=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,xg=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),_a={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Kl(e,t){const n=wg(e),r=bl("type",{handlers:{root:kg,element:yg,text:Cg,comment:Zl,doctype:_g,raw:vg},unknown:Ng}),i={parser:n?new ka(_a):ka.getFragmentParser(void 0,_a),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),pn(i,nt());const s=n?i.parser.document:i.parser.getFragment(),a=wm(s,{file:i.options.file});return i.stitches&&tt(a,"comment",function(o,l,h){const m=o;if(m.value.stitch&&h&&l!==void 0){const d=h.children;return d[l]=m.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Xl(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function kg(e,t){Xl(e.children,t)}function yg(e,t){Sg(e,t),Xl(e.children,t),Ig(e,t)}function Cg(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ne.CHARACTER,chars:e.value,location:er(e)};pn(t,nt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _g(e,t){const n={type:ne.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:er(e)};pn(t,nt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ag(e,t){t.stitches=!0;const n=Lg(e);"children"in e&&"children"in n&&(n.children=Kl({type:"root",children:e.children},t.options).children),Zl({type:"comment",value:{stitch:n}},t)}function Zl(e,t){const n=e.value,r={type:ne.COMMENT,data:n,location:er(e)};pn(t,nt(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function vg(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Jl(t,nt(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(bg,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function Ng(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ag(n,t);else{let r="";throw xg.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function pn(e,t){Jl(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=be.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Jl(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Sg(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===be.PLAINTEXT)return;pn(t,nt(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Pt.html;i===Pt.html&&n==="svg"&&(i=Pt.svg);const s=Pm({...e,children:[]},{space:i===Pt.svg?"svg":"html"}),a={type:ne.START_TAG,tagName:n,tagID:fn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:er(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ig(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&$m.includes(n)||t.parser.tokenizer.state===be.PLAINTEXT)return;pn(t,Vr(e));const r={type:ne.END_TAG,tagName:n,tagID:fn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:er(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===be.RCDATA||t.parser.tokenizer.state===be.RAWTEXT||t.parser.tokenizer.state===be.SCRIPT_DATA)&&(t.parser.tokenizer.state=be.DATA)}function wg(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function er(e){const t=nt(e)||{line:void 0,column:void 0,offset:void 0},n=Vr(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Lg(e){return"children"in e?Bt({...e,children:[]}):Bt(e)}function Di(e){return function(t,n){return Kl(t,{...e,file:n})}}var Nt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],wt={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Nt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Nt],h2:[["className","sr-only"]],img:[...Nt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Nt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Nt],table:[...Nt],ul:[...Nt,["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"]},Et={}.hasOwnProperty;function Rg(e,t){let n={type:"root",children:[]};const r=ec({schema:t?{...wt,...t}:wt,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function ec(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Og(e,n);case"doctype":return Dg(e,n);case"element":return Pg(e,n);case"root":return Mg(e,n);case"text":return Bg(e,n)}}}function Og(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return tr(i,t),i}}function Dg(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return tr(n,t),n}}function Pg(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=tc(e,t.children),i=Fg(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Et.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let l=-1;for(s=!1;++l<o.length;)e.stack.includes(o[l])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:i,children:r};return tr(a,t),a}function Mg(e,t){const n={type:"root",children:tc(e,t.children)};return tr(n,t),n}function Bg(e,t){const n={type:"text",value:typeof t.value=="string"?t.value:""};return tr(n,t),n}function tc(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=ec(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function Fg(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&Et.call(r,n)?r[n]:void 0,a=r&&Et.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},l={};let h;for(h in o)if(Et.call(o,h)){const m=o[h];let d=Aa(e,va(s,h),h,m);d==null&&(d=Aa(e,va(a,h),h,m)),d!=null&&(l[h]=d)}if(i&&Et.call(i,n)){const m=i[n];for(h in m)Et.call(m,h)&&!Et.call(l,h)&&(l[h]=m[h])}return l}function Aa(e,t,n,r){return t?Array.isArray(r)?jg(e,t,n,r):nc(e,t,n,r):void 0}function jg(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const a=nc(e,t,n,r[i]);(typeof a=="number"||typeof a=="string")&&s.push(a)}return s}function nc(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Hg(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const a=t[s];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){i=!0;break}}else if(a===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Hg(e,t,n){const r=e.schema.protocols&&Et.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),a=i.indexOf("?"),o=i.indexOf("#"),l=i.indexOf("/");if(s<0||l>-1&&s>l||a>-1&&s>a||o>-1&&s>o)return!0;let h=-1;for(;++h<r.length;){const m=r[h];if(s===m.length&&i.slice(0,m.length)===m)return!0}return!1}function tr(e,t){const n=Gl(t);t.data&&(e.data=Bt(t.data)),n&&(e.position=n)}function va(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function rc(e){return function(t){return Rg(t,e)}}function Na(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Ne=_t(/[A-Za-z]/),Ce=_t(/[\dA-Za-z]/),Ug=_t(/[#-'*+\--9=?A-Z^-~]/);function Nr(e){return e!==null&&(e<32||e===127)}var Pi=_t(/\d/),zg=_t(/[\dA-Fa-f]/),$g=_t(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function he(e){return e!==null&&(e<0||e===32)}function ie(e){return e===-2||e===-1||e===32}var Wr=_t(/\p{P}|\p{S}/u),Ft=_t(/\s/);function _t(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qg(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yg(e,t,n){const r=jr((n||{}).ignore||[]),i=Vg(t);let s=-1;for(;++s<i.length;)as(e,"text",a);function a(l,h){let m=-1,d;for(;++m<h.length;){const f=h[m],p=d?d.children:void 0;if(r(f,p?p.indexOf(f):void 0,d))return;d=f}if(d)return o(l,h)}function o(l,h){const m=h[h.length-1],d=i[s][0],f=i[s][1];let p=0;const g=m.children.indexOf(l);let _=!1,A=[];d.lastIndex=0;let b=d.exec(l.value);for(;b;){const v=b.index,S={index:b.index,input:b.input,stack:[...h,l]};let w=f(...b,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?d.lastIndex=v+1:(p!==v&&A.push({type:"text",value:l.value.slice(p,v)}),Array.isArray(w)?A.push(...w):w&&A.push(w),p=v+b[0].length,_=!0),!d.global)break;b=d.exec(l.value)}return _?(p<l.value.length&&A.push({type:"text",value:l.value.slice(p)}),m.children.splice(g,1,...A)):A=[l],g+A.length}}function Vg(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Wg(i[0]),Qg(i[1])])}return t}function Wg(e){return typeof e=="string"?new RegExp(qg(e),"g"):e}function Qg(e){return typeof e=="function"?e:function(){return e}}var oi="phrasing",li=["autolink","link","image","label"];function Gg(){return{transforms:[nE],enter:{literalAutolink:Xg,literalAutolinkEmail:ci,literalAutolinkHttp:ci,literalAutolinkWww:ci},exit:{literalAutolink:tE,literalAutolinkEmail:eE,literalAutolinkHttp:Zg,literalAutolinkWww:Jg}}}function Kg(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:oi,notInConstruct:li},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:oi,notInConstruct:li},{character:":",before:"[ps]",after:"\\/",inConstruct:oi,notInConstruct:li}]}}function Xg(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ci(e){this.config.enter.autolinkProtocol.call(this,e)}function Zg(e){this.config.exit.autolinkProtocol.call(this,e)}function Jg(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function eE(e){this.config.exit.autolinkEmail.call(this,e)}function tE(e){this.exit(e)}function nE(e){Yg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rE],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,iE]],{ignore:["link","linkReference"]})}function rE(e,t,n,r,i){let s="";if(!ic(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!sE(n)))return!1;const a=aE(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function iE(e,t,n,r){return!ic(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function aE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Na(e,"(");let s=Na(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function ic(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ft(n)||Wr(n))&&(!t||n!==47)}function Ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}sc.peek=pE;function oE(){this.buffer()}function lE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cE(){this.buffer()}function uE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ve(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dE(e){this.exit(e)}function mE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ve(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fE(e){this.exit(e)}function pE(){return"["}function sc(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function gE(){return{enter:{gfmFootnoteCallString:oE,gfmFootnoteCall:lE,gfmFootnoteDefinitionLabelString:cE,gfmFootnoteDefinition:uE},exit:{gfmFootnoteCallString:hE,gfmFootnoteCall:dE,gfmFootnoteDefinitionLabelString:mE,gfmFootnoteDefinition:fE}}}function EE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const h=s.enter("footnoteDefinition"),m=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),m(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
|
|
4
|
-
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?ac:TE))),h(),l}}function TE(e,t,n){return t===0?e:ac(e,t,n)}function ac(e,t,n){return(n?"":" ")+e}var bE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];oc.peek=_E;function xE(){return{canContainEols:["delete"],enter:{strikethrough:yE},exit:{strikethrough:CE}}}function kE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bE}],handlers:{delete:oc}}}function yE(e){this.enter({type:"delete",children:[]},e)}function CE(e){this.exit(e)}function oc(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function _E(){return"~"}function AE(e){return e.length}function vE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||AE,s=[],a=[],o=[],l=[];let h=0,m=-1;for(;++m<e.length;){const _=[],A=[];let b=-1;for(e[m].length>h&&(h=e[m].length);++b<e[m].length;){const v=NE(e[m][b]);if(n.alignDelimiters!==!1){const S=i(v);A[b]=S,(l[b]===void 0||S>l[b])&&(l[b]=S)}_.push(v)}a[m]=_,o[m]=A}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<h;)s[d]=Sa(r[d]);else{const _=Sa(r);for(;++d<h;)s[d]=_}d=-1;const f=[],p=[];for(;++d<h;){const _=s[d];let A="",b="";_===99?(A=":",b=":"):_===108?A=":":_===114&&(b=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[d]-A.length-b.length);const S=A+"-".repeat(v)+b;n.alignDelimiters!==!1&&(v=A.length+v+b.length,v>l[d]&&(l[d]=v),p[d]=v),f[d]=S}a.splice(1,0,f),o.splice(1,0,p),m=-1;const g=[];for(;++m<a.length;){const _=a[m],A=o[m];d=-1;const b=[];for(;++d<h;){const v=_[d]||"";let S="",w="";if(n.alignDelimiters!==!1){const R=l[d]-(A[d]||0),N=s[d];N===114?S=" ".repeat(R):N===99?R%2?(S=" ".repeat(R/2+.5),w=" ".repeat(R/2-.5)):(S=" ".repeat(R/2),w=S):w=" ".repeat(R)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(S),b.push(v),n.alignDelimiters!==!1&&b.push(w),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==h-1)&&b.push("|")}g.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return g.join(`
|
|
5
|
-
`)}function NE(e){return e==null?"":String(e)}function Sa(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function SE(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),IE);return i(),a}function IE(e,t,n){return">"+(n?"":" ")+e}function wE(e,t){return Ia(e,t.inConstruct,!0)&&!Ia(e,t.notInConstruct,!1)}function Ia(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function wa(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
-
`&&wE(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
7
|
-
`}function LE(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function RE(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function OE(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function DE(e,t,n,r){const i=OE(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(RE(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,PE);return d(),f}const o=n.createTracker(r),l=i.repeat(Math.max(LE(s,i)+1,3)),h=n.enter("codeFenced");let m=o.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);m+=o.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);m+=o.move(" "),m+=o.move(n.safe(e.meta,{before:m,after:`
|
|
8
|
-
`,encode:["`"],...o.current()})),d()}return m+=o.move(`
|
|
9
|
-
`),s&&(m+=o.move(s+`
|
|
10
|
-
`)),m+=o.move(l),h(),m}function PE(e,t,n){return(n?"":" ")+e}function fs(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ME(e,t,n,r){const i=fs(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let h=l.move("[");return h+=l.move(n.safe(n.associationId(e),{before:h,after:"]",...l.current()})),h+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(o=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
11
|
-
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),h+=l.move(" "+i),h+=l.move(n.safe(e.title,{before:h,after:i,...l.current()})),h+=l.move(i),o()),a(),h}function BE(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function zn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hn(e){if(e===null||he(e)||Ft(e))return 1;if(Wr(e))return 2}function Sr(e,t,n){const r=hn(e),i=hn(t);return r===void 0?i===void 0?n==="_"?{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}}lc.peek=FE;function lc(e,t,n,r){const i=BE(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const h=l.charCodeAt(0),m=Sr(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(l=zn(h)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Sr(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+zn(d));const p=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:m.outside},o+l+p}function FE(e,t,n){return n.options.emphasis||"*"}var jE={};function ps(e,t){const n=t||jE;return cc(e,typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,typeof n.includeHtml=="boolean"?n.includeHtml:!0)}function cc(e,t,n){if(HE(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return La(e.children,t,n)}return Array.isArray(e)?La(e,t,n):""}function La(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=cc(e[i],t,n);return r.join("")}function HE(e){return!!(e&&typeof e=="object")}function UE(e,t){let n=!1;return tt(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,!1}),!!((!e.depth||e.depth<3)&&ps(e)&&(t.options.setext||n))}function zE(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(UE(e,n)){const m=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
|
|
12
|
-
`,after:`
|
|
13
|
-
`});return d(),m(),f+`
|
|
14
|
-
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
15
|
-
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
16
|
-
`,...s.current()});return/^[\t ]/.test(h)&&(h=zn(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,n.options.closeAtx&&(h+=" "+a),l(),o(),h}uc.peek=$E;function uc(e){return e.value||""}function $E(){return"<"}hc.peek=qE;function hc(e,t,n,r){const i=fs(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let h=l.move("![");return h+=l.move(n.safe(e.alt,{before:h,after:"]",...l.current()})),h+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(o=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),h+=l.move(" "+i),h+=l.move(n.safe(e.title,{before:h,after:i,...l.current()})),h+=l.move(i),o()),h+=l.move(")"),a(),h}function qE(){return"!"}dc.peek=YE;function dc(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const h=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(h+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=m,s(),i==="full"||!h||h!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function YE(){return"!"}mc.peek=VE;function mc(e,t,n){let r=e.value||"",i="`",s=-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+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let h=l.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(l.index+1)}}return i+r+i}function VE(){return"`"}function fc(e,t){const n=ps(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}pc.peek=WE;function pc(e,t,n,r){const i=fs(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(fc(e,n)){const m=n.stack;n.stack=[],o=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),n.stack=m,d}o=n.enter("link"),l=n.enter("label");let h=a.move("[");return h+=a.move(n.containerPhrasing(e,{before:h,after:"](",...a.current()})),h+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(n.safe(e.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(l=n.enter("destinationRaw"),h+=a.move(n.safe(e.url,{before:h,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),h+=a.move(" "+i),h+=a.move(n.safe(e.title,{before:h,after:i,...a.current()})),h+=a.move(i),l()),h+=a.move(")"),o(),h}function WE(e,t,n){return fc(e,n)?"<":"["}gc.peek=QE;function gc(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const h=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(h+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=m,s(),i==="full"||!h||h!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function QE(){return"["}function gs(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function GE(e){const t=gs(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function KE(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ec(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XE(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?KE(n):gs(n);const o=e.ordered?a==="."?")":".":GE(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Ec(n)===a&&m){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const h=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),h}function ZE(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function JE(e,t,n,r){const i=ZE(n);let s=n.bulletCurrent||gs(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,o.current()),m);return l(),h;function m(d,f,p){return f?(p?"":" ".repeat(a))+d:(p?s:s+" ".repeat(a-s.length))+d}}function eT(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}var tT=jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function nT(e,t,n,r){return(e.children.some(function(i){return tT(i)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Tc.peek=iT;function Tc(e,t,n,r){const i=rT(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const h=l.charCodeAt(0),m=Sr(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(l=zn(h)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Sr(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+zn(d));const p=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:m.outside},o+l+p}function iT(e,t,n){return n.options.strong||"*"}function sT(e,t,n,r){return n.safe(e.value,r)}function aT(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function oT(e,t,n){const r=(Ec(n)+(n.options.ruleSpaces?" ":"")).repeat(aT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var bc={blockquote:SE,break:wa,code:DE,definition:ME,emphasis:lc,hardBreak:wa,heading:zE,html:uc,image:hc,imageReference:dc,inlineCode:mc,link:pc,linkReference:gc,list:XE,listItem:JE,paragraph:eT,root:nT,strong:Tc,text:sT,thematicBreak:oT},Ra=document.createElement("i");function Es(e){const t="&"+e+";";Ra.innerHTML=t;const n=Ra.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}var lT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cT(e){return e.replace(lT,uT)}function uT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),i=r===120||r===88;return xc(n.slice(i?2:1),i?16:10)}return Es(n)||e}function hT(){return{enter:{table:dT,tableData:Oa,tableHeader:Oa,tableRow:fT},exit:{codeText:pT,table:mT,tableData:ui,tableHeader:ui,tableRow:ui}}}function dT(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function mT(e){this.exit(e),this.data.inTable=void 0}function fT(e){this.enter({type:"tableRow",children:[]},e)}function ui(e){this.exit(e)}function Oa(e){this.enter({type:"tableCell",children:[]},e)}function pT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gT(e,t){return t==="|"?t:e}function ET(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
17
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:l,tableRow:o}};function a(p,g,_,A){return h(m(p,_,A),p.align)}function o(p,g,_,A){const b=h([d(p,_,A)]);return b.slice(0,b.indexOf(`
|
|
18
|
-
`))}function l(p,g,_,A){const b=_.enter("tableCell"),v=_.enter("phrasing"),S=_.containerPhrasing(p,{...A,before:s,after:s});return v(),b(),S}function h(p,g){return vE(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function m(p,g,_){const A=p.children;let b=-1;const v=[],S=g.enter("table");for(;++b<A.length;)v[b]=d(A[b],g,_);return S(),v}function d(p,g,_){const A=p.children;let b=-1;const v=[],S=g.enter("tableRow");for(;++b<A.length;)v[b]=l(A[b],p,g,_);return S(),v}function f(p,g,_){let A=bc.inlineCode(p,g,_);return _.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function TT(){return{exit:{taskListCheckValueChecked:Da,taskListCheckValueUnchecked:Da,paragraph:xT}}}function bT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kT}}}function Da(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function xT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function kT(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=bc.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),l;function h(m){return m+a}}function yT(){return[Gg(),gE(),xE(),hT(),TT()]}function CT(e){return{extensions:[Kg(),EE(e),kE(),ET(e),bT()]}}function Fe(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ze(e,t){return e.length>0?(Fe(e,e.length,0,t),e):t}var Pa={}.hasOwnProperty;function kc(e){const t={};let n=-1;for(;++n<e.length;)_T(t,e[n]);return t}function _T(e,t){let n;for(n in t){const r=(Pa.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Pa.call(r,s)||(r[s]=[]);const a=i[s];AT(r[s],Array.isArray(a)?a:a?[a]:[])}}}function AT(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Fe(e,0,0,r)}var vT={tokenize:RT,partial:!0},yc={tokenize:OT,partial:!0},Cc={tokenize:DT,partial:!0},_c={tokenize:PT,partial:!0},NT={tokenize:MT,partial:!0},Ac={name:"wwwAutolink",tokenize:wT,previous:Nc},vc={name:"protocolAutolink",tokenize:LT,previous:Sc},ht={name:"emailAutolink",tokenize:IT,previous:Ic},rt={};function ST(){return{text:rt}}var St=48;for(;St<123;)rt[St]=ht,St++,St===58?St=65:St===91&&(St=97);rt[43]=ht;rt[45]=ht;rt[46]=ht;rt[95]=ht;rt[72]=[ht,vc];rt[104]=[ht,vc];rt[87]=[ht,Ac];rt[119]=[ht,Ac];function IT(e,t,n){const r=this;let i,s;return a;function a(d){return!Mi(d)||!Ic.call(r,r.previous)||Ts(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Mi(d)?(e.consume(d),o):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(NT,m,h)(d):d===45||d===95||Ce(d)?(s=!0,e.consume(d),l):m(d)}function h(d){return e.consume(d),i=!0,l}function m(d){return s&&i&&Ne(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function wT(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Nc.call(r,r.previous)||Ts(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vT,e.attempt(yc,e.attempt(Cc,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function LT(e,t,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&Sc.call(r,r.previous)&&!Ts(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(Ne(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?h:(s=!0,l)):n(d)}function h(d){return d===null||Nr(d)||he(d)||Ft(d)||Wr(d)?n(d):e.attempt(yc,e.attempt(Cc,m),n)(d)}function m(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function RT(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function OT(e,t,n){let r,i,s;return a;function a(h){return h===46||h===95?e.check(_c,l,o)(h):h===null||he(h)||Ft(h)||h!==45&&Wr(h)?l(h):(s=!0,e.consume(h),a)}function o(h){return h===95?r=!0:(i=r,r=void 0),e.consume(h),a}function l(h){return i||r||!s?n(h):t(h)}}function DT(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(_c,t,s)(a):a===null||he(a)||Ft(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function PT(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||he(o)||Ft(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||he(o)||Ft(o)?t(o):r(o)}function s(o){return Ne(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Ne(o)?(e.consume(o),a):n(o)}}function MT(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ce(s)?n(s):t(s)}}function Nc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||he(e)}function Sc(e){return!Ne(e)}function Ic(e){return!(e===47||Mi(e))}function Mi(e){return e===43||e===45||e===46||e===95||Ce(e)}function Ts(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function gn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Ce(e.charCodeAt(n+1))&&Ce(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Qr(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}var Bi={name:"attention",resolveAll:BT,tokenize:FT};function BT(e,t){let n=-1,r,i,s,a,o,l,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};Ma(d,-l),Ma(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ze(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ze(h,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),h=ze(h,Qr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=ze(h,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=ze(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Fe(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FT(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=hn(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const h=e.exit("attentionSequence"),m=hn(l),d=!m||m===2&&i||n.includes(l),f=!i||i===2&&m||n.includes(r);return h._open=!!(s===42?d:d&&(i||!f)),h._close=!!(s===42?f:f&&(m||!d)),t(l)}}function Ma(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var jT={name:"autolink",tokenize:HT};function HT(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Ne(p)?(e.consume(p),a):p===64?n(p):h(p)}function a(p){return p===43||p===45||p===46||Ce(p)?(r=1,o(p)):h(p)}function o(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ce(p))&&r++<32?(e.consume(p),o):(r=0,h(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Nr(p)?n(p):(e.consume(p),l)}function h(p){return p===64?(e.consume(p),m):Ug(p)?(e.consume(p),h):n(p)}function m(p){return Ce(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,m):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Ce(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return n(p)}}function oe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return ie(l)?(e.enter(n),o(l)):t(l)}function o(l){return ie(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}var nr={partial:!0,tokenize:UT};function UT(e,t,n){return r;function r(s){return ie(s)?oe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||K(s)?t(s):n(s)}}var wc={continuation:{tokenize:$T},exit:qT,name:"blockQuote",tokenize:zT};function zT(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return ie(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function $T(e,t,n){const r=this;return i;function i(a){return ie(a)?oe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(wc,t,n)(a)}}function qT(e){e.exit("blockQuote")}var Lc={name:"characterEscape",tokenize:YT};function YT(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return $g(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}var Rc={name:"characterReference",tokenize:VT};function VT(e,t,n){const r=this;let i=0,s,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),s=31,a=Ce,m(d))}function h(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=zg,m):(e.enter("characterReferenceValue"),s=7,a=Pi,m(d))}function m(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===Ce&&!Es(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<s?(e.consume(d),m):n(d)}}var Ba={partial:!0,tokenize:QT},Fa={concrete:!0,name:"codeFenced",tokenize:WT};function WT(e,t,n){const r=this,i={partial:!0,tokenize:R};let s=0,a=0,o;return l;function l(N){return h(N)}function h(N){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(N)}function m(N){return N===o?(a++,e.consume(N),m):a<3?n(N):(e.exit("codeFencedFenceSequence"),ie(N)?oe(e,d,"whitespace")(N):d(N))}function d(N){return N===null||K(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(Ba,_,w)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(N))}function f(N){return N===null||K(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),oe(e,p,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),f)}function p(N){return N===null||K(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||K(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===o?n(N):(e.consume(N),g)}function _(N){return e.attempt(i,w,A)(N)}function A(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),b}function b(N){return s>0&&ie(N)?oe(e,v,"linePrefix",s+1)(N):v(N)}function v(N){return N===null||K(N)?e.check(Ba,_,w)(N):(e.enter("codeFlowValue"),S(N))}function S(N){return N===null||K(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),S)}function w(N){return e.exit("codeFenced"),t(N)}function R(N,M,z){let Y=0;return I;function I(G){return N.enter("lineEnding"),N.consume(G),N.exit("lineEnding"),j}function j(G){return N.enter("codeFencedFence"),ie(G)?oe(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):$(G)}function $(G){return G===o?(N.enter("codeFencedFenceSequence"),V(G)):z(G)}function V(G){return G===o?(Y++,N.consume(G),V):Y>=a?(N.exit("codeFencedFenceSequence"),ie(G)?oe(N,Q,"whitespace")(G):Q(G)):z(G)}function Q(G){return G===null||K(G)?(N.exit("codeFencedFence"),M(G)):z(G)}}}function QT(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}var hi={name:"codeIndented",tokenize:KT},GT={partial:!0,tokenize:XT};function KT(e,t,n){const r=this;return i;function i(h){return e.enter("codeIndented"),oe(e,s,"linePrefix",5)(h)}function s(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(h):n(h)}function a(h){return h===null?l(h):K(h)?e.attempt(GT,a,l)(h):(e.enter("codeFlowValue"),o(h))}function o(h){return h===null||K(h)?(e.exit("codeFlowValue"),a(h)):(e.consume(h),o)}function l(h){return e.exit("codeIndented"),t(h)}}function XT(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):K(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):oe(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):K(a)?i(a):n(a)}}var ZT={name:"codeText",previous:eb,resolve:JT,tokenize:tb};function JT(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||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),t-=r-i-2,r=i+2),i=void 0);return e}function eb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tb(e,t,n){let r=0,i,s;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,m(d)):K(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),h(d))}function h(d){return d===null||d===32||d===96||K(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),h)}function m(d){return d===96?(e.consume(d),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",h(d))}}var nb=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&_n(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),_n(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_n(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);_n(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);_n(this.left,t.reverse())}}};function _n(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Oc(e){const t={};let n=-1,r,i,s,a,o,l,h;const m=new nb(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,rb(m,n)),n=t[n],h=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=m.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},o=m.slice(i,n),o.unshift(r),m.splice(i,n-i+1,o))}}return Fe(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function rb(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],h={};let m,d,f=-1,p=n,g=0,_=0;const A=[_];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(m=r.sliceStream(p),p.next||m.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(_=f+1,A.push(_),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):A.pop(),f=A.length;f--;){const b=o.slice(A[f],A[f+1]),v=s.pop();l.push([v,v+b.length-1]),e.splice(v,2,b)}for(l.reverse(),f=-1;++f<l.length;)h[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return h}var ib={resolve:ab,tokenize:ob},sb={partial:!0,tokenize:lb};function ab(e){return Oc(e),e}function ob(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):K(o)?e.check(sb,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function lb(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),oe(e,s,"linePrefix")}function s(a){if(a===null||K(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Dc(e,t,n,r,i,s,a,o,l){const h=l||Number.POSITIVE_INFINITY;let m=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),f):b===null||b===32||b===41||Nr(b)?n(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),_(b))}function f(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(o),f(b)):b===null||b===60||K(b)?n(b):(e.consume(b),b===92?g:p)}function g(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function _(b){return!m&&(b===null||b===41||he(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(b)):m<h&&b===40?(e.consume(b),m++,_):b===41?(e.consume(b),m--,_):b===null||b===32||b===40||Nr(b)?n(b):(e.consume(b),b===92?A:_)}function A(b){return b===40||b===41||b===92?(e.consume(b),_):_(b)}}function Pc(e,t,n,r,i,s){const a=this;let o=0,l;return h;function h(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),m}function m(p){return o>999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):K(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||K(p)||o++>999?(e.exit("chunkString"),m(p)):(e.consume(p),l||(l=!ie(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),o++,d):d(p)}}function Mc(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),h(f))}function h(f){return f===a?(e.exit(s),l(a)):f===null?n(f):K(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oe(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(f))}function m(f){return f===a||f===null||K(f)?(e.exit("chunkString"),h(f)):(e.consume(f),f===92?d:m)}function d(f){return f===a||f===92?(e.consume(f),m):m(f)}}function Mn(e,t){let n;return r;function r(i){return K(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ie(i)?oe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var cb={name:"definition",tokenize:hb},ub={partial:!0,tokenize:db};function hb(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return Pc.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return he(p)?Mn(e,h)(p):h(p)}function h(p){return Dc(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function m(p){return e.attempt(ub,d,d)(p)}function d(p){return ie(p)?oe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||K(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function db(e,t,n){return r;function r(o){return he(o)?Mn(e,i)(o):n(o)}function i(o){return Mc(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return ie(o)?oe(e,a,"whitespace")(o):a(o)}function a(o){return o===null||K(o)?t(o):n(o)}}var mb={name:"hardBreakEscape",tokenize:fb};function fb(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return K(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}var pb={name:"headingAtx",resolve:gb,tokenize:Eb};function gb(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Fe(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Eb(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||he(m)?(e.exit("atxHeadingSequence"),o(m)):n(m)}function o(m){return m===35?(e.enter("atxHeadingSequence"),l(m)):m===null||K(m)?(e.exit("atxHeading"),t(m)):ie(m)?oe(e,o,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function l(m){return m===35?(e.consume(m),l):(e.exit("atxHeadingSequence"),o(m))}function h(m){return m===null||m===35||he(m)?(e.exit("atxHeadingText"),o(m)):(e.consume(m),h)}}var Tb=["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"],ja=["pre","script","style","textarea"],bb={concrete:!0,name:"htmlFlow",resolveTo:yb,tokenize:Cb},xb={partial:!0,tokenize:Ab},kb={partial:!0,tokenize:_b};function yb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cb(e,t,n){const r=this;let i,s,a,o,l;return h;function h(C){return m(C)}function m(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),s=!0,_):C===63?(e.consume(C),i=3,r.interrupt?t:y):Ne(C)?(e.consume(C),a=String.fromCharCode(C),A):n(C)}function f(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,o=0,g):Ne(C)?(e.consume(C),i=4,r.interrupt?t:y):n(C)}function p(C){return C===45?(e.consume(C),r.interrupt?t:y):n(C)}function g(C){return C==="CDATA[".charCodeAt(o++)?(e.consume(C),o===6?r.interrupt?t:$:g):n(C)}function _(C){return Ne(C)?(e.consume(C),a=String.fromCharCode(C),A):n(C)}function A(C){if(C===null||C===47||C===62||he(C)){const De=C===47,Te=a.toLowerCase();return!De&&!s&&ja.includes(Te)?(i=1,r.interrupt?t(C):$(C)):Tb.includes(a.toLowerCase())?(i=6,De?(e.consume(C),b):r.interrupt?t(C):$(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):s?v(C):S(C))}return C===45||Ce(C)?(e.consume(C),a+=String.fromCharCode(C),A):n(C)}function b(C){return C===62?(e.consume(C),r.interrupt?t:$):n(C)}function v(C){return ie(C)?(e.consume(C),v):I(C)}function S(C){return C===47?(e.consume(C),I):C===58||C===95||Ne(C)?(e.consume(C),w):ie(C)?(e.consume(C),S):I(C)}function w(C){return C===45||C===46||C===58||C===95||Ce(C)?(e.consume(C),w):R(C)}function R(C){return C===61?(e.consume(C),N):ie(C)?(e.consume(C),R):S(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),l=C,M):ie(C)?(e.consume(C),N):z(C)}function M(C){return C===l?(e.consume(C),l=null,Y):C===null||K(C)?n(C):(e.consume(C),M)}function z(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||he(C)?R(C):(e.consume(C),z)}function Y(C){return C===47||C===62||ie(C)?S(C):n(C)}function I(C){return C===62?(e.consume(C),j):n(C)}function j(C){return C===null||K(C)?$(C):ie(C)?(e.consume(C),j):n(C)}function $(C){return C===45&&i===2?(e.consume(C),U):C===60&&i===1?(e.consume(C),P):C===62&&i===4?(e.consume(C),ce):C===63&&i===3?(e.consume(C),y):C===93&&i===5?(e.consume(C),J):K(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xb,X,V)(C)):C===null||K(C)?(e.exit("htmlFlowData"),V(C)):(e.consume(C),$)}function V(C){return e.check(kb,Q,X)(C)}function Q(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),G}function G(C){return C===null||K(C)?V(C):(e.enter("htmlFlowData"),$(C))}function U(C){return C===45?(e.consume(C),y):$(C)}function P(C){return C===47?(e.consume(C),a="",W):$(C)}function W(C){if(C===62){const De=a.toLowerCase();return ja.includes(De)?(e.consume(C),ce):$(C)}return Ne(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),W):$(C)}function J(C){return C===93?(e.consume(C),y):$(C)}function y(C){return C===62?(e.consume(C),ce):C===45&&i===2?(e.consume(C),y):$(C)}function ce(C){return C===null||K(C)?(e.exit("htmlFlowData"),X(C)):(e.consume(C),ce)}function X(C){return e.exit("htmlFlow"),t(C)}}function _b(e,t,n){const r=this;return i;function i(a){return K(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Ab(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nr,t,n)}}var vb={name:"htmlText",tokenize:Nb};function Nb(e,t,n){const r=this;let i,s,a;return o;function o(y){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(y),l}function l(y){return y===33?(e.consume(y),h):y===47?(e.consume(y),R):y===63?(e.consume(y),S):Ne(y)?(e.consume(y),z):n(y)}function h(y){return y===45?(e.consume(y),m):y===91?(e.consume(y),s=0,g):Ne(y)?(e.consume(y),v):n(y)}function m(y){return y===45?(e.consume(y),p):n(y)}function d(y){return y===null?n(y):y===45?(e.consume(y),f):K(y)?(a=d,P(y)):(e.consume(y),d)}function f(y){return y===45?(e.consume(y),p):d(y)}function p(y){return y===62?U(y):y===45?f(y):d(y)}function g(y){return y==="CDATA[".charCodeAt(s++)?(e.consume(y),s===6?_:g):n(y)}function _(y){return y===null?n(y):y===93?(e.consume(y),A):K(y)?(a=_,P(y)):(e.consume(y),_)}function A(y){return y===93?(e.consume(y),b):_(y)}function b(y){return y===62?U(y):y===93?(e.consume(y),b):_(y)}function v(y){return y===null||y===62?U(y):K(y)?(a=v,P(y)):(e.consume(y),v)}function S(y){return y===null?n(y):y===63?(e.consume(y),w):K(y)?(a=S,P(y)):(e.consume(y),S)}function w(y){return y===62?U(y):S(y)}function R(y){return Ne(y)?(e.consume(y),N):n(y)}function N(y){return y===45||Ce(y)?(e.consume(y),N):M(y)}function M(y){return K(y)?(a=M,P(y)):ie(y)?(e.consume(y),M):U(y)}function z(y){return y===45||Ce(y)?(e.consume(y),z):y===47||y===62||he(y)?Y(y):n(y)}function Y(y){return y===47?(e.consume(y),U):y===58||y===95||Ne(y)?(e.consume(y),I):K(y)?(a=Y,P(y)):ie(y)?(e.consume(y),Y):U(y)}function I(y){return y===45||y===46||y===58||y===95||Ce(y)?(e.consume(y),I):j(y)}function j(y){return y===61?(e.consume(y),$):K(y)?(a=j,P(y)):ie(y)?(e.consume(y),j):Y(y)}function $(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),i=y,V):K(y)?(a=$,P(y)):ie(y)?(e.consume(y),$):(e.consume(y),Q)}function V(y){return y===i?(e.consume(y),i=void 0,G):y===null?n(y):K(y)?(a=V,P(y)):(e.consume(y),V)}function Q(y){return y===null||y===34||y===39||y===60||y===61||y===96?n(y):y===47||y===62||he(y)?Y(y):(e.consume(y),Q)}function G(y){return y===47||y===62||he(y)?Y(y):n(y)}function U(y){return y===62?(e.consume(y),e.exit("htmlTextData"),e.exit("htmlText"),t):n(y)}function P(y){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),W}function W(y){return ie(y)?oe(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):J(y)}function J(y){return e.enter("htmlTextData"),a(y)}}var bs={name:"labelEnd",resolveAll:Lb,resolveTo:Rb,tokenize:Ob},Sb={tokenize:Db},Ib={tokenize:Pb},wb={tokenize:Mb};function Lb(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Fe(e,0,e.length,n),e}function Rb(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",h,t]],o=ze(o,e.slice(s+1,s+r+3)),o=ze(o,[["enter",m,t]]),o=ze(o,Qr(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ze(o,[["exit",m,t],e[a-2],e[a-1],["exit",h,t]]),o=ze(o,e.slice(a+1)),o=ze(o,[["exit",l,t]]),Fe(e,s,e.length,o),e}function Ob(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(f){return s?s._inactive?d(f):(a=r.parser.defined.includes(Ve(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(Sb,m,a?m:d)(f):f===91?e.attempt(Ib,m,a?h:d)(f):a?m(f):d(f)}function h(f){return e.attempt(wb,m,d)(f)}function m(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function Db(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return he(d)?Mn(e,s)(d):s(d)}function s(d){return d===41?m(d):Dc(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return he(d)?Mn(e,l)(d):m(d)}function o(d){return n(d)}function l(d){return d===34||d===39||d===40?Mc(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):m(d)}function h(d){return he(d)?Mn(e,m)(d):m(d)}function m(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Pb(e,t,n){const r=this;return i;function i(o){return Pc.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function Mb(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}var Bb={name:"labelStartImage",resolveAll:bs.resolveAll,tokenize:Fb};function Fb(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}var jb={name:"labelStartLink",resolveAll:bs.resolveAll,tokenize:Hb};function Hb(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var di={name:"lineEnding",tokenize:Ub};function Ub(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),oe(e,t,"linePrefix")}}var kr={name:"thematicBreak",tokenize:zb};function zb(e,t,n){let r=0,i;return s;function s(h){return e.enter("thematicBreak"),a(h)}function a(h){return i=h,o(h)}function o(h){return h===i?(e.enter("thematicBreakSequence"),l(h)):r>=3&&(h===null||K(h))?(e.exit("thematicBreak"),t(h)):n(h)}function l(h){return h===i?(e.consume(h),r++,l):(e.exit("thematicBreakSequence"),ie(h)?oe(e,o,"whitespace")(h):o(h))}}var Re={continuation:{tokenize:Vb},exit:Qb,name:"list",tokenize:Yb},$b={partial:!0,tokenize:Gb},qb={partial:!0,tokenize:Wb};function Yb(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pi(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(kr,n,h)(p):h(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Pi(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),h(p)):n(p)}function h(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(nr,r.interrupt?n:m,e.attempt($b,f,d))}function m(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return ie(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Vb(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(nr,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!ie(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qb,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(e,e.attempt(Re,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Wb(e,t,n){const r=this;return oe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Qb(e){e.exit(this.containerState.type)}function Gb(e,t,n){const r=this;return oe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!ie(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}var Ha={name:"setextUnderline",resolveTo:Kb,tokenize:Xb};function Kb(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Xb(e,t,n){const r=this;let i;return s;function s(h){let m=r.events.length,d;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){d=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=h,a(h)):n(h)}function a(h){return e.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===i?(e.consume(h),o):(e.exit("setextHeadingLineSequence"),ie(h)?oe(e,l,"lineSuffix")(h):l(h))}function l(h){return h===null||K(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}var Zb={tokenize:a0,partial:!0};function Jb(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r0,continuation:{tokenize:i0},exit:s0}},text:{91:{name:"gfmFootnoteCall",tokenize:n0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e0,resolveTo:t0}}}}function e0(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const h=Ve(r.sliceSerialize({start:a.end,end:r.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function t0(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function n0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(d){if(s>999||d===93&&!a||d===null||d===91||he(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Ve(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return he(d)||(a=!0),s++,e.consume(d),d===92?m:h}function m(d){return d===91||d===92||d===93?(e.consume(d),s++,h):h(d)}}function r0(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(g)}function m(g){if(a>999||g===93&&!o||g===null||g===91||he(g))return n(g);if(g===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return s=Ve(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return he(g)||(o=!0),a++,e.consume(g),g===92?d:m}function d(g){return g===91||g===92||g===93?(e.consume(g),a++,m):m(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),oe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function i0(e,t,n){return e.check(nr,t,e.attempt(Zb,t,n))}function s0(e){e.exit("gfmFootnoteDefinition")}function a0(e,t,n){const r=this;return oe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function o0(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(s,a){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},m={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},d=[["enter",h,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",m,a]],f=a.parser.constructs.insideSpan.null;f&&Fe(d,d.length,0,Qr(f,s.slice(l+1,o),a)),Fe(d,d.length,0,[["exit",m,a],["enter",s[o][1],a],["exit",s[o][1],a],["exit",h,a]]),Fe(s,l-1,o-l+3,d),o=l+d.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function i(s,a,o){const l=this.previous,h=this.events;let m=0;return d;function d(p){return l===126&&h[h.length-1][1].type!=="characterEscape"?o(p):(s.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const g=hn(l);if(p===126)return m>1?o(p):(s.consume(p),m++,f);if(m<2&&!t)return o(p);const _=s.exit("strikethroughSequenceTemporary"),A=hn(p);return _._open=!A||A===2&&!!g,_._close=!g||g===2&&!!A,a(p)}}}var l0=class{constructor(){this.map=[]}add(e,t,n){c0(this,e,t,n)}consume(e){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const i of r)e.push(i);r=n.pop()}this.map.length=0}};function c0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function u0(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function h0(){return{flow:{null:{name:"table",tokenize:d0,resolveAll:m0}}}}function d0(e,t,n){const r=this;let i=0,s=0,a;return o;function o(I){let j=r.events.length-1;for(;j>-1;){const Q=r.events[j][1].type;if(Q==="lineEnding"||Q==="linePrefix")j--;else break}const $=j>-1?r.events[j][1].type:null,V=$==="tableHead"||$==="tableRow"?N:l;return V===N&&r.parser.lazy[r.now().line]?n(I):V(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(a=!0,s+=1),m(I)}function m(I){return I===null?n(I):K(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):ie(I)?oe(e,m,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),d(I)))}function d(I){return I===null||I===124||he(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?f:d)}function f(I){return I===92||I===124?(e.consume(I),d):d(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,ie(I)?oe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?A(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),_):R(I)}function _(I){return ie(I)?oe(e,A,"whitespace")(I):A(I)}function A(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):I===45?(s+=1,b(I)):I===null||K(I)?w(I):R(I)}function b(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):R(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(I))}function S(I){return ie(I)?oe(e,w,"whitespace")(I):w(I)}function w(I){return I===124?g(I):I===null||K(I)?!a||i!==s?R(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):R(I)}function R(I){return n(I)}function N(I){return e.enter("tableRow"),M(I)}function M(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),M):I===null||K(I)?(e.exit("tableRow"),t(I)):ie(I)?oe(e,M,"whitespace")(I):(e.enter("data"),z(I))}function z(I){return I===null||I===124||he(I)?(e.exit("data"),M(I)):(e.consume(I),I===92?Y:z)}function Y(I){return I===92||I===124?(e.consume(I),z):z(I)}}function m0(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,h,m,d;const f=new l0;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(Ua(f,t,l,h,m),m=void 0,l=0),h={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",h,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,m={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",m,t]])),i=g.type==="tableDelimiterRow"?2:m?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],d=dr(f,t,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=dr(f,t,s,i,void 0,d)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],d=dr(f,t,s,i,n,d)):a[1]!==0&&(d=dr(f,t,a,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Ua(f,t,l,h,m),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=u0(t.events,n))}return e}function dr(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Xt(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Xt(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const h=Xt(t.events,n[2]),m=Xt(t.events,n[3]),d={type:o,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;e.add(g,_,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Xt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Ua(e,t,n,r,i){const s=[],a=Xt(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Xt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var f0={name:"tasklistCheck",tokenize:g0};function p0(){return{text:{91:f0}}}function g0(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return he(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return K(l)?t(l):ie(l)?e.check({tokenize:E0},t,n)(l):n(l)}}function E0(e,t,n){return oe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function T0(e){return kc([ST(),Jb(),o0(e),h0(),p0()])}var b0={};function x0(e){const t=this,n=e||b0,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(T0(n)),s.push(yT()),a.push(CT(n))}var k0=Object.defineProperty,y0=Object.defineProperties,C0=Object.getOwnPropertyDescriptors,za=Object.getOwnPropertySymbols,_0=Object.prototype.hasOwnProperty,A0=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?k0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t)=>{for(var n in t||(t={}))_0.call(t,n)&&$a(e,n,t[n]);if(za)for(var n of za(t))A0.call(t,n)&&$a(e,n,t[n]);return e},Fc=(e,t)=>y0(e,C0(t)),Ie=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},v0=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},N0=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!v0(e,n)&&(t+=1)}return t},xt=(e,t)=>{let n=!1,r=!1,i=-1;for(let s=0;s<e.length;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}if(!r&&e[s]==="`")if(n){if(i<t&&t<s)return!0;n=!1,i=-1}else n=!0,i=s}return!1},S0=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,I0=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(S0,(t,n,r,i)=>Ie(e,i)?t:`${n}\\>${r}`),w0=/(\*\*)([^*]*\*?)$/,L0=/(__)([^_]*?)$/,R0=/(\*\*\*)([^*]*?)$/,O0=/(\*)([^*]*?)$/,D0=/(_)([^_]*?)$/,P0=/(`)([^`]*?)$/,M0=/(~~)([^~]*?)$/,$t=/^[\s_~*`]*$/,jc=/^[\s]*[-*+][\s]+$/,B0=/[\p{L}\p{N}_]/u,F0=/^```[^`\n]*```?$/,j0=/^\*{4,}$/,H0=/(__)([^_]+)_$/,U0=/(~~)([^~]+)~$/,qa=/~~/g,kt=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:B0.test(e)},z0=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},Hc=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Gr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},$0=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
19
|
-
`)return!1}return!1},Uc=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?$0(e,t):!1;if(e[n]===`
|
|
20
|
-
`)return!1}return!1},q0=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
21
|
-
`)return!1}return!1},xs=(e,t,n)=>{let r=0;for(let l=t-1;l>=0;l-=1)if(e[l]===`
|
|
22
|
-
`){r=l+1;break}let i=e.length;for(let l=t;l<e.length;l+=1)if(e[l]===`
|
|
23
|
-
`){i=l;break}let s=e.substring(r,i),a=0,o=!1;for(let l of s)if(l===n)a+=1;else if(l!==" "&&l!==" "){o=!0;break}return a>=3&&!o},Y0=(e,t,n,r)=>n==="\\"||e.includes("$")&&Gr(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&kt(n)&&kt(r)||(!n||n===" "||n===" "||n===`
|
|
24
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
25
|
-
`)),zc=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let s=i>0?e[i-1]:"",a=i<r-1?e[i+1]:"";Y0(e,i,s,a)||(t+=1)}return t},V0=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Gr(e,t)||Uc(e,t)||q0(e,t)||n==="_"||r==="_"||n&&r&&kt(n)&&kt(r)),W0=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let s=i>0?e[i-1]:"",a=i<r-1?e[i+1]:"";V0(e,i,s,a)||(t+=1)}return t},Q0=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},ks=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},Ya=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},G0=(e,t,n)=>{if(!t||$t.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
26
|
-
`),i=r===-1?0:r+1,s=e.substring(i,n);return jc.test(s)&&t.includes(`
|
|
27
|
-
`)?!0:xs(e,n,"*")},K0=e=>{let t=e.match(w0);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Ie(e,r)||xt(e,r)||G0(e,n,r)?e:ks(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},X0=(e,t,n)=>{if(!t||$t.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
28
|
-
`),i=r===-1?0:r+1,s=e.substring(i,n);return jc.test(s)&&t.includes(`
|
|
29
|
-
`)?!0:xs(e,n,"_")},Z0=e=>{let t=e.match(L0);if(!t){let i=e.match(H0);if(i){let s=e.lastIndexOf(i[1]);if(!(Ie(e,s)||xt(e,s))&&Ya(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Ie(e,r)||xt(e,r)||X0(e,n,r)?e:Ya(e)%2===1?`${e}__`:e},J0=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!Gr(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
30
|
-
`)&&(!i||i===" "||i===" "||i===`
|
|
31
|
-
`)||r&&i&&kt(r)&&kt(i))continue;return n}}return-1},ex=e=>{if(!e.match(O0))return e;let t=J0(e);if(t===-1||Ie(e,t)||xt(e,t))return e;let n=e.substring(t+1);return!n||$t.test(n)?e:zc(e)%2===1?`${e}*`:e},$c=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!Gr(e,n)&&!Uc(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&kt(r)&&kt(i))continue;return n}}return-1},tx=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
32
|
-
`;)t-=1;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},nx=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(ks(t)%2!==1)return null;let n=t.indexOf("**"),r=$c(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},rx=e=>{if(!e.match(D0))return e;let t=$c(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||$t.test(n)||Ie(e,t)||xt(e,t))return e;if(W0(e)%2===1){let r=nx(e);return r!==null?r:tx(e)}return e},ix=e=>{let t=ks(e),n=zc(e);return t%2===0&&n%2===0},sx=(e,t,n)=>!t||$t.test(t)||Ie(e,n)||xt(e,n)?!0:xs(e,n,"*"),ax=e=>{if(j0.test(e))return e;let t=e.match(R0);if(!t)return e;let n=t[2];return sx(e,n,e.lastIndexOf(t[1]))?e:Q0(e)%2===1?ix(e)?e:`${e}***`:e},ox=/<[a-zA-Z/][^>]*$/,lx=e=>{let t=e.match(ox);return!t||t.index===void 0||Ie(e,t.index)?e:e.substring(0,t.index).trimEnd()},cx=e=>!e.match(F0)||e.includes(`
|
|
33
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,ux=e=>(e.match(/```/g)||[]).length%2===1,hx=e=>{let t=cx(e);if(t!==null)return t;let n=e.match(P0);if(n&&!ux(e)){let r=n[2];if(!r||$t.test(r))return e;if(N0(e)%2===1)return`${e}\``}return e},qc=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",dx=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!qc(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},mx=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!qc(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},fx=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
34
|
-
`,t)!==-1&&!e.endsWith(`
|
|
35
|
-
`)?`${e}
|
|
36
|
-
$$`:`${e}$$`},px=e=>dx(e)%2===0?e:fx(e),gx=e=>mx(e)%2===1?`${e}$`:e,Ex=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=z0(e,t);if(r===-1||Ie(e,r))return null;let i=r>0&&e[r-1]==="!",s=i?r-1:r,a=e.substring(0,s);if(i)return a;let o=e.substring(r+1,t);return n==="text-only"?`${a}${o}`:`${a}[${o}](streamdown:incomplete-link)`},Va=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Ie(e,n)){if(n>0&&e[n-1]==="!")continue;let r=Hc(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},Tx=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let s=e.substring(0,i);if(r)return s;if(n==="text-only"){let a=Va(e,t);return e.substring(0,a)+e.substring(a+1)}return`${e}](streamdown:incomplete-link)`}if(Hc(e,t)===-1){let s=e.substring(0,i);if(r)return s;if(n==="text-only"){let a=Va(e,t);return e.substring(0,a)+e.substring(a+1)}return`${e}](streamdown:incomplete-link)`}return null},Yc=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Ie(e,n)){let r=Ex(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Ie(e,r)){let i=Tx(e,r,t);if(i!==null)return i}return e},bx=/^-{1,2}$/,xx=/^[\s]*-{1,2}[\s]+$/,kx=/^={1,2}$/,yx=/^[\s]*={1,2}[\s]+$/,Cx=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
37
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(bx.test(i)&&!n.match(xx)){let s=r.split(`
|
|
38
|
-
`).at(-1);if(s&&s.trim().length>0)return`${e}`}if(kx.test(i)&&!n.match(yx)){let s=r.split(`
|
|
39
|
-
`).at(-1);if(s&&s.trim().length>0)return`${e}`}return e},_x=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),Ax=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(_x,(t,n)=>Ie(e,n)?t:"\\~"),vx=e=>{var t,n;let r=e.match(M0);if(r){let i=r[2];if(!i||$t.test(i))return e;let s=e.lastIndexOf(r[1]);if(Ie(e,s)||xt(e,s))return e;if(((t=e.match(qa))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(U0);if(i){let s=e.lastIndexOf(i[0].slice(0,2));if(Ie(e,s)||xt(e,s))return e;if(((n=e.match(qa))==null?void 0:n.length)%2===1)return`${e}~`}}return e},mi=e=>e!==!1,Nx=e=>e===!0,ve={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},Sx=[{handler:{name:"singleTilde",handle:Ax,priority:ve.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:I0,priority:ve.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:lx,priority:ve.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Cx,priority:ve.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Yc,priority:ve.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:ax,priority:ve.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:K0,priority:ve.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Z0,priority:ve.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:ex,priority:ve.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:rx,priority:ve.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:hx,priority:ve.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:vx,priority:ve.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:px,priority:ve.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:gx,priority:ve.INLINE_KATEX},optionKey:"inlineKatex"}],Ix=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return Sx.filter(({handler:r,optionKey:i})=>r.name==="links"?mi(e?.links)||mi(e?.images):r.name==="inlineKatex"?Nx(e?.inlineKatex):mi(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Fc(Bc({},r),{handle:s=>Yc(s,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},wx=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=Ix(t),s=((n=t?.handlers)!=null?n:[]).map(o=>{var l;return{handler:Fc(Bc({},o),{priority:(l=o.priority)!=null?l:ve.DEFAULT}),earlyReturn:void 0}}),a=[...i,...s].sort((o,l)=>{var h,m;return((h=o.handler.priority)!=null?h:0)-((m=l.handler.priority)!=null?m:0)});for(let{handler:o,earlyReturn:l}of a)if(r=o.handle(r),l!=null&&l(r))return r;return r},Lx=wx,Rx=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ox=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dx={};function Wa(e,t){return((t||Dx).jsx?Ox:Rx).test(e)}var Px=/[ \t\n\f\r]/g;function Mx(e){return typeof e=="object"?e.type==="text"?Qa(e.value):!1:Qa(e)}function Qa(e){return e.replace(Px,"")===""}var Bx=qn(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,h=/^\s+|\s+$/g,m=`
|
|
40
|
-
`,d="/",f="*",p="",g="comment",_="declaration";function A(v,S){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];S=S||{};var w=1,R=1;function N(U){var P=U.match(r);P&&(w+=P.length);var W=U.lastIndexOf(m);R=~W?U.length-W:R+U.length}function M(){var U={line:w,column:R};return function(P){return P.position=new z(U),j(),P}}function z(U){this.start=U,this.end={line:w,column:R},this.source=S.source}z.prototype.content=v;function Y(U){var P=new Error(S.source+":"+w+":"+R+": "+U);if(P.reason=U,P.filename=S.source,P.line=w,P.column=R,P.source=v,!S.silent)throw P}function I(U){var P=U.exec(v);if(P){var W=P[0];return N(W),v=v.slice(W.length),P}}function j(){I(i)}function $(U){var P;for(U=U||[];P=V();)P!==!1&&U.push(P);return U}function V(){var U=M();if(!(d!=v.charAt(0)||f!=v.charAt(1))){for(var P=2;p!=v.charAt(P)&&(f!=v.charAt(P)||d!=v.charAt(P+1));)++P;if(P+=2,p===v.charAt(P-1))return Y("End of comment missing");var W=v.slice(2,P-2);return R+=2,N(W),v=v.slice(P),R+=2,U({type:g,comment:W})}}function Q(){var U=M(),P=I(s);if(P){if(V(),!I(a))return Y("property missing ':'");var W=I(o),J=U({type:_,property:b(P[0].replace(n,p)),value:W?b(W[0].replace(n,p)):p});return I(l),J}}function G(){var U=[];$(U);for(var P;P=Q();)P!==!1&&(U.push(P),$(U));return U}return j(),G()}function b(v){return v?v.replace(h,p):p}t.exports=A})),Fx=qn((e=>{var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Bx());function r(i,s){let a=null;if(!i||typeof i!="string")return a;const o=(0,n.default)(i),l=typeof s=="function";return o.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:d}=h;l?s(m,d,h):d&&(a=a||{},a[m]=d)}),a}})),jx=qn((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(m){return!m||r.test(m)||t.test(m)},o=function(m,d){return d.toUpperCase()},l=function(m,d){return"".concat(d,"-")},h=function(m,d){return d===void 0&&(d={}),a(m)?m:(m=m.toLowerCase(),d.reactCompat?m=m.replace(s,l):m=m.replace(i,l),m.replace(n,o))};e.camelCase=h})),Hx=qn(((e,t)=>{var n=(e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}})(Fx()),r=jx();function i(s,a){var o={};return!s||typeof s!="string"||(0,n.default)(s,function(l,h){l&&h&&(o[(0,r.camelCase)(l,a)]=h)}),o}i.default=i,t.exports=i}));function Bn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ga(e.position):"start"in e||"end"in e?Ga(e):"line"in e||"column"in e?Fi(e):""}function Fi(e){return Ka(e&&e.line)+":"+Ka(e&&e.column)}function Ga(e){return Fi(e&&e.start)+"-"+Fi(e&&e.end)}function Ka(e){return e&&typeof e=="number"?e:1}var Ae=class extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let r="",i={},s=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?r=e:!i.cause&&e&&(s=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?i.ruleId=n:(i.source=n.slice(0,o),i.ruleId=n.slice(o+1))}if(!i.place&&i.ancestors&&i.ancestors){const o=i.ancestors[i.ancestors.length-1];o&&(i.place=o.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Bn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ae.prototype.file="";Ae.prototype.name="";Ae.prototype.reason="";Ae.prototype.message="";Ae.prototype.stack="";Ae.prototype.column=void 0;Ae.prototype.line=void 0;Ae.prototype.ancestors=void 0;Ae.prototype.cause=void 0;Ae.prototype.fatal=void 0;Ae.prototype.place=void 0;Ae.prototype.ruleId=void 0;Ae.prototype.source=void 0;var Ux=Pr(Hx(),1),ys={}.hasOwnProperty,zx=new Map,$x=/[A-Z]/g,qx=new Set(["table","tbody","thead","tfoot","tr"]),Yx=new Set(["td","th"]),Vc="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Vx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ek(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Jx(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ct:Zn,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Wc(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Wc(e,t,n){if(t.type==="element")return Wx(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Qx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Kx(e,t,n);if(t.type==="mdxjsEsm")return Gx(e,t);if(t.type==="root")return Xx(e,t,n);if(t.type==="text")return Zx(e,t)}function Wx(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ct,e.schema=i),e.ancestors.push(t);const s=Gc(e,t.tagName,!1),a=tk(e,t);let o=_s(e,t);return qx.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Mx(l):!0})),Qc(e,a,s,t),Cs(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Qx(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$n(e,t.position)}function Gx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$n(e,t.position)}function Kx(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ct,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Gc(e,t.name,!0),a=nk(e,t),o=_s(e,t);return Qc(e,a,s,t),Cs(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Xx(e,t,n){const r={};return Cs(r,_s(e,t)),e.create(t,e.Fragment,r,n)}function Zx(e,t){return t.value}function Qc(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Cs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Jx(e,t,n){return r;function r(i,s,a,o){const l=Array.isArray(a.children)?n:t;return o?l(s,a,o):l(s,a)}}function ek(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=nt(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function tk(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ys.call(t.properties,i)){const s=rk(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Yx.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nk(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $n(e,t.position);else{const i=r.name;let s;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,s=e.evaluater.evaluateExpression(a.expression)}else $n(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function _s(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:zx;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const h=i.get(l)||0;a=l+"-"+h,i.set(l,h+1)}}const o=Wc(e,s,a);o!==void 0&&n.push(o)}return n}function rk(e,t,n){const r=Ur(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?fl(n):pl(n)),r.property==="style"){let i=typeof n=="object"?n:ik(e,String(n));return e.stylePropertyNameCase==="css"&&(i=sk(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?pm[r.property]||r.property:r.attribute,n]}}function ik(e,t){try{return(0,Ux.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ae("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=Vc+"#cannot-parse-style-attribute",i}}function Gc(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=Wa(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Wa(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ys.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$n(e)}function $n(e,t){const n=new Ae("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Vc+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sk(e){const t={};let n;for(n in e)ys.call(e,n)&&(t[ak(n)]=e[n]);return t}function ak(e){let t=e.replace($x,ok);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ok(e){return"-"+e.toLowerCase()}var fi={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"]},lk={tokenize:ck};function ck(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),oe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return K(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}var uk={tokenize:hk},Xa={tokenize:dk};function hk(e){const t=this,n=[];let r=0,i,s,a;return o;function o(S){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,l,h)(S)}return h(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const w=t.events.length;let R=w,N;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){N=t.events[R][1].end;break}b(r);let M=w;for(;M<t.events.length;)t.events[M][1].end={...N},M++;return Fe(t.events,R+1,0,t.events.slice(w)),t.events.length=M,h(S)}return o(S)}function h(S){if(r===n.length){if(!i)return f(S);if(i.currentConstruct&&i.currentConstruct.concrete)return g(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xa,m,d)(S)}function m(S){return i&&v(),b(r),f(S)}function d(S){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(S)}function f(S){return t.containerState={},e.attempt(Xa,p,g)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),f(S)}function g(S){if(S===null){i&&v(),b(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),_(S)}function _(S){if(S===null){A(e.exit("chunkFlow"),!0),b(0),e.consume(S);return}return K(S)?(e.consume(S),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(S),_)}function A(S,w){const R=t.sliceStream(S);if(w&&R.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(R),t.parser.lazy[S.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const M=t.events.length;let z=M,Y,I;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(Y){I=t.events[z][1].end;break}Y=!0}for(b(r),N=M;N<t.events.length;)t.events[N][1].end={...I},N++;Fe(t.events,z+1,0,t.events.slice(M)),t.events.length=N}}function b(S){let w=n.length;for(;w-- >S;){const R=n[w];t.containerState=R[1],R[0].exit.call(t,e)}n.length=S}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function dk(e,t,n){return oe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var mk={tokenize:fk};function fk(e){const t=this,n=e.attempt(nr,r,e.attempt(this.parser.constructs.flowInitial,i,oe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ib,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var pk={resolveAll:Xc()},gk=Kc("string"),Ek=Kc("text");function Kc(e){return{resolveAll:Xc(e==="text"?Tk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(m){return h(m)?s(m):o(m)}function o(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),l}function l(m){return h(m)?(n.exit("data"),s(m)):(n.consume(m),l)}function h(m){if(m===null)return!0;const d=i[m];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Xc(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function Tk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const h=i[s];if(typeof h=="string"){for(a=h.length;h.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(h===-2)l=!0,o++;else if(h!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const h={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}var bk=Zi({attentionMarkers:()=>Nk,contentInitial:()=>kk,disable:()=>Sk,document:()=>xk,flow:()=>Ck,flowInitial:()=>yk,insideSpan:()=>vk,string:()=>_k,text:()=>Ak}),xk={42:Re,43:Re,45:Re,48:Re,49:Re,50:Re,51:Re,52:Re,53:Re,54:Re,55:Re,56:Re,57:Re,62:wc},kk={91:cb},yk={[-2]:hi,[-1]:hi,32:hi},Ck={35:pb,42:kr,45:[Ha,kr],60:bb,61:Ha,95:kr,96:Fa,126:Fa},_k={38:Rc,92:Lc},Ak={[-5]:di,[-4]:di,[-3]:di,33:Bb,38:Rc,42:Bi,60:[jT,vb],91:jb,92:[mb,Lc],93:bs,95:Bi,96:ZT},vk={null:[Bi,pk]},Nk={null:[42,95]},Sk={null:[]};function Ik(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:M(R),check:M(N),consume:v,enter:S,exit:w,interrupt:M(N,{interrupt:!0})},h={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let m=t.tokenize.call(h,l);return t.resolveAll&&s.push(t),h;function d(j){return a=ze(a,j),A(),a[a.length-1]!==null?[]:(z(t,0),h.events=Qr(s,h.events,h),h.events)}function f(j,$){return Lk(p(j),$)}function p(j){return wk(a,j)}function g(){const{_bufferIndex:j,_index:$,line:V,column:Q,offset:G}=r;return{_bufferIndex:j,_index:$,line:V,column:Q,offset:G}}function _(j){i[j.line]=j.column,I()}function A(){let j;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<$.length;)b($.charCodeAt(r._bufferIndex));else b($)}}function b(j){m=m(j)}function v(j){K(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,I()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=j}function S(j,$){const V=$||{};return V.type=j,V.start=g(),h.events.push(["enter",V,h]),o.push(V),V}function w(j){const $=o.pop();return $.end=g(),h.events.push(["exit",$,h]),$}function R(j,$){z(j,$.from)}function N(j,$){$.restore()}function M(j,$){return V;function V(Q,G,U){let P,W,J,y;return Array.isArray(Q)?X(Q):"tokenize"in Q?X([Q]):ce(Q);function ce(ge){return At;function At(Pe){const He=Pe!==null&&ge[Pe],it=Pe!==null&&ge.null;return X([...Array.isArray(He)?He:He?[He]:[],...Array.isArray(it)?it:it?[it]:[]])(Pe)}}function X(ge){return P=ge,W=0,ge.length===0?U:C(ge[W])}function C(ge){return At;function At(Pe){return y=Y(),J=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?Te(Pe):ge.tokenize.call($?Object.assign(Object.create(h),$):h,l,De,Te)(Pe)}}function De(ge){return j(J,y),G}function Te(ge){return y.restore(),++W<P.length?C(P[W]):U}}}function z(j,$){j.resolveAll&&!s.includes(j)&&s.push(j),j.resolve&&Fe(h.events,$,h.events.length-$,j.resolve(h.events.slice($),h)),j.resolveTo&&(h.events=j.resolveTo(h.events,h))}function Y(){const j=g(),$=h.previous,V=h.currentConstruct,Q=h.events.length,G=Array.from(o);return{from:Q,restore:U};function U(){r=j,h.previous=$,h.currentConstruct=V,h.events.length=Q,o=G,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function wk(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function Lk(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:a="\r";break;case-4:a=`
|
|
41
|
-
`;break;case-3:a=`\r
|
|
42
|
-
`;break;case-2:a=t?" ":" ";break;case-1:if(!t&&i)continue;a=" ";break;default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Rk(e){const t={constructs:kc([bk,...(e||{}).extensions||[]]),content:n(lk),defined:[],document:n(uk),flow:n(mk),lazy:{},string:n(gk),text:n(Ek)};return t;function n(r){return i;function i(s){return Ik(t,r,s)}}}function Ok(e){for(;!Oc(e););return e}var Za=/[\0\t\n\r]/g;function Dk(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let h,m,d,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Za.lastIndex=d,h=Za.exec(s),f=h&&h.index!==void 0?h.index:s.length,p=s.charCodeAt(f),!h){t=s.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),p){case 0:l.push(65533),e++;break;case 9:for(m=Math.ceil(e/4)*4,l.push(-2);e++<m;)l.push(-1);break;case 10:l.push(-4),e=1;break;default:r=!0,e=1}d=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}var Zc={}.hasOwnProperty;function Pk(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Mk(n)(Ok(Rk(n).document().write(Dk()(e,t,!0))))}function Mk(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(de),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:s(Tn),blockQuote:s(it),characterEscape:Y,characterReference:Y,codeFenced:s(sr),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(sr,a),codeText:s(ar,a),codeTextData:Y,data:Y,codeFlowValue:Y,definition:s(or),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(lr),hardBreakEscape:s(Yt),hardBreakTrailing:s(Yt),htmlFlow:s(cr,a),htmlFlowData:Y,htmlText:s(cr,a),htmlTextData:Y,image:s(se),label:a,link:s(de),listItem:s(Ge),listItemValue:f,listOrdered:s(we,d),listUnordered:s(we),paragraph:s(vt),reference:C,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Tn),strong:s(mh),thematicBreak:s(ph)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:He,autolinkProtocol:Pe,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:ge,characterReference:At,codeFenced:l(A),codeFencedFence:_,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:I,codeIndented:l(b),codeText:l(G),codeTextData:I,data:I,definition:l(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:S,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(V),htmlFlowData:I,htmlText:l(Q),htmlTextData:I,image:l(P),label:J,labelText:W,lineEnding:j,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:De,resourceDestinationString:y,resourceTitleString:ce,resource:X,setextHeading:l(z),setextHeadingLineSequence:M,setextHeadingText:N,strong:l(),thematicBreak:l()}};Jc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let q={type:"root",children:[]};const Z={stack:[q],tokenStack:[],config:t,enter:o,exit:h,buffer:a,resume:m,data:n},fe=[];let pe=-1;for(;++pe<D.length;)(D[pe][1].type==="listOrdered"||D[pe][1].type==="listUnordered")&&(D[pe][0]==="enter"?fe.push(pe):pe=i(D,fe.pop(),pe));for(pe=-1;++pe<D.length;){const mt=t[D[pe][0]];Zc.call(mt,D[pe][1].type)&&mt[D[pe][1].type].call(Object.assign({sliceSerialize:D[pe][2].sliceSerialize},Z),D[pe][1])}if(Z.tokenStack.length>0){const mt=Z.tokenStack[Z.tokenStack.length-1];(mt[1]||Ja).call(Z,void 0,mt[0])}for(q.position={start:ft(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:ft(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)q=t.transforms[pe](q)||q;return q}function i(D,q,Z){let fe=q-1,pe=-1,mt=!1,Vt,st,bn,xn;for(;++fe<=Z;){const Me=D[fe];switch(Me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":Me[0]==="enter"?pe++:pe--,xn=void 0;break;case"lineEndingBlank":Me[0]==="enter"&&(Vt&&!xn&&!pe&&!bn&&(bn=fe),xn=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xn=void 0}if(!pe&&Me[0]==="enter"&&Me[1].type==="listItemPrefix"||pe===-1&&Me[0]==="exit"&&(Me[1].type==="listUnordered"||Me[1].type==="listOrdered")){if(Vt){let Wt=fe;for(st=void 0;Wt--;){const at=D[Wt];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;st&&(D[st][1].type="lineEndingBlank",mt=!0),at[1].type="lineEnding",st=Wt}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}bn&&(!st||bn<st)&&(Vt._spread=!0),Vt.end=Object.assign({},st?D[st][1].start:Me[1].end),D.splice(st||fe,0,["exit",Vt,Me[2]]),fe++,Z++}if(Me[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},Me[1].start),end:void 0};Vt=Wt,D.splice(fe,0,["enter",Wt,Me[2]]),fe++,Z++,bn=void 0,xn=!0}}}return D[q][1]._spread=mt,Z}function s(D,q){return Z;function Z(fe){o.call(this,D(fe),fe),q&&q.call(this,fe)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(D,q,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([q,Z||void 0]),D.position={start:ft(q.start),end:void 0}}function l(D){return q;function q(Z){D&&D.call(this,Z),h.call(this,Z)}}function h(D,q){const Z=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==D.type&&(q?q.call(this,D,fe[0]):(fe[1]||Ja).call(this,D,fe[0]));else throw new Error("Cannot close `"+D.type+"` ("+Bn({start:D.start,end:D.end})+"): it’s not open");Z.position.end=ft(D.end)}function m(){return ps(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(D){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),q=this.stack[this.stack.length-1];q.lang=D}function g(){const D=this.resume(),q=this.stack[this.stack.length-1];q.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const D=this.resume(),q=this.stack[this.stack.length-1];q.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const D=this.resume(),q=this.stack[this.stack.length-1];q.value=D.replace(/(\r?\n|\r)$/g,"")}function v(D){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.label=q,Z.identifier=Ve(this.sliceSerialize(D)).toLowerCase()}function S(){const D=this.resume(),q=this.stack[this.stack.length-1];q.title=D}function w(){const D=this.resume(),q=this.stack[this.stack.length-1];q.url=D}function R(D){const q=this.stack[this.stack.length-1];q.depth||(q.depth=this.sliceSerialize(D).length)}function N(){this.data.setextHeadingSlurpLineEnding=!0}function M(D){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(D){const q=this.stack[this.stack.length-1].children;let Z=q[q.length-1];(!Z||Z.type!=="text")&&(Z=fh(),Z.position={start:ft(D.start),end:void 0},q.push(Z)),this.stack.push(Z)}function I(D){const q=this.stack.pop();q.value+=this.sliceSerialize(D),q.position.end=ft(D.end)}function j(D){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=q.children[q.children.length-1];Z.position.end=ft(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(Y.call(this,D),I.call(this,D))}function $(){this.data.atHardBreak=!0}function V(){const D=this.resume(),q=this.stack[this.stack.length-1];q.value=D}function Q(){const D=this.resume(),q=this.stack[this.stack.length-1];q.value=D}function G(){const D=this.resume(),q=this.stack[this.stack.length-1];q.value=D}function U(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=q,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function P(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=q,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function W(D){const q=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=cT(q),Z.identifier=Ve(q).toLowerCase()}function J(){const D=this.stack[this.stack.length-1],q=this.resume(),Z=this.stack[this.stack.length-1];this.data.inReference=!0,Z.type==="link"?Z.children=D.children:Z.alt=q}function y(){const D=this.resume(),q=this.stack[this.stack.length-1];q.url=D}function ce(){const D=this.resume(),q=this.stack[this.stack.length-1];q.title=D}function X(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function De(D){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.label=q,Z.identifier=Ve(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Te(D){this.data.characterReferenceType=D.type}function ge(D){const q=this.sliceSerialize(D),Z=this.data.characterReferenceType;let fe;Z?(fe=xc(q,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Es(q);const pe=this.stack[this.stack.length-1];pe.value+=fe}function At(D){const q=this.stack.pop();q.position.end=ft(D.end)}function Pe(D){I.call(this,D);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(D)}function He(D){I.call(this,D);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(D)}function it(){return{type:"blockquote",children:[]}}function sr(){return{type:"code",lang:null,meta:null,value:""}}function ar(){return{type:"inlineCode",value:""}}function or(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function lr(){return{type:"emphasis",children:[]}}function Tn(){return{type:"heading",depth:0,children:[]}}function Yt(){return{type:"break"}}function cr(){return{type:"html",value:""}}function se(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function we(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Ge(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function mh(){return{type:"strong",children:[]}}function fh(){return{type:"text",value:""}}function ph(){return{type:"thematicBreak"}}}function ft(e){return{line:e.line,column:e.column,offset:e.offset}}function Jc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Jc(e,r):Bk(e,r)}}function Bk(e,t){let n;for(n in t)if(Zc.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ja(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bn({start:t.start,end:t.end})+") is still open")}function Fk(e){const t=this;t.parser=n;function n(r){return Pk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jk(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Hk(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
43
|
-
`}]}function Uk(e,t){const n=t.value?t.value+`
|
|
44
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function zk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $k(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=gn(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const h={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,h),e.applyData(t,h)}function Yk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function eu(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Wk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eu(e,t);const i={src:gn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Qk(e,t){const n={src:gn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eu(e,t);const i={href:gn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Xk(e,t){const n={href:gn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zk(e,t,n){const r=e.all(t),i=n?Jk(n):tu(t),s={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let d;m&&m.type==="element"&&m.tagName==="p"?d=m:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const m=r[o];(i||o!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
|
|
45
|
-
`}),m.type==="element"&&m.tagName==="p"&&!i?a.push(...m.children):a.push(m)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
|
|
46
|
-
`});const h={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,h),e.applyData(t,h)}function Jk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=tu(n[r])}return t}function tu(e){const t=e.spread;return t??e.children.length>1}function ey(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ty(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ny(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ry(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iy(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=nt(t.children[1]),l=Vr(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function sy(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let o=-1;const l=[];for(;++o<a;){const m=t.children[o],d={},f=s?s[o]:void 0;f&&(d.align=f);let p={type:"element",tagName:i,properties:d,children:[]};m&&(p.children=e.all(m),e.patch(m,p),p=e.applyData(m,p)),l.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,h),e.applyData(t,h)}function ay(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var eo=9,to=32;function oy(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(no(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(no(t.slice(i),i>0,!1)),s.join("")}function no(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===eo||s===to;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===eo||s===to;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ly(e,t){const n={type:"text",value:oy(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cy(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var uy={blockquote:jk,break:Hk,code:Uk,delete:zk,emphasis:$k,footnoteReference:qk,heading:Yk,html:Vk,imageReference:Wk,image:Qk,inlineCode:Gk,linkReference:Kk,link:Xk,listItem:Zk,list:ey,paragraph:ty,root:ny,strong:ry,table:iy,tableCell:ay,tableRow:sy,text:ly,thematicBreak:cy,toml:mr,yaml:mr,definition:mr,footnoteDefinition:mr};function mr(){}function hy(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function dy(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function my(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hy,r=e.options.footnoteBackLabel||dy,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[l]);if(!h)continue;const m=e.all(h),d=String(h.identifier).toUpperCase(),f=gn(d.toLowerCase());let p=0;const g=[],_=e.footnoteCounts.get(d);for(;_!==void 0&&++p<=_;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const A=m[m.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const v=A.children[A.children.length-1];v&&v.type==="text"?v.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...g)}else m.push(...g);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(m,!0)};e.patch(h,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Bt(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
47
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
48
|
-
`}]}}var ji={}.hasOwnProperty,fy={};function py(e,t){const n=t||fy,r=new Map,i=new Map,s={all:o,applyData:Ey,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...uy,...n.handlers},one:a,options:n,patch:gy,wrap:by};return tt(e,function(l){if(l.type==="definition"||l.type==="footnoteDefinition"){const h=l.type==="definition"?r:i,m=String(l.identifier).toUpperCase();h.has(m)||h.set(m,l)}}),s;function a(l,h){const m=l.type,d=s.handlers[m];if(ji.call(s.handlers,m)&&d)return d(s,l,h);if(s.options.passThrough&&s.options.passThrough.includes(m)){if("children"in l){const{children:f,...p}=l,g=Bt(p);return g.children=s.all(l),g}return Bt(l)}return(s.options.unknownHandler||Ty)(s,l,h)}function o(l){const h=[];if("children"in l){const m=l.children;let d=-1;for(;++d<m.length;){const f=s.one(m[d],l);if(f){if(d&&m[d-1].type==="break"&&(!Array.isArray(f)&&f.type==="text"&&(f.value=ro(f.value)),!Array.isArray(f)&&f.type==="element")){const p=f.children[0];p&&p.type==="text"&&(p.value=ro(p.value))}Array.isArray(f)?h.push(...f):h.push(f)}}}return h}}function gy(e,t){e.position&&(t.position=Gl(e))}function Ey(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:"children"in n?n.children:[n]}),n.type==="element"&&s&&Object.assign(n.properties,Bt(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ty(e,t){const n=t.data||{},r="value"in t&&!(ji.call(n,"hProperties")||ji.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function by(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
49
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
50
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
51
|
-
`}),n}function ro(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function io(e,t){const n=py(e,t),r=n.one(e,void 0),i=my(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&("children"in s,s.children.push({type:"text",value:`
|
|
52
|
-
`},i)),s}function xy(e,t){return e&&"run"in e?async function(n,r){const i=io(n,{file:r,...t});await e.run(i,r)}:function(n,r){return io(n,{file:r,...e||t})}}function so(e){if(e)throw e}var ky=qn(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):r.call(d)==="[object Array]"},o=function(d){if(!d||r.call(d)!=="[object Object]")return!1;var f=n.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&n.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!p)return!1;var g;for(g in d);return typeof g>"u"||n.call(d,g)},l=function(d,f){i&&f.name==="__proto__"?i(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},h=function(d,f){if(f==="__proto__")if(n.call(d,f)){if(s)return s(d,f).value}else return;return d[f]};t.exports=function m(){var d,f,p,g,_,A,b=arguments[0],v=1,S=arguments.length,w=!1;for(typeof b=="boolean"&&(w=b,b=arguments[1]||{},v=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});v<S;++v)if(d=arguments[v],d!=null)for(f in d)p=h(b,f),g=h(d,f),b!==g&&(w&&g&&(o(g)||(_=a(g)))?(_?(_=!1,A=p&&a(p)?p:[]):A=p&&o(p)?p:{},l(b,{name:f,newValue:m(w,A,g)})):typeof g<"u"&&l(b,{name:f,newValue:g}));return b}}));function Hi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function yy(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...h){const m=e[++s];let d=-1;if(l){a(l);return}for(;++d<i.length;)(h[d]===null||h[d]===void 0)&&(h[d]=i[d]);i=h,m?Cy(m,o)(...h):a(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Cy(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(h){const m=h;if(o&&n)throw m;return i(m)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}var Xe={basename:_y,dirname:Ay,extname:vy,join:Ny,sep:"/"};function _y(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rr(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Ay(e){if(rr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vy(e){rr(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ny(...e){let t=-1,n;for(;++t<e.length;)rr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Sy(n)}function Sy(e){rr(e);const t=e.codePointAt(0)===47;let n=Iy(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Iy(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function rr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var wy={cwd:Ly};function Ly(){return"/"}function Ui(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ry(e){if(typeof e=="string")e=new URL(e);else if(!Ui(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Oy(e)}function Oy(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+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(t)}var pi=["history","path","basename","stem","extname","dirname"],Dy=class{constructor(e){let t;e?Ui(e)?t={path:e}:typeof e=="string"||Py(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":wy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<pi.length;){const i=pi[n];i in t&&t[i]!==void 0&&t[i]!==null&&(this[i]=i==="history"?[...t[i]]:t[i])}let r;for(r in t)pi.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?Xe.basename(this.path):void 0}set basename(e){Ei(e,"basename"),gi(e,"basename"),this.path=Xe.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Xe.dirname(this.path):void 0}set dirname(e){ao(this.basename,"dirname"),this.path=Xe.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Xe.extname(this.path):void 0}set extname(e){if(gi(e,"extname"),ao(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xe.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ui(e)&&(e=Ry(e)),Ei(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Xe.basename(this.path,this.extname):void 0}set stem(e){Ei(e,"stem"),gi(e,"stem"),this.path=Xe.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Ae(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}};function gi(e,t){if(e&&e.includes(Xe.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xe.sep+"`")}function Ei(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ao(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Py(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var My=(function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ti=Pr(ky(),1),By={}.hasOwnProperty,Fy=class nu extends My{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=yy()}copy(){const t=new nu;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data((0,Ti.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ki("data",this.frozen),this.namespace[t]=n,this):By.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ki("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=fr(t),r=this.parser||this.Parser;return bi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),bi("process",this.parser||this.Parser),xi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=fr(t),l=r.parse(o);r.run(l,o,function(m,d,f){if(m||!d||!f)return h(m);const p=d,g=r.stringify(p,f);Uy(g)?f.value=g:f.result=g,h(m,f)});function h(m,d){m||!d?a(m):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),bi("processSync",this.parser||this.Parser),xi("processSync",this.compiler||this.Compiler),this.process(t,i),lo("processSync","process",n),r;function i(s,a){n=!0,so(s),r=a}}run(t,n,r){oo(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=fr(n);i.run(t,l,h);function h(m,d,f){const p=d||t;m?o(m):a?a(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),lo("runSync","run",r),i;function s(a,o){so(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=fr(n),i=this.compiler||this.Compiler;return xi("stringify",i),oo(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ki("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(h){if(typeof h=="function")l(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...d]=h;l(m,d)}else a(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function a(h){if(!("plugins"in h)&&!("settings"in h))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");o(h.plugins),h.settings&&(i.settings=(0,Ti.default)(!0,i.settings,h.settings))}function o(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const d=h[m];s(d)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function l(h,m){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===h){f=d;break}if(f===-1)r.push([h,...m]);else if(m.length>0){let[p,...g]=m;const _=r[f][1];Hi(_)&&Hi(p)&&(p=(0,Ti.default)(!0,_,p)),r[f]=[h,p,...g]}}}},jy=new Fy().freeze();function bi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ki(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oo(e){if(!Hi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fr(e){return Hy(e)?e:new Dy(e)}function Hy(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uy(e){return typeof e=="string"||zy(e)}function zy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ru=Pr(Vh(),1);function As(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qt=As();function iu(e){qt=e}var Lt={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Se.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,t)};return r}var $y=(()=>{try{return!0}catch{return!1}})(),Se={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},qy=/^(?:[ \t]*(?:\n|$))+/,Yy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ir=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,su=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,au=le(su).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Qy=le(su).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ns=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gy=/^[^\n]+/,Ss=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ky=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ss).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xy=le(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vs).getRegex(),Kr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Is=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zy=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Is).replace("tag",Kr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),co=le(Ns).replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kr).getRegex(),ws={blockquote:le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",co).getRegex(),code:Yy,def:Ky,fences:Vy,heading:Wy,hr:ir,html:Zy,lheading:au,list:Xy,newline:qy,paragraph:co,table:Lt,text:Gy},uo=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kr).getRegex(),Jy={...ws,lheading:Qy,table:uo,paragraph:le(Ns).replace("hr",ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",uo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kr).getRegex()},eC={...ws,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Is).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Lt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Ns).replace("hr",ir).replace("heading",` *#{1,6} *[^
|
|
53
|
-
]`).replace("lheading",au).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tC=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ou=/^( {2,}|\\)\n(?!\s*$)/,rC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,En=/[\p{P}\p{S}]/u,Xr=/[\s\p{P}\p{S}]/u,Ls=/[^\s\p{P}\p{S}]/u,iC=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xr).getRegex(),lu=/(?!~)[\p{P}\p{S}]/u,sC=/(?!~)[\s\p{P}\p{S}]/u,aC=/(?:[^\s\p{P}\p{S}]|~)/u,oC=le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$y?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cu=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lC=le(cu,"u").replace(/punct/g,En).getRegex(),cC=le(cu,"u").replace(/punct/g,lu).getRegex(),uu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uC=le(uu,"gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,Xr).replace(/punct/g,En).getRegex(),hC=le(uu,"gu").replace(/notPunctSpace/g,aC).replace(/punctSpace/g,sC).replace(/punct/g,lu).getRegex(),dC=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,Xr).replace(/punct/g,En).getRegex(),mC=le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,En).getRegex(),fC=le("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,Xr).replace(/punct/g,En).getRegex(),pC=le(/\\(punct)/,"gu").replace(/punct/g,En).getRegex(),gC=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),EC=le(Is).replace("(?:-->|$)","-->").getRegex(),TC=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",EC).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ir=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bC=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ir).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hu=le(/^!?\[(label)\]\[(ref)\]/).replace("label",Ir).replace("ref",Ss).getRegex(),du=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ss).getRegex(),xC=le("reflink|nolink(?!\\()","g").replace("reflink",hu).replace("nolink",du).getRegex(),ho=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rs={_backpedal:Lt,anyPunctuation:pC,autolink:gC,blockSkip:oC,br:ou,code:nC,del:Lt,delLDelim:Lt,delRDelim:Lt,emStrongLDelim:lC,emStrongRDelimAst:uC,emStrongRDelimUnd:dC,escape:tC,link:bC,nolink:du,punctuation:iC,reflink:hu,reflinkSearch:xC,tag:TC,text:rC,url:Lt},kC={...Rs,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",Ir).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ir).getRegex()},zi={...Rs,emStrongRDelimAst:hC,emStrongLDelim:cC,delLDelim:mC,delRDelim:fC,url:le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ho).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ho).getRegex()},yC={...zi,br:le(ou).replace("{2,}","*").getRegex(),text:le(zi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pr={normal:ws,gfm:Jy,pedantic:eC},An={normal:Rs,gfm:zi,breaks:yC,pedantic:kC},CC={"&":"&","<":"<",">":">",'"':""","'":"'"},mo=e=>CC[e];function Ke(e,t){if(t){if(Se.escapeTest.test(e))return e.replace(Se.escapeReplace,mo)}else if(Se.escapeTestNoEncode.test(e))return e.replace(Se.escapeReplaceNoEncode,mo);return e}function fo(e){try{e=encodeURI(e).replace(Se.percentDecode,"%")}catch{return null}return e}function po(e,t){let n=e.replace(Se.findPipe,(i,s,a)=>{let o=!1,l=s;for(;--l>=0&&a[l]==="\\";)o=!o;return o?"|":" |"}).split(Se.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(Se.slashPipe,"|");return n}function vn(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r;){let s=e.charAt(r-i-1);if(s===t&&!n)i++;else if(s!==t&&n)i++;else break}return e.slice(0,r-i)}function _C(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function AC(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function go(e,t,n,r,i){let s=t.href,a=t.title||null,o=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function vC(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
54
|
-
`).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
|
|
55
|
-
`)}var wr=class{options;rules;lexer;constructor(e){this.options=e||qt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:vn(n,`
|
|
56
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=vC(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=vn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:vn(t[0],`
|
|
57
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=vn(t[0],`
|
|
58
|
-
`).split(`
|
|
59
|
-
`),r="",i="",s=[];for(;n.length>0;){let a=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);let h=o.join(`
|
|
60
|
-
`),m=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
62
|
-
${h}`:h,i=i?`${i}
|
|
63
|
-
${m}`:m;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,s,!0),this.lexer.state.top=d,n.length===0)break;let f=s.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let p=f,g=p.raw+`
|
|
64
|
-
`+n.join(`
|
|
65
|
-
`),_=this.blockquote(g);s[s.length-1]=_,r=r.substring(0,r.length-p.raw.length)+_.raw,i=i.substring(0,i.length-p.text.length)+_.text;break}else if(f?.type==="list"){let p=f,g=p.raw+`
|
|
66
|
-
`+n.join(`
|
|
67
|
-
`),_=this.list(g);s[s.length-1]=_,r=r.substring(0,r.length-f.raw.length)+_.raw,i=i.substring(0,i.length-p.raw.length)+_.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
68
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let l=!1,h="",m="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let d=AC(t[2].split(`
|
|
69
|
-
`,1)[0],t[1].length),f=e.split(`
|
|
70
|
-
`,1)[0],p=!d.trim(),g=0;if(this.options.pedantic?(g=2,m=d.trimStart()):p?g=t[1].length+1:(g=d.search(this.rules.other.nonSpaceChar),g=g>4?1:g,m=d.slice(g),g+=t[1].length),p&&this.rules.other.blankLine.test(f)&&(h+=f+`
|
|
71
|
-
`,e=e.substring(f.length+1),l=!0),!l){let _=this.rules.other.nextBulletRegex(g),A=this.rules.other.hrRegex(g),b=this.rules.other.fencesBeginRegex(g),v=this.rules.other.headingBeginRegex(g),S=this.rules.other.htmlBeginRegex(g),w=this.rules.other.blockquoteBeginRegex(g);for(;e;){let R=e.split(`
|
|
72
|
-
`,1)[0],N;if(f=R,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),N=f):N=f.replace(this.rules.other.tabCharGlobal," "),b.test(f)||v.test(f)||S.test(f)||w.test(f)||_.test(f)||A.test(f))break;if(N.search(this.rules.other.nonSpaceChar)>=g||!f.trim())m+=`
|
|
73
|
-
`+N.slice(g);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||v.test(d)||A.test(d))break;m+=`
|
|
74
|
-
`+f}p=!f.trim(),h+=R+`
|
|
75
|
-
`,e=e.substring(R.length+1),d=N.slice(g)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),i.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=h}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let m={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=m.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=m.raw+l.tokens[0].raw,l.tokens[0].text=m.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(m)):l.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):l.tokens.unshift(m)}}if(!i.loose){let h=l.tokens.filter(m=>m.type==="space");i.loose=h.length>0&&h.some(m=>this.rules.other.anyLine.test(m.raw))}}if(i.loose)for(let l of i.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=po(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
76
|
-
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(po(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
77
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=vn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=_C(t[2],"()");if(s===-2)return;if(s>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),go(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!r){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return go(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,o=i,l=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+i);(r=h.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let m=[...r[0]][0].length,d=e.slice(0,i+r.index+m+a);if(Math.min(i,a)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,o=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+i);(r=l.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(a=[...s].length,a!==i))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...r[0]][0].length,m=e.slice(0,i+r.index+h+a),d=m.slice(i,-i);return{type:"del",raw:m,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},$e=class $i{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||qt,this.options.tokenizer=this.options.tokenizer||new wr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Se,block:pr.normal,inline:An.normal};this.options.pedantic?(n.block=pr.pedantic,n.inline=An.pedantic):this.options.gfm&&(n.block=pr.gfm,this.options.breaks?n.inline=An.breaks:n.inline=An.gfm),this.tokenizer.rules=n}static get rules(){return{block:pr,inline:An}}static lex(t,n){return new $i(n).lex(t)}static lexInline(t,n){return new $i(n).inlineTokens(t)}lex(t){t=t.replace(Se.carriageReturn,`
|
|
78
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Se.tabCharGlobal," ").replace(Se.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
79
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
80
|
-
`)?"":`
|
|
81
|
-
`)+i.raw,a.text+=`
|
|
82
|
-
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
83
|
-
`)?"":`
|
|
84
|
-
`)+i.raw,a.text+=`
|
|
85
|
-
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,o=t.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
86
|
-
`)?"":`
|
|
87
|
-
`)+i.raw,a.text+=`
|
|
88
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
89
|
-
`)?"":`
|
|
90
|
-
`)+i.raw,a.text+=`
|
|
91
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,o="";for(;t;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(m=>(l=m.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let m=n.at(-1);l.type==="text"&&m?.type==="text"?(m.raw+=l.raw,m.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,r,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t,r,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let h=t;if(this.options.extensions?.startInline){let m=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(m=Math.min(m,f))}),m<1/0&&m>=0&&(h=t.substring(0,m+1))}if(l=this.tokenizer.inlineText(h)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let m=n.at(-1);m?.type==="text"?(m.raw+=l.raw,m.text+=l.text):n.push(l);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Lr=class{options;parser;constructor(e){this.options=e||qt}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Se.notSpaceStart)?.[0],i=e.replace(Se.endingNewline,"")+`
|
|
92
|
-
`;return r?'<pre><code class="language-'+Ke(r)+'">'+(n?i:Ke(i,!0))+`</code></pre>
|
|
93
|
-
`:"<pre><code>"+(n?i:Ke(i,!0))+`</code></pre>
|
|
94
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
95
|
-
${this.parser.parse(e)}</blockquote>
|
|
96
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
97
|
-
`}hr(e){return`<hr>
|
|
98
|
-
`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a<e.items.length;a++){let o=e.items[a];r+=this.listitem(o)}let i=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
99
|
-
`+r+"</"+i+`>
|
|
100
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
101
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
102
|
-
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
103
|
-
<thead>
|
|
104
|
-
`+t+`</thead>
|
|
105
|
-
`+r+`</table>
|
|
106
|
-
`}tablerow({text:e}){return`<tr>
|
|
107
|
-
${e}</tr>
|
|
108
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
109
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ke(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=fo(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+Ke(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=fo(e);if(i===null)return Ke(n);e=i;let s=`<img src="${e}" alt="${Ke(n)}"`;return t&&(s+=` title="${Ke(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ke(e.text)}},Os=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Ye=class qi{options;renderer;textRenderer;constructor(t){this.options=t||qt,this.options.renderer=this.options.renderer||new Lr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Os}static parse(t,n){return new qi(n).parse(t)}static parseInline(t,n){return new qi(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let a=i,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=o||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);break;case"hr":n+=this.renderer.hr(s);break;case"heading":n+=this.renderer.heading(s);break;case"code":n+=this.renderer.code(s);break;case"table":n+=this.renderer.table(s);break;case"blockquote":n+=this.renderer.blockquote(s);break;case"list":n+=this.renderer.list(s);break;case"checkbox":n+=this.renderer.checkbox(s);break;case"html":n+=this.renderer.html(s);break;case"def":n+=this.renderer.def(s);break;case"paragraph":n+=this.renderer.paragraph(s);break;case"text":n+=this.renderer.text(s);break;default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}let a=s;switch(a.type){case"escape":r+=n.text(a);break;case"html":r+=n.html(a);break;case"link":r+=n.link(a);break;case"image":r+=n.image(a);break;case"checkbox":r+=n.checkbox(a);break;case"strong":r+=n.strong(a);break;case"em":r+=n.em(a);break;case"codespan":r+=n.codespan(a);break;case"br":r+=n.br(a);break;case"del":r+=n.del(a);break;case"text":r+=n.text(a);break;default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},In=class{options;block;constructor(e){this.options=e||qt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?$e.lex:$e.lexInline}provideParser(e=this.block){return e?Ye.parse:Ye.parseInline}},NC=class{defaults=As();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ye;Renderer=Lr;TextRenderer=Os;Lexer=$e;Tokenizer=wr;Hooks=In;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new Lr(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...h)=>{let m=o.apply(i,h);return m===!1&&(m=l.apply(i,h)),m||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new wr(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...h)=>{let m=o.apply(i,h);return m===!1&&(m=l.apply(i,h)),m}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new In;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];In.passThroughHooks.has(s)?i[a]=h=>{if(this.defaults.async&&In.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await o.call(i,h);return l.call(i,d)})();let m=o.call(i,h);return l.call(i,m)}:i[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(i,h);return d===!1&&(d=await l.apply(i,h)),d})();let m=o.apply(i,h);return m===!1&&(m=l.apply(i,h)),m}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $e.lex(e,t??this.defaults)}parser(e,t){return Ye.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,o=await(i.hooks?await i.hooks.provideLexer(e):e?$e.lex:$e.lexInline)(a,i),l=i.hooks?await i.hooks.processAllTokens(o):o;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let h=await(i.hooks?await i.hooks.provideParser(e):e?Ye.parse:Ye.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(h):h})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer(e):e?$e.lex:$e.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=(i.hooks?i.hooks.provideParser(e):e?Ye.parse:Ye.parseInline)(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return s(a)}}}onError(e,t){return n=>{if(n.message+=`
|
|
110
|
-
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Ke(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},jt=new NC;function ue(e,t){return jt.parse(e,t)}ue.options=ue.setOptions=function(e){return jt.setOptions(e),ue.defaults=jt.defaults,iu(ue.defaults),ue};ue.getDefaults=As;ue.defaults=qt;ue.use=function(...e){return jt.use(...e),ue.defaults=jt.defaults,iu(ue.defaults),ue};ue.walkTokens=function(e,t){return jt.walkTokens(e,t)};ue.parseInline=jt.parseInline;ue.Parser=Ye;ue.parser=Ye.parse;ue.Renderer=Lr;ue.TextRenderer=Os;ue.Lexer=$e;ue.lexer=$e.lex;ue.Tokenizer=wr;ue.Hooks=In;ue.parse=ue;var Wv=ue.options,Qv=ue.setOptions,Gv=ue.use,Kv=ue.walkTokens,Xv=ue.parseInline,Zv=Ye.parse,Jv=$e.lex,SC=300,IC="300px",wC=500;function LC(e={}){let{immediate:t=!1,debounceDelay:n=SC,rootMargin:r=IC,idleTimeout:i=wC}=e,[s,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),l=(0,E.useRef)(null),h=(0,E.useRef)(null),m=(0,E.useMemo)(()=>p=>{let g=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-g))})},1)},[]),d=(0,E.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,g)=>window.requestIdleCallback(p,g):m,[m]),f=(0,E.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,E.useEffect)(()=>{if(t){a(!0);return}let p=o.current;if(!p)return;l.current&&(clearTimeout(l.current),l.current=null),h.current&&(f(h.current),h.current=null);let g=()=>{l.current&&(clearTimeout(l.current),l.current=null),h.current&&(f(h.current),h.current=null)},_=S=>{h.current=d(w=>{w.timeRemaining()>0||w.didTimeout?(a(!0),S.disconnect()):h.current=d(()=>{a(!0),S.disconnect()},{timeout:i/2})},{timeout:i})},A=S=>{g(),l.current=window.setTimeout(()=>{var w,R;let N=S.takeRecords();(N.length===0||(R=(w=N.at(-1))==null?void 0:w.isIntersecting)!=null&&R)&&_(S)},n)},b=(S,w)=>{S.isIntersecting?A(w):g()},v=new IntersectionObserver(S=>{for(let w of S)b(w,v)},{rootMargin:r,threshold:0});return v.observe(p),()=>{l.current&&clearTimeout(l.current),h.current&&f(h.current),v.disconnect()}},[t,n,r,i,f,d]),{shouldRender:s,containerRef:o}}var mu=/\s/,RC=/^\s+$/,OC=new Set(["code","pre","svg","math","annotation"]),DC=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",PC=e=>e.some(t=>DC(t)&&OC.has(t.tagName)),MC=e=>{let t=[],n="",r=!1;for(let i of e){let s=mu.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},BC=e=>{let t=[],n="";for(let r of e)mu.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},FC=(e,t,n,r,i,s)=>{let a=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return s&&(a+=`;--sd-delay:${s}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:a},children:[{type:"text",value:e}]}},jC=(e,t,n,r,i)=>{let s=t.at(-1);if(!(s&&"children"in s))return;if(PC(t))return Nn;let a=s,o=a.children.indexOf(e);if(o===-1)return;let l=e.value;if(!l.trim()){i.count+=l.length;return}let h=n.sep==="char"?BC(l):MC(l),m=r.prevContentLength,d=h.map(f=>{let p=i.count;if(i.count+=f.length,RC.test(f))return{type:"text",value:f};let g=m>0&&p<m,_=g?0:i.newIndex++*n.stagger;return FC(f,n.animation,n.duration,n.easing,g,_)});return a.children.splice(o,1,...d),o+d.length},HC=0;function Yi(e){var t,n,r,i,s;let a={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word",stagger:(s=e?.stagger)!=null?s:40},o={prevContentLength:0,lastRenderCharCount:0},l=HC++,h=()=>m=>{let d={count:0,newIndex:0};as(m,"text",(f,p)=>jC(f,p,a,o,d)),o.lastRenderCharCount=d.count,o.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${l}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(m){o.prevContentLength=m},getLastRenderCharCount(){let m=o.lastRenderCharCount;return o.lastRenderCharCount=0,m}}}Yi();var fu=(0,E.createContext)(!1),UC=()=>(0,E.useContext)(fu),Ds=(...e)=>Xo(Ko(e)),zC=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},$C=e=>e?(...t)=>zC(e,Xo(Ko(t))):Ds,en=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,s=URL.createObjectURL(i),a=document.createElement("a");a.href=s,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)},Vi=(0,E.createContext)(Ds),re=()=>(0,E.useContext)(Vi),qC=Ds("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),YC=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),s=n.slice(r+1).trim();i&&s&&(t[i]=s)}}return t},VC=(0,E.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:s=!0,...a})=>{let o=re(),l=(0,E.useMemo)(()=>o(qC),[o]),h=(0,E.useMemo)(()=>{let m={};return t.bg&&(m["--sdm-bg"]=t.bg),t.fg&&(m["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(m,YC(t.rootStyle)),m},[t.bg,t.fg,t.rootStyle]);return(0,u.jsx)("div",{className:o(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...a,children:(0,u.jsx)("pre",{className:o(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:(0,u.jsx)("code",{className:s?o("[counter-increment:line_0] [counter-reset:line]"):void 0,style:s&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((m,d)=>(0,u.jsx)("span",{className:s?l:void 0,children:m.length===0||m.length===1&&m[0].content===""?`
|
|
111
|
-
`:m.map((f,p)=>{let g={},_=!!f.bgColor;if(f.color&&(g["--sdm-c"]=f.color),f.bgColor&&(g["--sdm-tbg"]=f.bgColor),f.htmlStyle)for(let[A,b]of Object.entries(f.htmlStyle))A==="color"?g["--sdm-c"]=b:A==="background-color"?(g["--sdm-tbg"]=b,_=!0):g[A]=b;return(0,u.jsx)("span",{className:o("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",_&&"bg-[var(--sdm-tbg)]",_&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:g,...f.htmlAttrs,children:f.content},p)})},d))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),WC=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let s=re();return(0,u.jsx)("div",{className:s("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},pu=(0,E.createContext)({code:""}),gu=()=>(0,E.useContext)(pu),QC=({language:e})=>{let t=re();return(0,u.jsx)("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:(0,u.jsx)("span",{className:t("ml-1 font-mono lowercase"),children:e})})},GC=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
112
|
-
`;)t--;return e.slice(0,t)},KC=(0,E.lazy)(()=>nl(()=>import("./highlighted-body-OFNGDK62-jkW4Egvm.js").then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2,3]))),XC=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:s,lineNumbers:a,...o})=>{let l=re(),h=(0,E.useMemo)(()=>GC(e),[e]),m=(0,E.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
|
|
113
|
-
`).map(d=>[{content:d,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return(0,u.jsx)(pu.Provider,{value:{code:e},children:(0,u.jsxs)(WC,{isIncomplete:i,language:t,children:[(0,u.jsx)(QC,{language:t}),r?(0,u.jsx)("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,u.jsx)("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,(0,u.jsx)(E.Suspense,{fallback:(0,u.jsx)(VC,{className:n,language:t,lineNumbers:a,result:m,startLine:s,...o}),children:(0,u.jsx)(KC,{className:n,code:h,language:t,lineNumbers:a,raw:m,startLine:s,...o})})]})})},ZC=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),JC=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),e_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),t_=e=>(0,u.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,u.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,u.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),n_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),r_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),i_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),s_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),a_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),o_=e=>(0,u.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,u.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),wn={CheckIcon:ZC,CopyIcon:JC,DownloadIcon:e_,ExternalLinkIcon:s_,Loader2Icon:t_,Maximize2Icon:n_,RotateCcwIcon:r_,XIcon:i_,ZoomInIcon:a_,ZoomOutIcon:o_},Eu=(0,E.createContext)(wn),l_=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},Eo=({icons:e,children:t})=>{let n=(0,E.useRef)(e),r=(0,E.useRef)(e?{...wn,...e}:wn);l_(n.current,e)||(n.current=e,r.current=e?{...wn,...e}:wn);let i=r.current;return(0,u.jsx)(Eu.Provider,{value:i,children:t})},Qe=()=>(0,E.useContext)(Eu),Tu={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Wi=(0,E.createContext)(Tu),dt=()=>(0,E.useContext)(Wi),To=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:s,...a})=>{let o=re(),[l,h]=(0,E.useState)(!1),m=(0,E.useRef)(0),{code:d}=gu(),{isAnimating:f}=(0,E.useContext)(je),p=dt(),g=s??d,_=async()=>{var v;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.writeText)){t?.(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(g),h(!0),e?.(),m.current=window.setTimeout(()=>h(!1),n))}catch(S){t?.(S)}};(0,E.useEffect)(()=>()=>{window.clearTimeout(m.current)},[]);let A=Qe(),b=l?A.CheckIcon:A.CopyIcon;return(0,u.jsx)("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:f,onClick:_,title:p.copyCode,type:"button",...a,children:r??(0,u.jsx)(b,{size:14})})},bo={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},c_=({onDownload:e,onError:t,language:n,children:r,className:i,code:s,...a})=>{let o=re(),{code:l}=gu(),{isAnimating:h}=(0,E.useContext)(je),m=dt(),d=Qe(),f=s??l,p=`file.${n&&n in bo?bo[n]:"txt"}`,g="text/plain",_=()=>{try{en(p,f,g),e?.()}catch(A){t?.(A)}};return(0,u.jsx)("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:h,onClick:_,title:m.downloadFile,type:"button",...a,children:r??(0,u.jsx)(d.DownloadIcon,{size:14})})},xo=()=>{let{Loader2Icon:e}=Qe(),t=re();return(0,u.jsxs)("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[(0,u.jsx)("div",{className:t("h-[46px] w-full bg-muted/80")}),(0,u.jsx)("div",{className:t("flex w-full items-center justify-center p-4"),children:(0,u.jsx)(e,{className:t("size-4 animate-spin")})})]})},u_=/\.[^/.]+$/,h_=({node:e,className:t,src:n,alt:r,onLoad:i,onError:s,...a})=>{let{DownloadIcon:o}=Qe(),l=re(),h=(0,E.useRef)(null),[m,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)(!1),g=dt(),_=a.width!=null||a.height!=null,A=(m||_)&&!f,b=f&&!_;(0,E.useEffect)(()=>{let R=h.current;if(R!=null&&R.complete){let N=R.naturalWidth>0;d(N),p(!N)}},[]);let v=(0,E.useCallback)(R=>{d(!0),p(!1),i?.(R)},[i]),S=(0,E.useCallback)(R=>{d(!1),p(!0),s?.(R)},[s]),w=async()=>{if(n)try{let R=await(await fetch(n)).blob(),N=new URL(n,window.location.origin).pathname.split("/").pop()||"",M=N.split(".").pop(),z=N.includes(".")&&M!==void 0&&M.length<=4,Y="";if(z)Y=N;else{let I=R.type,j="png";I.includes("jpeg")||I.includes("jpg")?j="jpg":I.includes("png")?j="png":I.includes("svg")?j="svg":I.includes("gif")?j="gif":I.includes("webp")&&(j="webp"),Y=`${(r||N||"image").replace(u_,"")}.${j}`}en(Y,R,R.type)}catch{window.open(n,"_blank")}};return n?(0,u.jsxs)("div",{className:l("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[(0,u.jsx)("img",{alt:r,className:l("max-w-full rounded-lg",b&&"hidden",t),"data-streamdown":"image",onError:S,onLoad:v,ref:h,src:n,...a}),b&&(0,u.jsx)("span",{className:l("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:g.imageNotAvailable}),(0,u.jsx)("div",{className:l("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),A&&(0,u.jsx)("button",{className:l("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:w,title:g.downloadImage,type:"button",children:(0,u.jsx)(o,{size:14})})]}):null},Fn=0,Ps=()=>{Fn+=1,Fn===1&&(document.body.style.overflow="hidden")},Ms=()=>{Fn=Math.max(0,Fn-1),Fn===0&&(document.body.style.overflow="")},d_=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:s,ExternalLinkIcon:a,XIcon:o}=Qe(),l=re(),[h,m]=(0,E.useState)(!1),d=dt(),f=(0,E.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},[e]),p=(0,E.useCallback)(()=>{r(),n()},[r,n]);return(0,E.useEffect)(()=>{if(t){Ps();let g=_=>{_.key==="Escape"&&n()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),Ms()}}},[t,n]),t?(0,u.jsx)("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:g=>{g.key==="Escape"&&n()},role:"button",tabIndex:0,children:(0,u.jsxs)("div",{className:l("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),role:"presentation",children:[(0,u.jsx)("button",{className:l("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:d.close,type:"button",children:(0,u.jsx)(o,{size:16})}),(0,u.jsxs)("div",{className:l("flex flex-col gap-2"),children:[(0,u.jsxs)("div",{className:l("flex items-center gap-2 font-semibold text-lg"),children:[(0,u.jsx)(a,{size:20}),(0,u.jsx)("span",{children:d.openExternalLink})]}),(0,u.jsx)("p",{className:l("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),(0,u.jsx)("div",{className:l("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,u.jsxs)("div",{className:l("flex gap-2"),children:[(0,u.jsx)("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:f,type:"button",children:h?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{size:14}),(0,u.jsx)("span",{children:d.copied})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(s,{size:14}),(0,u.jsx)("span",{children:d.copyLink})]})}),(0,u.jsxs)("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:p,type:"button",children:[(0,u.jsx)(a,{size:14}),(0,u.jsx)("span",{children:d.openLink})]})]})]})}):null},Qi=(0,E.createContext)(null),Bs=()=>(0,E.useContext)(Qi),e1=()=>{var e;let t=Bs();return(e=t?.code)!=null?e:null},Fs=()=>{var e;let t=Bs();return(e=t?.mermaid)!=null?e:null},m_=e=>{var t;let n=Bs();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},f_=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,s)=>{let a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let l=document.createElement("canvas"),h=o.width*r,m=o.height*r;l.width=h,l.height=m;let d=l.getContext("2d");if(!d){s(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(o,0,0,h,m),l.toBlob(f=>{if(!f){s(new Error("Failed to create PNG blob"));return}i(f)},"image/png")},o.onerror=()=>s(new Error("Failed to load SVG image")),o.src=a})},p_=({chart:e,children:t,className:n,onDownload:r,config:i,onError:s})=>{let a=re(),[o,l]=(0,E.useState)(!1),h=(0,E.useRef)(null),{isAnimating:m}=(0,E.useContext)(je),d=Qe(),f=Fs(),p=dt(),g=async _=>{try{if(_==="mmd"){en("diagram.mmd",e,"text/plain"),l(!1),r?.(_);return}if(!f){s?.(new Error("Mermaid plugin not available"));return}let A=f.getMermaid(i),b=e.split("").reduce((w,R)=>(w<<5)-w+R.charCodeAt(0)|0,0),v=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await A.render(v,e);if(!S){s?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(_==="svg"){en("diagram.svg",S,"image/svg+xml"),l(!1),r?.(_);return}if(_==="png"){en("diagram.png",await f_(S),"image/png"),r?.(_),l(!1);return}}catch(A){s?.(A)}};return(0,E.useEffect)(()=>{let _=A=>{let b=A.composedPath();h.current&&!b.includes(h.current)&&l(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[]),(0,u.jsxs)("div",{className:a("relative"),ref:h,children:[(0,u.jsx)("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:m,onClick:()=>l(!o),title:p.downloadDiagram,type:"button",children:t??(0,u.jsx)(d.DownloadIcon,{size:14})}),o?(0,u.jsxs)("div",{className:a("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,u.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("svg"),title:p.downloadDiagramAsSvg,type:"button",children:p.mermaidFormatSvg}),(0,u.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("png"),title:p.downloadDiagramAsPng,type:"button",children:p.mermaidFormatPng}),(0,u.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("mmd"),title:p.downloadDiagramAsMmd,type:"button",children:p.mermaidFormatMmd})]}):null]})},g_=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...s})=>{let{Maximize2Icon:a,XIcon:o}=Qe(),l=re(),[h,m]=(0,E.useState)(!1),{isAnimating:d,controls:f}=(0,E.useContext)(je),p=dt(),g=(()=>{if(typeof f=="boolean")return f;let A=f.mermaid;return A===!1?!1:A===!0||A===void 0?!0:A.panZoom!==!1})(),_=()=>{m(!h)};return(0,E.useEffect)(()=>{if(h){Ps();let A=b=>{b.key==="Escape"&&m(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A),Ms()}}},[h]),(0,E.useEffect)(()=>{h?n?.():r&&r()},[h,n,r]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:d,onClick:_,title:p.viewFullscreen,type:"button",...s,children:(0,u.jsx)(a,{size:14})}),h?(0,ru.createPortal)((0,u.jsxs)("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:_,onKeyDown:A=>{A.key==="Escape"&&_()},role:"button",tabIndex:0,children:[(0,u.jsx)("button",{className:l("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:_,title:p.exitFullscreen,type:"button",children:(0,u.jsx)(o,{size:20})}),(0,u.jsx)("div",{className:l("flex size-full items-center justify-center p-4"),onClick:A=>A.stopPropagation(),onKeyDown:A=>A.stopPropagation(),role:"presentation",children:(0,u.jsx)(cA,{chart:e,className:l("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:g})})]}),document.body):null]})},bu=e=>{var t,n;let r=[],i=[],s=e.querySelectorAll("thead th");for(let o of s)r.push(((t=o.textContent)==null?void 0:t.trim())||"");let a=e.querySelectorAll("tbody tr");for(let o of a){let l=[],h=o.querySelectorAll("td");for(let m of h)l.push(((n=m.textContent)==null?void 0:n.trim())||"");i.push(l)}return{headers:r,rows:i}},xu=e=>{let{headers:t,rows:n}=e,r=o=>{let l=!1,h=!1;for(let m of o){if(m==='"'){l=!0,h=!0;break}(m===","||m===`
|
|
114
|
-
`)&&(l=!0)}return l?h?`"${o.replace(/"/g,'""')}"`:`"${o}"`:o},i=t.length>0?n.length+1:n.length,s=new Array(i),a=0;t.length>0&&(s[a]=t.map(r).join(","),a+=1);for(let o of n)s[a]=o.map(r).join(","),a+=1;return s.join(`
|
|
115
|
-
`)},E_=e=>{let{headers:t,rows:n}=e,r=o=>{let l=!1;for(let m of o)if(m===" "||m===`
|
|
116
|
-
`||m==="\r"){l=!0;break}if(!l)return o;let h=[];for(let m of o)m===" "?h.push("\\t"):m===`
|
|
117
|
-
`?h.push("\\n"):m==="\r"?h.push("\\r"):h.push(m);return h.join("")},i=t.length>0?n.length+1:n.length,s=new Array(i),a=0;t.length>0&&(s[a]=t.map(r).join(" "),a+=1);for(let o of n)s[a]=o.map(r).join(" "),a+=1;return s.join(`
|
|
118
|
-
`)},yi=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},Gi=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,s=t.map(o=>yi(o));r[i]=`| ${s.join(" | ")} |`,i+=1;let a=new Array(t.length);for(let o=0;o<t.length;o+=1)a[o]="---";r[i]=`| ${a.join(" | ")} |`,i+=1;for(let o of n)if(o.length<t.length){let l=new Array(t.length);for(let h=0;h<t.length;h+=1)l[h]=h<o.length?yi(o[h]):"";r[i]=`| ${l.join(" | ")} |`,i+=1}else{let l=o.map(h=>yi(h));r[i]=`| ${l.join(" | ")} |`,i+=1}return r.join(`
|
|
119
|
-
`)},ku=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let s=re(),[a,o]=(0,E.useState)(!1),[l,h]=(0,E.useState)(!1),m=(0,E.useRef)(null),d=(0,E.useRef)(0),{isAnimating:f}=(0,E.useContext)(je),p=dt(),g=async b=>{var v,S;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.write)){r?.(new Error("Clipboard API not available"));return}try{let w=(S=m.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),R=w?.querySelector("table");if(!R){r?.(new Error("Table not found"));return}let N=bu(R),M=({csv:xu,tsv:E_,md:Gi}[b]||Gi)(N),z=new ClipboardItem({"text/plain":new Blob([M],{type:"text/plain"}),"text/html":new Blob([R.outerHTML],{type:"text/html"})});await navigator.clipboard.write([z]),h(!0),o(!1),n?.(b),d.current=window.setTimeout(()=>h(!1),i)}catch(w){r?.(w)}};(0,E.useEffect)(()=>{let b=v=>{let S=v.composedPath();m.current&&!S.includes(m.current)&&o(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(d.current)}},[]);let _=Qe(),A=l?_.CheckIcon:_.CopyIcon;return(0,u.jsxs)("div",{className:s("relative"),ref:m,children:[(0,u.jsx)("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>o(!a),title:p.copyTable,type:"button",children:e??(0,u.jsx)(A,{height:14,width:14})}),a?(0,u.jsxs)("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,u.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("md"),title:p.copyTableAsMarkdown,type:"button",children:p.tableFormatMarkdown}),(0,u.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:p.copyTableAsCsv,type:"button",children:p.tableFormatCsv}),(0,u.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("tsv"),title:p.copyTableAsTsv,type:"button",children:p.tableFormatTsv})]}):null]})},yu=({children:e,className:t,onDownload:n,onError:r})=>{let i=re(),[s,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),{isAnimating:l}=(0,E.useContext)(je),h=dt(),m=Qe(),d=f=>{var p;try{let g=(p=o.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),_=g?.querySelector("table");if(!_){r?.(new Error("Table not found"));return}let A=bu(_),b=f==="csv"?xu(A):Gi(A);en(`table.${f==="csv"?"csv":"md"}`,b,f==="csv"?"text/csv":"text/markdown"),a(!1),n?.(f)}catch(g){r?.(g)}};return(0,E.useEffect)(()=>{let f=p=>{let g=p.composedPath();o.current&&!g.includes(o.current)&&a(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,u.jsxs)("div",{className:i("relative"),ref:o,children:[(0,u.jsx)("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>a(!s),title:h.downloadTable,type:"button",children:e??(0,u.jsx)(m.DownloadIcon,{size:14})}),s?(0,u.jsxs)("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,u.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),(0,u.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},T_=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:s}=Qe(),a=re(),[o,l]=(0,E.useState)(!1),{isAnimating:h}=(0,E.useContext)(je),m=dt(),d=()=>{l(!0)},f=()=>{l(!1)};return(0,E.useEffect)(()=>{if(o){Ps();let p=g=>{g.key==="Escape"&&l(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),Ms()}}},[o]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:d,title:m.viewFullscreen,type:"button",children:(0,u.jsx)(i,{size:14})}),o?(0,ru.createPortal)((0,u.jsx)("div",{"aria-label":m.viewFullscreen,"aria-modal":"true",className:a("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:p=>{p.key==="Escape"&&f()},role:"dialog",children:(0,u.jsxs)("div",{className:a("flex h-full flex-col"),onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:[(0,u.jsxs)("div",{className:a("flex items-center justify-end gap-1 p-4"),children:[n?(0,u.jsx)(ku,{}):null,r?(0,u.jsx)(yu,{}):null,(0,u.jsx)("button",{className:a("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:m.exitFullscreen,type:"button",children:(0,u.jsx)(s,{size:20})})]}),(0,u.jsx)("div",{className:a("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:(0,u.jsx)("table",{className:a("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},b_=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:s=!0,...a})=>{let o=re(),l=n&&r,h=n&&i,m=n&&s,d=l||h||m;return(0,u.jsxs)("div",{className:o("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[d?(0,u.jsxs)("div",{className:o("flex items-center justify-end gap-1"),children:[l?(0,u.jsx)(ku,{}):null,h?(0,u.jsx)(yu,{}):null,m?(0,u.jsx)(T_,{showCopy:l,showDownload:h,children:e}):null]}):null,(0,u.jsx)("div",{className:o("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:(0,u.jsx)("table",{className:o("w-full divide-y divide-border",t),"data-streamdown":"table",...a,children:e})})]})},x_=/startLine=(\d+)/,k_=/\bnoLineNumbers\b/,y_=(0,E.lazy)(()=>nl(()=>import("./mermaid-GHXKKRXX-BUBXMhKa.js").then(e=>({default:e.Mermaid})),[])),C_=/language-([^\s]+)/;function Zr(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function Ee(e,t){return e.className===t.className&&Zr(e.node,t.node)}var Ki=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Ci=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},ko=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},gr=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},js=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Ee(e,t));js.displayName="MarkdownOl";var Cu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Zr(e.node,t.node));Cu.displayName="MarkdownLi";var _u=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Ee(e,t));_u.displayName="MarkdownUl";var Au=(0,E.memo)(({className:e,node:t,...n})=>{let r=re();return(0,u.jsx)("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Ee(e,t));Au.displayName="MarkdownHr";var vu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Ee(e,t));vu.displayName="MarkdownStrong";var __=({children:e,className:t,href:n,node:r,...i})=>{let s=re(),{linkSafety:a}=(0,E.useContext)(je),[o,l]=(0,E.useState)(!1),h=n==="streamdown:incomplete-link",m=(0,E.useCallback)(async g=>{if(!(!(a!=null&&a.enabled&&n)||h)){if(g.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}l(!0)}},[a,n,h]),d=(0,E.useCallback)(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),f=(0,E.useCallback)(()=>{l(!1)},[]),p={url:n??"",isOpen:o,onClose:f,onConfirm:d};return a!=null&&a.enabled&&n?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:s("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:m,type:"button",children:e}),a.renderModal?a.renderModal(p):(0,u.jsx)(d_,{...p})]}):(0,u.jsx)("a",{className:s("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Nu=(0,E.memo)(__,(e,t)=>Ee(e,t)&&e.href===t.href);Nu.displayName="MarkdownA";var Su=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Ee(e,t));Su.displayName="MarkdownH1";var Iu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Ee(e,t));Iu.displayName="MarkdownH2";var wu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Ee(e,t));wu.displayName="MarkdownH3";var Lu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Ee(e,t));Lu.displayName="MarkdownH4";var Ru=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Ee(e,t));Ru.displayName="MarkdownH5";var Ou=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Ee(e,t));Ou.displayName="MarkdownH6";var Du=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,E.useContext)(je),s=Ki(i,"table"),a=Ci(i,"copy"),o=Ci(i,"download"),l=Ci(i,"fullscreen");return(0,u.jsx)(b_,{className:t,showControls:s,showCopy:a,showDownload:o,showFullscreen:l,...r,children:e})},(e,t)=>Ee(e,t));Du.displayName="MarkdownTable";var Pu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Ee(e,t));Pu.displayName="MarkdownThead";var Mu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Ee(e,t));Mu.displayName="MarkdownTbody";var Bu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Ee(e,t));Bu.displayName="MarkdownTr";var Fu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Ee(e,t));Fu.displayName="MarkdownTh";var ju=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Ee(e,t));ju.displayName="MarkdownTd";var Hu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Ee(e,t));Hu.displayName="MarkdownBlockquote";var Uu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Ee(e,t));Uu.displayName="MarkdownSup";var zu=(0,E.memo)(({children:e,className:t,node:n,...r})=>{let i=re();return(0,u.jsx)("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Ee(e,t));zu.displayName="MarkdownSub";var $u=(0,E.memo)(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=a=>{var o,l;if(!(0,E.isValidElement)(a))return!1;let h=Array.isArray(a.props.children)?a.props.children:[a.props.children],m=!1,d=!1;for(let f of h)if(f){if(typeof f=="string")f.trim()!==""&&(m=!0);else if((0,E.isValidElement)(f))if(((o=f.props)==null?void 0:o["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let g of p){if(typeof g=="string"&&g.trim()!==""){m=!0;break}if((0,E.isValidElement)(g)&&((l=g.props)==null?void 0:l["data-footnote-backref"])===void 0){m=!0;break}}}}return d&&!m},s=Array.isArray(e)?e.map(a=>{if(!(0,E.isValidElement)(a))return a;if(a.type===js){let o=(Array.isArray(a.props.children)?a.props.children:[a.props.children]).filter(l=>!i(l));return o.length===0?null:{...a,props:{...a.props,children:o}}}return a}):e;return(Array.isArray(s)?s.some(a=>a!==null):s!==null)?(0,u.jsx)("section",{className:t,...r,children:s}):null}return(0,u.jsx)("section",{className:t,...r,children:e})},(e,t)=>Ee(e,t));$u.displayName="MarkdownSection";var A_=({node:e,className:t,children:n,...r})=>{var i,s;let a=re(),o=!("data-block"in r),{mermaid:l,controls:h,lineNumbers:m}=(0,E.useContext)(je),d=Fs(),f=UC(),p=t?.match(C_),g=(i=p?.at(1))!=null?i:"",_=m_(g);if(o)return(0,u.jsx)("code",{className:a("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let A=(s=e?.properties)==null?void 0:s.metastring,b=A?.match(x_),v=b?Number.parseInt(b[1],10):void 0,S=v!==void 0&&v>=1?v:void 0,w=!(A&&k_.test(A))&&m!==!1,R="";if((0,E.isValidElement)(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?R=n.props.children:typeof n=="string"&&(R=n),_){let Y=_.component;return(0,u.jsx)(E.Suspense,{fallback:(0,u.jsx)(xo,{}),children:(0,u.jsx)(Y,{code:R,isIncomplete:f,language:g,meta:A})})}if(g==="mermaid"&&d){let Y=Ki(h,"mermaid"),I=gr(h,"download"),j=gr(h,"copy"),$=gr(h,"fullscreen"),V=gr(h,"panZoom"),Q=Y&&(I||j||$);return(0,u.jsx)(E.Suspense,{fallback:(0,u.jsx)(xo,{}),children:(0,u.jsxs)("div",{className:a("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[(0,u.jsx)("div",{className:a("flex h-8 items-center text-muted-foreground text-xs"),children:(0,u.jsx)("span",{className:a("ml-1 font-mono lowercase"),children:"mermaid"})}),Q?(0,u.jsx)("div",{className:a("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,u.jsxs)("div",{className:a("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[I?(0,u.jsx)(p_,{chart:R,config:l?.config}):null,j?(0,u.jsx)(To,{code:R}):null,$?(0,u.jsx)(g_,{chart:R,config:l?.config}):null]})}):null,(0,u.jsx)("div",{className:a("rounded-md border border-border bg-background"),children:(0,u.jsx)(y_,{chart:R,config:l?.config,showControls:V})})]})})}let N=Ki(h,"code"),M=ko(h,"download"),z=ko(h,"copy");return(0,u.jsx)(XC,{className:t,code:R,isIncomplete:f,language:g,lineNumbers:w,startLine:S,children:N?(0,u.jsxs)(u.Fragment,{children:[M?(0,u.jsx)(c_,{code:R,language:g}):null,z?(0,u.jsx)(To,{}):null]}):null})},qu=(0,E.memo)(A_,(e,t)=>e.className===t.className&&Zr(e.node,t.node));qu.displayName="MarkdownCode";var Yu=(0,E.memo)(h_,(e,t)=>e.className===t.className&&Zr(e.node,t.node));Yu.displayName="MarkdownImg";var Vu=(0,E.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&(0,E.isValidElement)(r[0])){let i=r[0].props.node,s=i?.tagName;if(s==="img")return(0,u.jsx)(u.Fragment,{children:e});if(s==="code"&&"data-block"in r[0].props)return(0,u.jsx)(u.Fragment,{children:e})}return(0,u.jsx)("p",{...n,children:e})},(e,t)=>Ee(e,t));Vu.displayName="MarkdownParagraph";var v_={ol:js,li:Cu,ul:_u,hr:Au,strong:vu,a:Nu,h1:Su,h2:Iu,h3:wu,h4:Lu,h5:Ru,h6:Ou,table:Du,thead:Pu,tbody:Mu,tr:Bu,th:Fu,td:ju,blockquote:Hu,code:qu,img:Yu,pre:({children:e})=>(0,E.isValidElement)(e)?(0,E.cloneElement)(e,{"data-block":"true"}):e,sup:Uu,sub:zu,p:Vu,section:$u},N_=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,S_=/\p{L}/u;function yo(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(N_.test(n))return"rtl";if(S_.test(n))return"ltr"}return"ltr"}var I_=/^[ \t]{0,3}(`{3,}|~{3,})/,w_=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,Co=e=>{let t=e.split(`
|
|
120
|
-
`),n=null,r=0;for(let i of t){let s=I_.exec(i);if(n===null){if(s){let a=s[1];n=a[0],r=a.length}}else if(s){let a=s[1],o=a[0],l=a.length;o===n&&l>=r&&(n=null,r=0)}}return n!==null},L_=e=>{let t=e.split(`
|
|
121
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&w_.test(r))return!0}return!1},R_=()=>e=>{tt(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},_o=[],Ao={allowDangerousHtml:!0},Er=new WeakMap,O_=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let l="default";return this.keyCache.set(e,l),l}let s=l=>{if(!l||l.length===0)return"";let h="";for(let m=0;m<l.length;m+=1){let d=l[m];if(m>0&&(h+=","),Array.isArray(d)){let[f,p]=d;if(typeof f=="function"){let g=Er.get(f);g||(g=f.name,Er.set(f,g)),h+=g}else h+=String(f);h+=":",h+=JSON.stringify(p)}else if(typeof d=="function"){let f=Er.get(d);f||(f=d.name,Er.set(d,f)),h+=f}else h+=String(d)}return h},a=s(n),o=`${s(r)}::${a}::${i?JSON.stringify(i):""}`;return this.keyCache.set(e,o),o}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},vo=new O_,Wu=e=>{let t=D_(e),n=e.children||"";return U_(t.runSync(t.parse(n),n),e)},D_=e=>{let t=vo.get(e);if(t)return t;let n=M_(e);return vo.set(e,n),n},P_=e=>e.some(t=>Array.isArray(t)?t[0]===Di:t===Di),M_=e=>{let t=e.rehypePlugins||_o,n=e.remarkPlugins||_o,r=P_(t)?n:[...n,R_],i=e.remarkRehypeOptions?{...Ao,...e.remarkRehypeOptions}:Ao;return jy().use(Fk).use(r).use(xy,i).use(t)},B_=e=>e,F_=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},j_=(e,t)=>{var n;for(let r in fi)if(Object.hasOwn(fi,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],s=fi[r];(s===null||s.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},H_=(e,t,n,r,i,s)=>{let a=!1;return r?a=!r.includes(e.tagName):i&&(a=i.includes(e.tagName)),!a&&s&&typeof t=="number"&&(a=!s(e,t,n)),a},U_=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:s,unwrapDisallowed:a,urlTransform:o}=t;if(n||r||i||s||o){let l=o||B_;tt(e,(h,m,d)=>{if(h.type==="raw"&&d&&typeof m=="number")return F_(d,m,s,h.value),m;if(h.type==="element"&&(j_(h,l),H_(h,m,d,r,i,n)&&d&&typeof m=="number"))return a&&h.children?d.children.splice(m,1,...h.children):d.children.splice(m,1),m})}return Vx(e,{Fragment:u.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0})},z_=/\[\^[\w-]{1,200}\](?!:)/,$_=/\[\^[\w-]{1,200}\]:/,q_=/<(\w+)[\s>]/,Y_=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),No=new Map,So=new Map,V_=e=>{let t=e.toLowerCase(),n=No.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return No.set(t,r),r},W_=e=>{let t=e.toLowerCase(),n=So.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return So.set(t,r),r},Io=(e,t)=>{if(Y_.has(t.toLowerCase()))return 0;let n=e.match(V_(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},wo=(e,t)=>{let n=e.match(W_(t));return n?n.length:0},Q_=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},G_=e=>{let t=z_.test(e),n=$_.test(e);if(t||n)return[e];let r=$e.lex(e,{gfm:!0}),i=[],s=[],a=!1;for(let o of r){let l=o.raw,h=i.length;if(s.length>0){i[h-1]+=l;let m=s.at(-1),d=Io(l,m),f=wo(l,m);for(let p=0;p<d;p+=1)s.push(m);for(let p=0;p<f;p+=1)s.length>0&&s.at(-1)===m&&s.pop();continue}if(o.type==="html"&&o.block){let m=l.match(q_);if(m){let d=m[1];Io(l,d)>wo(l,d)&&s.push(d)}}if(h>0&&!a){let m=i[h-1];if(Q_(m)%2===1){i[h-1]=m+l;continue}}i.push(l),o.type!=="space"&&(a=o.type==="code")}return i},K_=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(s,a,o,l)=>{if(!o.includes(`
|
|
122
|
-
|
|
123
|
-
`))return a+o+l;let h=o.replace(/\n\n/g,`
|
|
124
|
-
<!---->
|
|
125
|
-
`);return`${a}${(h.startsWith(`
|
|
126
|
-
`)?"":`
|
|
127
|
-
`)+h+(h.endsWith(`
|
|
128
|
-
`)?"":`
|
|
129
|
-
`)}${l}
|
|
130
|
-
|
|
131
|
-
`})}return n},X_=/([\\`*_~[\]|])/g,Z_=e=>e.replace(X_,"\\$1"),J_=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(s,a,o,l)=>a+Z_(o).replace(/\n\n/g," ")+l)}return n},Qu=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(Qu).join(""):"",eA=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));tt(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=Qu(r);r.children=i?[{type:"text",value:i}]:[]}})},tA=()=>e=>{tt(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},nA=/^[ \t]*<[\w!/?-]/,rA=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,iA=e=>typeof e!="string"||e.length===0||!nA.test(e)?e:e.replace(rA,"$1"),Lo,Ro,Oo,Do,yr={...wt,protocols:{...wt.protocols,href:[...(Ro=(Lo=wt.protocols)==null?void 0:Lo.href)!=null?Ro:[],"tel"]},attributes:{...wt.attributes,code:[...(Do=(Oo=wt.attributes)==null?void 0:Oo.code)!=null?Do:[],"metastring"]}},Xi={raw:Di,sanitize:[rc,yr],harden:[tm,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},sA={gfm:[x0,{}],codeMeta:tA},Po=Object.values(Xi),aA=Object.values(sA),oA={block:" ▋",circle:" ●"},Gu=["github-light","github-dark"],Ku={enabled:!0},je=(0,E.createContext)({shikiTheme:Gu,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Ku}),Xu=(0,E.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:s,animatePlugin:a,...o})=>{if(a){let m=a.getLastRenderCharCount();a.setPrevContentLength(m)}let l=typeof e=="string"&&n?iA(e):e,h=(0,u.jsx)(Wu,{...o,children:l});return(0,u.jsx)(fu.Provider,{value:i,children:s?(0,u.jsx)("div",{dir:s,style:{display:"contents"},children:h}):h})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,a;return((s=e.components)==null?void 0:s[i])!==((a=t.components)==null?void 0:a[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});Xu.displayName="Block";var Hs=(0,E.memo)(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:s,rehypePlugins:a=Po,remarkPlugins:o=aA,className:l,shikiTheme:h=Gu,mermaid:m,controls:d=!0,isAnimating:f=!1,animated:p,BlockComponent:g=Xu,parseMarkdownIntoBlocksFn:_=G_,caret:A,plugins:b,remend:v,linkSafety:S=Ku,lineNumbers:w=!0,allowedTags:R,literalTagContent:N,translations:M,icons:z,prefix:Y,onAnimationStart:I,onAnimationEnd:j,...$})=>{let V=(0,E.useId)(),[Q,G]=(0,E.useTransition)(),U=(0,E.useMemo)(()=>$C(Y),[Y]),P=(0,E.useRef)(null),W=(0,E.useRef)(I),J=(0,E.useRef)(j);W.current=I,J.current=j,(0,E.useEffect)(()=>{var se,de,we;if(t==="static")return;let Ge=P.current;if(P.current=f,Ge===null){f&&((se=W.current)==null||se.call(W));return}f&&!Ge?(de=W.current)==null||de.call(W):!f&&Ge&&((we=J.current)==null||we.call(J))},[f,t]);let y=(0,E.useMemo)(()=>R?Object.keys(R):[],[R]),ce=(0,E.useMemo)(()=>{if(typeof e!="string")return"";let se=t==="streaming"&&r?Lx(e,v):e;return N&&N.length>0&&(se=J_(se,N)),y.length>0&&(se=K_(se,y)),se},[e,t,r,v,y,N]),X=(0,E.useMemo)(()=>_(ce),[ce,_]),[C,De]=(0,E.useState)(X);(0,E.useEffect)(()=>{t==="streaming"&&!He?G(()=>{De(X)}):De(X)},[X,t]);let Te=t==="streaming"?C:X,ge=(0,E.useMemo)(()=>n==="auto"?Te.map(yo):void 0,[Te,n]),At=(0,E.useMemo)(()=>Te.map((se,de)=>`${V}-${de}`),[Te.length,V]),Pe=(0,E.useMemo)(()=>p===!0?"true":p?JSON.stringify(p):"",[p]),He=(0,E.useMemo)(()=>Pe?Pe==="true"?Yi():Yi(p):null,[Pe]),it=(0,E.useMemo)(()=>{var se,de;return{shikiTheme:(de=(se=b?.code)==null?void 0:se.getThemes())!=null?de:h,controls:d,isAnimating:f,lineNumbers:w,mode:t,mermaid:m,linkSafety:S}},[h,d,f,w,t,m,S,b?.code]),sr=(0,E.useMemo)(()=>M?JSON.stringify(M):"",[M]),ar=(0,E.useMemo)(()=>({...Tu,...M}),[sr]),or=(0,E.useMemo)(()=>{let{inlineCode:se,...de}=s??{},we={...v_,...de};if(se){let Ge=we.code;we.code=vt=>"data-block"in vt?Ge?(0,E.createElement)(Ge,vt):null:(0,E.createElement)(se,vt)}return we},[s]),lr=(0,E.useMemo)(()=>{let se=[];return b!=null&&b.cjk&&(se=[...se,...b.cjk.remarkPluginsBefore]),se=[...se,...o],b!=null&&b.cjk&&(se=[...se,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(se=[...se,b.math.remarkPlugin]),se},[o,b?.math,b?.cjk]),Tn=(0,E.useMemo)(()=>{var se;let de=a;if(R&&Object.keys(R).length>0&&a===Po){let we={...yr,tagNames:[...(se=yr.tagNames)!=null?se:[],...Object.keys(R)],attributes:{...yr.attributes,...R}};de=[Xi.raw,[rc,we],Xi.harden]}return N&&N.length>0&&(de=[...de,[eA,N]]),b!=null&&b.math&&(de=[...de,b.math.rehypePlugin]),He&&f&&(de=[...de,He.rehypePlugin]),de},[a,b?.math,He,f,R,N]),Yt=(0,E.useMemo)(()=>{if(!f||Te.length===0)return!1;let se=Te.at(-1);return Co(se)||L_(se)},[f,Te]),cr=(0,E.useMemo)(()=>A&&f&&!Yt?{"--streamdown-caret":`"${oA[A]}"`}:void 0,[A,f,Yt]);return t==="static"?(0,u.jsx)(Wi.Provider,{value:ar,children:(0,u.jsx)(Qi.Provider,{value:b??null,children:(0,u.jsx)(je.Provider,{value:it,children:(0,u.jsx)(Eo,{icons:z,children:(0,u.jsx)(Vi.Provider,{value:U,children:(0,u.jsx)("div",{className:U("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",l),dir:n==="auto"?yo(ce):n,children:(0,u.jsx)(Wu,{components:or,rehypePlugins:Tn,remarkPlugins:lr,...$,children:ce})})})})})})}):(0,u.jsx)(Wi.Provider,{value:ar,children:(0,u.jsx)(Qi.Provider,{value:b??null,children:(0,u.jsx)(je.Provider,{value:it,children:(0,u.jsx)(Eo,{icons:z,children:(0,u.jsx)(Vi.Provider,{value:U,children:(0,u.jsxs)("div",{className:U("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",A&&!Yt?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,l),style:cr,children:[Te.length===0&&A&&f&&(0,u.jsx)("span",{}),Te.map((se,de)=>{var we;let Ge=de===Te.length-1,vt=f&&Ge&&Co(se);return(0,u.jsx)(g,{animatePlugin:He,components:or,content:se,dir:(we=ge?.[de])!=null?we:n!=="auto"?n:void 0,index:de,isIncomplete:vt,rehypePlugins:Tn,remarkPlugins:lr,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...$},At[de])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);Hs.displayName="Streamdown";var lA=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:a=1,fullscreen:o=!1})=>{let{RotateCcwIcon:l,ZoomInIcon:h,ZoomOutIcon:m}=Qe(),d=re(),f=(0,E.useRef)(null),p=(0,E.useRef)(null),[g,_]=(0,E.useState)(a),[A,b]=(0,E.useState)({x:0,y:0}),[v,S]=(0,E.useState)(!1),[w,R]=(0,E.useState)({x:0,y:0}),[N,M]=(0,E.useState)({x:0,y:0}),z=(0,E.useCallback)(U=>{_(P=>Math.max(n,Math.min(r,P+U)))},[n,r]),Y=(0,E.useCallback)(()=>{z(i)},[z,i]),I=(0,E.useCallback)(()=>{z(-i)},[z,i]),j=(0,E.useCallback)(()=>{_(a),b({x:0,y:0})},[a]),$=(0,E.useCallback)(U=>{U.preventDefault();let P=U.deltaY>0?-i:i;z(P)},[z,i]),V=(0,E.useCallback)(U=>{if(U.button!==0||U.isPrimary===!1)return;S(!0),R({x:U.clientX,y:U.clientY}),M(A);let P=U.currentTarget;P instanceof HTMLElement&&P.setPointerCapture(U.pointerId)},[A]),Q=(0,E.useCallback)(U=>{if(!v)return;U.preventDefault();let P=U.clientX-w.x,W=U.clientY-w.y;b({x:N.x+P,y:N.y+W})},[v,w,N]),G=(0,E.useCallback)(U=>{S(!1);let P=U.currentTarget;P instanceof HTMLElement&&P.releasePointerCapture(U.pointerId)},[]);return(0,E.useEffect)(()=>{let U=f.current;if(U)return U.addEventListener("wheel",$,{passive:!1}),()=>{U.removeEventListener("wheel",$)}},[$]),(0,E.useEffect)(()=>{let U=p.current;if(U&&v)return document.body.style.userSelect="none",U.addEventListener("pointermove",Q,{passive:!1}),U.addEventListener("pointerup",G),U.addEventListener("pointercancel",G),()=>{document.body.style.userSelect="",U.removeEventListener("pointermove",Q),U.removeEventListener("pointerup",G),U.removeEventListener("pointercancel",G)}},[v,Q,G]),(0,u.jsxs)("div",{className:d("relative flex flex-col",o?"h-full w-full":"min-h-28 w-full",t),ref:f,style:{cursor:v?"grabbing":"grab"},children:[s?(0,u.jsxs)("div",{className:d("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",o?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,u.jsx)("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:g>=r,onClick:Y,title:"Zoom in",type:"button",children:(0,u.jsx)(h,{size:16})}),(0,u.jsx)("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:g<=n,onClick:I,title:"Zoom out",type:"button",children:(0,u.jsx)(m,{size:16})}),(0,u.jsx)("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:j,title:"Reset zoom and pan",type:"button",children:(0,u.jsx)(l,{size:16})})]}):null,(0,u.jsx)("div",{className:d("flex-1 origin-center transition-transform duration-150 ease-out",o?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:V,ref:p,role:"application",style:{transform:`translate(${A.x}px, ${A.y}px) scale(${g})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},cA=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let s=re(),[a,o]=(0,E.useState)(null),[l,h]=(0,E.useState)(!1),[m,d]=(0,E.useState)(""),[f,p]=(0,E.useState)(""),[g,_]=(0,E.useState)(0),{mermaid:A}=(0,E.useContext)(je),b=Fs(),v=A?.errorComponent,{shouldRender:S,containerRef:w}=LC({immediate:r});if((0,E.useEffect)(()=>{if(S){if(!b){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{o(null),h(!0);let N=b.getMermaid(n),M=e.split("").reduce((I,j)=>(I<<5)-I+j.charCodeAt(0)|0,0),z=`mermaid-${Math.abs(M)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:Y}=await N.render(z,e);d(Y),p(Y)}catch(N){if(!(f||m)){let M=N instanceof Error?N.message:"Failed to render Mermaid chart";o(M)}}finally{h(!1)}})()}},[e,n,g,S,b]),!(S||m||f))return(0,u.jsx)("div",{className:s("my-4 min-h-[200px]",t),ref:w});if(l&&!m&&!f)return(0,u.jsx)("div",{className:s("my-4 flex justify-center p-4",t),ref:w,children:(0,u.jsxs)("div",{className:s("flex items-center space-x-2 text-muted-foreground"),children:[(0,u.jsx)("div",{className:s("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),(0,u.jsx)("span",{className:s("text-sm"),children:"Loading diagram..."})]})});if(a&&!m&&!f){let N=()=>_(M=>M+1);return v?(0,u.jsx)("div",{ref:w,children:(0,u.jsx)(v,{chart:e,error:a,retry:N})}):(0,u.jsxs)("div",{className:s("rounded-md bg-red-50 p-4",t),ref:w,children:[(0,u.jsxs)("p",{className:s("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",a]}),(0,u.jsxs)("details",{className:s("mt-2"),children:[(0,u.jsx)("summary",{className:s("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),(0,u.jsx)("pre",{className:s("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let R=m||f;return(0,u.jsx)("div",{className:s("size-full",t),"data-streamdown":"mermaid",ref:w,children:(0,u.jsx)(lA,{className:s(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,u.jsx)("div",{"aria-label":"Mermaid chart",className:s("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:R},role:"img"})})})},Zu={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Mo=E.createContext&&E.createContext(Zu),uA=["attr","size","title"];function hA(e,t){if(e==null)return{};var n,r,i=dA(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(null,arguments)}function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bo(Object(n),!0).forEach(function(r){mA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mA(e,t,n){return(t=fA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fA(e){var t=pA(e,"string");return typeof t=="symbol"?t:t+""}function pA(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ju(e){return e&&e.map((t,n)=>E.createElement(t.tag,Or({key:n},t.attr),Ju(t.child)))}function gA(e){return t=>E.createElement(EA,Rr({attr:Or({},e.attr)},t),Ju(e.child))}function EA(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=hA(e,uA),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),E.createElement("svg",Rr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Or(Or({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&E.createElement("title",null,s),e.children)};return Mo!==void 0?E.createElement(Mo.Consumer,null,n=>t(n)):t(Zu)}function TA(e){return gA({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},child:[]},{tag:"path",attr:{d:"M9 18c-4.51 2-5-2-7-2"},child:[]}]})(e)}var bA={damping:.7,stiffness:.05,mass:1.25},xA=70,kA=1e3/60,yA=350,Jr=!1;globalThis.document?.addEventListener("mousedown",()=>{Jr=!0});globalThis.document?.addEventListener("mouseup",()=>{Jr=!1});globalThis.document?.addEventListener("click",()=>{Jr=!1});var CA=(e={})=>{const[t,n]=(0,E.useState)(!1),[r,i]=(0,E.useState)(e.initial!==!1),[s,a]=(0,E.useState)(!1),o=(0,E.useRef)(null);o.current=e;const l=(0,E.useCallback)(()=>{if(!Jr)return!1;const v=window.getSelection();if(!v||!v.rangeCount)return!1;const S=v.getRangeAt(0);return S.commonAncestorContainer.contains(A.current)||A.current?.contains(S.commonAncestorContainer)},[]),h=(0,E.useCallback)(v=>{d.isAtBottom=v,i(v)},[]),m=(0,E.useCallback)(v=>{d.escapedFromLock=v,n(v)},[]),d=(0,E.useMemo)(()=>{let v;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return A.current?.scrollTop??0},set scrollTop(S){if(A.current){const{scrollBehavior:w}=getComputedStyle(A.current);w!=="auto"&&(A.current.style.scrollBehavior="auto"),A.current.scrollTop=S,d.ignoreScrollToTop=A.current.scrollTop,w!=="auto"&&(A.current.style.scrollBehavior=w)}},get targetScrollTop(){return!A.current||!b.current?0:A.current.scrollHeight-1-A.current.clientHeight},get calculatedTargetScrollTop(){if(!A.current||!b.current)return 0;const{targetScrollTop:S}=this;if(!e.targetScrollTop)return S;if(v?.targetScrollTop===S)return v.calculatedScrollTop;const w=Math.max(Math.min(e.targetScrollTop(S,{scrollElement:A.current,contentElement:b.current}),S),0);return v={targetScrollTop:S,calculatedScrollTop:w},requestAnimationFrame(()=>{v=void 0}),w},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=xA}}},[]),f=(0,E.useCallback)((v={})=>{typeof v=="string"&&(v={animation:v}),v.preserveScrollPosition||h(!0);const S=Date.now()+(Number(v.wait)||0),w=Ai(o.current,v.animation),{ignoreEscapes:R=!1}=v;let N,M=d.calculatedTargetScrollTop;v.duration instanceof Promise?v.duration.finally(()=>{N=Date.now()}):N=S+(v.duration??0);const z=async()=>{const Y=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:I}=d,j=performance.now(),$=(j-(d.lastTick??j))/kA;if(d.animation||(d.animation={behavior:w,promise:Y,ignoreEscapes:R}),d.animation.behavior===w&&(d.lastTick=j),l()||S>Date.now())return z();if(I<Math.min(M,d.calculatedTargetScrollTop)){if(d.animation?.behavior===w){if(w==="instant")return d.scrollTop=d.calculatedTargetScrollTop,z();d.velocity=(w.damping*d.velocity+w.stiffness*d.scrollDifference)/w.mass,d.accumulated+=d.velocity*$,d.scrollTop+=d.accumulated,d.scrollTop!==I&&(d.accumulated=0)}return z()}return N>Date.now()?(M=d.calculatedTargetScrollTop,z()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Ai(o.current,o.current.resize),ignoreEscapes:R,duration:Math.max(0,N-Date.now())||void 0}):d.isAtBottom)});return Y.then(I=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),I))};return v.wait!==!0&&(d.animation=void 0),d.animation?.behavior===w?d.animation.promise:z()},[h,l,d]),p=(0,E.useCallback)(()=>{m(!0),h(!1)},[m,h]),g=(0,E.useCallback)(({target:v})=>{if(v!==A.current)return;const{scrollTop:S,ignoreScrollToTop:w}=d;let{lastScrollTop:R=S}=d;d.lastScrollTop=S,d.ignoreScrollToTop=void 0,w&&w>S&&(R=w),a(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||S===w)return;if(l()){m(!0),h(!1);return}const N=S>R,M=S<R;if(d.animation?.ignoreEscapes){d.scrollTop=R;return}M&&(m(!0),h(!1)),N&&m(!1),!d.escapedFromLock&&d.isNearBottom&&h(!0)},1)},[m,h,l,d]),_=(0,E.useCallback)(({target:v,deltaY:S})=>{let w=v;for(;!["scroll","auto"].includes(getComputedStyle(w).overflow);){if(!w.parentElement)return;w=w.parentElement}w===A.current&&S<0&&A.current.scrollHeight>A.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),h(!1))},[m,h,d]),A=Fo(v=>{A.current?.removeEventListener("scroll",g),A.current?.removeEventListener("wheel",_),v?.addEventListener("scroll",g,{passive:!0}),v?.addEventListener("wheel",_,{passive:!0})},[]),b=Fo(v=>{if(d.resizeObserver?.disconnect(),!v)return;let S;d.resizeObserver=new ResizeObserver(([w])=>{const{height:R}=w.contentRect,N=R-(S??R);if(d.resizeDifference=N,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),a(d.isNearBottom),N>=0){const M=Ai(o.current,S?o.current.resize:o.current.initial);f({animation:M,wait:!0,preserveScrollPosition:!0,duration:M==="instant"?void 0:yA})}else d.isNearBottom&&(m(!1),h(!0));S=R,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===N&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(v)},[]);return{contentRef:b,scrollRef:A,scrollToBottom:f,stopScroll:p,isAtBottom:r||s,isNearBottom:s,escapedFromLock:t,state:d}};function Fo(e,t){const n=(0,E.useCallback)(r=>(n.current=r,e(r)),t);return n}var _i=new Map;function Ai(...e){const t={...bA};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return _i.has(r)||_i.set(r,Object.freeze(t)),n?"instant":_i.get(r)}var eh=(0,E.createContext)(null),_A=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Dr({instance:e,children:t,resize:n,initial:r,mass:i,damping:s,stiffness:a,targetScrollTop:o,contextRef:l,...h}){const m=(0,E.useRef)(null),d=E.useCallback((R,N)=>(w?.targetScrollTop??o)?.(R,N)??R,[o]),f=CA({mass:i,damping:s,stiffness:a,resize:n,initial:r,targetScrollTop:d}),{scrollRef:p,contentRef:g,scrollToBottom:_,stopScroll:A,isAtBottom:b,escapedFromLock:v,state:S}=e??f,w=(0,E.useMemo)(()=>({scrollToBottom:_,stopScroll:A,scrollRef:p,isAtBottom:b,escapedFromLock:v,contentRef:g,state:S,get targetScrollTop(){return m.current},set targetScrollTop(R){m.current=R}}),[_,b,g,p,A,v,S]);return(0,E.useImperativeHandle)(l,()=>w,[w]),_A(()=>{p.current&&getComputedStyle(p.current).overflow==="visible"&&(p.current.style.overflow="auto")},[]),E.createElement(eh.Provider,{value:w},E.createElement("div",{...h},typeof t=="function"?t(w):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const s=th();return E.createElement("div",{ref:s.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},E.createElement("div",{...i,ref:s.contentRef},typeof n=="function"?n(s):n))}e.Content=t})(Dr||(Dr={}));function th(){const e=(0,E.useContext)(eh);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var AA=({className:e,...t})=>(0,u.jsx)(Dr,{className:ee("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),vA=({className:e,...t})=>(0,u.jsx)(Dr.Content,{className:ee("flex flex-col gap-8 p-4",e),...t}),NA=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:r}=th(),i=(0,E.useCallback)(()=>{r()},[r]);return!n&&(0,u.jsx)(ae,{className:ee("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:i,size:"icon",type:"button",variant:"outline",...t,children:(0,u.jsx)(Rh,{className:"size-4"})})},jo=[{variant:"shine",component:({children:e,className:t,...n})=>(0,u.jsx)("span",{...n,className:ee("bg-[linear-gradient(110deg,#bfbfbf,35%,#000,50%,#bfbfbf,75%,#bfbfbf)] dark:bg-[linear-gradient(110deg,#404040,35%,#fff,50%,#404040,75%,#404040)]","bg-size-[200%_100%] bg-clip-text text-transparent","animate-shine",t),children:e})}];function SA({variant:e="shine",className:t,...n}){const r=jo.find(i=>i.variant===e)?.component||jo[0].component;return(0,u.jsx)(Gh,{className:ee("font-medium text-sm"),children:(0,u.jsx)(r,{...n,className:t})})}var Ho=({className:e,from:t,...n})=>(0,u.jsx)("div",{className:ee("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...n}),Uo=({children:e,className:t,...n})=>(0,u.jsx)("div",{className:ee("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...n,children:e}),nh=(0,E.createContext)(null),IA=()=>{const e=(0,E.use)(nh);if(!e)throw new Error("MessageBranch components must be used within MessageBranch");return e},zo=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{const[i,s]=(0,E.useState)(e),[a,o]=(0,E.useState)([]),l=f=>{s(f),t?.(f)},h=()=>{const f=i>0?i-1:a.length-1;l(f)},m=()=>{const f=i<a.length-1?i+1:0;l(f)},d={currentBranch:i,totalBranches:a.length,goToPrevious:h,goToNext:m,branches:a,setBranches:o};return(0,u.jsx)(nh.Provider,{value:d,children:(0,u.jsx)("div",{className:ee("grid w-full gap-2 [&>div]:pb-0",n),...r})})},$o=({children:e,...t})=>{const{currentBranch:n,setBranches:r,branches:i}=IA(),s=Array.isArray(e)?e:[e];return(0,E.useEffect)(()=>{i.length!==s.length&&r(s)},[s,i,r]),s.map((a,o)=>(0,u.jsx)("div",{className:ee("grid gap-2 overflow-hidden [&>div]:pb-0",o===n?"block":"hidden"),...t,children:a},a.key))},rh=(0,E.memo)(({className:e,...t})=>(0,u.jsx)(Hs,{className:ee("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);rh.displayName="MessageResponse";var wA="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",LA=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=wA[n[e]&63];return t},RA=(0,E.createContext)(null),OA=(0,E.createContext)(null),ih=()=>(0,E.useContext)(RA),DA=()=>(0,E.useContext)(OA),sh=(0,E.createContext)(null),PA=()=>{const e=DA(),t=(0,E.use)(sh),n=e??t;if(!n)throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return n},MA=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:s,maxFileSize:a,onError:o,onSubmit:l,children:h,...m})=>{const d=ih(),f=!!d,p=(0,E.useRef)(null),g=(0,E.useRef)(null),[_,A]=(0,E.useState)([]),b=f?d.attachments.files:_,v=(0,E.useRef)(b);v.current=b;const S=(0,E.useCallback)(()=>{p.current?.click()},[]),w=(0,E.useCallback)(P=>!t||t.trim()===""?!0:t.split(",").map(W=>W.trim()).filter(Boolean).some(W=>{if(W.endsWith("/*")){const J=W.slice(0,-1);return P.type.startsWith(J)}return P.type===W}),[t]),R=(0,E.useCallback)(P=>{const W=Array.from(P),J=W.filter(X=>w(X));if(W.length&&J.length===0){o?.({code:"accept",message:"No files match the accepted types."});return}const y=X=>a?X.size<=a:!0,ce=J.filter(y);if(J.length>0&&ce.length===0){o?.({code:"max_file_size",message:"All files exceed the maximum size."});return}A(X=>{const C=typeof s=="number"?Math.max(0,s-X.length):void 0,De=typeof C=="number"?ce.slice(0,C):ce;typeof C=="number"&&ce.length>C&&o?.({code:"max_files",message:"Too many files. Some were not added."});const Te=[];for(const ge of De)Te.push({id:LA(),type:"file",url:URL.createObjectURL(ge),mediaType:ge.type,filename:ge.name});return X.concat(Te)})},[w,s,a,o]),N=(0,E.useCallback)(P=>A(W=>{const J=W.find(y=>y.id===P);return J?.url&&URL.revokeObjectURL(J.url),W.filter(y=>y.id!==P)}),[]),M=(0,E.useCallback)(()=>A(P=>{for(const W of P)W.url&&URL.revokeObjectURL(W.url);return[]}),[]),z=f?d.attachments.add:R,Y=f?d.attachments.remove:N,I=f?d.attachments.clear:M,j=f?d.attachments.openFileDialog:S;(0,E.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,E.useEffect)(()=>{i&&p.current&&b.length===0&&(p.current.value="")},[b,i]),(0,E.useEffect)(()=>{const P=g.current;if(!P||r)return;const W=y=>{y.dataTransfer?.types?.includes("Files")&&y.preventDefault()},J=y=>{y.dataTransfer?.types?.includes("Files")&&y.preventDefault(),y.dataTransfer?.files&&y.dataTransfer.files.length>0&&z(y.dataTransfer.files)};return P.addEventListener("dragover",W),P.addEventListener("drop",J),()=>{P.removeEventListener("dragover",W),P.removeEventListener("drop",J)}},[z,r]),(0,E.useEffect)(()=>{if(!r)return;const P=J=>{J.dataTransfer?.types?.includes("Files")&&J.preventDefault()},W=J=>{J.dataTransfer?.types?.includes("Files")&&J.preventDefault(),J.dataTransfer?.files&&J.dataTransfer.files.length>0&&z(J.dataTransfer.files)};return document.addEventListener("dragover",P),document.addEventListener("drop",W),()=>{document.removeEventListener("dragover",P),document.removeEventListener("drop",W)}},[z,r]),(0,E.useEffect)(()=>()=>{if(!f)for(const P of v.current)P.url&&URL.revokeObjectURL(P.url)},[f]);const $=P=>{P.currentTarget.files&&z(P.currentTarget.files),P.currentTarget.value=""},V=async P=>{try{const W=await(await fetch(P)).blob();return new Promise(J=>{const y=new FileReader;y.onloadend=()=>J(y.result),y.onerror=()=>J(null),y.readAsDataURL(W)})}catch{return null}},Q=(0,E.useMemo)(()=>({files:b.map(P=>({...P,id:P.id})),add:z,remove:Y,clear:I,openFileDialog:j,fileInputRef:p}),[b,z,Y,I,j]),G=P=>{P.preventDefault();const W=P.currentTarget,J=f?d.textInput.value:new FormData(W).get("message")||"";f||W.reset(),Promise.all(b.map(async({id:y,...ce})=>{if(ce.url?.startsWith("blob:")){const X=await V(ce.url);return{...ce,url:X??ce.url}}return ce})).then(y=>{try{const ce=l({text:J,files:y},P);ce instanceof Promise?ce.then(()=>{I(),f&&d.textInput.clear()}).catch(()=>{}):(I(),f&&d.textInput.clear())}catch{}}).catch(()=>{})},U=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("input",{accept:t,"aria-label":"Upload files",className:"hidden",multiple:n,onChange:$,ref:p,title:"Upload files",type:"file"}),(0,u.jsx)("form",{className:ee("w-full",e),onSubmit:G,ref:g,...m,children:(0,u.jsx)(bd,{className:"overflow-hidden",children:h})})]});return f?U:(0,u.jsx)(sh.Provider,{value:Q,children:U})},BA=({className:e,...t})=>(0,u.jsx)("div",{className:ee("contents",e),...t}),FA=({onChange:e,className:t,placeholder:n="What would you like to know?",...r})=>{const i=ih(),s=PA(),[a,o]=(0,E.useState)(!1),l=d=>{if(d.key==="Enter"){if(a||d.nativeEvent.isComposing||d.shiftKey)return;d.preventDefault();const f=d.currentTarget.form;if(f?.querySelector('button[type="submit"]')?.disabled)return;f?.requestSubmit()}if(d.key==="Backspace"&&d.currentTarget.value===""&&s.files.length>0){d.preventDefault();const f=s.files.at(-1);f&&s.remove(f.id)}},h=d=>{const f=d.clipboardData?.items;if(!f)return;const p=[];for(const g of f)if(g.kind==="file"){const _=g.getAsFile();_&&p.push(_)}p.length>0&&(d.preventDefault(),s.add(p))},m=i?{value:i.textInput.value,onChange:d=>{i.textInput.setInput(d.currentTarget.value),e?.(d)}}:{onChange:e};return(0,u.jsx)(dd,{className:ee("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:()=>o(!1),onCompositionStart:()=>o(!0),onKeyDown:l,onPaste:h,placeholder:n,...r,...m})},jA=({className:e,...t})=>(0,u.jsx)(ud,{align:"block-end",className:ee("justify-between justify-end gap-1",e),...t}),HA=({className:e,variant:t="default",size:n="icon-sm",status:r,children:i,...s})=>{let a=(0,u.jsx)(Lh,{className:"size-4"});return r==="submitted"?a=(0,u.jsx)(Bh,{className:"size-4 animate-spin"}):r==="streaming"?a=(0,u.jsx)(Uh,{className:"size-4"}):r==="error"&&(a=(0,u.jsx)(Hh,{className:"size-4"})),(0,u.jsx)(md,{"aria-label":"Submit",className:ee(e),size:n,type:"submit",variant:t,...s,children:i??a})};function UA({...e}){return(0,u.jsx)(Qh,{"data-slot":"collapsible",...e})}function zA({...e}){return(0,u.jsx)(Zh,{"data-slot":"collapsible-trigger",...e})}function $A({...e}){return(0,u.jsx)(nd,{"data-slot":"collapsible-content",...e})}var qA=({children:e,as:t="p",className:n,duration:r=2,spread:i=2})=>{const s=(0,E.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,u.jsx)(t,{className:ee("relative inline-block bg-size-[250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]","animate-shimmer",n),style:{"--spread":`${s}px`,"--duration":`${r}s`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},children:e})},YA=(0,E.memo)(qA),ah=(0,E.createContext)(null),VA=()=>{const e=(0,E.use)(ah);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},WA=1e3,QA=1e3,oh=(0,E.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:s,children:a,...o})=>{const[l,h]=Ws({prop:n,defaultProp:r,onChange:i}),[m,d]=Ws({prop:s,defaultProp:void 0}),[f,p]=(0,E.useState)(!1),[g,_]=(0,E.useState)(null);(0,E.useEffect)(()=>{t?g===null&&_(Date.now()):g!==null&&(d(Math.ceil((Date.now()-g)/QA)),_(null))},[t,g,d]),(0,E.useEffect)(()=>{if(r&&!t&&l&&!f){const b=setTimeout(()=>{h(!1),p(!0)},WA);return()=>clearTimeout(b)}},[t,l,r,h,f]);const A=b=>{h(b)};return(0,u.jsx)(ah.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:h,duration:m},children:(0,u.jsx)(UA,{className:ee("not-prose mb-4",e),onOpenChange:A,open:l,...o,children:a})})}),GA=(e,t)=>e||t===0?(0,u.jsx)(YA,{duration:1,children:"Thinking..."}):t===void 0?(0,u.jsx)("p",{children:"Thought for a few seconds"}):(0,u.jsxs)("p",{children:["Thought for ",t," seconds"]}),lh=(0,E.memo)(({className:e,children:t,getThinkingMessage:n=GA,...r})=>{const{isStreaming:i,isOpen:s,duration:a}=VA();return(0,u.jsx)(zA,{className:ee("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(jh,{className:"size-4"}),n(i,a),(0,u.jsx)(Qo,{className:ee("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),ch=(0,E.memo)(({className:e,children:t,...n})=>(0,u.jsx)($A,{className:ee("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:(0,u.jsx)(Hs,{children:t})}));oh.displayName="Reasoning";lh.displayName="ReasoningTrigger";ch.displayName="ReasoningContent";var KA=({className:e,children:t,...n})=>(0,u.jsxs)(rl,{className:"w-full overflow-x-auto whitespace-nowrap",...n,children:[(0,u.jsx)("div",{className:ee("flex w-max flex-nowrap items-center gap-2",e),children:t}),(0,u.jsx)(Od,{className:"hidden",orientation:"horizontal"})]}),XA=({suggestion:e,onClick:t,className:n,variant:r="outline",size:i="sm",children:s,...a})=>{const o=()=>{t?.(e)};return(0,u.jsx)(ae,{className:ee("cursor-pointer rounded-full px-4",n),onClick:o,size:i,type:"button",variant:r,...a,children:s||e})},Us=({enabled:e=!0}={})=>{const{data:t,isLoading:n,error:r,refetch:i}=gh({queryKey:xd.rateLimit(),queryFn:async()=>(await sd()).data,enabled:e});return{rateLimit:t,isLoadingRateLimit:n,errorRateLimit:r,refetchRateLimit:i}},ZA=({db:e,onRateLimitRefetch:t,onControllerReady:n})=>{const[r,i]=(0,E.useState)(""),[s,a]=(0,E.useState)(null),{openOverlay:o}=yt(),{pendingPrompt:l,consumePrompt:h}=Dd(),{includeSchemaInAiContext:m,provider:d,model:f}=is(),p=Ji(Cr),g=ss(),_=p.status[d],A=_?.state==="set"||_?.state==="locked",{rateLimit:b}=Us({enabled:g&&d==="gemini"&&!A}),{remaining:v}=b??{remaining:0,limit:0},S=A||d==="gemini"&&v>0,{messages:w,sendMessage:R,isLoading:N,clear:M,stop:z}=Th({connection:xh(`${ad()}${id.API_PREFIX}/chat`),body:{db:e,includeSchema:m},byok:Cr,forwardedProps:{provider:d,model:f},onError:V=>a(V.message),onFinish:()=>{d==="gemini"&&!A&&t()}});(0,E.useEffect)(()=>{!l||N||!g||!S||(h(),R(l))},[S,h,g,N,l,R]),(0,E.useEffect)(()=>{n({clear:()=>{M(),i(""),a(null)},isLoading:N})},[M,N,n]);const Y=V=>{const Q=!!V.text,G=!!V.files?.length;!(Q||G)||N||(a(null),R(V.text),i(""))},I=V=>{a(null),R(V),i("")},j=()=>{z(),i("")},$=N?"streaming":"ready";return(0,u.jsxs)("div",{className:"relative flex size-full flex-col divide-y overflow-hidden",children:[(0,u.jsxs)(AA,{children:[(0,u.jsx)(vA,{children:w.length===0?(0,u.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:(0,u.jsxs)("div",{className:"text-center space-y-2",children:[(0,u.jsx)("p",{className:"text-lg font-medium",children:"Start a new conversation"}),(0,u.jsx)("p",{className:"text-sm",children:"Ask me anything to get started"})]})}):(0,u.jsxs)(u.Fragment,{children:[w.map(V=>{const Q=V.parts.filter(P=>P.type==="thinking"),G=V.parts.reduce((P,W)=>W.type==="text"?P+(W.content??""):P,""),U=Q.length>0;return(0,u.jsx)(zo,{defaultBranch:0,children:(0,u.jsx)($o,{children:(0,u.jsx)(Ho,{from:V.role==="user"?"user":"assistant",children:(0,u.jsxs)("div",{children:[U&&V.role==="assistant"&&(0,u.jsxs)(oh,{duration:0,children:[(0,u.jsx)(lh,{}),(0,u.jsx)(ch,{children:Q.map(P=>P.content).join(`
|
|
132
|
-
`)})]}),(0,u.jsx)(Uo,{children:(0,u.jsx)(rh,{children:G})})]})})})},V.id)}),N&&(0,u.jsx)(zo,{defaultBranch:0,children:(0,u.jsx)($o,{children:(0,u.jsx)(Ho,{from:"assistant",children:(0,u.jsx)(Uo,{children:(0,u.jsx)(SA,{children:"Thinking..."})})})})})]})}),(0,u.jsx)(NA,{})]}),(0,u.jsxs)("div",{className:"grid shrink-0 gap-4 pt-3",children:[s&&(0,u.jsx)("div",{className:"mx-4 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:s}),!S&&(0,u.jsxs)("div",{className:"mx-4 rounded-lg border p-3 text-sm",children:[(0,u.jsx)("p",{className:"text-muted-foreground",children:d==="gemini"?"The hosted AI limit is exhausted. Add a personal Gemini key to continue.":`Add a ${d} API key to use this provider.`}),(0,u.jsx)(ae,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>o("settings.app"),children:"Open settings"})]}),w.length===0&&S&&(0,u.jsx)(KA,{className:"px-4",children:Qd.map(V=>(0,u.jsx)(XA,{onClick:()=>I(V),suggestion:V,size:"lg",children:V},V))}),(0,u.jsx)("div",{className:"w-full px-4 pb-4",children:(0,u.jsxs)(MA,{globalDrop:!0,multiple:!0,onSubmit:Y,children:[(0,u.jsx)(BA,{children:(0,u.jsx)(FA,{onChange:V=>i(V.target.value),value:r,placeholder:"Type a message..."})}),(0,u.jsx)(jA,{children:(0,u.jsx)(HA,{className:"h-8!",status:$,onClick:N?j:void 0,disabled:!S})})]})})]})]})},JA=()=>{const{isOverlayOpen:e,closeOverlay:t}=yt(),{selectedDatabase:n}=rs(),{includeSchemaInAiContext:r,provider:i,model:s}=is(),a=Ji(Cr),o=ss(),l=a.status[i],h=l?.state==="set"||l?.state==="locked",{rateLimit:m,refetchRateLimit:d}=Us({enabled:o&&i==="gemini"&&!h}),[f,p]=(0,E.useState)(null),g=(0,E.useRef)(_=>p(_));return(0,u.jsx)(Zo,{title:"AI Assistant",cta:(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[m&&!h&&(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsxs)("span",{className:"text-xs px-2 py-1 cursor-default text-muted-foreground",children:[m.remaining,"/",m.limit]})}),(0,u.jsx)(Dt,{side:"bottom",children:(0,u.jsxs)("p",{children:[m.remaining," messages remaining"]})})]}),n&&f&&(0,u.jsxs)(ae,{type:"button",variant:"outline",size:"lg",onClick:f.clear,disabled:f.isLoading,children:[(0,u.jsx)(tn,{className:"size-4 mr-1"}),"New Chat"]})]}),closeButton:!1,open:e("chat.assistant"),size:"max-w-2xl!",contentClassName:"p-0 flex flex-col h-[calc(100vh-4rem)] flex-1",onOpenChange:_=>{_||t("chat.assistant")},children:n?(0,u.jsx)(ZA,{db:n,onRateLimitRefetch:d,onControllerReady:g.current},`${n}:${r}:${i}:${s}`):(0,u.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground p-8",children:(0,u.jsxs)("div",{className:"text-center space-y-2",children:[(0,u.jsx)("p",{className:"text-lg font-medium",children:"No database selected"}),(0,u.jsx)("p",{className:"text-sm",children:"Select a database from the sidebar to start chatting."})]})})})},ev=()=>{const{openOverlay:e}=yt(),{dbType:t}=rs(),{provider:n}=is(),r=Ji(Cr),i=ss(),s=r.status[n],a=s?.state==="set"||s?.state==="locked",{rateLimit:o,isLoadingRateLimit:l,errorRateLimit:h}=Us({enabled:i&&n==="gemini"&&!a}),{remaining:m=0,limit:d=0}=o??{remaining:0,limit:0},p=a?"bg-emerald-500":l||h?"bg-zinc-500":n!=="gemini"||m===0?"bg-red-500":m<=5?"bg-yellow-500":"bg-emerald-500";return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsxs)(ae,{variant:"ghost",className:"border-r-0 border-y-0 border-l border-border rounded-none h-full w-12 relative text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",onClick:()=>{e("chat.assistant"),t&&yd.capture("chat_opened",{db_type:t})},children:[(0,u.jsx)(Fh,{className:"size-5"}),(0,u.jsx)("span",{"data-testid":"chat-status-indicator",className:ee("absolute top-2 right-2 h-2 w-2 rounded-full ring-2 ring-background",p)})]})}),(0,u.jsx)(Dt,{side:"bottom",className:"text-xs",children:a?(0,u.jsxs)("p",{children:["AI Assistant · personal ",n," key"]}):!l&&!h?m>0?(0,u.jsxs)("p",{children:[m,"/",d," messages remaining"]}):(0,u.jsx)("p",{children:"AI Assistant"}):(0,u.jsx)("p",{children:"AI status unavailable"})})]}),(0,u.jsx)(JA,{})]})},tv=()=>{const{pathname:e}=Yn(),t=Mr({strict:!1}),n=e.split("/")[1]||"table",r=Ht()?.dataModel==="key-value"?["browser","runner"]:ld,i=t.table;return(0,u.jsx)("div",{className:"flex h-full items-center",children:r.map(s=>{const a=(s==="table"||s==="schema")&&i;return(0,u.jsx)(Vo,{to:a?`/${s}/$table`:`/${s}`,params:a?{table:i}:void 0,className:"h-full flex items-center",children:(0,u.jsx)(ae,{variant:"ghost",className:ee("flex-1 px-4 border-l-0 border-y-0 border-r border-border h-full rounded-none capitalize text-xs font-medium transition-colors",n===s?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:s})},s)})})},nv=()=>{const{sidebar:{isOpen:e,isPinned:t},setSidebarOpen:n,setSidebarPinned:r}=Br(),i=()=>{n(!e),r(!t)};return(0,u.jsx)(ae,{variant:"ghost",onClick:i,className:"h-full aspect-square border-l-0 border-y-0 border-r border-border rounded-none text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",children:(0,u.jsx)(yh,{className:"size-5"})})},rv=()=>{const{theme:e,isDark:t,setTheme:n}=Id(),{openOverlay:r}=yt();return(0,u.jsxs)("div",{className:"border-b border-border w-full flex items-center justify-between bg-background text-foreground h-12",children:[(0,u.jsxs)("div",{className:"flex items-center h-full",children:[(0,u.jsx)(nv,{}),(0,u.jsx)(tv,{})]}),(0,u.jsxs)("div",{className:"flex items-center h-full",children:[(0,u.jsx)(ev,{}),(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsx)(ae,{type:"button",variant:"ghost",className:"border-r-0 border-y-0 border-l border-border rounded-none h-full w-12 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors","aria-label":"Open settings",onClick:()=>r("settings.app"),children:(0,u.jsx)(Dh,{className:"size-5"})})}),(0,u.jsx)(Dt,{children:(0,u.jsx)("p",{children:"Settings"})})]}),(0,u.jsxs)(el,{children:[(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsx)(tl,{asChild:!0,children:(0,u.jsx)(ae,{variant:"ghost",className:"border-r-0 border-y-0 border-l border-border rounded-none h-full w-12 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors","aria-label":`Theme: ${e}, switch theme`,children:e==="light"?(0,u.jsx)(qs,{className:"size-5"}):e==="dark"?(0,u.jsx)($s,{className:"size-5"}):(0,u.jsx)(Ys,{className:"size-5"})})})}),(0,u.jsx)(Dt,{children:(0,u.jsx)("p",{children:t?"Switch to light mode":"Switch to dark mode"})})]}),(0,u.jsxs)(Jo,{align:"end",children:[(0,u.jsxs)(qe,{onClick:()=>n("light"),children:[(0,u.jsx)(qs,{}),"Light",e==="light"&&(0,u.jsx)(ei,{className:"ml-auto"})]}),(0,u.jsxs)(qe,{onClick:()=>n("dark"),children:[(0,u.jsx)($s,{}),"Dark",e==="dark"&&(0,u.jsx)(ei,{className:"ml-auto"})]}),(0,u.jsxs)(qe,{onClick:()=>n("system"),children:[(0,u.jsx)(Ys,{}),"System",e==="system"&&(0,u.jsx)(ei,{className:"ml-auto"})]})]})]}),(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsx)(ae,{variant:"ghost",className:"border-r-0 border-y-0 border-l border-border rounded-none h-full w-12 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",asChild:!0,children:(0,u.jsx)("a",{href:Xs.SITE_GITHUB_NEW_ISSUE_LINK,target:"_blank",rel:"noopener noreferrer","aria-label":"Create a new GitHub issue",children:(0,u.jsx)(zh,{className:"size-5"})})})}),(0,u.jsx)(Dt,{children:(0,u.jsx)("p",{children:"Report a bug"})})]}),(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsx)(ae,{variant:"ghost",className:"border-r-0 border-y-0 border-l border-border rounded-none h-full w-12 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",asChild:!0,children:(0,u.jsx)("a",{href:Xs.SITE_GITHUB_LINK,target:"_blank",rel:"noopener noreferrer","aria-label":"View the db-studio GitHub repository",children:(0,u.jsx)(TA,{className:"size-5"})})})}),(0,u.jsx)(Dt,{children:(0,u.jsx)("p",{children:"View on GitHub"})})]})]})]})};function uh({...e}){return(0,u.jsx)(Kh,{"data-slot":"context-menu",...e})}function hh({className:e,...t}){return(0,u.jsx)(ed,{"data-slot":"context-menu-trigger",className:ee("select-none",e),...t})}function dh({className:e,...t}){return(0,u.jsx)(td,{children:(0,u.jsx)(rd,{"data-slot":"context-menu-content",className:ee("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",e),...t})})}function Tt({className:e,inset:t,variant:n="default",...r}){return(0,u.jsx)(Jh,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function qo({className:e,...t}){return(0,u.jsx)(Wh,{"data-slot":"context-menu-separator",className:ee("bg-border/50 -mx-1 my-1 h-px",e),...t})}var vi=({folderId:e,isExpanded:t,onToggle:n,count:r,name:i,showContextMenu:s=!1})=>{const a=Vn(),{deleteFolder:o,getQueriesByFolder:l,addQuery:h,updateFolder:m}=Fr(),[d,f]=(0,E.useState)(!1),[p,g]=(0,E.useState)(""),[_,A]=(0,E.useState)(!1),b=(0,E.useCallback)(()=>{if(e){if(l(e).length>0){A(!0);return}o(e)}},[o,e,l]),v=(0,E.useCallback)(()=>{e&&(o(e),A(!1))},[o,e]),S=(0,E.useCallback)(()=>{const N=h(void 0,e);a({to:"/runner/$queryId",params:{queryId:N}})},[h,e,a]),w=(0,E.useCallback)(()=>{g(i),f(!0)},[i]),R=(0,E.useCallback)(()=>{e&&p.trim()&&(m(e,{name:p.trim()}),f(!1),g(""))},[e,p,m]);return(0,u.jsxs)(u.Fragment,{children:[s?(0,u.jsxs)(uh,{children:[(0,u.jsx)(hh,{asChild:!0,children:(0,u.jsxs)("button",{type:"button",onClick:n,className:ee("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,u.jsx)(Vs,{className:ee("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,u.jsx)("span",{className:"flex-1",children:i}),(0,u.jsx)(jn,{children:r})]})}),(0,u.jsxs)(dh,{children:[(0,u.jsxs)(Tt,{onClick:S,children:[(0,u.jsx)(tn,{className:"size-4"}),"Add a new query"]}),(0,u.jsxs)(Tt,{onClick:w,children:[(0,u.jsx)(es,{className:"size-4"}),"Rename folder"]}),(0,u.jsxs)(Tt,{onClick:b,children:[(0,u.jsx)(ns,{className:"size-4"}),"Delete folder"]})]})]}):(0,u.jsxs)("button",{type:"button",onClick:n,className:ee("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,u.jsx)(Vs,{className:ee("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,u.jsx)("span",{className:"flex-1",children:i}),(0,u.jsx)(jn,{children:r})]}),(0,u.jsx)(rn,{open:d,onOpenChange:f,children:(0,u.jsxs)(nn,{children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Rename Folder"}),(0,u.jsx)(sn,{children:"Enter a new name for this folder."})]}),(0,u.jsx)(et,{value:p,onChange:N=>g(N.target.value),placeholder:"Folder name",onKeyDown:N=>{N.key==="Enter"&&R()},autoFocus:!0}),(0,u.jsxs)(ln,{children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>{f(!1),g("")},children:"Cancel"}),(0,u.jsx)(ae,{onClick:R,disabled:!p.trim(),children:"Rename"})]})]})}),(0,u.jsx)(Ld,{open:_,onOpenChange:A,children:(0,u.jsxs)(Rd,{children:[(0,u.jsxs)(wd,{children:[(0,u.jsx)(jd,{children:"Delete Folder"}),(0,u.jsxs)(Ad,{children:["This folder contains ",r," ",r===1?"query":"queries",". Deleting this folder will also delete all queries inside it. This action cannot be undone."]})]}),(0,u.jsxs)(_d,{children:[(0,u.jsx)($d,{children:"Cancel"}),(0,u.jsx)(Cd,{onClick:v,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Folder"})]})]})})]})},Tr=({id:e,tableName:t,isNested:n=!1,showContextMenu:r=!0})=>{const i=Vn(),{deleteQuery:s,addQuery:a,getQuery:o,toggleFavorite:l,updateQuery:h,moveQuery:m,folders:d,addFolder:f}=Fr(),{queryId:p}=Mr({strict:!1}),g=p===e,_=o(e),A=_?.isFavorite??!1,[b,v]=(0,E.useState)(!1),[S,w]=(0,E.useState)(""),[R,N]=(0,E.useState)(!1),[M,z]=(0,E.useState)(void 0),[Y,I]=(0,E.useState)(!1),[j,$]=(0,E.useState)(""),V=(0,E.useCallback)(()=>{i({to:"/runner/$queryId",params:{queryId:e}})},[i,e]),Q=(0,E.useCallback)(()=>{s(e),p===e&&i({to:"/runner"}),ot.success("Query deleted successfully")},[s,e,i,p]),G=(0,E.useCallback)(()=>{const X=o(e),C=a(`${X?.name} (Copy)`);i({to:"/runner/$queryId",params:{queryId:C}}),ot.success("Query duplicated successfully")},[a,o,i,e]),U=(0,E.useCallback)(()=>{l(e),ot.success("Query favorited successfully")},[l,e]),P=(0,E.useCallback)(()=>{w(_?.name??""),v(!0)},[_?.name]),W=(0,E.useCallback)(()=>{S.trim()&&(h(e,{name:S.trim()}),v(!1),w(""),ot.success("Query renamed successfully"))},[e,S,h]),J=(0,E.useCallback)(()=>{z(_?.folderId),I(!1),$(""),N(!0)},[_?.folderId]),y=(0,E.useCallback)(X=>{X==="__create_new__"?(I(!0),z(void 0)):(I(!1),z(X==="__none__"?void 0:X))},[]),ce=(0,E.useCallback)(()=>{if(Y&&j.trim()){const X=Math.random().toString(36).substring(2,15);f({id:X,name:j.trim(),isExpanded:!0,isFavorite:!1}),m(e,X),ot.success("Query moved to new folder successfully")}else Y||(m(e,M),ot.success("Query moved to selected folder successfully"));N(!1),I(!1),$(""),z(void 0)},[Y,j,M,e,f,m]);return(0,u.jsxs)("li",{className:"relative",children:[r?(0,u.jsxs)(uh,{children:[(0,u.jsx)(hh,{asChild:!0,children:(0,u.jsxs)("button",{type:"button",onClick:V,className:ee("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",g?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",n?"px-4 pl-12":"px-4"),children:[g&&(0,u.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,u.jsx)("span",{className:"flex-1",children:t})]})}),(0,u.jsxs)(dh,{children:[(0,u.jsxs)(Tt,{onClick:P,children:[(0,u.jsx)(es,{className:"size-4"}),"Rename query"]}),(0,u.jsxs)(Tt,{onClick:G,children:[(0,u.jsx)(wh,{className:"size-4"}),"Duplicate query"]}),(0,u.jsxs)(Tt,{onClick:U,children:[(0,u.jsx)(Oh,{className:A?"size-4 fill-current":"size-4"}),A?"Remove from favorites":"Add to favorites"]}),(0,u.jsx)(qo,{}),(0,u.jsxs)(Tt,{onClick:J,children:[(0,u.jsx)(Ih,{className:"size-4"}),"Move to folder"]}),(0,u.jsx)(qo,{}),(0,u.jsxs)(Tt,{onClick:Q,children:[(0,u.jsx)(ns,{className:"size-4"}),"Delete query"]})]})]}):(0,u.jsxs)("button",{type:"button",onClick:V,className:ee("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",g?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",n?"px-4 pl-12":"px-4"),children:[g&&(0,u.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,u.jsx)("span",{className:"flex-1",children:t})]}),(0,u.jsx)(rn,{open:b,onOpenChange:v,children:(0,u.jsxs)(nn,{children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Rename Query"}),(0,u.jsx)(sn,{children:"Enter a new name for this query."})]}),(0,u.jsx)(et,{value:S,onChange:X=>w(X.target.value),placeholder:"Query name",onKeyDown:X=>{X.key==="Enter"&&W()},autoFocus:!0}),(0,u.jsxs)(ln,{children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>{v(!1),w("")},children:"Cancel"}),(0,u.jsx)(ae,{onClick:W,disabled:!S.trim(),children:"Rename"})]})]})}),(0,u.jsx)(rn,{open:R,onOpenChange:X=>{N(X),X||(I(!1),$(""),z(void 0))},children:(0,u.jsxs)(nn,{children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Move to Folder"}),(0,u.jsx)(sn,{children:"Select a folder to move this query to."})]}),(0,u.jsx)("div",{className:"space-y-4",children:Y?(0,u.jsx)(et,{value:j,onChange:X=>$(X.target.value),placeholder:"Folder name",onKeyDown:X=>{X.key==="Enter"&&j.trim()&&ce(),X.key==="Escape"&&(I(!1),$(""))},autoFocus:!0}):(0,u.jsxs)(Qn,{value:M??"__none__",onValueChange:y,children:[(0,u.jsx)(Wn,{className:"w-full",children:(0,u.jsx)(Kn,{placeholder:"Select a folder"})}),(0,u.jsxs)(Gn,{children:[(0,u.jsx)(ut,{value:"__none__",children:"No folder"}),d.map(X=>(0,u.jsx)(ut,{value:X.id,children:X.name},X.id)),(0,u.jsx)(ut,{value:"__create_new__",children:(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)(Wo,{className:"size-4"}),"Create a new folder"]})})]})]})}),(0,u.jsxs)(ln,{children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>{N(!1),I(!1),$(""),z(void 0)},children:"Cancel"}),(0,u.jsx)(ae,{onClick:ce,disabled:Y&&!j.trim(),children:Y?"Create & Move":"Move"})]})]})})]})},iv=()=>{const[e]=Je(ct.SIDEBAR_SEARCH,{defaultValue:""}),{folders:t,queries:n,getFavoriteQueries:r,getQueriesByFolder:i,toggleFolder:s}=Fr(),[a,o]=(0,E.useState)(!0),[l,h]=(0,E.useState)(!0),m=n.filter(g=>!g.isFavorite).length,d=r(),f=d.length,p=n.filter(g=>!g.folderId&&!g.isFavorite);if(e){const g=n.filter(_=>_.name.toLowerCase().includes(e.toLowerCase()));return g.length===0?(0,u.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"No queries found matching"}):(0,u.jsx)("div",{className:"flex-1 overflow-y-auto",children:g.map(_=>(0,u.jsx)(Tr,{id:_.id,tableName:_.name},_.id))})}return(0,u.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,u.jsx)(vi,{name:"Favorites",isExpanded:a,onToggle:()=>o(!a),count:f}),a&&d.map(g=>(0,u.jsx)(Tr,{id:g.id,tableName:g.name},g.id)),(0,u.jsx)(zd,{className:"bg-sidebar-border"}),(0,u.jsx)(vi,{name:"Queries",isExpanded:l,onToggle:()=>h(!l),count:m}),l&&(0,u.jsxs)(u.Fragment,{children:[t.map(g=>{const _=i(g.id),A=_.length;return(0,u.jsxs)("div",{children:[(0,u.jsx)(vi,{folderId:g.id,name:g.name,isExpanded:g.isExpanded,onToggle:()=>s(g.id),count:A,showContextMenu:!0}),g.isExpanded&&_.map(b=>(0,u.jsx)(Tr,{id:b.id,tableName:b.name,isNested:!0,showContextMenu:!0},b.id))]},g.id)}),p.map(g=>(0,u.jsx)(Tr,{id:g.id,tableName:g.name,showContextMenu:!0},g.id))]})]})},sv=()=>{const{addQuery:e,addFolder:t}=Fr(),n=Vn(),r=(0,E.useRef)(null),[i,s]=Je(ct.SIDEBAR_SEARCH,{defaultValue:""}),a=h=>{s(h.target.value)},o=()=>{const h=e();n({to:"/runner/$queryId",params:{queryId:h}})},l=()=>{const h=Math.random().toString(36).substring(2,15);t({id:h,name:"New Folder",isExpanded:!0,isFavorite:!1})};return(0,u.jsxs)("div",{className:"p-3 space-y-2 border-b border-sidebar-border",children:[(0,u.jsxs)("div",{className:"flex gap-2",children:[(0,u.jsxs)(ae,{className:"flex-1 justify-start h-8",onClick:o,children:[(0,u.jsx)(tn,{className:"size-4"}),"Add Query"]}),(0,u.jsxs)(ae,{className:"flex-1 justify-start h-8",onClick:l,children:[(0,u.jsx)(Wo,{className:"size-4"}),"Add Folder"]})]}),(0,u.jsxs)("div",{className:"relative",children:[(0,u.jsx)(ts,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,u.jsx)(et,{ref:r,placeholder:"Search queries",value:i??"",onChange:a,className:"rounded-sm h-8 pl-8 pr-8"}),(0,u.jsx)(jn,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]})]})},av=()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(sv,{}),(0,u.jsx)(iv,{})]}),ov=({tableName:e,schemaName:t})=>{const n=Vn(),r=Mr({strict:!1}),{pathname:i}=Yn(),{copyTableSchema:s,isCopyingSchema:a}=Bd(),{exportFile:o,isExportingFile:l}=Ud(),{deleteTable:h,forceDeleteTable:m,isDeletingTable:d}=Nd(),{renameTable:f,isRenamingTable:p}=Sd({tableName:e,schemaName:t}),{openOverlay:g,closeOverlay:_,isOverlayOpen:A}=yt(),[b,v]=(0,E.useState)(e),[S,w]=(0,E.useState)([]),R=`tables.rename-table.${e}`,N=`tables.delete-table.${e}`,M=`tables.force-delete-table.${e}`,z=Q=>{Q?(v(e),g(R)):_(R)},Y=async()=>{const Q=b.trim();if(!(!Q||Q===e))try{if(await f({newTableName:Q,schemaName:t}),z(!1),r.table===e){const G=i.startsWith("/schema")?"/schema/$table":"/table/$table";n({to:G,params:{table:Q}})}}catch{}},I=()=>{navigator.clipboard.writeText(e),ot.success("Table name copied to clipboard")},j=async()=>{const Q=await h(e);Q.fkViolation?(w(Q.relatedRecords),_(N),g(M)):(_(N),n({to:"/"}))},$=async()=>{await m(e),_(M),n({to:"/"})},V=()=>{_(M),w([])};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(el,{children:[(0,u.jsx)(tl,{asChild:!0,children:(0,u.jsx)(ae,{variant:"ghost",size:"icon-sm",onClick:Q=>{Q.stopPropagation(),Q.preventDefault()},onPointerDown:Q=>{Q.stopPropagation()},children:(0,u.jsx)(Ch,{})})}),(0,u.jsx)(Jo,{className:"w-56",align:"start",children:(0,u.jsxs)(pd,{children:[(0,u.jsxs)(qe,{onClick:I,children:[(0,u.jsx)($h,{className:"size-4"}),"Copy name"]}),(0,u.jsxs)(qe,{onClick:()=>s(e),disabled:a,children:[(0,u.jsx)(Sh,{className:"size-4"}),"Copy table schema"]}),(0,u.jsx)(Qs,{}),(0,u.jsxs)(qe,{onClick:()=>z(!0),children:[(0,u.jsx)(Mh,{className:"size-4"}),"Rename table"]}),(0,u.jsxs)(qe,{onClick:()=>n({to:"/schema/$table",params:{table:e}}),children:[(0,u.jsx)(es,{className:"size-4"}),"Edit table"]}),(0,u.jsxs)(Ed,{children:[(0,u.jsxs)(fd,{children:[(0,u.jsx)(vh,{className:"size-4"}),"Export data"]}),(0,u.jsxs)(gd,{children:[(0,u.jsx)(qe,{onClick:()=>o({tableName:e,format:"csv"}),disabled:l,children:"Export as CSV"}),(0,u.jsx)(qe,{onClick:()=>o({tableName:e,format:"json"}),disabled:l,children:"Export as JSON"}),(0,u.jsx)(qe,{onClick:()=>o({tableName:e,format:"xlsx"}),disabled:l,children:"Export as Excel"})]})]}),(0,u.jsx)(Qs,{}),(0,u.jsxs)(qe,{variant:"destructive",onClick:()=>g(N),children:[(0,u.jsx)(ns,{className:"size-4"}),"Delete table"]})]})})]}),(0,u.jsx)(lv,{tableName:e,newTableName:b,setNewTableName:v,isOpen:A(R),onOpenChange:z,onRename:Y,isRenaming:p}),(0,u.jsx)(cv,{isOpen:A(N),onOpenChange:Q=>{Q||_(N)},tableName:e,onDelete:j,isDeleting:d}),(0,u.jsx)(uv,{isOpen:A(M),onOpenChange:Q=>{Q||_(M)},tableName:e,relatedRecords:S,onForceDelete:$,onCancel:V,isDeleting:d})]})},lv=({tableName:e,newTableName:t,setNewTableName:n,isOpen:r,onOpenChange:i,onRename:s,isRenaming:a})=>{const o=t.trim(),l=!o||o===e;return(0,u.jsx)(rn,{open:r,onOpenChange:i,children:(0,u.jsxs)(nn,{className:"max-w-md",children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Rename Table"}),(0,u.jsx)(sn,{children:"Update the table name while keeping all data and schema unchanged."})]}),(0,u.jsxs)("div",{className:"space-y-4",children:[(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsx)(Gs,{htmlFor:"current-table-name",children:"Current name"}),(0,u.jsx)(et,{id:"current-table-name",value:e,readOnly:!0,disabled:!0})]}),(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsx)(Gs,{htmlFor:"new-table-name",children:"New name"}),(0,u.jsx)(et,{id:"new-table-name",value:t,onChange:h=>n(h.target.value),placeholder:"table_name",autoFocus:!0,disabled:a,onKeyDown:h=>{h.key==="Enter"&&!l&&!a&&s()}})]})]}),(0,u.jsxs)(ln,{className:"gap-2",children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>i(!1),disabled:a,children:"Cancel"}),(0,u.jsx)(ae,{onClick:s,disabled:l||a,children:a?"Renaming...":"Rename Table"})]})]})})},cv=({isOpen:e,onOpenChange:t,tableName:n,onDelete:r,isDeleting:i})=>(0,u.jsx)(rn,{open:e,onOpenChange:t,children:(0,u.jsxs)(nn,{className:"max-w-md",children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Delete Table"}),(0,u.jsxs)(sn,{children:["Are you sure you want to delete the table"," ",(0,u.jsxs)("span",{className:"font-semibold text-foreground",children:['"',n,'"']}),"? This action cannot be undone and all data will be permanently lost."]})]}),(0,u.jsxs)(ln,{className:"gap-2",children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>t(!1),disabled:i,children:"Cancel"}),(0,u.jsx)(ae,{variant:"destructive",onClick:r,disabled:i,children:i?"Deleting...":"Delete Table"})]})]})}),uv=({isOpen:e,onOpenChange:t,tableName:n,relatedRecords:r,onForceDelete:i,onCancel:s,isDeleting:a})=>(0,u.jsx)(rn,{open:e,onOpenChange:t,children:(0,u.jsxs)(nn,{className:"max-w-xl! max-h-[calc(100vh-1rem)]!",children:[(0,u.jsxs)(an,{children:[(0,u.jsx)(on,{children:"Cannot Delete - Foreign Key Constraint"}),(0,u.jsxs)(sn,{children:["The table ",(0,u.jsxs)("span",{className:"font-semibold text-foreground",children:['"',n,'"']})," ","cannot be deleted because it is referenced by records in other tables. You can either cancel the operation or force delete, which will also delete all related records."]})]}),(0,u.jsx)("div",{className:"space-y-4 max-h-64 overflow-y-auto",children:r.map((o,l)=>(0,u.jsxs)("div",{className:"border border-border rounded-md p-3",children:[(0,u.jsxs)("div",{className:"font-medium text-sm mb-2",children:["Table: ",(0,u.jsx)("span",{className:"text-primary",children:o.tableName}),(0,u.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",o.records.length," record",o.records.length!==1?"s":"",")"]})]}),(0,u.jsxs)("div",{className:"text-xs text-muted-foreground mb-2",children:["References column: ",o.columnName]}),(0,u.jsx)("div",{className:"bg-muted rounded p-2 text-xs overflow-x-auto",children:(0,u.jsxs)("pre",{className:"whitespace-pre-wrap",children:[JSON.stringify(o.records.slice(0,5),null,2),o.records.length>5&&(0,u.jsxs)("div",{className:"text-muted-foreground mt-2",children:["... and ",o.records.length-5," more"]})]})})]},`${o.tableName}-${o.columnName}-${l}`))}),(0,u.jsxs)(ln,{className:"gap-2",children:[(0,u.jsx)(ae,{variant:"outline",onClick:s,disabled:a,children:"Cancel"}),(0,u.jsx)(ae,{variant:"destructive",onClick:i,disabled:a,children:a?"Deleting...":"Force Delete All"})]})]})}),hv=({tableName:e,rowCount:t,schemaName:n})=>{const r=Mr({strict:!1}),{pathname:i}=Yn(),s=r.table===e,a=i.startsWith("/schema")?"/schema/$table":"/table/$table";return(0,u.jsxs)("li",{className:"relative group",children:[s&&(0,u.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary z-10"}),(0,u.jsxs)("div",{className:ee("w-full flex gap-0.5 pl-4 pr-2 py-1.5 text-sm transition-colors text-left justify-start items-center focus:outline-none",s?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground"),children:[(0,u.jsx)(Vo,{to:a,params:{table:e},className:"flex-1 flex items-center gap-1 min-w-0 focus:outline-none",children:(0,u.jsxs)("span",{className:"flex-1 truncate",children:[n&&n!=="public"?`${n}.`:"",e]})}),(0,u.jsxs)("div",{className:"flex items-center gap-1 h-5 shrink-0",children:[(0,u.jsx)("div",{className:ee(s?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:(0,u.jsx)(ov,{tableName:e,schemaName:n})}),(0,u.jsx)(jn,{children:t})]})]})]})},dv=()=>{const[e]=Je(ct.SIDEBAR_SEARCH,{defaultValue:""}),[t,n]=Je(ct.ACTIVE_SCHEMA,{defaultValue:"all"}),r=Ht(),{tablesList:i=[],isLoadingTablesList:s,errorTablesList:a}=il(),o=(0,E.useMemo)(()=>Array.from(new Set(i.reduce((m,d)=>(d.schemaName&&m.push(d.schemaName),m),[]))).sort(),[i]),l=(r?.schemaSelector??!1)&&o.length>1,h=i?.filter(m=>{const d=t==="all"||m.schemaName===t,f=m.tableName.toLowerCase().includes(e.toLowerCase());return d&&f});return(0,E.useEffect)(()=>{!l||t==="all"||o.includes(t)||n("all")},[o,t,n,l]),s?(0,u.jsx)("div",{className:"flex-1 h-full overflow-y-auto pb-3 flex items-center justify-center",children:(0,u.jsx)(od,{size:"size-6"})}):a?(0,u.jsxs)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:["Error: ",a.message]}):(0,u.jsx)("div",{className:"flex-1 overflow-y-auto pb-3",children:h&&h.length>0?(0,u.jsx)("ul",{children:h?.map(m=>(0,u.jsx)(hv,{schemaName:m.schemaName,tableName:m.tableName,rowCount:m.rowCount},m.schemaName?`${m.schemaName}.${m.tableName}`:m.tableName))}):e?(0,u.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables found matching"}):(0,u.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables available"})})},mv=()=>{const e=(0,E.useRef)(null),[t,n]=Je(ct.SIDEBAR_SEARCH,{defaultValue:""}),{openOverlay:r}=yt(),i=Ht();return vd("/",s=>{s.preventDefault(),e.current&&e.current.focus()},{preventDefault:!0}),(0,u.jsx)("div",{className:"px-3 pb-3 pt-2 space-y-2",children:(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,u.jsx)(ts,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,u.jsx)(et,{ref:e,variant:"outline",placeholder:"Search tables",value:t??"",onChange:s=>n(s.target.value.trim()),className:"rounded-sm h-8 pl-8 pr-8"}),(0,u.jsx)(jn,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]}),i?.dataModel!=="document"&&(0,u.jsx)(ae,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>r("table-builder.create-table"),"aria-label":"Add table",children:(0,u.jsx)(tn,{className:"size-4"})})]})})},fv=()=>{const[e,t]=Je(ct.ACTIVE_SCHEMA,{defaultValue:"all"}),n=Ht(),{tablesList:r=[]}=il(),i=(0,E.useMemo)(()=>Array.from(new Set(r.reduce((s,a)=>(a.schemaName&&s.push(a.schemaName),s),[]))).sort(),[r]);return(n?.schemaSelector??!1)&&i.length>1?(0,u.jsx)("div",{className:"px-3 pt-3",children:(0,u.jsxs)(Qn,{value:e,onValueChange:t,children:[(0,u.jsx)(Wn,{variant:"outline",className:"h-8! w-full justify-between rounded-sm",children:(0,u.jsx)(Kn,{placeholder:"Select schema"})}),(0,u.jsxs)(Gn,{children:[(0,u.jsx)(ut,{value:"all",children:"All schemas"}),i.map(s=>(0,u.jsx)(ut,{value:s,children:s},s))]})]})}):null},Yo=()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(fv,{}),(0,u.jsx)(mv,{}),(0,u.jsx)(rl,{className:"flex-1 overflow-y-auto pb-3 block h-full w-full",children:(0,u.jsx)(dv,{})})]});function pv(){const{databases:e,isLoadingDatabases:t,refetchDatabases:n,isRefetchingDatabases:r}=Pd(),{connectionInfo:i,isLoadingConnectionInfo:s}=Fd(),{selectedDatabase:a,setSelectedDatabase:o}=rs(),l=Ht(),h=Vn(),[m,d]=(0,E.useState)(!1),f=g=>{o(g),h({to:l?.dataModel==="key-value"?"/browser":"/table",search:{}})},p=async()=>{await n(),ot.success("Databases refreshed")};return(0,u.jsx)("div",{className:"mt-auto border-t border-sidebar-border bg-sidebar text-sidebar-foreground",children:(0,u.jsxs)("div",{className:"p-4 space-y-2",children:[(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between",children:[(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)(Ah,{className:"size-4 text-muted-foreground"}),(0,u.jsx)("span",{className:"text-sm font-medium",children:"Database"})]}),(0,u.jsxs)(Ot,{children:[(0,u.jsx)(Rt,{asChild:!0,children:(0,u.jsx)(ae,{variant:"ghost",size:"icon",className:"size-6 hover:bg-accent",onClick:p,disabled:t||r,children:(0,u.jsx)(Go,{className:ee("size-3.5",(t||r)&&"animate-spin")})})}),(0,u.jsx)(Dt,{children:"Refresh databases"})]})]}),(0,u.jsxs)(Qn,{value:a||"",onValueChange:f,children:[(0,u.jsx)(Wn,{className:"h-9 text-xs font-mono w-full",disabled:t||r,children:(0,u.jsx)(Kn,{placeholder:"Select database..."})}),(0,u.jsx)(Gn,{children:e?.map(g=>(0,u.jsx)(ut,{value:g.name,className:"font-mono text-xs",children:g.name},g.name))})]})]}),(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsxs)(ae,{variant:"ghost",className:"w-full hover:bg-accent flex items-center justify-between",onClick:()=>d(!m),disabled:s||r,children:[(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)("div",{className:"flex items-center justify-center",children:(0,u.jsxs)("div",{className:"relative flex size-2",children:[(0,u.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),(0,u.jsx)("span",{className:"relative inline-flex rounded-full size-2 bg-green-500"})]})}),(0,u.jsx)("span",{className:"text-xs font-medium text-green-600",children:"Connected"})]}),(0,u.jsx)(Qo,{className:ee("size-3 text-muted-foreground transition-transform",m&&"rotate-180")})]}),m&&i&&(0,u.jsxs)("div",{className:"space-y-1.5 p-2 rounded-md bg-muted/30",children:[(0,u.jsxs)("div",{className:"flex justify-between items-center",children:[(0,u.jsx)("span",{className:"text-xs text-muted-foreground",children:"Host"}),(0,u.jsxs)("span",{className:"text-xs font-mono text-foreground",children:[i.host,":",i.port]})]}),(0,u.jsxs)("div",{className:"flex justify-between items-center",children:[(0,u.jsx)("span",{className:"text-xs text-muted-foreground",children:"User"}),(0,u.jsx)("span",{className:"text-xs font-mono text-foreground",children:i.user})]}),(0,u.jsxs)("div",{className:"flex justify-between items-center",children:[(0,u.jsx)("span",{className:"text-xs text-muted-foreground",children:"Databases"}),(0,u.jsx)("span",{className:"text-xs font-mono font-medium text-foreground",children:e?.length||0})]})]})]})]})})}var gv=()=>{const{sidebar:{isPinned:e},toggleSidebarPinned:t}=Br();return(0,u.jsx)("div",{className:"flex items-center justify-between h-9 border-b border-sidebar-border",children:(0,u.jsx)(ae,{variant:"ghost",size:"lg",onClick:t,className:"size-9 flex items-center justify-center transition hover:bg-transparent! focus-visible:ring-0 focus-visible:ring-offset-0",title:e?"Unpin sidebar":"Pin sidebar",children:e?(0,u.jsx)(qh,{className:"size-4"}):(0,u.jsx)(kh,{className:"size-4"})})})},Ev=({children:e})=>{const{sidebar:{width:t,isOpen:n,isPinned:r},setSidebarWidth:i,setSidebarOpen:s}=Br(),a=(0,E.useRef)(!1),o=(0,E.useRef)(0),l=(0,E.useRef)(0),h=(0,E.useRef)(null),m=(0,E.useRef)(null),d=(0,E.useRef)(M=>{}),f=(0,E.useRef)(()=>{}),p=(0,E.useRef)(M=>{}),g=(0,E.useRef)(()=>{}),_=(0,E.useRef)(()=>{}),A=(0,E.useCallback)(M=>{a.current&&requestAnimationFrame(()=>{const z=M.clientX-o.current,Y=l.current+z;i(Y)})},[i]),b=(0,E.useCallback)(()=>{a.current=!1,Object.assign(document.body.style,{cursor:"",userSelect:""});const M=document.getElementById("resize-overlay");M&&M.remove()},[]),v=(0,E.useCallback)(M=>{M.preventDefault(),a.current=!0,o.current=M.clientX,l.current=t,Object.assign(document.body.style,{cursor:"col-resize",userSelect:"none"});const z=document.createElement("div");z.id="resize-overlay",z.style.cssText="position:fixed;inset:0;z-index:9999;cursor:col-resize;",document.body.appendChild(z)},[t]),S=(0,E.useCallback)(()=>{r||s(!0)},[r,s]),w=(0,E.useCallback)(()=>{r||s(!1)},[r,s]),R=(0,E.useCallback)(M=>{r||n||a.current||(M.clientX<=ct.HOVER_ZONE?(h.current&&clearTimeout(h.current),h.current=window.setTimeout(()=>{s(!0)},ct.HOVER_DELAY)):M.clientX>ct.HOVER_ZONE+50&&h.current&&clearTimeout(h.current))},[r,n,s]);d.current=A,f.current=b,p.current=R,g.current=S,_.current=w;const N=M=>{r||s(M)};return(0,E.useEffect)(()=>{const M=I=>d.current(I),z=()=>f.current(),Y=I=>p.current(I);return document.addEventListener("mousemove",M),document.addEventListener("mouseup",z),document.addEventListener("mousemove",Y),()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",z),document.removeEventListener("mousemove",Y),h.current&&clearTimeout(h.current)}},[]),(0,E.useEffect)(()=>{const M=m.current;if(!M)return;const z=()=>g.current(),Y=()=>_.current();return M.addEventListener("mouseenter",z),M.addEventListener("mouseleave",Y),()=>{M.removeEventListener("mouseenter",z),M.removeEventListener("mouseleave",Y)}},[]),(0,u.jsxs)(cd,{open:n,onOpenChange:N,modal:!1,children:[(0,u.jsx)(Td,{className:"sr-only",children:"Open Sidebar"}),(0,u.jsx)(hd,{ref:m,side:"left",showCloseButton:!1,isPinned:r,className:ee("bg-sidebar border-r border-sidebar-border text-sidebar-foreground p-0","transition-transform duration-300 ease-out"),style:{width:`${t}px`},onOpenAutoFocus:M=>M.preventDefault(),children:(0,u.jsxs)("div",{className:"relative h-full flex flex-col",children:[e,(0,u.jsx)("div",{role:"button",tabIndex:0,onMouseDown:v,className:ee("absolute top-0 right-0 w-2 h-full cursor-col-resize z-50","hover:bg-blue-500/50 transition-colors group"),title:"Drag to resize",children:(0,u.jsx)("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-2 h-12 bg-blue-500 opacity-0 group-hover:opacity-100 transition-opacity rounded-full"})})]})})]})},Tv=["string","hash","list","set","zset","stream"],It=qd(""),bv=()=>{const{closeOverlay:e,isOverlayOpen:t}=yt(),[n,r]=(0,E.useState)(It),[i,s]=(0,E.useState)("string"),[a,o]=(0,E.useState)(It),[l,h]=(0,E.useState)(It),[m,d]=(0,E.useState)("0"),[f,p]=(0,E.useState)(""),{createKey:g,isPending:_}=Yd(),A=t("redis-browser.create-key"),b=i==="hash"||i==="stream",v=n===null||a===null||b&&l===null,S=async()=>{const w=b?l:It;if(n===null||a===null||w===null)return;let R;switch(i){case"string":R={kind:"string",value:a};break;case"hash":R={kind:"hash",entries:[{field:a,value:w}]};break;case"list":R={kind:"list",entries:[a]};break;case"set":R={kind:"set",members:[a]};break;case"zset":R={kind:"zset",entries:[{member:a,score:Number(m)}]};break;case"stream":R={kind:"stream",id:"*",fields:[{field:a,value:w}]}}await g({key:n,type:i,value:R,ttlMs:f?Number(f)*1e3:null}),r(It),s("string"),o(It),h(It),d("0"),p(""),e("redis-browser.create-key")};return(0,u.jsxs)(Zo,{title:"Create Redis key",description:"Creates the key atomically and never overwrites an existing key.",open:A,onOpenChange:w=>{w||e("redis-browser.create-key")},size:"sm:max-w-md!",headerClassName:"border-b border-border p-4",titleClassName:"text-sm font-medium",contentClassName:"space-y-4 px-4 py-4",children:[(0,u.jsxs)(Md,{className:"gap-4",children:[(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-name",children:"Key"}),(0,u.jsx)(ti,{id:"redis-key-name",value:n,onChange:r,className:"h-8",placeholder:"cache:user:42"}),(0,u.jsx)(Ks,{children:"Text, hexadecimal, and Base64 keys are supported."})]}),(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-type",children:"Type"}),(0,u.jsxs)(Qn,{value:i,onValueChange:w=>s(w),children:[(0,u.jsx)(Wn,{id:"redis-key-type",className:"h-8!",children:(0,u.jsx)(Kn,{})}),(0,u.jsx)(Gn,{children:Tv.map(w=>(0,u.jsx)(ut,{value:w,children:w},w))})]})]}),(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-first-value",children:i==="hash"||i==="stream"?"Initial field":i==="zset"?"Initial member":"Initial value"}),(0,u.jsx)(ti,{id:"redis-key-first-value",value:a,onChange:o})]}),(i==="hash"||i==="stream")&&(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-second-value",children:"Initial value"}),(0,u.jsx)(ti,{id:"redis-key-second-value",value:l,onChange:h})]}),i==="zset"&&(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-score",children:"Score"}),(0,u.jsx)(et,{id:"redis-key-score",type:"number",value:m,onChange:w=>d(w.target.value),className:"font-mono"})]}),(0,u.jsxs)(Gt,{children:[(0,u.jsx)(Qt,{htmlFor:"redis-key-ttl",children:"TTL in seconds"}),(0,u.jsx)(et,{id:"redis-key-ttl",type:"number",min:1,value:f,onChange:w=>p(w.target.value),placeholder:"Persistent",className:"font-mono h-8"}),(0,u.jsx)(Ks,{children:"Leave empty to create a persistent key."})]})]}),(0,u.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[(0,u.jsx)(ae,{variant:"outline",onClick:()=>e("redis-browser.create-key"),children:"Cancel"}),(0,u.jsx)(ae,{disabled:_||v,onClick:S,children:"Create key"})]})]})},xv=["string","hash","list","set","zset","stream"],kv={string:"STR",hash:"HASH",list:"LIST",set:"SET",zset:"ZSET",stream:"XSTR"},yv=e=>e===-1?"∞":e<0?"gone":e<1e3?`${e}ms`:e<6e4?`${Math.ceil(e/1e3)}s`:e<36e5?`${Math.ceil(e/6e4)}m`:`${Math.ceil(e/36e5)}h`,Cv=e=>e===null?"—":e<1024?`${e} B`:`${(e/1024).toFixed(1)} KiB`,_v=(e,t)=>t!==void 0?t||"(empty key)":`0x${Array.from(Vd(e),n=>n.toString(16).padStart(2,"0")).join("")}`,Av=()=>{const{openOverlay:e}=yt(),[t,n]=Je("key"),[r,i]=Je("search",{defaultValue:""}),[s,a]=(0,E.useState)(r),[o,l]=Je("type",{defaultValue:""}),[h,m]=Je("glob",{defaultValue:"false"}),d=h==="true",f=Wd({search:s,type:o,exactPattern:d}),p=(0,E.useMemo)(()=>f.data?.pages.flatMap(b=>b.keys)??[],[f.data]),g=(0,E.useRef)(null),_=bh({count:p.length,getScrollElement:()=>g.current,estimateSize:()=>33,overscan:10}),A=_.getVirtualItems();return(0,E.useEffect)(()=>{const b=window.setTimeout(()=>a(r),250);return()=>window.clearTimeout(b)},[r]),(0,E.useEffect)(()=>{const b=A.at(-1);b&&b.index>=p.length-5&&f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()},[A,p.length,f.hasNextPage,f.isFetchingNextPage,f.fetchNextPage]),(0,u.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-background font-mono",children:[(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"space-y-2 px-3 pb-3 pt-2",children:[(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,u.jsx)(ts,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,u.jsx)(et,{variant:"outline",value:r,onChange:b=>i(b.target.value),placeholder:d?"Redis glob pattern":"Find keys","aria-label":"Find Redis keys",className:"h-8 rounded-sm pl-8"})]}),(0,u.jsx)(ae,{variant:"outline",size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>ot.promise(f.refetch({throwOnError:!0}),{loading:"Refreshing Redis keys...",success:"Redis keys refreshed",error:"Failed to refresh Redis keys"}),disabled:f.isFetching,"aria-label":"Refresh Redis keys",children:(0,u.jsx)(Go,{className:ee(f.isFetching&&"animate-spin")})}),(0,u.jsx)(ae,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>e("redis-browser.create-key"),"aria-label":"Create Redis key",children:(0,u.jsx)(tn,{})})]}),(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsxs)(Qn,{value:o||"all",onValueChange:b=>l(b==="all"?"":b),children:[(0,u.jsx)(Wn,{variant:"outline","aria-label":"Filter Redis key type",className:"h-8! min-w-0 flex-1 justify-between rounded-sm",children:(0,u.jsx)(Kn,{})}),(0,u.jsxs)(Gn,{children:[(0,u.jsx)(ut,{value:"all",children:"All types"}),xv.map(b=>(0,u.jsx)(ut,{value:b,children:b},b))]})]}),(0,u.jsxs)(Hd,{variant:"outline",size:"lg",pressed:d,onPressedChange:b=>m(b?"true":"false"),className:"shrink-0 rounded-sm px-2 text-xs/relaxed uppercase","aria-label":"Use Redis glob pattern",children:[(0,u.jsx)(Ph,{className:"size-4"})," Glob"]})]})]}),(0,u.jsxs)("div",{className:"flex h-6 items-center justify-between px-4 text-[9px] uppercase tracking-wider text-muted-foreground",children:[(0,u.jsxs)("span",{children:[p.length," loaded"]}),(0,u.jsx)("span",{children:f.dataUpdatedAt>0?new Date(f.dataUpdatedAt).toLocaleTimeString():"not scanned"})]})]}),(0,u.jsxs)("div",{ref:g,className:"min-h-0 flex-1 overflow-auto",children:[f.isLoading?(0,u.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Scanning keyspace…"}):p.length===0?(0,u.jsxs)("div",{className:"flex min-h-32 flex-col items-center justify-center gap-2 px-4 text-center text-muted-foreground",children:[(0,u.jsx)(Nh,{className:"size-4"}),(0,u.jsx)("span",{className:"text-xs",children:"No keys in this scan."}),(0,u.jsxs)(ae,{variant:"outline",size:"sm",onClick:()=>e("redis-browser.create-key"),children:[(0,u.jsx)(tn,{})," Create key"]})]}):(0,u.jsx)("div",{className:"relative w-full",style:{height:`${_.getTotalSize()}px`},children:A.map(b=>{const v=p[b.index],S=v.key.base64||"-",w=_v(v.key.base64,v.key.utf8);return(0,u.jsxs)(ae,{variant:"ghost",onClick:()=>n(S),className:ee("absolute left-0 top-0 h-auto w-full justify-start gap-2 rounded-none px-4 py-1.5 text-sm font-normal transition-colors",t===S?"bg-sidebar-accent text-sidebar-accent-foreground font-medium before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-primary":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),style:{transform:`translateY(${b.start}px)`},title:w,children:[(0,u.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-current",children:w}),(0,u.jsx)(kd,{variant:"outline",className:"h-4 w-10 shrink-0 justify-center rounded-sm px-1 text-[8px] font-normal text-muted-foreground",children:kv[v.type]??"?"}),(0,u.jsxs)("span",{className:"shrink-0 text-[9px] text-muted-foreground",children:[Cv(v.memoryBytes)," ·"," ",v.ttlMs===-1?(0,u.jsx)(_h,{className:"inline size-3 align-[-2px]","aria-label":"No expiry"}):yv(v.ttlMs)]})]},`${S}-${b.index}`)})}),f.isFetchingNextPage&&(0,u.jsx)("div",{className:"px-2 py-1 text-center text-[10px] text-muted-foreground",children:"Scanning more…"})]}),(0,u.jsx)(bv,{})]})},vv=()=>{const{pathname:e}=Yn(),t=e.split("/")[1],n=Ht()?.dataModel==="key-value",r=(0,E.useMemo)(()=>{if(n&&t!=="runner")return(0,u.jsx)(Av,{});switch(t){case"":case"table":case"schema":return(0,u.jsx)(Yo,{});case"runner":return(0,u.jsx)(av,{});default:return(0,u.jsx)(Yo,{})}},[n,t]);return(0,u.jsxs)(Ev,{children:[(0,u.jsx)(gv,{}),r,(0,u.jsx)(pv,{})]})},t1=Zi({component:()=>Nv});function Nv(){const e=Ht()?.dataModel==="key-value",{pathname:t}=Yn(),n=t.split("/")[1],{sidebar:{isPinned:r,width:i}}=Br();return e&&n!=="browser"&&n!=="runner"?(0,u.jsx)(zs,{to:"/browser"}):!e&&n==="browser"?(0,u.jsx)(zs,{to:"/"}):(0,u.jsxs)("div",{className:"bg-background text-foreground w-dvw flex h-dvh max-h-dvh overflow-hidden relative",children:[(0,u.jsx)(vv,{}),(0,u.jsxs)("div",{className:"flex-1 flex flex-col h-full overflow-hidden ",style:{marginLeft:r?`${i}px`:"0"},children:[(0,u.jsx)(rv,{}),(0,u.jsx)(Eh,{})]})]})}export{cA as a,Nv as component,je as i,VC as n,e1 as r,t1 as t};
|