From d2bef504c4709c69dba0decca36540fbe3fe9139 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 28 Aug 2022 12:09:39 +0000 Subject: [PATCH] v4.1.0 website: add `backToUp` button. 17734029155ec4a88da87cd098517b65291b52a0 --- asset-manifest.json | 12 ++++++------ coverage/lcov-report/index.html | 2 +- coverage/lcov-report/src/index.html | 2 +- coverage/lcov-report/src/index.tsx.html | 2 +- coverage/lcov-report/src/nodes/copy.ts.html | 2 +- coverage/lcov-report/src/nodes/index.html | 2 +- coverage/lcov-report/src/nodes/octiconLink.ts.html | 2 +- coverage/lcov-report/src/plugins/index.html | 2 +- .../lcov-report/src/plugins/reservedMeta.ts.html | 2 +- index.html | 2 +- static/js/main.3b9ab59b.js | 3 +++ ...4.js.LICENSE.txt => main.3b9ab59b.js.LICENSE.txt} | 0 static/js/main.3b9ab59b.js.map | 1 + static/js/main.f5d48f44.js | 3 --- static/js/main.f5d48f44.js.map | 1 - static/js/refractor-vendor.6eaa9c3e.js | 2 ++ static/js/refractor-vendor.6eaa9c3e.js.map | 1 + static/js/refractor-vendor.bc22ceca.js | 2 -- static/js/refractor-vendor.bc22ceca.js.map | 1 - 19 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 static/js/main.3b9ab59b.js rename static/js/{main.f5d48f44.js.LICENSE.txt => main.3b9ab59b.js.LICENSE.txt} (100%) create mode 100644 static/js/main.3b9ab59b.js.map delete mode 100644 static/js/main.f5d48f44.js delete mode 100644 static/js/main.f5d48f44.js.map create mode 100644 static/js/refractor-vendor.6eaa9c3e.js create mode 100644 static/js/refractor-vendor.6eaa9c3e.js.map delete mode 100644 static/js/refractor-vendor.bc22ceca.js delete mode 100644 static/js/refractor-vendor.bc22ceca.js.map diff --git a/asset-manifest.json b/asset-manifest.json index 87a67a00..8214c396 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,20 +1,20 @@ { "files": { "main.css": "/react-markdown-preview/static/css/main.42640bfe.css", - "main.js": "/react-markdown-preview/static/js/main.f5d48f44.js", - "refractor-vendor.js": "/react-markdown-preview/static/js/refractor-vendor.bc22ceca.js", + "main.js": "/react-markdown-preview/static/js/main.3b9ab59b.js", + "refractor-vendor.js": "/react-markdown-preview/static/js/refractor-vendor.6eaa9c3e.js", "react-vendor.js": "/react-markdown-preview/static/js/react-vendor.6a538c04.js", "static/media/logo.svg": "/react-markdown-preview/static/media/logo.3931a054f5ef8356122965d973d55570.svg", "index.html": "/react-markdown-preview/index.html", "main.42640bfe.css.map": "/react-markdown-preview/static/css/main.42640bfe.css.map", - "main.f5d48f44.js.map": "/react-markdown-preview/static/js/main.f5d48f44.js.map", - "refractor-vendor.bc22ceca.js.map": "/react-markdown-preview/static/js/refractor-vendor.bc22ceca.js.map", + "main.3b9ab59b.js.map": "/react-markdown-preview/static/js/main.3b9ab59b.js.map", + "refractor-vendor.6eaa9c3e.js.map": "/react-markdown-preview/static/js/refractor-vendor.6eaa9c3e.js.map", "react-vendor.6a538c04.js.map": "/react-markdown-preview/static/js/react-vendor.6a538c04.js.map" }, "entrypoints": [ - "static/js/refractor-vendor.bc22ceca.js", + "static/js/refractor-vendor.6eaa9c3e.js", "static/js/react-vendor.6a538c04.js", "static/css/main.42640bfe.css", - "static/js/main.f5d48f44.js" + "static/js/main.3b9ab59b.js" ] } \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index ceefcb84..85643d0c 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -131,7 +131,7 @@

All files

\ No newline at end of file +React Markdown Preview
\ No newline at end of file diff --git a/static/js/main.3b9ab59b.js b/static/js/main.3b9ab59b.js new file mode 100644 index 00000000..39ef57f7 --- /dev/null +++ b/static/js/main.3b9ab59b.js @@ -0,0 +1,3 @@ +/*! For license information please see main.3b9ab59b.js.LICENSE.txt */ +!function(){var e={4245:function(e,t,n){"use strict";var r={};function i(e){if(Array.isArray(e))return e}n.r(r),n.d(r,{attentionMarkers:function(){return dn},contentInitial:function(){return sn},disable:function(){return mn},document:function(){return un},flow:function(){return cn},flowInitial:function(){return ln},insideSpan:function(){return hn},string:function(){return fn},text:function(){return pn}});var o=n(181);function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){return i(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(s){u=!0,i=s}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}}(e,t)||(0,o.Z)(e,t)||a()}var s=n(5848);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var f=n(3433),p=n(5671),h=n(3144),d=n(136),m=n(3668),E=n(1120),T=n(9611);var g=n(8814);function v(e,t,n){return v=(0,g.Z)()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&(0,T.Z)(i,n.prototype),i},v.apply(null,arguments)}function A(e){var t="function"===typeof Map?new Map:void 0;return A=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return v(e,arguments,(0,E.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,T.Z)(r,e)},A(e)}var y=document.createElement("template");y.innerHTML='\n\n\n';var C=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,p.Z)(this,n),(e=t.call(this)).right="0",e.shadow=e.attachShadow({mode:"open"}),e.shadow.appendChild(e.ownerDocument.importNode(y.content,!0)),e.update(),e}return(0,h.Z)(n,[{key:"setAttr",value:function(e,t){var n=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?n.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?n.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?n.style[e]=t:n.setAttribute(e,t)}},{key:"update",value:function(){var e=this;[].concat((0,f.Z)(this.getAttributeNames()),["right"]).forEach((function(t){var n=e.getAttribute(t)||e[t]||"";e.setAttr(t,n)}))}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this.setAttr(e,n)}}],[{key:"observedAttributes",get:function(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}}]),n}(A(HTMLElement));customElements.define("github-corners",C);var _=n(2466),k=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function b(e){var t=e.size,n=void 0===t?80:t,r=e.fixed,i=void 0!==r&&r,o=e.bottom,a=e.zIndex,u=e.style,s=e.bgColor,f=void 0===s?"#151513":s,p=e.color,h=void 0===p?"#fff":p,d=e.position,m=void 0===d?"right":d,E=c(e,k),T="left"===m?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return o?(T.bottom=0,T.top="initial",T.transform="left"===m?"scale(-1, -1)":"scale(1, -1)"):(T.bottom="initial",T.top=0),(0,_.jsx)("github-corners",l({target:"__blank",width:n,height:n,href:e.href,position:i?"fixed":"absolute","z-index":a,style:u,fill:f,color:h},T,E))}var D=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,p.Z)(this,n),t.apply(this,arguments)}return(0,h.Z)(n,[{key:"render",value:function(){var e=this;return(0,_.jsx)(_.Fragment,{children:s.Children.toArray(this.props.children).map((function(t){return s.isValidElement(t)?s.cloneElement(t,l({},e.props,t.props)):null}))})}}]),n}(s.Component),N=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i){var o;return(0,p.Z)(this,n),(o=t.call(this,e)).getUrl=function(){return""},o.state=Object.assign({},l({},r,e),i),o}return(0,h.Z)(n,[{key:"render",value:function(){var e=this.state.href;return e?(0,_.jsxs)("a",{href:e,children:[" ",(0,_.jsx)("img",{alt:"",src:this.getUrl()})," "]}):(0,_.jsx)("img",{alt:"",src:this.getUrl()})}}]),n}(s.Component);N.defaultProps={platform:"github",base:"https://img.shields.io"};var S=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"issues"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.property,o=e.user,a=e.repo,u=e.label,s=e.base;return"github"!==n?"":"issues"===t||/^issues-(raw|closed|closed-raw|pr|pr-raw|pr-closed|pr-closed-raw)/.test(t)?u&&("issues"===t||/^issues-(raw|pr|pr-raw)/.test(t||""))?[s,n,t,o,a,u].join("/"):[s,n,t,o,a].join("/"):"issueKind"===t?[s,n,t,"detail",i,o,a].join("/"):""},r}return(0,h.Z)(n)}(N),O=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"languages"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base,u=e.path;return"github"!==n?"":"languages"===t?[a,n,t,"code-size",i,o].join("/"):"repo-size"===t?[a,n,t,i,o].join("/"):"size"===t&&u?[a,n,t,i,o,u].join("/"):""},r}return(0,h.Z)(n)}(N),F=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"downloads",total:!0})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base,u=e.tag,s=e.path,l=e.total;if("github"!==n||!/^(downloads|downloads-pre)/.test(t||""))return"";var c=[a,n,t,i,o];return s&&u?[].concat(c,[u,s]).join("/"):l&&u||"downloads-pre"===t&&u&&l?[].concat(c,[u,"total"]).join("/"):l?[].concat(c,["total"]).join("/"):""},r}return(0,h.Z)(n)}(N),x=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"commits-since"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base,u=e.interval,s=e.variant,l=e.version,c=e.branch;return"github"!==n?"":"commits-since"===t&&l&&c?[a,n,t,i,o,l,c].join("/"):"commit-activity"===t&&u?[a,n,t,u,i,o].join("/"):"variant"===t&&s?[a,n,t,s,i,o].join("/"):"last-commit"===t?c?[a,n,t,i,o,c].join("/"):[a,n,t,i,o].join("/"):t&&/^release-(date|date-pre)/.test(t)?[a,n,t,i,o].join("/"):""},r}return(0,h.Z)(n)}(N),I=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"version-release"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base,u=e.branch,s="";switch(t){case"version-release":s="v/release";break;case"version-tag":s="v/tag";break;case"package-json":s="package-json/v";break;case"manifest-json":s="manifest-json/v";break;case"go-mod":s="go-mod/go-version"}if("github"!==n||!s)return"";var l=[a,n,s,i,o];return/(go-mod|manifest-json|package-json)/.test(t||"")&&u?[].concat(l,[u]).join("/"):l.join("/")},r}return(0,h.Z)(n)}(N),R=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"license"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base;return"github"!==n?"":[a,n,t,i,o].join("/")},r}return(0,h.Z)(n)}(N),w=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"languages-count"})).getUrl=function(){var e=r.state,t=e.base,n=e.platform,i=e.type,o=e.user,a=e.repo,u=e.query,s="";switch(i){case"languages-count":s="languages/count";break;case"languages-top":s="languages/top";break;case"search":s="search"}if("github"!==n||!s)return"";var l=[t,n,s,o,a];return u?[].concat(l,[u]).join("/"):l.join("/")},r}return(0,h.Z)(n)}(N),L=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{platform:"github",type:"followers"})).getUrl=function(){var e=r.state,t=e.type,n=e.platform,i=e.user,o=e.repo,a=e.base;return"github"!==n?"":"followers"===t?[a,n,t,i].join("/"):[a,n,t,i,o].join("/")},r}return(0,h.Z)(n)}(N),M=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,p.Z)(this,n),t.apply(this,arguments)}return(0,h.Z)(n)}(D);M.Issues=S,M.Size=O,M.Activity=x,M.Downloads=F,M.Version=I,M.License=R,M.Analysis=w,M.Social=L;var P=M,B=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{type:"version"},{platform:"npm"})).getUrl=function(){var e=r.state,t=e.base,n=e.platform,i=e.type,o=e.scope,a=e.packageName,u=e.dependency,s=e.dependencyScope,l=e.version,c=e.registryUri;if("npm"!==n||!a)return"";var f="",p=[t,n];return"version"===i&&a?(p.push("v"),o&&p.push(o),p.push(a),l&&p.push(l),f=p.join("/"),c&&(f=f+"?registry_uri="+c)):"peer-dependency"===i&&a&&u?(p.push("dependency-version"),o&&p.push(o),f=[].concat(p,[a,"peer",u]).join("/")):"dev-dependency"===i&&a&&u?(p.push("dependency-version"),o&&p.push(o),p.concat([a,"dev"]),s&&p.push(s),p.push(u),f=p.join("/")):a&&u&&(p.concat([a,u]),f=p.join("/")),f},r}return(0,h.Z)(n)}(N),H=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,p.Z)(this,n),(r=t.call(this,e,{format:"min"},{platform:"npm"})).getUrl=function(){var e=r.state,t=e.base,n=e.platform,i=e.format,o=e.packageName,a=e.scope,u=e.version;if("npm"!==n)return"";var s=[t,"bundlephobia"],l="";return o&&i&&(l=[].concat(s,[i,o]).join("/")),o&&i&&a&&(l=[].concat(s,[i,a,o]).join("/")),o&&i&&a&&u&&(l=[].concat(s,[i,a,o,u]).join("/")),o&&i&&u&&(l=[].concat(s,[i,o,u]).join("/")),l},r}return(0,h.Z)(n)}(N),U=function(e){(0,d.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,p.Z)(this,n),t.apply(this,arguments)}return(0,h.Z)(n)}(D);U.Version=B,U.Size=H;var j=U,G=["className","prefixCls","element","top","size","strokeWidth","smooth","hideProgress","children"],K={position:"sticky",bottom:15,right:15,visibility:"visible",opacity:0,transition:"visibility 0.3s linear 0s, opacity 0.3s linear 0s",cursor:"pointer",userSelect:"none"},z={display:"block",transform:"rotate(-90deg)"},Y={transition:"stroke-dashoffset 0.3s linear 0s"},Z={position:"absolute",top:0,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12},Q=document.documentElement;function W(e){void 0===e&&(e={});var t=e,n=t.className,r=t.prefixCls,i=void 0===r?"w-back-to-up":r,o=t.element,a=void 0===o?Q:o,f=t.top,p=void 0===f?120:f,h=t.size,d=void 0===h?35:h,m=t.strokeWidth,E=void 0===m?3:m,T=t.smooth,g=void 0===T||T,v=t.hideProgress,A=void 0!==v&&v,y=t.children,C=c(e,G),k=[n,i].filter(Boolean).join(" "),b=Object.assign({},K,{position:a===Q?"fixed":"sticky"},C.style,{width:d,height:d,opacity:0===p?1:0}),D=(0,s.useRef)(null),N=(0,s.useMemo)((function(){return d/2}),[d]),S=(0,s.useMemo)((function(){return d/2-E/2}),[d,E]),O=(0,s.useMemo)((function(){return Math.PI*S*2}),[S]),F=u((0,s.useState)(O),2),x=F[0],I=F[1],R=function(e){var t=a||Q,n=t.clientHeight,r=t.scrollHeight,i=t.scrollTop;I(O-O*(i/(r-n))),D.current&&p>0&&(D.current.style.opacity=i>p?"1":"0")};(0,s.useEffect)((function(){var e=a===Q?document:a;return e&&e.addEventListener("scroll",R,{passive:!0}),function(){e&&e.removeEventListener("scroll",R)}}),[a]);return(0,_.jsxs)("div",l({className:k,ref:D},C,{onClick:function(e){a.scrollTo({top:0,behavior:g?"smooth":"auto"})},style:b,children:[!A&&(0,_.jsxs)("svg",{viewBox:"0 0 "+d+" "+d,width:d,height:d,focusable:"false",style:z,children:[(0,_.jsx)("circle",{fill:"rgb(0 0 0 / 75%)",stroke:"rgb(200 200 200 / 85%)",strokeWidth:E,r:S,cx:N,cy:N}),(0,_.jsx)("circle",{fill:"none",stroke:"rgb(0 0 0 / 50%)",strokeWidth:E,r:S,cx:N,cy:N,strokeDasharray:O,strokeDashoffset:x,style:Y})]}),y&&(0,_.jsx)("div",{style:Z,children:y})]}))}n(144);var V=n.p+"static/media/logo.3931a054f5ef8356122965d973d55570.svg";function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;te.length){for(;o--;)if(47===e.charCodeAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";var a=-1,u=t.length-1;for(;o--;)if(47===e.charCodeAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),u>-1&&(e.charCodeAt(o)===t.charCodeAt(u--)?u<0&&(i=o):(u=-1,i=a));r===i?i=a:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(ue(e),0===e.length)return".";var t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},extname:function(e){ue(e);var t,n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){var u=e.charCodeAt(n);if(47!==u)r<0&&(t=!0,r=n+1),46===u?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1);else if(t){i=n+1;break}}if(o<0||r<0||0===a||1===a&&o===r-1&&o===i+1)return"";return e.slice(o,r)},join:function(){for(var e,t=-1,n=arguments.length,r=new Array(n),i=0;i2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",o=0):o=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),a=s,u=0;continue}}else if(i.length>0){i="",o=0,a=s,u=0;continue}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,s):i=e.slice(a+1,s),o=s-a-1;a=s,u=0}else 46===n&&u>-1?u++:u=-1}return i}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}function ue(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var se={cwd:function(){return"/"}};function le(e){return null!==e&&"object"===typeof e&&e.href&&e.origin}function ce(e){if("string"===typeof e)e=new URL(e);else if(!le(e)){var 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("file:"!==e.protocol){var n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return function(e){if(""!==e.hostname){var t=new TypeError('File URL host must be "localhost" or empty on darwin');throw t.code="ERR_INVALID_FILE_URL_HOST",t}var n=e.pathname,r=-1;for(;++ro.length;s&&o.push(r);try{u=e.apply(this,o)}catch(c){var l=c;if(s&&n)throw l;return r(l)}s||(u instanceof Promise?u.then(i,r):u instanceof Error?r(u):i(u))};function r(e){if(!n){n=!0;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o1?s-1:0),c=1;c1?n-1:0),u=1;uo?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),[].splice.apply(e,i);else for(n&&[].splice.apply(e,[t,n]);a0?(we(e,e.length,0,t),e):t}var Me={}.hasOwnProperty;function Pe(e){for(var t={},n=-1;++nr))return;for(var l,c,f=i.events.length,p=f;p--;)if("exit"===i.events[p][0]&&"chunkFlow"===i.events[p][1].type){if(l){c=i.events[p][1].end;break}l=!0}for(T(a),s=f;st;){var r=o[n];i.containerState=r[1],r[0].exit.call(i,e)}o.length=t}function g(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},nt={tokenize:function(e,t,n){return Je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var rt={tokenize:function(e,t,n){return Je(e,(function(e){return null===e||We(e)?t(e):n(e)}),"linePrefix")},partial:!0};function it(e){for(var t,n,r,i,o,a,u,s={},l=-1;++l=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0};var st={tokenize:function(e){var t=this,n=e.attempt(rt,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,Je(e,e.attempt(this.parser.constructs.flow,r,e.attempt(at,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};var lt={resolveAll:ht()},ct=pt("string"),ft=pt("text");function pt(e){return{tokenize:function(t){var n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return s(e)?i(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),u;t.consume(e)}function u(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),u)}function s(e){if(null===e)return!0;var t=r[e],i=-1;if(t)for(;++i-1&&(n[0]=n[0].slice(i)),a>0&&n.push(e[o].slice(0,a)));return n}(a,e)}function h(){return Object.assign({},r)}function d(){for(var e;r._indexl?n(i):(e.consume(i),d):41===i?c--?(e.consume(i),d):(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(i)):null===i||Qe(i)?c?n(i):(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(i)):Ze(i)?n(i):(e.consume(i),92===i?m:d)}function m(t){return 40===t||41===t||92===t?(e.consume(t),d):d(t)}}function _t(e,t,n,r,i,o){var a,u=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),l};function l(f){return null===f||91===f||93===f&&!a||94===f&&!s&&"_hiddenFootnoteSupport"in u.parser.constructs||s>999?n(f):93===f?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):We(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(t){return null===t||91===t||93===t||We(t)||s++>999?(e.exit("chunkString"),l(t)):(e.consume(t),a=a||!Ve(t),92===t?f:c)}function f(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function kt(e,t,n,r,i,o){var a;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,u};function u(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),s(n))}function s(t){return t===a?(e.exit(o),u(a)):null===t?n(t):We(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Je(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===a||null===t||We(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:l)}function c(t){return t===a||92===t?(e.consume(t),l):l(t)}}function bt(e,t){var n;return function r(i){if(We(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(Ve(i))return Je(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}function Dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Nt={name:"definition",tokenize:function(e,t,n){var r,i=this;return function(t){return e.enter("definition"),_t.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function o(t){return r=Dt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),bt(e,Ct(e,e.attempt(St,Je(e,a,"whitespace"),Je(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function a(o){return null===o||We(o)?(e.exit("definition"),i.parser.defined.includes(r)||i.parser.defined.push(r),t(o)):n(o)}}},St={tokenize:function(e,t,n){return function(t){return Qe(t)?bt(e,r)(t):n(t)};function r(t){return 34===t||39===t||40===t?kt(e,Je(e,i,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function i(e){return null===e||We(e)?t(e):n(e)}},partial:!0};var Ot={name:"codeIndented",tokenize:function(e,t,n){var r=this;return function(t){return e.enter("codeIndented"),Je(e,i,"linePrefix",5)(t)};function i(e){var t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?u(t):We(t)?e.attempt(Ft,o,u)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||We(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),a)}function u(n){return e.exit("codeIndented"),t(n)}}},Ft={tokenize:function(e,t,n){var r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):We(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):Je(e,o,"linePrefix",5)(t)}function o(e){var o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):We(e)?i(e):n(e)}},partial:!0};var xt={name:"headingAtx",tokenize:function(e,t,n){var r=this,i=0;return function(t){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(t)};function o(u){return 35===u&&i++<6?(e.consume(u),o):null===u||Qe(u)?(e.exit("atxHeadingSequence"),r.interrupt?t(u):a(u)):n(u)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),u(n)):null===n||We(n)?(e.exit("atxHeading"),t(n)):Ve(n)?Je(e,a,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function u(t){return 35===t?(e.consume(t),u):(e.exit("atxHeadingSequence"),a(t))}function s(t){return null===t||35===t||Qe(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),s)}},resolve:function(e,t){var n,r,i=e.length-2,o=3;"whitespace"===e[o][1].type&&(o+=2);i-2>o&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4);i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},we(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}};var It={name:"setextUnderline",tokenize:function(e,t,n){var r,i,o=this,a=o.events.length;for(;a--;)if("lineEnding"!==o.events[a][1].type&&"linePrefix"!==o.events[a][1].type&&"content"!==o.events[a][1].type){i="paragraph"===o.events[a][1].type;break}return function(t){if(!o.parser.lazy[o.now().line]&&(o.interrupt||i))return e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),r=t,u(t);return n(t)};function u(t){return t===r?(e.consume(t),u):(e.exit("setextHeadingLineSequence"),Je(e,s,"lineSuffix")(t))}function s(r){return null===r||We(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){var n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);var a={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=a;return e.push(["exit",a,t]),e}};var Rt=["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","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],wt=["pre","script","style","textarea"],Lt={name:"htmlFlow",tokenize:function(e,t,n){var r,i,o,a,u,s=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l};function l(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),h):63===a?(e.consume(a),r=3,s.interrupt?t:w):Ue(a)?(e.consume(a),o=String.fromCharCode(a),i=!0,d):n(a)}function c(i){return 45===i?(e.consume(i),r=2,f):91===i?(e.consume(i),r=5,o="CDATA[",a=0,p):Ue(i)?(e.consume(i),r=4,s.interrupt?t:w):n(i)}function f(r){return 45===r?(e.consume(r),s.interrupt?t:w):n(r)}function p(r){return r===o.charCodeAt(a++)?(e.consume(r),a===o.length?s.interrupt?t:D:p):n(r)}function h(t){return Ue(t)?(e.consume(t),o=String.fromCharCode(t),d):n(t)}function d(a){return null===a||47===a||62===a||Qe(a)?47!==a&&i&&wt.includes(o.toLowerCase())?(r=1,s.interrupt?t(a):D(a)):Rt.includes(o.toLowerCase())?(r=6,47===a?(e.consume(a),m):s.interrupt?t(a):D(a)):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):i?T(a):E(a)):45===a||Ke(a)?(e.consume(a),o+=String.fromCharCode(a),d):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:D):n(r)}function E(t){return Ve(t)?(e.consume(t),E):k(t)}function T(t){return 47===t?(e.consume(t),k):58===t||95===t||Ue(t)?(e.consume(t),g):Ve(t)?(e.consume(t),T):k(t)}function g(t){return 45===t||46===t||58===t||95===t||Ke(t)?(e.consume(t),g):v(t)}function v(t){return 61===t?(e.consume(t),A):Ve(t)?(e.consume(t),v):T(t)}function A(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),u=t,y):Ve(t)?(e.consume(t),A):(u=null,C(t))}function y(t){return null===t||We(t)?n(t):t===u?(e.consume(t),_):(e.consume(t),y)}function C(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||Qe(t)?v(t):(e.consume(t),C)}function _(e){return 47===e||62===e||Ve(e)?T(e):n(e)}function k(t){return 62===t?(e.consume(t),b):n(t)}function b(t){return Ve(t)?(e.consume(t),b):null===t||We(t)?D(t):n(t)}function D(t){return 45===t&&2===r?(e.consume(t),F):60===t&&1===r?(e.consume(t),x):62===t&&4===r?(e.consume(t),L):63===t&&3===r?(e.consume(t),w):93===t&&5===r?(e.consume(t),R):!We(t)||6!==r&&7!==r?null===t||We(t)?N(t):(e.consume(t),D):e.check(Mt,L,N)(t)}function N(t){return e.exit("htmlFlowData"),S(t)}function S(t){return null===t?M(t):We(t)?e.attempt({tokenize:O,partial:!0},S,M)(t):(e.enter("htmlFlowData"),D(t))}function O(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r};function r(e){return s.parser.lazy[s.now().line]?n(e):t(e)}}function F(t){return 45===t?(e.consume(t),w):D(t)}function x(t){return 47===t?(e.consume(t),o="",I):D(t)}function I(t){return 62===t&&wt.includes(o.toLowerCase())?(e.consume(t),L):Ue(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),I):D(t)}function R(t){return 93===t?(e.consume(t),w):D(t)}function w(t){return 62===t?(e.consume(t),L):45===t&&2===r?(e.consume(t),w):D(t)}function L(t){return null===t||We(t)?(e.exit("htmlFlowData"),M(t)):(e.consume(t),L)}function M(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){var t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},Mt={tokenize:function(e,t,n){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(rt,t,n)}},partial:!0};var Pt={name:"codeFenced",tokenize:function(e,t,n){var r,i=this,o={tokenize:function(e,t,n){var i=0;return Je(e,o,"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}function a(t){return t===r?(e.consume(t),i++,a):i1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;var f=Object.assign({},e[n][1].end),p=Object.assign({},e[c][1].start);Vt(f,-u),Vt(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[n][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[c][1].start),end:p},i={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[c][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[n][1].end=Object.assign({},o.start),e[c][1].start=Object.assign({},a.end),s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=Le(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=Le(s,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),s=Le(s,mt(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=Le(s,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,s=Le(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):l=0,we(e,n-1,c-n+3,s),c=n+s.length-l-2;break}c=-1;for(;++c13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535===(65535&n)||65534===(65535&n)||n>1114111?"\ufffd":String.fromCharCode(n)}var gn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vn(e){return e.replace(gn,An)}function An(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){var r=n.charCodeAt(1),i=120===r||88===r;return Tn(n.slice(i?2:1),i?16:10)}return(0,Bt.T)(n)||e}var yn={}.hasOwnProperty,Cn=function(e,t,n){return"string"!==typeof t&&(n=t,t=void 0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_n({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ie),autolinkProtocol:S,autolinkEmail:S,atxHeading:s(J),blockQuote:s(W),characterEscape:S,characterReference:S,codeFenced:s(V),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(V,l),codeText:s(q,l),codeTextData:S,data:S,codeFlowValue:S,definition:s(X),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s($),hardBreakEscape:s(te),hardBreakTrailing:s(te),htmlFlow:s(ne,l),htmlFlowData:S,htmlText:s(ne,l),htmlTextData:S,image:s(re),label:l,link:s(ie),listItem:s(ae),listItemValue:m,listOrdered:s(oe,d),listUnordered:s(oe),paragraph:s(ue),reference:G,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(J),strong:s(se),thematicBreak:s(ce)},exit:{atxHeading:f(),atxHeadingSequence:k,autolink:f(),autolinkEmail:Q,autolinkProtocol:Z,blockQuote:f(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:Y,codeFenced:f(v),codeFencedFence:g,codeFencedFenceInfo:E,codeFencedFenceMeta:T,codeFlowValue:O,codeIndented:f(A),codeText:f(w),codeTextData:O,data:O,definition:f(),definitionDestinationString:_,definitionLabelString:y,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(x),hardBreakTrailing:f(x),htmlFlow:f(I),htmlFlowData:O,htmlText:f(R),htmlTextData:O,image:f(M),label:B,labelText:P,lineEnding:F,link:f(L),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:K,resourceDestinationString:H,resourceTitleString:U,resource:j,setextHeading:f(N),setextHeadingLineSequence:D,setextHeadingText:b,strong:f(),thematicBreak:f()}},e.mdastExtensions||[]),n={};return r;function r(e){for(var n={type:"root",children:[]},r=[],s=[],f={stack:[n],tokenStack:r,config:t,enter:c,exit:p,buffer:l,resume:h,setData:o,getData:a},d=-1;++d0){var E=r[r.length-1];(E[1]||bn).call(f,void 0,E[0])}for(n.position={start:u(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:u(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d0&&void 0!==arguments[0]?arguments[0]:{}).extensions||[])),content:t(et),document:t(tt),flow:t(st),string:t(ct),text:t(ft)};return e;function t(t){return function(n){return Et(e,t,n)}}}(n).document().write(function(){var e,t=1,n="",r=!0;return function(i,o,a){var u,s,l,c,f,p=[];for(i=n+i.toString(o),l=0,n="",r&&(65279===i.charCodeAt(0)&&l++,r=void 0);l":"")+")"}));return f;function f(){var l,c,f,p=[];if((!t||i(a,u,s[s.length-1]||null))&&(p=function(e){if(Array.isArray(e))return e;if("number"===typeof e)return[true,e];return[e]}(n(a,s)),p[0]===Rn))return p;if(a.children&&p[0]!==In)for(c=(r?a.children.length:-1)+o,f=s.concat(a);c>-1&&c-1?n.offset:null}}}var Hn={}.hasOwnProperty;function Un(e){return String(e||"").toUpperCase()}var jn={}.hasOwnProperty;function Gn(e,t){var n=t.data||{};return"value"in t&&!(jn.call(n,"hName")||jn.call(n,"hProperties")||jn.call(n,"hChildren"))?e.augment(t,Nn("text",t.value)):e(t,"div",Yn(e,t))}function Kn(e,t,n){var r,i=t&&t.type;if(!i)throw new Error("Expected node, got `"+t+"`");return("function"===typeof(r=jn.call(e.handlers,i)?e.handlers[i]:e.passThrough&&e.passThrough.includes(i)?zn:e.unknownHandler)?r:Gn)(e,t,n)}function zn(e,t){return"children"in t?$($({},t),{},{children:Yn(e,t)}):t}function Yn(e,t){var n=[];if("children"in t)for(var r=t.children,i=-1;++i":"gt"};function Qn(e,t){var n=function(e){return e.replace(/["&<>]/g,(function(e){return"&"+Zn[e]+";"}))}(function(e){var t=[],n=-1,r=0,i=0;for(;++n55295&&o<57344){var u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(a=String.fromCharCode(o,u),i=1):a="\ufffd"}else a=String.fromCharCode(o);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)}(e||""));if(!t)return n;var r=n.indexOf(":"),i=n.indexOf("?"),o=n.indexOf("#"),a=n.indexOf("/");return r<0||a>-1&&r>a||i>-1&&r>i||o>-1&&r>o||t.test(n.slice(0,r))?n:""}function Wn(e,t){var n=[],r=-1;for(t&&n.push(Nn("text","\n"));++r0&&n.push(Nn("text","\n")),n}function Vn(e,t){var n,r=String(t.identifier),i=Qn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);-1===o?(e.footnoteOrder.push(r),e.footnoteCounts[r]=1,n=e.footnoteOrder.length):(e.footnoteCounts[r]++,n=o+1);var a=e.footnoteCounts[r];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+i,id:e.clobberPrefix+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[Nn("text",String(n))])])}var qn=n(9930);function Xn(e,t){var n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return Nn("text","!["+t.alt+r);var i=Yn(e,t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift(Nn("text","["));var a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push(Nn("text",r)),i}function $n(e){var t=e.spread;return void 0===t||null===t?e.children.length>1:t}function Jn(e,t,n){var r=0,i=e.length;if(t)for(var o=e.codePointAt(r);9===o||32===o;)r++,o=e.codePointAt(r);if(n)for(var a=e.codePointAt(i-1);9===a||32===a;)i--,a=e.codePointAt(i-1);return i>r?e.slice(r,i):""}var er={blockquote:function(e,t){return e(t,"blockquote",Wn(Yn(e,t),!0))},break:function(e,t){return[e(t,"br"),Nn("text","\n")]},code:function(e,t){var n=t.value?t.value+"\n":"",r=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),i={};r&&(i.className=["language-"+r]);var o=e(t,"code",i,[Nn("text",n)]);return t.meta&&(o.data={meta:t.meta}),e(t.position,"pre",[o])},delete:function(e,t){return e(t,"del",Yn(e,t))},emphasis:function(e,t){return e(t,"em",Yn(e,t))},footnoteReference:Vn,footnote:function(e,t){for(var n=e.footnoteById,r=1;r in n;)r++;var i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},Vn(e,{type:"footnoteReference",identifier:i,position:t.position})},heading:function(e,t){return e(t,"h"+t.depth,Yn(e,t))},html:function(e,t){return e.dangerous?e.augment(t,Nn("raw",t.value)):null},imageReference:function(e,t){var n=e.definition(t.identifier);if(!n)return Xn(e,t);var r={src:qn(n.url||""),alt:t.alt};return null!==n.title&&void 0!==n.title&&(r.title=n.title),e(t,"img",r)},image:function(e,t){var n={src:qn(t.url),alt:t.alt};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"img",n)},inlineCode:function(e,t){return e(t,"code",[Nn("text",t.value.replace(/\r?\n|\r/g," "))])},linkReference:function(e,t){var n=e.definition(t.identifier);if(!n)return Xn(e,t);var r={href:qn(n.url||"")};return null!==n.title&&void 0!==n.title&&(r.title=n.title),e(t,"a",r,Yn(e,t))},link:function(e,t){var n={href:qn(t.url)};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"a",n,Yn(e,t))},listItem:function(e,t,n){var r,i=Yn(e,t),o=n?function(e){var t=e.spread,n=e.children,r=-1;for(;!t&&++r0&&r.children.unshift(Nn("text"," ")),r.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),a.className=["task-list-item"]);for(var s=-1;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Jn(t.slice(i),i>0,!1)),o.join("")}(String(t.value))))},thematicBreak:function(e,t){return e(t,"hr")},toml:tr,yaml:tr,definition:tr,footnoteDefinition:tr};function tr(){return null}var nr={}.hasOwnProperty;function rr(e,t){var n=t||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=void 0===n.clobberPrefix||null===n.clobberPrefix?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.definition=function(e){var t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Ln(e,"definition",(function(e){var n=Un(e.identifier);n&&!Hn.call(t,n)&&(t[n]=e)})),function(e){var n=Un(e);return n&&Hn.call(t,n)?t[n]:null}}(e),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.augment=o,a.handlers=$($({},er),n.handlers),a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,Ln(e,"footnoteDefinition",(function(e){var t=String(e.identifier).toUpperCase();nr.call(i,t)||(i[t]=e)})),a;function o(e,t){if(e&&"data"in e&&e.data){var n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties=$($({},t.properties),n.hProperties)),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){var r="type"in e?e:{position:e};(i=r)&&i.position&&i.position.start&&i.position.start.line&&i.position.start.column&&i.position.end&&i.position.end.line&&i.position.end.column&&(t.position={start:Mn(r),end:Pn(r)})}var i;return t}function a(e,t,n,r){return Array.isArray(n)&&(r=n,n={}),o(e,{type:"element",tagName:t,properties:n||{},children:r||[]})}}function ir(e,t){var n=rr(e,t),r=Kn(n,e,null),i=function(e){for(var t=-1,n=[];++t1?"-"+u:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"\u21a9"}]};u>1&&l.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(u)}]}),s.length>0&&s.push({type:"text",value:" "}),s.push(l)}var c=i[i.length-1];if(c&&"element"===c.type&&"p"===c.tagName){var f,p=c.children[c.children.length-1];p&&"text"===p.type?p.value+=" ":c.children.push({type:"text",value:" "}),(f=c.children).push.apply(f,s)}else i.push.apply(i,s);var h={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:Wn(i,!0)};r.position&&(h.position=r.position),n.push(h)}}return 0===n.length?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:$($({},JSON.parse(JSON.stringify(e.footnoteLabelProperties))),{},{id:"footnote-label"}),children:[Nn("text",e.footnoteLabel)]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:Wn(n,!0)},{type:"text",value:"\n"}]}}(n);return i&&r.children.push(Nn("text","\n"),i),Array.isArray(r)?{type:"root",children:r}:r}var or=function(e,t){return e&&"run"in e?function(e,t){return function(n,r,i){e.run(ir(n,t),r,(function(e){i(e)}))}}(e,t):function(e){return function(t){return ir(t,e)}}(e||t)};var ar=n(4808),ur=n(2925);function sr(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return function(t){Ln(t,"element",(function(t,n,r){var i,o=r;if(e.allowedElements?i=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(i=e.disallowedElements.includes(t.tagName)),!i&&e.allowElement&&"number"===typeof n&&(i=!e.allowElement(t,n,o)),i&&"number"===typeof n){var a;if(e.unwrapDisallowed&&t.children)(a=o.children).splice.apply(a,[n,1].concat((0,f.Z)(t.children)));else o.children.splice(n,1);return n}}))}}var lr=["http","https","mailto","tel"];var cr=n(8428);function fr(e){var t=e&&"object"===typeof e&&"text"===e.type?e.value||"":e;return"string"===typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}var pr=n(316),hr={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"},dr=n(1642),mr=n(6991),Er=n(821),Tr={}.hasOwnProperty,gr=new Set(["table","thead","tbody","tfoot","tr"]);function vr(e,t){for(var n,r=[],i=-1;++i0?s.createElement(d,l,f):s.createElement(d,l)}function yr(e,t){for(var n=-1,r=0;++n for more info)")),delete br[t]}var r=Ce().use(Dn).use(e.remarkPlugins||[]).use(or,$($({},e.remarkRehypeOptions),{},{allowDangerousHtml:!0})).use(e.rehypePlugins||[]).use(sr,e),i=new pe;"string"===typeof e.children?i.value=e.children:void 0!==e.children&&null!==e.children&&console.warn("[react-markdown] Warning: please pass a string as `children` (not: `".concat(e.children,"`)"));var o=r.runSync(r.parse(i),i);if("root"!==o.type)throw new TypeError("Expected a `root` node");var a=s.createElement(s.Fragment,{},vr({options:e,schema:ur.dy,listDepth:0},o));return e.className&&(a=s.createElement("div",{className:e.className},a)),a}Dr.defaultProps={transformLinkUri:function(e){var t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;var r=t.indexOf(":");if(-1===r)return t;for(var i=-1;++ii||-1!==(i=t.indexOf("#"))&&r>i?t:"javascript:void(0)"}},Dr.propTypes={children:ar.string,className:ar.string,allowElement:ar.func,allowedElements:ar.arrayOf(ar.string),disallowedElements:ar.arrayOf(ar.string),unwrapDisallowed:ar.bool,remarkPlugins:ar.arrayOf(ar.oneOfType([ar.object,ar.func,ar.arrayOf(ar.oneOfType([ar.bool,ar.string,ar.object,ar.func,ar.arrayOf(ar.any)]))])),rehypePlugins:ar.arrayOf(ar.oneOfType([ar.object,ar.func,ar.arrayOf(ar.oneOfType([ar.bool,ar.string,ar.object,ar.func,ar.arrayOf(ar.any)]))])),sourcePos:ar.bool,rawSourcePos:ar.bool,skipHtml:ar.bool,includeElementIndex:ar.bool,transformLinkUri:ar.oneOfType([ar.func,ar.bool]),linkTarget:ar.oneOfType([ar.func,ar.string]),transformImageUri:ar.func,components:ar.object};for(var Nr={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(t){return 87===t||119===t?(e.consume(t),i):n(t)}function i(t){return 87===t||119===t?(e.consume(t),o):n(t)}function o(t){return 46===t?(e.consume(t),a):n(t)}function a(e){return null===e||We(e)?n(e):t(e)}},partial:!0},Sr={tokenize:function(e,t,n){var r,i;return o;function o(t){return 38===t?e.check(xr,u,a)(t):46===t||95===t?e.check(Fr,u,a)(t):null===t||Ze(t)||qe(t)||45!==t&&Xe(t)?u(t):(e.consume(t),o)}function a(t){return 46===t?(i=r,r=void 0,e.consume(t),o):(95===t&&(r=!0),e.consume(t),o)}function u(e){return i||r?n(e):t(e)}},partial:!0},Or={tokenize:function(e,t){var n=0;return r;function r(a){return 38===a?e.check(xr,t,i)(a):(40===a&&n++,41===a?e.check(Fr,o,i)(a):Hr(a)?t(a):Br(a)?e.check(Fr,t,i)(a):(e.consume(a),r))}function i(t){return e.consume(t),r}function o(e){return--n<0?t(e):i(e)}},partial:!0},Fr={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(i){return Br(i)?(e.consume(i),r):Hr(i)?t(i):n(i)}},partial:!0},xr={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(t){return Ue(t)?(e.consume(t),r):59===t?(e.consume(t),i):n(t)}function i(e){return Hr(e)?t(e):n(e)}},partial:!0},Ir={tokenize:function(e,t,n){var r=this;return function(t){if(87!==t&&119!==t||!jr(r.previous)||zr(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Nr,e.attempt(Sr,e.attempt(Or,i),n),n)(t)};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:jr},Rr={tokenize:function(e,t,n){var r=this;return function(t){if(72!==t&&104!==t||!Gr(r.previous)||zr(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(t),i};function i(t){return 84===t||116===t?(e.consume(t),o):n(t)}function o(t){return 84===t||116===t?(e.consume(t),a):n(t)}function a(t){return 80===t||112===t?(e.consume(t),u):n(t)}function u(t){return 83===t||115===t?(e.consume(t),s):s(t)}function s(t){return 58===t?(e.consume(t),l):n(t)}function l(t){return 47===t?(e.consume(t),c):n(t)}function c(t){return 47===t?(e.consume(t),f):n(t)}function f(t){return null===t||Ze(t)||qe(t)||Xe(t)?n(t):e.attempt(Sr,e.attempt(Or,p),n)(t)}function p(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Gr},wr={tokenize:function(e,t,n){var r,i,o=this;return function(t){if(!Ur(t)||!Kr(o.previous)||zr(o.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return Ur(t)?(e.consume(t),a):64===t?(e.consume(t),u):n(t)}function u(t){return 46===t?e.check(Fr,f,s)(t):45===t||95===t?e.check(Fr,n,l)(t):Ke(t)?(!i&&je(t)&&(i=!0),e.consume(t),u):f(t)}function s(t){return e.consume(t),r=!0,i=void 0,u}function l(t){return e.consume(t),c}function c(t){return 46===t?e.check(Fr,n,s)(t):u(t)}function f(o){return r&&!i?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(o)):n(o)}},previous:Kr},Lr={},Mr={text:Lr},Pr=48;Pr<123;)Lr[Pr]=wr,58===++Pr?Pr=65:91===Pr&&(Pr=97);function Br(e){return 33===e||34===e||39===e||41===e||42===e||44===e||46===e||58===e||59===e||60===e||63===e||95===e||126===e}function Hr(e){return null===e||60===e||Qe(e)}function Ur(e){return 43===e||45===e||46===e||95===e||Ke(e)}function jr(e){return null===e||40===e||42===e||95===e||126===e||Qe(e)}function Gr(e){return null===e||!Ue(e)}function Kr(e){return 47!==e&&Gr(e)}function zr(e){for(var t=e.length,n=!1;t--;){var r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Lr[43]=wr,Lr[45]=wr,Lr[46]=wr,Lr[95]=wr,Lr[72]=[wr,Rr],Lr[104]=[wr,Rr],Lr[87]=[wr,Ir],Lr[119]=[wr,Ir];var Yr={tokenize:function(e,t,n){var r=this;return Je(e,(function(e){var i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function Zr(){var e;return{document:q({},91,{tokenize:qr,continuation:{tokenize:Xr},exit:$r}),text:(e={},q(e,91,{tokenize:Vr}),q(e,93,{add:"after",tokenize:Qr,resolveTo:Wr}),e)}}function Qr(e,t,n){for(var r,i=this,o=i.events.length,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);o--;){var u=i.events[o][1];if("labelImage"===u.type){r=u;break}if("gfmFootnoteCall"===u.type||"labelLink"===u.type||"label"===u.type||"image"===u.type||"link"===u.type)break}return function(o){if(!r||!r._balanced)return n(o);var u=Dt(i.sliceSerialize({start:r.end,end:i.now()}));if(94!==u.charCodeAt(0)||!a.includes(u.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function Wr(e,t){for(var n=e.length;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";var 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++;var o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice.apply(e,[n,e.length-n+1].concat(u)),e}function Vr(e,t,n){var r,i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),u};function u(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(u){var c;return null===u||91===u||a++>999?n(u):93===u?r?(e.exit("chunkString"),c=e.exit("gfmFootnoteCallString"),o.includes(Dt(i.sliceSerialize(c)))?function(n){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(n),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}(u):n(u)):n(u):(e.consume(u),Qe(u)||(r=!0),92===u?l:s)}function l(t){return 91===t||92===t||93===t?(e.consume(t),a++,s):s(t)}}function qr(e,t,n){var r,i,o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),u=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),l):n(t)}function l(t){var a;return null===t||91===t||u>999?n(t):93===t?i?(a=e.exit("gfmFootnoteDefinitionLabelString"),r=Dt(o.sliceSerialize(a)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p):n(t):We(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u++,l):(e.enter("chunkString").contentType="string",c(t))}function c(t){return null===t||We(t)||91===t||93===t||u>999?(e.exit("chunkString"),l(t)):(Qe(t)||(i=!0),u++,e.consume(t),92===t?f:c)}function f(t){return 91===t||92===t||93===t?(e.consume(t),u++,c):c(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),Je(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return a.includes(r)||a.push(r),t(e)}}function Xr(e,t,n){return e.check(rt,t,e.attempt(Yr,t,n))}function $r(e){e.exit("gfmFootnoteDefinition")}function Jr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.singleTilde,n={tokenize:i,resolveAll:r};return null!==t&&void 0!==t||(t=!0),{text:q({},126,n),insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){for(var n=-1;++n1?r(o):(e.consume(o),a++,u);if(a<2&&!t)return r(o);var l=e.exit("strikethroughSequenceTemporary"),c=Qt(o);return l._open=!c||2===c&&Boolean(s),l._close=!s||2===s&&Boolean(c),n(o)}}}var ei={flow:{null:{tokenize:function(e,t,n){var r,i,o=this,a=[],u=0;return function(t){if(e.enter("table")._align=a,e.enter("tableHead"),e.enter("tableRow"),124===t)return s(t);return u++,e.enter("temporaryTableCellContent"),f(t)};function s(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l}function l(t){return null===t||We(t)?function(t){if(null===t)return n(t);e.exit("tableRow"),e.exit("tableHead");var r=o.interrupt;return o.interrupt=!0,e.attempt({tokenize:S,partial:!0},(function(t){return o.interrupt=r,e.enter("tableDelimiterRow"),h(t)}),(function(e){return o.interrupt=r,n(e)}))(t)}(t):Ve(t)?(e.enter("whitespace"),e.consume(t),c):(r&&(r=void 0,u++),124===t?s(t):(e.enter("temporaryTableCellContent"),f(t)))}function c(t){return Ve(t)?(e.consume(t),c):(e.exit("whitespace"),l(t))}function f(t){return null===t||124===t||Qe(t)?(e.exit("temporaryTableCellContent"),l(t)):(e.consume(t),92===t?p:f)}function p(t){return 92===t||124===t?(e.consume(t),f):f(t)}function h(t){return null===t||We(t)?g(t):Ve(t)?(e.enter("whitespace"),e.consume(t),d):45===t?(e.enter("tableDelimiterFiller"),e.consume(t),i=!0,a.push("none"),m):58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),a.push("left"),E):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):n(t)}function d(t){return Ve(t)?(e.consume(t),d):(e.exit("whitespace"),h(t))}function m(t){return 45===t?(e.consume(t),m):(e.exit("tableDelimiterFiller"),58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),a[a.length-1]="left"===a[a.length-1]?"center":"right",T):h(t))}function E(t){return 45===t?(e.enter("tableDelimiterFiller"),e.consume(t),i=!0,m):n(t)}function T(t){return null===t||We(t)?g(t):Ve(t)?(e.enter("whitespace"),e.consume(t),d):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):n(t)}function g(t){return e.exit("tableDelimiterRow"),i&&u===a.length?null===t?v(t):e.check(ti,v,e.attempt({tokenize:S,partial:!0},Je(e,A,"linePrefix",4),v))(t):n(t)}function v(n){return e.exit("table"),t(n)}function A(t){return e.enter("tableBody"),y(t)}function y(t){return e.enter("tableRow"),124===t?C(t):(e.enter("temporaryTableCellContent"),b(t))}function C(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),_}function _(t){return null===t||We(t)?function(t){if(e.exit("tableRow"),null===t)return N(t);return e.check(ti,N,e.attempt({tokenize:S,partial:!0},Je(e,y,"linePrefix",4),N))(t)}(t):Ve(t)?(e.enter("whitespace"),e.consume(t),k):124===t?C(t):(e.enter("temporaryTableCellContent"),b(t))}function k(t){return Ve(t)?(e.consume(t),k):(e.exit("whitespace"),_(t))}function b(t){return null===t||124===t||Qe(t)?(e.exit("temporaryTableCellContent"),_(t)):(e.consume(t),92===t?D:b)}function D(t){return 92===t||124===t?(e.consume(t),b):b(t)}function N(t){return e.exit("tableBody"),v(t)}function S(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Je(e,r,"linePrefix")};function r(r){if(o.parser.lazy[o.now().line]||null===r||We(r))return n(r);var i=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?n(r):(o._gfmTableDynamicInterruptHack=!0,e.check(o.parser.constructs.flow,(function(e){return o._gfmTableDynamicInterruptHack=!1,n(e)}),(function(e){return o._gfmTableDynamicInterruptHack=!1,t(e)}))(r))}}},resolve:function(e,t){var n,r,i,o,a,u,s,l=-1;for(;++l0?{type:"text",value:m}:void 0),!1!==m){var E;if(a!==n&&p.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(m))(E=p).push.apply(E,(0,f.Z)(m));else m&&p.push(m);a=n+h[0].length,c=!0}if(!i.global)break;h=i.exec(e.value)}if(c){var T;a?\]}]+$/.exec(e);if(o)for(e=e.slice(0,o.index),t=(i=o[0]).indexOf(")"),n=ai(e,"("),r=ai(e,")");-1!==t&&n>r;)e+=i.slice(0,t+1),t=(i=i.slice(t+1)).indexOf(")"),r++;return[e,i]}(n+r);if(!a[0])return!1;var u={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function Ti(e,t,n,r){return!(!gi(r,!0)||/[_-\d]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function gi(e,t){var n=e.input.charCodeAt(e.index-1);return(0===e.index||qe(n)||Xe(n))&&(!t||47!==n)}function vi(e){return e.label||!e.identifier?e.label||"":vn(e.identifier)}function Ai(e){var t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(/\r?\n|\r/g),n=t[t.length-1];return i+=t.length-1,o=1===t.length?o+n.length:1+n.length+r,e},current:function(){return{now:{line:i,column:o},lineShift:r}},shift:function(e){r+=e}}}function yi(e,t,n){var r=t.indexStack,i=e.children||[],o=Ai(n),a=[],u=-1;for(r.push(-1);++u=m||(E+10?" ":"")),i.shift(4),o+=i.move(_i(yi(e,n,i.current()),(function(e,t,n){if(t)return(n?"":" ")+e;return e}))),a(),o},footnoteReference:e}};function e(e,t,n,r){var i=Ai(r),o=i.move("[^"),a=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(Ni(n,vi(e),$($({},i.current()),{},{before:o,after:"]"}))),u(),a(),o+=i.move("]")}}function xi(e,t,n){var r=t.indexStack,i=e.children||[],o=[],a=-1,u=n.before;r.push(-1);for(var s=Ai(n);++a0&&("\r"===u||"\n"===u)&&"html"===l.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),u=" ",(s=Ai(n)).move(o.join(""))),o.push(s.move(t.handle(l,e,t,$($({},s.current()),{},{before:u,after:c})))),u=o[o.length-1].slice(-1)}return r.pop(),o.join("")}var Ii={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},Ri={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:wi}};function wi(e,t,n,r){var i=Ai(r),o=n.enter("emphasis"),a=i.move("~~");return a+=xi(e,n,$($({},i.current()),{},{before:a,after:"~"})),a+=i.move("~~"),o(),a}function Li(e,t,n){for(var r=e.value||"",i="`",o=-1;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o1&&void 0!==arguments[1]?arguments[1]:{},n=(t.align||[]).concat(),r=t.stringLength||Pi,i=[],o=[],a=[],u=[],s=0,l=-1;++ls&&(s=e[l].length);++pu[p])&&(u[p]=d)}c.push(h)}o[l]=c,a[l]=f}var m=-1;if("object"===typeof n&&"length"in n)for(;++mu[m]&&(u[m]=C),g[m]=C),T[m]=_}o.splice(1,0,T),a.splice(1,0,g),l=-1;for(var k=[];++l-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);var a=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));var u=Ai(r);u.move(o+" ".repeat(a-o.length)),u.shift(a);var s=n.enter("listItem"),l=_i(yi(e,n,u.current()),(function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?o:o+" ".repeat(a-o.length))+e}));return s(),l}var Yi={exit:{taskListCheckValueChecked:Qi,taskListCheckValueUnchecked:Qi,paragraph:function(e){var t,n=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],i=n.children,o=r.children[0],a=-1;if(n&&"listItem"===n.type&&"boolean"===typeof n.checked&&o&&"text"===o.type){for(;++a0&&void 0!==arguments[0]?arguments[0]:{},t=this.data();function n(e,n){(t[e]?t[e]:t[e]=[]).push(n)}n("micromarkExtensions",oi(e)),n("fromMarkdownExtensions",Wi()),n("toMarkdownExtensions",Vi(e))}var Xi=n(2186),$i={}.hasOwnProperty;function Ji(e,t){var n=t&&e&&"object"===typeof e&&"element"===e.type&&e.properties&&$i.call(e.properties,t)&&e.properties[t];return null!==n&&void 0!==n&&!1!==n}function eo(e){var t=e&&"element"===e.type&&e.tagName.toLowerCase()||"",n=2===t.length&&104===t.charCodeAt(0)?t.charCodeAt(1):0;return n>48&&n<55?n-48:null}function to(e){return"children"in e?ro(e):"value"in e?e.value:""}function no(e){return"text"===e.type?e.value:"children"in e?ro(e):""}function ro(e){for(var t=-1,n=[];++t1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{},n=t.properties,r=t.behaviour||t.behavior||"prepend",i=t.content||fo,o=t.group,a=uo(t.test);return"wrap"===r?e=l:"before"===r||"after"===r?e=s:(n||(n={ariaHidden:"true",tabIndex:-1}),e=u),function(t){Ln(t,"element",(function(t,n,r){if(eo(t)&&Ji(t,"id")&&a(t,n,r))return e(t,n,r)}))};function u(e){return e.children["prepend"===r?"unshift":"push"](h(e,ve(!0,{},n),c(i,e))),[In]}function s(e,t,a){var u;if("number"===typeof t&&a){var s=h(e,ve(!0,{},n),c(i,e)),l="before"===r?[s,e]:[e,s];if(o){var d=p(o,e);d&&!Array.isArray(d)&&"element"===d.type&&(d.children=l,l=[d])}return(u=a.children).splice.apply(u,[t,1].concat((0,f.Z)(l))),[In,t+l.length]}}function l(e){return e.children=[h(e,ve(!0,{},n),e.children)],[In]}function c(e,t){var n=p(e,t);return Array.isArray(n)?n:[n]}function p(e,t){return"function"===typeof e?e(t):ve(!0,Array.isArray(e)?[]:{},e)}function h(e,t,n){return{type:"element",tagName:"a",properties:Object.assign({},t,{href:"#"+(e.properties||{}).id}),children:n}}}var ho=n(3854),mo=(0,n(7780).v)(ur.YP,"g",["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"]),Eo=n(6350);var To={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/"},go={}.hasOwnProperty,vo={"#document":yo,"#document-fragment":yo,"#text":function(e,t){return{type:"text",value:t.value}},"#comment":function(e,t){return{type:"comment",value:t.data}},"#documentType":function(){return{type:"doctype"}}};function Ao(e,t){var n,r=e.schema,i=go.call(vo,t.nodeName)?vo[t.nodeName]:Co;"tagName"in t&&(e.schema=t.namespaceURI===To.svg?ur.YP:ur.dy),"childNodes"in t&&(n=function(e,t){var n=-1,r=[];for(;++n-1&&ee)return{line:t+1,column:e-(n[t-1]||0)+1,offset:e};return{line:void 0,column:void 0,offset:void 0}},toOffset:function(e){var t,r=e&&e.line,i=e&&e.column;return"number"!==typeof r||"number"!==typeof i||Number.isNaN(r)||Number.isNaN(i)||!(r-1 in n)||(t=(n[r-2]||0)+i-1||0),t>-1&&t0?e.call(t,a,u,s):e.call(t,a,u)}function wo(e,t,n,r,i){var o,a=(0,pr.s)(r.schema,t);void 0===n||null===n||"number"===typeof n&&Number.isNaN(n)||!1===n&&(r.vue||r.vdom||r.hyperscript)||!n&&a.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=a.commaSeparated?(0,mr.P)(n):(0,dr.P)(n)),a.boolean&&r.hyperscript&&(n=""),"style"===a.property&&"string"===typeof n&&(r.react||r.vue||r.vdom)&&(n=function(e,t){var n={};try{Er(e,(function(e,t){"-ms-"===e.slice(0,4)&&(e="ms-"+e.slice(4)),n[e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))]=t}))}catch(r){throw r.message=t+"[style]"+r.message.slice("undefined".length),r}return n}(n,i)),r.vue?"style"!==a.property&&(o="attrs"):a.mustUseProperty||(r.vdom?"style"!==a.property&&(o="attributes"):r.hyperscript&&(o="attrs")),o?e[o]=Object.assign(e[o]||{},q({},a.attribute,n)):a.space&&r.react?e[No[a.property]||a.property]=n:e[a.attribute]=n)}function Lo(e){return"context"in e&&"cleanup"in e}var Mo={}.hasOwnProperty;function Po(e,t){var n=t||{};function r(t){var n=r.invalid,i=r.handlers;if(t&&Mo.call(t,e)&&(n=Mo.call(i,t[e])?i[t[e]]:r.unknown),n)return n.apply(this,arguments)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Bo={}.hasOwnProperty,Ho=Po("type",{handlers:{root:function(e,t){var n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Uo(e.children,n,t),jo(e,n)},element:function(e,t){var n=t.space;return Io((function(n,r){var i,o,a,u,s,l=[];for(a in r)Bo.call(r,a)&&!1!==r[a]&&((i=(0,pr.s)(t,a)).boolean&&!r[a]||(o={name:a,value:!0===r[a]?"":String(r[a])},i.space&&"html"!==i.space&&"svg"!==i.space&&((u=a.indexOf(":"))<0?o.prefix="":(o.name=a.slice(u+1),o.prefix=a.slice(0,u)),o.namespace=To[i.space]),l.push(o)));"html"===t.space&&"svg"===e.tagName&&(t=ur.YP);(s=jo(e,{nodeName:n,tagName:n,attrs:l,namespaceURI:To[t.space],childNodes:[],parentNode:void 0})).childNodes=Uo(e.children,s,t),"template"===n&&(s.content=function(e,t){var n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Uo(e.children,n,t),jo(e,n)}(e.content,t));return s}),Object.assign({},e,{children:[]}),{space:n})},text:function(e){return jo(e,{nodeName:"#text",value:e.value,parentNode:void 0})},comment:function(e){return jo(e,{nodeName:"#comment",data:e.value,parentNode:void 0})},doctype:function(e){return jo(e,{nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:void 0})}}});function Uo(e,t,n){var r,i=-1,o=[];if(e)for(;++i1&&void 0!==arguments[1]?arguments[1]:{};return bo(r)?(n=r,t={}):(n=r.file,t=r),Ao({schema:"svg"===t.space?ur.YP:ur.dy,file:n,verbose:t.verbose,location:!1},e)}(function(e){var t="root"===e.type?e.children[0]:e;return Boolean(t&&("doctype"===t.type||"element"===t.type&&"html"===t.tagName))}(t)?function(){var e=f.treeAdapter.createDocument();if(f._bootstrap(e,void 0),!(o=f.tokenizer))throw new Error("Expected `tokenizer`");return a=o.preprocessor,s=o.__mixins[0],u=s.posTracker,p(t),T(),e}():function(){var e={nodeName:"template",tagName:"template",attrs:[],namespaceURI:To.html,childNodes:[]},n={nodeName:"documentmock",tagName:"documentmock",attrs:[],namespaceURI:To.html,childNodes:[]},r={nodeName:"#document-fragment",childNodes:[]};if(f._bootstrap(n,e),f._pushTmplInsertionMode("IN_TEMPLATE_MODE"),f._initTokenizerForFragmentParsing(),f._insertFakeRootElement(),f._resetInsertionMode(),f._findFormInFragmentContext(),!(o=f.tokenizer))throw new Error("Expected `tokenizer`");return a=o.preprocessor,s=o.__mixins[0],u=s.posTracker,p(t),T(),f._adoptNodes(n.childNodes[0],r),r}(),n);return i&&Ln(h,"comment",(function(e,t,n){var r=e;if(r.value.stitch&&null!==n&&null!==t)return n.children[t]=r.value.stitch,t})),"root"!==t.type&&"root"===h.type&&1===h.children.length?h.children[0]:h;function d(e){var t=-1;if(e)for(;++t0&&void 0!==arguments[0]?arguments[0]:{};return function(t,n){return Yo(t,n,e)}}var Xo=function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=n;i1){var i=e.children[0];if(i&&"code"===i.tagName&&"number"===typeof n){var o=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;t>-1;){if(!e[--t])return;if(e[t]&&e[t].value&&""!==e[t].value.replace(/(\n|\s)/g,"")||"text"!==e[t].type){if(!/^rehype:/.test(e[t].value)||"comment"!==e[t].type)return;return e[t]}}}(r.children,n);if(o){var a=$o(o);Object.keys(a).length>0&&(e.properties=$($({},e.properties),{"data-type":"rehyp"}),i.properties=Jo(i.properties,a,t.properties))}}}if(/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(e.tagName)&&r&&Array.isArray(r.children)&&"number"===typeof n){var u=Xo(r.children,n);if(u){var s=$o(u);Object.keys(s).length>0&&(e.properties=Jo(e.properties,s,t.properties))}}}))}},na=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.openDelimiter,n=void 0===t?"rehype:ignore:start":t,r=e.closeDelimiter,i=void 0===r?"rehype:ignore:end":r;return function(e){Ln(e,(function(e,t,r){if("element"===e.type||"root"===e.type){var o=!1;e.children=e.children.filter((function(e){return"comment"===e.type&&e.value.trim()===n?(o=!0,!1):"comment"===e.type&&e.value.trim()===i?(o=!1,!1):!o}))}}))}},ra={}.hasOwnProperty,ia=n(3871),oa=n(6018),aa=n(1998);function ua(){ua=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,i){var o=new RegExp(e,r);return t.set(o,i||t.get(e)),la(o,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){return t[n]=e[r[n]],t}),Object.create(null))}return sa(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);return n&&(n.groups=r(n,this)),n},n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var o=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)>/g,(function(e,t){return"$"+o[t]})))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(r(e,a)),i.apply(this,e)}))}return e[Symbol.replace].call(this,n,i)},ua.apply(this,arguments)}function sa(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&la(e,t)}function la(e,t){return la=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},la(e,t)}function ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var pa=function(e){return function(t){return void 0===t&&(t={}),function(e){Ln(e,"element",n)};function n(n,r,i){if(i&&"pre"===i.tagName&&"code"===n.tagName){var o=n.data&&n.data.meta?n.data.meta:"";n.properties.className?"boolean"==typeof n.properties.className?n.properties.className=[]:Array.isArray(n.properties.className)||(n.properties.className=[n.properties.className]):n.properties.className=[],n.properties.className.push("code-highlight");var a,u,s=function(e){for(var t,n=fa(e.properties.className);!(t=n()).done;){var r=t.value;if("language-"===r.slice(0,9))return r.slice(9).toLowerCase()}return null}(n);if(s)try{var l;l=null!=s&&s.includes("diff-")?s.split("-")[1]:s,a=e.highlight(to(n),l),i.properties.className=(i.properties.className||[]).concat("language-"+l)}catch(T){if(!t.ignoreMissing||!/Unknown language/.test(T.message))throw T;a=n}else a=n;a.children=(u=1,function e(t){return t.reduce((function(t,n){if("text"===n.type){var r=n.value,i=(r.match(/\n/g)||"").length;if(0===i)n.position={start:{line:u,column:1},end:{line:u,column:1}},t.push(n);else for(var o,a=r.split("\n"),s=fa(a.entries());!(o=s()).done;){var l=o.value,c=l[0],f=l[1];t.push({type:"text",value:c===a.length-1?f:f+"\n",position:{start:{line:u+c,column:1},end:{line:u+c,column:1}}})}return u+=i,t}if(Object.prototype.hasOwnProperty.call(n,"children")){var p=u;return n.children=e(n.children),t.push(n),n.position={start:{line:p,column:1},end:{line:u,column:1}},t}return t.push(n),t}),[])})(a.children),a.position=a.children.length>0?{start:{line:a.children[0].position.start.line,column:0},end:{line:a.children[a.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var c,f=function(e){var t=/{([\d,-]+)}/,n=e.split(",").map((function(e){return e.trim()})).join();if(t.test(n)){var r=t.exec(n)[1],i=ia(r);return function(e){return i.includes(e+1)}}return function(){return!1}}(o),p=function(e){var t=ua(/showLineNumbers=([0-9]+)/i,{lines:1});if(t.test(e)){var n=t.exec(e);return Number(n.groups.lines)}return 1}(o),h=function(e){for(var t=new Array(e),n=0;n0&&0===l.length)return null}var c={};for(s in t)ra.call(t,s)&&(c[s]="children"===s?l:t[s]);return c}(e)}(a,(function(e){return e.position.start.line<=n+1&&e.position.end.line>=n+1}));r.children=i.children,!o.toLowerCase().includes("showLineNumbers".toLowerCase())&&!t.showLineNumbers||d.some((function(e){return o.toLowerCase().includes(e)}))||(r.properties.line=[(n+p).toString()],r.properties.className.push("line-number")),f(n)&&r.properties.className.push("highlight-line"),("diff"===s||null!=s&&s.includes("diff-"))&&"-"===to(r).substring(0,1)?r.properties.className.push("deleted"):("diff"===s||null!=s&&s.includes("diff-"))&&"+"===to(r).substring(0,1)&&r.properties.className.push("inserted")},E=fa(h.entries());!(c=E()).done;)m();h.length>0&&""===to(h[h.length-1]).trim()&&h.pop(),n.children=h}}}},ha=(pa(oa.$),pa(aa.$)),da="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",ma=new RegExp("^[^"+da+"]*["+"\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]"),Ea=new RegExp("^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*["+da+"]");var Ta=uo();function ga(e,t){var n,r,i=e.schema,o=e.language,a=e.direction,u=e.editableOrEditingHost;if(Ta(t)&&t.properties){var s=t.properties.xmlLang||t.properties.lang,l=t.properties.type||"text",c=Aa(t);void 0!==s&&null!==s&&(e.language=String(s),r=!0),i&&"html"===i.space?("true"===t.properties.contentEditable&&(e.editableOrEditingHost=!0,r=!0),ao(t,"svg")&&(e.schema=ur.YP,r=!0),"rtl"===c?n=c:"ltr"===c||"auto"!==c&&ao(t,"html")||"auto"!==c&&ao(t,"input")&&"tel"===l?n="ltr":("auto"===c||ao(t,"bdi"))&&(ao(t,"textarea")?n=va(to(t)):!ao(t,"input")||"email"!==l&&"search"!==l&&"tel"!==l&&"text"!==l?Ln(t,(function(e){if("text"===e.type)return(n=va(e.value))?Rn:null;if(e!==t&&(ao(e,["bdi","script","style","textare"])||Aa(e)))return In})):n=t.properties.value?va(t.properties.value):"ltr"),n&&(e.direction=n,r=!0)):e.editableOrEditingHost&&(e.editableOrEditingHost=!1,r=!0)}return r?function(){e.schema=i,e.language=o,e.direction=a,e.editableOrEditingHost=u}:ya}function va(e){var t=function(e){var t=String(e||"");return ma.test(t)?"rtl":Ea.test(t)?"ltr":"neutral"}(e);return"neutral"===t?void 0:t}function Aa(e){var t=Ta(e)&&e.properties&&"string"===typeof e.properties.dir?e.properties.dir.toLowerCase():void 0;return"auto"===t||"ltr"===t||"rtl"===t?t:void 0}function ya(){}var Ca={}.hasOwnProperty,_a=Po("nestingOperator",{unknown:function(e){throw new Error("Unexpected nesting `"+e.nestingOperator+"`")},invalid:function(e,t,n,r,i){if(r||null===n)throw new Error("topScan is supposed to be called from the root node");if(!i.iterator)throw new Error("Expected `iterator`");i.iterator(e,t,n,r,i),i.shallow||ba(e,t,n,r,i)},handlers:{null:ba,">":Da,"+":function(e,t,n,r,i){if(!r||null===n)return;Na(e,r,i,n+1,!0)},"~":function(e,t,n,r,i){if(!r||null===n)return;Na(e,r,i,n+1)}}});function ka(e,t,n,r,i){_a(e,t,n,r,i)}function ba(e,t,n,r,i){var o=i.iterator;i.iterator=function e(t,n,r,i,a){if(!o)throw new Error("Expected `iterator`");if(a.iterator=o,o(t,n,r,i,a),a.iterator=e,a.one&&a.found)return;Da(t,n,r,i,a)},Da(e,t,n,r,i)}function Da(e,t,n,r,i){(function(e){return Array.isArray(e.children)})(t)&&0!==t.children.length&&Na(e,t,i)}function Na(e,t,n,r,i){var o=n.index?function(e,t){var r=u,i=Ca.call(l,e.tagName)?l[e.tagName]:0;d(e.tagName),c.push((function(){n.elementIndex=r,n.typeIndex=i,n.elementCount=u,n.typeCount=l[e.tagName],h(e,t)}))}:h,a=t.children,u=0,s=-1,l={},c=[];if(void 0!==r&&null!==r||(r=0),!(r>=a.length)){if(n.index)for(;++s0;return i.shallow=o,i.one=a,i.scopeElements=u,l},lang:function(e,t,n,r,i){return""!==i.language&&void 0!==i.language&&null!==i.language&&Oa(i.language,(0,mr.Q)(e.value)).length>0},"last-child":function(e,t,n,r,i){return Ba(i,e),Boolean(i.elementCount&&i.elementIndex===i.elementCount-1)},"last-of-type":function(e,t,n,r,i){return Ba(i,e),"number"===typeof i.typeIndex&&"number"===typeof i.typeCount&&i.typeIndex===i.typeCount-1},matches:Ra,not:function(e,t,n,r,i){return!Ra(e,t,n,r,i)},"nth-child":function(e,t,n,r,i){return Ba(i,e),"number"===typeof i.elementIndex&&e.value(i.elementIndex)},"nth-last-child":function(e,t,n,r,i){return Ba(i,e),Boolean("number"===typeof i.elementCount&&"number"===typeof i.elementIndex&&e.value(i.elementCount-i.elementIndex-1))},"nth-of-type":function(e,t,n,r,i){return Ba(i,e),"number"===typeof i.typeIndex&&e.value(i.typeIndex)},"nth-last-of-type":function(e,t,n,r,i){return Ba(i,e),"number"===typeof i.typeCount&&"number"===typeof i.typeIndex&&e.value(i.typeCount-1-i.typeIndex)},"only-child":function(e,t,n,r,i){return Ba(i,e),1===i.elementCount},"only-of-type":function(e,t,n,r,i){return Ba(i,e),1===i.typeCount},optional:function(e,t){return!La(e,t)},"read-only":function(e,t,n,r,i){return!Ma(e,t,n,r,i)},"read-write":Ma,required:La,root:function(e,t,n,r,i){return Boolean((!r||"root"===r.type)&&i.schema&&("html"===i.schema.space||"svg"===i.schema.space)&&ao(t,["html","svg"]))},scope:function(e,t,n,r,i){return Boolean(ao(t)&&i.scopeElements&&i.scopeElements.includes(t))}}});function Ia(e,t,n,r,i){for(var o=e.pseudos,a=-1;++a=n};var r=Math.abs(t),i=(n%r+r)%r;return t>1?function(e){return e>=n&&e%r===i}:function(e){return e<=n&&e%r===i}}(function(e){if("even"===(e=e.trim().toLowerCase()))return[2,0];if("odd"===e)return[2,1];var t=0,n=0,r=o(),i=a();if(t=Va&&e.charCodeAt(t)<=qa;)r=10*r+(e.charCodeAt(t)-Va),t++;return t===n?null:r}function u(){for(;t","+","~");var ou=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.forEach((function(t){"text"===t.type?n+=t.value:"element"===t.type&&t.children&&Array.isArray(t.children)&&(n+=e(t.children))})),n},au=function(e){var t=e||{},n=t.selector,r=t.rewrite;return function(e){if(r&&"function"===typeof r)if(n&&"string"===typeof n){var t=iu(n,e);t&&t.length>0&&Ln(e,t,(function(e,t,n){r(e,t,n)}))}else Ln(e,(function(e,t,n){r(e,t,n)}))}},uu={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]},su=n(6871),lu=n.n(su);var cu=function(e){return void 0===e&&(e={}),function(e){Ln(e,(function(e){"element"===e.type&&"code"===e.tagName&&e.data&&e.data.meta&&(e.properties=l({},e.properties,{"data-meta":String(e.data.meta)}))}))}},fu=["prefixCls","className","source","style","disableCopy","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","warpperElement"],pu=s.forwardRef((function(e,t){var n=e.prefixCls,r=void 0===n?"wmde-markdown wmde-markdown-color":n,i=e.className,o=e.source,a=e.style,u=e.disableCopy,p=void 0!==u&&u,h=e.onScroll,d=e.onMouseOver,m=e.pluginsFilter,E=e.rehypeRewrite,T=e.warpperElement,g=void 0===T?{}:T,v=c(e,fu),A=s.createRef();(0,s.useImperativeHandle)(t,(function(){return l({},e,{mdp:A})}),[A,e]);var y=(r||"")+" "+(i||""),C=[cu,[ha,{ignoreMissing:!0}],qo,oo,po,na,[au,{rewrite:function(e,t,n){if("element"===e.type&&n&&"root"===n.type&&/h(1|2|3|4|5|6)/.test(e.tagName)){var r=e.children&&e.children[0];r&&r.properties&&"true"===r.properties.ariaHidden&&(r.properties=l({class:"anchor"},r.properties),r.children=[uu])}if("element"===e.type&&"pre"===e.tagName&&!p){var i=ou(e.children);e.children.push((void 0===(o=i)&&(o=""),{type:"element",tagName:"div",properties:{onClick:function(e){var t=e.currentTarget||e.target;t.classList.add("active"),lu()(t.dataset.code,(function(){setTimeout((function(){t.classList.remove("active")}),2e3)}))},"data-code":o,class:"copied"},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}))}var o;E&&E(e,t,n)}}],[ta,{properties:"attr"}]].concat((0,f.Z)(v.rehypePlugins||[])),k={allowElement:function(e,t,n){return v.allowElement?v.allowElement(e,t,n):/^[A-Za-z0-9]+$/.test(e.tagName)}},b=[].concat((0,f.Z)(v.remarkPlugins||[]),[qi]);return(0,_.jsx)("div",l({ref:A,onScroll:h,onMouseOver:d},g,{className:y,style:a,children:(0,_.jsx)(Dr,l({},v,k,{rehypePlugins:m?m("rehype",C):C,remarkPlugins:m?m("remark",b):b,children:o||""}))}))})),hu=1,du=function(){var e=u((0,s.useState)(""),2),t=e[0],n=e[1];return(0,_.jsxs)("div",{className:"App",children:[(0,_.jsx)(W,{children:"Top"}),(0,_.jsx)("dark-mode",{permanent:!0,light:"Light",dark:"Dark"}),(0,_.jsx)(b,{zIndex:9999,fixed:!0,target:"__blank",href:"https://github.com/uiwjs/react-markdown-preview"}),(0,_.jsxs)("header",{className:"App-header",children:[(0,_.jsx)("img",{style:{},src:V,className:"App-logo",alt:"logo"}),(0,_.jsx)("a",{href:"https://github.com/uiwjs/react-markdown-preview",target:"_blank",rel:"noopener noreferrer",children:"React Markdown Preview"}),(0,_.jsx)("p",{children:"React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style."})]}),(0,_.jsxs)("div",{className:"App-editor",children:[(0,_.jsx)("button",{onClick:function(){return n("# Markdown "+hu++)},children:"set value"}),(0,_.jsx)("textarea",{placeholder:"Please enter the Markdown code!",value:t,spellCheck:"false",onChange:function(e){return n(e.target.value)}}),(0,_.jsx)(pu,{className:"App-editor-preview",source:t})]}),(0,_.jsx)(pu,{className:"App-markdown",source:"React Markdown Preview\n===\n\x3c!--dividing--\x3e\n\n[![Build and Deploy](https://github.com/uiwjs/react-markdown-preview/actions/workflows/ci.marster.yml/badge.svg)](https://github.com/uiwjs/react-markdown-preview/actions/workflows/ci.marster.yml)\n[![jsDelivr CDN](https://data.jsdelivr.com/v1/package/npm/@uiw/react-markdown-preview/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@uiw/react-markdown-preview)\n[![Downloads](https://img.shields.io/npm/dm/@uiw/react-markdown-preview.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-markdown-preview)\n[![Coverage Status](https://uiwjs.github.io/react-markdown-preview/badge.svg)](https://uiwjs.github.io/react-markdown-preview/coverage/lcov-report/)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-markdown-preview.svg)](https://www.npmjs.com/package/@uiw/react-markdown-preview)\n[![npm unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-markdown-preview/file/README.md)\n[![Repo Dependents](https://badgen.net/github/dependents-repo/uiwjs/react-markdown-preview)](https://github.com/uiwjs/react-markdown-preview/network/dependents)\n\nReact component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style. The current [document website](https://uiwjs.github.io/react-markdown-preview/) is converted using this react component.\n\n## Features\n\n- \ud83c\udf12 Support dark-mode/night-mode. `@v4`\n- \ud83d\ude46\ud83c\udffc\u200d\u2642\ufe0f GitHub style: The markdown content is rendered as close to the way it's rendered on GitHub as possible.\n- \ud83c\udfcb\ud83c\udffe\u200d\u2642\ufe0f Support [GFM](https://github.github.com/gfm/) (autolink literals, footnotes, strikethrough, tables, tasklists).\n- \ud83c\udf6d Support automatic code block highlight.\n- \ud83d\udc1d Support for defining styles via comment.\n- \u26f3\ufe0f Support for [GFM footnotes](https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/)\n\n## Quick Start\n\n```bash\n$ npm install @uiw/react-markdown-preview --save\n```\n\n## Usage Example\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/react-markdown-preview-co1mj?fontsize=14&hidenavigation=1&theme=dark)\n\n```js test:meta\nimport MarkdownPreview from '@uiw/react-markdown-preview';\n\nconst source = `\n## MarkdownPreview\n\n> todo: React component preview markdown text.\n`;\n\nfunction Demo() {\n return (\n \n )\n}\n```\n\n## Disable Header links\n\n```js test:meta\nimport MarkdownPreview from '@uiw/react-markdown-preview';\n\nconst source = `\n## MarkdownPreview\n\n## Header 2\n\n### Header 3\n`;\n\nfunction Demo() {\n return (\n {\n if (node.tagName === \"a\" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {\n parent.children = [parent.children[1]];\n }\n }}\n />\n );\n}\n```\n\n### Options Props\n\n```typescript\nimport { ReactMarkdownProps } from 'react-markdown';\nimport { RehypeRewriteOptions } from 'rehype-rewrite';\n\ntype MarkdownPreviewProps = {\n prefixCls?: string;\n className?: string;\n source?: string;\n disableCopy?: boolean;\n style?: React.CSSProperties;\n pluginsFilter?: (type: 'rehype' | 'remark', plugin: PluggableList) => PluggableList;\n warpperElement?: React.DetailedHTMLProps, HTMLDivElement> & {\n 'data-color-mode'?: 'light' | 'dark';\n };\n onScroll?: (e: React.UIEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n rehypeRewrite?: RehypeRewriteOptions['rewrite'];\n} & ReactMarkdownProps;\n```\n\n- `source` (`string`, default: `''`)\\\n Markdown to parse\n- `className` (`string?`)\\\n Wrap the markdown in a `div` with this class name\n\nThis [`ReactMarkdownProps`](https://github.com/remarkjs/react-markdown/tree/02bac837bf141cdb8face360fb88be6fa33ab194#props) details. [Upgrade `react-markdown` v6](https://github.com/remarkjs/react-markdown/blob/15b4757082cf3f32a25eba0b8ea30baf751a8b40/changelog.md#600---2021-04-15)\n\n- `children` (`string`, default: `''`)\\\n Markdown to parse\n- `className` (`string?`)\\\n Wrap the markdown in a `div` with this class name\n- `skipHtml` (`boolean`, default: `false`)\\\n Ignore HTML in Markdown completely\n- `sourcePos` (`boolean`, default: `false`)\\\n Pass a prop to all components with a serialized position\n (`data-sourcepos=\"3:1-3:13\"`)\n- `rawSourcePos` (`boolean`, default: `false`)\\\n Pass a prop to all components with their [position][]\n (`sourcePosition: {start: {line: 3, column: 1}, end:\u2026}`)\n- `includeElementIndex` (`boolean`, default: `false`)\\\n Pass the `index` (number of elements before it) and `siblingCount` (number\n of elements in parent) as props to all components\n- `allowedElements` (`Array.`, default: `undefined`)\\\n Tag names to allow (can\u2019t combine w/ `disallowedElements`).\n By default all elements are allowed\n- `disallowedElements` (`Array.`, default: `undefined`)\\\n Tag names to disallow (can\u2019t combine w/ `allowedElements`).\n By default no elements are disallowed\n- `allowElement` (`(element, index, parent) => boolean?`, optional)\\\n Function called to check if an element is allowed (when truthy) or not.\n `allowedElements` / `disallowedElements` is used first!\n- `unwrapDisallowed` (`boolean`, default: `false`)\\\n Extract (unwrap) the children of not allowed elements.\n By default, when `strong` is not allowed, it and it\u2019s children is dropped,\n but with `unwrapDisallowed` the element itself is dropped but the children\n used\n- `linkTarget` (`string` or `(href, children, title) => string`, optional)\\\n Target to use on links (such as `_blank` for ` string`, default:\n [`./uri-transformer.js`](https://github.com/remarkjs/react-markdown/blob/02bac837bf141cdb8face360fb88be6fa33ab194/lib/uri-transformer.js), optional)\\\n URL to use for links.\n The default allows only `http`, `https`, `mailto`, and `tel`, and is\n exported from this module as `uriTransformer`.\n Pass `null` to allow all URLs.\n See [security][]\n- `transformImageUri` (`(src, alt, title) => string`, default:\n [`./uri-transformer.js`](https://github.com/remarkjs/react-markdown/blob/02bac837bf141cdb8face360fb88be6fa33ab194/lib/uri-transformer.js), optional)\\\n Same as `transformLinkUri` but for images\n- `components` (`Object.`, default: `{}`)\\\n Object mapping tag names to React components\n- `remarkPlugins`\x3c!--rehype:style=color: red;background-color: #ffeb3b;--\x3e (`Array.`, default: `[]`)\\\n List of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) to use.\n See the next section for examples on how to pass options\n- `rehypePlugins`\x3c!--rehype:style=color: red;background-color: #ffeb3b;--\x3e (`Array.`, default: `[]`)\\\n List of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) to use.\n See the next section for examples on how to pass options\n\n## Markdown Features\n\n### Supports for CSS Style\n\nUse HTML comments [`\x3c!--rehype:xxx--\x3e`](https://github.com/jaywcjlove/rehype-attr)\x3c!--rehype:style=color: red;--\x3e to let Markdown support style customization.\n\n```markdown\n## Title\n\x3c!--rehype:style=display: flex; height: 230px; align-items: center; justify-content: center; font-size: 38px;--\x3e\n\nMarkdown Supports **Style**\x3c!--rehype:style=color: red;--\x3e\n```\n\n### Support for [GFM footnotes](https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/)\n\n```markdown\nHere is a simple footnote[^1]. With some additional text after it.\n\n[^1]: My reference.\n```\n\n## Support dark-mode/night-mode\n\nBy default, the [`dark-mode`](https://github.com/jaywcjlove/dark-mode/) is automatically switched according to the system. If you need to switch manually, just set the `data-color-mode=\"dark\"` parameter for body. \n\n```html\n\n```\n\n```js\ndocument.documentElement.setAttribute('data-color-mode', 'dark')\ndocument.documentElement.setAttribute('data-color-mode', 'light')\n```\n\nInherit custom color variables by adding [`.wmde-markdown-var`](https://github.com/uiwjs/react-markdown-preview/blob/a53be1e93fb1c2327649c4a6b084adb80679affa/src/styles/markdown.less#L1-L193) selector.\n\n```jsx\nconst Demo = () => {\n return (\n
\n
\n \n
\n )\n}\n```\n\n## Development\n\nRuns the project in development mode. \n\n```bash\n# Step 1, run first,\n# listen to the component compile and output the .js file\n# listen for compilation output type .d.ts file\n# listen to the component compile and output the .css file\nnpm run watch\n# Step 2, development mode, listen to compile preview website instance\nnpm start\n```\n\nBuilds the app for production to the build folder.\n\n```bash\nnpm run build\n```\n\nThe build is minified and the filenames include the hashes.\nYour app is ready to be deployed!\n\n### Alternatives\n\nIf you need more features-rich Markdown Editor, you can use [@uiwjs/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor)\n\n- [@uiw/react-markdown-editor](https://github.com/uiwjs/react-markdown-editor): A markdown editor with preview, implemented with React.js and TypeScript.\n- [@uiw/react-md-editor](https://github.com/uiwjs/react-md-editor): A simple markdown editor with preview, implemented with React.js and TypeScript.\n- [@uiw/react-textarea-code-editor](https://github.com/uiwjs/react-textarea-code-editor): A simple code editor with syntax highlighting.\n- [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror): CodeMirror component for React. @codemirror\n- [@uiw/react-monacoeditor](https://github.com/jaywcjlove/react-monacoeditor): Monaco Editor component for React.\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n
\n \n\n\nMade with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nLicensed under the MIT License.\n".replace(/([\s\S]*)/,"")}),(0,_.jsxs)("div",{className:"App-footer",children:[(0,_.jsxs)(P,{user:"uiwjs",repo:"react-markdown-preview",children:[(0,_.jsx)(P.Social,{type:"forks",href:"https://github.com/uiwjs/react-markdown-preview"}),(0,_.jsx)(P.Social,{type:"stars",href:"https://github.com/uiwjs/react-markdown-preview/stargazers"}),(0,_.jsx)(P.Social,{type:"watchers",href:"https://github.com/uiwjs/react-markdown-preview/watchers"})]}),(0,_.jsx)(j.Version,{scope:"@uiw",packageName:"react-markdown-preview",href:"https://www.npmjs.com/package/@uiw/react-markdown-preview"})]})]})},mu=n(3824),Eu=document.getElementById("root");(0,mu.s)(Eu).render((0,_.jsx)(du,{}))},6871:function(e){e.exports=function(){"use strict";function e(e,t){var n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);var r=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);n.select();var i=!1;try{i=!!document.execCommand("copy")}catch(o){i=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(i)}return e}()},144:function(e,t,n){var r=n(6690).default,i=n(9728).default,o=n(6115).default,a=n(1655).default,u=n(6389).default,s=n(3496).default,l=n(8416).default,c=document,f="_dark_mode_theme_",p="permanent",h="colorschemechange",d="light",m="dark",E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,n,{enumerable:!0,get:function(){var e=this.getAttribute(t);return null===e?"":e},set:function(e){this.setAttribute(t,e)}})},T=function(e){"use strict";a(n,e);var t=u(n);function n(){var e;return r(this,n),e=t.call(this),l(o(e),"LOCAL_NANE",f),e.t(),e}return i(n,[{key:"connectedCallback",value:function(){var e=this;E(this,"mode"),E(this,m),E(this,d),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,n,{enumerable:!0,get:function(){return this.hasAttribute(t)},set:function(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,p);var t=localStorage.getItem(f);t&&[d,m].includes(t)&&(this.mode=t,this.permanent=!0),this.permanent&&!t&&localStorage.setItem(f,this.mode);var n=[d,m].includes(t);this.permanent&&t?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=m,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=d,this.o())),this.permanent||n||(window.matchMedia("(prefers-color-scheme: light)").onchange=function(t){e.mode=t.matches?d:m,e.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=function(t){e.mode=t.matches?m:d,e.o()}),new MutationObserver((function(t,r){e.mode=c.documentElement.dataset.colorMode,e.permanent&&n&&(localStorage.setItem(f,e.mode),e.i("permanentcolorscheme",{permanent:e.permanent})),e.h(),e.i(h,{colorScheme:e.mode})})).observe(c.documentElement,{attributes:!0}),this.i(h,{colorScheme:this.mode}),this.h()}},{key:"attributeChangedCallback",value:function(e,t,n){if("mode"===e&&t!==n&&[d,m].includes(n)){var r=localStorage.getItem(f);this.mode===r?(this.mode=n,this.h(),this.o()):this.mode&&this.mode!==r&&(this.h(),this.o())}else e!==d&&e!==m||t===n||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(f,this.mode):localStorage.removeItem(f))}},{key:"o",value:function(){c.documentElement.setAttribute("data-color-mode",this.mode)}},{key:"h",value:function(){this.icon.textContent=this.mode===d?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===d?this.getAttribute(m):this.getAttribute(d),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}},{key:"t",value:function(){var e=this,t=this.attachShadow({mode:"open"});this.label=c.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=function(){e.mode=e.mode===d?m:d,e.permanent&&localStorage.setItem(f,e.mode),e.o(),e.h()},t.appendChild(this.label),this.icon=c.createElement("span"),this.label.appendChild(this.icon),this.text=c.createElement("span"),this.label.appendChild(this.text);var n="_dark_mode_style_";if(!c.getElementById(n)){var r=c.createElement("style");r.id=n,r.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",c.head.appendChild(r)}var i=c.createElement("style");i.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",t.appendChild(i)}},{key:"i",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}],[{key:"observedAttributes",get:function(){return["mode",d,m,p]}}]),n}(s(HTMLElement));customElements.define("dark-mode",T)},997:function(e){e.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},9706:function(e,t,n){"use strict";var r=n(3621),i=n(5560),o=function(){function e(){this.pseudos={},this.attrEqualityMods={},this.ruleNestingOperators={},this.substitutesEnabled=!1}return e.prototype.registerSelectorPseudos=function(){for(var e=[],t=0;t=u)throw Error("Expected symbol but end of file reached.");if(s=e.charAt(t),r.identSpecialChars[s])n+=s;else{if(r.isHex(s)){var i=s;for(t++,s=e.charAt(t);r.isHex(s);)i+=s,t++,s=e.charAt(t);" "===s&&(t++,s=e.charAt(t)),n+=String.fromCharCode(parseInt(i,16));continue}n+=s}}t++,s=e.charAt(t)}return n}function f(){s=e.charAt(t);for(var n=!1;" "===s||"\t"===s||"\n"===s||"\r"===s||"\f"===s;)n=!0,t++,s=e.charAt(t);return n}function p(){var n=h();if(!n)return null;var r=n;for(s=e.charAt(t);","===s;){if(t++,f(),"selectors"!==r.type&&(r={type:"selectors",selectors:[n]}),!(n=h()))throw Error('Rule expected after ",".');r.selectors.push(n)}return r}function h(){f();var n={type:"ruleSet"},r=d();if(!r)return null;for(var i=n;r&&(r.type="rule",i.rule=r,i=r,f(),s=e.charAt(t),!(t>=u||","===s||")"===s));)if(o[s]){var a=s;if(t++,f(),!(r=d()))throw Error('Rule expected after "'+a+'".');r.nestingOperator=a}else(r=d())&&(r.nestingOperator=null);return n}function d(){for(var o=null;t=u)throw Error('Expected "=" but end of file reached.');if("="!==s)throw Error('Expected "=" but "'+s+'" found.');h.operator=d+"=",t++,f();var m="";if(h.valueType="string",'"'===s)m=l('"',r.doubleQuotesEscapeChars);else if("'"===s)m=l("'",r.singleQuoteEscapeChars);else if(a&&"$"===s)t++,m=c(),h.valueType="substitute";else{for(;t=u)throw Error('Expected "]" but end of file reached.');if("]"!==s)throw Error('Expected "]" but "'+s+'" found.');t++,h.value=m}((o=o||{}).attrs=o.attrs||[]).push(h)}else{if(":"!==s)break;t++;var E=c(),T={name:E};if("("===s){t++;var g="";if(f(),"selector"===n[E])T.valueType="selector",g=p();else{if(T.valueType=n[E]||"string",'"'===s)g=l('"',r.doubleQuotesEscapeChars);else if("'"===s)g=l("'",r.singleQuoteEscapeChars);else if(a&&"$"===s)t++,g=c(),T.valueType="substitute";else{for(;t=u)throw Error('Expected ")" but end of file reached.');if(")"!==s)throw Error('Expected ")" but "'+s+'" found.');t++,T.value=g}((o=o||{}).pseudos=o.pseudos||[]).push(T)}return o}return function(){var n=p();if(t="a"&&e<="z"||e>="A"&&e<="Z"||"-"===e||"_"===e},t.isIdent=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"-"===e||"_"===e},t.isHex=function(e){return e>="a"&&e<="f"||e>="A"&&e<="F"||e>="0"&&e<="9"},t.escapeIdentifier=function(e){for(var n=e.length,r="",i=0;i="A"&&o<="Z"||o>="a"&&o<="z"||0!==i&&o>="0"&&o<="9")r+=o;else{var a=o.charCodeAt(0);if(55296===(63488&a)){var u=e.charCodeAt(i++);if(55296!==(64512&a)||56320!==(64512&u))throw Error("UCS-2(decode): illegal sequence");a=((1023&a)<<10)+(1023&u)+65536}r+="\\"+a.toString(16)+" "}i++}return r},t.escapeStr=function(e){for(var n,r=e.length,i="",o=0;o":!0,"?":!0,"@":!0,"[":!0,"\\":!0,"]":!0,"^":!0,"`":!0,"{":!0,"|":!0,"}":!0,"~":!0},t.strReplacementsRev={"\n":"\\n","\r":"\\r","\t":"\\t","\f":"\\f","\v":"\\v"},t.singleQuoteEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\","'":"'"},t.doubleQuotesEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\",'"':'"'}},5056:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return"undefined"===typeof r||t.call(e,r)},u=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,l,c,f=arguments[0],p=1,h=arguments.length,d=!1;for("boolean"===typeof f&&(d=f,f=arguments[1]||{},p=2),(null==f||"object"!==typeof f&&"function"!==typeof f)&&(f={});p=55296&&u<=57343){if(u>=55296&&u<=56319&&o+1=56320&&s<=57343){c+=encodeURIComponent(e[o]+e[o+1]),o++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[o]);return c}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},3871:function(e,t,n){var r=n(7424).default,i=n(4704).default;function o(e){var t,n,o=[],a=i(e.split(",").map((function(e){return e.trim()})));try{for(a.s();!(n=a.n()).done;){var u=n.value;if(/^-?\d+$/.test(u))o.push(parseInt(u,10));else if(t=u.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){var s=r(t,4),l=(s[0],s[1]),c=s[2],f=s[3];if(l&&f){var p=(l=parseInt(l))<(f=parseInt(f))?1:-1;"-"!==c&&".."!==c&&"\u2025"!==c||(f+=p);for(var h=l;h!==f;h+=p)o.push(h)}}}}catch(d){a.e(d)}finally{a.f()}return o}t.default=o,e.exports=o},2594:function(e,t,n){"use strict";var r=n(9550).DOCUMENT_MODE,i="html",o=["+//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//"],a=o.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),u=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],s=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],l=s.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function c(e){var t=-1!==e.indexOf('"')?"'":'"';return t+e+t}function f(e,t){for(var n=0;n-1)return r.QUIRKS;var c=null===t?a:o;if(f(n,c))return r.QUIRKS;if(f(n,c=null===t?s:l))return r.LIMITED_QUIRKS}return r.NO_QUIRKS},t.serializeContent=function(e,t,n){var r="!DOCTYPE ";return e&&(r+=e),t?r+=" PUBLIC "+c(t):n&&(r+=" SYSTEM"),null!==n&&(r+=" "+c(n)),r}},9359:function(e){"use strict";e.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},6734:function(e,t,n){"use strict";var r,i=n(8416).default,o=n(6494),a=n(9550),u=a.TAG_NAMES,s=a.NAMESPACES,l=a.ATTRS,c="text/html",f="application/xhtml+xml",p={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},h={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:s.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:s.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:s.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:s.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:s.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:s.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:s.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:s.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:s.XML},"xml:space":{prefix:"xml",name:"space",namespace:s.XML},xmlns:{prefix:"",name:"xmlns",namespace:s.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:s.XMLNS}},d=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},m=(i(r={},u.B,!0),i(r,u.BIG,!0),i(r,u.BLOCKQUOTE,!0),i(r,u.BODY,!0),i(r,u.BR,!0),i(r,u.CENTER,!0),i(r,u.CODE,!0),i(r,u.DD,!0),i(r,u.DIV,!0),i(r,u.DL,!0),i(r,u.DT,!0),i(r,u.EM,!0),i(r,u.EMBED,!0),i(r,u.H1,!0),i(r,u.H2,!0),i(r,u.H3,!0),i(r,u.H4,!0),i(r,u.H5,!0),i(r,u.H6,!0),i(r,u.HEAD,!0),i(r,u.HR,!0),i(r,u.I,!0),i(r,u.IMG,!0),i(r,u.LI,!0),i(r,u.LISTING,!0),i(r,u.MENU,!0),i(r,u.META,!0),i(r,u.NOBR,!0),i(r,u.OL,!0),i(r,u.P,!0),i(r,u.PRE,!0),i(r,u.RUBY,!0),i(r,u.S,!0),i(r,u.SMALL,!0),i(r,u.SPAN,!0),i(r,u.STRONG,!0),i(r,u.STRIKE,!0),i(r,u.SUB,!0),i(r,u.SUP,!0),i(r,u.TABLE,!0),i(r,u.TT,!0),i(r,u.U,!0),i(r,u.UL,!0),i(r,u.VAR,!0),r);t.causesExit=function(e){var t=e.tagName;return!!(t===u.FONT&&(null!==o.getTokenAttr(e,l.COLOR)||null!==o.getTokenAttr(e,l.SIZE)||null!==o.getTokenAttr(e,l.FACE)))||m[t]},t.adjustTokenMathMLAttrs=function(e){for(var t=0;t=55296&&e<=57343},t.isSurrogatePair=function(e){return e>=56320&&e<=57343},t.getSurrogatePairCodePoint=function(e,t){return 1024*(e-55296)+9216+t},t.isControlCodePoint=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},t.isUndefinedCodePoint=function(e){return e>=64976&&e<=65007||n.indexOf(e)>-1}},7470:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(1655).default,a=n(6389).default,u=function(e){o(n,e);var t=a(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e)).posTracker=null,o.onParseError=i.onParseError,o}return i(n,[{key:"_setErrorLocation",value:function(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset}},{key:"_reportError",value:function(e){var t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t)}},{key:"_getOverriddenMethods",value:function(e){return{_err:function(t){e._reportError(t)}}}}]),n}(n(332));e.exports=u},6900:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(1655).default,a=n(6389).default,u=n(7470),s=n(6829),l=n(8308),c=n(332),f=function(e){o(n,e);var t=a(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i)).opts=i,o.ctLoc=null,o.locBeforeToken=!1,o}return i(n,[{key:"_setErrorLocation",value:function(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset)}},{key:"_getOverriddenMethods",value:function(e,t){return{_bootstrap:function(n,r){t._bootstrap.call(this,n,r),c.install(this.tokenizer,s,e.opts),c.install(this.tokenizer,l)},_processInputToken:function(n){e.ctLoc=n.location,t._processInputToken.call(this,n)},_err:function(t,n){e.locBeforeToken=n&&n.beforeToken,e._reportError(t)}}}}]),n}(u);e.exports=f},337:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(1588).default,a=n(3808).default,u=n(1655).default,s=n(6389).default,l=n(7470),c=n(9301),f=n(332),p=function(e){u(n,e);var t=s(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i)).posTracker=f.install(e,c),o.lastErrOffset=-1,o}return i(n,[{key:"_reportError",value:function(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,o(a(n.prototype),"_reportError",this).call(this,e))}}]),n}(l);e.exports=p},6829:function(e,t,n){"use strict";var r=n(9728).default,i=n(6690).default,o=n(1655).default,a=n(6389).default,u=n(7470),s=n(337),l=n(332),c=function(e){o(n,e);var t=a(n);function n(e,r){var o;i(this,n),o=t.call(this,e,r);var a=l.install(e.preprocessor,s,r);return o.posTracker=a.posTracker,o}return r(n)}(u);e.exports=c},1150:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(1655).default,a=n(6389).default,u=function(e){o(n,e);var t=a(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e)).onItemPop=i.onItemPop,o}return i(n,[{key:"_getOverriddenMethods",value:function(e,t){return{pop:function(){e.onItemPop(this.current),t.pop.call(this)},popAllUpToHtmlElement:function(){for(var n=this.stackTop;n>0;n--)e.onItemPop(this.items[n]);t.popAllUpToHtmlElement.call(this)},remove:function(n){e.onItemPop(this.current),t.remove.call(this,n)}}}}]),n}(n(332));e.exports=u},15:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(1655).default,a=n(6389).default,u=n(332),s=n(6494),l=n(8308),c=n(1150),f=n(9550).TAG_NAMES,p=function(e){o(n,e);var t=a(n);function n(e){var i;return r(this,n),(i=t.call(this,e)).parser=e,i.treeAdapter=i.parser.treeAdapter,i.posTracker=null,i.lastStartTagToken=null,i.lastFosterParentingLocation=null,i.currentToken=null,i}return i(n,[{key:"_setStartLocation",value:function(e){var t=null;this.lastStartTagToken&&((t=Object.assign({},this.lastStartTagToken.location)).startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t)}},{key:"_setEndLocation",value:function(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){var n=t.location,r=this.treeAdapter.getTagName(e),i={};t.type===s.END_TAG_TOKEN&&r===t.tagName?(i.endTag=Object.assign({},n),i.endLine=n.endLine,i.endCol=n.endCol,i.endOffset=n.endOffset):(i.endLine=n.startLine,i.endCol=n.startCol,i.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}},{key:"_getOverriddenMethods",value:function(e,t){return{_bootstrap:function(n,r){t._bootstrap.call(this,n,r),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;var i=u.install(this.tokenizer,l);e.posTracker=i.posTracker,u.install(this.openElements,c,{onItemPop:function(t){e._setEndLocation(t,e.currentToken)}})},_runParsingLoop:function(n){t._runParsingLoop.call(this,n);for(var r=this.openElements.stackTop;r>=0;r--)e._setEndLocation(this.openElements.items[r],e.currentToken)},_processTokenInForeignContent:function(n){e.currentToken=n,t._processTokenInForeignContent.call(this,n)},_processToken:function(n){if(e.currentToken=n,t._processToken.call(this,n),n.type===s.END_TAG_TOKEN&&(n.tagName===f.HTML||n.tagName===f.BODY&&this.openElements.hasInScope(f.BODY)))for(var r=this.openElements.stackTop;r>=0;r--){var i=this.openElements.items[r];if(this.treeAdapter.getTagName(i)===n.tagName){e._setEndLocation(i,n);break}}},_setDocumentType:function(e){t._setDocumentType.call(this,e);for(var n=this.treeAdapter.getChildNodes(this.document),r=n.length,i=0;i=3)for(var r=this.treeAdapter.getAttrList(t).length,i=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t),a=this.length-1;a>=0;a--){var u=this.entries[a];if(u.type===e.MARKER_ENTRY)break;var s=u.element,l=this.treeAdapter.getAttrList(s);this.treeAdapter.getTagName(s)===i&&this.treeAdapter.getNamespaceURI(s)===o&&l.length===r&&n.push({idx:a,attrs:l})}return n.length<3?[]:n}},{key:"_ensureNoahArkCondition",value:function(e){var t=this._getNoahArkConditionCandidates(e),n=t.length;if(n){for(var r=this.treeAdapter.getAttrList(e),i=r.length,o=Object.create(null),a=0;a=2;f--)this.entries.splice(t[f].idx,1),this.length--}}},{key:"insertMarker",value:function(){this.entries.push({type:e.MARKER_ENTRY}),this.length++}},{key:"pushElement",value:function(t,n){this._ensureNoahArkCondition(t),this.entries.push({type:e.ELEMENT_ENTRY,element:t,token:n}),this.length++}},{key:"insertElementAfterBookmark",value:function(t,n){for(var r=this.length-1;r>=0&&this.entries[r]!==this.bookmark;r--);this.entries.splice(r+1,0,{type:e.ELEMENT_ENTRY,element:t,token:n}),this.length++}},{key:"removeEntry",value:function(e){for(var t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}},{key:"clearToLastMarker",value:function(){for(;this.length;){var t=this.entries.pop();if(this.length--,t.type===e.MARKER_ENTRY)break}}},{key:"getElementEntryInScopeWithTagName",value:function(t){for(var n=this.length-1;n>=0;n--){var r=this.entries[n];if(r.type===e.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(r.element)===t)return r}return null}},{key:"getElementEntry",value:function(t){for(var n=this.length-1;n>=0;n--){var r=this.entries[n];if(r.type===e.ELEMENT_ENTRY&&r.element===t)return r}return null}}]),e}();o.MARKER_ENTRY="MARKER_ENTRY",o.ELEMENT_ENTRY="ELEMENT_ENTRY",e.exports=o},3854:function(e,t,n){"use strict";var r,i,o,a,u,s,l,c,f,p,h,d,m,E,T,g,v,A,y,C,_,k,b,D,N,S,O=n(6690).default,F=n(9728).default,x=n(8416).default,I=n(6494),R=n(7906),w=n(8253),L=n(15),M=n(6900),P=n(332),B=n(1993),H=n(4278),U=n(2594),j=n(6734),G=n(9359),K=n(3906),z=n(9550),Y=z.TAG_NAMES,Z=z.NAMESPACES,Q=z.ATTRS,W={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:B},V="hidden",q="INITIAL_MODE",X="BEFORE_HTML_MODE",$="BEFORE_HEAD_MODE",J="IN_HEAD_MODE",ee="IN_HEAD_NO_SCRIPT_MODE",te="AFTER_HEAD_MODE",ne="IN_BODY_MODE",re="TEXT_MODE",ie="IN_TABLE_MODE",oe="IN_TABLE_TEXT_MODE",ae="IN_CAPTION_MODE",ue="IN_COLUMN_GROUP_MODE",se="IN_TABLE_BODY_MODE",le="IN_ROW_MODE",ce="IN_CELL_MODE",fe="IN_SELECT_MODE",pe="IN_SELECT_IN_TABLE_MODE",he="IN_TEMPLATE_MODE",de="AFTER_BODY_MODE",me="IN_FRAMESET_MODE",Ee="AFTER_FRAMESET_MODE",Te="AFTER_AFTER_BODY_MODE",ge="AFTER_AFTER_FRAMESET_MODE",ve=(x(r={},Y.TR,le),x(r,Y.TBODY,se),x(r,Y.THEAD,se),x(r,Y.TFOOT,se),x(r,Y.CAPTION,ae),x(r,Y.COLGROUP,ue),x(r,Y.TABLE,ie),x(r,Y.BODY,ne),x(r,Y.FRAMESET,me),r),Ae=(x(i={},Y.CAPTION,ie),x(i,Y.COLGROUP,ie),x(i,Y.TBODY,ie),x(i,Y.TFOOT,ie),x(i,Y.THEAD,ie),x(i,Y.COL,ue),x(i,Y.TR,se),x(i,Y.TD,le),x(i,Y.TH,le),i),ye=(x(S={},q,(x(o={},I.CHARACTER_TOKEN,Me),x(o,I.NULL_CHARACTER_TOKEN,Me),x(o,I.WHITESPACE_CHARACTER_TOKEN,Fe),x(o,I.COMMENT_TOKEN,Ie),x(o,I.DOCTYPE_TOKEN,(function(e,t){e._setDocumentType(t);var n=t.forceQuirks?z.DOCUMENT_MODE.QUIRKS:U.getDocumentMode(t);U.isConforming(t)||e._err(G.nonConformingDoctype);e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=X})),x(o,I.START_TAG_TOKEN,Me),x(o,I.END_TAG_TOKEN,Me),x(o,I.EOF_TOKEN,Me),o)),x(S,X,(x(a={},I.CHARACTER_TOKEN,Pe),x(a,I.NULL_CHARACTER_TOKEN,Pe),x(a,I.WHITESPACE_CHARACTER_TOKEN,Fe),x(a,I.COMMENT_TOKEN,Ie),x(a,I.DOCTYPE_TOKEN,Fe),x(a,I.START_TAG_TOKEN,(function(e,t){t.tagName===Y.HTML?(e._insertElement(t,Z.HTML),e.insertionMode=$):Pe(e,t)})),x(a,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n!==Y.HTML&&n!==Y.HEAD&&n!==Y.BODY&&n!==Y.BR||Pe(e,t)})),x(a,I.EOF_TOKEN,Pe),a)),x(S,$,(x(u={},I.CHARACTER_TOKEN,Be),x(u,I.NULL_CHARACTER_TOKEN,Be),x(u,I.WHITESPACE_CHARACTER_TOKEN,Fe),x(u,I.COMMENT_TOKEN,Ie),x(u,I.DOCTYPE_TOKEN,xe),x(u,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.HEAD?(e._insertElement(t,Z.HTML),e.headElement=e.openElements.current,e.insertionMode=J):Be(e,t)})),x(u,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HEAD||n===Y.BODY||n===Y.HTML||n===Y.BR?Be(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),x(u,I.EOF_TOKEN,Be),u)),x(S,J,(x(s={},I.CHARACTER_TOKEN,je),x(s,I.NULL_CHARACTER_TOKEN,je),x(s,I.WHITESPACE_CHARACTER_TOKEN,we),x(s,I.COMMENT_TOKEN,Ie),x(s,I.DOCTYPE_TOKEN,xe),x(s,I.START_TAG_TOKEN,He),x(s,I.END_TAG_TOKEN,Ue),x(s,I.EOF_TOKEN,je),s)),x(S,ee,(x(l={},I.CHARACTER_TOKEN,Ge),x(l,I.NULL_CHARACTER_TOKEN,Ge),x(l,I.WHITESPACE_CHARACTER_TOKEN,we),x(l,I.COMMENT_TOKEN,Ie),x(l,I.DOCTYPE_TOKEN,xe),x(l,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.BASEFONT||n===Y.BGSOUND||n===Y.HEAD||n===Y.LINK||n===Y.META||n===Y.NOFRAMES||n===Y.STYLE?He(e,t):n===Y.NOSCRIPT?e._err(G.nestedNoscriptInHead):Ge(e,t)})),x(l,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.NOSCRIPT?(e.openElements.pop(),e.insertionMode=J):n===Y.BR?Ge(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),x(l,I.EOF_TOKEN,Ge),l)),x(S,te,(x(c={},I.CHARACTER_TOKEN,Ke),x(c,I.NULL_CHARACTER_TOKEN,Ke),x(c,I.WHITESPACE_CHARACTER_TOKEN,we),x(c,I.COMMENT_TOKEN,Ie),x(c,I.DOCTYPE_TOKEN,xe),x(c,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.BODY?(e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=ne):n===Y.FRAMESET?(e._insertElement(t,Z.HTML),e.insertionMode=me):n===Y.BASE||n===Y.BASEFONT||n===Y.BGSOUND||n===Y.LINK||n===Y.META||n===Y.NOFRAMES||n===Y.SCRIPT||n===Y.STYLE||n===Y.TEMPLATE||n===Y.TITLE?(e._err(G.abandonedHeadElementChild),e.openElements.push(e.headElement),He(e,t),e.openElements.remove(e.headElement)):n===Y.HEAD?e._err(G.misplacedStartTagForHeadElement):Ke(e,t)})),x(c,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.BODY||n===Y.HTML||n===Y.BR?Ke(e,t):n===Y.TEMPLATE?Ue(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),x(c,I.EOF_TOKEN,Ke),c)),x(S,ne,(x(f={},I.CHARACTER_TOKEN,Ye),x(f,I.NULL_CHARACTER_TOKEN,Fe),x(f,I.WHITESPACE_CHARACTER_TOKEN,ze),x(f,I.COMMENT_TOKEN,Ie),x(f,I.DOCTYPE_TOKEN,Fe),x(f,I.START_TAG_TOKEN,nt),x(f,I.END_TAG_TOKEN,at),x(f,I.EOF_TOKEN,ut),f)),x(S,re,(x(p={},I.CHARACTER_TOKEN,we),x(p,I.NULL_CHARACTER_TOKEN,we),x(p,I.WHITESPACE_CHARACTER_TOKEN,we),x(p,I.COMMENT_TOKEN,Fe),x(p,I.DOCTYPE_TOKEN,Fe),x(p,I.START_TAG_TOKEN,Fe),x(p,I.END_TAG_TOKEN,(function(e,t){t.tagName===Y.SCRIPT&&(e.pendingScript=e.openElements.current);e.openElements.pop(),e.insertionMode=e.originalInsertionMode})),x(p,I.EOF_TOKEN,(function(e,t){e._err(G.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t)})),p)),x(S,ie,(x(h={},I.CHARACTER_TOKEN,st),x(h,I.NULL_CHARACTER_TOKEN,st),x(h,I.WHITESPACE_CHARACTER_TOKEN,st),x(h,I.COMMENT_TOKEN,Ie),x(h,I.DOCTYPE_TOKEN,Fe),x(h,I.START_TAG_TOKEN,lt),x(h,I.END_TAG_TOKEN,ct),x(h,I.EOF_TOKEN,ut),h)),x(S,oe,(x(d={},I.CHARACTER_TOKEN,(function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0})),x(d,I.NULL_CHARACTER_TOKEN,Fe),x(d,I.WHITESPACE_CHARACTER_TOKEN,(function(e,t){e.pendingCharacterTokens.push(t)})),x(d,I.COMMENT_TOKEN,pt),x(d,I.DOCTYPE_TOKEN,pt),x(d,I.START_TAG_TOKEN,pt),x(d,I.END_TAG_TOKEN,pt),x(d,I.EOF_TOKEN,pt),d)),x(S,ae,(x(m={},I.CHARACTER_TOKEN,Ye),x(m,I.NULL_CHARACTER_TOKEN,Fe),x(m,I.WHITESPACE_CHARACTER_TOKEN,ze),x(m,I.COMMENT_TOKEN,Ie),x(m,I.DOCTYPE_TOKEN,Fe),x(m,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.CAPTION||n===Y.COL||n===Y.COLGROUP||n===Y.TBODY||n===Y.TD||n===Y.TFOOT||n===Y.TH||n===Y.THEAD||n===Y.TR?e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ie,e._processToken(t)):nt(e,t)})),x(m,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.CAPTION||n===Y.TABLE?e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ie,n===Y.TABLE&&e._processToken(t)):n!==Y.BODY&&n!==Y.COL&&n!==Y.COLGROUP&&n!==Y.HTML&&n!==Y.TBODY&&n!==Y.TD&&n!==Y.TFOOT&&n!==Y.TH&&n!==Y.THEAD&&n!==Y.TR&&at(e,t)})),x(m,I.EOF_TOKEN,ut),m)),x(S,ue,(x(E={},I.CHARACTER_TOKEN,ht),x(E,I.NULL_CHARACTER_TOKEN,ht),x(E,I.WHITESPACE_CHARACTER_TOKEN,we),x(E,I.COMMENT_TOKEN,Ie),x(E,I.DOCTYPE_TOKEN,Fe),x(E,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.COL?(e._appendElement(t,Z.HTML),t.ackSelfClosing=!0):n===Y.TEMPLATE?He(e,t):ht(e,t)})),x(E,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.COLGROUP?e.openElements.currentTagName===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=ie):n===Y.TEMPLATE?Ue(e,t):n!==Y.COL&&ht(e,t)})),x(E,I.EOF_TOKEN,ut),E)),x(S,se,(x(T={},I.CHARACTER_TOKEN,st),x(T,I.NULL_CHARACTER_TOKEN,st),x(T,I.WHITESPACE_CHARACTER_TOKEN,st),x(T,I.COMMENT_TOKEN,Ie),x(T,I.DOCTYPE_TOKEN,Fe),x(T,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Z.HTML),e.insertionMode=le):n===Y.TH||n===Y.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR),e.insertionMode=le,e._processToken(t)):n===Y.CAPTION||n===Y.COL||n===Y.COLGROUP||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie,e._processToken(t)):lt(e,t)})),x(T,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD?e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie):n===Y.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie,e._processToken(t)):(n!==Y.BODY&&n!==Y.CAPTION&&n!==Y.COL&&n!==Y.COLGROUP||n!==Y.HTML&&n!==Y.TD&&n!==Y.TH&&n!==Y.TR)&&ct(e,t)})),x(T,I.EOF_TOKEN,ut),T)),x(S,le,(x(g={},I.CHARACTER_TOKEN,st),x(g,I.NULL_CHARACTER_TOKEN,st),x(g,I.WHITESPACE_CHARACTER_TOKEN,st),x(g,I.COMMENT_TOKEN,Ie),x(g,I.DOCTYPE_TOKEN,Fe),x(g,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.TH||n===Y.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,Z.HTML),e.insertionMode=ce,e.activeFormattingElements.insertMarker()):n===Y.CAPTION||n===Y.COL||n===Y.COLGROUP||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR?e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=se,e._processToken(t)):lt(e,t)})),x(g,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.TR?e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=se):n===Y.TABLE?e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=se,e._processToken(t)):n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD?(e.openElements.hasInTableScope(n)||e.openElements.hasInTableScope(Y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=se,e._processToken(t)):(n!==Y.BODY&&n!==Y.CAPTION&&n!==Y.COL&&n!==Y.COLGROUP||n!==Y.HTML&&n!==Y.TD&&n!==Y.TH)&&ct(e,t)})),x(g,I.EOF_TOKEN,ut),g)),x(S,ce,(x(v={},I.CHARACTER_TOKEN,Ye),x(v,I.NULL_CHARACTER_TOKEN,Fe),x(v,I.WHITESPACE_CHARACTER_TOKEN,ze),x(v,I.COMMENT_TOKEN,Ie),x(v,I.DOCTYPE_TOKEN,Fe),x(v,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.CAPTION||n===Y.COL||n===Y.COLGROUP||n===Y.TBODY||n===Y.TD||n===Y.TFOOT||n===Y.TH||n===Y.THEAD||n===Y.TR?(e.openElements.hasInTableScope(Y.TD)||e.openElements.hasInTableScope(Y.TH))&&(e._closeTableCell(),e._processToken(t)):nt(e,t)})),x(v,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.TD||n===Y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=le):n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR?e.openElements.hasInTableScope(n)&&(e._closeTableCell(),e._processToken(t)):n!==Y.BODY&&n!==Y.CAPTION&&n!==Y.COL&&n!==Y.COLGROUP&&n!==Y.HTML&&at(e,t)})),x(v,I.EOF_TOKEN,ut),v)),x(S,fe,(x(A={},I.CHARACTER_TOKEN,we),x(A,I.NULL_CHARACTER_TOKEN,Fe),x(A,I.WHITESPACE_CHARACTER_TOKEN,we),x(A,I.COMMENT_TOKEN,Ie),x(A,I.DOCTYPE_TOKEN,Fe),x(A,I.START_TAG_TOKEN,dt),x(A,I.END_TAG_TOKEN,mt),x(A,I.EOF_TOKEN,ut),A)),x(S,pe,(x(y={},I.CHARACTER_TOKEN,we),x(y,I.NULL_CHARACTER_TOKEN,Fe),x(y,I.WHITESPACE_CHARACTER_TOKEN,we),x(y,I.COMMENT_TOKEN,Ie),x(y,I.DOCTYPE_TOKEN,Fe),x(y,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e._processToken(t)):dt(e,t)})),x(y,I.END_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e._processToken(t)):mt(e,t)})),x(y,I.EOF_TOKEN,ut),y)),x(S,he,(x(C={},I.CHARACTER_TOKEN,Ye),x(C,I.NULL_CHARACTER_TOKEN,Fe),x(C,I.WHITESPACE_CHARACTER_TOKEN,ze),x(C,I.COMMENT_TOKEN,Ie),x(C,I.DOCTYPE_TOKEN,Fe),x(C,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;if(n===Y.BASE||n===Y.BASEFONT||n===Y.BGSOUND||n===Y.LINK||n===Y.META||n===Y.NOFRAMES||n===Y.SCRIPT||n===Y.STYLE||n===Y.TEMPLATE||n===Y.TITLE)He(e,t);else{var r=Ae[n]||ne;e._popTmplInsertionMode(),e._pushTmplInsertionMode(r),e.insertionMode=r,e._processToken(t)}})),x(C,I.END_TAG_TOKEN,(function(e,t){t.tagName===Y.TEMPLATE&&Ue(e,t)})),x(C,I.EOF_TOKEN,Et),C)),x(S,de,(x(_={},I.CHARACTER_TOKEN,Tt),x(_,I.NULL_CHARACTER_TOKEN,Tt),x(_,I.WHITESPACE_CHARACTER_TOKEN,ze),x(_,I.COMMENT_TOKEN,(function(e,t){e._appendCommentNode(t,e.openElements.items[0])})),x(_,I.DOCTYPE_TOKEN,Fe),x(_,I.START_TAG_TOKEN,(function(e,t){t.tagName===Y.HTML?nt(e,t):Tt(e,t)})),x(_,I.END_TAG_TOKEN,(function(e,t){t.tagName===Y.HTML?e.fragmentContext||(e.insertionMode=Te):Tt(e,t)})),x(_,I.EOF_TOKEN,Le),_)),x(S,me,(x(k={},I.CHARACTER_TOKEN,Fe),x(k,I.NULL_CHARACTER_TOKEN,Fe),x(k,I.WHITESPACE_CHARACTER_TOKEN,we),x(k,I.COMMENT_TOKEN,Ie),x(k,I.DOCTYPE_TOKEN,Fe),x(k,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.FRAMESET?e._insertElement(t,Z.HTML):n===Y.FRAME?(e._appendElement(t,Z.HTML),t.ackSelfClosing=!0):n===Y.NOFRAMES&&He(e,t)})),x(k,I.END_TAG_TOKEN,(function(e,t){t.tagName!==Y.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===Y.FRAMESET||(e.insertionMode=Ee))})),x(k,I.EOF_TOKEN,Le),k)),x(S,Ee,(x(b={},I.CHARACTER_TOKEN,Fe),x(b,I.NULL_CHARACTER_TOKEN,Fe),x(b,I.WHITESPACE_CHARACTER_TOKEN,we),x(b,I.COMMENT_TOKEN,Ie),x(b,I.DOCTYPE_TOKEN,Fe),x(b,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.NOFRAMES&&He(e,t)})),x(b,I.END_TAG_TOKEN,(function(e,t){t.tagName===Y.HTML&&(e.insertionMode=ge)})),x(b,I.EOF_TOKEN,Le),b)),x(S,Te,(x(D={},I.CHARACTER_TOKEN,gt),x(D,I.NULL_CHARACTER_TOKEN,gt),x(D,I.WHITESPACE_CHARACTER_TOKEN,ze),x(D,I.COMMENT_TOKEN,Re),x(D,I.DOCTYPE_TOKEN,Fe),x(D,I.START_TAG_TOKEN,(function(e,t){t.tagName===Y.HTML?nt(e,t):gt(e,t)})),x(D,I.END_TAG_TOKEN,gt),x(D,I.EOF_TOKEN,Le),D)),x(S,ge,(x(N={},I.CHARACTER_TOKEN,Fe),x(N,I.NULL_CHARACTER_TOKEN,Fe),x(N,I.WHITESPACE_CHARACTER_TOKEN,ze),x(N,I.COMMENT_TOKEN,Re),x(N,I.DOCTYPE_TOKEN,Fe),x(N,I.START_TAG_TOKEN,(function(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.NOFRAMES&&He(e,t)})),x(N,I.END_TAG_TOKEN,Fe),x(N,I.EOF_TOKEN,Le),N)),S),Ce=function(){function e(t){O(this,e),this.options=H(W,t),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&P.install(this,L),this.options.onParseError&&P.install(this,M,{onParseError:this.options.onParseError})}return F(e,[{key:"parse",value:function(e){var t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}},{key:"parseFragment",value:function(e,t){t||(t=this.treeAdapter.createElement(Y.TEMPLATE,Z.HTML,[]));var n=this.treeAdapter.createElement("documentmock",Z.HTML,[]);this._bootstrap(n,t),this.treeAdapter.getTagName(t)===Y.TEMPLATE&&this._pushTmplInsertionMode(he),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);var r=this.treeAdapter.getFirstChild(n),i=this.treeAdapter.createDocumentFragment();return this._adoptNodes(r,i),i}},{key:"_bootstrap",value:function(e,t){this.tokenizer=new I(this.options),this.stopped=!1,this.insertionMode=q,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new R(this.document,this.treeAdapter),this.activeFormattingElements=new w(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1}},{key:"_err",value:function(){}},{key:"_runParsingLoop",value:function(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();var t=this.tokenizer.getNextToken();if(t.type===I.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===I.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1)}if(this._processInputToken(t),e&&this.pendingScript)break}}},{key:"runParsingLoopForCurrentChunk",value:function(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){var n=this.pendingScript;return this.pendingScript=null,void t(n)}e&&e()}},{key:"_setupTokenizerCDATAMode",value:function(){var e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==Z.HTML&&!this._isIntegrationPoint(e)}},{key:"_switchToTextParsing",value:function(e,t){this._insertElement(e,Z.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=re}},{key:"switchToPlaintextParsing",value:function(){this.insertionMode=re,this.originalInsertionMode=ne,this.tokenizer.state=I.MODE.PLAINTEXT}},{key:"_getAdjustedCurrentElement",value:function(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}},{key:"_findFormInFragmentContext",value:function(){var e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}while(e)}},{key:"_initTokenizerForFragmentParsing",value:function(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===Z.HTML){var e=this.treeAdapter.getTagName(this.fragmentContext);e===Y.TITLE||e===Y.TEXTAREA?this.tokenizer.state=I.MODE.RCDATA:e===Y.STYLE||e===Y.XMP||e===Y.IFRAME||e===Y.NOEMBED||e===Y.NOFRAMES||e===Y.NOSCRIPT?this.tokenizer.state=I.MODE.RAWTEXT:e===Y.SCRIPT?this.tokenizer.state=I.MODE.SCRIPT_DATA:e===Y.PLAINTEXT&&(this.tokenizer.state=I.MODE.PLAINTEXT)}}},{key:"_setDocumentType",value:function(e){var t=e.name||"",n=e.publicId||"",r=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,n,r)}},{key:"_attachElementToTree",value:function(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{var t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e)}}},{key:"_appendElement",value:function(e,t){var n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n)}},{key:"_insertElement",value:function(e,t){var n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n),this.openElements.push(n)}},{key:"_insertFakeElement",value:function(e){var t=this.treeAdapter.createElement(e,Z.HTML,[]);this._attachElementToTree(t),this.openElements.push(t)}},{key:"_insertTemplate",value:function(e){var t=this.treeAdapter.createElement(e.tagName,Z.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t),this.openElements.push(t)}},{key:"_insertFakeRootElement",value:function(){var e=this.treeAdapter.createElement(Y.HTML,Z.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e)}},{key:"_appendCommentNode",value:function(e,t){var n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n)}},{key:"_insertCharacters",value:function(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else{var t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars)}}},{key:"_adoptNodes",value:function(e,t){for(var n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}},{key:"_shouldProcessTokenInForeignContent",value:function(e){var t=this._getAdjustedCurrentElement();if(!t||t===this.document)return!1;var n=this.treeAdapter.getNamespaceURI(t);if(n===Z.HTML)return!1;if(this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&n===Z.MATHML&&e.type===I.START_TAG_TOKEN&&e.tagName===Y.SVG)return!1;var r=e.type===I.CHARACTER_TOKEN||e.type===I.NULL_CHARACTER_TOKEN||e.type===I.WHITESPACE_CHARACTER_TOKEN;return(!(e.type===I.START_TAG_TOKEN&&e.tagName!==Y.MGLYPH&&e.tagName!==Y.MALIGNMARK)&&!r||!this._isIntegrationPoint(t,Z.MATHML))&&((e.type!==I.START_TAG_TOKEN&&!r||!this._isIntegrationPoint(t,Z.HTML))&&e.type!==I.EOF_TOKEN)}},{key:"_processToken",value:function(e){ye[this.insertionMode][e.type](this,e)}},{key:"_processTokenInBodyMode",value:function(e){ye.IN_BODY_MODE[e.type](this,e)}},{key:"_processTokenInForeignContent",value:function(e){e.type===I.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e):e.type===I.NULL_CHARACTER_TOKEN?function(e,t){t.chars=K.REPLACEMENT_CHARACTER,e._insertCharacters(t)}(this,e):e.type===I.WHITESPACE_CHARACTER_TOKEN?we(this,e):e.type===I.COMMENT_TOKEN?Ie(this,e):e.type===I.START_TAG_TOKEN?function(e,t){if(j.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Z.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t)}else{var n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Z.MATHML?j.adjustTokenMathMLAttrs(t):r===Z.SVG&&(j.adjustTokenSVGTagName(t),j.adjustTokenSVGAttrs(t)),j.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):e.type===I.END_TAG_TOKEN&&function(e,t){for(var n=e.openElements.stackTop;n>0;n--){var r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Z.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(r).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(r);break}}}(this,e)}},{key:"_processInputToken",value:function(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===I.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err(G.nonVoidHtmlElementStartTagWithTrailingSolidus)}},{key:"_isIntegrationPoint",value:function(e,t){var n=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e),i=this.treeAdapter.getAttrList(e);return j.isIntegrationPoint(n,r,i,t)}},{key:"_reconstructActiveFormattingElements",value:function(){var e=this.activeFormattingElements.length;if(e){var t=e,n=null;do{if(t--,(n=this.activeFormattingElements.entries[t]).type===w.MARKER_ENTRY||this.openElements.contains(n.element)){t++;break}}while(t>0);for(var r=t;r=0;e--){var n=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(n=this.fragmentContext));var r=this.treeAdapter.getTagName(n),i=ve[r];if(i){this.insertionMode=i;break}if(!(t||r!==Y.TD&&r!==Y.TH)){this.insertionMode=ce;break}if(!t&&r===Y.HEAD){this.insertionMode=J;break}if(r===Y.SELECT){this._resetInsertionModeForSelect(e);break}if(r===Y.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(r===Y.HTML){this.insertionMode=this.headElement?te:$;break}if(t){this.insertionMode=ne;break}}}},{key:"_resetInsertionModeForSelect",value:function(e){if(e>0)for(var t=e-1;t>0;t--){var n=this.openElements.items[t],r=this.treeAdapter.getTagName(n);if(r===Y.TEMPLATE)break;if(r===Y.TABLE)return void(this.insertionMode=pe)}this.insertionMode=fe}},{key:"_pushTmplInsertionMode",value:function(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e}},{key:"_popTmplInsertionMode",value:function(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}},{key:"_isElementCausesFosterParenting",value:function(e){var t=this.treeAdapter.getTagName(e);return t===Y.TABLE||t===Y.TBODY||t===Y.TFOOT||t===Y.THEAD||t===Y.TR}},{key:"_shouldFosterParentOnInsertion",value:function(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}},{key:"_findFosterParentingLocation",value:function(){for(var e={parent:null,beforeElement:null},t=this.openElements.stackTop;t>=0;t--){var n=this.openElements.items[t],r=this.treeAdapter.getTagName(n),i=this.treeAdapter.getNamespaceURI(n);if(r===Y.TEMPLATE&&i===Z.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}if(r===Y.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}},{key:"_fosterParentElement",value:function(e){var t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}},{key:"_fosterParentText",value:function(e){var t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e)}},{key:"_isSpecialElement",value:function(e){var t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return z.SPECIAL_ELEMENTS[n][t]}}]),e}();function _e(e,t){var n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagName)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ot(e,t),n}function ke(e,t){for(var n=null,r=e.openElements.stackTop;r>=0;r--){var i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i)&&(n=i)}return n||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),n}function be(e,t,n){for(var r=t,i=e.openElements.getCommonAncestor(t),o=0,a=i;a!==n;o++,a=i){i=e.openElements.getCommonAncestor(a);var u=e.activeFormattingElements.getElementEntry(a),s=u&&o>=3;!u||s?(s&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(a)):(a=De(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function De(e,t){var 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 Ne(e,t,n){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(n);else{var r=e.treeAdapter.getTagName(t),i=e.treeAdapter.getNamespaceURI(t);r===Y.TEMPLATE&&i===Z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Se(e,t,n){var r=e.treeAdapter.getNamespaceURI(n.element),i=n.token,o=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,n.token),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o)}function Oe(e,t){for(var n,r=0;r<8&&(n=_e(e,t));r++){var i=ke(e,n);if(!i)break;e.activeFormattingElements.bookmark=n;var o=be(e,i,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(o),Ne(e,a,o),Se(e,i,n)}}function Fe(){}function xe(e){e._err(G.misplacedDoctype)}function Ie(e,t){e._appendCommentNode(t,e.openElements.currentTmplContent||e.openElements.current)}function Re(e,t){e._appendCommentNode(t,e.document)}function we(e,t){e._insertCharacters(t)}function Le(e){e.stopped=!0}function Me(e,t){e._err(G.missingDoctype,{beforeToken:!0}),e.treeAdapter.setDocumentMode(e.document,z.DOCUMENT_MODE.QUIRKS),e.insertionMode=X,e._processToken(t)}function Pe(e,t){e._insertFakeRootElement(),e.insertionMode=$,e._processToken(t)}function Be(e,t){e._insertFakeElement(Y.HEAD),e.headElement=e.openElements.current,e.insertionMode=J,e._processToken(t)}function He(e,t){var n=t.tagName;n===Y.HTML?nt(e,t):n===Y.BASE||n===Y.BASEFONT||n===Y.BGSOUND||n===Y.LINK||n===Y.META?(e._appendElement(t,Z.HTML),t.ackSelfClosing=!0):n===Y.TITLE?e._switchToTextParsing(t,I.MODE.RCDATA):n===Y.NOSCRIPT?e.options.scriptingEnabled?e._switchToTextParsing(t,I.MODE.RAWTEXT):(e._insertElement(t,Z.HTML),e.insertionMode=ee):n===Y.NOFRAMES||n===Y.STYLE?e._switchToTextParsing(t,I.MODE.RAWTEXT):n===Y.SCRIPT?e._switchToTextParsing(t,I.MODE.SCRIPT_DATA):n===Y.TEMPLATE?(e._insertTemplate(t,Z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=he,e._pushTmplInsertionMode(he)):n===Y.HEAD?e._err(G.misplacedStartTagForHeadElement):je(e,t)}function Ue(e,t){var n=t.tagName;n===Y.HEAD?(e.openElements.pop(),e.insertionMode=te):n===Y.BODY||n===Y.BR||n===Y.HTML?je(e,t):n===Y.TEMPLATE&&e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==Y.TEMPLATE&&e._err(G.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(G.endTagWithoutMatchingOpenElement)}function je(e,t){e.openElements.pop(),e.insertionMode=te,e._processToken(t)}function Ge(e,t){var n=t.type===I.EOF_TOKEN?G.openElementsLeftAfterEof:G.disallowedContentInNoscriptInHead;e._err(n),e.openElements.pop(),e.insertionMode=J,e._processToken(t)}function Ke(e,t){e._insertFakeElement(Y.BODY),e.insertionMode=ne,e._processToken(t)}function ze(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Ye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Ze(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}function Qe(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function We(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ve(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function qe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Xe(e,t){e._appendElement(t,Z.HTML),t.ackSelfClosing=!0}function $e(e,t){e._switchToTextParsing(t,I.MODE.RAWTEXT)}function Je(e,t){e.openElements.currentTagName===Y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function et(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Z.HTML)}function tt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function nt(e,t){var n=t.tagName;switch(n.length){case 1:n===Y.I||n===Y.S||n===Y.B||n===Y.U?We(e,t):n===Y.P?Ze(e,t):n===Y.A?function(e,t){var n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(Oe(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):tt(e,t);break;case 2:n===Y.DL||n===Y.OL||n===Y.UL?Ze(e,t):n===Y.H1||n===Y.H2||n===Y.H3||n===Y.H4||n===Y.H5||n===Y.H6?function(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement();var n=e.openElements.currentTagName;n!==Y.H1&&n!==Y.H2&&n!==Y.H3&&n!==Y.H4&&n!==Y.H5&&n!==Y.H6||e.openElements.pop(),e._insertElement(t,Z.HTML)}(e,t):n===Y.LI||n===Y.DD||n===Y.DT?function(e,t){e.framesetOk=!1;for(var n=t.tagName,r=e.openElements.stackTop;r>=0;r--){var i=e.openElements.items[r],o=e.treeAdapter.getTagName(i),a=null;if(n===Y.LI&&o===Y.LI?a=Y.LI:n!==Y.DD&&n!==Y.DT||o!==Y.DD&&o!==Y.DT||(a=o),a){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(o!==Y.ADDRESS&&o!==Y.DIV&&o!==Y.P&&e._isSpecialElement(i))break}e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}(e,t):n===Y.EM||n===Y.TT?We(e,t):n===Y.BR?qe(e,t):n===Y.HR?function(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t):n===Y.RB?et(e,t):n===Y.RT||n===Y.RP?function(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Y.RTC),e._insertElement(t,Z.HTML)}(e,t):n!==Y.TH&&n!==Y.TD&&n!==Y.TR&&tt(e,t);break;case 3:n===Y.DIV||n===Y.DIR||n===Y.NAV?Ze(e,t):n===Y.PRE?Qe(e,t):n===Y.BIG?We(e,t):n===Y.IMG||n===Y.WBR?qe(e,t):n===Y.XMP?function(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,I.MODE.RAWTEXT)}(e,t):n===Y.SVG?function(e,t){e._reconstructActiveFormattingElements(),j.adjustTokenSVGAttrs(t),j.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,Z.SVG):e._insertElement(t,Z.SVG),t.ackSelfClosing=!0}(e,t):n===Y.RTC?et(e,t):n!==Y.COL&&tt(e,t);break;case 4:n===Y.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t):n===Y.BASE||n===Y.LINK||n===Y.META?He(e,t):n===Y.BODY?function(e,t){var n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t):n===Y.MAIN||n===Y.MENU?Ze(e,t):n===Y.FORM?function(e,t){var n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML),n||(e.formElement=e.openElements.current))}(e,t):n===Y.CODE||n===Y.FONT?We(e,t):n===Y.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Y.NOBR)&&(Oe(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):n===Y.AREA?qe(e,t):n===Y.MATH?function(e,t){e._reconstructActiveFormattingElements(),j.adjustTokenMathMLAttrs(t),j.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,Z.MATHML):e._insertElement(t,Z.MATHML),t.ackSelfClosing=!0}(e,t):n===Y.MENU?function(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}(e,t):n!==Y.HEAD&&tt(e,t);break;case 5:n===Y.STYLE||n===Y.TITLE?He(e,t):n===Y.ASIDE?Ze(e,t):n===Y.SMALL?We(e,t):n===Y.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==z.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=ie}(e,t):n===Y.EMBED?qe(e,t):n===Y.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML);var n=I.getTokenAttr(t,Q.TYPE);n&&n.toLowerCase()===V||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t):n===Y.PARAM||n===Y.TRACK?Xe(e,t):n===Y.IMAGE?function(e,t){t.tagName=Y.IMG,qe(e,t)}(e,t):n!==Y.FRAME&&n!==Y.TBODY&&n!==Y.TFOOT&&n!==Y.THEAD&&tt(e,t);break;case 6:n===Y.SCRIPT?He(e,t):n===Y.CENTER||n===Y.FIGURE||n===Y.FOOTER||n===Y.HEADER||n===Y.HGROUP||n===Y.DIALOG?Ze(e,t):n===Y.BUTTON?function(e,t){e.openElements.hasInScope(Y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1}(e,t):n===Y.STRIKE||n===Y.STRONG?We(e,t):n===Y.APPLET||n===Y.OBJECT?Ve(e,t):n===Y.KEYGEN?qe(e,t):n===Y.SOURCE?Xe(e,t):n===Y.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,I.MODE.RAWTEXT)}(e,t):n===Y.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode===ie||e.insertionMode===ae||e.insertionMode===se||e.insertionMode===le||e.insertionMode===ce?e.insertionMode=pe:e.insertionMode=fe}(e,t):n===Y.OPTION?Je(e,t):tt(e,t);break;case 7:n===Y.BGSOUND?He(e,t):n===Y.DETAILS||n===Y.ADDRESS||n===Y.ARTICLE||n===Y.SECTION||n===Y.SUMMARY?Ze(e,t):n===Y.LISTING?Qe(e,t):n===Y.MARQUEE?Ve(e,t):n===Y.NOEMBED?$e(e,t):n!==Y.CAPTION&&tt(e,t);break;case 8:n===Y.BASEFONT?He(e,t):n===Y.FRAMESET?function(e,t){var n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Z.HTML),e.insertionMode=me)}(e,t):n===Y.FIELDSET?Ze(e,t):n===Y.TEXTAREA?function(e,t){e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=I.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=re}(e,t):n===Y.TEMPLATE?He(e,t):n===Y.NOSCRIPT?e.options.scriptingEnabled?$e(e,t):tt(e,t):n===Y.OPTGROUP?Je(e,t):n!==Y.COLGROUP&&tt(e,t);break;case 9:n===Y.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.tokenizer.state=I.MODE.PLAINTEXT}(e,t):tt(e,t);break;case 10:n===Y.BLOCKQUOTE||n===Y.FIGCAPTION?Ze(e,t):tt(e,t);break;default:tt(e,t)}}function rt(e,t){var n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function it(e,t){var n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function ot(e,t){for(var n=t.tagName,r=e.openElements.stackTop;r>0;r--){var i=e.openElements.items[r];if(e.treeAdapter.getTagName(i)===n){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilElementPopped(i);break}if(e._isSpecialElement(i))break}}function at(e,t){var n=t.tagName;switch(n.length){case 1:n===Y.A||n===Y.B||n===Y.I||n===Y.S||n===Y.U?Oe(e,t):n===Y.P?function(e){e.openElements.hasInButtonScope(Y.P)||e._insertFakeElement(Y.P),e._closePElement()}(e):ot(e,t);break;case 2:n===Y.DL||n===Y.UL||n===Y.OL?rt(e,t):n===Y.LI?function(e){e.openElements.hasInListItemScope(Y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Y.LI),e.openElements.popUntilTagNamePopped(Y.LI))}(e):n===Y.DD||n===Y.DT?function(e,t){var n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t):n===Y.H1||n===Y.H2||n===Y.H3||n===Y.H4||n===Y.H5||n===Y.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e):n===Y.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR),e.openElements.pop(),e.framesetOk=!1}(e):n===Y.EM||n===Y.TT?Oe(e,t):ot(e,t);break;case 3:n===Y.BIG?Oe(e,t):n===Y.DIR||n===Y.DIV||n===Y.NAV||n===Y.PRE?rt(e,t):ot(e,t);break;case 4:n===Y.BODY?function(e){e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=de)}(e):n===Y.HTML?function(e,t){e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=de,e._processToken(t))}(e,t):n===Y.FORM?function(e){var t=e.openElements.tmplCount>0,n=e.formElement;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Y.FORM):e.openElements.remove(n))}(e):n===Y.CODE||n===Y.FONT||n===Y.NOBR?Oe(e,t):n===Y.MAIN||n===Y.MENU?rt(e,t):ot(e,t);break;case 5:n===Y.ASIDE?rt(e,t):n===Y.SMALL?Oe(e,t):ot(e,t);break;case 6:n===Y.CENTER||n===Y.FIGURE||n===Y.FOOTER||n===Y.HEADER||n===Y.HGROUP||n===Y.DIALOG?rt(e,t):n===Y.APPLET||n===Y.OBJECT?it(e,t):n===Y.STRIKE||n===Y.STRONG?Oe(e,t):ot(e,t);break;case 7:n===Y.ADDRESS||n===Y.ARTICLE||n===Y.DETAILS||n===Y.SECTION||n===Y.SUMMARY||n===Y.LISTING?rt(e,t):n===Y.MARQUEE?it(e,t):ot(e,t);break;case 8:n===Y.FIELDSET?rt(e,t):n===Y.TEMPLATE?Ue(e,t):ot(e,t);break;case 10:n===Y.BLOCKQUOTE||n===Y.FIGCAPTION?rt(e,t):ot(e,t);break;default:ot(e,t)}}function ut(e,t){e.tmplInsertionModeStackTop>-1?Et(e,t):e.stopped=!0}function st(e,t){var n=e.openElements.currentTagName;n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=oe,e._processToken(t)):ft(e,t)}function lt(e,t){var n=t.tagName;switch(n.length){case 2:n===Y.TD||n===Y.TH||n===Y.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY),e.insertionMode=se,e._processToken(t)}(e,t):ft(e,t);break;case 3:n===Y.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP),e.insertionMode=ue,e._processToken(t)}(e,t):ft(e,t);break;case 4:n===Y.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,Z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t):ft(e,t);break;case 5:n===Y.TABLE?function(e,t){e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode(),e._processToken(t))}(e,t):n===Y.STYLE?He(e,t):n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=se}(e,t):n===Y.INPUT?function(e,t){var n=I.getTokenAttr(t,Q.TYPE);n&&n.toLowerCase()===V?e._appendElement(t,Z.HTML):ft(e,t),t.ackSelfClosing=!0}(e,t):ft(e,t);break;case 6:n===Y.SCRIPT?He(e,t):ft(e,t);break;case 7:n===Y.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Z.HTML),e.insertionMode=ae}(e,t):ft(e,t);break;case 8:n===Y.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=ue}(e,t):n===Y.TEMPLATE?He(e,t):ft(e,t);break;default:ft(e,t)}}function ct(e,t){var n=t.tagName;n===Y.TABLE?e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode()):n===Y.TEMPLATE?Ue(e,t):n!==Y.BODY&&n!==Y.CAPTION&&n!==Y.COL&&n!==Y.COLGROUP&&n!==Y.HTML&&n!==Y.TBODY&&n!==Y.TD&&n!==Y.TFOOT&&n!==Y.TH&&n!==Y.THEAD&&n!==Y.TR&&ft(e,t)}function ft(e,t){var n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=n}function pt(e,t){var n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0?(e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0}function Tt(e,t){e.insertionMode=ne,e._processToken(t)}function gt(e,t){e.insertionMode=ne,e._processToken(t)}e.exports=Ce},7906:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(9550),a=o.TAG_NAMES,u=o.NAMESPACES;function s(e){switch(e.length){case 1:return e===a.P;case 2:return e===a.RB||e===a.RP||e===a.RT||e===a.DD||e===a.DT||e===a.LI;case 3:return e===a.RTC;case 6:return e===a.OPTION;case 8:return e===a.OPTGROUP}return!1}function l(e){switch(e.length){case 1:return e===a.P;case 2:return e===a.RB||e===a.RP||e===a.RT||e===a.DD||e===a.DT||e===a.LI||e===a.TD||e===a.TH||e===a.TR;case 3:return e===a.RTC;case 5:return e===a.TBODY||e===a.TFOOT||e===a.THEAD;case 6:return e===a.OPTION;case 7:return e===a.CAPTION;case 8:return e===a.OPTGROUP||e===a.COLGROUP}return!1}function c(e,t){switch(e.length){case 2:if(e===a.TD||e===a.TH)return t===u.HTML;if(e===a.MI||e===a.MO||e===a.MN||e===a.MS)return t===u.MATHML;break;case 4:if(e===a.HTML)return t===u.HTML;if(e===a.DESC)return t===u.SVG;break;case 5:if(e===a.TABLE)return t===u.HTML;if(e===a.MTEXT)return t===u.MATHML;if(e===a.TITLE)return t===u.SVG;break;case 6:return(e===a.APPLET||e===a.OBJECT)&&t===u.HTML;case 7:return(e===a.CAPTION||e===a.MARQUEE)&&t===u.HTML;case 8:return e===a.TEMPLATE&&t===u.HTML;case 13:return e===a.FOREIGN_OBJECT&&t===u.SVG;case 14:return e===a.ANNOTATION_XML&&t===u.MATHML}return!1}var f=function(){function e(t,n){r(this,e),this.stackTop=-1,this.items=[],this.current=t,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=n}return i(e,[{key:"_indexOf",value:function(e){for(var t=-1,n=this.stackTop;n>=0;n--)if(this.items[n]===e){t=n;break}return t}},{key:"_isInTemplate",value:function(){return this.currentTagName===a.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===u.HTML}},{key:"_updateCurrentElement",value:function(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null}},{key:"push",value:function(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++}},{key:"pop",value:function(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()}},{key:"replace",value:function(e,t){var n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&this._updateCurrentElement()}},{key:"insertAfter",value:function(e,t){var n=this._indexOf(e)+1;this.items.splice(n,0,t),n===++this.stackTop&&this._updateCurrentElement()}},{key:"popUntilTagNamePopped",value:function(e){for(;this.stackTop>-1;){var t=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&n===u.HTML)break}}},{key:"popUntilElementPopped",value:function(e){for(;this.stackTop>-1;){var t=this.current;if(this.pop(),t===e)break}}},{key:"popUntilNumberedHeaderPopped",value:function(){for(;this.stackTop>-1;){var e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===a.H1||e===a.H2||e===a.H3||e===a.H4||e===a.H5||e===a.H6&&t===u.HTML)break}}},{key:"popUntilTableCellPopped",value:function(){for(;this.stackTop>-1;){var e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===a.TD||e===a.TH&&t===u.HTML)break}}},{key:"popAllUpToHtmlElement",value:function(){this.stackTop=0,this._updateCurrentElement()}},{key:"clearBackToTableContext",value:function(){for(;this.currentTagName!==a.TABLE&&this.currentTagName!==a.TEMPLATE&&this.currentTagName!==a.HTML||this.treeAdapter.getNamespaceURI(this.current)!==u.HTML;)this.pop()}},{key:"clearBackToTableBodyContext",value:function(){for(;this.currentTagName!==a.TBODY&&this.currentTagName!==a.TFOOT&&this.currentTagName!==a.THEAD&&this.currentTagName!==a.TEMPLATE&&this.currentTagName!==a.HTML||this.treeAdapter.getNamespaceURI(this.current)!==u.HTML;)this.pop()}},{key:"clearBackToTableRowContext",value:function(){for(;this.currentTagName!==a.TR&&this.currentTagName!==a.TEMPLATE&&this.currentTagName!==a.HTML||this.treeAdapter.getNamespaceURI(this.current)!==u.HTML;)this.pop()}},{key:"remove",value:function(e){for(var t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}},{key:"tryPeekProperlyNestedBodyElement",value:function(){var e=this.items[1];return e&&this.treeAdapter.getTagName(e)===a.BODY?e:null}},{key:"contains",value:function(e){return this._indexOf(e)>-1}},{key:"getCommonAncestor",value:function(e){var t=this._indexOf(e);return--t>=0?this.items[t]:null}},{key:"isRootHtmlElementCurrent",value:function(){return 0===this.stackTop&&this.currentTagName===a.HTML}},{key:"hasInScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===u.HTML)return!0;if(c(n,r))return!1}return!0}},{key:"hasNumberedHeaderInScope",value:function(){for(var e=this.stackTop;e>=0;e--){var t=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===a.H1||t===a.H2||t===a.H3||t===a.H4||t===a.H5||t===a.H6)&&n===u.HTML)return!0;if(c(t,n))return!1}return!0}},{key:"hasInListItemScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===u.HTML)return!0;if((n===a.UL||n===a.OL)&&r===u.HTML||c(n,r))return!1}return!0}},{key:"hasInButtonScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===u.HTML)return!0;if(n===a.BUTTON&&r===u.HTML||c(n,r))return!1}return!0}},{key:"hasInTableScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===u.HTML){if(n===e)return!0;if(n===a.TABLE||n===a.TEMPLATE||n===a.HTML)return!1}}return!0}},{key:"hasTableBodyContextInTableScope",value:function(){for(var e=this.stackTop;e>=0;e--){var t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===u.HTML){if(t===a.TBODY||t===a.THEAD||t===a.TFOOT)return!0;if(t===a.TABLE||t===a.HTML)return!1}}return!0}},{key:"hasInSelectScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===u.HTML){if(n===e)return!0;if(n!==a.OPTION&&n!==a.OPTGROUP)return!1}}return!0}},{key:"generateImpliedEndTags",value:function(){for(;s(this.currentTagName);)this.pop()}},{key:"generateImpliedEndTagsThoroughly",value:function(){for(;l(this.currentTagName);)this.pop()}},{key:"generateImpliedEndTagsWithExclusion",value:function(e){for(;s(this.currentTagName)&&this.currentTagName!==e;)this.pop()}}]),e}();e.exports=f},6494:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(676),a=n(3906),u=n(6036),s=n(9359),l=a.CODE_POINTS,c=a.CODE_POINT_SEQUENCES,f={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},p="DATA_STATE",h="RCDATA_STATE",d="RAWTEXT_STATE",m="SCRIPT_DATA_STATE",E="PLAINTEXT_STATE",T="TAG_OPEN_STATE",g="END_TAG_OPEN_STATE",v="TAG_NAME_STATE",A="RCDATA_LESS_THAN_SIGN_STATE",y="RCDATA_END_TAG_OPEN_STATE",C="RCDATA_END_TAG_NAME_STATE",_="RAWTEXT_LESS_THAN_SIGN_STATE",k="RAWTEXT_END_TAG_OPEN_STATE",b="RAWTEXT_END_TAG_NAME_STATE",D="SCRIPT_DATA_LESS_THAN_SIGN_STATE",N="SCRIPT_DATA_END_TAG_OPEN_STATE",S="SCRIPT_DATA_END_TAG_NAME_STATE",O="SCRIPT_DATA_ESCAPE_START_STATE",F="SCRIPT_DATA_ESCAPE_START_DASH_STATE",x="SCRIPT_DATA_ESCAPED_STATE",I="SCRIPT_DATA_ESCAPED_DASH_STATE",R="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",w="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",L="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",M="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",P="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",B="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",H="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",U="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",j="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",G="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",K="BEFORE_ATTRIBUTE_NAME_STATE",z="ATTRIBUTE_NAME_STATE",Y="AFTER_ATTRIBUTE_NAME_STATE",Z="BEFORE_ATTRIBUTE_VALUE_STATE",Q="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",W="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",V="ATTRIBUTE_VALUE_UNQUOTED_STATE",q="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",X="SELF_CLOSING_START_TAG_STATE",$="BOGUS_COMMENT_STATE",J="MARKUP_DECLARATION_OPEN_STATE",ee="COMMENT_START_STATE",te="COMMENT_START_DASH_STATE",ne="COMMENT_STATE",re="COMMENT_LESS_THAN_SIGN_STATE",ie="COMMENT_LESS_THAN_SIGN_BANG_STATE",oe="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ae="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",ue="COMMENT_END_DASH_STATE",se="COMMENT_END_STATE",le="COMMENT_END_BANG_STATE",ce="DOCTYPE_STATE",fe="BEFORE_DOCTYPE_NAME_STATE",pe="DOCTYPE_NAME_STATE",he="AFTER_DOCTYPE_NAME_STATE",de="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",me="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",Ee="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",Te="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",ge="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",ve="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",Ae="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",ye="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",Ce="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",_e="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",ke="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",be="BOGUS_DOCTYPE_STATE",De="CDATA_SECTION_STATE",Ne="CDATA_SECTION_BRACKET_STATE",Se="CDATA_SECTION_END_STATE",Oe="CHARACTER_REFERENCE_STATE",Fe="NAMED_CHARACTER_REFERENCE_STATE",xe="AMBIGUOS_AMPERSAND_STATE",Ie="NUMERIC_CHARACTER_REFERENCE_STATE",Re="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",we="DECIMAL_CHARACTER_REFERENCE_START_STATE",Le="HEXADEMICAL_CHARACTER_REFERENCE_STATE",Me="DECIMAL_CHARACTER_REFERENCE_STATE",Pe="NUMERIC_CHARACTER_REFERENCE_END_STATE";function Be(e){return e===l.SPACE||e===l.LINE_FEED||e===l.TABULATION||e===l.FORM_FEED}function He(e){return e>=l.DIGIT_0&&e<=l.DIGIT_9}function Ue(e){return e>=l.LATIN_CAPITAL_A&&e<=l.LATIN_CAPITAL_Z}function je(e){return e>=l.LATIN_SMALL_A&&e<=l.LATIN_SMALL_Z}function Ge(e){return je(e)||Ue(e)}function Ke(e){return Ge(e)||He(e)}function ze(e){return e>=l.LATIN_CAPITAL_A&&e<=l.LATIN_CAPITAL_F}function Ye(e){return e>=l.LATIN_SMALL_A&&e<=l.LATIN_SMALL_F}function Ze(e){return e+32}function Qe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function We(e){return String.fromCharCode(Ze(e))}function Ve(e,t){for(var n=u[++e],r=++e,i=r+n-1;r<=i;){var o=r+i>>>1,a=u[o];if(at))return u[o+n];i=o-1}}return-1}var qe=function(){function e(){r(this,e),this.preprocessor=new o,this.tokenQueue=[],this.allowCDATA=!1,this.state=p,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}return i(e,[{key:"_err",value:function(){}},{key:"_errOnNextCodePoint",value:function(e){this._consume(),this._err(e),this._unconsume()}},{key:"getNextToken",value:function(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;var e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}},{key:"write",value:function(e,t){this.active=!0,this.preprocessor.write(e,t)}},{key:"insertHtmlAtCurrentPos",value:function(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}},{key:"_ensureHibernation",value:function(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:e.HIBERNATION_TOKEN}),!0}return!1}},{key:"_consume",value:function(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}},{key:"_unconsume",value:function(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}},{key:"_reconsumeInState",value:function(e){this.state=e,this._unconsume()}},{key:"_consumeSequenceIfMatch",value:function(e,t,n){for(var r=0,i=!0,o=e.length,a=0,u=t,s=void 0;a0&&(u=this._consume(),r++),u===l.EOF){i=!1;break}if(u!==(s=e[a])&&(n||u!==Ze(s))){i=!1;break}}if(!i)for(;r--;)this._unconsume();return i}},{key:"_isTempBufferEqualToScriptString",value:function(){if(this.tempBuff.length!==c.SCRIPT_STRING.length)return!1;for(var e=0;e0&&this._err(s.endTagWithAttributes),t.selfClosing&&this._err(s.endTagWithTrailingSolidus)),this.tokenQueue.push(t)}},{key:"_emitCurrentCharacterToken",value:function(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}},{key:"_emitEOFToken",value:function(){this._createEOFToken(),this._emitCurrentToken()}},{key:"_appendCharToCurrentCharacterToken",value:function(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}},{key:"_emitCodePoint",value:function(t){var n=e.CHARACTER_TOKEN;Be(t)?n=e.WHITESPACE_CHARACTER_TOKEN:t===l.NULL&&(n=e.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(n,Qe(t))}},{key:"_emitSeveralCodePoints",value:function(e){for(var t=0;t-1;){var i=u[r],o=i<7;o&&1&i&&(t=2&i?[u[++r],u[++r]]:[u[++r]],n=0);var a=this._consume();if(this.tempBuff.push(a),n++,a===l.EOF)break;r=o?4&i?Ve(r,a):-1:a===i?++r:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}},{key:"_isCharacterReferenceInAttribute",value:function(){return this.returnState===Q||this.returnState===W||this.returnState===V}},{key:"_isCharacterReferenceAttributeQuirk",value:function(e){if(!e&&this._isCharacterReferenceInAttribute()){var t=this._consume();return this._unconsume(),t===l.EQUALS_SIGN||Ke(t)}return!1}},{key:"_flushCodePointsConsumedAsCharacterReference",value:function(){if(this._isCharacterReferenceInAttribute())for(var e=0;e")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.state=x,this._emitChars(a.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=x,this._emitCodePoint(e))}},{key:w,value:function(e){e===l.SOLIDUS?(this.tempBuff=[],this.state=L):Ge(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(P)):(this._emitChars("<"),this._reconsumeInState(x))}},{key:L,value:function(e){Ge(e)?(this._createEndTagToken(),this._reconsumeInState(M)):(this._emitChars("")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.state=B,this._emitChars(a.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=B,this._emitCodePoint(e))}},{key:j,value:function(e){e===l.SOLIDUS?(this.tempBuff=[],this.state=G,this._emitChars("/")):this._reconsumeInState(B)}},{key:G,value:function(e){Be(e)||e===l.SOLIDUS||e===l.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?x:B,this._emitCodePoint(e)):Ue(e)?(this.tempBuff.push(Ze(e)),this._emitCodePoint(e)):je(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(B)}},{key:K,value:function(e){Be(e)||(e===l.SOLIDUS||e===l.GREATER_THAN_SIGN||e===l.EOF?this._reconsumeInState(Y):e===l.EQUALS_SIGN?(this._err(s.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=z):(this._createAttr(""),this._reconsumeInState(z)))}},{key:z,value:function(e){Be(e)||e===l.SOLIDUS||e===l.GREATER_THAN_SIGN||e===l.EOF?(this._leaveAttrName(Y),this._unconsume()):e===l.EQUALS_SIGN?this._leaveAttrName(Z):Ue(e)?this.currentAttr.name+=We(e):e===l.QUOTATION_MARK||e===l.APOSTROPHE||e===l.LESS_THAN_SIGN?(this._err(s.unexpectedCharacterInAttributeName),this.currentAttr.name+=Qe(e)):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.name+=a.REPLACEMENT_CHARACTER):this.currentAttr.name+=Qe(e)}},{key:Y,value:function(e){Be(e)||(e===l.SOLIDUS?this.state=X:e===l.EQUALS_SIGN?this.state=Z:e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(z)))}},{key:Z,value:function(e){Be(e)||(e===l.QUOTATION_MARK?this.state=Q:e===l.APOSTROPHE?this.state=W:e===l.GREATER_THAN_SIGN?(this._err(s.missingAttributeValue),this.state=p,this._emitCurrentToken()):this._reconsumeInState(V))}},{key:Q,value:function(e){e===l.QUOTATION_MARK?this.state=q:e===l.AMPERSAND?(this.returnState=Q,this.state=Oe):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=a.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Qe(e)}},{key:W,value:function(e){e===l.APOSTROPHE?this.state=q:e===l.AMPERSAND?(this.returnState=W,this.state=Oe):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=a.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Qe(e)}},{key:V,value:function(e){Be(e)?this._leaveAttrValue(K):e===l.AMPERSAND?(this.returnState=V,this.state=Oe):e===l.GREATER_THAN_SIGN?(this._leaveAttrValue(p),this._emitCurrentToken()):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=a.REPLACEMENT_CHARACTER):e===l.QUOTATION_MARK||e===l.APOSTROPHE||e===l.LESS_THAN_SIGN||e===l.EQUALS_SIGN||e===l.GRAVE_ACCENT?(this._err(s.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=Qe(e)):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Qe(e)}},{key:q,value:function(e){Be(e)?this._leaveAttrValue(K):e===l.SOLIDUS?this._leaveAttrValue(X):e===l.GREATER_THAN_SIGN?(this._leaveAttrValue(p),this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.missingWhitespaceBetweenAttributes),this._reconsumeInState(K))}},{key:X,value:function(e){e===l.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.unexpectedSolidusInTag),this._reconsumeInState(K))}},{key:$,value:function(e){e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===l.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=a.REPLACEMENT_CHARACTER):this.currentToken.data+=Qe(e)}},{key:J,value:function(e){this._consumeSequenceIfMatch(c.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=ee):this._consumeSequenceIfMatch(c.DOCTYPE_STRING,e,!1)?this.state=ce:this._consumeSequenceIfMatch(c.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=De:(this._err(s.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=$):this._ensureHibernation()||(this._err(s.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState($))}},{key:ee,value:function(e){e===l.HYPHEN_MINUS?this.state=te:e===l.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=p,this._emitCurrentToken()):this._reconsumeInState(ne)}},{key:te,value:function(e){e===l.HYPHEN_MINUS?this.state=se:e===l.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ne))}},{key:ne,value:function(e){e===l.HYPHEN_MINUS?this.state=ue:e===l.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=re):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=a.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=Qe(e)}},{key:re,value:function(e){e===l.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=ie):e===l.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(ne)}},{key:ie,value:function(e){e===l.HYPHEN_MINUS?this.state=oe:this._reconsumeInState(ne)}},{key:oe,value:function(e){e===l.HYPHEN_MINUS?this.state=ae:this._reconsumeInState(ue)}},{key:ae,value:function(e){e!==l.GREATER_THAN_SIGN&&e!==l.EOF&&this._err(s.nestedComment),this._reconsumeInState(se)}},{key:ue,value:function(e){e===l.HYPHEN_MINUS?this.state=se:e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ne))}},{key:se,value:function(e){e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===l.EXCLAMATION_MARK?this.state=le:e===l.HYPHEN_MINUS?this.currentToken.data+="-":e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(ne))}},{key:le,value:function(e){e===l.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=ue):e===l.GREATER_THAN_SIGN?(this._err(s.incorrectlyClosedComment),this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(ne))}},{key:ce,value:function(e){Be(e)?this.state=fe:e===l.GREATER_THAN_SIGN?this._reconsumeInState(fe):e===l.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingWhitespaceBeforeDoctypeName),this._reconsumeInState(fe))}},{key:fe,value:function(e){Be(e)||(Ue(e)?(this._createDoctypeToken(We(e)),this.state=pe):e===l.NULL?(this._err(s.unexpectedNullCharacter),this._createDoctypeToken(a.REPLACEMENT_CHARACTER),this.state=pe):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(Qe(e)),this.state=pe))}},{key:pe,value:function(e){Be(e)?this.state=he:e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):Ue(e)?this.currentToken.name+=We(e):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.name+=a.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=Qe(e)}},{key:he,value:function(e){Be(e)||(e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(c.PUBLIC_STRING,e,!1)?this.state=de:this._consumeSequenceIfMatch(c.SYSTEM_STRING,e,!1)?this.state=Ae:this._ensureHibernation()||(this._err(s.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState(be)))}},{key:de,value:function(e){Be(e)?this.state=me:e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=Ee):e===l.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=Te):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be))}},{key:me,value:function(e){Be(e)||(e===l.QUOTATION_MARK?(this.currentToken.publicId="",this.state=Ee):e===l.APOSTROPHE?(this.currentToken.publicId="",this.state=Te):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be)))}},{key:Ee,value:function(e){e===l.QUOTATION_MARK?this.state=ge:e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=a.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Qe(e)}},{key:Te,value:function(e){e===l.APOSTROPHE?this.state=ge:e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=a.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Qe(e)}},{key:ge,value:function(e){Be(e)?this.state=ve:e===l.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=Ce):e===l.APOSTROPHE?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=_e):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be))}},{key:ve,value:function(e){Be(e)||(e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===l.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ce):e===l.APOSTROPHE?(this.currentToken.systemId="",this.state=_e):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be)))}},{key:Ae,value:function(e){Be(e)?this.state=ye:e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=Ce):e===l.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=_e):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be))}},{key:ye,value:function(e){Be(e)||(e===l.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ce):e===l.APOSTROPHE?(this.currentToken.systemId="",this.state=_e):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(be)))}},{key:Ce,value:function(e){e===l.QUOTATION_MARK?this.state=ke:e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=a.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Qe(e)}},{key:_e,value:function(e){e===l.APOSTROPHE?this.state=ke:e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=a.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Qe(e)}},{key:ke,value:function(e){Be(e)||(e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState(be)))}},{key:be,value:function(e){e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===l.NULL?this._err(s.unexpectedNullCharacter):e===l.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}},{key:De,value:function(e){e===l.RIGHT_SQUARE_BRACKET?this.state=Ne:e===l.EOF?(this._err(s.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}},{key:Ne,value:function(e){e===l.RIGHT_SQUARE_BRACKET?this.state=Se:(this._emitChars("]"),this._reconsumeInState(De))}},{key:Se,value:function(e){e===l.GREATER_THAN_SIGN?this.state=p:e===l.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(De))}},{key:Oe,value:function(e){this.tempBuff=[l.AMPERSAND],e===l.NUMBER_SIGN?(this.tempBuff.push(e),this.state=Ie):Ke(e)?this._reconsumeInState(Fe):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:Fe,value:function(e){var t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[l.AMPERSAND];else if(t){var n=this.tempBuff[this.tempBuff.length-1]===l.SEMICOLON;this._isCharacterReferenceAttributeQuirk(n)||(n||this._errOnNextCodePoint(s.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state=xe}},{key:xe,value:function(e){Ke(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=Qe(e):this._emitCodePoint(e):(e===l.SEMICOLON&&this._err(s.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}},{key:Ie,value:function(e){this.charRefCode=0,e===l.LATIN_SMALL_X||e===l.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=Re):this._reconsumeInState(we)}},{key:Re,value:function(e){!function(e){return He(e)||ze(e)||Ye(e)}(e)?(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(Le)}},{key:we,value:function(e){He(e)?this._reconsumeInState(Me):(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:Le,value:function(e){ze(e)?this.charRefCode=16*this.charRefCode+e-55:Ye(e)?this.charRefCode=16*this.charRefCode+e-87:He(e)?this.charRefCode=16*this.charRefCode+e-48:e===l.SEMICOLON?this.state=Pe:(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState(Pe))}},{key:Me,value:function(e){He(e)?this.charRefCode=10*this.charRefCode+e-48:e===l.SEMICOLON?this.state=Pe:(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState(Pe))}},{key:Pe,value:function(){if(this.charRefCode===l.NULL)this._err(s.nullCharacterReference),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(s.characterReferenceOutsideUnicodeRange),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(a.isSurrogate(this.charRefCode))this._err(s.surrogateCharacterReference),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(a.isUndefinedCodePoint(this.charRefCode))this._err(s.noncharacterCharacterReference);else if(a.isControlCodePoint(this.charRefCode)||this.charRefCode===l.CARRIAGE_RETURN){this._err(s.controlCharacterReference);var e=f[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}]),e}();qe.CHARACTER_TOKEN="CHARACTER_TOKEN",qe.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",qe.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",qe.START_TAG_TOKEN="START_TAG_TOKEN",qe.END_TAG_TOKEN="END_TAG_TOKEN",qe.COMMENT_TOKEN="COMMENT_TOKEN",qe.DOCTYPE_TOKEN="DOCTYPE_TOKEN",qe.EOF_TOKEN="EOF_TOKEN",qe.HIBERNATION_TOKEN="HIBERNATION_TOKEN",qe.MODE={DATA:p,RCDATA:h,RAWTEXT:d,SCRIPT_DATA:m,PLAINTEXT:E},qe.getTokenAttr=function(e,t){for(var n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null},e.exports=qe},6036:function(e){"use strict";e.exports=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204])},676:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,o=n(3906),a=n(9359),u=o.CODE_POINTS,s=function(){function e(){r(this,e),this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536}return i(e,[{key:"_err",value:function(){}},{key:"_addGap",value:function(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}},{key:"_processSurrogate",value:function(e){if(this.pos!==this.lastCharPos){var t=this.html.charCodeAt(this.pos+1);if(o.isSurrogatePair(t))return this.pos++,this._addGap(),o.getSurrogatePairCodePoint(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,u.EOF;return this._err(a.surrogateInInputStream),e}},{key:"dropParsedChunk",value:function(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])}},{key:"write",value:function(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t}},{key:"insertHtmlAtCurrentPos",value:function(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1}},{key:"advance",value:function(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,u.EOF;var e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===u.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===u.CARRIAGE_RETURN?(this.skipNextNewLine=!0,u.LINE_FEED):(this.skipNextNewLine=!1,o.isSurrogate(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===u.LINE_FEED||e===u.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}},{key:"_checkForProblematicCharacters",value:function(e){o.isControlCodePoint(e)?this._err(a.controlCharacterInInputStream):o.isUndefinedCodePoint(e)&&this._err(a.noncharacterInInputStream)}},{key:"retreat",value:function(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}}]),e}();e.exports=s},1993:function(e,t,n){"use strict";var r=n(9550).DOCUMENT_MODE;t.createDocument=function(){return{nodeName:"#document",mode:r.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return{nodeName:"#comment",data:e,parentNode:null}};var i=function(e){return{nodeName:"#text",value:e,parentNode:null}},o=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e},a=t.insertBefore=function(e,t,n){var r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e};t.setTemplateContent=function(e,t){e.content=t},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,n,r){for(var i=null,a=0;a>>1,i=e[r];if(!(0>>1;ro(s,n))lo(c,s)?(e[r]=c,e[l]=n,r=l):(e[r]=s,e[u]=n,r=u);else{if(!(lo(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var u=Date,s=u.now();t.unstable_now=function(){return u.now()-s}}var l=[],c=[],f=1,p=null,h=3,d=!1,m=!1,E=!1,T="function"===typeof setTimeout?setTimeout:null,g="function"===typeof clearTimeout?clearTimeout:null,v="undefined"!==typeof setImmediate?setImmediate:null;function A(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(l,t)}t=r(c)}}function y(e){if(E=!1,A(e),!m)if(null!==r(l))m=!0,R(C);else{var t=r(c);null!==t&&w(y,t.startTime-e)}}function C(e,n){m=!1,E&&(E=!1,g(D),D=-1),d=!0;var o=h;try{for(A(n),p=r(l);null!==p&&(!(p.expirationTime>n)||e&&!O());){var a=p.callback;if("function"===typeof a){p.callback=null,h=p.priorityLevel;var u=a(p.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?p.callback=u:p===r(l)&&i(l),A(n)}else i(l);p=r(l)}if(null!==p)var s=!0;else{var f=r(c);null!==f&&w(y,f.startTime-n),s=!1}return s}finally{p=null,h=o,d=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,k=!1,b=null,D=-1,N=5,S=-1;function O(){return!(t.unstable_now()-Se||125a?(e.sortIndex=o,n(c,e),null===r(l)&&e===r(c)&&(E?(g(D),D=-1):E=!0,w(y,o-a))):(e.sortIndex=u,n(l,e),m||d||(m=!0,R(C))),e},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},8623:function(e,t,n){"use strict";e.exports=n(9282)},821:function(e,t,n){var r=n(5341);e.exports=function(e,t){var n,i=null;if(!e||"string"!==typeof e)return i;for(var o,a,u=r(e),s="function"===typeof t,l=0,c=u.length;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},6389:function(e,t,n){var r=n(3808),i=n(9617),o=n(4993);e.exports=function(e){var t=i();return function(){var n,i=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return o(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},8416:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},1588:function(e,t,n){var r=n(1753);function i(){return"undefined"!==typeof Reflect&&Reflect.get?(e.exports=i=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3808:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:function(e,t,n){var r=n(6015);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},6035:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:function(e){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},8872:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(s){u=!0,i=s}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:function(e,t,n){var r=n(8698).default,i=n(6115);e.exports=function(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6015:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:function(e,t,n){var r=n(5372),i=n(8872),o=n(6116),a=n(2218);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},1753:function(e,t,n){var r=n(3808);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},8698:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:function(e,t,n){var r=n(3897);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:function(e,t,n){var r=n(3808),i=n(6015),o=n(6035),a=n(3515);function u(t){var n="function"===typeof Map?new Map:void 0;return e.exports=u=function(e){if(null===e||!o(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,u(t)}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"div",a=e||"",u={},s=0;s2?l-2:0),m=2;m=48&&t<=57}function a(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function u(e){return function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||o(e)}var s=n(9156),l=String.fromCharCode,c=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function f(e){var t,n,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d="string"===typeof f.additional?f.additional.charCodeAt(0):f.additional,m=[],E=0,T=-1,g="";f.position&&("start"in f.position||"indent"in f.position?(n=f.position.indent,t=f.position.start):t=f.position);var v,A=(t?t.line:0)||1,y=(t?t.column:0)||1,C=K();for(E--;++E<=e.length;)if(10===v&&(y=(n?n[T]:0)||1),38===(v=e.charCodeAt(E))){var _=e.charCodeAt(E+1);if(9===_||10===_||12===_||32===_||38===_||60===_||Number.isNaN(_)||d&&_===d){g+=l(v),y++;continue}var k=E+1,b=k,D=k,N=void 0;if(35===_){D=++b;var S=e.charCodeAt(D);88===S||120===S?(N="hexadecimal",D=++b):N="decimal"}else N="named";var O="",F="",x="",I="named"===N?u:"decimal"===N?o:a;for(D--;++D<=e.length;){var R=e.charCodeAt(D);if(!I(R))break;x+=l(R),"named"===N&&r.includes(x)&&(O=x,F=(0,s.T)(x))}var w=59===e.charCodeAt(D);if(w){D++;var L="named"===N&&(0,s.T)(x);L&&(O=x,F=L)}var M=1+D-k,P="";if(w||!1!==f.nonTerminated)if(x)if("named"===N){if(w&&!F)z(5,1);else if(O!==x&&(M=1+(D=b+O.length)-b,w=!1),!w){var B=O?1:3;if(f.attribute){var H=e.charCodeAt(D);61===H?(z(B,M),F=""):u(H)?F="":z(B,M)}else z(B,M)}P=F}else{w||z(2,M);var U=Number.parseInt(x,"hexadecimal"===N?16:10);if(p(U))z(7,M),P=l(65533);else if(U in i)z(6,M),P=i[U];else{var j="";h(U)&&z(6,M),U>65535&&(j+=l((U-=65536)>>>10|55296),U=56320|1023&U),P=j+l(U)}}else"named"!==N&&z(4,M);else;if(P){Y(),C=K(),E=D-1,y+=D-k+1,m.push(P);var G=K();G.offset++,f.reference&&f.reference.call(f.referenceContext,P,{start:C,end:G},e.slice(k-1,D)),C=G}else x=e.slice(k-1,D),g+=x,y+=x.length,E=D-1}else 10===v&&(A++,T++,y=0),Number.isNaN(v)?Y():(g+=l(v),y++);return m.join("");function K(){return{line:A,column:y,offset:E+((t?t.offset:0)||0)}}function z(e,t){var n;f.warning&&((n=K()).column+=t,n.offset+=t,f.warning.call(f.warningContext,c[e],n,e))}function Y(){g&&(m.push(g),f.text&&f.text.call(f.textContext,g,{start:C,end:K()}),g="")}}function p(e){return e>=55296&&e<=57343||e>1114111}function h(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535===(65535&e)||65534===(65535&e)}},2925:function(e,t,n){"use strict";n.d(t,{dy:function(){return A},YP:function(){return y}});var r=n(3144),i=n(5671),o=(0,r.Z)((function e(t,n,r){(0,i.Z)(this,e),this.property=t,this.normal=n,r&&(this.space=r)}));function a(e,t){for(var n={},r={},i=-1;++i4&&"data"===n.slice(0,4)&&a.test(t)){if("-"===t.charAt(4)){var h=t.slice(5).replace(u,f);l="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{var d=t.slice(4);if(!u.test(d)){var m=d.replace(s,c);"-"!==m.charAt(0)&&(m="-"+m),t="data"+m}}p=i.I}return new p(l,t)}function c(e){return"-"+e.toLowerCase()}function f(e){return e.charAt(1).toUpperCase()}},3661:function(e,t,n){"use strict";function r(e){return e.toLowerCase()}n.d(t,{F:function(){return r}})},6212:function(e,t,n){"use strict";n.d(t,{I:function(){return f}});var r=n(3144),i=n(5671),o=n(7326),a=n(136),u=n(3668),s=n(6246),l=n(6944),c=Object.keys(l),f=function(e){(0,a.Z)(n,e);var t=(0,u.Z)(n);function n(e,r,a,u){var s;(0,i.Z)(this,n);var f=-1;if(s=t.call(this,e,r),p((0,o.Z)(s),"space",u),"number"===typeof a)for(;++f=o)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(u=!1,o0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[r,i,o]}}(),n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",function(){var e={179:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var i,o,a=r[0],u=r[1],s=r[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(i in u)n.o(u,i)&&(n.m[i]=u[i]);if(s)var c=s(n)}for(t&&t(r);l= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","// @ts-ignore\ndeclare global {\n interface HTMLElementTagNameMap {\n 'github-corners': GithubCorners;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'github-corners': Partial | {\n style?: Partial | React.CSSProperties;\n };\n }\n }\n}\n\nconst GITHUB_CORNERS_TEMPLATE = document.createElement(\"template\");\nGITHUB_CORNERS_TEMPLATE.innerHTML = `\n\n\n \n \n \n \n \n \n \n\n`;\n\nexport class GithubCorners extends HTMLElement {\n /** Sets the z-order of a positioned element and its descendants or flex items. */\n 'z-index'?: string;\n height?: string | number;\n width?: string | number;\n href?: string;\n color?: string;\n fill?: string;\n position?: string;\n target?: string;\n top?: string;\n left?: string;\n right?: string = '0';\n bottom?: string;\n transform?: string;\n private shadow: ShadowRoot\n static get observedAttributes(): string[] {\n return ['style', 'z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];\n }\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: 'open' });\n this.shadow.appendChild(this.ownerDocument.importNode(GITHUB_CORNERS_TEMPLATE.content, true));\n this.update()\n }\n private setAttr(name: string, value: string) {\n const svg = this.shadow.querySelector('svg');\n if (/(href)/.test(name.toLocaleLowerCase())) {\n svg.lastElementChild.setAttribute('xlink:href', value);\n } else if (/(color|fill)/.test(name.toLocaleLowerCase())) {\n (svg.firstElementChild as HTMLAnchorElement).style[name as any] = value;\n } else if (/(z-index|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {\n svg.style[name as any] = value;\n } else {\n svg.setAttribute(name, value);\n }\n }\n private update() {\n ;[...this.getAttributeNames(), 'right'].forEach((name) => {\n const value = this.getAttribute(name) || this[name as keyof GithubCorners] as any || '';\n this.setAttr(name, value);\n });\n }\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (oldValue !== newValue) {\n this.setAttr(name, newValue);\n }\n }\n}\n\ncustomElements.define('github-corners', GithubCorners);","import React from 'react';\nimport '@uiw/github-corners';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /** Is it displayed at the bottom? */\n bottom?: boolean,\n /** \n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default function githubCorners(props: GitHubCornersProps) {\n const { size = 80, fixed = false, bottom, zIndex, className, style, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl: React.CSSProperties = position === 'left' ? { left: 0, right: 'initial', transform: 'scale(-1, 1)' } : { right: 0, left: 'initial', transform: 'scale(1, 1)' };\n if (bottom) {\n styl.bottom = 0;\n styl.top = 'initial';\n styl.transform = position === 'left' ? 'scale(-1, -1)' : 'scale(1, -1)';\n } else {\n styl.bottom = 'initial';\n styl.top = 0;\n }\n return (\n \n );\n}","import React, { Component, ReactElement } from 'react';\nimport { BaseProps } from '../common/Base';\n\nexport interface ContainerProps extends BaseProps {}\n\nexport default class Container extends Component {\n render() {\n return (\n <>\n {React.Children.toArray(this.props.children).map((child: React.ReactNode) => {\n if (!React.isValidElement(child)) return null;\n return React.cloneElement(child as ReactElement, { ...this.props, ...(child as React.ReactElement).props });\n })}\n \n );\n }\n}","import React, { Component } from 'react';\n\nexport interface BaseProps {\n platform?: 'github' | 'coveralls' | 'npm';\n type?: string;\n user?: string;\n repo?: string;\n base?: string;\n href?: HTMLAnchorElement['href'];\n children?: React.ReactNode;\n}\n\nexport interface BaseState extends BaseProps {}\n\nexport default class Base extends Component {\n static defaultProps: BaseProps = {\n platform: 'github',\n base: 'https://img.shields.io',\n }\n constructor(props: BaseProps & T, defaultState: BaseProps & T, forceState?: BaseProps & T) {\n super(props);\n this.state = Object.assign({}, { ...defaultState, ...props }, forceState);\n }\n getUrl = () => '';\n render() {\n const { href } = this.state;\n if (href) {\n return \"\" ;\n }\n return \"\";\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface IssueProps extends BaseProps {\n /**\n * Github Issue\n * \n * `/github/:issueKind/detail/:property/:user/:repo/:number` \n * GitHub issue/pull request detail: GitHub issue/pull request detail badge \n * \n * `/github/issues/:user/:repo` \n * GitHub issues: GitHub issues badge \n * \n * `/github/issues-raw/:user/:repo` \n * GitHub issues: GitHub issues badge \n * \n * `/github/issues/:user/:repo/:label` \n * GitHub issues by-label: GitHub issues by-label badge \n * \n * `/github/issues-raw/:user/:repo/:label` \n * GitHub issues by-label: GitHub issues by-label badge \n * \n * `/github/issues-closed/:user/:repo` \n * GitHub closed issues: GitHub closed issues badge \n * \n * `/github/issues-closed-raw/:user/:repo` \n * GitHub closed issues: GitHub closed issues badge \n * \n * `/github/issues-pr/:user/:repo` \n * GitHub pull requests: GitHub pull requests badge \n * \n * `/github/issues-pr-raw/:user/:repo` \n * GitHub pull requests: GitHub pull requests badge \n * \n * `/github/issues-pr-closed/:user/:repo` \n * GitHub closed pull requests: GitHub closed pull requests badge \n * \n * `/github/issues-pr-closed-raw/:user/:repo` \n * GitHub closed pull requests: GitHub closed pull requests badge \n * \n * `/github/issues-pr/:user/:repo/:label` \n * GitHub pull requests by-label: GitHub pull requests by-label badge \n * \n * `/github/issues-pr-raw/:user/:repo/:label` \n * GitHub pull requests by-label: GitHub pull requests by-label badge \n * \n * `/github/labels/:user/:repo/:name` \n * GitHub labels: GitHub labels badge \n */\n type?: 'issueKind' | 'issues' | 'issues-raw' | 'issues-closed'\n | 'issues-closed-raw' | 'issues-pr' | 'issues-pr-raw' \n | 'issues-pr-closed' | 'issues-pr-closed-raw'\n | 'languages';\n /**\n * /github/:issueKind/detail/:property/:user/:repo/:number\n */\n property?: string;\n /**\n * /github/:issueKind/detail/:property/:user/:repo/:number\n */\n number?: string;\n label?: string;\n}\n\nexport default class Issue extends Base {\n constructor(props: IssueProps) {\n super(props, { platform: 'github', type: 'issues' });\n };\n getUrl = () => {\n const { type, platform, property, user, repo, label, base } = this.state;\n if (platform !== 'github') return '';\n if (type === 'issues' || /^issues-(raw|closed|closed-raw|pr|pr-raw|pr-closed|pr-closed-raw)/.test(type!)) {\n if(label && (type === 'issues' || /^issues-(raw|pr|pr-raw)/.test(type || ''))) {\n return [base, platform, type, user, repo, label].join('/');\n }\n return [base, platform, type, user, repo].join('/');\n }\n if(type === 'issueKind') {\n return [base, platform, type, 'detail', property, user, repo].join('/');\n }\n return '';\n }\n}","import Base, { BaseProps } from '../common/Base';\n\nexport interface SizeProps extends BaseProps {\n /**\n * Github Size\n * \n * /github/languages/code-size/:user/:repo \n * /github/repo-size/:user/:repo \n * /github/size/:user/:repo/:path* \n */\n type?: 'languages' | 'repo-size' | 'size';\n /**\n * GitHub file size in bytes\n * build/phaser-craft.min.js\n */\n path?: string;\n}\n\nexport default class Size extends Base {\n constructor(props: SizeProps) {\n super(props, { platform: 'github', type: 'languages' });\n };\n\n getUrl = () => {\n const { type, platform, user, repo, base, path } = this.state;\n if (platform !== 'github') return '';\n /**\n * /github/languages/code-size/:user/:repo\n */\n if (type === 'languages') {\n return [base, platform, type, 'code-size', user, repo].join('/');\n }\n /**\n * /github/repo-size/:user/:repo\n */\n if (type === 'repo-size') {\n return [base, platform, type, user, repo].join('/');\n }\n /**\n * /github/size/:user/:repo/:path*\n */\n if (type === 'size' && path) {\n return [base, platform, type, user, repo, path].join('/');\n }\n return '';\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface ActivityProps extends BaseProps {\n /**\n * Github Downloads\n * \n * `/github/downloads/:user/:repo/total`\n * GitHub All Releases: GitHub All Releases badge \n * \n * `/github/downloads/:user/:repo/:tag/total`\n * GitHub Releases: GitHub Releases badge \n * \n * `/github/downloads-pre/:user/:repo/:tag/total`\n * GitHub Pre-Releases: GitHub Pre-Releases badge \n * \n * `/github/downloads/:user/:repo/:tag/total`\n * GitHub Releases (by Release): GitHub Releases (by Release) badge \n * \n * `/github/downloads/:user/:repo/:tag/:path`\n * GitHub Releases (by Asset): GitHub Releases (by Asset) badge \n * \n * `/github/downloads-pre/:user/:repo/:tag/:path`\n * GitHub Pre-Releases (by Asset): GitHub Pre-Releases (by Asset) badge \n */\n type?: 'downloads' | 'downloads-pre';\n tag?: string;\n path?: string;\n total?: boolean;\n}\n\nexport default class Activity extends Base {\n constructor(props: ActivityProps) {\n super(props, { platform: 'github', type: 'downloads', total: true });\n };\n getUrl = () => {\n const { type, platform, user, repo, base, tag, path, total } = this.state;\n if (platform !== 'github' || !/^(downloads|downloads-pre)/.test(type || '')) return '';\n\n const baseData = [base, platform, type, user, repo];\n\n if (path && tag) {\n return [...baseData, tag, path].join('/');\n }\n if ((total && tag) || (type === 'downloads-pre' && tag && total)) {\n return [...baseData, tag, 'total'].join('/');\n }\n if (total) {\n return [...baseData, 'total'].join('/');\n }\n return '';\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface ActivityProps extends BaseProps {\n /**\n * `/github/commit-activity/:interval/:user/:repo`\n * GitHub commit activity: GitHub commit activity badge \n * \n * `/github/commits-since/:user/:repo/:version/:branch*`\n * GitHub commits since tagged version: GitHub commits since tagged version badge \n * \n * `/github/commits-since/:user/:repo/:version/:branch*`\n * GitHub commits since tagged version (branch): GitHub commits since tagged version (branch) badge \n * \n * `/github/commits-since/:user/:repo/:version/:branch*`\n * GitHub commits since latest release: GitHub commits since latest release badge \n * \n * `/github/commits-since/:user/:repo/:version/:branch*`\n * GitHub commits since latest release (branch): GitHub commits since latest release (branch) badge \n * \n * `/github/:variant/:user/:repo`\n * GitHub contributors: GitHub contributors badge \n * \n * `/github/last-commit/:user/:repo`\n * GitHub last commit: GitHub last commit badge \n * \n * `/github/last-commit/:user/:repo/:branch`\n * GitHub last commit (branch): GitHub last commit (branch) badge \n * \n * `/github/release-date/:user/:repo`\n * GitHub Release Date: GitHub Release Date badge \n * \n * `/github/release-date-pre/:user/:repo`\n * GitHub (Pre-)Release Date: GitHub (Pre-)Release Date badge \n */\n type?: 'commit-activity' | 'commits-since' | 'variant' | 'last-commit' | 'release-date' | 'release-date-pre';\n variant?: string;\n interval?: 'y' | 'm' | 'w';\n version?: 'contributors' | 'contributors-anon';\n branch?: string;\n}\n\nexport default class Activity extends Base {\n constructor(props: ActivityProps) {\n super(props, { platform: 'github', type: 'commits-since' });\n };\n getUrl = () => {\n const { type, platform, user, repo, base, interval, variant, version, branch } = this.state;\n if (platform !== 'github') return '';\n if (type === 'commits-since' && version && branch) {\n return [base, platform, type, user, repo, version, branch].join('/');\n }\n if (type === 'commit-activity' && interval) {\n return [base, platform, type, interval, user, repo].join('/');\n }\n if (type === 'variant' && variant) {\n return [base, platform, type, variant, user, repo].join('/');\n }\n if (type === 'last-commit') {\n return branch ? [base, platform, type, user, repo, branch].join('/') : [base, platform, type, user, repo].join('/');\n }\n if (type && /^release-(date|date-pre)/.test(type)) {\n return [base, platform, type, user, repo].join('/');\n }\n return '';\n }\n}","import Base, { BaseProps } from '../common/Base';\n\nexport interface VersionProps extends BaseProps {\n /**\n * Github Version\n * \n * `/github/go-mod/go-version/:user/:repo`\n * GitHub go.mod Go version: GitHub go.mod Go version badge \n * \n * `/github/go-mod/go-version/:user/:repo/:branch`\n * GitHub go.mod Go version (branch): GitHub go.mod Go version (branch) badge \n * \n * `/github/go-mod/go-version/:user/:repo?filename=src%2Fgo.mod`\n * GitHub go.mod Go version (subfolder of monorepo): GitHub go.mod Go version (subfolder of monorepo) badge \n * \n * `/github/go-mod/go-version/:user/:repo/:branch?filename=src%2Fgo.mod`\n * GitHub go.mod Go version (branch & subfolder of monorepo): GitHub go.mod Go version (branch & subfolder of monorepo) badge \n * \n * `/github/manifest-json/v/:user/:repo`\n * GitHub manifest version: GitHub manifest version badge \n * \n * `/github/manifest-json/v/:user/:repo/:branch`\n * GitHub manifest version: GitHub manifest version badge \n * \n * `/github/package-json/v/:user/:repo`\n * GitHub package.json version: GitHub package.json version badge \n * \n * `/github/package-json/v/:user/:repo/:branch`\n * GitHub package.json version (branch): GitHub package.json version (branch) badge \n * \n * `/github/v/release/:user/:repo`\n * GitHub release (latest by date): GitHub release (latest by date) badge \n * \n * `/github/v/release/:user/:repo?include_prereleases`\n * GitHub release (latest by date including pre-releases): GitHub release (latest by date including pre-releases) badge \n * \n * `/github/v/release/:user/:repo?sort=semver`\n * GitHub release (latest SemVer): GitHub release (latest SemVer) badge \n * \n * `/github/v/release/:user/:repo?include_prereleases&sort=semver`\n * GitHub release (latest SemVer including pre-releases): GitHub release (latest SemVer including pre-releases) badge \n * \n * `/github/v/tag/:user/:repo`\n * GitHub tag (latest by date): GitHub tag (latest by date) badge \n * \n * `/github/v/tag/:user/:repo?sort=semver`\n * GitHub tag (latest SemVer): GitHub tag (latest SemVer) badge \n * \n * `/github/v/tag/:user/:repo?include_prereleases&sort=semver`\n * GitHub tag (latest SemVer pre-release): GitHub tag (latest SemVer pre-release) badge \n */\n type?: 'version-release' | 'version-tag' | 'package-json' | 'manifest-json' | 'go-mod';\n branch?: string;\n}\n\nexport default class Version extends Base {\n constructor(props: VersionProps) {\n super(props, { platform: 'github', type: 'version-release' });\n };\n\n getUrl = () => {\n const { type, platform, user, repo, base, branch } = this.state;\n let typePath = '';\n switch (type) {\n case 'version-release': typePath = 'v/release';break;\n case 'version-tag': typePath = 'v/tag';break;\n case 'package-json': typePath = 'package-json/v';break;\n case 'manifest-json': typePath = 'manifest-json/v';break;\n case 'go-mod': typePath = 'go-mod/go-version';break;\n default:break;\n }\n if (platform !== 'github' || !typePath) return '';\n const baseData = [base, platform, typePath, user, repo];\n if (/(go-mod|manifest-json|package-json)/.test(type || '') && branch) {\n return [...baseData, branch].join('/');\n }\n return baseData.join('/');\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface LicenseProps extends BaseProps {\n /**\n * Github License\n * \n * `/github/license/:user/:repo` \n * GitHub: GitHub badge \n */\n type?: 'license';\n}\n\nexport default class License extends Base {\n constructor(props: LicenseProps) {\n super(props, { platform: 'github', type: 'license' });\n };\n getUrl = () => {\n const { type, platform, user, repo, base } = this.state;\n if (platform !== 'github') return '';\n return [base, platform, type, user, repo].join('/');\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface AnalysisProps extends BaseProps {\n /**\n * Github Analysis\n * \n * `/github/languages/count/:user/:repo` \n * GitHub language count: GitHub language count badge \n * \n * `/github/search/:user/:repo/:query` \n * GitHub search hit counter: GitHub search hit counter badge \n * \n * `/github/languages/top/:user/:repo` \n * GitHub top language: GitHub top language badge \n */\n type?: 'languages-count' | 'languages-top' | 'search';\n query?: string;\n}\n\nexport default class Analysis extends Base {\n constructor(props: AnalysisProps) {\n super(props, { platform: 'github', type: 'languages-count' });\n };\n getUrl = () => {\n const { base, platform, type, user, repo, query } = this.state;\n let typePath = '';\n switch (type) {\n case 'languages-count': typePath = 'languages/count';break;\n case 'languages-top': typePath = 'languages/top';break;\n case 'search': typePath = 'search';break;\n default:break;\n }\n if (platform !== 'github' || !typePath) return '';\n const baseData = [base, platform, typePath, user, repo];\n if (query) {\n return [...baseData, query].join('/');\n }\n return baseData.join('/');\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface SocialProps extends BaseProps {\n /**\n * Github License\n * \n * `/github/followers/:user?label=Follow`\n * GitHub followers: GitHub followers badge \n * \n * `/github/forks/:user/:repo?label=Fork`\n * GitHub forks: GitHub forks badge \n * \n * `/github/stars/:user/:repo?style=social`\n * GitHub stars: GitHub stars badge \n * \n * `/github/watchers/:user/:repo?label=Watch`\n * GitHub watchers: GitHub watchers badge \n */\n type?: 'followers' | 'forks' | 'stars' | 'watchers';\n}\n\nexport default class Social extends Base {\n constructor(props: SocialProps) {\n super(props, { platform: 'github', type: 'followers' });\n };\n getUrl = () => {\n const { type, platform, user, repo, base } = this.state;\n if (platform !== 'github') return '';\n if(type === 'followers') return [base, platform, type, user].join('/');\n return [base, platform, type, user, repo].join('/');\n }\n}","import Container from '../common/Container';\nimport Issues from './Issues';\nimport Size from './Size';\nimport Downloads from './Downloads';\nimport Activity from './Activity';\nimport Version from './Version';\nimport License from './License';\nimport Analysis from './Analysis';\nimport Social from './Social';\n\nexport default class Github extends Container {\n static Issues = Issues;\n static Size = Size;\n static Activity = Activity;\n static Downloads = Downloads;\n static Version = Version;\n static License = License;\n static Analysis = Analysis;\n static Social = Social;\n}","import Github from './Github';\n\nexport default Github;","import Base, { BaseProps} from '../common/Base';\n\n/**\n * NPM Version\n * \n * `/npm/v/:packageName` \n * npm: npm badge \n * \n * `/npm/v/:scope/:packageName` \n * npm (scoped): npm (scoped) badge \n * \n * `/npm/v/:packageName/:tag` \n * npm (tag): npm (tag) badge \n * \n * `/npm/v/:packageName/:tag?registry_uri=https%3A%2F%2Fregistry.npmjs.com` \n * npm (custom registry): npm (custom registry) badge \n * \n * `/npm/v/:scope/:packageName/:tag` \n * npm (scoped with tag): npm (scoped with tag) badge \n * \n * `/npm/dependency-version/:packageName/peer/:dependency`\n * npm peer dependency version: npm peer dependency version badge \n * \n * `/npm/dependency-version/:scope?/:packageName/dev/:dependencyScope?/:dependency`\n * npm peer dependency version (scoped): npm peer dependency version (scoped) badge \n * \n * `/npm/dependency-version/:packageName/dev/:dependency`\n * npm dev dependency version: npm dev dependency version badge \n * \n * `/npm/dependency-version/:scope?/:packageName/dev/:dependencyScope?/:dependency`\n * npm dev dependency version (scoped): npm dev dependency version (scoped) badge \n * \n * `/npm/dependency-version/:packageName/:dependency`\n * npm (prod) dependency version: npm (prod) dependency version badge \n * \n * `/npm/dependency-version/:scope?/:packageName/:dependencyScope?/:dependency`\n * npm (prod) dependency version (scoped): npm (prod) dependency version (scoped) badge \n * \n * `/npm/types/:packageName`\n * npm type definitions: npm type definitions badge \n */\nexport interface VersionProps extends BaseProps {\n type?: 'version' | 'peer-dependency' | 'dev-dependency';\n registryUri?: string;\n packageName?: string;\n dependency?: string;\n scope?: string;\n dependencyScope?: string;\n version?: string;\n}\n\nexport default class Version extends Base {\n constructor(props: VersionProps) {\n super(props, { type: 'version' }, { platform: 'npm' });\n };\n getUrl = () => {\n const { base, platform, type, scope, packageName, dependency, dependencyScope, version, registryUri } = this.state;\n if (platform !== 'npm' || !packageName) return '';\n\n let url = '';\n const baseData = [base, platform];\n\n if (type === 'version' && packageName) {\n baseData.push('v');\n if (scope) {\n baseData.push(scope);\n }\n baseData.push(packageName);\n if (version) {\n baseData.push(version);\n }\n url = baseData.join('/');\n if (registryUri) {\n url = `${url}?registry_uri=${registryUri}`;\n }\n } else if (type === 'peer-dependency' && packageName && dependency) {\n baseData.push('dependency-version');\n if (scope) {\n baseData.push(scope);\n }\n url = [...baseData, packageName, 'peer', dependency].join('/');\n } else if (type === 'dev-dependency' && packageName && dependency) {\n baseData.push('dependency-version');\n if (scope) {\n baseData.push(scope);\n }\n baseData.concat([packageName, 'dev']);\n if (dependencyScope) {\n baseData.push(dependencyScope);\n }\n baseData.push(dependency);\n url = baseData.join('/');\n } else if (packageName && dependency) {\n baseData.concat([packageName, dependency]);\n url = baseData.join('/');\n }\n\n return url;\n }\n}","import Base, { BaseProps} from '../common/Base';\n\nexport interface SizeProps extends BaseProps {\n format?: 'min' | 'minzip';\n packageName?: string;\n scope?: string;\n version?: string;\n}\n\n/**\n * Npm Size\n * \n * `/bundlephobia/:format/:packageName`\n * npm bundle size: npm bundle size badge \n * \n * `/bundlephobia/:format/:scope/:packageName`\n * npm bundle size (scoped): npm bundle size (scoped) badge \n * \n * `/bundlephobia/:format/:packageName/:version`\n * npm bundle size (version): npm bundle size (version) badge \n * \n * `/bundlephobia/:format/:scope/:packageName/:version`\n * npm bundle size (scoped version): npm bundle size (scoped version) badge \n * \n */\nexport default class Size extends Base {\n constructor(props: SizeProps) {\n super(props, { format: 'min' }, { platform: 'npm' });\n };\n getUrl = () => {\n const { base, platform, format, packageName, scope, version } = this.state;\n if (platform !== 'npm') return '';\n\n const baseData = [base, 'bundlephobia'];\n let url = '';\n\n if (packageName && format) {\n url = [...baseData, format, packageName].join('/');\n }\n if (packageName && format && scope) {\n url = [...baseData, format, scope, packageName].join('/');\n }\n if (packageName && format && scope && version) {\n url = [...baseData, format, scope, packageName, version].join('/');\n }\n if (packageName && format && version) {\n url = [...baseData, format, packageName, version].join('/');\n }\n\n return url;\n }\n}","import Container from '../common/Container';\nimport Version from './Version';\nimport Size from './Size';\n\nexport default class Npm extends Container {\n static Version = Version;\n static Size = Size;\n}","import Npm from './Npm';\n\nexport default Npm;","import React, { useEffect, useMemo, useRef, useState } from 'react';\n\nexport interface BackToUpProps extends React.AllHTMLAttributes {\n prefixCls?: string;\n /** Scroll bar area @default document.documentElement */\n element?: HTMLElement | null;\n /** Whether to use smooth scrolling* @default true */\n smooth?: boolean;\n /** Classname to add/override styling (note, !important for overrides might be needed) */\n className?: string;\n /** Object to add/override styling */\n style?: React.CSSProperties;\n /** Height after page scroll to be visible @default 120 */\n top?: number;\n /** The Button width & height @default 35 */\n size?: number;\n /** the width of the progress bar */\n strokeWidth?: number;\n /** hide progress icon */\n hideProgress?: boolean;\n}\n\nconst warpperStyle: React.CSSProperties = {\n position: 'sticky',\n bottom: 15,\n right: 15,\n visibility: 'visible',\n opacity: 0,\n transition: 'visibility 0.3s linear 0s, opacity 0.3s linear 0s',\n cursor: 'pointer',\n userSelect: 'none',\n};\n\nconst svgStyle: React.CSSProperties = {\n display: 'block',\n transform: 'rotate(-90deg)',\n};\n\nconst circleStyle: React.CSSProperties = {\n transition: 'stroke-dashoffset 0.3s linear 0s',\n};\n\nconst childStyle: React.CSSProperties = {\n position: 'absolute',\n top: 0,\n display: 'flex',\n height: '100%',\n width: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n color: '#fff',\n fontSize: 12,\n};\n\nconst documentElement = document.documentElement;\n\nexport default function BackToUp(props: BackToUpProps = {}) {\n const {\n className,\n prefixCls = 'w-back-to-up',\n element = documentElement,\n top = 120,\n size = 35,\n strokeWidth = 3,\n smooth = true,\n hideProgress = false,\n children,\n ...others\n } = props;\n const cls = [className, prefixCls].filter(Boolean).join(' ');\n const style: React.CSSProperties = Object.assign(\n {},\n warpperStyle,\n {\n position: element === documentElement ? 'fixed' : 'sticky',\n },\n others.style,\n {\n width: size,\n height: size,\n opacity: top === 0 ? 1 : 0,\n },\n );\n const $dom = useRef(null);\n const center = useMemo(() => size / 2, [size]);\n const radius = useMemo(() => size / 2 - strokeWidth / 2, [size, strokeWidth]);\n const dasharray = useMemo(() => Math.PI * radius * 2, [radius]);\n const [progress, setProgress] = useState(dasharray);\n\n const handleScroll = (ev: MouseEventInit) => {\n const { clientHeight, scrollHeight, scrollTop } = element || documentElement;\n const percentage = scrollTop / (scrollHeight - clientHeight);\n setProgress(dasharray - dasharray * percentage);\n if ($dom.current && top > 0) {\n $dom.current.style.opacity = scrollTop > top ? '1' : '0';\n }\n };\n\n useEffect(() => {\n const scrollElement = element === documentElement ? document : element;\n if (scrollElement) {\n scrollElement.addEventListener('scroll', handleScroll, { passive: true });\n }\n return () => {\n if (scrollElement) {\n scrollElement.removeEventListener('scroll', handleScroll);\n }\n };\n }, [element]);\n\n const goToUp = (ev: React.MouseEvent) => {\n element!.scrollTo({ top: 0, behavior: smooth ? 'smooth' : 'auto' });\n };\n\n return (\n
\n {!hideProgress && (\n \n \n \n \n )}\n {children &&
{children}
}\n
\n );\n}\n","var _g;\n\nvar _excluded = [\"title\", \"titleId\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nfunction SvgLogo(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 841.9 595.3\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#61DAFB\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z\"\n }), /*#__PURE__*/React.createElement(\"circle\", {\n cx: 420.9,\n cy: 296.5,\n r: 45.7\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M520.5 78.1z\"\n }))));\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgLogo);\nexport default __webpack_public_path__ + \"static/media/logo.3931a054f5ef8356122965d973d55570.svg\";\nexport { ForwardRef as ReactComponent };","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","/**\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {object & {type: string, position?: Position|undefined}} NodeLike\n */\n\n/**\n * Stringify one point, a position (start and end points), or a node’s\n * positional information.\n *\n * @param {Node|NodeLike|Position|Point|null} [value]\n * @returns {string}\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point|undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position|undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number|undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {object & {type: string, position?: Position|undefined}} NodeLike\n */\n\nimport {stringifyPosition} from 'unist-util-stringify-position'\n\nexport class VFileMessage extends Error {\n /**\n * Constructor of a message for `reason` at `place` from `origin`.\n * When an error is passed in as `reason`, copies the `stack`.\n *\n * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).\n * @param {string} [origin] Place in code the message originates from (`string`, optional).\n */\n constructor(reason, place, origin) {\n /** @type {[string|null, string|null]} */\n const parts = [null, null]\n /** @type {Position} */\n let position = {\n // @ts-expect-error: we always follows the structure of `position`.\n start: {line: null, column: null},\n // @ts-expect-error: \"\n end: {line: null, column: null}\n }\n\n super()\n\n if (typeof place === 'string') {\n origin = place\n place = undefined\n }\n\n if (typeof origin === 'string') {\n const index = origin.indexOf(':')\n\n if (index === -1) {\n parts[1] = origin\n } else {\n parts[0] = origin.slice(0, index)\n parts[1] = origin.slice(index + 1)\n }\n }\n\n if (place) {\n // Node.\n if ('type' in place || 'position' in place) {\n if (place.position) {\n position = place.position\n }\n }\n // Position.\n else if ('start' in place || 'end' in place) {\n position = place\n }\n // Point.\n else if ('line' in place || 'column' in place) {\n position.start = place\n }\n }\n\n // Fields from `Error`\n this.name = stringifyPosition(place) || '1:1'\n this.message = typeof reason === 'object' ? reason.message : reason\n this.stack = typeof reason === 'object' ? reason.stack : ''\n\n /**\n * Reason for message.\n * @type {string}\n */\n this.reason = this.message\n /**\n * If true, marks associated file as no longer processable.\n * @type {boolean?}\n */\n // eslint-disable-next-line no-unused-expressions\n this.fatal\n /**\n * Starting line of error.\n * @type {number?}\n */\n this.line = position.start.line\n /**\n * Starting column of error.\n * @type {number?}\n */\n this.column = position.start.column\n /**\n * Namespace of warning.\n * @type {string?}\n */\n this.source = parts[0]\n /**\n * Category of message.\n * @type {string?}\n */\n this.ruleId = parts[1]\n /**\n * Full range information, when available.\n * Has start and end properties, both set to an object with line and column, set to number?.\n * @type {Position?}\n */\n this.position = position\n\n // The following fields are “well known”.\n // Not standard.\n // Feel free to add other non-standard fields to your messages.\n\n /* eslint-disable no-unused-expressions */\n /**\n * You can use this to specify the source value that’s being reported, which\n * is deemed incorrect.\n * @type {string?}\n */\n this.actual\n /**\n * You can use this to suggest values that should be used instead of\n * `actual`, one or more values that are deemed as acceptable.\n * @type {Array?}\n */\n this.expected\n /**\n * You may add a file property with a path of a file (used throughout the VFile ecosystem).\n * @type {string?}\n */\n this.file\n /**\n * You may add a url property with a link to documentation for the message.\n * @type {string?}\n */\n this.url\n /**\n * You may add a note property with a long form description of the message (supported by vfile-reporter).\n * @type {string?}\n */\n this.note\n /* eslint-enable no-unused-expressions */\n }\n}\n\nVFileMessage.prototype.file = ''\nVFileMessage.prototype.name = ''\nVFileMessage.prototype.reason = ''\nVFileMessage.prototype.message = ''\nVFileMessage.prototype.stack = ''\nVFileMessage.prototype.fatal = null\nVFileMessage.prototype.column = null\nVFileMessage.prototype.line = null\nVFileMessage.prototype.source = null\nVFileMessage.prototype.ruleId = null\nVFileMessage.prototype.position = null\n","// A derivative work based on:\n// .\n// Which is licensed:\n//\n// MIT License\n//\n// Copyright (c) 2013 James Halliday\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A derivative work based on:\n//\n// Parts of that are extracted from Node’s internal `path` module:\n// .\n// Which is licensed:\n//\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nexport const path = {basename, dirname, extname, join, sep: '/'}\n\n/* eslint-disable max-depth, complexity */\n\n/**\n * @param {string} path\n * @param {string} [ext]\n * @returns {string}\n */\nfunction basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') {\n throw new TypeError('\"ext\" argument must be a string')\n }\n\n assertPath(path)\n let start = 0\n let end = -1\n let index = path.length\n /** @type {boolean|undefined} */\n let seenNonSlash\n\n if (ext === undefined || ext.length === 0 || ext.length > path.length) {\n while (index--) {\n if (path.charCodeAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // path component.\n seenNonSlash = true\n end = index + 1\n }\n }\n\n return end < 0 ? '' : path.slice(start, end)\n }\n\n if (ext === path) {\n return ''\n }\n\n let firstNonSlashEnd = -1\n let extIndex = ext.length - 1\n\n while (index--) {\n if (path.charCodeAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else {\n if (firstNonSlashEnd < 0) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching.\n seenNonSlash = true\n firstNonSlashEnd = index + 1\n }\n\n if (extIndex > -1) {\n // Try to match the explicit extension.\n if (path.charCodeAt(index) === ext.charCodeAt(extIndex--)) {\n if (extIndex < 0) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = index\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIndex = -1\n end = firstNonSlashEnd\n }\n }\n }\n }\n\n if (start === end) {\n end = firstNonSlashEnd\n } else if (end < 0) {\n end = path.length\n }\n\n return path.slice(start, end)\n}\n\n/**\n * @param {string} path\n * @returns {string}\n */\nfunction dirname(path) {\n assertPath(path)\n\n if (path.length === 0) {\n return '.'\n }\n\n let end = -1\n let index = path.length\n /** @type {boolean|undefined} */\n let unmatchedSlash\n\n // Prefix `--` is important to not run on `0`.\n while (--index) {\n if (path.charCodeAt(index) === 47 /* `/` */) {\n if (unmatchedSlash) {\n end = index\n break\n }\n } else if (!unmatchedSlash) {\n // We saw the first non-path separator\n unmatchedSlash = true\n }\n }\n\n return end < 0\n ? path.charCodeAt(0) === 47 /* `/` */\n ? '/'\n : '.'\n : end === 1 && path.charCodeAt(0) === 47 /* `/` */\n ? '//'\n : path.slice(0, end)\n}\n\n/**\n * @param {string} path\n * @returns {string}\n */\nfunction extname(path) {\n assertPath(path)\n\n let index = path.length\n\n let end = -1\n let startPart = 0\n let startDot = -1\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find.\n let preDotState = 0\n /** @type {boolean|undefined} */\n let unmatchedSlash\n\n while (index--) {\n const code = path.charCodeAt(index)\n\n if (code === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (unmatchedSlash) {\n startPart = index + 1\n break\n }\n\n continue\n }\n\n if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // extension.\n unmatchedSlash = true\n end = index + 1\n }\n\n if (code === 46 /* `.` */) {\n // If this is our first dot, mark it as the start of our extension.\n if (startDot < 0) {\n startDot = index\n } else if (preDotState !== 1) {\n preDotState = 1\n }\n } else if (startDot > -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension.\n preDotState = -1\n }\n }\n\n if (\n startDot < 0 ||\n end < 0 ||\n // We saw a non-dot character immediately before the dot.\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly `..`.\n (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n ) {\n return ''\n }\n\n return path.slice(startDot, end)\n}\n\n/**\n * @param {Array} segments\n * @returns {string}\n */\nfunction join(...segments) {\n let index = -1\n /** @type {string|undefined} */\n let joined\n\n while (++index < segments.length) {\n assertPath(segments[index])\n\n if (segments[index]) {\n joined =\n joined === undefined ? segments[index] : joined + '/' + segments[index]\n }\n }\n\n return joined === undefined ? '.' : normalize(joined)\n}\n\n/**\n * Note: `normalize` is not exposed as `path.normalize`, so some code is\n * manually removed from it.\n *\n * @param {string} path\n * @returns {string}\n */\nfunction normalize(path) {\n assertPath(path)\n\n const absolute = path.charCodeAt(0) === 47 /* `/` */\n\n // Normalize the path according to POSIX rules.\n let value = normalizeString(path, !absolute)\n\n if (value.length === 0 && !absolute) {\n value = '.'\n }\n\n if (value.length > 0 && path.charCodeAt(path.length - 1) === 47 /* / */) {\n value += '/'\n }\n\n return absolute ? '/' + value : value\n}\n\n/**\n * Resolve `.` and `..` elements in a path with directory names.\n *\n * @param {string} path\n * @param {boolean} allowAboveRoot\n * @returns {string}\n */\nfunction normalizeString(path, allowAboveRoot) {\n let result = ''\n let lastSegmentLength = 0\n let lastSlash = -1\n let dots = 0\n let index = -1\n /** @type {number|undefined} */\n let code\n /** @type {number} */\n let lastSlashIndex\n\n while (++index <= path.length) {\n if (index < path.length) {\n code = path.charCodeAt(index)\n } else if (code === 47 /* `/` */) {\n break\n } else {\n code = 47 /* `/` */\n }\n\n if (code === 47 /* `/` */) {\n if (lastSlash === index - 1 || dots === 1) {\n // Empty.\n } else if (lastSlash !== index - 1 && dots === 2) {\n if (\n result.length < 2 ||\n lastSegmentLength !== 2 ||\n result.charCodeAt(result.length - 1) !== 46 /* `.` */ ||\n result.charCodeAt(result.length - 2) !== 46 /* `.` */\n ) {\n if (result.length > 2) {\n lastSlashIndex = result.lastIndexOf('/')\n\n if (lastSlashIndex !== result.length - 1) {\n if (lastSlashIndex < 0) {\n result = ''\n lastSegmentLength = 0\n } else {\n result = result.slice(0, lastSlashIndex)\n lastSegmentLength = result.length - 1 - result.lastIndexOf('/')\n }\n\n lastSlash = index\n dots = 0\n continue\n }\n } else if (result.length > 0) {\n result = ''\n lastSegmentLength = 0\n lastSlash = index\n dots = 0\n continue\n }\n }\n\n if (allowAboveRoot) {\n result = result.length > 0 ? result + '/..' : '..'\n lastSegmentLength = 2\n }\n } else {\n if (result.length > 0) {\n result += '/' + path.slice(lastSlash + 1, index)\n } else {\n result = path.slice(lastSlash + 1, index)\n }\n\n lastSegmentLength = index - lastSlash - 1\n }\n\n lastSlash = index\n dots = 0\n } else if (code === 46 /* `.` */ && dots > -1) {\n dots++\n } else {\n dots = -1\n }\n }\n\n return result\n}\n\n/**\n * @param {string} path\n */\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError(\n 'Path must be a string. Received ' + JSON.stringify(path)\n )\n }\n}\n\n/* eslint-enable max-depth, complexity */\n","// Somewhat based on:\n// .\n// But I don’t think one tiny line of code can be copyrighted. 😅\nexport const proc = {cwd}\n\nfunction cwd() {\n return '/'\n}\n","/**\n * @typedef URL\n * @property {string} hash\n * @property {string} host\n * @property {string} hostname\n * @property {string} href\n * @property {string} origin\n * @property {string} password\n * @property {string} pathname\n * @property {string} port\n * @property {string} protocol\n * @property {string} search\n * @property {any} searchParams\n * @property {string} username\n * @property {() => string} toString\n * @property {() => string} toJSON\n */\n\n/**\n * @param {unknown} fileURLOrPath\n * @returns {fileURLOrPath is URL}\n */\n// From: \nexport function isUrl(fileURLOrPath) {\n return (\n fileURLOrPath !== null &&\n typeof fileURLOrPath === 'object' &&\n // @ts-expect-error: indexable.\n fileURLOrPath.href &&\n // @ts-expect-error: indexable.\n fileURLOrPath.origin\n )\n}\n","/// \n\nimport {isUrl} from './minurl.shared.js'\n\n// See: \n\n/**\n * @param {string|URL} path\n */\nexport function urlToPath(path) {\n if (typeof path === 'string') {\n path = new URL(path)\n } else if (!isUrl(path)) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'The \"path\" argument must be of type string or an instance of URL. Received `' +\n path +\n '`'\n )\n error.code = 'ERR_INVALID_ARG_TYPE'\n throw error\n }\n\n if (path.protocol !== 'file:') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError('The URL must be of scheme file')\n error.code = 'ERR_INVALID_URL_SCHEME'\n throw error\n }\n\n return getPathFromURLPosix(path)\n}\n\n/**\n * @param {URL} url\n */\nfunction getPathFromURLPosix(url) {\n if (url.hostname !== '') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL host must be \"localhost\" or empty on darwin'\n )\n error.code = 'ERR_INVALID_FILE_URL_HOST'\n throw error\n }\n\n const pathname = url.pathname\n let index = -1\n\n while (++index < pathname.length) {\n if (\n pathname.charCodeAt(index) === 37 /* `%` */ &&\n pathname.charCodeAt(index + 1) === 50 /* `2` */\n ) {\n const third = pathname.charCodeAt(index + 2)\n if (third === 70 /* `F` */ || third === 102 /* `f` */) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL path must not include encoded / characters'\n )\n error.code = 'ERR_INVALID_FILE_URL_PATH'\n throw error\n }\n }\n }\n\n return decodeURIComponent(pathname)\n}\n\nexport {isUrl} from './minurl.shared.js'\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {Record & {type: string, position?: Position|undefined}} NodeLike\n * @typedef {import('./minurl.shared.js').URL} URL\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Value} Value\n *\n * @typedef {'ascii'|'utf8'|'utf-8'|'utf16le'|'ucs2'|'ucs-2'|'base64'|'base64url'|'latin1'|'binary'|'hex'} BufferEncoding\n * Encodings supported by the buffer class.\n * This is a copy of the typing from Node, copied to prevent Node globals from\n * being needed.\n * Copied from: \n *\n * @typedef {Value|Options|VFile|URL} Compatible\n * Things that can be passed to the constructor.\n *\n * @typedef VFileCoreOptions\n * @property {Value} [value]\n * @property {string} [cwd]\n * @property {Array} [history]\n * @property {string|URL} [path]\n * @property {string} [basename]\n * @property {string} [stem]\n * @property {string} [extname]\n * @property {string} [dirname]\n * @property {Data} [data]\n *\n * @typedef Map\n * Raw source map, see:\n * .\n * @property {number} version\n * @property {Array} sources\n * @property {Array} names\n * @property {string|undefined} [sourceRoot]\n * @property {Array|undefined} [sourcesContent]\n * @property {string} mappings\n * @property {string} file\n *\n * @typedef {{[key: string]: unknown} & VFileCoreOptions} Options\n * Configuration: a bunch of keys that will be shallow copied over to the new\n * file.\n *\n * @typedef {Record} ReporterSettings\n * @typedef {(files: Array, options: T) => string} Reporter\n */\n\nimport buffer from 'is-buffer'\nimport {VFileMessage} from 'vfile-message'\nimport {path} from './minpath.js'\nimport {proc} from './minproc.js'\nimport {urlToPath, isUrl} from './minurl.js'\n\n// Order of setting (least specific to most), we need this because otherwise\n// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n// stem can be set.\nconst order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']\n\nexport class VFile {\n /**\n * Create a new virtual file.\n *\n * If `options` is `string` or `Buffer`, it’s treated as `{value: options}`.\n * If `options` is a `URL`, it’s treated as `{path: options}`.\n * If `options` is a `VFile`, shallow copies its data over to the new file.\n * All fields in `options` are set on the newly created `VFile`.\n *\n * Path related fields are set in the following order (least specific to\n * most specific): `history`, `path`, `basename`, `stem`, `extname`,\n * `dirname`.\n *\n * It’s not possible to set either `dirname` or `extname` without setting\n * either `history`, `path`, `basename`, or `stem` as well.\n *\n * @param {Compatible} [value]\n */\n constructor(value) {\n /** @type {Options} */\n let options\n\n if (!value) {\n options = {}\n } else if (typeof value === 'string' || buffer(value)) {\n // @ts-expect-error Looks like a buffer.\n options = {value}\n } else if (isUrl(value)) {\n options = {path: value}\n } else {\n // @ts-expect-error Looks like file or options.\n options = value\n }\n\n /**\n * Place to store custom information (default: `{}`).\n * It’s OK to store custom data directly on the file but moving it to\n * `data` is recommended.\n * @type {Data}\n */\n this.data = {}\n\n /**\n * List of messages associated with the file.\n * @type {Array}\n */\n this.messages = []\n\n /**\n * List of filepaths the file moved between.\n * The first is the original path and the last is the current path.\n * @type {Array}\n */\n this.history = []\n\n /**\n * Base of `path` (default: `process.cwd()` or `'/'` in browsers).\n * @type {string}\n */\n this.cwd = proc.cwd()\n\n /* eslint-disable no-unused-expressions */\n /**\n * Raw value.\n * @type {Value}\n */\n this.value\n\n // The below are non-standard, they are “well-known”.\n // As in, used in several tools.\n\n /**\n * Whether a file was saved to disk.\n * This is used by vfile reporters.\n * @type {boolean}\n */\n this.stored\n\n /**\n * Sometimes files have a non-string, compiled, representation.\n * This can be stored in the `result` field.\n * One example is when turning markdown into React nodes.\n * This is used by unified to store non-string results.\n * @type {unknown}\n */\n this.result\n\n /**\n * Sometimes files have a source map associated with them.\n * This can be stored in the `map` field.\n * This should be a `Map` type, which is equivalent to the `RawSourceMap`\n * type from the `source-map` module.\n * @type {Map|undefined}\n */\n this.map\n /* eslint-enable no-unused-expressions */\n\n // Set path related properties in the correct order.\n let index = -1\n\n while (++index < order.length) {\n const prop = order[index]\n\n // Note: we specifically use `in` instead of `hasOwnProperty` to accept\n // `vfile`s too.\n if (prop in options && options[prop] !== undefined) {\n // @ts-expect-error: TS is confused by the different types for `history`.\n this[prop] = prop === 'history' ? [...options[prop]] : options[prop]\n }\n }\n\n /** @type {string} */\n let prop\n\n // Set non-path related properties.\n for (prop in options) {\n // @ts-expect-error: fine to set other things.\n if (!order.includes(prop)) this[prop] = options[prop]\n }\n }\n\n /**\n * Get the full path (example: `'~/index.min.js'`).\n * @returns {string}\n */\n get path() {\n return this.history[this.history.length - 1]\n }\n\n /**\n * Set the full path (example: `'~/index.min.js'`).\n * Cannot be nullified.\n * You can set a file URL (a `URL` object with a `file:` protocol) which will\n * be turned into a path with `url.fileURLToPath`.\n * @param {string|URL} path\n */\n set path(path) {\n if (isUrl(path)) {\n path = urlToPath(path)\n }\n\n assertNonEmpty(path, 'path')\n\n if (this.path !== path) {\n this.history.push(path)\n }\n }\n\n /**\n * Get the parent path (example: `'~'`).\n */\n get dirname() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined\n }\n\n /**\n * Set the parent path (example: `'~'`).\n * Cannot be set if there’s no `path` yet.\n */\n set dirname(dirname) {\n assertPath(this.basename, 'dirname')\n this.path = path.join(dirname || '', this.basename)\n }\n\n /**\n * Get the basename (including extname) (example: `'index.min.js'`).\n */\n get basename() {\n return typeof this.path === 'string' ? path.basename(this.path) : undefined\n }\n\n /**\n * Set basename (including extname) (`'index.min.js'`).\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n */\n set basename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = path.join(this.dirname || '', basename)\n }\n\n /**\n * Get the extname (including dot) (example: `'.js'`).\n */\n get extname() {\n return typeof this.path === 'string' ? path.extname(this.path) : undefined\n }\n\n /**\n * Set the extname (including dot) (example: `'.js'`).\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be set if there’s no `path` yet.\n */\n set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\n if (extname) {\n if (extname.charCodeAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = path.join(this.dirname, this.stem + (extname || ''))\n }\n\n /**\n * Get the stem (basename w/o extname) (example: `'index.min'`).\n */\n get stem() {\n return typeof this.path === 'string'\n ? path.basename(this.path, this.extname)\n : undefined\n }\n\n /**\n * Set the stem (basename w/o extname) (example: `'index.min'`).\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n */\n set stem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = path.join(this.dirname || '', stem + (this.extname || ''))\n }\n\n /**\n * Serialize the file.\n *\n * @param {BufferEncoding} [encoding='utf8']\n * When `value` is a `Buffer`, `encoding` is a character encoding to\n * understand it as (default: `'utf8'`).\n * @returns {string}\n * Serialized file.\n */\n toString(encoding) {\n return (this.value || '').toString(encoding)\n }\n\n /**\n * Constructs a new `VFileMessage`, where `fatal` is set to `false`, and\n * associates it with the file by adding it to `vfile.messages` and setting\n * `message.file` to the current filepath.\n *\n * @param {string|Error} reason\n * Human readable reason for the message, uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place]\n * Place where the message occurred in the file.\n * @param {string} [origin]\n * Computer readable reason for the message\n * @returns {VFileMessage}\n * Message.\n */\n message(reason, place, origin) {\n const message = new VFileMessage(reason, place, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n }\n\n /**\n * Like `VFile#message()`, but associates an informational message where\n * `fatal` is set to `null`.\n *\n * @param {string|Error} reason\n * Human readable reason for the message, uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place]\n * Place where the message occurred in the file.\n * @param {string} [origin]\n * Computer readable reason for the message\n * @returns {VFileMessage}\n * Message.\n */\n info(reason, place, origin) {\n const message = this.message(reason, place, origin)\n\n message.fatal = null\n\n return message\n }\n\n /**\n * Like `VFile#message()`, but associates a fatal message where `fatal` is\n * set to `true`, and then immediately throws it.\n *\n * > 👉 **Note**: a fatal error means that a file is no longer processable.\n *\n * @param {string|Error} reason\n * Human readable reason for the message, uses the stack and message of the error if given.\n * @param {Node|NodeLike|Position|Point} [place]\n * Place where the message occurred in the file.\n * @param {string} [origin]\n * Computer readable reason for the message\n * @returns {never}\n * Message.\n */\n fail(reason, place, origin) {\n const message = this.message(reason, place, origin)\n\n message.fatal = true\n\n throw message\n }\n}\n\n/**\n * Assert that `part` is not a path (as in, does not contain `path.sep`).\n *\n * @param {string|undefined} part\n * @param {string} name\n * @returns {void}\n */\nfunction assertPart(part, name) {\n if (part && part.includes(path.sep)) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}\n\n/**\n * Assert that `part` is not empty.\n *\n * @param {string|undefined} part\n * @param {string} name\n * @returns {asserts part is string}\n */\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n/**\n * Assert `path` exists.\n *\n * @param {string|undefined} path\n * @param {string} name\n * @returns {asserts path is string}\n */\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\n}\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","/**\n * @typedef {(error?: Error|null|undefined, ...output: Array) => void} Callback\n * @typedef {(...input: Array) => any} Middleware\n *\n * @typedef {(...input: Array) => void} Run\n * Call all middleware.\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add `fn` (middleware) to the list.\n * @typedef {{run: Run, use: Use}} Pipeline\n * Middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n */\nexport function trough() {\n /** @type {Array} */\n const fns = []\n /** @type {Pipeline} */\n const pipeline = {run, use}\n\n return pipeline\n\n /** @type {Run} */\n function run(...values) {\n let middlewareIndex = -1\n /** @type {Callback} */\n const callback = values.pop()\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback)\n }\n\n next(null, ...values)\n\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error|null|undefined} error\n * @param {Array} output\n */\n function next(error, ...output) {\n const fn = fns[++middlewareIndex]\n let index = -1\n\n if (error) {\n callback(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index]\n }\n }\n\n // Save the newly created `output` for the next call.\n values = output\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...output)\n } else {\n callback(null, ...output)\n }\n }\n }\n\n /** @type {Use} */\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError(\n 'Expected `middelware` to be a function, not ' + middelware\n )\n }\n\n fns.push(middelware)\n return pipeline\n }\n}\n\n/**\n * Wrap `middleware`.\n * Can be sync or async; return a promise, receive a callback, or return new\n * values and errors.\n *\n * @param {Middleware} middleware\n * @param {Callback} callback\n */\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n let called\n\n return wrapped\n\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array} parameters\n * @returns {void}\n */\n function wrapped(...parameters) {\n const fnExpectsCallback = middleware.length > parameters.length\n /** @type {any} */\n let result\n\n if (fnExpectsCallback) {\n parameters.push(done)\n }\n\n try {\n result = middleware.apply(this, parameters)\n } catch (error) {\n const exception = /** @type {Error} */ (error)\n\n // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n if (fnExpectsCallback && called) {\n throw exception\n }\n\n return done(exception)\n }\n\n if (!fnExpectsCallback) {\n if (result instanceof Promise) {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /**\n * Call `callback`, only once.\n * @type {Callback}\n */\n function done(error, ...output) {\n if (!called) {\n called = true\n callback(error, ...output)\n }\n }\n\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n function then(value) {\n done(null, value)\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('vfile').VFileCompatible} VFileCompatible\n * @typedef {import('vfile').VFileValue} VFileValue\n * @typedef {import('..').Processor} Processor\n * @typedef {import('..').Plugin} Plugin\n * @typedef {import('..').Preset} Preset\n * @typedef {import('..').Pluggable} Pluggable\n * @typedef {import('..').PluggableList} PluggableList\n * @typedef {import('..').Transformer} Transformer\n * @typedef {import('..').Parser} Parser\n * @typedef {import('..').Compiler} Compiler\n * @typedef {import('..').RunCallback} RunCallback\n * @typedef {import('..').ProcessCallback} ProcessCallback\n *\n * @typedef Context\n * @property {Node} tree\n * @property {VFile} file\n */\n\nimport {bail} from 'bail'\nimport isBuffer from 'is-buffer'\nimport extend from 'extend'\nimport isPlainObj from 'is-plain-obj'\nimport {trough} from 'trough'\nimport {VFile} from 'vfile'\n\n// Expose a frozen processor.\nexport const unified = base().freeze()\n\nconst own = {}.hasOwnProperty\n\n// Function to create the first processor.\n/**\n * @returns {Processor}\n */\nfunction base() {\n const transformers = trough()\n /** @type {Processor['attachers']} */\n const attachers = []\n /** @type {Record} */\n let namespace = {}\n /** @type {boolean|undefined} */\n let frozen\n let freezeIndex = -1\n\n // Data management.\n // @ts-expect-error: overloads are handled.\n processor.data = data\n processor.Parser = undefined\n processor.Compiler = undefined\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n // @ts-expect-error: overloads are handled.\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n // @ts-expect-error: overloads are handled.\n processor.run = run\n processor.runSync = runSync\n // @ts-expect-error: overloads are handled.\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n /** @type {Processor} */\n function processor() {\n const destination = base()\n let index = -1\n\n while (++index < attachers.length) {\n destination.use(...attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /**\n * @param {string|Record} [key]\n * @param {unknown} [value]\n * @returns {unknown}\n */\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n namespace[key] = value\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n /** @type {Processor['freeze']} */\n function freeze() {\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n const [attacher, ...options] = attachers[freezeIndex]\n\n if (options[0] === false) {\n continue\n }\n\n if (options[0] === true) {\n options[0] = undefined\n }\n\n /** @type {Transformer|void} */\n const transformer = attacher.call(processor, ...options)\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Number.POSITIVE_INFINITY\n\n return processor\n }\n\n /**\n * @param {Pluggable|null|undefined} [value]\n * @param {...unknown} options\n * @returns {Processor}\n */\n function use(value, ...options) {\n /** @type {Record|undefined} */\n let settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin(value, ...options)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = Object.assign(namespace.settings || {}, settings)\n }\n\n return processor\n\n /**\n * @param {import('..').Pluggable} value\n * @returns {void}\n */\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n const [plugin, ...options] = value\n addPlugin(plugin, ...options)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n }\n\n /**\n * @param {Preset} result\n * @returns {void}\n */\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = Object.assign(settings || {}, result.settings)\n }\n }\n\n /**\n * @param {PluggableList|null|undefined} [plugins]\n * @returns {void}\n */\n function addList(plugins) {\n let index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n const thing = plugins[index]\n add(thing)\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n /**\n * @param {Plugin} plugin\n * @param {...unknown} [value]\n * @returns {void}\n */\n function addPlugin(plugin, value) {\n let index = -1\n /** @type {Processor['attachers'][number]|undefined} */\n let entry\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entry = attachers[index]\n break\n }\n }\n\n if (entry) {\n if (isPlainObj(entry[1]) && isPlainObj(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n // @ts-expect-error: fine.\n attachers.push([...arguments])\n }\n }\n }\n\n /** @type {Processor['parse']} */\n function parse(doc) {\n processor.freeze()\n const file = vfile(doc)\n const Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n // @ts-expect-error: `newable` checks this.\n return new Parser(String(file), file).parse()\n }\n\n // @ts-expect-error: `newable` checks this.\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /** @type {Processor['stringify']} */\n function stringify(node, doc) {\n processor.freeze()\n const file = vfile(doc)\n const Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n // @ts-expect-error: `newable` checks this.\n return new Compiler(node, file).compile()\n }\n\n // @ts-expect-error: `newable` checks this.\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /**\n * @param {Node} node\n * @param {VFileCompatible|RunCallback} [doc]\n * @param {RunCallback} [callback]\n * @returns {Promise|void}\n */\n function run(node, doc, callback) {\n assertNode(node)\n processor.freeze()\n\n if (!callback && typeof doc === 'function') {\n callback = doc\n doc = undefined\n }\n\n if (!callback) {\n return new Promise(executor)\n }\n\n executor(null, callback)\n\n /**\n * @param {null|((node: Node) => void)} resolve\n * @param {(error: Error) => void} reject\n * @returns {void}\n */\n function executor(resolve, reject) {\n // @ts-expect-error: `doc` can’t be a callback anymore, we checked.\n transformers.run(node, vfile(doc), done)\n\n /**\n * @param {Error|null} error\n * @param {Node} tree\n * @param {VFile} file\n * @returns {void}\n */\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n // @ts-expect-error: `callback` is defined if `resolve` is not.\n callback(null, tree, file)\n }\n }\n }\n }\n\n /** @type {Processor['runSync']} */\n function runSync(node, file) {\n /** @type {Node|undefined} */\n let result\n /** @type {boolean|undefined} */\n let complete\n\n processor.run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n // @ts-expect-error: we either bailed on an error or have a tree.\n return result\n\n /**\n * @param {Error|null} [error]\n * @param {Node} [tree]\n * @returns {void}\n */\n function done(error, tree) {\n bail(error)\n result = tree\n complete = true\n }\n }\n\n /**\n * @param {VFileCompatible} doc\n * @param {ProcessCallback} [callback]\n * @returns {Promise|undefined}\n */\n function process(doc, callback) {\n processor.freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!callback) {\n return new Promise(executor)\n }\n\n executor(null, callback)\n\n /**\n * @param {null|((file: VFile) => void)} resolve\n * @param {(error?: Error|null|undefined) => void} reject\n * @returns {void}\n */\n function executor(resolve, reject) {\n const file = vfile(doc)\n\n processor.run(processor.parse(file), file, (error, tree, file) => {\n if (error || !tree || !file) {\n done(error)\n } else {\n /** @type {unknown} */\n const result = processor.stringify(tree, file)\n\n if (result === undefined || result === null) {\n // Empty.\n } else if (looksLikeAVFileValue(result)) {\n file.value = result\n } else {\n file.result = result\n }\n\n done(error, file)\n }\n })\n\n /**\n * @param {Error|null|undefined} [error]\n * @param {VFile|undefined} [file]\n * @returns {void}\n */\n function done(error, file) {\n if (error || !file) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n // @ts-expect-error: `callback` is defined if `resolve` is not.\n callback(null, file)\n }\n }\n }\n }\n\n /** @type {Processor['processSync']} */\n function processSync(doc) {\n /** @type {boolean|undefined} */\n let complete\n\n processor.freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n\n const file = vfile(doc)\n\n processor.process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n /**\n * @param {Error|null|undefined} [error]\n * @returns {void}\n */\n function done(error) {\n complete = true\n bail(error)\n }\n }\n}\n\n/**\n * Check if `value` is a constructor.\n *\n * @param {unknown} value\n * @param {string} name\n * @returns {boolean}\n */\nfunction newable(value, name) {\n return (\n typeof value === 'function' &&\n // Prototypes do exist.\n // type-coverage:ignore-next-line\n value.prototype &&\n // A function with keys in its prototype is probably a constructor.\n // Classes’ prototype methods are not enumerable, so we check if some value\n // exists in the prototype.\n // type-coverage:ignore-next-line\n (keys(value.prototype) || name in value.prototype)\n )\n}\n\n/**\n * Check if `value` is an object with keys.\n *\n * @param {Record} value\n * @returns {boolean}\n */\nfunction keys(value) {\n /** @type {string} */\n let key\n\n for (key in value) {\n if (own.call(value, key)) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `Parser`')\n }\n}\n\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `Compiler`')\n }\n}\n\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot call `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`')\n // Fine.\n }\n}\n\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n\n/**\n * @param {VFileCompatible} [value]\n * @returns {VFile}\n */\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value)\n}\n\n/**\n * @param {VFileCompatible} [value]\n * @returns {value is VFile}\n */\nfunction looksLikeAVFile(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'message' in value &&\n 'messages' in value\n )\n}\n\n/**\n * @param {unknown} [value]\n * @returns {value is VFileValue}\n */\nfunction looksLikeAVFileValue(value) {\n return typeof value === 'string' || isBuffer(value)\n}\n","/**\n * @typedef Options\n * @property {boolean} [includeImageAlt=true]\n */\n\n/**\n * Get the text content of a node.\n * Prefer the node’s plain-text fields, otherwise serialize its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} node\n * @param {Options} [options]\n * @returns {string}\n */\nexport function toString(node, options) {\n var {includeImageAlt = true} = options || {}\n return one(node, includeImageAlt)\n}\n\n/**\n * @param {unknown} node\n * @param {boolean} includeImageAlt\n * @returns {string}\n */\nfunction one(node, includeImageAlt) {\n return (\n (node &&\n typeof node === 'object' &&\n // @ts-ignore looks like a literal.\n (node.value ||\n // @ts-ignore looks like an image.\n (includeImageAlt ? node.alt : '') ||\n // @ts-ignore looks like a parent.\n ('children' in node && all(node.children, includeImageAlt)) ||\n (Array.isArray(node) && all(node, includeImageAlt)))) ||\n ''\n )\n}\n\n/**\n * @param {Array.} values\n * @param {boolean} includeImageAlt\n * @returns {string}\n */\nfunction all(values, includeImageAlt) {\n /** @type {Array.} */\n var result = []\n var index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt)\n }\n\n return result.join('')\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * @param {T[]} list\n * @param {number} start\n * @param {number} remove\n * @param {T[]} items\n * @returns {void}\n */\nexport function splice(list, start, remove, items) {\n const end = list.length\n let chunkStart = 0\n /** @type {unknown[]} */\n\n let parameters // Make start between zero and `end` (included).\n\n if (start < 0) {\n start = -start > end ? 0 : end + start\n } else {\n start = start > end ? end : start\n }\n\n remove = remove > 0 ? remove : 0 // No need to chunk the items if there’s only a couple (10k) items.\n\n if (items.length < 10000) {\n parameters = Array.from(items)\n parameters.unshift(start, remove) // @ts-expect-error Hush, it’s fine.\n ;[].splice.apply(list, parameters)\n } else {\n // Delete `remove` items starting from `start`\n if (remove) [].splice.apply(list, [start, remove]) // Insert the items in chunks to not cause stack overflows.\n\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000)\n parameters.unshift(start, 0) // @ts-expect-error Hush, it’s fine.\n ;[].splice.apply(list, parameters)\n chunkStart += 10000\n start += 10000\n }\n }\n}\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * @param {T[]} list\n * @param {T[]} items\n * @returns {T[]}\n */\n\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items)\n return list\n }\n\n return items\n}\n","/**\n * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine several syntax extensions into one.\n *\n * @param {Extension[]} extensions List of syntax extensions.\n * @returns {NormalizedExtension} A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all Extension to merge into.\n * @param {Extension} extension Extension to merge.\n * @returns {void}\n */\nfunction syntaxExtension(all, extension) {\n /** @type {string} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {string} */\n let code\n\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {unknown[]} existing\n * @param {unknown[]} list\n * @returns {void}\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {unknown[]} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine several HTML extensions into one.\n *\n * @param {HtmlExtension[]} htmlExtensions List of HTML extensions.\n * @returns {HtmlExtension} A single combined extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all Extension to merge into.\n * @param {HtmlExtension} extension Extension to merge.\n * @returns {void}\n */\nfunction htmlExtension(all, extension) {\n /** @type {string} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {string} */\n let type\n\n if (right) {\n for (type in right) {\n left[type] = right[type]\n }\n }\n }\n}\n","// This module is generated by `script/`.\n//\n// CommonMark handles attention (emphasis, strong) markers based on what comes\n// before or after them.\n// One such difference is if those characters are Unicode punctuation.\n// This script is generated from the Unicode data.\nexport const unicodePunctuationRegex =\n /[!-/:-@[-`{-~\\u00A1\\u00A7\\u00AB\\u00B6\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]/\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {unicodePunctuationRegex} from './lib/unicode-punctuation-regex.js'\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n */\n\nexport const asciiAlpha = regexCheck(/[A-Za-z]/)\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n */\n\nexport const asciiDigit = regexCheck(/\\d/)\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n */\n\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/)\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n */\n\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/)\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n */\n\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n */\n\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/)\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * @returns {code is number}\n */\n\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n )\n}\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * @returns {code is number}\n */\n\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32)\n}\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * @returns {code is number}\n */\n\nexport function markdownLineEnding(code) {\n return code !== null && code < -2\n}\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * @returns {code is number}\n */\n\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32\n}\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n */\n\nexport const unicodeWhitespace = regexCheck(/\\s/)\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n */\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n\nexport const unicodePunctuation = regexCheck(unicodePunctuationRegex)\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * @returns {(code: Code) => code is number}\n */\n\nfunction regexCheck(regex) {\n return check\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code Character code\n * @returns {code is number} Whether the character code matches the bound regex\n */\n\n function check(code) {\n return code !== null && regex.test(String.fromCharCode(code))\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\nimport {markdownSpace} from 'micromark-util-character'\n/**\n * @param {Effects} effects\n * @param {State} ok\n * @param {string} type\n * @param {number} [max=Infinity]\n * @returns {State}\n */\n\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Number.POSITIVE_INFINITY\n let size = 0\n return start\n /** @type {State} */\n\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type)\n return prefix(code)\n }\n\n return ok(code)\n }\n /** @type {State} */\n\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code)\n return prefix\n }\n\n effects.exit(type)\n return ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n}\n/** @type {Initializer} */\n\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(\n this.parser.constructs.contentInitial,\n afterContentStartConstruct,\n paragraphInitial\n )\n /** @type {Token} */\n\n let previous\n return contentStart\n /** @type {State} */\n\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, contentStart, 'linePrefix')\n }\n /** @type {State} */\n\n function paragraphInitial(code) {\n effects.enter('paragraph')\n return lineStart(code)\n }\n /** @type {State} */\n\n function lineStart(code) {\n const token = effects.enter('chunkText', {\n contentType: 'text',\n previous\n })\n\n if (previous) {\n previous.next = token\n }\n\n previous = token\n return data(code)\n }\n /** @type {State} */\n\n function data(code) {\n if (code === null) {\n effects.exit('chunkText')\n effects.exit('paragraph')\n effects.consume(code)\n return\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code)\n effects.exit('chunkText')\n return lineStart\n } // Data.\n\n effects.consume(code)\n return data\n }\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Point} Point\n */\n\n/**\n * @typedef {Record} StackState\n * @typedef {[Construct, StackState]} StackItem\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {splice} from 'micromark-util-chunked'\n/** @type {InitialConstruct} */\n\nexport const document = {\n tokenize: initializeDocument\n}\n/** @type {Construct} */\n\nconst containerConstruct = {\n tokenize: tokenizeContainer\n}\n/** @type {Initializer} */\n\nfunction initializeDocument(effects) {\n const self = this\n /** @type {StackItem[]} */\n\n const stack = []\n let continued = 0\n /** @type {TokenizeContext|undefined} */\n\n let childFlow\n /** @type {Token|undefined} */\n\n let childToken\n /** @type {number} */\n\n let lineStartOffset\n return start\n /** @type {State} */\n\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued]\n self.containerState = item[1]\n return effects.attempt(\n item[0].continuation,\n documentContinue,\n checkNewContainers\n )(code)\n } // Done.\n\n return checkNewContainers(code)\n }\n /** @type {State} */\n\n function documentContinue(code) {\n continued++ // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined\n\n if (childFlow) {\n closeFlow()\n } // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n\n const indexBeforeExits = self.events.length\n let indexBeforeFlow = indexBeforeExits\n /** @type {Point|undefined} */\n\n let point // Find the flow chunk.\n\n while (indexBeforeFlow--) {\n if (\n self.events[indexBeforeFlow][0] === 'exit' &&\n self.events[indexBeforeFlow][1].type === 'chunkFlow'\n ) {\n point = self.events[indexBeforeFlow][1].end\n break\n }\n }\n\n exitContainers(continued) // Fix positions.\n\n let index = indexBeforeExits\n\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point)\n index++\n } // Inject the exits earlier (they’re still also at the end).\n\n splice(\n self.events,\n indexBeforeFlow + 1,\n 0,\n self.events.slice(indexBeforeExits)\n ) // Discard the duplicate exits.\n\n self.events.length = index\n return checkNewContainers(code)\n }\n\n return start(code)\n }\n /** @type {State} */\n\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code)\n } // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code)\n } // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n\n self.interrupt = Boolean(\n childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack\n )\n } // Check if there is a new container.\n\n self.containerState = {}\n return effects.check(\n containerConstruct,\n thereIsANewContainer,\n thereIsNoNewContainer\n )(code)\n }\n /** @type {State} */\n\n function thereIsANewContainer(code) {\n if (childFlow) closeFlow()\n exitContainers(continued)\n return documentContinued(code)\n }\n /** @type {State} */\n\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length\n lineStartOffset = self.now().offset\n return flowStart(code)\n }\n /** @type {State} */\n\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {}\n return effects.attempt(\n containerConstruct,\n containerContinue,\n flowStart\n )(code)\n }\n /** @type {State} */\n\n function containerContinue(code) {\n continued++\n stack.push([self.currentConstruct, self.containerState]) // Try another.\n\n return documentContinued(code)\n }\n /** @type {State} */\n\n function flowStart(code) {\n if (code === null) {\n if (childFlow) closeFlow()\n exitContainers(0)\n effects.consume(code)\n return\n }\n\n childFlow = childFlow || self.parser.flow(self.now())\n effects.enter('chunkFlow', {\n contentType: 'flow',\n previous: childToken,\n _tokenizer: childFlow\n })\n return flowContinue(code)\n }\n /** @type {State} */\n\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit('chunkFlow'), true)\n exitContainers(0)\n effects.consume(code)\n return\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code)\n writeToChild(effects.exit('chunkFlow')) // Get ready for the next line.\n\n continued = 0\n self.interrupt = undefined\n return start\n }\n\n effects.consume(code)\n return flowContinue\n }\n /**\n * @param {Token} token\n * @param {boolean} [eof]\n * @returns {void}\n */\n\n function writeToChild(token, eof) {\n const stream = self.sliceStream(token)\n if (eof) stream.push(null)\n token.previous = childToken\n if (childToken) childToken.next = token\n childToken = token\n childFlow.defineSkip(token.start)\n childFlow.write(stream) // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length\n\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && // …and either is not ended yet…\n (!childFlow.events[index][1].end || // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)\n ) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return\n }\n } // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n\n const indexBeforeExits = self.events.length\n let indexBeforeFlow = indexBeforeExits\n /** @type {boolean|undefined} */\n\n let seen\n /** @type {Point|undefined} */\n\n let point // Find the previous chunk (the one before the lazy line).\n\n while (indexBeforeFlow--) {\n if (\n self.events[indexBeforeFlow][0] === 'exit' &&\n self.events[indexBeforeFlow][1].type === 'chunkFlow'\n ) {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end\n break\n }\n\n seen = true\n }\n }\n\n exitContainers(continued) // Fix positions.\n\n index = indexBeforeExits\n\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point)\n index++\n } // Inject the exits earlier (they’re still also at the end).\n\n splice(\n self.events,\n indexBeforeFlow + 1,\n 0,\n self.events.slice(indexBeforeExits)\n ) // Discard the duplicate exits.\n\n self.events.length = index\n }\n }\n /**\n * @param {number} size\n * @returns {void}\n */\n\n function exitContainers(size) {\n let index = stack.length // Exit open containers.\n\n while (index-- > size) {\n const entry = stack[index]\n self.containerState = entry[1]\n entry[0].exit.call(self, effects)\n }\n\n stack.length = size\n }\n\n function closeFlow() {\n childFlow.write([null])\n childToken = undefined\n childFlow = undefined\n self.containerState._closeFlow = undefined\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeContainer(effects, ok, nok) {\n return factorySpace(\n effects,\n effects.attempt(this.parser.constructs.document, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4\n )\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const blankLine = {\n tokenize: tokenizeBlankLine,\n partial: true\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeBlankLine(effects, ok, nok) {\n return factorySpace(effects, afterWhitespace, 'linePrefix')\n /** @type {State} */\n\n function afterWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Event} Event\n */\nimport {splice} from 'micromark-util-chunked'\n\n/**\n * Tokenize subcontent.\n *\n * @param {Event[]} events\n * @returns {boolean}\n */\nexport function subtokenize(events) {\n /** @type {Record} */\n const jumps = {}\n let index = -1\n /** @type {Event} */\n\n let event\n /** @type {number|undefined} */\n\n let lineIndex\n /** @type {number} */\n\n let otherIndex\n /** @type {Event} */\n\n let otherEvent\n /** @type {Event[]} */\n\n let parameters\n /** @type {Event[]} */\n\n let subevents\n /** @type {boolean|undefined} */\n\n let more\n\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index]\n }\n\n event = events[index] // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n\n if (\n index &&\n event[1].type === 'chunkFlow' &&\n events[index - 1][1].type === 'listItemPrefix'\n ) {\n subevents = event[1]._tokenizer.events\n otherIndex = 0\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'lineEndingBlank'\n ) {\n otherIndex += 2\n }\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'content'\n ) {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === 'content') {\n break\n }\n\n if (subevents[otherIndex][1].type === 'chunkText') {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true\n otherIndex++\n }\n }\n }\n } // Enter.\n\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index))\n index = jumps[index]\n more = true\n }\n } // Exit.\n else if (event[1]._container) {\n otherIndex = index\n lineIndex = undefined\n\n while (otherIndex--) {\n otherEvent = events[otherIndex]\n\n if (\n otherEvent[1].type === 'lineEnding' ||\n otherEvent[1].type === 'lineEndingBlank'\n ) {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n }\n\n otherEvent[1].type = 'lineEnding'\n lineIndex = otherIndex\n }\n } else {\n break\n }\n }\n\n if (lineIndex) {\n // Fix position.\n event[1].end = Object.assign({}, events[lineIndex][1].start) // Switch container exit w/ line endings.\n\n parameters = events.slice(lineIndex, index)\n parameters.unshift(event)\n splice(events, lineIndex, index - lineIndex + 1, parameters)\n }\n }\n }\n\n return !more\n}\n/**\n * Tokenize embedded tokens.\n *\n * @param {Event[]} events\n * @param {number} eventIndex\n * @returns {Record}\n */\n\nfunction subcontent(events, eventIndex) {\n const token = events[eventIndex][1]\n const context = events[eventIndex][2]\n let startPosition = eventIndex - 1\n /** @type {number[]} */\n\n const startPositions = []\n const tokenizer =\n token._tokenizer || context.parser[token.contentType](token.start)\n const childEvents = tokenizer.events\n /** @type {[number, number][]} */\n\n const jumps = []\n /** @type {Record} */\n\n const gaps = {}\n /** @type {Chunk[]} */\n\n let stream\n /** @type {Token|undefined} */\n\n let previous\n let index = -1\n /** @type {Token|undefined} */\n\n let current = token\n let adjust = 0\n let start = 0\n const breaks = [start] // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n\n while (current) {\n // Find the position of the event for this token.\n while (events[++startPosition][1] !== current) {\n // Empty.\n }\n\n startPositions.push(startPosition)\n\n if (!current._tokenizer) {\n stream = context.sliceStream(current)\n\n if (!current.next) {\n stream.push(null)\n }\n\n if (previous) {\n tokenizer.defineSkip(current.start)\n }\n\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true\n }\n\n tokenizer.write(stream)\n\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined\n }\n } // Unravel the next token.\n\n previous = current\n current = current.next\n } // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n\n current = token\n\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' &&\n childEvents[index - 1][0] === 'enter' &&\n childEvents[index][1].type === childEvents[index - 1][1].type &&\n childEvents[index][1].start.line !== childEvents[index][1].end.line\n ) {\n start = index + 1\n breaks.push(start) // Help GC.\n\n current._tokenizer = undefined\n current.previous = undefined\n current = current.next\n }\n } // Help GC.\n\n tokenizer.events = [] // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n\n if (current) {\n // Help GC.\n current._tokenizer = undefined\n current.previous = undefined\n } else {\n breaks.pop()\n } // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n\n index = breaks.length\n\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1])\n const start = startPositions.pop()\n jumps.unshift([start, start + slice.length - 1])\n splice(events, start, 2, slice)\n }\n\n index = -1\n\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]\n adjust += jumps[index][1] - jumps[index][0] - 1\n }\n\n return gaps\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {subtokenize} from 'micromark-util-subtokenize'\n\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n tokenize: tokenizeContent,\n resolve: resolveContent\n}\n/** @type {Construct} */\n\nconst continuationConstruct = {\n tokenize: tokenizeContinuation,\n partial: true\n}\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\n\nfunction resolveContent(events) {\n subtokenize(events)\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeContent(effects, ok) {\n /** @type {Token} */\n let previous\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('content')\n previous = effects.enter('chunkContent', {\n contentType: 'content'\n })\n return data(code)\n }\n /** @type {State} */\n\n function data(code) {\n if (code === null) {\n return contentEnd(code)\n }\n\n if (markdownLineEnding(code)) {\n return effects.check(\n continuationConstruct,\n contentContinue,\n contentEnd\n )(code)\n } // Data.\n\n effects.consume(code)\n return data\n }\n /** @type {State} */\n\n function contentEnd(code) {\n effects.exit('chunkContent')\n effects.exit('content')\n return ok(code)\n }\n /** @type {State} */\n\n function contentContinue(code) {\n effects.consume(code)\n effects.exit('chunkContent')\n previous.next = effects.enter('chunkContent', {\n contentType: 'content',\n previous\n })\n previous = previous.next\n return data\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this\n return startLookahead\n /** @type {State} */\n\n function startLookahead(code) {\n effects.exit('chunkContent')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, prefixed, 'linePrefix')\n }\n /** @type {State} */\n\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n\n const tail = self.events[self.events.length - 1]\n\n if (\n !self.parser.constructs.disable.null.includes('codeIndented') &&\n tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ) {\n return ok(code)\n }\n\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {blankLine, content} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n}\n/** @type {Initializer} */\n\nfunction initializeFlow(effects) {\n const self = this\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine,\n atBlankEnding, // Try to parse initial flow (essentially, only code).\n effects.attempt(\n this.parser.constructs.flowInitial,\n afterConstruct,\n factorySpace(\n effects,\n effects.attempt(\n this.parser.constructs.flow,\n afterConstruct,\n effects.attempt(content, afterConstruct)\n ),\n 'linePrefix'\n )\n )\n )\n return initial\n /** @type {State} */\n\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEndingBlank')\n effects.consume(code)\n effects.exit('lineEndingBlank')\n self.currentConstruct = undefined\n return initial\n }\n /** @type {State} */\n\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n self.currentConstruct = undefined\n return initial\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nexport const resolver = {\n resolveAll: createResolver()\n}\nexport const string = initializeFactory('string')\nexport const text = initializeFactory('text')\n/**\n * @param {'string'|'text'} field\n * @returns {InitialConstruct}\n */\n\nfunction initializeFactory(field) {\n return {\n tokenize: initializeText,\n resolveAll: createResolver(\n field === 'text' ? resolveAllLineSuffixes : undefined\n )\n }\n /** @type {Initializer} */\n\n function initializeText(effects) {\n const self = this\n const constructs = this.parser.constructs[field]\n const text = effects.attempt(constructs, start, notText)\n return start\n /** @type {State} */\n\n function start(code) {\n return atBreak(code) ? text(code) : notText(code)\n }\n /** @type {State} */\n\n function notText(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('data')\n effects.consume(code)\n return data\n }\n /** @type {State} */\n\n function data(code) {\n if (atBreak(code)) {\n effects.exit('data')\n return text(code)\n } // Data.\n\n effects.consume(code)\n return data\n }\n /**\n * @param {Code} code\n * @returns {boolean}\n */\n\n function atBreak(code) {\n if (code === null) {\n return true\n }\n\n const list = constructs[code]\n let index = -1\n\n if (list) {\n while (++index < list.length) {\n const item = list[index]\n\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true\n }\n }\n }\n\n return false\n }\n }\n}\n/**\n * @param {Resolver} [extraResolver]\n * @returns {Resolver}\n */\n\nfunction createResolver(extraResolver) {\n return resolveAllText\n /** @type {Resolver} */\n\n function resolveAllText(events, context) {\n let index = -1\n /** @type {number|undefined} */\n\n let enter // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === 'data') {\n enter = index\n index++\n }\n } else if (!events[index] || events[index][1].type !== 'data') {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n index = enter + 2\n }\n\n enter = undefined\n }\n }\n\n return extraResolver ? extraResolver(events, context) : events\n }\n}\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\n\nfunction resolveAllLineSuffixes(events, context) {\n let eventIndex = 0 // Skip first.\n\n while (++eventIndex <= events.length) {\n if (\n (eventIndex === events.length ||\n events[eventIndex][1].type === 'lineEnding') &&\n events[eventIndex - 1][1].type === 'data'\n ) {\n const data = events[eventIndex - 1][1]\n const chunks = context.sliceStream(data)\n let index = chunks.length\n let bufferIndex = -1\n let size = 0\n /** @type {boolean|undefined} */\n\n let tabs\n\n while (index--) {\n const chunk = chunks[index]\n\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length\n\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++\n bufferIndex--\n }\n\n if (bufferIndex) break\n bufferIndex = -1\n } // Number\n else if (chunk === -2) {\n tabs = true\n size++\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++\n break\n }\n }\n\n if (size) {\n const token = {\n type:\n eventIndex === events.length || tabs || size < 2\n ? 'lineSuffix'\n : 'hardBreakTrailing',\n start: {\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size,\n _index: data.start._index + index,\n _bufferIndex: index\n ? bufferIndex\n : data.start._bufferIndex + bufferIndex\n },\n end: Object.assign({}, data.end)\n }\n data.end = Object.assign({}, token.start)\n\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token)\n } else {\n events.splice(\n eventIndex,\n 0,\n ['enter', token, context],\n ['exit', token, context]\n )\n eventIndex += 2\n }\n }\n\n eventIndex++\n }\n }\n\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {{resolveAll?: Resolver}[]} constructs\n * @param {Event[]} events\n * @param {TokenizeContext} context\n * @returns {Event[]}\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Resolver[]} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n */\n\n/**\n * @typedef Info\n * @property {() => void} restore\n * @property {number} from\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * @param {Info} info\n * @returns {void}\n */\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * @param {InitialConstruct} initialize\n * @param {Omit} [from]\n * @returns {TokenizeContext}\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = Object.assign(\n from\n ? Object.assign({}, from)\n : {\n line: 1,\n column: 1,\n offset: 0\n },\n {\n _index: 0,\n _bufferIndex: -1\n }\n )\n /** @type {Record} */\n\n const columnStart = {}\n /** @type {Construct[]} */\n\n const resolveAllConstructs = []\n /** @type {Chunk[]} */\n\n let chunks = []\n /** @type {Token[]} */\n\n let stack = []\n /** @type {boolean|undefined} */\n\n let consumed = true\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n\n const effects = {\n consume,\n enter,\n exit,\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n }\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n\n const context = {\n previous: null,\n code: null,\n containerState: {},\n events: [],\n parser,\n sliceStream,\n sliceSerialize,\n now,\n defineSkip,\n write\n }\n /**\n * The state function.\n *\n * @type {State|void}\n */\n\n let state = initialize.tokenize.call(context, effects)\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n\n let expectedCode\n\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize)\n }\n\n return context\n /** @type {TokenizeContext['write']} */\n\n function write(slice) {\n chunks = push(chunks, slice)\n main() // Exit if we’re not done, resolve might change stuff.\n\n if (chunks[chunks.length - 1] !== null) {\n return []\n }\n\n addResult(initialize, 0) // Otherwise, resolve, and exit.\n\n context.events = resolveAll(resolveAllConstructs, context.events, context)\n return context.events\n } //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs)\n }\n /** @type {TokenizeContext['sliceStream']} */\n\n function sliceStream(token) {\n return sliceChunks(chunks, token)\n }\n /** @type {TokenizeContext['now']} */\n\n function now() {\n return Object.assign({}, point)\n }\n /** @type {TokenizeContext['defineSkip']} */\n\n function defineSkip(value) {\n columnStart[value.line] = value.column\n accountForPotentialSkip()\n } //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {void}\n */\n\n function main() {\n /** @type {number} */\n let chunkIndex\n\n while (point._index < chunks.length) {\n const chunk = chunks[point._index] // If we’re in a buffer chunk, loop through it.\n\n if (typeof chunk === 'string') {\n chunkIndex = point._index\n\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0\n }\n\n while (\n point._index === chunkIndex &&\n point._bufferIndex < chunk.length\n ) {\n go(chunk.charCodeAt(point._bufferIndex))\n }\n } else {\n go(chunk)\n }\n }\n }\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * @returns {void}\n */\n\n function go(code) {\n consumed = undefined\n expectedCode = code\n state = state(code)\n }\n /** @type {Effects['consume']} */\n\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++\n point.column = 1\n point.offset += code === -3 ? 2 : 1\n accountForPotentialSkip()\n } else if (code !== -1) {\n point.column++\n point.offset++\n } // Not in a string chunk.\n\n if (point._bufferIndex < 0) {\n point._index++\n } else {\n point._bufferIndex++ // At end of string chunk.\n // @ts-expect-error Points w/ non-negative `_bufferIndex` reference\n // strings.\n\n if (point._bufferIndex === chunks[point._index].length) {\n point._bufferIndex = -1\n point._index++\n }\n } // Expose the previous character.\n\n context.previous = code // Mark as consumed.\n\n consumed = true\n }\n /** @type {Effects['enter']} */\n\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {}\n token.type = type\n token.start = now()\n context.events.push(['enter', token, context])\n stack.push(token)\n return token\n }\n /** @type {Effects['exit']} */\n\n function exit(type) {\n const token = stack.pop()\n token.end = now()\n context.events.push(['exit', token, context])\n return token\n }\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from)\n }\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n\n function onsuccessfulcheck(_, info) {\n info.restore()\n }\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * @param {Record} [fields]\n */\n\n function constructFactory(onreturn, fields) {\n return hook\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Construct|Construct[]|ConstructRecord} constructs\n * @param {State} returnState\n * @param {State} [bogusState]\n * @returns {State}\n */\n\n function hook(constructs, returnState, bogusState) {\n /** @type {Construct[]} */\n let listOfConstructs\n /** @type {number} */\n\n let constructIndex\n /** @type {Construct} */\n\n let currentConstruct\n /** @type {Info} */\n\n let info\n return Array.isArray(constructs)\n ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs)\n : 'tokenize' in constructs // @ts-expect-error Looks like a construct.\n ? handleListOfConstructs([constructs])\n : handleMapOfConstructs(constructs)\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * @returns {State}\n */\n\n function handleMapOfConstructs(map) {\n return start\n /** @type {State} */\n\n function start(code) {\n const def = code !== null && map[code]\n const all = code !== null && map.null\n const list = [\n // To do: add more extension tests.\n\n /* c8 ignore next 2 */\n ...(Array.isArray(def) ? def : def ? [def] : []),\n ...(Array.isArray(all) ? all : all ? [all] : [])\n ]\n return handleListOfConstructs(list)(code)\n }\n }\n /**\n * Handle a list of construct.\n *\n * @param {Construct[]} list\n * @returns {State}\n */\n\n function handleListOfConstructs(list) {\n listOfConstructs = list\n constructIndex = 0\n\n if (list.length === 0) {\n return bogusState\n }\n\n return handleConstruct(list[constructIndex])\n }\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * @returns {State}\n */\n\n function handleConstruct(construct) {\n return start\n /** @type {State} */\n\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store()\n currentConstruct = construct\n\n if (!construct.partial) {\n context.currentConstruct = construct\n }\n\n if (\n construct.name &&\n context.parser.constructs.disable.null.includes(construct.name)\n ) {\n return nok(code)\n }\n\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context,\n effects,\n ok,\n nok\n )(code)\n }\n }\n /** @type {State} */\n\n function ok(code) {\n consumed = true\n onreturn(currentConstruct, info)\n return returnState\n }\n /** @type {State} */\n\n function nok(code) {\n consumed = true\n info.restore()\n\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex])\n }\n\n return bogusState\n }\n }\n }\n /**\n * @param {Construct} construct\n * @param {number} from\n * @returns {void}\n */\n\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct)\n }\n\n if (construct.resolve) {\n splice(\n context.events,\n from,\n context.events.length - from,\n construct.resolve(context.events.slice(from), context)\n )\n }\n\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context)\n }\n }\n /**\n * Store state.\n *\n * @returns {Info}\n */\n\n function store() {\n const startPoint = now()\n const startPrevious = context.previous\n const startCurrentConstruct = context.currentConstruct\n const startEventsIndex = context.events.length\n const startStack = Array.from(stack)\n return {\n restore,\n from: startEventsIndex\n }\n /**\n * Restore state.\n *\n * @returns {void}\n */\n\n function restore() {\n point = startPoint\n context.previous = startPrevious\n context.currentConstruct = startCurrentConstruct\n context.events.length = startEventsIndex\n stack = startStack\n accountForPotentialSkip()\n }\n }\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {void}\n */\n\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line]\n point.offset += columnStart[point.line] - 1\n }\n }\n}\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {Chunk[]} chunks\n * @param {Pick} token\n * @returns {Chunk[]}\n */\n\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index\n const startBufferIndex = token.start._bufferIndex\n const endIndex = token.end._index\n const endBufferIndex = token.end._bufferIndex\n /** @type {Chunk[]} */\n\n let view\n\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]\n } else {\n view = chunks.slice(startIndex, endIndex)\n\n if (startBufferIndex > -1) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view[0] = view[0].slice(startBufferIndex)\n }\n\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex))\n }\n }\n\n return view\n}\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {Chunk[]} chunks\n * @param {boolean} [expandTabs=false]\n * @returns {string}\n */\n\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1\n /** @type {string[]} */\n\n const result = []\n /** @type {boolean|undefined} */\n\n let atTab\n\n while (++index < chunks.length) {\n const chunk = chunks[index]\n /** @type {string} */\n\n let value\n\n if (typeof chunk === 'string') {\n value = chunk\n } else\n switch (chunk) {\n case -5: {\n value = '\\r'\n break\n }\n\n case -4: {\n value = '\\n'\n break\n }\n\n case -3: {\n value = '\\r' + '\\n'\n break\n }\n\n case -2: {\n value = expandTabs ? ' ' : '\\t'\n break\n }\n\n case -1: {\n if (!expandTabs && atTab) continue\n value = ' '\n break\n }\n\n default: {\n // Currently only replacement character.\n value = String.fromCharCode(chunk)\n }\n }\n\n atTab = chunk === -2\n result.push(value)\n }\n\n return result.join('')\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0\n /** @type {NonNullable} */\n\n let marker\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('thematicBreak')\n marker = code\n return atBreak(code)\n }\n /** @type {State} */\n\n function atBreak(code) {\n if (code === marker) {\n effects.enter('thematicBreakSequence')\n return sequence(code)\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, 'whitespace')(code)\n }\n\n if (size < 3 || (code !== null && !markdownLineEnding(code))) {\n return nok(code)\n }\n\n effects.exit('thematicBreak')\n return ok(code)\n }\n /** @type {State} */\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return sequence\n }\n\n effects.exit('thematicBreakSequence')\n return atBreak(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\n\n/**\n * @typedef {Record & {marker: Code, type: string, size: number}} ListContainerState\n * @typedef {TokenizeContext & {containerState: ListContainerState}} TokenizeContextWithState\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {asciiDigit, markdownSpace} from 'micromark-util-character'\nimport {blankLine} from './blank-line.js'\nimport {thematicBreak} from './thematic-break.js'\n/** @type {Construct} */\n\nexport const list = {\n name: 'list',\n tokenize: tokenizeListStart,\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd\n}\n/** @type {Construct} */\n\nconst listItemPrefixWhitespaceConstruct = {\n tokenize: tokenizeListItemPrefixWhitespace,\n partial: true\n}\n/** @type {Construct} */\n\nconst indentConstruct = {\n tokenize: tokenizeIndent,\n partial: true\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this\n const tail = self.events[self.events.length - 1]\n let initialSize =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n let size = 0\n return start\n /** @type {State} */\n\n function start(code) {\n const kind =\n self.containerState.type ||\n (code === 42 || code === 43 || code === 45\n ? 'listUnordered'\n : 'listOrdered')\n\n if (\n kind === 'listUnordered'\n ? !self.containerState.marker || code === self.containerState.marker\n : asciiDigit(code)\n ) {\n if (!self.containerState.type) {\n self.containerState.type = kind\n effects.enter(kind, {\n _container: true\n })\n }\n\n if (kind === 'listUnordered') {\n effects.enter('listItemPrefix')\n return code === 42 || code === 45\n ? effects.check(thematicBreak, nok, atMarker)(code)\n : atMarker(code)\n }\n\n if (!self.interrupt || code === 49) {\n effects.enter('listItemPrefix')\n effects.enter('listItemValue')\n return inside(code)\n }\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code)\n return inside\n }\n\n if (\n (!self.interrupt || size < 2) &&\n (self.containerState.marker\n ? code === self.containerState.marker\n : code === 41 || code === 46)\n ) {\n effects.exit('listItemValue')\n return atMarker(code)\n }\n\n return nok(code)\n }\n /**\n * @type {State}\n **/\n\n function atMarker(code) {\n effects.enter('listItemMarker')\n effects.consume(code)\n effects.exit('listItemMarker')\n self.containerState.marker = self.containerState.marker || code\n return effects.check(\n blankLine, // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank,\n effects.attempt(\n listItemPrefixWhitespaceConstruct,\n endOfPrefix,\n otherPrefix\n )\n )\n }\n /** @type {State} */\n\n function onBlank(code) {\n self.containerState.initialBlankLine = true\n initialSize++\n return endOfPrefix(code)\n }\n /** @type {State} */\n\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter('listItemPrefixWhitespace')\n effects.consume(code)\n effects.exit('listItemPrefixWhitespace')\n return endOfPrefix\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function endOfPrefix(code) {\n self.containerState.size =\n initialSize +\n self.sliceSerialize(effects.exit('listItemPrefix'), true).length\n return ok(code)\n }\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this\n self.containerState._closeFlow = undefined\n return effects.check(blankLine, onBlank, notBlank)\n /** @type {State} */\n\n function onBlank(code) {\n self.containerState.furtherBlankLines =\n self.containerState.furtherBlankLines ||\n self.containerState.initialBlankLine // We have a blank line.\n // Still, try to consume at most the items size.\n\n return factorySpace(\n effects,\n ok,\n 'listItemIndent',\n self.containerState.size + 1\n )(code)\n }\n /** @type {State} */\n\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined\n self.containerState.initialBlankLine = undefined\n return notInCurrentItem(code)\n }\n\n self.containerState.furtherBlankLines = undefined\n self.containerState.initialBlankLine = undefined\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code)\n }\n /** @type {State} */\n\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true // As we’re closing flow, we’re no longer interrupting.\n\n self.interrupt = undefined\n return factorySpace(\n effects,\n effects.attempt(list, ok, nok),\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n }\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemIndent',\n self.containerState.size + 1\n )\n /** @type {State} */\n\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'listItemIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === self.containerState.size\n ? ok(code)\n : nok(code)\n }\n}\n/**\n * @type {Exiter}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type)\n}\n/**\n * @type {Tokenizer}\n * @this {TokenizeContextWithState}\n */\n\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemPrefixWhitespace',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4 + 1\n )\n /** @type {State} */\n\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return !markdownSpace(code) &&\n tail &&\n tail[1].type === 'listItemPrefixWhitespace'\n ? ok(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownSpace} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const blockQuote = {\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart,\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n if (code === 62) {\n const state = self.containerState\n\n if (!state.open) {\n effects.enter('blockQuote', {\n _container: true\n })\n state.open = true\n }\n\n effects.enter('blockQuotePrefix')\n effects.enter('blockQuoteMarker')\n effects.consume(code)\n effects.exit('blockQuoteMarker')\n return after\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter('blockQuotePrefixWhitespace')\n effects.consume(code)\n effects.exit('blockQuotePrefixWhitespace')\n effects.exit('blockQuotePrefix')\n return ok\n }\n\n effects.exit('blockQuotePrefix')\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n return factorySpace(\n effects,\n effects.attempt(blockQuote, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4\n )\n}\n/** @type {Exiter} */\n\nfunction exit(effects) {\n effects.exit('blockQuote')\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\nimport {\n asciiControl,\n markdownLineEndingOrSpace,\n markdownLineEnding\n} from 'micromark-util-character'\n\n/**\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} literalType\n * @param {string} literalMarkerType\n * @param {string} rawType\n * @param {string} stringType\n * @param {number} [max=Infinity]\n * @returns {State}\n */\n// eslint-disable-next-line max-params\nexport function factoryDestination(\n effects,\n ok,\n nok,\n type,\n literalType,\n literalMarkerType,\n rawType,\n stringType,\n max\n) {\n const limit = max || Number.POSITIVE_INFINITY\n let balance = 0\n return start\n /** @type {State} */\n\n function start(code) {\n if (code === 60) {\n effects.enter(type)\n effects.enter(literalType)\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n return destinationEnclosedBefore\n }\n\n if (code === null || code === 41 || asciiControl(code)) {\n return nok(code)\n }\n\n effects.enter(type)\n effects.enter(rawType)\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationRaw(code)\n }\n /** @type {State} */\n\n function destinationEnclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n effects.exit(literalType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationEnclosed(code)\n }\n /** @type {State} */\n\n function destinationEnclosed(code) {\n if (code === 62) {\n effects.exit('chunkString')\n effects.exit(stringType)\n return destinationEnclosedBefore(code)\n }\n\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return code === 92 ? destinationEnclosedEscape : destinationEnclosed\n }\n /** @type {State} */\n\n function destinationEnclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code)\n return destinationEnclosed\n }\n\n return destinationEnclosed(code)\n }\n /** @type {State} */\n\n function destinationRaw(code) {\n if (code === 40) {\n if (++balance > limit) return nok(code)\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === 41) {\n if (!balance--) {\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n if (balance) return nok(code)\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n if (asciiControl(code)) return nok(code)\n effects.consume(code)\n return code === 92 ? destinationRawEscape : destinationRaw\n }\n /** @type {State} */\n\n function destinationRawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code)\n return destinationRaw\n }\n\n return destinationRaw(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').State} State\n */\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n\n/**\n * @this {TokenizeContext}\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} markerType\n * @param {string} stringType\n * @returns {State}\n */\n// eslint-disable-next-line max-params\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this\n let size = 0\n /** @type {boolean} */\n\n let data\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.enter(stringType)\n return atBreak\n }\n /** @type {State} */\n\n function atBreak(code) {\n if (\n code === null ||\n code === 91 ||\n (code === 93 && !data) ||\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook */\n\n /* c8 ignore next 3 */\n (code === 94 &&\n !size &&\n '_hiddenFootnoteSupport' in self.parser.constructs) ||\n size > 999\n ) {\n return nok(code)\n }\n\n if (code === 93) {\n effects.exit(stringType)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return atBreak\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return label(code)\n }\n /** @type {State} */\n\n function label(code) {\n if (\n code === null ||\n code === 91 ||\n code === 93 ||\n markdownLineEnding(code) ||\n size++ > 999\n ) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n\n effects.consume(code)\n data = data || !markdownSpace(code)\n return code === 92 ? labelEscape : label\n }\n /** @type {State} */\n\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return label\n }\n\n return label(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/**\n * @param {Effects} effects\n * @param {State} ok\n * @param {State} nok\n * @param {string} type\n * @param {string} markerType\n * @param {string} stringType\n * @returns {State}\n */\n// eslint-disable-next-line max-params\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable} */\n let marker\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n marker = code === 40 ? 41 : code\n return atFirstTitleBreak\n }\n /** @type {State} */\n\n function atFirstTitleBreak(code) {\n if (code === marker) {\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n return atTitleBreak(code)\n }\n /** @type {State} */\n\n function atTitleBreak(code) {\n if (code === marker) {\n effects.exit(stringType)\n return atFirstTitleBreak(marker)\n }\n\n if (code === null) {\n return nok(code)\n } // Note: blank lines can’t exist in content.\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, atTitleBreak, 'linePrefix')\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return title(code)\n }\n /** @type {State} */\n\n function title(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n return atTitleBreak(code)\n }\n\n effects.consume(code)\n return code === 92 ? titleEscape : title\n }\n /** @type {State} */\n\n function titleEscape(code) {\n if (code === marker || code === 92) {\n effects.consume(code)\n return title\n }\n\n return title(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n\n/**\n * @param {Effects} effects\n * @param {State} ok\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen\n return start\n /** @type {State} */\n\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n seen = true\n return start\n }\n\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n start,\n seen ? 'linePrefix' : 'lineSuffix'\n )(code)\n }\n\n return ok(code)\n }\n}\n","/**\n * Normalize an identifier (such as used in definitions).\n *\n * @param {string} value\n * @returns {string}\n */\nexport function normalizeIdentifier(value) {\n return (\n value // Collapse Markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, ' ') // Trim.\n .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase()\n .toUpperCase()\n )\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factorySpace} from 'micromark-factory-space'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace\n} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n}\n/** @type {Construct} */\n\nconst titleConstruct = {\n tokenize: tokenizeTitle,\n partial: true\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this\n /** @type {string} */\n\n let identifier\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('definition')\n return factoryLabel.call(\n self,\n effects,\n labelAfter,\n nok,\n 'definitionLabel',\n 'definitionLabelMarker',\n 'definitionLabelString'\n )(code)\n }\n /** @type {State} */\n\n function labelAfter(code) {\n identifier = normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker') // Note: blank lines can’t exist in content.\n\n return factoryWhitespace(\n effects,\n factoryDestination(\n effects,\n effects.attempt(\n titleConstruct,\n factorySpace(effects, after, 'whitespace'),\n factorySpace(effects, after, 'whitespace')\n ),\n nok,\n 'definitionDestination',\n 'definitionDestinationLiteral',\n 'definitionDestinationLiteralMarker',\n 'definitionDestinationRaw',\n 'definitionDestinationString'\n )\n )\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('definition')\n\n if (!self.parser.defined.includes(identifier)) {\n self.parser.defined.push(identifier)\n }\n\n return ok(code)\n }\n\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeTitle(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, before)(code)\n : nok(code)\n }\n /** @type {State} */\n\n function before(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n factorySpace(effects, after, 'whitespace'),\n nok,\n 'definitionTitle',\n 'definitionTitleMarker',\n 'definitionTitleString'\n )(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n}\n/** @type {Construct} */\n\nconst indentedContent = {\n tokenize: tokenizeIndentedContent,\n partial: true\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCodeIndented(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeIndented')\n return factorySpace(effects, afterStartPrefix, 'linePrefix', 4 + 1)(code)\n }\n /** @type {State} */\n\n function afterStartPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ? afterPrefix(code)\n : nok(code)\n }\n /** @type {State} */\n\n function afterPrefix(code) {\n if (code === null) {\n return after(code)\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(indentedContent, afterPrefix, after)(code)\n }\n\n effects.enter('codeFlowValue')\n return content(code)\n }\n /** @type {State} */\n\n function content(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return afterPrefix(code)\n }\n\n effects.consume(code)\n return content\n }\n /** @type {State} */\n\n function after(code) {\n effects.exit('codeIndented')\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeIndentedContent(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return start\n }\n\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code)\n }\n /** @type {State} */\n\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ? ok(code)\n : markdownLineEnding(code)\n ? start(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {splice} from 'micromark-util-chunked'\n\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n tokenize: tokenizeHeadingAtx,\n resolve: resolveHeadingAtx\n}\n/** @type {Resolver} */\n\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2\n let contentStart = 3\n /** @type {Token} */\n\n let content\n /** @type {Token} */\n\n let text // Prefix whitespace, part of the opening.\n\n if (events[contentStart][1].type === 'whitespace') {\n contentStart += 2\n } // Suffix whitespace, part of the closing.\n\n if (\n contentEnd - 2 > contentStart &&\n events[contentEnd][1].type === 'whitespace'\n ) {\n contentEnd -= 2\n }\n\n if (\n events[contentEnd][1].type === 'atxHeadingSequence' &&\n (contentStart === contentEnd - 1 ||\n (contentEnd - 4 > contentStart &&\n events[contentEnd - 2][1].type === 'whitespace'))\n ) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4\n }\n\n if (contentEnd > contentStart) {\n content = {\n type: 'atxHeadingText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n text = {\n type: 'chunkText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n // @ts-expect-error Constants are fine to assign.\n contentType: 'text'\n }\n splice(events, contentStart, contentEnd - contentStart + 1, [\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n ])\n }\n\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n const self = this\n let size = 0\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('atxHeading')\n effects.enter('atxHeadingSequence')\n return fenceOpenInside(code)\n }\n /** @type {State} */\n\n function fenceOpenInside(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code)\n return fenceOpenInside\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingSequence')\n return self.interrupt ? ok(code) : headingBreak(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function headingBreak(code) {\n if (code === 35) {\n effects.enter('atxHeadingSequence')\n return sequence(code)\n }\n\n if (code === null || markdownLineEnding(code)) {\n effects.exit('atxHeading')\n return ok(code)\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, headingBreak, 'whitespace')(code)\n }\n\n effects.enter('atxHeadingText')\n return data(code)\n }\n /** @type {State} */\n\n function sequence(code) {\n if (code === 35) {\n effects.consume(code)\n return sequence\n }\n\n effects.exit('atxHeadingSequence')\n return headingBreak(code)\n }\n /** @type {State} */\n\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingText')\n return headingBreak(code)\n }\n\n effects.consume(code)\n return data\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n tokenize: tokenizeSetextUnderline,\n resolveTo: resolveToSetextUnderline\n}\n/** @type {Resolver} */\n\nfunction resolveToSetextUnderline(events, context) {\n let index = events.length\n /** @type {number|undefined} */\n\n let content\n /** @type {number|undefined} */\n\n let text\n /** @type {number|undefined} */\n\n let definition // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === 'content') {\n content = index\n break\n }\n\n if (events[index][1].type === 'paragraph') {\n text = index\n }\n } // Exit\n else {\n if (events[index][1].type === 'content') {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1)\n }\n\n if (!definition && events[index][1].type === 'definition') {\n definition = index\n }\n }\n }\n\n const heading = {\n type: 'setextHeading',\n start: Object.assign({}, events[text][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n } // Change the paragraph to setext heading text.\n\n events[text][1].type = 'setextHeadingText' // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n\n if (definition) {\n events.splice(text, 0, ['enter', heading, context])\n events.splice(definition + 1, 0, ['exit', events[content][1], context])\n events[content][1].end = Object.assign({}, events[definition][1].end)\n } else {\n events[content][1] = heading\n } // Add the heading exit at the end.\n\n events.push(['exit', heading, context])\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {NonNullable} */\n\n let marker\n /** @type {boolean} */\n\n let paragraph // Find an opening.\n\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (\n self.events[index][1].type !== 'lineEnding' &&\n self.events[index][1].type !== 'linePrefix' &&\n self.events[index][1].type !== 'content'\n ) {\n paragraph = self.events[index][1].type === 'paragraph'\n break\n }\n }\n\n return start\n /** @type {State} */\n\n function start(code) {\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter('setextHeadingLine')\n effects.enter('setextHeadingLineSequence')\n marker = code\n return closingSequence(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code)\n return closingSequence\n }\n\n effects.exit('setextHeadingLineSequence')\n return factorySpace(effects, closingSequenceEnd, 'lineSuffix')(code)\n }\n /** @type {State} */\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('setextHeadingLine')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n","/**\n * List of lowercase HTML tag names which when parsing HTML (flow), result\n * in more relaxed rules (condition 6): because they are known blocks, the\n * HTML-like syntax doesn’t have to be strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * .\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML tag names which when parsing HTML (flow), result in\n * HTML that can include lines w/o exiting, until a closing tag also in this\n * list is found (condition 1).\n *\n * This module is copied from:\n * .\n *\n * Note that `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {htmlBlockNames, htmlRawNames} from 'micromark-util-html-tag-name'\nimport {blankLine} from './blank-line.js'\n/** @type {Construct} */\n\nexport const htmlFlow = {\n name: 'htmlFlow',\n tokenize: tokenizeHtmlFlow,\n resolveTo: resolveToHtmlFlow,\n concrete: true\n}\n/** @type {Construct} */\n\nconst nextBlankConstruct = {\n tokenize: tokenizeNextBlank,\n partial: true\n}\n/** @type {Resolver} */\n\nfunction resolveToHtmlFlow(events) {\n let index = events.length\n\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') {\n break\n }\n }\n\n if (index > 1 && events[index - 2][1].type === 'linePrefix') {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start // Add the prefix start to the HTML line token.\n\n events[index + 1][1].start = events[index - 2][1].start // Remove the line prefix.\n\n events.splice(index - 2, 2)\n }\n\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this\n /** @type {number} */\n\n let kind\n /** @type {boolean} */\n\n let startTag\n /** @type {string} */\n\n let buffer\n /** @type {number} */\n\n let index\n /** @type {Code} */\n\n let marker\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('htmlFlow')\n effects.enter('htmlFlowData')\n effects.consume(code)\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationStart\n }\n\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n\n if (code === 63) {\n effects.consume(code)\n kind = 3 // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n buffer = String.fromCharCode(code)\n startTag = true\n return tagName\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function declarationStart(code) {\n if (code === 45) {\n effects.consume(code)\n kind = 2\n return commentOpenInside\n }\n\n if (code === 91) {\n effects.consume(code)\n kind = 5\n buffer = 'CDATA['\n index = 0\n return cdataOpenInside\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n kind = 4\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function cdataOpenInside(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code)\n return index === buffer.length\n ? self.interrupt\n ? ok\n : continuation\n : cdataOpenInside\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n buffer = String.fromCharCode(code)\n return tagName\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function tagName(code) {\n if (\n code === null ||\n code === 47 ||\n code === 62 ||\n markdownLineEndingOrSpace(code)\n ) {\n if (\n code !== 47 &&\n startTag &&\n htmlRawNames.includes(buffer.toLowerCase())\n ) {\n kind = 1\n return self.interrupt ? ok(code) : continuation(code)\n }\n\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n kind = 6\n\n if (code === 47) {\n effects.consume(code)\n return basicSelfClosing\n }\n\n return self.interrupt ? ok(code) : continuation(code)\n }\n\n kind = 7 // Do not support complete HTML when interrupting\n\n return self.interrupt && !self.parser.lazy[self.now().line]\n ? nok(code)\n : startTag\n ? completeAttributeNameBefore(code)\n : completeClosingTagAfter(code)\n }\n\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n buffer += String.fromCharCode(code)\n return tagName\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code)\n return self.interrupt ? ok : continuation\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeClosingTagAfter\n }\n\n return completeEnd(code)\n }\n /** @type {State} */\n\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code)\n return completeEnd\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return completeAttributeName\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameBefore\n }\n\n return completeEnd(code)\n }\n /** @type {State} */\n\n function completeAttributeName(code) {\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return completeAttributeName\n }\n\n return completeAttributeNameAfter(code)\n }\n /** @type {State} */\n\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameAfter\n }\n\n return completeAttributeNameBefore(code)\n }\n /** @type {State} */\n\n function completeAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return completeAttributeValueQuoted\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n\n marker = null\n return completeAttributeValueUnquoted(code)\n }\n /** @type {State} */\n\n function completeAttributeValueQuoted(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n\n if (code === marker) {\n effects.consume(code)\n return completeAttributeValueQuotedAfter\n }\n\n effects.consume(code)\n return completeAttributeValueQuoted\n }\n /** @type {State} */\n\n function completeAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96 ||\n markdownLineEndingOrSpace(code)\n ) {\n return completeAttributeNameAfter(code)\n }\n\n effects.consume(code)\n return completeAttributeValueUnquoted\n }\n /** @type {State} */\n\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code)\n return completeAfter\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function completeAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAfter\n }\n\n return code === null || markdownLineEnding(code)\n ? continuation(code)\n : nok(code)\n }\n /** @type {State} */\n\n function continuation(code) {\n if (code === 45 && kind === 2) {\n effects.consume(code)\n return continuationCommentInside\n }\n\n if (code === 60 && kind === 1) {\n effects.consume(code)\n return continuationRawTagOpen\n }\n\n if (code === 62 && kind === 4) {\n effects.consume(code)\n return continuationClose\n }\n\n if (code === 63 && kind === 3) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n if (code === 93 && kind === 5) {\n effects.consume(code)\n return continuationCharacterDataInside\n }\n\n if (markdownLineEnding(code) && (kind === 6 || kind === 7)) {\n return effects.check(\n nextBlankConstruct,\n continuationClose,\n continuationAtLineEnding\n )(code)\n }\n\n if (code === null || markdownLineEnding(code)) {\n return continuationAtLineEnding(code)\n }\n\n effects.consume(code)\n return continuation\n }\n /** @type {State} */\n\n function continuationAtLineEnding(code) {\n effects.exit('htmlFlowData')\n return htmlContinueStart(code)\n }\n /** @type {State} */\n\n function htmlContinueStart(code) {\n if (code === null) {\n return done(code)\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(\n {\n tokenize: htmlLineEnd,\n partial: true\n },\n htmlContinueStart,\n done\n )(code)\n }\n\n effects.enter('htmlFlowData')\n return continuation(code)\n }\n /** @type {Tokenizer} */\n\n function htmlLineEnd(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n /** @type {State} */\n\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n }\n /** @type {State} */\n\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n return continuation(code)\n }\n /** @type {State} */\n\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n\n return continuation(code)\n }\n /** @type {State} */\n\n function continuationRawEndTag(code) {\n if (code === 62 && htmlRawNames.includes(buffer.toLowerCase())) {\n effects.consume(code)\n return continuationClose\n }\n\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n buffer += String.fromCharCode(code)\n return continuationRawEndTag\n }\n\n return continuation(code)\n }\n /** @type {State} */\n\n function continuationCharacterDataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n return continuation(code)\n }\n /** @type {State} */\n\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n } // More dashes.\n\n if (code === 45 && kind === 2) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n return continuation(code)\n }\n /** @type {State} */\n\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return done(code)\n }\n\n effects.consume(code)\n return continuationClose\n }\n /** @type {State} */\n\n function done(code) {\n effects.exit('htmlFlow')\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeNextBlank(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.exit('htmlFlowData')\n effects.enter('lineEndingBlank')\n effects.consume(code)\n effects.exit('lineEndingBlank')\n return effects.attempt(blankLine, ok, nok)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace\n} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this\n /** @type {Construct} */\n\n const closingFenceConstruct = {\n tokenize: tokenizeClosingFence,\n partial: true\n }\n /** @type {Construct} */\n\n const nonLazyLine = {\n tokenize: tokenizeNonLazyLine,\n partial: true\n }\n const tail = this.events[this.events.length - 1]\n const initialPrefix =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n let sizeOpen = 0\n /** @type {NonNullable} */\n\n let marker\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n marker = code\n return sequenceOpen(code)\n }\n /** @type {State} */\n\n function sequenceOpen(code) {\n if (code === marker) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n\n effects.exit('codeFencedFenceSequence')\n return sizeOpen < 3\n ? nok(code)\n : factorySpace(effects, infoOpen, 'whitespace')(code)\n }\n /** @type {State} */\n\n function infoOpen(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code)\n }\n\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n /** @type {State} */\n\n function info(code) {\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, infoAfter, 'whitespace')(code)\n }\n\n if (code === 96 && code === marker) return nok(code)\n effects.consume(code)\n return info\n }\n /** @type {State} */\n\n function infoAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code)\n }\n\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n /** @type {State} */\n\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return openAfter(code)\n }\n\n if (code === 96 && code === marker) return nok(code)\n effects.consume(code)\n return meta\n }\n /** @type {State} */\n\n function openAfter(code) {\n effects.exit('codeFencedFence')\n return self.interrupt ? ok(code) : contentStart(code)\n }\n /** @type {State} */\n\n function contentStart(code) {\n if (code === null) {\n return after(code)\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(\n nonLazyLine,\n effects.attempt(\n closingFenceConstruct,\n after,\n initialPrefix\n ? factorySpace(\n effects,\n contentStart,\n 'linePrefix',\n initialPrefix + 1\n )\n : contentStart\n ),\n after\n )(code)\n }\n\n effects.enter('codeFlowValue')\n return contentContinue(code)\n }\n /** @type {State} */\n\n function contentContinue(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return contentStart(code)\n }\n\n effects.consume(code)\n return contentContinue\n }\n /** @type {State} */\n\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n /** @type {Tokenizer} */\n\n function tokenizeNonLazyLine(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n /** @type {State} */\n\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n }\n /** @type {Tokenizer} */\n\n function tokenizeClosingFence(effects, ok, nok) {\n let size = 0\n return factorySpace(\n effects,\n closingSequenceStart,\n 'linePrefix',\n this.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )\n /** @type {State} */\n\n function closingSequenceStart(code) {\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return closingSequence(code)\n }\n /** @type {State} */\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return closingSequence\n }\n\n if (size < sizeOpen) return nok(code)\n effects.exit('codeFencedFenceSequence')\n return factorySpace(effects, closingSequenceEnd, 'whitespace')(code)\n }\n /** @type {State} */\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n\n return nok(code)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {\n asciiAlphanumeric,\n asciiDigit,\n asciiHexDigit\n} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this\n let size = 0\n /** @type {number} */\n\n let max\n /** @type {(code: Code) => code is number} */\n\n let test\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('characterReference')\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric')\n effects.consume(code)\n effects.exit('characterReferenceMarkerNumeric')\n return numeric\n }\n\n effects.enter('characterReferenceValue')\n max = 31\n test = asciiAlphanumeric\n return value(code)\n }\n /** @type {State} */\n\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal')\n effects.consume(code)\n effects.exit('characterReferenceMarkerHexadecimal')\n effects.enter('characterReferenceValue')\n max = 6\n test = asciiHexDigit\n return value\n }\n\n effects.enter('characterReferenceValue')\n max = 7\n test = asciiDigit\n return value(code)\n }\n /** @type {State} */\n\n function value(code) {\n /** @type {Token} */\n let token\n\n if (code === 59 && size) {\n token = effects.exit('characterReferenceValue')\n\n if (\n test === asciiAlphanumeric &&\n !decodeNamedCharacterReference(self.sliceSerialize(token))\n ) {\n return nok(code)\n }\n\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n effects.exit('characterReference')\n return ok\n }\n\n if (test(code) && size++ < max) {\n effects.consume(code)\n return value\n }\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {asciiPunctuation} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeLineEnding(effects, ok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\n/** @type {Construct} */\n\nconst resourceConstruct = {\n tokenize: tokenizeResource\n}\n/** @type {Construct} */\n\nconst fullReferenceConstruct = {\n tokenize: tokenizeFullReference\n}\n/** @type {Construct} */\n\nconst collapsedReferenceConstruct = {\n tokenize: tokenizeCollapsedReference\n}\n/** @type {Resolver} */\n\nfunction resolveAllLabelEnd(events) {\n let index = -1\n /** @type {Token} */\n\n let token\n\n while (++index < events.length) {\n token = events[index][1]\n\n if (\n token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd'\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n\n return events\n}\n/** @type {Resolver} */\n\nfunction resolveToLabelEnd(events, context) {\n let index = events.length\n let offset = 0\n /** @type {Token} */\n\n let token\n /** @type {number|undefined} */\n\n let open\n /** @type {number|undefined} */\n\n let close\n /** @type {Event[]} */\n\n let media // Find an opening.\n\n while (index--) {\n token = events[index][1]\n\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n } // Mark other link openings as inactive, as we can’t have links in\n // links.\n\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n\n const group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n const label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n }\n const text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ] // Opening marker.\n\n media = push(media, events.slice(open + 1, open + offset + 3)) // Text open.\n\n media = push(media, [['enter', text, context]]) // Between.\n\n media = push(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n ) // Text close, marker close, label close.\n\n media = push(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ]) // Reference, resource, or so.\n\n media = push(media, events.slice(close + 1)) // Media close.\n\n media = push(media, [['exit', group, context]])\n splice(events, open, events.length, media)\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Token} */\n\n let labelStart\n /** @type {boolean} */\n\n let defined // Find an opening.\n\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n\n return start\n /** @type {State} */\n\n function start(code) {\n if (!labelStart) {\n return nok(code)\n } // It’s a balanced bracket, but contains a link.\n\n if (labelStart._inactive) return balanced(code)\n defined = self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n )\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return afterLabelEnd\n }\n /** @type {State} */\n\n function afterLabelEnd(code) {\n // Resource: `[asd](fgh)`.\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n ok,\n defined ? ok : balanced\n )(code)\n } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?\n\n if (code === 91) {\n return effects.attempt(\n fullReferenceConstruct,\n ok,\n defined\n ? effects.attempt(collapsedReferenceConstruct, ok, balanced)\n : balanced\n )(code)\n } // Shortcut reference: `[asd]`?\n\n return defined ? ok(code) : balanced(code)\n }\n /** @type {State} */\n\n function balanced(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeResource(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return factoryWhitespace(effects, open)\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 41) {\n return end(code)\n }\n\n return factoryDestination(\n effects,\n destinationAfter,\n nok,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 32\n )(code)\n }\n /** @type {State} */\n\n function destinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, between)(code)\n : end(code)\n }\n /** @type {State} */\n\n function between(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n factoryWhitespace(effects, end),\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n\n return end(code)\n }\n /** @type {State} */\n\n function end(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeFullReference(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n return factoryLabel.call(\n self,\n effects,\n afterLabel,\n nok,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n /** @type {State} */\n\n function afterLabel(code) {\n return self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n )\n ? ok(code)\n : nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCollapsedReference(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {labelEnd} from './label-end.js'\n/** @type {Construct} */\n\nexport const labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook */\n\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\n\n/**\n * Classify whether a character code represents whitespace, punctuation, or\n * something else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * Note that eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * @returns {number|undefined}\n */\nexport function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Point} Point\n */\nimport {push, splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n\nfunction resolveAllAttention(events, context) {\n let index = -1\n /** @type {number} */\n\n let open\n /** @type {Token} */\n\n let group\n /** @type {Token} */\n\n let text\n /** @type {Token} */\n\n let openingSequence\n /** @type {Token} */\n\n let closingSequence\n /** @type {number} */\n\n let use\n /** @type {Event[]} */\n\n let nextEvents\n /** @type {number} */\n\n let offset // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index // Now walk back to find an opener.\n\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open && // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n } // Number of markers to use from the sequence.\n\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n const start = Object.assign({}, events[open][1].end)\n const end = Object.assign({}, events[index][1].start)\n movePoint(start, -use)\n movePoint(end, use)\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start,\n end: Object.assign({}, events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n }\n events[open][1].end = Object.assign({}, openingSequence.start)\n events[index][1].start = Object.assign({}, closingSequence.end)\n nextEvents = [] // If there are more markers in the opening, add them before.\n\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n } // Opening.\n\n nextEvents = push(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ]) // Between.\n\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n ) // Closing.\n\n nextEvents = push(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ]) // If there are more markers in the closing, add them after.\n\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = push(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n } // Remove remaining sequences.\n\n index = -1\n\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null\n const previous = this.previous\n const before = classifyCharacter(previous)\n /** @type {NonNullable} */\n\n let marker\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('attentionSequence')\n marker = code\n return sequence(code)\n }\n /** @type {State} */\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code)\n return sequence\n }\n\n const token = effects.exit('attentionSequence')\n const after = classifyCharacter(code)\n const open =\n !after || (after === 2 && before) || attentionMarkers.includes(code)\n const close =\n !before || (before === 2 && after) || attentionMarkers.includes(previous)\n token._open = Boolean(marker === 42 ? open : open && (before || !close))\n token._close = Boolean(marker === 42 ? close : close && (after || !open))\n return ok(code)\n }\n}\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {void}\n */\n\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiAtext,\n asciiControl\n} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 1\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n\n return asciiAtext(code) ? emailAtext(code) : nok(code)\n }\n /** @type {State} */\n\n function schemeOrEmailAtext(code) {\n return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)\n ? schemeInsideOrEmailAtext(code)\n : emailAtext(code)\n }\n /** @type {State} */\n\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n return urlInside\n }\n\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n\n return emailAtext(code)\n }\n /** @type {State} */\n\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n return end(code)\n }\n\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return urlInside\n }\n /** @type {State} */\n\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n /** @type {State} */\n\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n\n if (code === 62) {\n // Exit, then change the type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n return end(code)\n }\n\n return emailValue(code)\n }\n /** @type {State} */\n\n function emailValue(code) {\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n effects.consume(code)\n return code === 45 ? emailValue : emailLabel\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function end(code) {\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this\n /** @type {NonNullable|undefined} */\n\n let marker\n /** @type {string} */\n\n let buffer\n /** @type {number} */\n\n let index\n /** @type {State} */\n\n let returnState\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpen\n }\n\n if (code === 91) {\n effects.consume(code)\n buffer = 'CDATA['\n index = 0\n return cdataOpen\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function commentOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentStart\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function commentStart(code) {\n if (code === null || code === 62) {\n return nok(code)\n }\n\n if (code === 45) {\n effects.consume(code)\n return commentStartDash\n }\n\n return comment(code)\n }\n /** @type {State} */\n\n function commentStartDash(code) {\n if (code === null || code === 62) {\n return nok(code)\n }\n\n return comment(code)\n }\n /** @type {State} */\n\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = comment\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return comment\n }\n /** @type {State} */\n\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return end\n }\n\n return comment(code)\n }\n /** @type {State} */\n\n function cdataOpen(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code)\n return index === buffer.length ? cdata : cdataOpen\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = cdata\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return cdata\n }\n /** @type {State} */\n\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n\n return cdata(code)\n }\n /** @type {State} */\n\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n\n return cdata(code)\n }\n /** @type {State} */\n\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n\n if (markdownLineEnding(code)) {\n returnState = declaration\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return declaration\n }\n /** @type {State} */\n\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = instruction\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return instruction\n }\n /** @type {State} */\n\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n /** @type {State} */\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function tagClose(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n\n return tagCloseBetween(code)\n }\n /** @type {State} */\n\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n\n return end(code)\n }\n /** @type {State} */\n\n function tagOpen(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n\n return end(code)\n }\n /** @type {State} */\n\n function tagOpenAttributeName(code) {\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n\n return tagOpenAttributeNameAfter(code)\n }\n /** @type {State} */\n\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n\n return tagOpenBetween(code)\n }\n /** @type {State} */\n\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueUnquoted\n }\n /** @type {State} */\n\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n return tagOpenAttributeValueQuotedAfter\n }\n\n if (code === null) {\n return nok(code)\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n /** @type {State} */\n\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 62 || code === 47 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n } // We can’t have blank lines in content, so no need to worry about empty\n // tokens.\n\n /** @type {State} */\n\n function atLineEnding(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(\n effects,\n afterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )\n }\n /** @type {State} */\n\n function afterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n /** @type {State} */\n\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {labelEnd} from './label-end.js'\n/** @type {Construct} */\n\nexport const labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n /** @type {State} */\n\n function after(code) {\n /* To do: remove in the future once we’ve switched from\n * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n * which doesn’t need this */\n\n /* Hidden footnotes hook. */\n\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n */\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n return open\n }\n /** @type {State} */\n\n function open(code) {\n if (markdownLineEnding(code)) {\n effects.exit('escapeMarker')\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').State} State\n */\nimport {markdownLineEnding} from 'micromark-util-character'\n\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous\n}\n/** @type {Resolver} */\n\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4\n let headEnterIndex = 3\n /** @type {number} */\n\n let index\n /** @type {number|undefined} */\n\n let enter // If we start and end with an EOL or a space.\n\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex // And we have data.\n\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding'\n events[tailExitIndex][1].type = 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n } // Merge adjacent spaces and data.\n\n index = headEnterIndex - 1\n tailExitIndex++\n\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n\n enter = undefined\n }\n }\n\n return events\n}\n/** @type {Previous} */\n\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this\n let sizeOpen = 0\n /** @type {number} */\n\n let size\n /** @type {Token} */\n\n let token\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return openingSequence(code)\n }\n /** @type {State} */\n\n function openingSequence(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return openingSequence\n }\n\n effects.exit('codeTextSequence')\n return gap(code)\n }\n /** @type {State} */\n\n function gap(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n } // Closing fence?\n // Could also be data.\n\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return closingSequence(code)\n } // Tabs don’t work, and virtual spaces don’t make sense.\n\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return gap\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return gap\n } // Data.\n\n effects.enter('codeTextData')\n return data(code)\n } // In code.\n\n /** @type {State} */\n\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return gap(code)\n }\n\n effects.consume(code)\n return data\n } // Closing fence.\n\n /** @type {State} */\n\n function closingSequence(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return closingSequence\n } // Done!\n\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n } // More or less accents: mark as data.\n\n token.type = 'codeTextData'\n return data(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\nimport {\n attention,\n autolink,\n blockQuote,\n characterEscape,\n characterReference,\n codeFenced,\n codeIndented,\n codeText,\n definition,\n hardBreakEscape,\n headingAtx,\n htmlFlow,\n htmlText,\n labelEnd,\n labelStartImage,\n labelStartLink,\n lineEnding,\n list,\n setextUnderline,\n thematicBreak\n} from 'micromark-core-commonmark'\nimport {resolver as resolveText} from './initialize/text.js'\n/** @type {Extension['document']} */\n\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n}\n/** @type {Extension['contentInitial']} */\n\nexport const contentInitial = {\n [91]: definition\n}\n/** @type {Extension['flowInitial']} */\n\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n}\n/** @type {Extension['flow']} */\n\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n}\n/** @type {Extension['string']} */\n\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n}\n/** @type {Extension['text']} */\n\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n}\n/** @type {Extension['insideSpan']} */\n\nexport const insideSpan = {\n null: [attention, resolveText]\n}\n/** @type {Extension['attentionMarkers']} */\n\nexport const attentionMarkers = {\n null: [42, 95]\n}\n/** @type {Extension['disable']} */\n\nexport const disable = {\n null: []\n}\n","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding} [encoding]\n * @param {boolean} [end=false]\n * @returns {Chunk[]}\n */\nconst search = /[\\0\\t\\n\\r]/g\n/**\n * @returns {Preprocessor}\n */\n\nexport function preprocess() {\n let column = 1\n let buffer = ''\n /** @type {boolean|undefined} */\n\n let start = true\n /** @type {boolean|undefined} */\n\n let atCarriageReturn\n return preprocessor\n /** @type {Preprocessor} */\n\n function preprocessor(value, encoding, end) {\n /** @type {Chunk[]} */\n const chunks = []\n /** @type {RegExpMatchArray|null} */\n\n let match\n /** @type {number} */\n\n let next\n /** @type {number} */\n\n let startPosition\n /** @type {number} */\n\n let endPosition\n /** @type {Code} */\n\n let code // @ts-expect-error `Buffer` does allow an encoding.\n\n value = buffer + value.toString(encoding)\n startPosition = 0\n buffer = ''\n\n if (start) {\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n\n start = undefined\n }\n\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition =\n match && match.index !== undefined ? match.index : value.length\n code = value.charCodeAt(endPosition)\n\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n\n switch (code) {\n case 0: {\n chunks.push(65533)\n column++\n break\n }\n\n case 9: {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n\n while (column++ < next) chunks.push(-1)\n\n break\n }\n\n case 10: {\n chunks.push(-4)\n column = 1\n break\n }\n\n default: {\n atCarriageReturn = true\n column = 1\n }\n }\n }\n\n startPosition = endPosition + 1\n }\n\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n\n return chunks\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base)\n\n if (\n // C0 except for HT, LF, FF, CR, space\n code < 9 ||\n code === 11 ||\n (code > 13 && code < 32) || // Control character (DEL) of the basic block and C1 controls.\n (code > 126 && code < 160) || // Lone high surrogates and low surrogates.\n (code > 55295 && code < 57344) || // Noncharacters.\n (code > 64975 && code < 65008) ||\n (code & 65535) === 65535 ||\n (code & 65535) === 65534 || // Out of range\n code > 1114111\n ) {\n return '\\uFFFD'\n }\n\n return String.fromCharCode(code)\n}\n","import {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nconst characterEscapeOrReference =\n /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi\n/**\n * Utility to decode markdown strings (which occur in places such as fenced\n * code info strings, destinations, labels, and titles).\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * @returns {string}\n */\n\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode)\n}\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\n\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1\n } // Reference.\n\n const head = $2.charCodeAt(0)\n\n if (head === 35) {\n const head = $2.charCodeAt(1)\n const hex = head === 120 || head === 88\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)\n }\n\n return decodeNamedCharacterReference($2) || $0\n}\n","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist').Point} Point\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Content} Content\n * @typedef {Root|Content} Node\n * @typedef {Extract} Parent\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n *\n * @typedef {UnistParent & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @typedef _CompileDataFields\n * @property {boolean|undefined} expectingFirstListItemValue\n * @property {boolean|undefined} flowCodeInside\n * @property {boolean|undefined} setextHeadingSlurpLineEnding\n * @property {boolean|undefined} atHardBreak\n * @property {'collapsed'|'full'} referenceType\n * @property {boolean|undefined} inReference\n * @property {'characterReferenceMarkerHexadecimal'|'characterReferenceMarkerNumeric'} characterReferenceType\n *\n * @typedef {Record & Partial<_CompileDataFields>} CompileData\n *\n * @typedef {(tree: Root) => Root|void} Transform\n * @typedef {(this: CompileContext, token: Token) => void} Handle\n * @typedef {Record} Handles\n * Token types mapping to handles\n * @typedef {Record|Array> & {canContainEols: Array, transforms: Array, enter: Handles, exit: Handles}} NormalizedExtension\n * @typedef {Partial} Extension\n * An mdast extension changes how markdown tokens are turned into mdast.\n *\n * @typedef {(this: Omit, left: Token|undefined, right: Token) => void} OnEnterError\n * @typedef {(this: Omit, left: Token, right: Token) => void} OnExitError\n *\n * @typedef CompileContext\n * mdast compiler context\n * @property {Array} stack\n * @property {Array<[Token, OnEnterError|undefined]>} tokenStack\n * @property {(key: string, value?: unknown) => void} setData\n * Set data into the key-value store.\n * @property {(key: K) => CompileData[K]} getData\n * Get data from the key-value store.\n * @property {(this: CompileContext) => void} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: N, token: Token, onError?: OnEnterError) => N} enter\n * Enter a token.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit\n * Exit a token.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {NormalizedExtension} config\n * Configuration.\n *\n * @typedef {{mdastExtensions?: Array>}} FromMarkdownOptions\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n */\nimport {toString} from 'mdast-util-to-string'\nimport {parse} from 'micromark/lib/parse.js'\nimport {preprocess} from 'micromark/lib/preprocess.js'\nimport {postprocess} from 'micromark/lib/postprocess.js'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nimport {decodeString} from 'micromark-util-decode-string'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {stringifyPosition} from 'unist-util-stringify-position'\nconst own = {}.hasOwnProperty\n/**\n * @param value Markdown to parse (`string` or `Buffer`).\n * @param [encoding] Character encoding to understand `value` as when it’s a `Buffer` (`string`, default: `'utf8'`).\n * @param [options] Configuration\n */\n\nexport const fromMarkdown =\n /**\n * @type {(\n * ((value: Value, encoding: Encoding, options?: Options) => Root) &\n * ((value: Value, options?: Options) => Root)\n * )}\n */\n\n /**\n * @param {Value} value\n * @param {Encoding} [encoding]\n * @param {Options} [options]\n * @returns {Root}\n */\n function (value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n\n return compiler(options)(\n postprocess(\n parse(options).document().write(preprocess()(value, encoding, true))\n )\n )\n }\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options} [options]\n */\n\nfunction compiler(options = {}) {\n /** @type {NormalizedExtension} */\n // @ts-expect-error: our base has all required fields, so the result will too.\n const config = configure(\n {\n transforms: [],\n canContainEols: [\n 'emphasis',\n 'fragment',\n 'heading',\n 'paragraph',\n 'strong'\n ],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n },\n options.mdastExtensions || []\n )\n /** @type {CompileData} */\n\n const data = {}\n return compile\n /**\n * @param {Array} events\n * @returns {Root}\n */\n\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n }\n /** @type {CompileContext['stack']} */\n\n const stack = [tree]\n /** @type {CompileContext['tokenStack']} */\n\n const tokenStack = []\n /** @type {Array} */\n\n const listStack = []\n /** @type {Omit} */\n\n const context = {\n stack,\n tokenStack,\n config,\n enter,\n exit,\n buffer,\n resume,\n setData,\n getData\n }\n let index = -1\n\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n const tail = listStack.pop()\n index = prepareList(events, tail, index)\n }\n }\n }\n\n index = -1\n\n while (++index < events.length) {\n const handler = config[events[index][0]]\n\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n Object.assign(\n {\n sliceSerialize: events[index][2].sliceSerialize\n },\n context\n ),\n events[index][1]\n )\n }\n }\n\n if (tokenStack.length > 0) {\n const tail = tokenStack[tokenStack.length - 1]\n const handler = tail[1] || defaultOnError\n handler.call(context, undefined, tail[0])\n } // Figure out `root` position.\n\n tree.position = {\n start: point(\n events.length > 0\n ? events[0][1].start\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n ),\n end: point(\n events.length > 0\n ? events[events.length - 2][1].end\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n )\n }\n index = -1\n\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree\n }\n\n return tree\n }\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n\n function prepareList(events, start, length) {\n let index = start - 1\n let containerBalance = -1\n let listSpread = false\n /** @type {Token|undefined} */\n\n let listItem\n /** @type {number|undefined} */\n\n let lineIndex\n /** @type {number|undefined} */\n\n let firstBlankLineIndex\n /** @type {boolean|undefined} */\n\n let atMarker\n\n while (++index <= length) {\n const event = events[index]\n\n if (\n event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered' ||\n event[1].type === 'blockQuote'\n ) {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n\n atMarker = undefined\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n\n atMarker = undefined\n }\n } else if (\n event[1].type === 'linePrefix' ||\n event[1].type === 'listItemValue' ||\n event[1].type === 'listItemMarker' ||\n event[1].type === 'listItemPrefix' ||\n event[1].type === 'listItemPrefixWhitespace'\n ) {\n // Empty.\n } else {\n atMarker = undefined\n }\n\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n let tailIndex = index\n lineIndex = undefined\n\n while (tailIndex--) {\n const tailEvent = events[tailIndex]\n\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n // @ts-expect-error Patched.\n listItem._spread = true\n } // Fix position.\n\n listItem.end = Object.assign(\n {},\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n } // Create a new list item.\n\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n // @ts-expect-error Patched\n _spread: false,\n start: Object.assign({}, event[1].start)\n } // @ts-expect-error: `listItem` is most definitely defined, TS...\n\n events.splice(index, 0, ['enter', listItem, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n } // @ts-expect-error Patched.\n\n events[start][1]._spread = listSpread\n return length\n }\n /**\n * @type {CompileContext['setData']}\n * @param [value]\n */\n\n function setData(key, value) {\n data[key] = value\n }\n /**\n * @type {CompileContext['getData']}\n * @template {string} K\n * @param {K} key\n * @returns {CompileData[K]}\n */\n\n function getData(key) {\n return data[key]\n }\n /**\n * @param {Point} d\n * @returns {Point}\n */\n\n function point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n }\n }\n /**\n * @param {(token: Token) => Node} create\n * @param {Handle} [and]\n * @returns {Handle}\n */\n\n function opener(create, and) {\n return open\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n /** @type {CompileContext['buffer']} */\n\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n })\n }\n /**\n * @type {CompileContext['enter']}\n * @template {Node} N\n * @this {CompileContext}\n * @param {N} node\n * @param {Token} token\n * @param {OnEnterError} [errorHandler]\n * @returns {N}\n */\n\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1]\n // @ts-expect-error: Assume `Node` can exist as a child of `parent`.\n parent.children.push(node)\n this.stack.push(node)\n this.tokenStack.push([token, errorHandler]) // @ts-expect-error: `end` will be patched later.\n\n node.position = {\n start: point(token.start)\n }\n return node\n }\n /**\n * @param {Handle} [and]\n * @returns {Handle}\n */\n\n function closer(and) {\n return close\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n /**\n * @type {CompileContext['exit']}\n * @this {CompileContext}\n * @param {Token} token\n * @param {OnExitError} [onExitError]\n * @returns {Node}\n */\n\n function exit(token, onExitError) {\n const node = this.stack.pop()\n const open = this.tokenStack.pop()\n\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({\n start: token.start,\n end: token.end\n }) +\n '): it’s not open'\n )\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0])\n } else {\n const handler = open[1] || defaultOnError\n handler.call(this, token, open[0])\n }\n }\n\n node.position.end = point(token.end)\n return node\n }\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n\n function resume() {\n return toString(this.stack.pop())\n } //\n // Handlers.\n //\n\n /** @type {Handle} */\n\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true)\n }\n /** @type {Handle} */\n\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n const ancestor =\n /** @type {List} */\n this.stack[this.stack.length - 2]\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10)\n setData('expectingFirstListItemValue')\n }\n }\n /** @type {Handle} */\n\n function onexitcodefencedfenceinfo() {\n const data = this.resume()\n const node =\n /** @type {Code} */\n this.stack[this.stack.length - 1]\n node.lang = data\n }\n /** @type {Handle} */\n\n function onexitcodefencedfencemeta() {\n const data = this.resume()\n const node =\n /** @type {Code} */\n this.stack[this.stack.length - 1]\n node.meta = data\n }\n /** @type {Handle} */\n\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return\n this.buffer()\n setData('flowCodeInside', true)\n }\n /** @type {Handle} */\n\n function onexitcodefenced() {\n const data = this.resume()\n const node =\n /** @type {Code} */\n this.stack[this.stack.length - 1]\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n setData('flowCodeInside')\n }\n /** @type {Handle} */\n\n function onexitcodeindented() {\n const data = this.resume()\n const node =\n /** @type {Code} */\n this.stack[this.stack.length - 1]\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '')\n }\n /** @type {Handle} */\n\n function onexitdefinitionlabelstring(token) {\n // Discard label, use the source content instead.\n const label = this.resume()\n const node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n /** @type {Handle} */\n\n function onexitdefinitiontitlestring() {\n const data = this.resume()\n const node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1]\n node.title = data\n }\n /** @type {Handle} */\n\n function onexitdefinitiondestinationstring() {\n const data = this.resume()\n const node =\n /** @type {Definition} */\n this.stack[this.stack.length - 1]\n node.url = data\n }\n /** @type {Handle} */\n\n function onexitatxheadingsequence(token) {\n const node =\n /** @type {Heading} */\n this.stack[this.stack.length - 1]\n\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length\n node.depth = depth\n }\n }\n /** @type {Handle} */\n\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true)\n }\n /** @type {Handle} */\n\n function onexitsetextheadinglinesequence(token) {\n const node =\n /** @type {Heading} */\n this.stack[this.stack.length - 1]\n node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2\n }\n /** @type {Handle} */\n\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding')\n }\n /** @type {Handle} */\n\n function onenterdata(token) {\n const parent =\n /** @type {Parent} */\n this.stack[this.stack.length - 1]\n /** @type {Node} */\n\n let tail = parent.children[parent.children.length - 1]\n\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text() // @ts-expect-error: we’ll add `end` later.\n\n tail.position = {\n start: point(token.start)\n } // @ts-expect-error: Assume `parent` accepts `text`.\n\n parent.children.push(tail)\n }\n\n this.stack.push(tail)\n }\n /** @type {Handle} */\n\n function onexitdata(token) {\n const tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n /** @type {Handle} */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1]\n\n // If we’re at a hard break, include the line ending in there.\n if (getData('atHardBreak')) {\n const tail = context.children[context.children.length - 1]\n tail.position.end = point(token.end)\n setData('atHardBreak')\n return\n }\n\n if (\n !getData('setextHeadingSlurpLineEnding') &&\n config.canContainEols.includes(context.type)\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n /** @type {Handle} */\n\n function onexithardbreak() {\n setData('atHardBreak', true)\n }\n /** @type {Handle} */\n\n function onexithtmlflow() {\n const data = this.resume()\n const node =\n /** @type {HTML} */\n this.stack[this.stack.length - 1]\n node.value = data\n }\n /** @type {Handle} */\n\n function onexithtmltext() {\n const data = this.resume()\n const node =\n /** @type {HTML} */\n this.stack[this.stack.length - 1]\n node.value = data\n }\n /** @type {Handle} */\n\n function onexitcodetext() {\n const data = this.resume()\n const node =\n /** @type {InlineCode} */\n this.stack[this.stack.length - 1]\n node.value = data\n }\n /** @type {Handle} */\n\n function onexitlink() {\n const context =\n /** @type {Link & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1] // To do: clean.\n\n if (getData('inReference')) {\n context.type += 'Reference' // @ts-expect-error: mutate.\n\n context.referenceType = getData('referenceType') || 'shortcut' // @ts-expect-error: mutate.\n\n delete context.url\n delete context.title\n } else {\n // @ts-expect-error: mutate.\n delete context.identifier // @ts-expect-error: mutate.\n\n delete context.label\n }\n\n setData('referenceType')\n }\n /** @type {Handle} */\n\n function onexitimage() {\n const context =\n /** @type {Image & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1] // To do: clean.\n\n if (getData('inReference')) {\n context.type += 'Reference' // @ts-expect-error: mutate.\n\n context.referenceType = getData('referenceType') || 'shortcut' // @ts-expect-error: mutate.\n\n delete context.url\n delete context.title\n } else {\n // @ts-expect-error: mutate.\n delete context.identifier // @ts-expect-error: mutate.\n\n delete context.label\n }\n\n setData('referenceType')\n }\n /** @type {Handle} */\n\n function onexitlabeltext(token) {\n const ancestor =\n /** @type {(Link|Image) & {identifier: string, label: string}} */\n this.stack[this.stack.length - 2]\n const string = this.sliceSerialize(token)\n ancestor.label = decodeString(string)\n ancestor.identifier = normalizeIdentifier(string).toLowerCase()\n }\n /** @type {Handle} */\n\n function onexitlabel() {\n const fragment =\n /** @type {Fragment} */\n this.stack[this.stack.length - 1]\n const value = this.resume()\n const node =\n /** @type {(Link|Image) & {identifier: string, label: string}} */\n this.stack[this.stack.length - 1] // Assume a reference.\n\n setData('inReference', true)\n\n if (node.type === 'link') {\n // @ts-expect-error: Assume static phrasing content.\n node.children = fragment.children\n } else {\n node.alt = value\n }\n }\n /** @type {Handle} */\n\n function onexitresourcedestinationstring() {\n const data = this.resume()\n const node =\n /** @type {Link|Image} */\n this.stack[this.stack.length - 1]\n node.url = data\n }\n /** @type {Handle} */\n\n function onexitresourcetitlestring() {\n const data = this.resume()\n const node =\n /** @type {Link|Image} */\n this.stack[this.stack.length - 1]\n node.title = data\n }\n /** @type {Handle} */\n\n function onexitresource() {\n setData('inReference')\n }\n /** @type {Handle} */\n\n function onenterreference() {\n setData('referenceType', 'collapsed')\n }\n /** @type {Handle} */\n\n function onexitreferencestring(token) {\n const label = this.resume()\n const node =\n /** @type {LinkReference|ImageReference} */\n this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n setData('referenceType', 'full')\n }\n /** @type {Handle} */\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type)\n }\n /** @type {Handle} */\n\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token)\n const type = getData('characterReferenceType')\n /** @type {string} */\n\n let value\n\n if (type) {\n value = decodeNumericCharacterReference(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n setData('characterReferenceType')\n } else {\n // @ts-expect-error `decodeNamedCharacterReference` can return false for\n // invalid named character references, but everything we’ve tokenized is\n // valid.\n value = decodeNamedCharacterReference(data)\n }\n\n const tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n /** @type {Handle} */\n\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n const node =\n /** @type {Link} */\n this.stack[this.stack.length - 1]\n node.url = this.sliceSerialize(token)\n }\n /** @type {Handle} */\n\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n const node =\n /** @type {Link} */\n this.stack[this.stack.length - 1]\n node.url = 'mailto:' + this.sliceSerialize(token)\n } //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n }\n }\n /** @returns {Code} */\n\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n }\n }\n /** @returns {InlineCode} */\n\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n }\n }\n /** @returns {Definition} */\n\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n /** @returns {Emphasis} */\n\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n }\n }\n /** @returns {Heading} */\n\n function heading() {\n // @ts-expect-error `depth` will be set later.\n return {\n type: 'heading',\n depth: undefined,\n children: []\n }\n }\n /** @returns {Break} */\n\n function hardBreak() {\n return {\n type: 'break'\n }\n }\n /** @returns {HTML} */\n\n function html() {\n return {\n type: 'html',\n value: ''\n }\n }\n /** @returns {Image} */\n\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n }\n }\n /** @returns {Link} */\n\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n }\n }\n /**\n * @param {Token} token\n * @returns {List}\n */\n\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n // @ts-expect-error Patched.\n spread: token._spread,\n children: []\n }\n }\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n\n function listItem(token) {\n return {\n type: 'listItem',\n // @ts-expect-error Patched.\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n /** @returns {Paragraph} */\n\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n }\n }\n /** @returns {Strong} */\n\n function strong() {\n return {\n type: 'strong',\n children: []\n }\n }\n /** @returns {Text} */\n\n function text() {\n return {\n type: 'text',\n value: ''\n }\n }\n /** @returns {ThematicBreak} */\n\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n }\n }\n}\n/**\n * @param {Extension} combined\n * @param {Array>} extensions\n * @returns {Extension}\n */\n\nfunction configure(combined, extensions) {\n let index = -1\n\n while (++index < extensions.length) {\n const value = extensions[index]\n\n if (Array.isArray(value)) {\n configure(combined, value)\n } else {\n extension(combined, value)\n }\n }\n\n return combined\n}\n/**\n * @param {Extension} combined\n * @param {Extension} extension\n * @returns {void}\n */\n\nfunction extension(combined, extension) {\n /** @type {string} */\n let key\n\n for (key in extension) {\n if (own.call(extension, key)) {\n const list = key === 'canContainEols' || key === 'transforms'\n const maybe = own.call(combined, key) ? combined[key] : undefined\n /* c8 ignore next */\n\n const left = maybe || (combined[key] = list ? [] : {})\n const right = extension[key]\n\n if (right) {\n if (list) {\n // @ts-expect-error: `left` is an array.\n combined[key] = [...left, ...right]\n } else {\n Object.assign(left, right)\n }\n }\n }\n }\n}\n/** @type {OnEnterError} */\n\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error(\n 'Cannot close `' +\n left.type +\n '` (' +\n stringifyPosition({\n start: left.start,\n end: left.end\n }) +\n '): a different token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is open'\n )\n } else {\n throw new Error(\n 'Cannot close document, a token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is still open'\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\nimport {subtokenize} from 'micromark-util-subtokenize'\n/**\n * @param {Event[]} events\n * @returns {Event[]}\n */\n\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').Create} Create\n */\nimport {combineExtensions} from 'micromark-util-combine-extensions'\nimport {content} from './initialize/content.js'\nimport {document} from './initialize/document.js'\nimport {flow} from './initialize/flow.js'\nimport {text, string} from './initialize/text.js'\nimport {createTokenizer} from './create-tokenizer.js'\nimport * as defaultConstructs from './constructs.js'\n/**\n * @param {ParseOptions} [options]\n * @returns {ParseContext}\n */\n\nexport function parse(options = {}) {\n /** @type {FullNormalizedExtension} */\n // @ts-expect-error `defaultConstructs` is full, so the result will be too.\n const constructs = combineExtensions(\n // @ts-expect-error Same as above.\n [defaultConstructs].concat(options.extensions || [])\n )\n /** @type {ParseContext} */\n\n const parser = {\n defined: [],\n lazy: {},\n constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n }\n return parser\n /**\n * @param {InitialConstruct} initial\n */\n\n function create(initial) {\n return creator\n /** @type {Create} */\n\n function creator(from) {\n return createTokenizer(parser, initial, from)\n }\n }\n}\n","import remarkParse from './lib/index.js'\n\nexport default remarkParse\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/** @type {import('unified').Plugin<[Options?] | void[], string, Root>} */\nexport default function remarkParse(options) {\n /** @type {import('unified').ParserFunction} */\n const parser = (doc) => {\n // Assume options.\n const settings = /** @type {Options} */ (this.data('settings'))\n\n return fromMarkdown(\n doc,\n Object.assign({}, settings, options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: this.data('micromarkExtensions') || [],\n mdastExtensions: this.data('fromMarkdownExtensions') || []\n })\n )\n }\n\n Object.assign(this, {Parser: parser})\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist').Literal} Literal\n * @typedef {Object.} Props\n * @typedef {Array.|string} ChildrenOrValue\n *\n * @typedef {(, C extends Node[]>(type: T, props: P, children: C) => {type: T, children: C} & P)} BuildParentWithProps\n * @typedef {(>(type: T, props: P, value: string) => {type: T, value: string} & P)} BuildLiteralWithProps\n * @typedef {(>(type: T, props: P) => {type: T} & P)} BuildVoidWithProps\n * @typedef {((type: T, children: C) => {type: T, children: C})} BuildParent\n * @typedef {((type: T, value: string) => {type: T, value: string})} BuildLiteral\n * @typedef {((type: T) => {type: T})} BuildVoid\n */\n\nexport var u = /**\n * @type {BuildVoid & BuildVoidWithProps & BuildLiteral & BuildLiteralWithProps & BuildParent & BuildParentWithProps}\n */ (\n /**\n * @param {string} type Type of node\n * @param {Props|ChildrenOrValue} [props] Additional properties for node (or `children` or `value`)\n * @param {ChildrenOrValue} [value] `children` or `value` of node\n * @returns {Node}\n */\n function (type, props, value) {\n /** @type {Node} */\n var node = {type: String(type)}\n\n if (\n (value === undefined || value === null) &&\n (typeof props === 'string' || Array.isArray(props))\n ) {\n value = props\n } else {\n Object.assign(node, props)\n }\n\n if (Array.isArray(value)) {\n node.children = value\n } else if (value !== undefined && value !== null) {\n node.value = String(value)\n }\n\n return node\n }\n)\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n *\n * @typedef {string} Type\n * @typedef {Object} Props\n *\n * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test\n */\n\n/**\n * Check if a node passes a test\n *\n * @callback TestFunctionAnything\n * @param {Node} node\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean|void}\n */\n\n/**\n * Check if a node passes a certain node test\n *\n * @template {Node} X\n * @callback TestFunctionPredicate\n * @param {Node} node\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {node is X}\n */\n\n/**\n * @callback AssertAnything\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean}\n */\n\n/**\n * Check if a node passes a certain node test\n *\n * @template {Node} Y\n * @callback AssertPredicate\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {node is Y}\n */\n\nexport const is =\n /**\n * Check if a node passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @type {(\n * ((node: unknown, test: T['type']|Partial|TestFunctionPredicate|Array.|TestFunctionPredicate>, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => node is T) &\n * ((node?: unknown, test?: Test, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * Check if a node passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @param {unknown} [node] Node to check\n * @param {Test} [test]\n * When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * When `array`, checks any one of the subtests pass.\n * @param {number|null|undefined} [index] Position of `node` in `parent`\n * @param {Parent|null|undefined} [parent] Parent of `node`\n * @param {unknown} [context] Context object to invoke `test` with\n * @returns {boolean} Whether test passed and `node` is a `Node` (object with `type` set to non-empty `string`).\n */\n // eslint-disable-next-line max-params\n function is(node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n // @ts-expect-error Looks like a node.\n return node && node.type && typeof node.type === 'string'\n ? Boolean(check.call(context, node, index, parent))\n : false\n }\n )\n\nexport const convert =\n /**\n * @type {(\n * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * Generate an assertion from a check.\n * @param {Test} [test]\n * When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * When `array`, checks any one of the subtests pass.\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return ok\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n/**\n * @param {Array.} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array.} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {unknown[]} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Utility to assert each property in `test` is represented in `node`, and each\n * values are strictly equal.\n *\n * @param {Props} check\n * @returns {AssertAnything}\n */\nfunction propsFactory(check) {\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n /** @type {string} */\n let key\n\n for (key in check) {\n // @ts-expect-error: hush, it sure works as an index.\n if (node[key] !== check[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Utility to convert a string into a function which checks a given node’s type\n * for said string.\n *\n * @param {Type} check\n * @returns {AssertAnything}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Utility to convert a string into a function which checks a given node’s type\n * for said string.\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {Array.} parameters\n * @returns {boolean}\n */\n function assertion(...parameters) {\n // @ts-expect-error: spreading is fine.\n return Boolean(check.call(this, ...parameters))\n }\n}\n\n// Utility to return true.\nfunction ok() {\n return true\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('./complex-types.js').Action} Action\n * @typedef {import('./complex-types.js').Index} Index\n * @typedef {import('./complex-types.js').ActionTuple} ActionTuple\n * @typedef {import('./complex-types.js').VisitorResult} VisitorResult\n * @typedef {import('./complex-types.js').Visitor} Visitor\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from './color.js'\n\n/**\n * Continue traversing as normal\n */\nexport const CONTINUE = true\n/**\n * Do not traverse this node’s children\n */\nexport const SKIP = 'skip'\n/**\n * Stop traversing immediately\n */\nexport const EXIT = false\n\n/**\n * Visit children of tree which pass test.\n *\n * @param tree\n * Tree to walk\n * @param [test]\n * `unist-util-is`-compatible test\n * @param visitor\n * Function called for nodes that pass `test`.\n * @param [reverse=false]\n * Traverse in reverse preorder (NRL) instead of preorder (NLR) (default).\n */\nexport const visitParents =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: import('./complex-types.js').BuildVisitor, reverse?: boolean) => void) &\n * ((tree: Tree, visitor: import('./complex-types.js').BuildVisitor, reverse?: boolean) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {import('./complex-types.js').Visitor} visitor\n * @param {boolean} [reverse=false]\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n test = null\n }\n\n const is = convert(test)\n const step = reverse ? -1 : 1\n\n factory(tree, null, [])()\n\n /**\n * @param {Node} node\n * @param {number?} index\n * @param {Array} parents\n */\n function factory(node, index, parents) {\n /** @type {Record} */\n // @ts-expect-error: hush\n const value = typeof node === 'object' && node !== null ? node : {}\n /** @type {string|undefined} */\n let name\n\n if (typeof value.type === 'string') {\n name =\n typeof value.tagName === 'string'\n ? value.tagName\n : typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' +\n color(value.type + (name ? '<' + name + '>' : '')) +\n ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {ActionTuple} */\n let result = []\n /** @type {ActionTuple} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n // @ts-expect-error looks like a parent.\n if (node.children && result[0] !== SKIP) {\n // @ts-expect-error looks like a parent.\n offset = (reverse ? node.children.length : -1) + step\n // @ts-expect-error looks like a parent.\n grandparents = parents.concat(node)\n\n // @ts-expect-error looks like a parent.\n while (offset > -1 && offset < node.children.length) {\n // @ts-expect-error looks like a parent.\n subresult = factory(node.children[offset], offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n\n return result\n }\n }\n }\n )\n\n/**\n * @param {VisitorResult} value\n * @returns {ActionTuple}\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return [value]\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n * @typedef {import('./complex-types.js').Visitor} Visitor\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\n/**\n * Visit children of tree which pass test.\n *\n * @param tree\n * Tree to walk\n * @param [test]\n * `unist-util-is`-compatible test\n * @param visitor\n * Function called for nodes that pass `test`.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of preorder (NLR) (default).\n */\nexport const visit =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: import('./complex-types.js').BuildVisitor, reverse?: boolean) => void) &\n * ((tree: Tree, visitor: import('./complex-types.js').BuildVisitor, reverse?: boolean) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {import('./complex-types.js').Visitor} visitor\n * @param {boolean} [reverse]\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {Node} node\n * @param {Array} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n return visitor(\n node,\n parent ? parent.children.indexOf(node) : null,\n parent\n )\n }\n }\n )\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {Record & {type: string, position?: PositionLike|undefined}} NodeLike\n * @typedef {import('unist').Point} Point\n *\n * @typedef {Partial} PointLike\n *\n * @typedef PositionLike\n * @property {PointLike} [start]\n * @property {PointLike} [end]\n */\n\nexport const pointStart = point('start')\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike|Node} [node]\n * @returns {Position}\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start'|'end'} type\n */\nfunction point(type) {\n return point\n\n /**\n * Get the positional info of `node`.\n *\n * @param {NodeLike|Node} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n return {\n line: point.line || null,\n column: point.column || null,\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root|import('mdast').Content} Node\n * @typedef {import('mdast').Definition} Definition\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `node`.\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} node\n */\nexport function definitions(node) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!node || !node.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(node, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /**\n * Get a node from the bound definition cache.\n *\n * @param {string} identifier\n * @returns {Definition|null}\n */\n function definition(identifier) {\n const id = clean(identifier)\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').Root|import('mdast').Parent['children'][number]} MdastNode\n * @typedef {import('./index.js').H} H\n * @typedef {import('./index.js').Handler} Handler\n * @typedef {import('./index.js').Content} Content\n */\n\nimport {u} from 'unist-builder'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Transform an unknown node.\n * @type {Handler}\n * @param {MdastNode} node\n */\nfunction unknown(h, node) {\n const data = node.data || {}\n\n if (\n 'value' in node &&\n !(\n own.call(data, 'hName') ||\n own.call(data, 'hProperties') ||\n own.call(data, 'hChildren')\n )\n ) {\n return h.augment(node, u('text', node.value))\n }\n\n return h(node, 'div', all(h, node))\n}\n\n/**\n * @type {Handler}\n * @param {MdastNode} node\n */\nexport function one(h, node, parent) {\n const type = node && node.type\n /** @type {Handler} */\n let fn\n\n // Fail on non-nodes.\n if (!type) {\n throw new Error('Expected node, got `' + node + '`')\n }\n\n if (own.call(h.handlers, type)) {\n fn = h.handlers[type]\n } else if (h.passThrough && h.passThrough.includes(type)) {\n fn = returnNode\n } else {\n fn = h.unknownHandler\n }\n\n return (typeof fn === 'function' ? fn : unknown)(h, node, parent)\n}\n\n/**\n * @type {Handler}\n * @param {MdastNode} node\n */\nfunction returnNode(h, node) {\n // @ts-expect-error: Pass through custom node.\n return 'children' in node ? {...node, children: all(h, node)} : node\n}\n\n/**\n * @param {H} h\n * @param {MdastNode} parent\n */\nexport function all(h, parent) {\n /** @type {Array} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n\n while (++index < nodes.length) {\n const result = one(h, nodes[index], parent)\n\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = result.value.replace(/^\\s+/, '')\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = head.value.replace(/^\\s+/, '')\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n}\n","const characterReferences = {'\"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'}\n\n/**\n * Encode only the dangerous HTML characters.\n *\n * This ensures that certain characters which have special meaning in HTML are\n * dealt with.\n * Technically, we can skip `>` and `\"` in many cases, but CM includes them.\n *\n * @param {string} value\n * @returns {string}\n */\nexport function encode(value) {\n return value.replace(/[\"&<>]/g, replace)\n\n /**\n * @param {string} value\n * @returns {string}\n */\n function replace(value) {\n // @ts-expect-error Hush, it’s fine.\n return '&' + characterReferences[value] + ';'\n }\n}\n","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri` below).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * Then, a regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`,\n * or `/^https?$/i` for `img[src]`.\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string|undefined} url\n * @param {RegExp} [protocol]\n * @returns {string}\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n\n if (!protocol) {\n return value\n }\n\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n\n if (\n // If there is no protocol, it’s relative.\n colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) || // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n\n return ''\n}\n/**\n * Normalize a URL (such as used in definitions).\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * @returns {string}\n */\n\nfunction normalizeUri(value) {\n /** @type {string[]} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n\n let replace = '' // A correct percent encoded value.\n\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n } // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n } // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1) // A correct surrogate pair.\n\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n } // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n } // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n\n if (skip) {\n index += skip\n skip = 0\n }\n }\n\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('./index.js').Content} Content\n */\n\nimport {u} from 'unist-builder'\n\n/**\n * Wrap `nodes` with line feeds between each entry.\n * Optionally adds line feeds at the start and end.\n *\n * @param {Array} nodes\n * @param {boolean} [loose=false]\n * @returns {Array}\n */\nexport function wrap(nodes, loose) {\n /** @type {Array} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push(u('text', '\\n'))\n }\n\n while (++index < nodes.length) {\n if (index) result.push(u('text', '\\n'))\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push(u('text', '\\n'))\n }\n\n return result\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {sanitizeUri} from 'micromark-util-sanitize-uri'\nimport {u} from 'unist-builder'\n\n/**\n * @type {Handler}\n * @param {FootnoteReference} node\n */\nexport function footnoteReference(h, node) {\n const id = String(node.identifier)\n const safeId = sanitizeUri(id.toLowerCase())\n const index = h.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n h.footnoteOrder.push(id)\n h.footnoteCounts[id] = 1\n counter = h.footnoteOrder.length\n } else {\n h.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = h.footnoteCounts[id]\n\n return h(node, 'sup', [\n h(\n node.position,\n 'a',\n {\n href: '#' + h.clobberPrefix + 'fn-' + safeId,\n id:\n h.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: 'footnote-label'\n },\n [u('text', String(counter))]\n )\n ])\n}\n","/**\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('./index.js').Handler} Handler\n * @typedef {import('./index.js').Content} Content\n */\n\nimport {u} from 'unist-builder'\nimport {all} from './traverse.js'\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @type {Handler}\n * @param {ImageReference|LinkReference} node\n * @returns {Content|Array}\n */\nexport function revert(h, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return u('text', '![' + node.alt + suffix)\n }\n\n const contents = all(h, node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift(u('text', '['))\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push(u('text', suffix))\n }\n\n return contents\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').List} List\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n * @typedef {import('../index.js').Content} Content\n */\n\nimport {u} from 'unist-builder'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {ListItem} node\n * @param {List} parent\n */\nexport function listItem(h, node, parent) {\n const result = all(h, node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const props = {}\n /** @type {Array} */\n const wrapped = []\n\n if (typeof node.checked === 'boolean') {\n /** @type {Element} */\n let paragraph\n\n if (\n result[0] &&\n result[0].type === 'element' &&\n result[0].tagName === 'p'\n ) {\n paragraph = result[0]\n } else {\n paragraph = h(null, 'p', [])\n result.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift(u('text', ' '))\n }\n\n paragraph.children.unshift(\n h(null, 'input', {\n type: 'checkbox',\n checked: node.checked,\n disabled: true\n })\n )\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n props.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < result.length) {\n const child = result[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n wrapped.push(u('text', '\\n'))\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n wrapped.push(...child.children)\n } else {\n wrapped.push(child)\n }\n }\n\n const tail = result[result.length - 1]\n\n // Add a final eol.\n if (tail && (loose || !('tagName' in tail) || tail.tagName !== 'p')) {\n wrapped.push(u('text', '\\n'))\n }\n\n return h(node, 'li', props, wrapped)\n}\n\n/**\n * @param {List} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = node.spread\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n\n return Boolean(loose)\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n return null\n}\n","/**\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {wrap} from '../wrap.js'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Blockquote} node\n */\nexport function blockquote(h, node) {\n return h(node, 'blockquote', wrap(all(h, node), true))\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {u} from 'unist-builder'\n\n/**\n * @type {Handler}\n * @param {Break} node\n * @returns {Array}\n */\nexport function hardBreak(h, node) {\n return [h(node, 'br'), u('text', '\\n')]\n}\n","/**\n * @typedef {import('mdast').Code} Code\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {u} from 'unist-builder'\n\n/**\n * @type {Handler}\n * @param {Code} node\n */\nexport function code(h, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang && node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/)\n /** @type {Properties} */\n const props = {}\n\n if (lang) {\n props.className = ['language-' + lang]\n }\n\n const code = h(node, 'code', props, [u('text', value)])\n\n if (node.meta) {\n code.data = {meta: node.meta}\n }\n\n return h(node.position, 'pre', [code])\n}\n","/**\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Delete} node\n */\nexport function strikethrough(h, node) {\n return h(node, 'del', all(h, node))\n}\n","/**\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Emphasis} node\n */\nexport function emphasis(h, node) {\n return h(node, 'em', all(h, node))\n}\n","/**\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../index.js').Handler} Handler\n *\n * @todo\n * `footnote` (or “inline note”) are a pandoc footnotes feature (`^[a note]`)\n * that does not exist in GFM.\n * We still have support for it, so that things remain working with\n * `micromark-extension-footnote` and `mdast-util-footnote`, but in the future\n * we might be able to remove it?\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n/**\n * @type {Handler}\n * @param {Footnote} node\n */\nexport function footnote(h, node) {\n const footnoteById = h.footnoteById\n let no = 1\n\n while (no in footnoteById) no++\n\n const identifier = String(no)\n\n footnoteById[identifier] = {\n type: 'footnoteDefinition',\n identifier,\n children: [{type: 'paragraph', children: node.children}],\n position: node.position\n }\n\n return footnoteReference(h, {\n type: 'footnoteReference',\n identifier,\n position: node.position\n })\n}\n","/**\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Heading} node\n */\nexport function heading(h, node) {\n return h(node, 'h' + node.depth, all(h, node))\n}\n","/**\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {u} from 'unist-builder'\n\n/**\n * Return either a `raw` node in dangerous mode, otherwise nothing.\n *\n * @type {Handler}\n * @param {HTML} node\n */\nexport function html(h, node) {\n return h.dangerous ? h.augment(node, u('raw', node.value)) : null\n}\n","/**\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport normalize from 'mdurl/encode.js'\nimport {revert} from '../revert.js'\n\n/**\n * @type {Handler}\n * @param {ImageReference} node\n */\nexport function imageReference(h, node) {\n const def = h.definition(node.identifier)\n\n if (!def) {\n return revert(h, node)\n }\n\n /** @type {Properties} */\n const props = {src: normalize(def.url || ''), alt: node.alt}\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title\n }\n\n return h(node, 'img', props)\n}\n","/**\n * @typedef {import('mdast').Image} Image\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport normalize from 'mdurl/encode.js'\n\n/**\n * @type {Handler}\n * @param {Image} node\n */\nexport function image(h, node) {\n /** @type {Properties} */\n const props = {src: normalize(node.url), alt: node.alt}\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title\n }\n\n return h(node, 'img', props)\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {u} from 'unist-builder'\n\n/**\n * @type {Handler}\n * @param {InlineCode} node\n */\nexport function inlineCode(h, node) {\n return h(node, 'code', [u('text', node.value.replace(/\\r?\\n|\\r/g, ' '))])\n}\n","/**\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport normalize from 'mdurl/encode.js'\nimport {revert} from '../revert.js'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {LinkReference} node\n */\nexport function linkReference(h, node) {\n const def = h.definition(node.identifier)\n\n if (!def) {\n return revert(h, node)\n }\n\n /** @type {Properties} */\n const props = {href: normalize(def.url || '')}\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title\n }\n\n return h(node, 'a', props, all(h, node))\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport normalize from 'mdurl/encode.js'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Link} node\n */\nexport function link(h, node) {\n /** @type {Properties} */\n const props = {href: normalize(node.url)}\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title\n }\n\n return h(node, 'a', props, all(h, node))\n}\n","/**\n * @typedef {import('mdast').List} List\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {wrap} from '../wrap.js'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {List} node\n * @returns {Element}\n */\nexport function list(h, node) {\n /** @type {Properties} */\n const props = {}\n const name = node.ordered ? 'ol' : 'ul'\n const items = all(h, node)\n let index = -1\n\n if (typeof node.start === 'number' && node.start !== 1) {\n props.start = node.start\n }\n\n // Like GitHub, add a class for custom styling.\n while (++index < items.length) {\n const item = items[index]\n\n if (\n item.type === 'element' &&\n item.tagName === 'li' &&\n item.properties &&\n Array.isArray(item.properties.className) &&\n item.properties.className.includes('task-list-item')\n ) {\n props.className = ['contains-task-list']\n break\n }\n }\n\n return h(node, name, props, wrap(items, true))\n}\n","/**\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Paragraph} node\n */\nexport function paragraph(h, node) {\n return h(node, 'p', all(h, node))\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {u} from 'unist-builder'\nimport {all} from '../traverse.js'\nimport {wrap} from '../wrap.js'\n\n/**\n * @type {Handler}\n * @param {Root} node\n */\nexport function root(h, node) {\n // @ts-expect-error `root`s are also fine.\n return h.augment(node, u('root', wrap(all(h, node))))\n}\n","/**\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Strong} node\n */\nexport function strong(h, node) {\n return h(node, 'strong', all(h, node))\n}\n","/**\n * @typedef {import('mdast').Table} Table\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n * @typedef {import('../index.js').Content} Content\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {wrap} from '../wrap.js'\nimport {all} from '../traverse.js'\n\n/**\n * @type {Handler}\n * @param {Table} node\n */\nexport function table(h, node) {\n const rows = node.children\n let index = -1\n const align = node.align || []\n /** @type {Array} */\n const result = []\n\n while (++index < rows.length) {\n const row = rows[index].children\n const name = index === 0 ? 'th' : 'td'\n /** @type {Array} */\n const out = []\n let cellIndex = -1\n const length = node.align ? align.length : row.length\n\n while (++cellIndex < length) {\n const cell = row[cellIndex]\n out.push(\n h(cell, name, {align: align[cellIndex]}, cell ? all(h, cell) : [])\n )\n }\n\n result[index] = h(rows[index], 'tr', wrap(out, true))\n }\n\n return h(\n node,\n 'table',\n wrap(\n [h(result[0].position, 'thead', wrap([result[0]], true))].concat(\n result[1]\n ? h(\n {\n start: pointStart(result[1]),\n end: pointEnd(result[result.length - 1])\n },\n 'tbody',\n wrap(result.slice(1), true)\n )\n : []\n ),\n true\n )\n )\n}\n","/**\n * @typedef {import('mdast').Text} Text\n * @typedef {import('../index.js').Handler} Handler\n */\n\nimport {trimLines} from 'trim-lines'\nimport {u} from 'unist-builder'\n\n/**\n * @type {Handler}\n * @param {Text} node\n */\nexport function text(h, node) {\n return h.augment(node, u('text', trimLines(String(node.value))))\n}\n","/**\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('hast').Element} Element\n * @typedef {import('../index.js').Handler} Handler\n */\n\n/**\n * @type {Handler}\n * @param {ThematicBreak} [node]\n * @returns {Element}\n */\nexport function thematicBreak(h, node) {\n return h(node, 'hr')\n}\n","/**\n * @typedef {import('mdast').Root|import('mdast').Parent['children'][number]} MdastNode\n * @typedef {import('hast').Root|import('hast').Parent['children'][number]} HastNode\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} Content\n * @typedef {import('unist-util-position').PositionLike} PositionLike\n *\n * @typedef EmbeddedHastFields\n * @property {string} [hName]\n * Defines the tag name of an element.\n * @property {Properties} [hProperties]\n * Defines the properties of an element.\n * @property {Array} [hChildren]\n * Defines the (hast) children of an element.\n *\n * @typedef {Record & EmbeddedHastFields} Data\n * unist data with embedded hast fields.\n *\n * @typedef {MdastNode & {data?: Data}} NodeWithData\n * unist node with embedded hast data.\n *\n * @callback Handler\n * Handle a node.\n * @param {H} h\n * Handle context.\n * @param {any} node\n * mdast node to handle.\n * @param {Parent|null} parent\n * Parent of `node`.\n * @returns {Content|Array|null|undefined}\n * hast node.\n *\n * @callback HFunctionProps\n * @param {MdastNode|PositionLike|null|undefined} node\n * mdast node or unist position.\n * @param {string} tagName\n * HTML tag name.\n * @param {Properties} props\n * Properties.\n * @param {Array?} [children]\n * hast content.\n * @returns {Element}\n * Compiled element.\n *\n * @callback HFunctionNoProps\n * @param {MdastNode|PositionLike|null|undefined} node\n * mdast node or unist position.\n * @param {string} tagName\n * HTML tag name.\n * @param {Array?} [children]\n * hast content\n * @returns {Element}\n * Compiled element.\n *\n * @typedef HFields\n * @property {boolean} dangerous\n * Whether HTML is allowed.\n * @property {string} clobberPrefix\n * Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n * Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n * HTML used for the footnote label.\n * @property {Properties} footnoteLabelProperties\n * Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n * Label to use to go back to a footnote call from the footnote section.\n * @property {(identifier: string) => Definition|null} definition\n * Definition cache.\n * @property {Record} footnoteById\n * Footnote cache.\n * @property {Array} footnoteOrder\n * Order in which footnotes occur.\n * @property {Record} footnoteCounts\n * Counts the same footnote was used.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {Handler} unknownHandler\n * Handler for any none not in `passThrough` or otherwise handled.\n * @property {(left: NodeWithData|PositionLike|null|undefined, right: Content) => Content} augment\n * Like `h` but lower-level and usable on non-elements.\n * @property {Array} passThrough\n * List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean} [allowDangerousHtml=false]\n * Whether to allow `html` nodes and inject them as `raw` HTML.\n * @property {string} [clobberPrefix='user-content-']\n * Prefix to use before the `id` attribute to prevent it from *clobbering*.\n * attributes.\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available in browsers on the `window` object.\n * Using a prefix prevents this from being a problem.\n * @property {string} [footnoteLabel='Footnotes']\n * Label to use for the footnotes section.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {string} [footnoteLabelTagName='h2']\n * HTML tag to use for the footnote label.\n * Can be changed to match your document structure and play well with your choice of css.\n * @property {Properties} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label.\n * A 'sr-only' class is added by default to hide this from sighted users.\n * Change it to make the label visible, or add classes for other purposes.\n * @property {string} [footnoteBackLabel='Back to content']\n * Label to use from backreferences back to their footnote call.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {Handlers} [handlers]\n * Object mapping mdast nodes to functions handling them\n * @property {Array} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast\n * @property {Handler} [unknownHandler]\n * Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n * Map of node types to handlers\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} H\n * Handle context\n */\n\nimport {u} from 'unist-builder'\nimport {visit} from 'unist-util-visit'\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {one} from './traverse.js'\nimport {footer} from './footer.js'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Turn mdast into hast.\n *\n * @param {MdastNode} tree\n * mdast node.\n * @param {Options} [options]\n * Configuration (optional).\n * @returns {H}\n * `h` function.\n */\nfunction factory(tree, options) {\n const settings = options || {}\n const dangerous = settings.allowDangerousHtml || false\n /** @type {Record} */\n const footnoteById = {}\n\n h.dangerous = dangerous\n h.clobberPrefix =\n settings.clobberPrefix === undefined || settings.clobberPrefix === null\n ? 'user-content-'\n : settings.clobberPrefix\n h.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n h.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n h.footnoteLabelProperties = settings.footnoteLabelProperties || {\n className: ['sr-only']\n }\n h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n h.definition = definitions(tree)\n h.footnoteById = footnoteById\n /** @type {Array} */\n h.footnoteOrder = []\n /** @type {Record} */\n h.footnoteCounts = {}\n h.augment = augment\n h.handlers = {...handlers, ...settings.handlers}\n h.unknownHandler = settings.unknownHandler\n h.passThrough = settings.passThrough\n\n visit(tree, 'footnoteDefinition', (definition) => {\n const id = String(definition.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!own.call(footnoteById, id)) {\n footnoteById[id] = definition\n }\n })\n\n // @ts-expect-error Hush, it’s fine!\n return h\n\n /**\n * Finalise the created `right`, a hast node, from `left`, an mdast node.\n *\n * @param {(NodeWithData|PositionLike)?} left\n * @param {Content} right\n * @returns {Content}\n */\n function augment(left, right) {\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (left && 'data' in left && left.data) {\n /** @type {Data} */\n const data = left.data\n\n if (data.hName) {\n if (right.type !== 'element') {\n right = {\n type: 'element',\n tagName: '',\n properties: {},\n children: []\n }\n }\n\n right.tagName = data.hName\n }\n\n if (right.type === 'element' && data.hProperties) {\n right.properties = {...right.properties, ...data.hProperties}\n }\n\n if ('children' in right && right.children && data.hChildren) {\n right.children = data.hChildren\n }\n }\n\n if (left) {\n const ctx = 'type' in left ? left : {position: left}\n\n if (!generated(ctx)) {\n // @ts-expect-error: fine.\n right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n }\n }\n\n return right\n }\n\n /**\n * Create an element for `node`.\n *\n * @type {HFunctionProps}\n */\n function h(node, tagName, props, children) {\n if (Array.isArray(props)) {\n children = props\n props = {}\n }\n\n // @ts-expect-error augmenting an element yields an element.\n return augment(node, {\n type: 'element',\n tagName,\n properties: props || {},\n children: children || []\n })\n }\n}\n\n/**\n * Transform `tree` (an mdast node) to a hast node.\n *\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {HastNode|null|undefined} hast node\n */\nexport function toHast(tree, options) {\n const h = factory(tree, options)\n const node = one(h, tree, null)\n const foot = footer(h)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push(u('text', '\\n'), foot)\n }\n\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n\nexport {handlers as defaultHandlers} from './handlers/index.js'\n","/**\n * @typedef {Object} PointLike\n * @property {number} [line]\n * @property {number} [column]\n * @property {number} [offset]\n *\n * @typedef {Object} PositionLike\n * @property {PointLike} [start]\n * @property {PointLike} [end]\n *\n * @typedef {Object} NodeLike\n * @property {PositionLike} [position]\n */\n\n/**\n * Check if `node` is *generated*.\n *\n * @param {NodeLike} [node]\n * @returns {boolean}\n */\nexport function generated(node) {\n return (\n !node ||\n !node.position ||\n !node.position.start ||\n !node.position.start.line ||\n !node.position.start.column ||\n !node.position.end ||\n !node.position.end.line ||\n !node.position.end.column\n )\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('./index.js').H} H\n */\n\nimport {sanitizeUri} from 'micromark-util-sanitize-uri'\nimport {u} from 'unist-builder'\nimport {all} from './traverse.js'\nimport {wrap} from './wrap.js'\n\n/**\n * @param {H} h\n * @returns {Element|null}\n */\nexport function footer(h) {\n let index = -1\n /** @type {Array} */\n const listItems = []\n\n while (++index < h.footnoteOrder.length) {\n const def = h.footnoteById[h.footnoteOrder[index].toUpperCase()]\n\n if (!def) {\n continue\n }\n\n const content = all(h, def)\n const id = String(def.identifier)\n const safeId = sanitizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= h.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n h.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: h.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: h.clobberPrefix + 'fn-' + safeId},\n children: wrap(content, true)\n }\n\n if (def.position) {\n listItem.position = def.position\n }\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return null\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: h.footnoteLabelTagName,\n properties: {\n ...JSON.parse(JSON.stringify(h.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [u('text', h.footnoteLabel)]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","import {visit} from 'unist-util-visit'\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Element} Element\n *\n * @callback AllowElement\n * @param {Element} element\n * @param {number} index\n * @param {Element|Root} parent\n * @returns {boolean|undefined}\n *\n * @typedef Options\n * @property {Array} [allowedElements]\n * @property {Array} [disallowedElements=[]]\n * @property {AllowElement} [allowElement]\n * @property {boolean} [unwrapDisallowed=false]\n */\n\n/**\n * @type {import('unified').Plugin<[Options], Root>}\n */\nexport default function rehypeFilter(options) {\n if (options.allowedElements && options.disallowedElements) {\n throw new TypeError(\n 'Only one of `allowedElements` and `disallowedElements` should be defined'\n )\n }\n\n if (\n options.allowedElements ||\n options.disallowedElements ||\n options.allowElement\n ) {\n return (tree) => {\n visit(tree, 'element', (node, index, parent_) => {\n const parent = /** @type {Element|Root} */ (parent_)\n /** @type {boolean|undefined} */\n let remove\n\n if (options.allowedElements) {\n remove = !options.allowedElements.includes(node.tagName)\n } else if (options.disallowedElements) {\n remove = options.disallowedElements.includes(node.tagName)\n }\n\n if (!remove && options.allowElement && typeof index === 'number') {\n remove = !options.allowElement(node, index, parent)\n }\n\n if (remove && typeof index === 'number') {\n if (options.unwrapDisallowed && node.children) {\n parent.children.splice(index, 1, ...node.children)\n } else {\n parent.children.splice(index, 1)\n }\n\n return index\n }\n\n return undefined\n })\n }\n }\n}\n","const protocols = ['http', 'https', 'mailto', 'tel']\n\n/**\n * @param {string} uri\n * @returns {string}\n */\nexport function uriTransformer(uri) {\n const url = (uri || '').trim()\n const first = url.charAt(0)\n\n if (first === '#' || first === '/') {\n return url\n }\n\n const colon = url.indexOf(':')\n if (colon === -1) {\n return url\n }\n\n let index = -1\n\n while (++index < protocols.length) {\n const protocol = protocols[index]\n\n if (\n colon === protocol.length &&\n url.slice(0, protocol.length).toLowerCase() === protocol\n ) {\n return url\n }\n }\n\n index = url.indexOf('?')\n if (index !== -1 && colon > index) {\n return url\n }\n\n index = url.indexOf('#')\n if (index !== -1 && colon > index) {\n return url\n }\n\n // eslint-disable-next-line no-script-url\n return 'javascript:void(0)'\n}\n","/**\n * @param {unknown} thing\n * @returns {boolean}\n */\nexport function whitespace(thing) {\n /** @type {string} */\n var value =\n // @ts-ignore looks like a node.\n thing && typeof thing === 'object' && thing.type === 'text'\n ? // @ts-ignore looks like a text.\n thing.value || ''\n : thing\n\n // HTML whitespace expression.\n // See .\n return typeof value === 'string' && value.replace(/[ \\t\\n\\f\\r]/g, '') === ''\n}\n","export const hastToReact = {\n classId: 'classID',\n dataType: 'datatype',\n itemId: 'itemID',\n strokeDashArray: 'strokeDasharray',\n strokeDashOffset: 'strokeDashoffset',\n strokeLineCap: 'strokeLinecap',\n strokeLineJoin: 'strokeLinejoin',\n strokeMiterLimit: 'strokeMiterlimit',\n typeOf: 'typeof',\n xLinkActuate: 'xlinkActuate',\n xLinkArcRole: 'xlinkArcrole',\n xLinkHref: 'xlinkHref',\n xLinkRole: 'xlinkRole',\n xLinkShow: 'xlinkShow',\n xLinkTitle: 'xlinkTitle',\n xLinkType: 'xlinkType',\n xmlnsXLink: 'xmlnsXlink'\n}\n","/**\n * @template T\n * @typedef {import('react').ComponentType} ComponentType\n */\n\n/**\n * @template T\n * @typedef {import('react').ComponentPropsWithoutRef} ComponentPropsWithoutRef\n */\n\n/**\n * @typedef {import('react').ReactNode} ReactNode\n * @typedef {import('unist').Position} Position\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('property-information').Info} Info\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('./complex-types').ReactMarkdownProps} ReactMarkdownProps\n *\n * @typedef Raw\n * @property {'raw'} type\n * @property {string} value\n *\n * @typedef Context\n * @property {Options} options\n * @property {Schema} schema\n * @property {number} listDepth\n *\n * @callback TransformLink\n * @param {string} href\n * @param {Array} children\n * @param {string?} title\n * @returns {string}\n *\n * @callback TransformImage\n * @param {string} src\n * @param {string} alt\n * @param {string?} title\n * @returns {string}\n *\n * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType\n *\n * @callback TransformLinkTarget\n * @param {string} href\n * @param {Array} children\n * @param {string?} title\n * @returns {TransformLinkTargetType|undefined}\n *\n * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames\n *\n * To do: is `data-sourcepos` typeable?\n *\n * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps\n * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps\n * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps\n * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps\n * @typedef {ComponentPropsWithoutRef<'table'> & ReactMarkdownProps & {style?: Record, isHeader: boolean}} TableCellProps\n * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps\n * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps\n *\n * @typedef {ComponentType} CodeComponent\n * @typedef {ComponentType} HeadingComponent\n * @typedef {ComponentType} LiComponent\n * @typedef {ComponentType} OrderedListComponent\n * @typedef {ComponentType} TableCellComponent\n * @typedef {ComponentType} TableRowComponent\n * @typedef {ComponentType} UnorderedListComponent\n *\n * @typedef SpecialComponents\n * @property {CodeComponent|ReactMarkdownNames} code\n * @property {HeadingComponent|ReactMarkdownNames} h1\n * @property {HeadingComponent|ReactMarkdownNames} h2\n * @property {HeadingComponent|ReactMarkdownNames} h3\n * @property {HeadingComponent|ReactMarkdownNames} h4\n * @property {HeadingComponent|ReactMarkdownNames} h5\n * @property {HeadingComponent|ReactMarkdownNames} h6\n * @property {LiComponent|ReactMarkdownNames} li\n * @property {OrderedListComponent|ReactMarkdownNames} ol\n * @property {TableCellComponent|ReactMarkdownNames} td\n * @property {TableCellComponent|ReactMarkdownNames} th\n * @property {TableRowComponent|ReactMarkdownNames} tr\n * @property {UnorderedListComponent|ReactMarkdownNames} ul\n *\n * @typedef {Partial & SpecialComponents>} Components\n *\n * @typedef Options\n * @property {boolean} [sourcePos=false]\n * @property {boolean} [rawSourcePos=false]\n * @property {boolean} [skipHtml=false]\n * @property {boolean} [includeElementIndex=false]\n * @property {null|false|TransformLink} [transformLinkUri]\n * @property {TransformImage} [transformImageUri]\n * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget]\n * @property {Components} [components]\n */\n\nimport React from 'react'\nimport ReactIs from 'react-is'\nimport {whitespace} from 'hast-util-whitespace'\nimport {svg, find, hastToReact} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {stringify as commas} from 'comma-separated-tokens'\nimport style from 'style-to-object'\n\nconst own = {}.hasOwnProperty\n\n// The table-related elements that must not contain whitespace text according\n// to React.\nconst tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr'])\n\n/**\n * @param {Context} context\n * @param {Element|Root} node\n */\nexport function childrenToReact(context, node) {\n /** @type {Array} */\n const children = []\n let childIndex = -1\n /** @type {Comment|Doctype|Element|Raw|Text} */\n let child\n\n while (++childIndex < node.children.length) {\n child = node.children[childIndex]\n\n if (child.type === 'element') {\n children.push(toReact(context, child, childIndex, node))\n } else if (child.type === 'text') {\n // Currently, a warning is triggered by react for *any* white space in\n // tables.\n // So we drop it.\n // See: .\n // See: .\n // See: .\n // See: .\n if (\n node.type !== 'element' ||\n !tableElements.has(node.tagName) ||\n !whitespace(child)\n ) {\n children.push(child.value)\n }\n } else if (child.type === 'raw' && !context.options.skipHtml) {\n // Default behavior is to show (encoded) HTML.\n children.push(child.value)\n }\n }\n\n return children\n}\n\n/**\n * @param {Context} context\n * @param {Element} node\n * @param {number} index\n * @param {Element|Root} parent\n */\nfunction toReact(context, node, index, parent) {\n const options = context.options\n const parentSchema = context.schema\n /** @type {ReactMarkdownNames} */\n // @ts-expect-error assume a known HTML/SVG element.\n const name = node.tagName\n /** @type {Record} */\n const properties = {}\n let schema = parentSchema\n /** @type {string} */\n let property\n\n if (parentSchema.space === 'html' && name === 'svg') {\n schema = svg\n context.schema = schema\n }\n\n if (node.properties) {\n for (property in node.properties) {\n if (own.call(node.properties, property)) {\n addProperty(properties, property, node.properties[property], context)\n }\n }\n }\n\n if (name === 'ol' || name === 'ul') {\n context.listDepth++\n }\n\n const children = childrenToReact(context, node)\n\n if (name === 'ol' || name === 'ul') {\n context.listDepth--\n }\n\n // Restore parent schema.\n context.schema = parentSchema\n\n // Nodes created by plugins do not have positional info, in which case we use\n // an object that matches the position interface.\n const position = node.position || {\n start: {line: null, column: null, offset: null},\n end: {line: null, column: null, offset: null}\n }\n const component =\n options.components && own.call(options.components, name)\n ? options.components[name]\n : name\n const basic = typeof component === 'string' || component === React.Fragment\n\n if (!ReactIs.isValidElementType(component)) {\n throw new TypeError(\n `Component for name \\`${name}\\` not defined or is not renderable`\n )\n }\n\n properties.key = [\n name,\n position.start.line,\n position.start.column,\n index\n ].join('-')\n\n if (name === 'a' && options.linkTarget) {\n properties.target =\n typeof options.linkTarget === 'function'\n ? options.linkTarget(\n String(properties.href || ''),\n node.children,\n typeof properties.title === 'string' ? properties.title : null\n )\n : options.linkTarget\n }\n\n if (name === 'a' && options.transformLinkUri) {\n properties.href = options.transformLinkUri(\n String(properties.href || ''),\n node.children,\n typeof properties.title === 'string' ? properties.title : null\n )\n }\n\n if (\n !basic &&\n name === 'code' &&\n parent.type === 'element' &&\n parent.tagName !== 'pre'\n ) {\n properties.inline = true\n }\n\n if (\n !basic &&\n (name === 'h1' ||\n name === 'h2' ||\n name === 'h3' ||\n name === 'h4' ||\n name === 'h5' ||\n name === 'h6')\n ) {\n properties.level = Number.parseInt(name.charAt(1), 10)\n }\n\n if (name === 'img' && options.transformImageUri) {\n properties.src = options.transformImageUri(\n String(properties.src || ''),\n String(properties.alt || ''),\n typeof properties.title === 'string' ? properties.title : null\n )\n }\n\n if (!basic && name === 'li' && parent.type === 'element') {\n const input = getInputElement(node)\n properties.checked =\n input && input.properties ? Boolean(input.properties.checked) : null\n properties.index = getElementsBeforeCount(parent, node)\n properties.ordered = parent.tagName === 'ol'\n }\n\n if (!basic && (name === 'ol' || name === 'ul')) {\n properties.ordered = name === 'ol'\n properties.depth = context.listDepth\n }\n\n if (name === 'td' || name === 'th') {\n if (properties.align) {\n if (!properties.style) properties.style = {}\n // @ts-expect-error assume `style` is an object\n properties.style.textAlign = properties.align\n delete properties.align\n }\n\n if (!basic) {\n properties.isHeader = name === 'th'\n }\n }\n\n if (!basic && name === 'tr' && parent.type === 'element') {\n properties.isHeader = Boolean(parent.tagName === 'thead')\n }\n\n // If `sourcePos` is given, pass source information (line/column info from markdown source).\n if (options.sourcePos) {\n properties['data-sourcepos'] = flattenPosition(position)\n }\n\n if (!basic && options.rawSourcePos) {\n properties.sourcePosition = node.position\n }\n\n // If `includeElementIndex` is given, pass node index info to components.\n if (!basic && options.includeElementIndex) {\n properties.index = getElementsBeforeCount(parent, node)\n properties.siblingCount = getElementsBeforeCount(parent)\n }\n\n if (!basic) {\n properties.node = node\n }\n\n // Ensure no React warnings are emitted for void elements w/ children.\n return children.length > 0\n ? React.createElement(component, properties, children)\n : React.createElement(component, properties)\n}\n\n/**\n * @param {Element|Root} node\n * @returns {Element?}\n */\nfunction getInputElement(node) {\n let index = -1\n\n while (++index < node.children.length) {\n const child = node.children[index]\n\n if (child.type === 'element' && child.tagName === 'input') {\n return child\n }\n }\n\n return null\n}\n\n/**\n * @param {Element|Root} parent\n * @param {Element} [node]\n * @returns {number}\n */\nfunction getElementsBeforeCount(parent, node) {\n let index = -1\n let count = 0\n\n while (++index < parent.children.length) {\n if (parent.children[index] === node) break\n if (parent.children[index].type === 'element') count++\n }\n\n return count\n}\n\n/**\n * @param {Record} props\n * @param {string} prop\n * @param {unknown} value\n * @param {Context} ctx\n */\nfunction addProperty(props, prop, value, ctx) {\n const info = find(ctx.schema, prop)\n let result = value\n\n // Ignore nullish and `NaN` values.\n // eslint-disable-next-line no-self-compare\n if (result === null || result === undefined || result !== result) {\n return\n }\n\n // Accept `array`.\n // Most props are space-separated.\n if (Array.isArray(result)) {\n result = info.commaSeparated ? commas(result) : spaces(result)\n }\n\n if (info.property === 'style' && typeof result === 'string') {\n result = parseStyle(result)\n }\n\n if (info.space && info.property) {\n props[\n own.call(hastToReact, info.property)\n ? hastToReact[info.property]\n : info.property\n ] = result\n } else if (info.attribute) {\n props[info.attribute] = result\n }\n}\n\n/**\n * @param {string} value\n * @returns {Record}\n */\nfunction parseStyle(value) {\n /** @type {Record} */\n const result = {}\n\n try {\n style(value, iterator)\n } catch {\n // Silent.\n }\n\n return result\n\n /**\n * @param {string} name\n * @param {string} v\n */\n function iterator(name, v) {\n const k = name.slice(0, 4) === '-ms-' ? `ms-${name.slice(4)}` : name\n result[k.replace(/-([a-z])/g, styleReplacer)] = v\n }\n}\n\n/**\n * @param {unknown} _\n * @param {string} $1\n */\nfunction styleReplacer(_, $1) {\n return $1.toUpperCase()\n}\n\n/**\n * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos\n * @returns {string}\n */\nfunction flattenPosition(pos) {\n return [\n pos.start.line,\n ':',\n pos.start.column,\n '-',\n pos.end.line,\n ':',\n pos.end.column\n ]\n .map((d) => String(d))\n .join('')\n}\n","/**\n * @typedef {import('react').ReactNode} ReactNode\n * @typedef {import('react').ReactElement<{}>} ReactElement\n * @typedef {import('unified').PluggableList} PluggableList\n * @typedef {import('hast').Root} Root\n * @typedef {import('./rehype-filter.js').Options} FilterOptions\n * @typedef {import('./ast-to-react.js').Options} TransformOptions\n *\n * @typedef CoreOptions\n * @property {string} children\n *\n * @typedef PluginOptions\n * @property {PluggableList} [remarkPlugins=[]]\n * @property {PluggableList} [rehypePlugins=[]]\n * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}]\n *\n * @typedef LayoutOptions\n * @property {string} [className]\n *\n * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions\n *\n * @typedef Deprecation\n * @property {string} id\n * @property {string} [to]\n */\n\nimport React from 'react'\nimport {VFile} from 'vfile'\nimport {unified} from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport PropTypes from 'prop-types'\nimport {html} from 'property-information'\nimport rehypeFilter from './rehype-filter.js'\nimport {uriTransformer} from './uri-transformer.js'\nimport {childrenToReact} from './ast-to-react.js'\n\nconst own = {}.hasOwnProperty\nconst changelog =\n 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'\n\n/** @type {Record} */\nconst deprecated = {\n plugins: {to: 'plugins', id: 'change-plugins-to-remarkplugins'},\n renderers: {to: 'components', id: 'change-renderers-to-components'},\n astPlugins: {id: 'remove-buggy-html-in-markdown-parser'},\n allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'},\n escapeHtml: {id: 'remove-buggy-html-in-markdown-parser'},\n source: {to: 'children', id: 'change-source-to-children'},\n allowNode: {\n to: 'allowElement',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n allowedTypes: {\n to: 'allowedElements',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n disallowedTypes: {\n to: 'disallowedElements',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n includeNodeIndex: {\n to: 'includeElementIndex',\n id: 'change-includenodeindex-to-includeelementindex'\n }\n}\n\n/**\n * React component to render markdown.\n *\n * @param {ReactMarkdownOptions} options\n * @returns {ReactElement}\n */\nexport function ReactMarkdown(options) {\n for (const key in deprecated) {\n if (own.call(deprecated, key) && own.call(options, key)) {\n const deprecation = deprecated[key]\n console.warn(\n `[react-markdown] Warning: please ${\n deprecation.to ? `use \\`${deprecation.to}\\` instead of` : 'remove'\n } \\`${key}\\` (see <${changelog}#${deprecation.id}> for more info)`\n )\n delete deprecated[key]\n }\n }\n\n const processor = unified()\n .use(remarkParse)\n .use(options.remarkPlugins || [])\n .use(remarkRehype, {\n ...options.remarkRehypeOptions,\n allowDangerousHtml: true\n })\n .use(options.rehypePlugins || [])\n .use(rehypeFilter, options)\n\n const file = new VFile()\n\n if (typeof options.children === 'string') {\n file.value = options.children\n } else if (options.children !== undefined && options.children !== null) {\n console.warn(\n `[react-markdown] Warning: please pass a string as \\`children\\` (not: \\`${options.children}\\`)`\n )\n }\n\n const hastNode = processor.runSync(processor.parse(file), file)\n\n if (hastNode.type !== 'root') {\n throw new TypeError('Expected a `root` node')\n }\n\n /** @type {ReactElement} */\n let result = React.createElement(\n React.Fragment,\n {},\n childrenToReact({options, schema: html, listDepth: 0}, hastNode)\n )\n\n if (options.className) {\n result = React.createElement('div', {className: options.className}, result)\n }\n\n return result\n}\n\nReactMarkdown.defaultProps = {transformLinkUri: uriTransformer}\n\nReactMarkdown.propTypes = {\n // Core options:\n children: PropTypes.string,\n // Layout options:\n className: PropTypes.string,\n // Filter options:\n allowElement: PropTypes.func,\n allowedElements: PropTypes.arrayOf(PropTypes.string),\n disallowedElements: PropTypes.arrayOf(PropTypes.string),\n unwrapDisallowed: PropTypes.bool,\n // Plugin options:\n remarkPlugins: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.string,\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n // prettier-ignore\n // type-coverage:ignore-next-line\n PropTypes.any\n )\n ])\n )\n ])\n ),\n rehypePlugins: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.string,\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n // prettier-ignore\n // type-coverage:ignore-next-line\n PropTypes.any\n )\n ])\n )\n ])\n ),\n // Transform options:\n sourcePos: PropTypes.bool,\n rawSourcePos: PropTypes.bool,\n skipHtml: PropTypes.bool,\n includeElementIndex: PropTypes.bool,\n transformLinkUri: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n linkTarget: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n transformImageUri: PropTypes.func,\n components: PropTypes.object\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiControl,\n asciiDigit,\n markdownLineEndingOrSpace,\n markdownLineEnding,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\nconst www = {\n tokenize: tokenizeWww,\n partial: true\n}\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n}\nconst path = {\n tokenize: tokenizePath,\n partial: true\n}\nconst punctuation = {\n tokenize: tokenizePunctuation,\n partial: true\n}\nconst namedCharacterReference = {\n tokenize: tokenizeNamedCharacterReference,\n partial: true\n}\nconst wwwAutolink = {\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n}\nconst httpAutolink = {\n tokenize: tokenizeHttpAutolink,\n previous: previousHttp\n}\nconst emailAutolink = {\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n}\n/** @type {ConstructRecord} */\n\nconst text = {}\n/** @type {Extension} */\n\nexport const gfmAutolinkLiteral = {\n text\n}\nlet code = 48 // Add alphanumerics.\n\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n if (code === 58) code = 65\n else if (code === 91) code = 97\n}\n\ntext[43] = emailAutolink\ntext[45] = emailAutolink\ntext[46] = emailAutolink\ntext[95] = emailAutolink\ntext[72] = [emailAutolink, httpAutolink]\ntext[104] = [emailAutolink, httpAutolink]\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n/** @type {Tokenizer} */\n\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this\n /** @type {boolean} */\n\n let hasDot\n /** @type {boolean|undefined} */\n\n let hasDigitInLastSegment\n return start\n /** @type {State} */\n\n function start(code) {\n if (\n !gfmAtext(code) ||\n !previousEmail(self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n /** @type {State} */\n\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n\n if (code === 64) {\n effects.consume(code)\n return label\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function label(code) {\n if (code === 46) {\n return effects.check(punctuation, done, dotContinuation)(code)\n }\n\n if (code === 45 || code === 95) {\n return effects.check(punctuation, nok, dashOrUnderscoreContinuation)(code)\n }\n\n if (asciiAlphanumeric(code)) {\n if (!hasDigitInLastSegment && asciiDigit(code)) {\n hasDigitInLastSegment = true\n }\n\n effects.consume(code)\n return label\n }\n\n return done(code)\n }\n /** @type {State} */\n\n function dotContinuation(code) {\n effects.consume(code)\n hasDot = true\n hasDigitInLastSegment = undefined\n return label\n }\n /** @type {State} */\n\n function dashOrUnderscoreContinuation(code) {\n effects.consume(code)\n return afterDashOrUnderscore\n }\n /** @type {State} */\n\n function afterDashOrUnderscore(code) {\n if (code === 46) {\n return effects.check(punctuation, nok, dotContinuation)(code)\n }\n\n return label(code)\n }\n /** @type {State} */\n\n function done(code) {\n if (hasDot && !hasDigitInLastSegment) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n if (\n (code !== 87 && code !== 119) ||\n !previousWww(self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww') // For `www.` we check instead of attempt, because when it matches, GH\n // treats it as part of a domain (yes, it says a valid domain must come\n // after `www.`, but that’s not how it’s implemented by them).\n\n return effects.check(\n www,\n effects.attempt(domain, effects.attempt(path, done), nok),\n nok\n )(code)\n }\n /** @type {State} */\n\n function done(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeHttpAutolink(effects, ok, nok) {\n const self = this\n return start\n /** @type {State} */\n\n function start(code) {\n if (\n (code !== 72 && code !== 104) ||\n !previousHttp(self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n effects.consume(code)\n return t1\n }\n /** @type {State} */\n\n function t1(code) {\n if (code === 84 || code === 116) {\n effects.consume(code)\n return t2\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function t2(code) {\n if (code === 84 || code === 116) {\n effects.consume(code)\n return p\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function p(code) {\n if (code === 80 || code === 112) {\n effects.consume(code)\n return s\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function s(code) {\n if (code === 83 || code === 115) {\n effects.consume(code)\n return colon\n }\n\n return colon(code)\n }\n /** @type {State} */\n\n function colon(code) {\n if (code === 58) {\n effects.consume(code)\n return slash1\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function slash1(code) {\n if (code === 47) {\n effects.consume(code)\n return slash2\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function slash2(code) {\n if (code === 47) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n return code === null ||\n asciiControl(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, done), nok)(code)\n }\n /** @type {State} */\n\n function done(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeWww(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.consume(code)\n return w2\n }\n /** @type {State} */\n\n function w2(code) {\n if (code === 87 || code === 119) {\n effects.consume(code)\n return w3\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function w3(code) {\n if (code === 87 || code === 119) {\n effects.consume(code)\n return dot\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function dot(code) {\n if (code === 46) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? nok(code) : ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean|undefined} */\n let hasUnderscoreInLastSegment\n /** @type {boolean|undefined} */\n\n let hasUnderscoreInLastLastSegment\n return domain\n /** @type {State} */\n\n function domain(code) {\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n done,\n punctuationContinuation\n )(code)\n }\n\n if (code === 46 || code === 95) {\n return effects.check(punctuation, done, punctuationContinuation)(code)\n } // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n\n if (\n code === null ||\n asciiControl(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 && unicodePunctuation(code))\n ) {\n return done(code)\n }\n\n effects.consume(code)\n return domain\n }\n /** @type {State} */\n\n function punctuationContinuation(code) {\n if (code === 46) {\n hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment\n hasUnderscoreInLastSegment = undefined\n effects.consume(code)\n return domain\n }\n\n if (code === 95) hasUnderscoreInLastSegment = true\n effects.consume(code)\n return domain\n }\n /** @type {State} */\n\n function done(code) {\n if (!hasUnderscoreInLastLastSegment && !hasUnderscoreInLastSegment) {\n return ok(code)\n }\n\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizePath(effects, ok) {\n let balance = 0\n return inPath\n /** @type {State} */\n\n function inPath(code) {\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n ok,\n continuedPunctuation\n )(code)\n }\n\n if (code === 40) {\n balance++\n }\n\n if (code === 41) {\n return effects.check(\n punctuation,\n parenAtPathEnd,\n continuedPunctuation\n )(code)\n }\n\n if (pathEnd(code)) {\n return ok(code)\n }\n\n if (trailingPunctuation(code)) {\n return effects.check(punctuation, ok, continuedPunctuation)(code)\n }\n\n effects.consume(code)\n return inPath\n }\n /** @type {State} */\n\n function continuedPunctuation(code) {\n effects.consume(code)\n return inPath\n }\n /** @type {State} */\n\n function parenAtPathEnd(code) {\n balance--\n return balance < 0 ? ok(code) : continuedPunctuation(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeNamedCharacterReference(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.consume(code)\n return inside\n }\n /** @type {State} */\n\n function inside(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return inside\n }\n\n if (code === 59) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function after(code) {\n // If the named character reference is followed by the end of the path, it’s\n // not continued punctuation.\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizePunctuation(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.consume(code)\n return after\n }\n /** @type {State} */\n\n function after(code) {\n // Check the next.\n if (trailingPunctuation(code)) {\n effects.consume(code)\n return after\n } // If the punctuation marker is followed by the end of the path, it’s not\n // continued punctuation.\n\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n/**\n * @param {Code} code\n * @returns {boolean}\n */\n\nfunction trailingPunctuation(code) {\n return (\n code === 33 ||\n code === 34 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 60 ||\n code === 63 ||\n code === 95 ||\n code === 126\n )\n}\n/**\n * @param {Code} code\n * @returns {boolean}\n */\n\nfunction pathEnd(code) {\n return code === null || code === 60 || markdownLineEndingOrSpace(code)\n}\n/**\n * @param {Code} code\n * @returns {boolean}\n */\n\nfunction gfmAtext(code) {\n return (\n code === 43 ||\n code === 45 ||\n code === 46 ||\n code === 95 ||\n asciiAlphanumeric(code)\n )\n}\n/** @type {Previous} */\n\nfunction previousWww(code) {\n return (\n code === null ||\n code === 40 ||\n code === 42 ||\n code === 95 ||\n code === 126 ||\n markdownLineEndingOrSpace(code)\n )\n}\n/** @type {Previous} */\n\nfunction previousHttp(code) {\n return code === null || !asciiAlpha(code)\n}\n/** @type {Previous} */\n\nfunction previousEmail(code) {\n return code !== 47 && previousHttp(code)\n}\n/**\n * @param {Array} events\n * @returns {boolean}\n */\n\nfunction previousUnbalanced(events) {\n let index = events.length\n let result = false\n\n while (index--) {\n const token = events[index][1]\n\n if (\n (token.type === 'labelLink' || token.type === 'labelImage') &&\n !token._balanced\n ) {\n result = true\n break\n } // @ts-expect-error If we’ve seen this token, and it was marked as not\n // having any unbalanced bracket before it, we can exit.\n\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false\n break\n }\n }\n\n if (events.length > 0 && !result) {\n // @ts-expect-error Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true\n }\n\n return result\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Event} Event\n */\nimport {blankLine} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace\n} from 'micromark-util-character'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n}\n/**\n * @returns {Extension}\n */\n\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {Token} */\n\n let labelStart // Find an opening.\n\n while (index--) {\n const token = self.events[index][1]\n\n if (token.type === 'labelImage') {\n labelStart = token\n break\n } // Exit if we’ve walked far enough.\n\n if (\n token.type === 'gfmFootnoteCall' ||\n token.type === 'labelLink' ||\n token.type === 'label' ||\n token.type === 'image' ||\n token.type === 'link'\n ) {\n break\n }\n }\n\n return start\n /** @type {State} */\n\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code)\n }\n\n const id = normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n\n if (id.charCodeAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code)\n }\n\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return ok(code)\n }\n}\n/** @type {Resolver} */\n\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length\n /** @type {Token|undefined} */\n\n let labelStart // Find an opening.\n\n while (index--) {\n if (\n events[index][1].type === 'labelImage' &&\n events[index][0] === 'enter'\n ) {\n labelStart = events[index][1]\n break\n }\n }\n\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = 'data'\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker' // The whole (without `!`):\n\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n } // The `^` marker\n\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n } // Increment the end 1 character.\n\n marker.end.column++\n marker.end.offset++\n marker.end._bufferIndex++\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n }\n const chunk = {\n type: 'chunkString',\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n }\n /** @type {Array} */\n\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1],\n events[index + 2],\n ['enter', call, context], // The `[`\n events[index + 3],\n events[index + 4], // The `^`.\n ['enter', marker, context],\n ['exit', marker, context], // Everything in between.\n ['enter', string, context],\n ['enter', chunk, context],\n ['exit', chunk, context],\n ['exit', string, context], // The ending (`]`, properly parsed and labelled).\n events[events.length - 2],\n events[events.length - 1],\n ['exit', call, context]\n ]\n events.splice(index, events.length - index + 1, ...replacement)\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n let size = 0\n /** @type {boolean} */\n\n let data\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('gfmFootnoteCall')\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return callStart\n }\n /** @type {State} */\n\n function callStart(code) {\n if (code !== 94) return nok(code)\n effects.enter('gfmFootnoteCallMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallMarker')\n effects.enter('gfmFootnoteCallString')\n effects.enter('chunkString').contentType = 'string'\n return callData\n }\n /** @type {State} */\n\n function callData(code) {\n /** @type {Token} */\n let token\n\n if (code === null || code === 91 || size++ > 999) {\n return nok(code)\n }\n\n if (code === 93) {\n if (!data) {\n return nok(code)\n }\n\n effects.exit('chunkString')\n token = effects.exit('gfmFootnoteCallString')\n return defined.includes(normalizeIdentifier(self.sliceSerialize(token)))\n ? end(code)\n : nok(code)\n }\n\n effects.consume(code)\n\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n\n return code === 92 ? callEscape : callData\n }\n /** @type {State} */\n\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return callData\n }\n\n return callData(code)\n }\n /** @type {State} */\n\n function end(code) {\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n effects.exit('gfmFootnoteCall')\n return ok\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {string} */\n\n let identifier\n let size = 0\n /** @type {boolean|undefined} */\n\n let data\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true\n effects.enter('gfmFootnoteDefinitionLabel')\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n return labelStart\n }\n /** @type {State} */\n\n function labelStart(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionMarker')\n effects.enter('gfmFootnoteDefinitionLabelString')\n return atBreak\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function atBreak(code) {\n /** @type {Token} */\n let token\n\n if (code === null || code === 91 || size > 999) {\n return nok(code)\n }\n\n if (code === 93) {\n if (!data) {\n return nok(code)\n }\n\n token = effects.exit('gfmFootnoteDefinitionLabelString')\n identifier = normalizeIdentifier(self.sliceSerialize(token))\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n effects.exit('gfmFootnoteDefinitionLabel')\n return labelAfter\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n size++\n return atBreak\n }\n\n effects.enter('chunkString').contentType = 'string'\n return label(code)\n }\n /** @type {State} */\n\n function label(code) {\n if (\n code === null ||\n markdownLineEnding(code) ||\n code === 91 ||\n code === 93 ||\n size > 999\n ) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n\n size++\n effects.consume(code)\n return code === 92 ? labelEscape : label\n }\n /** @type {State} */\n\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return label\n }\n\n return label(code)\n }\n /** @type {State} */\n\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker') // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n\n return factorySpace(effects, done, 'gfmFootnoteDefinitionWhitespace')\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function done(code) {\n if (!defined.includes(identifier)) {\n defined.push(identifier)\n }\n\n return ok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))\n}\n/** @type {Exiter} */\n\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition')\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'gfmFootnoteDefinitionIndent',\n 4 + 1\n )\n /** @type {State} */\n\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'gfmFootnoteDefinitionIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === 4\n ? ok(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n/**\n * @typedef Options\n * Configuration (optional).\n * @property {boolean} [singleTilde=true]\n * Whether to support strikethrough with a single tilde (`boolean`, default:\n * `true`).\n * Single tildes work on github.com, but are technically prohibited by the\n * GFM spec.\n */\nimport {splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/**\n * @param {Options} [options]\n * @returns {Extension}\n */\nexport function gfmStrikethrough(options = {}) {\n let single = options.singleTilde\n const tokenizer = {\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n }\n\n if (single === null || single === undefined) {\n single = true\n }\n\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n }\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n\n function resolveAllStrikethrough(events, context) {\n let index = -1 // Walk through all events.\n\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'strikethroughSequenceTemporary' &&\n events[index][1]._close\n ) {\n let open = index // Now walk back to find an opener.\n\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'strikethroughSequenceTemporary' &&\n events[open][1]._open && // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset ===\n events[open][1].end.offset - events[open][1].start.offset\n ) {\n events[index][1].type = 'strikethroughSequence'\n events[open][1].type = 'strikethroughSequence'\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n }\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n } // Opening.\n\n const nextEvents = [\n ['enter', strikethrough, context],\n ['enter', events[open][1], context],\n ['exit', events[open][1], context],\n ['enter', text, context]\n ] // Between.\n\n splice(\n nextEvents,\n nextEvents.length,\n 0,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n ) // Closing.\n\n splice(nextEvents, nextEvents.length, 0, [\n ['exit', text, context],\n ['enter', events[index][1], context],\n ['exit', events[index][1], context],\n ['exit', strikethrough, context]\n ])\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - 2\n break\n }\n }\n }\n }\n\n index = -1\n\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = 'data'\n }\n }\n\n return events\n }\n /** @type {Tokenizer} */\n\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous\n const events = this.events\n let size = 0\n return start\n /** @type {State} */\n\n function start(code) {\n if (\n previous === 126 &&\n events[events.length - 1][1].type !== 'characterEscape'\n ) {\n return nok(code)\n }\n\n effects.enter('strikethroughSequenceTemporary')\n return more(code)\n }\n /** @type {State} */\n\n function more(code) {\n const before = classifyCharacter(previous)\n\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code)\n effects.consume(code)\n size++\n return more\n }\n\n if (size < 2 && !single) return nok(code)\n const token = effects.exit('strikethroughSequenceTemporary')\n const after = classifyCharacter(code)\n token._open = !after || (after === 2 && Boolean(before))\n token._close = !before || (before === 2 && Boolean(after))\n return ok(code)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n */\n\n/**\n * @typedef {'left'|'center'|'right'|'none'} Align\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n\n/** @type {Extension} */\nexport const gfmTable = {\n flow: {\n null: {\n tokenize: tokenizeTable,\n resolve: resolveTable\n }\n }\n}\nconst nextPrefixedOrBlank = {\n tokenize: tokenizeNextPrefixedOrBlank,\n partial: true\n}\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1\n /** @type {boolean|undefined} */\n\n let inHead\n /** @type {boolean|undefined} */\n\n let inDelimiterRow\n /** @type {boolean|undefined} */\n\n let inRow\n /** @type {number|undefined} */\n\n let contentStart\n /** @type {number|undefined} */\n\n let contentEnd\n /** @type {number|undefined} */\n\n let cellStart\n /** @type {boolean|undefined} */\n\n let seenCellInRow\n\n while (++index < events.length) {\n const token = events[index][1]\n\n if (inRow) {\n if (token.type === 'temporaryTableCellContent') {\n contentStart = contentStart || index\n contentEnd = index\n }\n\n if (\n // Combine separate content parts into one.\n (token.type === 'tableCellDivider' || token.type === 'tableRow') &&\n contentEnd\n ) {\n const content = {\n type: 'tableContent',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n /** @type {Token} */\n\n const text = {\n type: 'chunkText',\n start: content.start,\n end: content.end,\n // @ts-expect-error It’s fine.\n contentType: 'text'\n }\n events.splice(\n contentStart,\n contentEnd - contentStart + 1,\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n )\n index -= contentEnd - contentStart - 3\n contentStart = undefined\n contentEnd = undefined\n }\n }\n\n if (\n events[index][0] === 'exit' &&\n cellStart !== undefined &&\n cellStart + (seenCellInRow ? 0 : 1) < index &&\n (token.type === 'tableCellDivider' ||\n (token.type === 'tableRow' &&\n (cellStart + 3 < index ||\n events[cellStart][1].type !== 'whitespace')))\n ) {\n const cell = {\n type: inDelimiterRow\n ? 'tableDelimiter'\n : inHead\n ? 'tableHeader'\n : 'tableData',\n start: events[cellStart][1].start,\n end: events[index][1].end\n }\n events.splice(index + (token.type === 'tableCellDivider' ? 1 : 0), 0, [\n 'exit',\n cell,\n context\n ])\n events.splice(cellStart, 0, ['enter', cell, context])\n index += 2\n cellStart = index + 1\n seenCellInRow = true\n }\n\n if (token.type === 'tableRow') {\n inRow = events[index][0] === 'enter'\n\n if (inRow) {\n cellStart = index + 1\n seenCellInRow = false\n }\n }\n\n if (token.type === 'tableDelimiterRow') {\n inDelimiterRow = events[index][0] === 'enter'\n\n if (inDelimiterRow) {\n cellStart = index + 1\n seenCellInRow = false\n }\n }\n\n if (token.type === 'tableHead') {\n inHead = events[index][0] === 'enter'\n }\n }\n\n return events\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeTable(effects, ok, nok) {\n const self = this\n /** @type {Array} */\n\n const align = []\n let tableHeaderCount = 0\n /** @type {boolean|undefined} */\n\n let seenDelimiter\n /** @type {boolean|undefined} */\n\n let hasDash\n return start\n /** @type {State} */\n\n function start(code) {\n // @ts-expect-error Custom.\n effects.enter('table')._align = align\n effects.enter('tableHead')\n effects.enter('tableRow') // If we start with a pipe, we open a cell marker.\n\n if (code === 124) {\n return cellDividerHead(code)\n }\n\n tableHeaderCount++\n effects.enter('temporaryTableCellContent') // Can’t be space or eols at the start of a construct, so we’re in a cell.\n\n return inCellContentHead(code)\n }\n /** @type {State} */\n\n function cellDividerHead(code) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n seenDelimiter = true\n return cellBreakHead\n }\n /** @type {State} */\n\n function cellBreakHead(code) {\n if (code === null || markdownLineEnding(code)) {\n return atRowEndHead(code)\n }\n\n if (markdownSpace(code)) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceHead\n }\n\n if (seenDelimiter) {\n seenDelimiter = undefined\n tableHeaderCount++\n }\n\n if (code === 124) {\n return cellDividerHead(code)\n } // Anything else is cell content.\n\n effects.enter('temporaryTableCellContent')\n return inCellContentHead(code)\n }\n /** @type {State} */\n\n function inWhitespaceHead(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return inWhitespaceHead\n }\n\n effects.exit('whitespace')\n return cellBreakHead(code)\n }\n /** @type {State} */\n\n function inCellContentHead(code) {\n // EOF, whitespace, pipe\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('temporaryTableCellContent')\n return cellBreakHead(code)\n }\n\n effects.consume(code)\n return code === 92 ? inCellContentEscapeHead : inCellContentHead\n }\n /** @type {State} */\n\n function inCellContentEscapeHead(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentHead\n } // Anything else.\n\n return inCellContentHead(code)\n }\n /** @type {State} */\n\n function atRowEndHead(code) {\n if (code === null) {\n return nok(code)\n }\n\n effects.exit('tableRow')\n effects.exit('tableHead')\n const originalInterrupt = self.interrupt\n self.interrupt = true\n return effects.attempt(\n {\n tokenize: tokenizeRowEnd,\n partial: true\n },\n function (code) {\n self.interrupt = originalInterrupt\n effects.enter('tableDelimiterRow')\n return atDelimiterRowBreak(code)\n },\n function (code) {\n self.interrupt = originalInterrupt\n return nok(code)\n }\n )(code)\n }\n /** @type {State} */\n\n function atDelimiterRowBreak(code) {\n if (code === null || markdownLineEnding(code)) {\n return rowEndDelimiter(code)\n }\n\n if (markdownSpace(code)) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n align.push('none')\n return inFillerDelimiter\n }\n\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n align.push('left')\n return afterLeftAlignment\n } // If we start with a pipe, we open a cell marker.\n\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function inWhitespaceDelimiter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n effects.exit('whitespace')\n return atDelimiterRowBreak(code)\n }\n /** @type {State} */\n\n function inFillerDelimiter(code) {\n if (code === 45) {\n effects.consume(code)\n return inFillerDelimiter\n }\n\n effects.exit('tableDelimiterFiller')\n\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n align[align.length - 1] =\n align[align.length - 1] === 'left' ? 'center' : 'right'\n return afterRightAlignment\n }\n\n return atDelimiterRowBreak(code)\n }\n /** @type {State} */\n\n function afterLeftAlignment(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n return inFillerDelimiter\n } // Anything else is not ok.\n\n return nok(code)\n }\n /** @type {State} */\n\n function afterRightAlignment(code) {\n if (code === null || markdownLineEnding(code)) {\n return rowEndDelimiter(code)\n }\n\n if (markdownSpace(code)) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n } // `|`\n\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function rowEndDelimiter(code) {\n effects.exit('tableDelimiterRow') // Exit if there was no dash at all, or if the header cell count is not the\n // delimiter cell count.\n\n if (!hasDash || tableHeaderCount !== align.length) {\n return nok(code)\n }\n\n if (code === null) {\n return tableClose(code)\n }\n\n return effects.check(\n nextPrefixedOrBlank,\n tableClose,\n effects.attempt(\n {\n tokenize: tokenizeRowEnd,\n partial: true\n },\n factorySpace(effects, bodyStart, 'linePrefix', 4),\n tableClose\n )\n )(code)\n }\n /** @type {State} */\n\n function tableClose(code) {\n effects.exit('table')\n return ok(code)\n }\n /** @type {State} */\n\n function bodyStart(code) {\n effects.enter('tableBody')\n return rowStartBody(code)\n }\n /** @type {State} */\n\n function rowStartBody(code) {\n effects.enter('tableRow') // If we start with a pipe, we open a cell marker.\n\n if (code === 124) {\n return cellDividerBody(code)\n }\n\n effects.enter('temporaryTableCellContent') // Can’t be space or eols at the start of a construct, so we’re in a cell.\n\n return inCellContentBody(code)\n }\n /** @type {State} */\n\n function cellDividerBody(code) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return cellBreakBody\n }\n /** @type {State} */\n\n function cellBreakBody(code) {\n if (code === null || markdownLineEnding(code)) {\n return atRowEndBody(code)\n }\n\n if (markdownSpace(code)) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceBody\n } // `|`\n\n if (code === 124) {\n return cellDividerBody(code)\n } // Anything else is cell content.\n\n effects.enter('temporaryTableCellContent')\n return inCellContentBody(code)\n }\n /** @type {State} */\n\n function inWhitespaceBody(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return inWhitespaceBody\n }\n\n effects.exit('whitespace')\n return cellBreakBody(code)\n }\n /** @type {State} */\n\n function inCellContentBody(code) {\n // EOF, whitespace, pipe\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('temporaryTableCellContent')\n return cellBreakBody(code)\n }\n\n effects.consume(code)\n return code === 92 ? inCellContentEscapeBody : inCellContentBody\n }\n /** @type {State} */\n\n function inCellContentEscapeBody(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentBody\n } // Anything else.\n\n return inCellContentBody(code)\n }\n /** @type {State} */\n\n function atRowEndBody(code) {\n effects.exit('tableRow')\n\n if (code === null) {\n return tableBodyClose(code)\n }\n\n return effects.check(\n nextPrefixedOrBlank,\n tableBodyClose,\n effects.attempt(\n {\n tokenize: tokenizeRowEnd,\n partial: true\n },\n factorySpace(effects, rowStartBody, 'linePrefix', 4),\n tableBodyClose\n )\n )(code)\n }\n /** @type {State} */\n\n function tableBodyClose(code) {\n effects.exit('tableBody')\n return tableClose(code)\n }\n /** @type {Tokenizer} */\n\n function tokenizeRowEnd(effects, ok, nok) {\n return start\n /** @type {State} */\n\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, prefixed, 'linePrefix')\n }\n /** @type {State} */\n\n function prefixed(code) {\n // Blank or interrupting line.\n if (\n self.parser.lazy[self.now().line] ||\n code === null ||\n markdownLineEnding(code)\n ) {\n return nok(code)\n }\n\n const tail = self.events[self.events.length - 1] // Indented code can interrupt delimiter and body rows.\n\n if (\n !self.parser.constructs.disable.null.includes('codeIndented') &&\n tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ) {\n return nok(code)\n }\n\n self._gfmTableDynamicInterruptHack = true\n return effects.check(\n self.parser.constructs.flow,\n function (code) {\n self._gfmTableDynamicInterruptHack = false\n return nok(code)\n },\n function (code) {\n self._gfmTableDynamicInterruptHack = false\n return ok(code)\n }\n )(code)\n }\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeNextPrefixedOrBlank(effects, ok, nok) {\n let size = 0\n return start\n /** @type {State} */\n\n function start(code) {\n // This is a check, so we don’t care about tokens, but we open a bogus one\n // so we’re valid.\n effects.enter('check') // EOL.\n\n effects.consume(code)\n return whitespace\n }\n /** @type {State} */\n\n function whitespace(code) {\n if (code === -1 || code === 32) {\n effects.consume(code)\n size++\n return size === 4 ? ok : whitespace\n } // EOF or whitespace\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n return ok(code)\n } // Anything else.\n\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Code} Code\n */\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEndingOrSpace,\n markdownLineEnding\n} from 'micromark-util-character'\nconst tasklistCheck = {\n tokenize: tokenizeTasklistCheck\n}\nexport const gfmTaskListItem = {\n text: {\n [91]: tasklistCheck\n }\n}\n/** @type {Tokenizer} */\n\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this\n return open\n /** @type {State} */\n\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null || // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem\n ) {\n return nok(code)\n }\n\n effects.enter('taskListCheck')\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n return inside\n }\n /** @type {State} */\n\n function inside(code) {\n // To match how GH works in comments, use `markdownSpace` (`[ \\t]`) instead\n // of `markdownLineEndingOrSpace` (`[ \\t\\r\\n]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked')\n effects.consume(code)\n effects.exit('taskListCheckValueUnchecked')\n return close\n }\n\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked')\n effects.consume(code)\n effects.exit('taskListCheckValueChecked')\n return close\n }\n\n return nok(code)\n }\n /** @type {State} */\n\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n effects.exit('taskListCheck')\n return effects.check(\n {\n tokenize: spaceThenNonSpace\n },\n ok,\n nok\n )\n }\n\n return nok(code)\n }\n}\n/** @type {Tokenizer} */\n\nfunction spaceThenNonSpace(effects, ok, nok) {\n const self = this\n return factorySpace(effects, after, 'whitespace')\n /** @type {State} */\n\n function after(code) {\n const tail = self.events[self.events.length - 1]\n return (\n // We either found spaces…\n ((tail && tail[1].type === 'whitespace') || // …or it was followed by a line ending, in which case, there has to be\n // non-whitespace after that line ending, because otherwise we’d get an\n // EOF as the content is closed with blank lines.\n markdownLineEnding(code)) &&\n code !== null\n ? ok(code)\n : nok(code)\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Support GFM or markdown on github.com.\n *\n * @param {Options} [options]\n * @returns {Extension}\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral,\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable,\n gfmTaskListItem\n ])\n}\n\n/**\n * Support to compile GFM to HTML.\n *\n * @param {HtmlOptions} [options]\n * @returns {HtmlExtension}\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml,\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml,\n gfmTableHtml,\n gfmTagfilterHtml,\n gfmTaskListItemHtml\n ])\n}\n","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","/**\n * @typedef Options\n * Configuration (optional).\n * @property {Test} [ignore]\n * `unist-util-is` test used to assert parents\n *\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Text} Text\n * @typedef {Content|Root} Node\n * @typedef {Exclude, Root>} Parent\n *\n * @typedef {import('unist-util-visit-parents').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n *\n * @typedef RegExpMatchObject\n * @property {number} index\n * @property {string} input\n * @property {[Root, ...Array, Text]} stack\n *\n * @typedef {string|RegExp} Find\n * @typedef {string|ReplaceFunction} Replace\n *\n * @typedef {[Find, Replace]} FindAndReplaceTuple\n * @typedef {Record} FindAndReplaceSchema\n * @typedef {Array} FindAndReplaceList\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * @typedef {Array} Pairs\n */\n\n/**\n * @callback ReplaceFunction\n * @param {...any} parameters\n * @returns {Array|PhrasingContent|string|false|undefined|null}\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param tree mdast tree\n * @param find Value to find and remove. When `string`, escaped and made into a global `RegExp`\n * @param [replace] Value to insert.\n * * When `string`, turned into a Text node.\n * * When `Function`, called with the results of calling `RegExp.exec` as\n * arguments, in which case it can return a single or a list of `Node`,\n * a `string` (which is wrapped in a `Text` node), or `false` to not replace\n * @param [options] Configuration.\n */\nexport const findAndReplace =\n /**\n * @type {(\n * ((tree: Node, find: Find, replace?: Replace, options?: Options) => Node) &\n * ((tree: Node, schema: FindAndReplaceSchema|FindAndReplaceList, options?: Options) => Node)\n * )}\n **/\n (\n /**\n * @param {Node} tree\n * @param {Find|FindAndReplaceSchema|FindAndReplaceList} find\n * @param {Replace|Options} [replace]\n * @param {Options} [options]\n */\n function (tree, find, replace, options) {\n /** @type {Options|undefined} */\n let settings\n /** @type {FindAndReplaceSchema|FindAndReplaceList} */\n let schema\n\n if (typeof find === 'string' || find instanceof RegExp) {\n // @ts-expect-error don’t expect options twice.\n schema = [[find, replace]]\n settings = options\n } else {\n schema = find\n // @ts-expect-error don’t expect replace twice.\n settings = replace\n }\n\n if (!settings) {\n settings = {}\n }\n\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(schema)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n return tree\n\n /** @type {import('unist-util-visit-parents/complex-types').BuildVisitor} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parent|undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = /** @type {Parent} */ (parents[index])\n\n if (\n ignored(\n parent,\n // @ts-expect-error mdast vs. unist parent.\n grandparent ? grandparent.children.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n // @ts-expect-error: stack is fine.\n return handler(node, parents)\n }\n }\n\n /**\n * @param {Text} node\n * @param {[Root, ...Array]} parents\n * @returns {VisitorResult}\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n // @ts-expect-error: TS is wrong, some of these children can be text.\n const index = parent.children.indexOf(node)\n let change = false\n /** @type {Array} */\n let nodes = []\n /** @type {number|undefined} */\n let position\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n if (value !== false) {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n }\n )\n\n/**\n * @param {FindAndReplaceSchema|FindAndReplaceList} schema\n * @returns {Pairs}\n */\nfunction toPairs(schema) {\n /** @type {Pairs} */\n const result = []\n\n if (typeof schema !== 'object') {\n throw new TypeError('Expected array or object as schema')\n }\n\n if (Array.isArray(schema)) {\n let index = -1\n\n while (++index < schema.length) {\n result.push([\n toExpression(schema[index][0]),\n toFunction(schema[index][1])\n ])\n }\n } else {\n /** @type {string} */\n let key\n\n for (key in schema) {\n if (own.call(schema, key)) {\n result.push([toExpression(key), toFunction(schema[key])])\n }\n }\n }\n\n return result\n}\n\n/**\n * @param {Find} find\n * @returns {RegExp}\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * @param {Replace} replace\n * @returns {ReplaceFunction}\n */\nfunction toFunction(replace) {\n return typeof replace === 'function' ? replace : () => replace\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Transform} FromMarkdownTransform\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown/lib/types.js').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction\n * @typedef {import('mdast-util-find-and-replace').RegExpMatchObject} RegExpMatchObject\n * @typedef {import('mdast-util-find-and-replace').PhrasingContent} PhrasingContent\n */\n\nimport {ccount} from 'ccount'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\n\nconst inConstruct = 'phrasing'\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/** @type {FromMarkdownExtension} */\nexport const gfmAutolinkLiteralFromMarkdown = {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n}\n\n/** @type {ToMarkdownExtension} */\nexport const gfmAutolinkLiteralToMarkdown = {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {character: ':', before: '[ps]', after: '\\\\/', inConstruct, notInConstruct}\n ]\n}\n\n/** @type {FromMarkdownHandle} */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = /** @type {Link} */ (this.stack[this.stack.length - 1])\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/g, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {PhrasingContent} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[_-\\d]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string|undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n /** @type {number} */\n let closingParenIndex\n /** @type {number} */\n let openingParens\n /** @type {number} */\n let closingParens\n /** @type {string|undefined} */\n let trail\n\n if (trailExec) {\n url = url.slice(0, trailExec.index)\n trail = trailExec[0]\n closingParenIndex = trail.indexOf(')')\n openingParens = ccount(url, '(')\n closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n (!email || code !== 47)\n )\n}\n","/**\n * @typedef {import('mdast').Association} Association\n */\n\nimport {decodeString} from 'micromark-util-decode-string'\n\n/**\n * The `label` of an association is the string value: character escapes and\n * references work, and casing is intact.\n * The `identifier` is used to match one association to another: controversially,\n * character escapes and references don’t work in this matching: `©` does\n * not match `©`, and `\\+` does not match `+`.\n * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\\nb`\n * matches `a b`.\n * So, we do prefer the label when figuring out how we’re going to serialize:\n * it has whitespace, casing, and we can ignore most useless character escapes\n * and all character references.\n *\n * @param {Association} node\n * @returns {string}\n */\nexport function association(node) {\n if (node.label || !node.identifier) {\n return node.label || ''\n }\n\n return decodeString(node.identifier)\n}\n","/**\n * @typedef {import('unist').Point} Point\n * @typedef {import('../types.js').TrackFields} TrackFields\n */\n\n/**\n * Functions to track output positions.\n * This info isn’t used yet but suchs functionality allows line wrapping,\n * and theoretically source maps (though, is there practical use in that?).\n *\n * @param {TrackFields} options_\n */\nexport function track(options_) {\n // Defaults are used to prevent crashes when older utilities somehow activate\n // this code.\n /* c8 ignore next 5 */\n const options = options_ || {}\n const now = options.now || {}\n let lineShift = options.lineShift || 0\n let line = now.line || 1\n let column = now.column || 1\n\n return {move, current, shift}\n\n /**\n * Get the current tracked info.\n *\n * @returns {{now: Point, lineShift: number}}\n */\n function current() {\n return {now: {line, column}, lineShift}\n }\n\n /**\n * Define an increased line shift (the typical indent for lines).\n *\n * @param {number} value\n */\n function shift(value) {\n lineShift += value\n }\n\n /**\n * Move past a string.\n *\n * @param {string} value\n * @returns {string}\n */\n function move(value = '') {\n const chunks = value.split(/\\r?\\n|\\r/g)\n const tail = chunks[chunks.length - 1]\n line += chunks.length - 1\n column =\n chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift\n return value\n }\n}\n","/**\n * @typedef {import('../types.js').Node} Node\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').Join} Join\n * @typedef {import('../types.js').Context} Context\n * @typedef {import('../types.js').TrackFields} TrackFields\n */\n\nimport {track} from './track.js'\n\n/**\n * @param {Parent} parent\n * @param {Context} context\n * @param {TrackFields} safeOptions\n * @returns {string}\n */\nexport function containerFlow(parent, context, safeOptions) {\n const indexStack = context.indexStack\n const children = parent.children || []\n const tracker = track(safeOptions)\n /** @type {Array} */\n const results = []\n let index = -1\n\n indexStack.push(-1)\n\n while (++index < children.length) {\n const child = children[index]\n\n indexStack[indexStack.length - 1] = index\n\n results.push(\n tracker.move(\n context.handle(child, parent, context, {\n before: '\\n',\n after: '\\n',\n ...tracker.current()\n })\n )\n )\n\n if (child.type !== 'list') {\n context.bulletLastUsed = undefined\n }\n\n if (index < children.length - 1) {\n results.push(tracker.move(between(child, children[index + 1])))\n }\n }\n\n indexStack.pop()\n\n return results.join('')\n\n /**\n * @param {Node} left\n * @param {Node} right\n * @returns {string}\n */\n function between(left, right) {\n let index = context.join.length\n\n while (index--) {\n const result = context.join[index](left, right, parent, context)\n\n if (result === true || result === 1) {\n break\n }\n\n if (typeof result === 'number') {\n return '\\n'.repeat(1 + result)\n }\n\n if (result === false) {\n return '\\n\\n\\n\\n'\n }\n }\n\n return '\\n\\n'\n }\n}\n","/**\n * @callback Map\n * @param {string} value\n * @param {number} line\n * @param {boolean} blank\n * @returns {string}\n */\n\nconst eol = /\\r?\\n|\\r/g\n\n/**\n * @param {string} value\n * @param {Map} map\n * @returns {string}\n */\nexport function indentLines(value, map) {\n /** @type {Array} */\n const result = []\n let start = 0\n let line = 0\n /** @type {RegExpExecArray|null} */\n let match\n\n while ((match = eol.exec(value))) {\n one(value.slice(start, match.index))\n result.push(match[0])\n start = match.index + match[0].length\n line++\n }\n\n one(value.slice(start))\n\n return result.join('')\n\n /**\n * @param {string} value\n */\n function one(value) {\n result.push(map(value, line, !value))\n }\n}\n","/**\n * @typedef {import('../types.js').Unsafe} Unsafe\n */\n\n/**\n * @param {Unsafe} pattern\n * @returns {RegExp}\n */\nexport function patternCompile(pattern) {\n if (!pattern._compiled) {\n const before =\n (pattern.atBreak ? '[\\\\r\\\\n][\\\\t ]*' : '') +\n (pattern.before ? '(?:' + pattern.before + ')' : '')\n\n pattern._compiled = new RegExp(\n (before ? '(' + before + ')' : '') +\n (/[|\\\\{}()[\\]^$+*?.-]/.test(pattern.character) ? '\\\\' : '') +\n pattern.character +\n (pattern.after ? '(?:' + pattern.after + ')' : ''),\n 'g'\n )\n }\n\n return pattern._compiled\n}\n","/**\n * @typedef {import('../types.js').Unsafe} Unsafe\n */\n\n/**\n * @param {Array} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (!list) {\n return none\n }\n\n if (typeof list === 'string') {\n list = [list]\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n","/**\n * @typedef {import('../types.js').Context} Context\n * @typedef {import('../types.js').SafeOptions} SafeOptions\n */\n\nimport {patternCompile} from './pattern-compile.js'\nimport {patternInScope} from './pattern-in-scope.js'\n\n/**\n * @param {Context} context\n * @param {string|null|undefined} input\n * @param {SafeOptions & {encode?: Array}} config\n * @returns {string}\n */\nexport function safe(context, input, config) {\n const value = (config.before || '') + (input || '') + (config.after || '')\n /** @type {Array} */\n const positions = []\n /** @type {Array} */\n const result = []\n /** @type {Record} */\n const infos = {}\n let index = -1\n\n while (++index < context.unsafe.length) {\n const pattern = context.unsafe[index]\n\n if (!patternInScope(context.stack, pattern)) {\n continue\n }\n\n const expression = patternCompile(pattern)\n /** @type {RegExpExecArray|null} */\n let match\n\n while ((match = expression.exec(value))) {\n const before = 'before' in pattern || Boolean(pattern.atBreak)\n const after = 'after' in pattern\n const position = match.index + (before ? match[1].length : 0)\n\n if (positions.includes(position)) {\n if (infos[position].before && !before) {\n infos[position].before = false\n }\n\n if (infos[position].after && !after) {\n infos[position].after = false\n }\n } else {\n positions.push(position)\n infos[position] = {before, after}\n }\n }\n }\n\n positions.sort(numerical)\n\n let start = config.before ? config.before.length : 0\n const end = value.length - (config.after ? config.after.length : 0)\n index = -1\n\n while (++index < positions.length) {\n const position = positions[index]\n\n // Character before or after matched:\n if (position < start || position >= end) {\n continue\n }\n\n // If this character is supposed to be escaped because it has a condition on\n // the next character, and the next character is definitly being escaped,\n // then skip this escape.\n if (\n (position + 1 < end &&\n positions[index + 1] === position + 1 &&\n infos[position].after &&\n !infos[position + 1].before &&\n !infos[position + 1].after) ||\n (positions[index - 1] === position - 1 &&\n infos[position].before &&\n !infos[position - 1].before &&\n !infos[position - 1].after)\n ) {\n continue\n }\n\n if (start !== position) {\n // If we have to use a character reference, an ampersand would be more\n // correct, but as backslashes only care about punctuation, either will\n // do the trick\n result.push(escapeBackslashes(value.slice(start, position), '\\\\'))\n }\n\n start = position\n\n if (\n /[!-/:-@[-`{-~]/.test(value.charAt(position)) &&\n (!config.encode || !config.encode.includes(value.charAt(position)))\n ) {\n // Character escape.\n result.push('\\\\')\n } else {\n // Character reference.\n result.push(\n '&#x' + value.charCodeAt(position).toString(16).toUpperCase() + ';'\n )\n start++\n }\n }\n\n result.push(escapeBackslashes(value.slice(start, end), config.after))\n\n return result.join('')\n}\n\n/**\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction numerical(a, b) {\n return a - b\n}\n\n/**\n * @param {string} value\n * @param {string} after\n * @returns {string}\n */\nfunction escapeBackslashes(value, after) {\n const expression = /\\\\(?=[!-/:-@[-`{-~])/g\n /** @type {Array} */\n const positions = []\n /** @type {Array} */\n const results = []\n const whole = value + after\n let index = -1\n let start = 0\n /** @type {RegExpExecArray|null} */\n let match\n\n while ((match = expression.exec(whole))) {\n positions.push(match.index)\n }\n\n while (++index < positions.length) {\n if (start !== positions[index]) {\n results.push(value.slice(start, positions[index]))\n }\n\n results.push('\\\\')\n start = positions[index]\n }\n\n results.push(value.slice(start))\n\n return results.join('')\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Map} Map\n */\n\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {association} from 'mdast-util-to-markdown/lib/util/association.js'\nimport {containerFlow} from 'mdast-util-to-markdown/lib/util/container-flow.js'\nimport {indentLines} from 'mdast-util-to-markdown/lib/util/indent-lines.js'\nimport {safe} from 'mdast-util-to-markdown/lib/util/safe.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\n/**\n * @returns {FromMarkdownExtension}\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteDefinition: enterFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteCallString: enterFootnoteCallString\n },\n exit: {\n gfmFootnoteDefinition: exitFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteCallString: exitFootnoteCallString\n }\n }\n\n /** @type {FromMarkdownHandle} */\n function enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n }\n\n /** @type {FromMarkdownHandle} */\n function enterFootnoteDefinitionLabelString() {\n this.buffer()\n }\n\n /** @type {FromMarkdownHandle} */\n function exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = /** @type {FootnoteDefinition} */ (\n this.stack[this.stack.length - 1]\n )\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /** @type {FromMarkdownHandle} */\n function exitFootnoteDefinition(token) {\n this.exit(token)\n }\n\n /** @type {FromMarkdownHandle} */\n function enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n }\n\n /** @type {FromMarkdownHandle} */\n function enterFootnoteCallString() {\n this.buffer()\n }\n\n /** @type {FromMarkdownHandle} */\n function exitFootnoteCallString(token) {\n const label = this.resume()\n const node = /** @type {FootnoteDefinition} */ (\n this.stack[this.stack.length - 1]\n )\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /** @type {FromMarkdownHandle} */\n function exitFootnoteCall(token) {\n this.exit(token)\n }\n}\n\n/**\n * @returns {ToMarkdownExtension}\n */\nexport function gfmFootnoteToMarkdown() {\n footnoteReference.peek = footnoteReferencePeek\n\n return {\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['phrasing', 'label', 'reference']}],\n handlers: {footnoteDefinition, footnoteReference}\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\n function footnoteReference(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n let value = tracker.move('[^')\n const exit = context.enter('footnoteReference')\n const subexit = context.enter('reference')\n value += tracker.move(\n safe(context, association(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n }\n\n /** @type {ToMarkdownHandle} */\n function footnoteReferencePeek() {\n return '['\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n let value = tracker.move('[^')\n const exit = context.enter('footnoteDefinition')\n const subexit = context.enter('label')\n value += tracker.move(\n safe(context, association(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n value += tracker.move(\n ']:' + (node.children && node.children.length > 0 ? ' ' : '')\n )\n tracker.shift(4)\n value += tracker.move(\n indentLines(containerFlow(node, context, tracker.current()), map)\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' ') + line\n }\n\n return line\n }\n }\n}\n","/**\n * @typedef {import('../types.js').Node} Node\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').SafeOptions} SafeOptions\n * @typedef {import('../types.js').Context} Context\n */\n\nimport {track} from './track.js'\n\n/**\n * @param {Parent} parent\n * @param {Context} context\n * @param {SafeOptions} safeOptions\n * @returns {string}\n */\nexport function containerPhrasing(parent, context, safeOptions) {\n const indexStack = context.indexStack\n const children = parent.children || []\n /** @type {Array} */\n const results = []\n let index = -1\n let before = safeOptions.before\n\n indexStack.push(-1)\n let tracker = track(safeOptions)\n\n while (++index < children.length) {\n const child = children[index]\n /** @type {string} */\n let after\n\n indexStack[indexStack.length - 1] = index\n\n if (index + 1 < children.length) {\n // @ts-expect-error: hush, it’s actually a `zwitch`.\n let handle = context.handle.handlers[children[index + 1].type]\n if (handle && handle.peek) handle = handle.peek\n after = handle\n ? handle(children[index + 1], parent, context, {\n before: '',\n after: '',\n ...tracker.current()\n }).charAt(0)\n : ''\n } else {\n after = safeOptions.after\n }\n\n // In some cases, html (text) can be found in phrasing right after an eol.\n // When we’d serialize that, in most cases that would be seen as html\n // (flow).\n // As we can’t escape or so to prevent it from happening, we take a somewhat\n // reasonable approach: replace that eol with a space.\n // See: \n if (\n results.length > 0 &&\n (before === '\\r' || before === '\\n') &&\n child.type === 'html'\n ) {\n results[results.length - 1] = results[results.length - 1].replace(\n /(\\r?\\n|\\r)$/,\n ' '\n )\n before = ' '\n\n // To do: does this work to reset tracker?\n tracker = track(safeOptions)\n tracker.move(results.join(''))\n }\n\n results.push(\n tracker.move(\n context.handle(child, parent, context, {\n ...tracker.current(),\n before,\n after\n })\n )\n )\n\n before = results[results.length - 1].slice(-1)\n }\n\n indexStack.pop()\n\n return results.join('')\n}\n","/**\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {containerPhrasing} from 'mdast-util-to-markdown/lib/util/container-phrasing.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\n/** @type {FromMarkdownExtension} */\nexport const gfmStrikethroughFromMarkdown = {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n}\n\n/** @type {ToMarkdownExtension} */\nexport const gfmStrikethroughToMarkdown = {\n unsafe: [{character: '~', inConstruct: 'phrasing'}],\n handlers: {delete: handleDelete}\n}\n\nhandleDelete.peek = peekDelete\n\n/** @type {FromMarkdownHandle} */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n const exit = context.enter('emphasis')\n let value = tracker.move('~~')\n value += containerPhrasing(node, context, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../types.js').Handle} Handle\n */\n\nimport {patternCompile} from '../util/pattern-compile.js'\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @type {Handle}\n * @param {InlineCode} node\n */\nexport function inlineCode(node, _, context) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < context.unsafe.length) {\n const pattern = context.unsafe[index]\n const expression = patternCompile(pattern)\n /** @type {RegExpExecArray|null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @type {Handle}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n","/**\n * @typedef Options\n * Configuration (optional).\n * @property {string|null|Array} [align]\n * One style for all columns, or styles for their respective columns.\n * Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).\n * Other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left.\n * *Only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean} [padding=true]\n * Whether to add a space of padding between delimiters and cells.\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {boolean} [delimiterStart=true]\n * Whether to begin each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean} [delimiterEnd=true]\n * Whether to end each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean} [alignDelimiters=true]\n * Whether to align the delimiters.\n * By default, they are aligned:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {(value: string) => number} [stringLength]\n * Function to detect the length of table cell content.\n * This is used when aligning the delimiters (`|`) between table cells.\n * Full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source.\n * To fix this, you can pass this function, which receives the cell content\n * and returns its “visible” size.\n * Note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n */\n\n/**\n * @typedef {Options} MarkdownTableOptions\n * @todo\n * Remove next major.\n */\n\n/**\n * Generate a markdown ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) table..\n *\n * @param {Array>} table\n * Table data (matrix of strings).\n * @param {Options} [options]\n * Configuration (optional).\n * @returns {string}\n */\nexport function markdownTable(table, options = {}) {\n const align = (options.align || []).concat()\n const stringLength = options.stringLength || defaultStringLength\n /** @type {Array} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array>} Cells per row. */\n const cellMatrix = []\n /** @type {Array>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (options.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n options.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (options.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (options.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (options.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n options.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(options.alignDelimiters === false && cell === '') &&\n (options.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (options.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (options.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (options.padding !== false) {\n line.push(' ')\n }\n\n if (\n options.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n options.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string|null|undefined} [value]\n * @returns {string}\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string} value\n * @returns {number}\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * @param {string|null|undefined} value\n * @returns {number}\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n","/**\n * @typedef {import('mdast').AlignType} AlignType\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('markdown-table').MarkdownTableOptions} MarkdownTableOptions\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Context} ToMarkdownContext\n * @typedef {import('mdast-util-to-markdown').SafeOptions} SafeOptions\n *\n * @typedef Options\n * @property {boolean} [tableCellPadding=true]\n * @property {boolean} [tablePipeAlign=true]\n * @property {MarkdownTableOptions['stringLength']} [stringLength]\n */\n\nimport {containerPhrasing} from 'mdast-util-to-markdown/lib/util/container-phrasing.js'\nimport {inlineCode} from 'mdast-util-to-markdown/lib/handle/inline-code.js'\nimport {markdownTable} from 'markdown-table'\n\n/** @type {FromMarkdownExtension} */\nexport const gfmTableFromMarkdown = {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n}\n\n/** @type {FromMarkdownHandle} */\nfunction enterTable(token) {\n /** @type {Array<'left'|'right'|'center'|'none'>} */\n // @ts-expect-error: `align` is custom.\n const align = token._align\n this.enter(\n {\n type: 'table',\n align: align.map((d) => (d === 'none' ? null : d)),\n children: []\n },\n token\n )\n this.setData('inTable', true)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitTable(token) {\n this.exit(token)\n this.setData('inTable')\n}\n\n/** @type {FromMarkdownHandle} */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exit(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownHandle} */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/** @type {FromMarkdownHandle} */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.getData('inTable')) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = /** @type {InlineCode} */ (this.stack[this.stack.length - 1])\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * @param {Options} [options]\n * @returns {ToMarkdownExtension}\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n table: handleTable,\n tableRow: handleTableRow,\n tableCell: handleTableCell,\n inlineCode: inlineCodeWithTable\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, context, safeOptions) {\n return serializeData(\n handleTableAsData(node, context, safeOptions),\n // @ts-expect-error: fixed in `markdown-table@3.0.1`.\n node.align\n )\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, context, safeOptions) {\n const row = handleTableRowAsData(node, context, safeOptions)\n // `markdown-table` will always add an align row\n const value = serializeData([row])\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, context, safeOptions) {\n const exit = context.enter('tableCell')\n const subexit = context.enter('phrasing')\n const value = containerPhrasing(node, context, {\n ...safeOptions,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array>} matrix\n * @param {Array} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n alignDelimiters,\n padding,\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {ToMarkdownContext} context\n * @param {SafeOptions} safeOptions\n */\n function handleTableAsData(node, context, safeOptions) {\n const children = node.children\n let index = -1\n /** @type {Array>} */\n const result = []\n const subexit = context.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(\n children[index],\n context,\n safeOptions\n )\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {ToMarkdownContext} context\n * @param {SafeOptions} safeOptions\n */\n function handleTableRowAsData(node, context, safeOptions) {\n const children = node.children\n let index = -1\n /** @type {Array} */\n const result = []\n const subexit = context.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(\n children[index],\n node,\n context,\n safeOptions\n )\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, context) {\n let value = inlineCode(node, parent, context)\n\n if (context.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').List} List\n * @typedef {import('../util/indent-lines.js').Map} Map\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').Handle} Handle\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\nimport {containerFlow} from '../util/container-flow.js'\nimport {indentLines} from '../util/indent-lines.js'\nimport {track} from '../util/track.js'\n\n/**\n * @type {Handle}\n * @param {ListItem} node\n */\nexport function listItem(node, parent, context, safeOptions) {\n const listItemIndent = checkListItemIndent(context)\n let bullet = context.bulletCurrent || checkBullet(context)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (context.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = track(safeOptions)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = context.enter('listItem')\n const value = indentLines(\n containerFlow(node, context, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n","/**\n * @typedef {import('../types.js').Context} Context\n * @typedef {import('../types.js').Options} Options\n */\n\n/**\n * @param {Context} context\n * @returns {Exclude}\n */\nexport function checkListItemIndent(context) {\n const style = context.options.listItemIndent || 'tab'\n\n // To do: remove in a major.\n // @ts-expect-error: deprecated.\n if (style === 1 || style === '1') {\n return 'one'\n }\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n","/**\n * @typedef {import('../types.js').Context} Context\n * @typedef {import('../types.js').Options} Options\n */\n\n/**\n * @param {Context} context\n * @returns {Exclude}\n */\nexport function checkBullet(context) {\n const marker = context.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {Extract} Parent\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').BlockContent} BlockContent\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {listItem} from 'mdast-util-to-markdown/lib/handle/list-item.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\n/** @type {FromMarkdownExtension} */\nexport const gfmTaskListItemFromMarkdown = {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n}\n\n/** @type {ToMarkdownExtension} */\nexport const gfmTaskListItemToMarkdown = {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitCheck(token) {\n const node = /** @type {ListItem} */ (this.stack[this.stack.length - 2])\n // We’re always in a paragraph, in a list item.\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/** @type {FromMarkdownHandle} */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = /** @type {Parent} */ (this.stack[this.stack.length - 2])\n const node = /** @type {Paragraph} */ (this.stack[this.stack.length - 1])\n const siblings = parent.children\n const head = node.children[0]\n let index = -1\n /** @type {Paragraph|undefined} */\n let firstParaghraph\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean' &&\n head &&\n head.type === 'text'\n ) {\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, context, safeOptions) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = track(safeOptions)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = listItem(node, parent, context, {\n ...safeOptions,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n","/**\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n *\n * @typedef {import('mdast-util-gfm-table').Options} Options\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * @returns {Array}\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown,\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown,\n gfmTableFromMarkdown,\n gfmTaskListItemFromMarkdown\n ]\n}\n\n/**\n * @param {Options} [options]\n * @returns {ToMarkdownExtension}\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown,\n gfmFootnoteToMarkdown(),\n gfmStrikethroughToMarkdown,\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown\n ]\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('micromark-extension-gfm').Options & import('mdast-util-gfm').Options} Options\n */\n\nimport {gfm} from 'micromark-extension-gfm'\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\n\n/**\n * Plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).\n *\n * @type {import('unified').Plugin<[Options?]|void[], Root>}\n */\nexport default function remarkGfm(options = {}) {\n const data = this.data()\n\n add('micromarkExtensions', gfm(options))\n add('fromMarkdownExtensions', gfmFromMarkdown())\n add('toMarkdownExtensions', gfmToMarkdown(options))\n\n /**\n * @param {string} field\n * @param {unknown} value\n */\n function add(field, value) {\n const list = /** @type {unknown[]} */ (\n // Other extensions\n /* c8 ignore next 2 */\n data[field] ? data[field] : (data[field] = [])\n )\n\n list.push(value)\n }\n}\n","var own = {}.hasOwnProperty\n\n/**\n * Check if `node` has a set `name` property.\n *\n * @param {unknown} node\n * @param {string} name\n * @returns {boolean}\n */\nexport function hasProperty(node, name) {\n /** @type {unknown} */\n var value =\n name &&\n node &&\n typeof node === 'object' &&\n // @ts-ignore Looks like a node.\n node.type === 'element' &&\n // @ts-ignore Looks like an element.\n node.properties &&\n // @ts-ignore Looks like an element.\n own.call(node.properties, name) &&\n // @ts-ignore Looks like an element.\n node.properties[name]\n\n return value !== null && value !== undefined && value !== false\n}\n","/**\n * @typedef {import('hast').Parent} Parent\n * @typedef {import('hast').Root} Root\n * @typedef {Root|Parent['children'][number]} Node\n */\n\n/**\n * Rank of a heading: H1 -> 1, H2 -> 2, etc.\n *\n * @param {Node} node\n * @returns {number|null}\n */\nexport function headingRank(node) {\n var name =\n (node && node.type === 'element' && node.tagName.toLowerCase()) || ''\n var code =\n name.length === 2 && name.charCodeAt(0) === 104 /* `h` */\n ? name.charCodeAt(1)\n : 0\n return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null\n}\n","/**\n * @fileoverview\n * Get the plain-text value of a hast node.\n * @longdescription\n * ## Use\n *\n * ```js\n * import {h} from 'hastscript'\n * import {toString} from 'hast-util-to-string'\n *\n * toString(h('p', 'Alpha'))\n * //=> 'Alpha'\n * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))\n * //=> 'Bold and italic.'\n * ```\n *\n * ## API\n *\n * ### `toString(node)`\n *\n * Transform a node to a string.\n */\n\n/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Element} Element\n * @typedef {Root|Root['children'][number]} Node\n */\n\n/**\n * Get the plain-text value of a hast node.\n *\n * @param {Node} node\n * @returns {string}\n */\nexport function toString(node) {\n // “The concatenation of data of all the Text node descendants of the context\n // object, in tree order.”\n if ('children' in node) {\n return all(node)\n }\n\n // “Context object’s data.”\n return 'value' in node ? node.value : ''\n}\n\n/**\n * @param {Node} node\n * @returns {string}\n */\nfunction one(node) {\n if (node.type === 'text') {\n return node.value\n }\n\n return 'children' in node ? all(node) : ''\n}\n\n/**\n * @param {Root|Element} node\n * @returns {string}\n */\nfunction all(node) {\n let index = -1\n /** @type {string[]} */\n const result = []\n\n while (++index < node.children.length) {\n result[index] = one(node.children[index])\n }\n\n return result.join('')\n}\n","/**\n * @typedef {import('hast').Root} Root\n */\n\nimport Slugger from 'github-slugger'\nimport {hasProperty} from 'hast-util-has-property'\nimport {headingRank} from 'hast-util-heading-rank'\nimport {toString} from 'hast-util-to-string'\nimport {visit} from 'unist-util-visit'\n\nconst slugs = new Slugger()\n\n/**\n * Plugin to add `id`s to headings.\n *\n * @type {import('unified').Plugin, Root>}\n */\nexport default function rehypeSlug() {\n return (tree) => {\n slugs.reset()\n\n visit(tree, 'element', (node) => {\n if (headingRank(node) && node.properties && !hasProperty(node, 'id')) {\n node.properties.id = slugs.slug(toString(node))\n }\n })\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('hast').Element} Element\n *\n * @typedef {string} TagName\n * @typedef {null|undefined|TagName|TestFunctionAnything|Array.} Test\n */\n\n/**\n * @template {Element} T\n * @typedef {null|undefined|T['tagName']|TestFunctionPredicate|Array.>} PredicateTest\n */\n\n/**\n * Check if an element passes a test\n *\n * @callback TestFunctionAnything\n * @param {Element} element\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean|void}\n */\n\n/**\n * Check if an element passes a certain node test\n *\n * @template {Element} X\n * @callback TestFunctionPredicate\n * @param {Element} element\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {element is X}\n */\n\n/**\n * Check if a node is an element and passes a certain node test\n *\n * @callback AssertAnything\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {boolean}\n */\n\n/**\n * Check if a node is an element and passes a certain node test\n *\n * @template {Element} Y\n * @callback AssertPredicate\n * @param {unknown} [node]\n * @param {number|null|undefined} [index]\n * @param {Parent|null|undefined} [parent]\n * @returns {node is Y}\n */\n\n// Check if `node` is an `element` and whether it passes the given test.\nexport const isElement =\n /**\n * Check if a node is an element and passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @type {(\n * (() => false) &\n * ((node: unknown, test?: PredicateTest, index?: number, parent?: Parent, context?: unknown) => node is T) &\n * ((node: unknown, test: Test, index?: number, parent?: Parent, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * Check if a node passes a test.\n * When a `parent` node is known the `index` of node should also be given.\n *\n * @param {unknown} [node] Node to check\n * @param {Test} [test] When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `array`, checks any one of the subtests pass.\n * @param {number} [index] Position of `node` in `parent`\n * @param {Parent} [parent] Parent of `node`\n * @param {unknown} [context] Context object to invoke `test` with\n * @returns {boolean} Whether test passed and `node` is an `Element` (object with `type` set to `element` and `tagName` set to a non-empty string).\n */\n // eslint-disable-next-line max-params\n function (node, test, index, parent, context) {\n const check = convertElement(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index for child node')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!parent.type || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n // @ts-expect-error Looks like a node.\n if (!node || !node.type || typeof node.type !== 'string') {\n return false\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n return check.call(context, node, index, parent)\n }\n )\n\nexport const convertElement =\n /**\n * @type {(\n * ((test: T['tagName']|TestFunctionPredicate) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * Generate an assertion from a check.\n * @param {Test} [test]\n * When nullish, checks if `node` is a `Node`.\n * When `string`, works like passing `function (node) {return node.type === test}`.\n * When `function` checks if function passed the node is true.\n * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * When `array`, checks any one of the subtests pass.\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return element\n }\n\n if (typeof test === 'string') {\n return tagNameFactory(test)\n }\n\n if (typeof test === 'object') {\n return anyFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or array as test')\n }\n )\n\n/**\n * @param {Array.} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array.} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convertElement(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {unknown[]} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) {\n return true\n }\n }\n\n return false\n }\n}\n\n/**\n * Utility to convert a string into a function which checks a given node’s tag\n * name for said string.\n *\n * @param {TagName} check\n * @returns {AssertAnything}\n */\nfunction tagNameFactory(check) {\n return tagName\n\n /**\n * @param {unknown} node\n * @returns {boolean}\n */\n function tagName(node) {\n return element(node) && node.tagName === check\n }\n}\n\n/**\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {unknown} node\n * @param {Array.} parameters\n * @returns {boolean}\n */\n function assertion(node, ...parameters) {\n // @ts-expect-error: fine.\n return element(node) && Boolean(check.call(this, node, ...parameters))\n }\n}\n\n/**\n * Utility to return true if this is an element.\n * @param {unknown} node\n * @returns {node is Element}\n */\nfunction element(node) {\n return Boolean(\n node &&\n typeof node === 'object' &&\n // @ts-expect-error Looks like a node.\n node.type === 'element' &&\n // @ts-expect-error Looks like an element.\n typeof node.tagName === 'string'\n )\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Parent} Parent\n * @typedef {import('hast').Element} Element\n * @typedef {Element['children'][number]} ElementChild\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast-util-is-element').Test} Test\n *\n * @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior\n *\n * @callback Build\n * @param {Element} node\n * @returns {ElementChild|ElementChild[]}\n *\n * @typedef Options\n * Configuration.\n * @property {Behavior} [behavior='prepend']\n * How to create links.\n * @property {Behavior} [behaviour]\n * Please use `behavior` instead\n * @property {Properties} [properties]\n * Extra properties to set on the link when injecting.\n * Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or\n * `'append'`.\n * @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}]\n * hast nodes to insert in the link.\n * @property {ElementChild|ElementChild[]|Build} [group]\n * hast node to wrap the heading and link with, if `behavior` is `'before'` or\n * `'after'`.\n * There is no default.\n * @property {Test} [test]\n * Test to define which heading elements are linked.\n * Any test that can be given to `hast-util-is-element` is supported.\n * The default (no test) is to link all headings.\n * Can be used to link only h1-h3, or for example all except h1.\n */\n\nimport extend from 'extend'\nimport {hasProperty} from 'hast-util-has-property'\nimport {headingRank} from 'hast-util-heading-rank'\nimport {convertElement} from 'hast-util-is-element'\nimport {visit, SKIP} from 'unist-util-visit'\n\n/** @type {Element} */\nconst contentDefaults = {\n type: 'element',\n tagName: 'span',\n properties: {className: ['icon', 'icon-link']},\n children: []\n}\n\n/**\n * Plugin to automatically add links to headings (h1-h6).\n *\n * @type {import('unified').Plugin<[Options?]|void[], Root>}\n */\nexport default function rehypeAutolinkHeadings(options = {}) {\n let props = options.properties\n const behavior = options.behaviour || options.behavior || 'prepend'\n const content = options.content || contentDefaults\n const group = options.group\n const is = convertElement(options.test)\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n let method\n\n if (behavior === 'wrap') {\n method = wrap\n } else if (behavior === 'before' || behavior === 'after') {\n method = around\n } else {\n if (!props) {\n props = {ariaHidden: 'true', tabIndex: -1}\n }\n\n method = inject\n }\n\n return (tree) => {\n visit(tree, 'element', (node, index, parent) => {\n if (\n headingRank(node) &&\n hasProperty(node, 'id') &&\n is(node, index, parent)\n ) {\n return method(node, index, parent)\n }\n })\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function inject(node) {\n node.children[behavior === 'prepend' ? 'unshift' : 'push'](\n create(node, extend(true, {}, props), toChildren(content, node))\n )\n\n return [SKIP]\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function around(node, index, parent) {\n // Uncommon.\n /* c8 ignore next */\n if (typeof index !== 'number' || !parent) return\n\n const link = create(\n node,\n extend(true, {}, props),\n toChildren(content, node)\n )\n let nodes = behavior === 'before' ? [link, node] : [node, link]\n\n if (group) {\n const grouping = toNode(group, node)\n\n if (grouping && !Array.isArray(grouping) && grouping.type === 'element') {\n grouping.children = nodes\n nodes = [grouping]\n }\n }\n\n parent.children.splice(index, 1, ...nodes)\n\n return [SKIP, index + nodes.length]\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function wrap(node) {\n node.children = [create(node, extend(true, {}, props), node.children)]\n return [SKIP]\n }\n\n /**\n * @param {ElementChild|ElementChild[]|Build} value\n * @param {Element} node\n * @returns {ElementChild[]}\n */\n function toChildren(value, node) {\n const result = toNode(value, node)\n return Array.isArray(result) ? result : [result]\n }\n\n /**\n * @param {ElementChild|ElementChild[]|Build} value\n * @param {Element} node\n * @returns {ElementChild|ElementChild[]}\n */\n function toNode(value, node) {\n if (typeof value === 'function') return value(node)\n return extend(true, Array.isArray(value) ? [] : {}, value)\n }\n\n /**\n * @param {Element} node\n * @param {Properties} props\n * @param {ElementChild[]} children\n * @returns {Element}\n */\n function create(node, props, children) {\n return {\n type: 'element',\n tagName: 'a',\n properties: Object.assign({}, props, {\n // Fix hast types and make them required.\n /* c8 ignore next */\n href: '#' + (node.properties || {}).id\n }),\n children\n }\n }\n}\n","/**\n * @typedef {import('./core.js').HChild} Child Acceptable child value\n * @typedef {import('./core.js').HProperties} Properties Acceptable properties value.\n *\n * @typedef {import('./jsx-classic').Element} s.JSX.Element\n * @typedef {import('./jsx-classic').IntrinsicAttributes} s.JSX.IntrinsicAttributes\n * @typedef {import('./jsx-classic').IntrinsicElements} s.JSX.IntrinsicElements\n * @typedef {import('./jsx-classic').ElementChildrenAttribute} s.JSX.ElementChildrenAttribute\n */\n\nimport {svg} from 'property-information'\nimport {core} from './core.js'\nimport {svgCaseSensitiveTagNames} from './svg-case-sensitive-tag-names.js'\n\nexport const s = core(svg, 'g', svgCaseSensitiveTagNames)\n","export const svgCaseSensitiveTagNames = [\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'glyphRef',\n 'linearGradient',\n 'radialGradient',\n 'solidColor',\n 'textArea',\n 'textPath'\n]\n","/**\n * Map of web namespaces.\n *\n * @type {Record}\n */\nexport const webNamespaces = {\n html: 'http://www.w3.org/1999/xhtml',\n mathml: 'http://www.w3.org/1998/Math/MathML',\n svg: 'http://www.w3.org/2000/svg',\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace',\n xmlns: 'http://www.w3.org/2000/xmlns/'\n}\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {import('hast').Parent} Parent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').DocType} Doctype\n * @typedef {Parent['children'][number]} Child\n * @typedef {Element['children'][number]} ElementChild\n * @typedef {Child|Root} Node\n * @typedef {import('parse5').Document} P5Document\n * @typedef {import('parse5').DocumentType} P5Doctype\n * @typedef {import('parse5').CommentNode} P5Comment\n * @typedef {import('parse5').TextNode} P5Text\n * @typedef {import('parse5').Element} P5Element\n * @typedef {import('parse5').ElementLocation} P5ElementLocation\n * @typedef {import('parse5').Location} P5Location\n * @typedef {import('parse5').Attribute} P5Attribute\n * @typedef {import('parse5').Node} P5Node\n *\n * @typedef {'html'|'svg'} Space\n *\n * @callback Handler\n * @param {Context} ctx\n * @param {P5Node} node\n * @param {Array.} [children]\n * @returns {Node}\n *\n * @typedef Options\n * @property {Space} [space='html'] Whether the root of the tree is in the `'html'` or `'svg'` space. If an element in with the SVG namespace is found in `ast`, `fromParse5` automatically switches to the SVG space when entering the element, and switches back when leaving\n * @property {VFile} [file] `VFile`, used to add positional information to nodes. If given, the file should have the original HTML source as its contents\n * @property {boolean} [verbose=false] Whether to add extra positional information about starting tags, closing tags, and attributes to elements. Note: not used without `file`\n *\n * @typedef Context\n * @property {Schema} schema\n * @property {VFile|undefined} file\n * @property {boolean|undefined} verbose\n * @property {boolean} location\n */\n\nimport {h, s} from 'hastscript'\nimport {html, svg, find} from 'property-information'\nimport {location} from 'vfile-location'\nimport {webNamespaces} from 'web-namespaces'\n\nconst own = {}.hasOwnProperty\n\n// Handlers.\nconst map = {\n '#document': root,\n '#document-fragment': root,\n '#text': text,\n '#comment': comment,\n '#documentType': doctype\n}\n\n/**\n * Transform Parse5’s AST to a hast tree.\n *\n * @param {P5Node} ast\n * @param {Options|VFile} [options]\n */\nexport function fromParse5(ast, options = {}) {\n /** @type {Options} */\n let settings\n /** @type {VFile|undefined} */\n let file\n\n if (isFile(options)) {\n file = options\n settings = {}\n } else {\n file = options.file\n settings = options\n }\n\n return transform(\n {\n schema: settings.space === 'svg' ? svg : html,\n file,\n verbose: settings.verbose,\n location: false\n },\n ast\n )\n}\n\n/**\n * Transform children.\n *\n * @param {Context} ctx\n * @param {P5Node} ast\n * @returns {Node}\n */\nfunction transform(ctx, ast) {\n const schema = ctx.schema\n /** @type {Handler} */\n // @ts-expect-error: index is fine.\n const fn = own.call(map, ast.nodeName) ? map[ast.nodeName] : element\n /** @type {Array.|undefined} */\n let children\n\n // Element.\n if ('tagName' in ast) {\n ctx.schema = ast.namespaceURI === webNamespaces.svg ? svg : html\n }\n\n if ('childNodes' in ast) {\n children = nodes(ctx, ast.childNodes)\n }\n\n const result = fn(ctx, ast, children)\n\n if ('sourceCodeLocation' in ast && ast.sourceCodeLocation && ctx.file) {\n // @ts-expect-error It’s fine.\n const position = createLocation(ctx, result, ast.sourceCodeLocation)\n\n if (position) {\n ctx.location = true\n result.position = position\n }\n }\n\n ctx.schema = schema\n\n return result\n}\n\n/**\n * Transform children.\n *\n * @param {Context} ctx\n * @param {Array.} children\n * @returns {Array.}\n */\nfunction nodes(ctx, children) {\n let index = -1\n /** @type {Array.} */\n const result = []\n\n while (++index < children.length) {\n // @ts-expect-error Assume no roots in children.\n result[index] = transform(ctx, children[index])\n }\n\n return result\n}\n\n/**\n * Transform a document.\n * Stores `ast.quirksMode` in `node.data.quirksMode`.\n *\n * @type {Handler}\n * @param {P5Document} ast\n * @param {Array.} children\n * @returns {Root}\n */\nfunction root(ctx, ast, children) {\n /** @type {Root} */\n const result = {\n type: 'root',\n children,\n data: {quirksMode: ast.mode === 'quirks' || ast.mode === 'limited-quirks'}\n }\n\n if (ctx.file && ctx.location) {\n const doc = String(ctx.file)\n const loc = location(doc)\n result.position = {\n start: loc.toPoint(0),\n end: loc.toPoint(doc.length)\n }\n }\n\n return result\n}\n\n/**\n * Transform a doctype.\n *\n * @type {Handler}\n * @returns {Doctype}\n */\nfunction doctype() {\n // @ts-expect-error Types are out of date.\n return {type: 'doctype'}\n}\n\n/**\n * Transform a text.\n *\n * @type {Handler}\n * @param {P5Text} ast\n * @returns {Text}\n */\nfunction text(_, ast) {\n return {type: 'text', value: ast.value}\n}\n\n/**\n * Transform a comment.\n *\n * @type {Handler}\n * @param {P5Comment} ast\n * @returns {Comment}\n */\nfunction comment(_, ast) {\n return {type: 'comment', value: ast.data}\n}\n\n/**\n * Transform an element.\n *\n * @type {Handler}\n * @param {P5Element} ast\n * @param {Array.} children\n * @returns {Element}\n */\nfunction element(ctx, ast, children) {\n const fn = ctx.schema.space === 'svg' ? s : h\n let index = -1\n /** @type {Object.} */\n const props = {}\n\n while (++index < ast.attrs.length) {\n const attribute = ast.attrs[index]\n props[(attribute.prefix ? attribute.prefix + ':' : '') + attribute.name] =\n attribute.value\n }\n\n const result = fn(ast.tagName, props, children)\n\n if (result.tagName === 'template' && 'content' in ast) {\n const pos = ast.sourceCodeLocation\n const startTag = pos && pos.startTag && position(pos.startTag)\n const endTag = pos && pos.endTag && position(pos.endTag)\n\n /** @type {Root} */\n // @ts-expect-error Types are wrong.\n const content = transform(ctx, ast.content)\n\n if (startTag && endTag && ctx.file) {\n content.position = {start: startTag.end, end: endTag.start}\n }\n\n result.content = content\n }\n\n return result\n}\n\n/**\n * Create clean positional information.\n *\n * @param {Context} ctx\n * @param {Node} node\n * @param {P5ElementLocation} location\n * @returns {Position|null}\n */\nfunction createLocation(ctx, node, location) {\n const result = position(location)\n\n if (node.type === 'element') {\n const tail = node.children[node.children.length - 1]\n\n // Bug for unclosed with children.\n // See: .\n if (\n result &&\n !location.endTag &&\n tail &&\n tail.position &&\n tail.position.end\n ) {\n result.end = Object.assign({}, tail.position.end)\n }\n\n if (ctx.verbose) {\n /** @type {Object.} */\n const props = {}\n /** @type {string} */\n let key\n\n for (key in location.attrs) {\n if (own.call(location.attrs, key)) {\n props[find(ctx.schema, key).property] = position(location.attrs[key])\n }\n }\n\n node.data = {\n position: {\n opening: position(location.startTag),\n closing: location.endTag ? position(location.endTag) : null,\n properties: props\n }\n }\n }\n }\n\n return result\n}\n\n/**\n * @param {P5Location} loc\n * @returns {Position|null}\n */\nfunction position(loc) {\n const start = point({\n line: loc.startLine,\n column: loc.startCol,\n offset: loc.startOffset\n })\n const end = point({\n line: loc.endLine,\n column: loc.endCol,\n offset: loc.endOffset\n })\n // @ts-expect-error `null` is fine.\n return start || end ? {start, end} : null\n}\n\n/**\n * @param {Point} point\n * @returns {Point|null}\n */\nfunction point(point) {\n return point.line && point.column ? point : null\n}\n\n/**\n * @param {VFile|Options} value\n * @returns {value is VFile}\n */\nfunction isFile(value) {\n return 'messages' in value\n}\n","/**\n * @typedef {import('unist').Point} Point\n * @typedef {import('vfile').VFile} VFile\n *\n * @typedef {Pick} PositionalPoint\n * @typedef {Required} FullPoint\n * @typedef {NonNullable} Offset\n */\n\n/**\n * Get transform functions for the given `document`.\n *\n * @param {string|Uint8Array|VFile} file\n */\nexport function location(file) {\n var value = String(file)\n /** @type {Array.} */\n var indices = []\n var search = /\\r?\\n|\\r/g\n\n while (search.test(value)) {\n indices.push(search.lastIndex)\n }\n\n indices.push(value.length + 1)\n\n return {toPoint, toOffset}\n\n /**\n * Get the line and column-based `point` for `offset` in the bound indices.\n * Returns a point with `undefined` values when given invalid or out of bounds\n * input.\n *\n * @param {Offset} offset\n * @returns {FullPoint}\n */\n function toPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset\n }\n }\n }\n }\n\n return {line: undefined, column: undefined, offset: undefined}\n }\n\n /**\n * Get the `offset` for a line and column-based `point` in the bound indices.\n * Returns `-1` when given invalid or out of bounds input.\n *\n * @param {PositionalPoint} point\n * @returns {Offset}\n */\n function toOffset(point) {\n var line = point && point.line\n var column = point && point.column\n /** @type {number} */\n var offset\n\n if (\n typeof line === 'number' &&\n typeof column === 'number' &&\n !Number.isNaN(line) &&\n !Number.isNaN(column) &&\n line - 1 in indices\n ) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Text} Text\n *\n * @typedef {import('unist-util-is').AssertPredicate} AssertElement\n * @typedef {import('unist-util-is').AssertPredicate} AssertText\n * @typedef {import('unist-util-is').AssertPredicate} AssertRoot\n *\n * @callback CreateElementLike\n * @param {string} name\n * @param {any} attributes\n * @param {Array.} [children]\n * @returns {any}\n *\n * @typedef Context\n * @property {html|svg} schema\n * @property {string|null} prefix\n * @property {number} key\n * @property {boolean} react\n * @property {boolean} vue\n * @property {boolean} vdom\n * @property {boolean} hyperscript\n *\n * @typedef Options\n * @property {string|null} [prefix]\n * @property {'html'|'svg'} [space]\n */\n\nimport {html, svg, find, hastToReact} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {stringify as commas} from 'comma-separated-tokens'\nimport style from 'style-to-object'\nimport {webNamespaces} from 'web-namespaces'\nimport {convert} from 'unist-util-is'\n\nconst ns = /** @type {Record} */ (webNamespaces)\nconst toReact = /** @type {Record} */ (hastToReact)\n\nconst own = {}.hasOwnProperty\n\n/** @type {AssertRoot} */\n// @ts-expect-error it’s correct.\nconst root = convert('root')\n/** @type {AssertElement} */\n// @ts-expect-error it’s correct.\nconst element = convert('element')\n/** @type {AssertText} */\n// @ts-expect-error it’s correct.\nconst text = convert('text')\n\n/**\n * @template {CreateElementLike} H\n * @param {H} h\n * @param {Element|Root} tree\n * @param {string|boolean|Options} [options]\n * @returns {ReturnType}\n */\nexport function toH(h, tree, options) {\n if (typeof h !== 'function') {\n throw new TypeError('h is not a function')\n }\n\n const r = react(h)\n const v = vue(h)\n const vd = vdom(h)\n /** @type {string|boolean|null|undefined} */\n let prefix\n /** @type {Element} */\n let node\n\n if (typeof options === 'string' || typeof options === 'boolean') {\n prefix = options\n options = {}\n } else {\n if (!options) options = {}\n prefix = options.prefix\n }\n\n if (root(tree)) {\n // @ts-expect-error Allow `doctypes` in there, we’ll filter them out later.\n node =\n tree.children.length === 1 && element(tree.children[0])\n ? tree.children[0]\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: tree.children\n }\n } else if (element(tree)) {\n node = tree\n } else {\n throw new Error(\n // @ts-expect-error runtime.\n 'Expected root or element, not `' + ((tree && tree.type) || tree) + '`'\n )\n }\n\n return transform(h, node, {\n schema: options.space === 'svg' ? svg : html,\n prefix:\n prefix === undefined || prefix === null\n ? r || v || vd\n ? 'h-'\n : null\n : typeof prefix === 'string'\n ? prefix\n : prefix\n ? 'h-'\n : null,\n key: 0,\n react: r,\n vue: v,\n vdom: vd,\n hyperscript: hyperscript(h)\n })\n}\n\n/**\n * Transform a hast node through a hyperscript interface to *anything*!\n *\n * @template {CreateElementLike} H\n * @param {H} h\n * @param {Element} node\n * @param {Context} ctx\n */\nfunction transform(h, node, ctx) {\n const parentSchema = ctx.schema\n let schema = parentSchema\n let name = node.tagName\n /** @type {Record} */\n const attributes = {}\n /** @type {Array.|string>} */\n const nodes = []\n let index = -1\n /** @type {string} */\n let key\n\n if (parentSchema.space === 'html' && name.toLowerCase() === 'svg') {\n schema = svg\n ctx.schema = schema\n }\n\n for (key in node.properties) {\n if (node.properties && own.call(node.properties, key)) {\n addAttribute(attributes, key, node.properties[key], ctx, name)\n }\n }\n\n if (ctx.vdom) {\n if (schema.space === 'html') {\n name = name.toUpperCase()\n } else if (schema.space) {\n attributes.namespace = ns[schema.space]\n }\n }\n\n if (ctx.prefix) {\n ctx.key++\n attributes.key = ctx.prefix + ctx.key\n }\n\n if (node.children) {\n while (++index < node.children.length) {\n const value = node.children[index]\n\n if (element(value)) {\n nodes.push(transform(h, value, ctx))\n } else if (text(value)) {\n nodes.push(value.value)\n }\n }\n }\n\n // Restore parent schema.\n ctx.schema = parentSchema\n\n // Ensure no React warnings are triggered for void elements having children\n // passed in.\n return nodes.length > 0\n ? h.call(node, name, attributes, nodes)\n : h.call(node, name, attributes)\n}\n\n/**\n * @param {Record} props\n * @param {string} prop\n * @param {unknown} value\n * @param {Context} ctx\n * @param {string} name\n */\n// eslint-disable-next-line complexity, max-params\nfunction addAttribute(props, prop, value, ctx, name) {\n const info = find(ctx.schema, prop)\n /** @type {string|undefined} */\n let subprop\n\n // Ignore nullish and `NaN` values.\n // Ignore `false` and falsey known booleans for hyperlike DSLs.\n if (\n value === undefined ||\n value === null ||\n (typeof value === 'number' && Number.isNaN(value)) ||\n (value === false && (ctx.vue || ctx.vdom || ctx.hyperscript)) ||\n (!value && info.boolean && (ctx.vue || ctx.vdom || ctx.hyperscript))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // Treat `true` and truthy known booleans.\n if (info.boolean && ctx.hyperscript) {\n value = ''\n }\n\n // VDOM, Vue, and React accept `style` as object.\n if (\n info.property === 'style' &&\n typeof value === 'string' &&\n (ctx.react || ctx.vue || ctx.vdom)\n ) {\n value = parseStyle(value, name)\n }\n\n if (ctx.vue) {\n if (info.property !== 'style') subprop = 'attrs'\n } else if (!info.mustUseProperty) {\n if (ctx.vdom) {\n if (info.property !== 'style') subprop = 'attributes'\n } else if (ctx.hyperscript) {\n subprop = 'attrs'\n }\n }\n\n if (subprop) {\n props[subprop] = Object.assign(props[subprop] || {}, {\n [info.attribute]: value\n })\n } else if (info.space && ctx.react) {\n props[toReact[info.property] || info.property] = value\n } else {\n props[info.attribute] = value\n }\n}\n\n/**\n * Check if `h` is `react.createElement`.\n *\n * @param {CreateElementLike} h\n * @returns {boolean}\n */\nfunction react(h) {\n /** @type {unknown} */\n const node = h('div', {})\n return Boolean(\n node &&\n // @ts-expect-error Looks like a React node.\n ('_owner' in node || '_store' in node) &&\n // @ts-expect-error Looks like a React node.\n (node.key === undefined || node.key === null)\n )\n}\n\n/**\n * Check if `h` is `hyperscript`.\n *\n * @param {CreateElementLike} h\n * @returns {boolean}\n */\nfunction hyperscript(h) {\n return 'context' in h && 'cleanup' in h\n}\n\n/**\n * Check if `h` is `virtual-dom/h`.\n *\n * @param {CreateElementLike} h\n * @returns {boolean}\n */\nfunction vdom(h) {\n /** @type {unknown} */\n const node = h('div', {})\n // @ts-expect-error Looks like a vnode.\n return node.type === 'VirtualNode'\n}\n\n/**\n * Check if `h` is Vue.\n *\n * @param {CreateElementLike} h\n * @returns {boolean}\n */\nfunction vue(h) {\n /** @type {unknown} */\n const node = h('div', {})\n // @ts-expect-error Looks like a Vue node.\n return Boolean(node && node.context && node.context._isVue)\n}\n\n/**\n * @param {string} value\n * @param {string} tagName\n * @returns {Record}\n */\nfunction parseStyle(value, tagName) {\n /** @type {Record} */\n const result = {}\n\n try {\n style(value, (name, value) => {\n if (name.slice(0, 4) === '-ms-') name = 'ms-' + name.slice(4)\n\n result[\n name.replace(\n /-([a-z])/g,\n /**\n * @param {string} _\n * @param {string} $1\n * @returns {string}\n */ (_, $1) => $1.toUpperCase()\n )\n ] = value\n })\n } catch (error) {\n error.message =\n tagName + '[style]' + error.message.slice('undefined'.length)\n throw error\n }\n\n return result\n}\n","var own = {}.hasOwnProperty\n\n/**\n * @callback Handler\n * @param {...unknown} value\n * @return {unknown}\n *\n * @typedef {Record} Handlers\n *\n * @typedef {Object} Options\n * @property {Handler} [unknown]\n * @property {Handler} [invalid]\n * @property {Handlers} [handlers]\n */\n\n/**\n * Handle values based on a property.\n *\n * @param {string} key\n * @param {Options} [options]\n */\nexport function zwitch(key, options) {\n var settings = options || {}\n\n /**\n * Handle one value.\n * Based on the bound `key`, a respective handler will be called.\n * If `value` is not an object, or doesn’t have a `key` property, the special\n * “invalid” handler will be called.\n * If `value` has an unknown `key`, the special “unknown” handler will be\n * called.\n *\n * All arguments, and the context object, are passed through to the handler,\n * and it’s result is returned.\n *\n * @param {...unknown} [value]\n * @this {unknown}\n * @returns {unknown}\n * @property {Handler} invalid\n * @property {Handler} unknown\n * @property {Handlers} handlers\n */\n function one(value) {\n var fn = one.invalid\n var handlers = one.handlers\n\n if (value && own.call(value, key)) {\n fn = own.call(handlers, value[key]) ? handlers[value[key]] : one.unknown\n }\n\n if (fn) {\n return fn.apply(this, arguments)\n }\n }\n\n one.handlers = settings.handlers || {}\n one.invalid = settings.invalid\n one.unknown = settings.unknown\n\n return one\n}\n","/**\n * @typedef {import('parse5').Node} P5Node\n * @typedef {import('parse5').Document} P5Document\n * @typedef {import('parse5').DocumentFragment} P5Fragment\n * @typedef {import('parse5').DocumentType} P5Doctype\n * @typedef {import('parse5').CommentNode} P5Comment\n * @typedef {import('parse5').TextNode} P5Text\n * @typedef {import('parse5').Element} P5Element\n * @typedef {import('parse5').Attribute} P5Attribute\n * @typedef {import('parse5').ParentNode} P5Parent\n * @typedef {Exclude} P5Child\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('property-information').Info} Info\n * @typedef {'html'|'svg'} Space\n * @typedef {import('hast').Parent} Parent\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {Parent['children'][number]} Child\n * @typedef {Child|Root} Node\n *\n * @callback Handle\n * @param {Node} node\n * @param {Schema} schema\n * @returns {P5Node}\n */\n\nimport {html, svg, find} from 'property-information'\nimport {toH} from 'hast-to-hyperscript'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\nvar own = {}.hasOwnProperty\n\nvar one = zwitch('type', {handlers: {root, element, text, comment, doctype}})\n\n/**\n * Transform a tree from hast to Parse5’s AST.\n *\n * @param {Node} tree\n * @param {Space} [space='html']\n * @returns {P5Node}\n */\nexport function toParse5(tree, space) {\n // @ts-ignore Types are wrong.\n return one(tree, space === 'svg' ? svg : html)\n}\n\n/**\n * @type {Handle}\n * @param {Root} node\n * @returns {P5Document}\n */\nfunction root(node, schema) {\n /** @type {P5Document} */\n var p5 = {\n nodeName: '#document',\n mode: (node.data || {}).quirksMode ? 'quirks' : 'no-quirks',\n childNodes: []\n }\n // @ts-ignore Assume correct children.\n p5.childNodes = all(node.children, p5, schema)\n return patch(node, p5)\n}\n\n/**\n * @type {Handle}\n * @param {Root} node\n * @returns {P5Fragment}\n */\nfunction fragment(node, schema) {\n /** @type {P5Fragment} */\n var p5 = {nodeName: '#document-fragment', childNodes: []}\n // @ts-ignore Assume correct children.\n p5.childNodes = all(node.children, p5, schema)\n return patch(node, p5)\n}\n\n/**\n * @type {Handle}\n * @param {Doctype} node\n * @returns {P5Doctype}\n */\nfunction doctype(node) {\n return patch(node, {\n nodeName: '#documentType',\n name: 'html',\n publicId: '',\n systemId: '',\n parentNode: undefined\n })\n}\n\n/**\n * @type {Handle}\n * @param {Text} node\n * @returns {P5Text}\n */\nfunction text(node) {\n return patch(node, {\n nodeName: '#text',\n value: node.value,\n parentNode: undefined\n })\n}\n\n/**\n * @type {Handle}\n * @param {Comment} node\n * @returns {P5Comment}\n */\nfunction comment(node) {\n return patch(node, {\n nodeName: '#comment',\n data: node.value,\n parentNode: undefined\n })\n}\n\n/**\n * @type {Handle}\n * @param {Element} node\n * @returns {P5Element}\n */\nfunction element(node, schema) {\n /** @type {Space} */\n // @ts-ignore Assume space.\n var space = schema.space\n return toH(h, Object.assign({}, node, {children: []}), {space})\n\n /**\n * @param {string} name\n * @param {Object.} attrs\n */\n function h(name, attrs) {\n /** @type {Array.} */\n var values = []\n /** @type {Info} */\n var info\n /** @type {P5Attribute} */\n var value\n /** @type {string} */\n var key\n /** @type {number} */\n var index\n /** @type {P5Element} */\n var p5\n\n for (key in attrs) {\n if (!own.call(attrs, key) || attrs[key] === false) {\n continue\n }\n\n info = find(schema, key)\n\n if (info.boolean && !attrs[key]) {\n continue\n }\n\n value = {name: key, value: attrs[key] === true ? '' : String(attrs[key])}\n\n if (info.space && info.space !== 'html' && info.space !== 'svg') {\n index = key.indexOf(':')\n\n if (index < 0) {\n value.prefix = ''\n } else {\n value.name = key.slice(index + 1)\n value.prefix = key.slice(0, index)\n }\n\n value.namespace = webNamespaces[info.space]\n }\n\n values.push(value)\n }\n\n if (schema.space === 'html' && node.tagName === 'svg') schema = svg\n\n p5 = patch(node, {\n nodeName: name,\n tagName: name,\n attrs: values,\n namespaceURI: webNamespaces[schema.space],\n childNodes: [],\n parentNode: undefined\n })\n\n // @ts-ignore Assume correct children.\n p5.childNodes = all(node.children, p5, schema)\n\n // @ts-ignore Types are wrong.\n if (name === 'template') p5.content = fragment(node.content, schema)\n\n return p5\n }\n}\n\n/**\n * @param {Array.} children\n * @param {P5Parent} p5\n * @param {Schema} schema\n * @returns {Array.}\n */\nfunction all(children, p5, schema) {\n var index = -1\n /** @type {Array.} */\n var result = []\n /** @type {P5Child} */\n var child\n\n if (children) {\n while (++index < children.length) {\n // @ts-ignore Assume child.\n child = one(children[index], schema)\n\n // @ts-ignore types are wrong.\n child.parentNode = p5\n\n result.push(child)\n }\n }\n\n return result\n}\n\n/**\n * Patch specific properties.\n *\n * @template {P5Node} T\n * @param {Node} node\n * @param {T} p5\n * @returns {T}\n */\nfunction patch(node, p5) {\n var position = node.position\n\n if (position && position.start && position.end) {\n // @ts-ignore Types are wrong.\n p5.sourceCodeLocation = {\n startLine: position.start.line,\n startCol: position.start.column,\n startOffset: position.start.offset,\n endLine: position.end.line,\n endCol: position.end.column,\n endOffset: position.end.offset\n }\n }\n\n return p5\n}\n","/**\n * List of HTML void tag names.\n *\n * @type {Array}\n */\nexport const htmlVoidElements = [\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'isindex',\n 'keygen',\n 'link',\n 'menuitem',\n 'meta',\n 'nextid',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('parse5').Document} P5Document\n * @typedef {import('parse5').DocumentFragment} P5Fragment\n * @typedef {Omit} P5Element\n * @typedef {import('parse5').Attribute} P5Attribute\n * @typedef {Omit & {startOffset: number|undefined, endOffset: number|undefined}} P5Location\n * @typedef {import('parse5').ParserOptions} P5ParserOptions\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Content} Content\n * @typedef {Root|Content} Node\n * @typedef {import('../complex-types').Raw} Raw\n *\n * @typedef {Omit & {value: {stitch: Node}}} Stitch\n *\n * @typedef Options\n * @property {Array} [passThrough]\n * List of custom hast node types to pass through (keep) in hast.\n * If the passed through nodes have children, those children are expected to\n * be hast and will be handled.\n *\n * @typedef HiddenTokenizer\n * @property {Array} __mixins\n * Way too simple, but works for us.\n * @property {HiddenPreprocessor} preprocessor\n * @property {(value: string) => void} write\n * @property {() => number} _consume\n * @property {Array} tokenQueue\n * @property {string} state\n * @property {string} returnState\n * @property {number} charRefCode\n * @property {Array} tempBuff\n * @property {Function} _flushCodePointsConsumedAsCharacterReference\n * @property {string} lastStartTagName\n * @property {number} consumedAfterSnapshot\n * @property {boolean} active\n * @property {HiddenToken|undefined} currentCharacterToken\n * @property {HiddenToken|undefined} currentToken\n * @property {unknown} currentAttr\n * @property {Function} NAMED_CHARACTER_REFERENCE_STATE\n * @property {Function} NUMERIC_CHARACTER_REFERENCE_END_STATE\n *\n * @typedef {Record & {location: P5Location}} HiddenToken\n *\n * @typedef HiddenPreprocessor\n * @property {string|undefined} html\n * @property {number} pos\n * @property {number} lastGapPos\n * @property {number} lastCharPos\n * @property {Array} gapStack\n * @property {boolean} skipNextNewLine\n * @property {boolean} lastChunkWritten\n * @property {boolean} endOfChunkHit\n *\n * @typedef HiddenLocationTracker\n * @property {P5Location|undefined} currentAttrLocation\n * @property {P5Location} ctLoc\n * @property {HiddenPosTracker} posTracker\n *\n * @typedef HiddenPosTracker\n * @property {boolean} isEol\n * @property {number} lineStartPos\n * @property {number} droppedBufferSize\n * @property {number} offset\n * @property {number} col\n * @property {number} line\n */\n\n// @ts-expect-error: untyped.\nimport Parser from 'parse5/lib/parser/index.js'\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {visit} from 'unist-util-visit'\nimport {fromParse5} from 'hast-util-from-parse5'\nimport {toParse5} from 'hast-util-to-parse5'\nimport {htmlVoidElements} from 'html-void-elements'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\nconst inTemplateMode = 'IN_TEMPLATE_MODE'\nconst dataState = 'DATA_STATE'\nconst characterToken = 'CHARACTER_TOKEN'\nconst startTagToken = 'START_TAG_TOKEN'\nconst endTagToken = 'END_TAG_TOKEN'\nconst commentToken = 'COMMENT_TOKEN'\nconst doctypeToken = 'DOCTYPE_TOKEN'\n\n/** @type {P5ParserOptions} */\nconst parseOptions = {sourceCodeLocationInfo: true, scriptingEnabled: false}\n\n/**\n * Given a hast tree and an optional vfile (for positional info), return a new\n * parsed-again hast tree.\n *\n * @param tree\n * Original hast tree.\n * @param file\n * Virtual file for positional info, optional.\n * @param options\n * Configuration.\n */\nexport const raw =\n /**\n * @type {(\n * ((tree: Node, file: VFile|undefined, options?: Options) => Node) &\n * ((tree: Node, options?: Options) => Node)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {VFile} [file]\n * @param {Options} [options]\n */\n function (tree, file, options) {\n let index = -1\n const parser = new Parser(parseOptions)\n const one = zwitch('type', {\n // @ts-expect-error: hush.\n handlers: {root, element, text, comment, doctype, raw: handleRaw},\n // @ts-expect-error: hush.\n unknown\n })\n /** @type {boolean|undefined} */\n let stitches\n /** @type {HiddenTokenizer|undefined} */\n let tokenizer\n /** @type {HiddenPreprocessor|undefined} */\n let preprocessor\n /** @type {HiddenPosTracker|undefined} */\n let posTracker\n /** @type {HiddenLocationTracker|undefined} */\n let locationTracker\n\n if (isOptions(file)) {\n options = file\n file = undefined\n }\n\n if (options && options.passThrough) {\n while (++index < options.passThrough.length) {\n // @ts-expect-error: hush.\n one.handlers[options.passThrough[index]] = stitch\n }\n }\n\n const result = fromParse5(\n documentMode(tree) ? document() : fragment(),\n file\n )\n\n if (stitches) {\n visit(result, 'comment', (node, index, parent) => {\n const stitch = /** @type {Stitch} */ (/** @type {unknown} */ (node))\n if (stitch.value.stitch && parent !== null && index !== null) {\n // @ts-expect-error: assume the stitch is allowed.\n parent.children[index] = stitch.value.stitch\n return index\n }\n })\n }\n\n // Unpack if possible and when not given a `root`.\n if (\n tree.type !== 'root' &&\n result.type === 'root' &&\n result.children.length === 1\n ) {\n return result.children[0]\n }\n\n return result\n\n /**\n * @returns {P5Fragment}\n */\n function fragment() {\n /** @type {P5Element} */\n const context = {\n nodeName: 'template',\n tagName: 'template',\n attrs: [],\n namespaceURI: webNamespaces.html,\n childNodes: []\n }\n /** @type {P5Element} */\n const mock = {\n nodeName: 'documentmock',\n tagName: 'documentmock',\n attrs: [],\n namespaceURI: webNamespaces.html,\n childNodes: []\n }\n /** @type {P5Fragment} */\n const doc = {nodeName: '#document-fragment', childNodes: []}\n\n parser._bootstrap(mock, context)\n parser._pushTmplInsertionMode(inTemplateMode)\n parser._initTokenizerForFragmentParsing()\n parser._insertFakeRootElement()\n parser._resetInsertionMode()\n parser._findFormInFragmentContext()\n\n tokenizer = parser.tokenizer\n /* c8 ignore next */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n preprocessor = tokenizer.preprocessor\n locationTracker = tokenizer.__mixins[0]\n posTracker = locationTracker.posTracker\n\n one(tree)\n\n resetTokenizer()\n\n parser._adoptNodes(mock.childNodes[0], doc)\n\n return doc\n }\n\n /**\n * @returns {P5Document}\n */\n function document() {\n /** @type {P5Document} */\n const doc = parser.treeAdapter.createDocument()\n\n parser._bootstrap(doc, undefined)\n tokenizer = parser.tokenizer\n /* c8 ignore next */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n preprocessor = tokenizer.preprocessor\n locationTracker = tokenizer.__mixins[0]\n posTracker = locationTracker.posTracker\n\n one(tree)\n\n resetTokenizer()\n\n return doc\n }\n\n /**\n * @param {Array} nodes\n * @returns {void}\n */\n function all(nodes) {\n let index = -1\n\n /* istanbul ignore else - invalid nodes, see rehypejs/rehype-raw#7. */\n if (nodes) {\n while (++index < nodes.length) {\n one(nodes[index])\n }\n }\n }\n\n /**\n * @param {Root} node\n * @returns {void}\n */\n function root(node) {\n all(node.children)\n }\n\n /**\n * @param {Element} node\n * @returns {void}\n */\n function element(node) {\n resetTokenizer()\n parser._processToken(startTag(node), webNamespaces.html)\n\n all(node.children)\n\n if (!htmlVoidElements.includes(node.tagName)) {\n resetTokenizer()\n parser._processToken(endTag(node))\n }\n }\n\n /**\n * @param {Text} node\n * @returns {void}\n */\n function text(node) {\n resetTokenizer()\n parser._processToken({\n type: characterToken,\n chars: node.value,\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Doctype} node\n * @returns {void}\n */\n function doctype(node) {\n resetTokenizer()\n parser._processToken({\n type: doctypeToken,\n name: 'html',\n forceQuirks: false,\n publicId: '',\n systemId: '',\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Comment|Stitch} node\n * @returns {void}\n */\n function comment(node) {\n resetTokenizer()\n parser._processToken({\n type: commentToken,\n data: node.value,\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Raw} node\n * @returns {void}\n */\n function handleRaw(node) {\n const start = pointStart(node)\n const line = start.line || 1\n const column = start.column || 1\n const offset = start.offset || 0\n\n /* c8 ignore next 4 */\n if (!preprocessor) throw new Error('Expected `preprocessor`')\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n if (!posTracker) throw new Error('Expected `posTracker`')\n if (!locationTracker) throw new Error('Expected `locationTracker`')\n\n // Reset preprocessor:\n // See: .\n preprocessor.html = undefined\n preprocessor.pos = -1\n preprocessor.lastGapPos = -1\n preprocessor.lastCharPos = -1\n preprocessor.gapStack = []\n preprocessor.skipNextNewLine = false\n preprocessor.lastChunkWritten = false\n preprocessor.endOfChunkHit = false\n\n // Reset preprocessor mixin:\n // See: .\n posTracker.isEol = false\n posTracker.lineStartPos = -column + 1 // Looks weird, but ensures we get correct positional info.\n posTracker.droppedBufferSize = offset\n posTracker.offset = 0\n posTracker.col = 1\n posTracker.line = line\n\n // Reset location tracker:\n // See: .\n locationTracker.currentAttrLocation = undefined\n locationTracker.ctLoc = createParse5Location(node)\n\n // See the code for `parse` and `parseFragment`:\n // See: .\n tokenizer.write(node.value)\n parser._runParsingLoop(null)\n\n // Character references hang, so if we ended there, we need to flush\n // those too.\n // We reset the preprocessor as if the document ends here.\n // Then one single call to the relevant state does the trick, parse5\n // consumes the whole token.\n if (\n tokenizer.state === 'NAMED_CHARACTER_REFERENCE_STATE' ||\n tokenizer.state === 'NUMERIC_CHARACTER_REFERENCE_END_STATE'\n ) {\n preprocessor.lastChunkWritten = true\n tokenizer[tokenizer.state](tokenizer._consume())\n }\n }\n\n /**\n * @param {Node} node\n */\n function stitch(node) {\n stitches = true\n\n /** @type {Node} */\n let clone\n\n // Recurse, because to somewhat handle `[]` (where `[]` denotes the\n // passed through node).\n if ('children' in node) {\n clone = {\n ...node,\n children: raw(\n {type: 'root', children: node.children},\n file,\n options\n // @ts-expect-error Assume a given parent yields a parent.\n ).children\n }\n } else {\n clone = {...node}\n }\n\n // Hack: `value` is supposed to be a string, but as none of the tools\n // (`parse5` or `hast-util-from-parse5`) looks at it, we can pass nodes\n // through.\n comment({type: 'comment', value: {stitch: clone}})\n }\n\n function resetTokenizer() {\n /* c8 ignore next 2 */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n if (!posTracker) throw new Error('Expected `posTracker`')\n\n // Process final characters if they’re still there after hibernating.\n // Similar to:\n // See: .\n const token = tokenizer.currentCharacterToken\n\n if (token) {\n token.location.endLine = posTracker.line\n token.location.endCol = posTracker.col + 1\n token.location.endOffset = posTracker.offset + 1\n parser._processToken(token)\n }\n\n // Reset tokenizer:\n // See: .\n // Especially putting it back in the `data` state is useful: some elements,\n // like textareas and iframes, change the state.\n // See GH-7.\n // But also if broken HTML is in `raw`, and then a correct element is given.\n // See GH-11.\n tokenizer.tokenQueue = []\n tokenizer.state = dataState\n tokenizer.returnState = ''\n tokenizer.charRefCode = -1\n tokenizer.tempBuff = []\n tokenizer.lastStartTagName = ''\n tokenizer.consumedAfterSnapshot = -1\n tokenizer.active = false\n tokenizer.currentCharacterToken = undefined\n tokenizer.currentToken = undefined\n tokenizer.currentAttr = undefined\n }\n }\n )\n/**\n * @param {Element} node\n * @returns {HiddenToken}\n */\nfunction startTag(node) {\n /** @type {P5Location} */\n const location = Object.assign(createParse5Location(node))\n // @ts-expect-error extra positional info.\n location.startTag = Object.assign({}, location)\n\n // Untyped token.\n return {\n type: startTagToken,\n tagName: node.tagName,\n selfClosing: false,\n attrs: attributes(node),\n location\n }\n}\n\n/**\n * @param {Element} node\n * @returns {Array}\n */\nfunction attributes(node) {\n return toParse5({\n tagName: node.tagName,\n type: 'element',\n properties: node.properties,\n children: []\n // @ts-expect-error Assume element.\n }).attrs\n}\n\n/**\n * @param {Element} node\n * @returns {HiddenToken}\n */\nfunction endTag(node) {\n /** @type {P5Location} */\n const location = Object.assign(createParse5Location(node))\n // @ts-expect-error extra positional info.\n location.startTag = Object.assign({}, location)\n\n // Untyped token.\n return {\n type: endTagToken,\n tagName: node.tagName,\n attrs: [],\n location\n }\n}\n\n/**\n * @param {Node} node\n */\nfunction unknown(node) {\n throw new Error('Cannot compile `' + node.type + '` node')\n}\n\n/**\n * @param {Node} node\n * @returns {boolean}\n */\nfunction documentMode(node) {\n const head = node.type === 'root' ? node.children[0] : node\n return Boolean(\n head &&\n (head.type === 'doctype' ||\n (head.type === 'element' && head.tagName === 'html'))\n )\n}\n\n/**\n * @param {Node|Stitch} node\n * @returns {P5Location}\n */\nfunction createParse5Location(node) {\n const start = pointStart(node)\n const end = pointEnd(node)\n\n return {\n startLine: start.line,\n startCol: start.column,\n startOffset: start.offset,\n endLine: end.line,\n endCol: end.column,\n endOffset: end.offset\n }\n}\n\n/**\n * @param {VFile|Options|undefined} value\n * @return {value is Options}\n */\nfunction isOptions(value) {\n return Boolean(value && !('message' in value && 'messages' in value))\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast-util-raw').Options} Options\n * @typedef {import('hast-util-raw')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {raw} from 'hast-util-raw'\n\n/**\n * Plugin to parse the tree again (and raw nodes).\n * Keeping positional info OK. 🙌\n *\n * @type {import('unified').Plugin<[Options?] | Array, Root>}\n */\nexport default function rehypeRaw(options = {}) {\n return (tree, file) => {\n // Assume that when a root was given, it’s also returned.\n const result = /** @type {Root} */ (raw(tree, file, options))\n return result\n }\n}\n","import { Element, Comment, Literal, ElementContent, RootContent, Properties } from 'hast';\nimport { RehypeAttrsOptions } from './';\n\nexport const getURLParameters = (url: string): Record =>\n(url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(\n (a: Record, v: string) => (\n (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a\n ),\n {},\n);\n\nexport const prevChild = (data: Literal[] = [], index: number): Comment | undefined => {\n let i = index;\n while (i > -1) {\n i--;\n if (!data[i]) return\n if ((data[i] && data[i].value && (data[i].value as string).replace(/(\\n|\\s)/g, '') !== '') || data[i].type !== 'text') {\n if (!/^rehype:/.test(data[i].value as string) || (data[i].type as string) !== 'comment') return;\n return data[i] as unknown as Comment;\n }\n }\n return;\n}\n\nexport const nextChild = (data: RootContent[] | ElementContent[] = [], index: number, tagName?: string): ElementContent | undefined => {\n let i = index;\n while (i < data.length) {\n i++;\n if (tagName) {\n const element = data[i] as Literal & Element;\n if (element && element.value && (element.value as string).replace(/(\\n|\\s)/g, '') !== '' || data[i] && (data[i].type as string) === 'element') {\n return element.tagName === tagName ? element : undefined\n }\n } else {\n const element = data[i] as ElementContent & Literal;\n if (!element || (element.type !== 'text' && (element.type as string) !== 'comment') || (element.type === 'text' && (element.value as string).replace(/(\\n|\\s)/g, '') !== '')) return;\n if ((element.type as string) === 'comment') {\n if (!/^rehype:/.test(element.value as string)) return;\n const nextNode = nextChild(data, i, 'pre')\n if (nextNode) return;\n return element;\n }\n }\n }\n return\n}\n\n/**\n * 获取代码注视的位置\n * @param data 数据\n * @param index 当前数据所在的位置\n * @returns 返回 当前参数数据 Object,`{}`\n */\nexport const getCommentObject = ({ value = '' }: Comment): Properties => {\n const param = getURLParameters(value.replace(/^rehype:/, ''));\n Object.keys(param).forEach((keyName: string) => {\n if (param[keyName] === 'true') {\n param[keyName] = true;\n }\n if (param[keyName] === 'false') {\n param[keyName] = false;\n }\n if (typeof param[keyName] === 'string' && !/^0/.test(param[keyName] as string) && !isNaN(+param[keyName])) {\n param[keyName] = +param[keyName];\n }\n })\n return param;\n}\n\nexport type DataConfig = {\n 'data-config': Properties\n}\n\nexport const propertiesHandle = (defaultAttrs?: Properties | null, attrs?: Properties, type?: RehypeAttrsOptions['properties']): Properties | DataConfig => {\n if (type === 'string') {\n return { ...defaultAttrs, 'data-config': JSON.stringify({ ...attrs, rehyp: true })}\n } else if (type === 'attr') {\n return { ...defaultAttrs, ...attrs}\n }\n return { ...defaultAttrs, 'data-config': { ...attrs, rehyp: true }}\n}","import { Plugin } from 'unified';\nimport { Root, Element, Comment, Properties, Literal } from 'hast';\nimport { visit } from 'unist-util-visit';\nimport { propertiesHandle, nextChild, prevChild, getCommentObject } from './utils';\n\nexport type RehypeAttrsOptions = {\n /**\n * ## `data`\n * \n * ```markdown\n * text\n * \n * ```\n * \n * ⇣⇣⇣⇣⇣⇣\n * \n * ```html\n *

text

\n * ```\n * \n * ## `string`\n * \n * ```markdown\n * text\n * \n * ```\n * \n * ⇣⇣⇣⇣⇣⇣\n * \n * ```html\n *

text

\n * ```\n * \n * ## attr\n * \n * ```markdown\n * text\n * \n * ```\n * ⇣⇣⇣⇣⇣⇣\n * ```html\n *

text

\n * ```\n */\n properties: 'data' | 'string' | 'attr';\n}\n\nconst defaultOptions: RehypeAttrsOptions = {\n properties: 'data',\n}\n\nconst rehypeAttrs: Plugin<[RehypeAttrsOptions?], Root> = (options) => {\n const opts = { ...defaultOptions, ...options }\n return (tree) => {\n visit(tree, 'element', (node, index, parent) => {\n if (node.tagName === 'pre' && node && Array.isArray(node.children) && parent && Array.isArray(parent.children) && parent.children.length > 1) {\n const firstChild = node.children[0] as Element;\n if (firstChild && firstChild.tagName === 'code' && typeof index === 'number') {\n const child = prevChild(parent.children as Literal[], index);\n if (child) {\n const attr = getCommentObject(child);\n if (Object.keys(attr).length > 0) {\n node.properties = { ...node.properties, ...{ 'data-type': 'rehyp' } }\n firstChild.properties = propertiesHandle(firstChild.properties, attr, opts.properties) as Properties\n }\n }\n }\n }\n\n if (/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(node.tagName) && parent && Array.isArray(parent.children) && typeof index === 'number') {\n const child = nextChild(parent.children, index)\n if (child) {\n const attr = getCommentObject(child as Comment)\n if (Object.keys(attr).length > 0) {\n node.properties = propertiesHandle(node.properties, attr, opts.properties) as Properties\n }\n }\n }\n });\n }\n}\n\n\nexport default rehypeAttrs\n","import { Plugin } from 'unified';\nimport { Root, RootContent } from 'hast';\nimport { visit } from 'unist-util-visit';\n\nexport type RehypeIgnoreOptions = {\n /**\n * Character to use for opening delimiter, by default `rehype:ignore:start`\n */\n openDelimiter?: string;\n /**\n * Character to use for closing delimiter, by default `rehype:ignore:end`\n */\n closeDelimiter?: string;\n}\n\nconst rehypeIgnore: Plugin<[RehypeIgnoreOptions?], Root> = (options = {}) => {\n const { openDelimiter = 'rehype:ignore:start', closeDelimiter = 'rehype:ignore:end' } = options;\n return (tree) => {\n visit(tree, (node: Root | RootContent, index, parent) => {\n if (node.type === 'element' || node.type === 'root') {\n // const start = node.children.findIndex((item) => item.type === 'comment' && item.value === openDelimiter);\n // const end = node.children.findIndex((item) => item.type === 'comment' && item.value === closeDelimiter);\n // if (start > -1 && end > -1) {\n // node.children = node.children.filter((_, idx) => idx < start || idx > end);\n // }\n let start = false;\n node.children = node.children.filter((item) => {\n if (item.type === 'comment' && item.value.trim() === openDelimiter) {\n start = true;\n return false\n }\n if (item.type === 'comment' && item.value.trim() === closeDelimiter) {\n start = false;\n return false\n }\n \n return !start;\n })\n }\n });\n }\n}\n\nexport default rehypeIgnore;\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n */\n\n/**\n * Options for unist util filter\n *\n * @typedef {Object} FilterOptions\n * @property {boolean} [cascade=true] Whether to drop parent nodes if they had children, but all their children were filtered out.\n */\n\nimport {convert} from 'unist-util-is'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create a new tree consisting of copies of all nodes that pass test.\n * The tree is walked in preorder (NLR), visiting the node itself, then its head, etc.\n *\n * @param tree Tree to filter.\n * @param options Configuration (optional).\n * @param test is-compatible test (such as a type).\n * @returns Given `tree` or `null` if it didn’t pass `test`.\n */\nexport const filter =\n /**\n * @type {(\n * ((node: Tree, options: FilterOptions, test: Check) => import('./complex-types').Matches) &\n * ((node: Tree, test: Check) => import('./complex-types').Matches) &\n * ((node: Tree, options?: FilterOptions) => Tree)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {FilterOptions} options\n * @param {Test} test\n * @returns {Node|null}\n */\n function (tree, options, test) {\n const is = convert(test || options)\n const cascade =\n options.cascade === undefined || options.cascade === null\n ? true\n : options.cascade\n\n return preorder(tree)\n\n /**\n * @param {Node} node\n * @param {number|undefined} [index]\n * @param {Parent|undefined} [parent]\n * @returns {Node|null}\n */\n function preorder(node, index, parent) {\n /** @type {Array.} */\n const children = []\n /** @type {number} */\n let childIndex\n /** @type {Node} */\n let result\n /** @type {string} */\n let key\n\n if (!is(node, index, parent)) return null\n\n // @ts-expect-error: Looks like a parent.\n if (node.children) {\n childIndex = -1\n\n // @ts-expect-error Looks like a parent.\n while (++childIndex < node.children.length) {\n // @ts-expect-error Looks like a parent.\n result = preorder(node.children[childIndex], childIndex, node)\n\n if (result) {\n children.push(result)\n }\n }\n\n // @ts-expect-error Looks like a parent.\n if (cascade && node.children.length > 0 && children.length === 0)\n return null\n }\n\n // Create a shallow clone, using the new children.\n /** @type {typeof node} */\n // @ts-expect-error all the fields will be copied over.\n const next = {}\n\n for (key in node) {\n if (own.call(node, key)) {\n // @ts-expect-error: Looks like a record.\n next[key] = key === 'children' ? children : node[key]\n }\n }\n\n return next\n }\n }\n )\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef Options options\n * Configuration.\n * @property {boolean} [showLineNumbers]\n * Set `showLineNumbers` to `true` to always display line number\n * @property {boolean} [ignoreMissing]\n * Set `ignoreMissing` to `true` to ignore unsupported languages and line highlighting when no language is specified\n */\n\nimport { visit } from 'unist-util-visit'\nimport { toString } from 'hast-util-to-string'\nimport { filter } from 'unist-util-filter'\nimport rangeParser from 'parse-numeric-range'\n\n/**\n * @param {Element} node\n * @return {string|null}\n */\nconst getLanguage = (node) => {\n const className = node.properties.className\n //@ts-ignore\n for (const classListItem of className) {\n if (classListItem.slice(0, 9) === 'language-') {\n return classListItem.slice(9).toLowerCase()\n }\n }\n return null\n}\n\n/**\n * Create a closure that determines if we have to highlight the given index\n *\n * @param {string} meta\n * @return { (index:number) => boolean }\n */\nconst calculateLinesToHighlight = (meta) => {\n const RE = /{([\\d,-]+)}/\n // Remove space between {} e.g. {1, 3}\n const parsedMeta = meta\n .split(',')\n .map((str) => str.trim())\n .join()\n if (RE.test(parsedMeta)) {\n const strlineNumbers = RE.exec(parsedMeta)[1]\n const lineNumbers = rangeParser(strlineNumbers)\n return (index) => lineNumbers.includes(index + 1)\n } else {\n return () => false\n }\n}\n\n/**\n * Check if we want to start the line numbering from a given number or 1\n * showLineNumbers=5, will start the numbering from 5\n * @param {string} meta\n * @returns {number}\n */\nconst calculateStartingLine = (meta) => {\n const RE = /showLineNumbers=(?\\d+)/i\n // pick the line number after = using a named capturing group\n if (RE.test(meta)) {\n const {\n groups: { lines },\n } = RE.exec(meta)\n return Number(lines)\n }\n return 1\n}\n\n/**\n * Create container AST for node lines\n *\n * @param {number} number\n * @return {Element[]}\n */\nconst createLineNodes = (number) => {\n const a = new Array(number)\n for (let i = 0; i < number; i++) {\n a[i] = {\n type: 'element',\n tagName: 'span',\n properties: { className: [] },\n children: [],\n }\n }\n return a\n}\n\n/**\n * Split multiline text nodes into individual nodes with positioning\n * Add a node start and end line position information for each text node\n *\n * @return { (ast:Element['children']) => Element['children'] }\n *\n */\nconst addNodePositionClosure = () => {\n let startLineNum = 1\n /**\n * @param {Element['children']} ast\n * @return {Element['children']}\n */\n const addNodePosition = (ast) => {\n return ast.reduce((result, node) => {\n if (node.type === 'text') {\n const value = /** @type {string} */ (node.value)\n const numLines = (value.match(/\\n/g) || '').length\n if (numLines === 0) {\n node.position = {\n // column: 1 is needed to avoid error with @next/mdx\n // https://github.com/timlrx/rehype-prism-plus/issues/44\n start: { line: startLineNum, column: 1 },\n end: { line: startLineNum, column: 1 },\n }\n result.push(node)\n } else {\n const lines = value.split('\\n')\n for (const [i, line] of lines.entries()) {\n result.push({\n type: 'text',\n value: i === lines.length - 1 ? line : line + '\\n',\n position: {\n start: { line: startLineNum + i, column: 1 },\n end: { line: startLineNum + i, column: 1 },\n },\n })\n }\n }\n startLineNum = startLineNum + numLines\n\n return result\n }\n\n if (Object.prototype.hasOwnProperty.call(node, 'children')) {\n const initialLineNum = startLineNum\n // @ts-ignore\n node.children = addNodePosition(node.children, startLineNum)\n result.push(node)\n node.position = {\n start: { line: initialLineNum, column: 1 },\n end: { line: startLineNum, column: 1 },\n }\n return result\n }\n\n result.push(node)\n return result\n }, [])\n }\n return addNodePosition\n}\n\n/**\n * Rehype prism plugin generator that highlights code blocks with refractor (prismjs)\n *\n * Pass in your own refractor object with the required languages registered:\n * https://github.com/wooorm/refractor#refractorregistersyntax\n *\n * @param {import('refractor/lib/core').Refractor} refractor\n * @return {import('unified').Plugin<[Options?], Root>}\n */\nconst rehypePrismGenerator = (refractor) => {\n return (options = {}) => {\n return (tree) => {\n visit(tree, 'element', visitor)\n }\n\n /**\n * @param {Element} node\n * @param {number} index\n * @param {Element} parent\n */\n function visitor(node, index, parent) {\n if (!parent || parent.tagName !== 'pre' || node.tagName !== 'code') {\n return\n }\n\n let meta = node.data && node.data.meta ? /** @type {string} */ (node.data.meta) : ''\n // Coerce className to array\n if (node.properties.className) {\n if (typeof node.properties.className === 'boolean') {\n node.properties.className = []\n } else if (!Array.isArray(node.properties.className)) {\n node.properties.className = [node.properties.className]\n }\n } else {\n node.properties.className = []\n }\n node.properties.className.push('code-highlight')\n const lang = getLanguage(node)\n\n /** @type {Element} */\n let refractorRoot\n\n // Syntax highlight\n if (lang) {\n try {\n let rootLang\n if (lang?.includes('diff-')){\n rootLang=lang.split('-')[1]\n } else{\n rootLang=lang\n }\n // @ts-ignore\n refractorRoot = refractor.highlight(toString(node), rootLang)\n // @ts-ignore className is already an array\n parent.properties.className = (parent.properties.className || []).concat(\n 'language-' + rootLang\n )\n } catch (err) {\n if (options.ignoreMissing && /Unknown language/.test(err.message)) {\n refractorRoot = node\n } else {\n throw err\n }\n }\n } else {\n refractorRoot = node\n }\n\n refractorRoot.children = addNodePositionClosure()(refractorRoot.children)\n\n // Add position info to root\n if (refractorRoot.children.length > 0) {\n refractorRoot.position = {\n start: { line: refractorRoot.children[0].position.start.line, column: 0 },\n end: {\n line: refractorRoot.children[refractorRoot.children.length - 1].position.end.line,\n column: 0,\n },\n }\n } else {\n refractorRoot.position = {\n start: { line: 0, column: 0 },\n end: { line: 0, column: 0 },\n }\n }\n\n const shouldHighlightLine = calculateLinesToHighlight(meta)\n const startingLineNumber = calculateStartingLine(meta)\n const codeLineArray = createLineNodes(refractorRoot.position.end.line)\n\n const falseShowLineNumbersStr = [\n 'showlinenumbers=false',\n 'showlinenumbers=\"false\"',\n 'showlinenumbers={false}',\n ]\n for (const [i, line] of codeLineArray.entries()) {\n // Default class name for each line\n line.properties.className = ['code-line']\n\n // Syntax highlight\n const treeExtract = filter(\n refractorRoot,\n (node) => node.position.start.line <= i + 1 && node.position.end.line >= i + 1\n )\n line.children = treeExtract.children\n\n // Line number\n if (\n (meta.toLowerCase().includes('showLineNumbers'.toLowerCase()) ||\n options.showLineNumbers) &&\n !falseShowLineNumbersStr.some((str) => meta.toLowerCase().includes(str))\n ) {\n line.properties.line = [(i + startingLineNumber).toString()]\n line.properties.className.push('line-number')\n }\n\n // Line highlight\n if (shouldHighlightLine(i)) {\n line.properties.className.push('highlight-line')\n }\n\n // Diff classes\n if ((lang === 'diff' || lang?.includes('diff-')) && toString(line).substring(0, 1) === '-') {\n line.properties.className.push('deleted')\n } else if ((lang === 'diff' || lang?.includes('diff-')) && toString(line).substring(0, 1) === '+') {\n line.properties.className.push('inserted')\n }\n }\n\n // Remove possible trailing line when splitting by \\n which results in empty array\n if (\n codeLineArray.length > 0 &&\n toString(codeLineArray[codeLineArray.length - 1]).trim() === ''\n ) {\n codeLineArray.pop()\n }\n\n node.children = codeLineArray\n }\n }\n}\n\nexport default rehypePrismGenerator\n","import { refractor as refractorAll } from 'refractor/lib/all.js'\nimport rehypePrismGenerator from './generator.js'\n\n/**\n * Rehype prism plugin that highlights code blocks with refractor (prismjs)\n * This supports all the languages and should be used on the server side.\n *\n * Consider using rehypePrismCommon or rehypePrismGenerator to generate a plugin\n * that supports your required languages.\n */\nconst rehypePrismAll = rehypePrismGenerator(refractorAll)\n\nexport default rehypePrismAll\n","import { refractor as refractorCommon } from 'refractor/lib/common.js'\nimport rehypePrismGenerator from './generator.js'\n\n/**\n * Rehype prism plugin that highlights code blocks with refractor (prismjs)\n * Supported languages: https://github.com/wooorm/refractor#data\n *\n * Consider using rehypePrismGenerator to generate a plugin\n * that supports your required languages.\n */\nconst rehypePrismCommon = rehypePrismGenerator(refractorCommon)\n\nexport default rehypePrismCommon\n","const rtlRange = '\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC'\nconst ltrRange =\n 'A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6' +\n '\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\\u200E\\u2C00-\\uFB1C' +\n '\\uFE00-\\uFE6F\\uFEFD-\\uFFFF'\n\n/* eslint-disable no-misleading-character-class */\nconst rtl = new RegExp('^[^' + ltrRange + ']*[' + rtlRange + ']')\nconst ltr = new RegExp('^[^' + rtlRange + ']*[' + ltrRange + ']')\n/* eslint-enable no-misleading-character-class */\n\n/**\n * Detect the direction of text: left-to-right, right-to-left, or neutral\n *\n * @param {string} value\n * @returns {'rtl'|'ltr'|'neutral'}\n */\nexport function direction(value) {\n const source = String(value || '')\n return rtl.test(source) ? 'rtl' : ltr.test(source) ? 'ltr' : 'neutral'\n}\n","/**\n * @typedef {import('./types.js').Node} Node\n * @typedef {import('./types.js').Element} Element\n * @typedef {import('./types.js').Parent} Parent\n * @typedef {import('hast-util-is-element').AssertPredicate} IsElement\n */\n\nimport {convertElement} from 'hast-util-is-element'\n\n/**\n * @param {Node} node\n * @returns {node is Parent}\n */\nexport function parent(node) {\n // @ts-expect-error: hush.\n return Array.isArray(node.children)\n}\n\n/** @type {IsElement} */\n// @ts-expect-error it works.\nexport const element = convertElement()\n","/**\n * @typedef {import('./types.js').SelectState} SelectState\n * @typedef {import('./types.js').HastNode} HastNode\n * @typedef {import('./types.js').ElementChild} ElementChild\n * @typedef {import('./types.js').Direction} Direction\n * @typedef {import('unist-util-visit/complex-types').Visitor} Visitor\n */\n\nimport {direction} from 'direction'\nimport {isElement} from 'hast-util-is-element'\nimport {toString} from 'hast-util-to-string'\nimport {svg} from 'property-information'\nimport {visit, EXIT, SKIP} from 'unist-util-visit'\nimport {element} from './util.js'\n\n/**\n * @param {SelectState} state\n * @param {HastNode} node\n * @returns {() => void}\n */\n// eslint-disable-next-line complexity\nexport function enterState(state, node) {\n const schema = state.schema\n const language = state.language\n const currentDirection = state.direction\n const editableOrEditingHost = state.editableOrEditingHost\n /** @type {Direction|undefined} */\n let dirInferred\n /** @type {boolean|undefined} */\n let found\n\n if (element(node) && node.properties) {\n const lang = node.properties.xmlLang || node.properties.lang\n const type = node.properties.type || 'text'\n const dir = dirProperty(node)\n\n if (lang !== undefined && lang !== null) {\n state.language = String(lang)\n found = true\n }\n\n if (schema && schema.space === 'html') {\n if (node.properties.contentEditable === 'true') {\n state.editableOrEditingHost = true\n found = true\n }\n\n if (isElement(node, 'svg')) {\n state.schema = svg\n found = true\n }\n\n // See: .\n // Explicit `[dir=rtl]`.\n if (dir === 'rtl') {\n dirInferred = dir\n } else if (\n // Explicit `[dir=ltr]`.\n dir === 'ltr' ||\n // HTML with an invalid or no `[dir]`.\n (dir !== 'auto' && isElement(node, 'html')) ||\n // `input[type=tel]` with an invalid or no `[dir]`.\n (dir !== 'auto' && isElement(node, 'input') && type === 'tel')\n ) {\n dirInferred = 'ltr'\n // `[dir=auto]` or `bdi` with an invalid or no `[dir]`.\n } else if (dir === 'auto' || isElement(node, 'bdi')) {\n if (isElement(node, 'textarea')) {\n // Check contents of `