UNPKG

@birthsenseai/esm-patient-ai-analysis-app

Version:

AI Analysis integration for OpenMRS patient charts - provides clinical summaries, drug interaction analysis, and patient follow-up messages

2 lines 119 kB
/*! For license information please see 821.js.LICENSE.txt */ (self.webpackChunk_birthsenseai_esm_patient_ai_analysis_app=self.webpackChunk_birthsenseai_esm_patient_ai_analysis_app||[]).push([[821],{320:function(e,n){"use strict";var t,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function y(e){if("object"==typeof e&&null!==e){var n=e.$$typeof;switch(n){case r:switch(e=e.type){case i:case u:case l:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case m:case h:case a:return e;default:return n}}case o:return n}}}t=Symbol.for("react.module.reference"),n.ContextConsumer=c,n.ContextProvider=a,n.Element=r,n.ForwardRef=f,n.Fragment=i,n.Lazy=m,n.Memo=h,n.Portal=o,n.Profiler=u,n.StrictMode=l,n.Suspense=p,n.SuspenseList=d,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(e){return y(e)===c},n.isContextProvider=function(e){return y(e)===a},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},n.isForwardRef=function(e){return y(e)===f},n.isFragment=function(e){return y(e)===i},n.isLazy=function(e){return y(e)===m},n.isMemo=function(e){return y(e)===h},n.isPortal=function(e){return y(e)===o},n.isProfiler=function(e){return y(e)===u},n.isStrictMode=function(e){return y(e)===l},n.isSuspense=function(e){return y(e)===p},n.isSuspenseList=function(e){return y(e)===d},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===l||e===p||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===t||void 0!==e.getModuleId)},n.typeOf=y},346:function(e,n,t){"use strict";t.d(n,{$:function(){return or}});var r={};t.r(r),t.d(r,{attentionMarkers:function(){return yn},contentInitial:function(){return fn},disable:function(){return xn},document:function(){return sn},flow:function(){return dn},flowInitial:function(){return pn},insideSpan:function(){return gn},string:function(){return hn},text:function(){return mn}});var o={};t.r(o),t.d(o,{boolean:function(){return dt},booleanish:function(){return ht},commaOrSpaceSeparated:function(){return kt},commaSeparated:function(){return xt},number:function(){return gt},overloadedBoolean:function(){return mt},spaceSeparated:function(){return yt}});var i=t(1343),l=t(1990);function u(e){return e&&"object"==typeof e?"position"in e||"type"in e?c(e.position):"start"in e||"end"in e?c(e):"line"in e||"column"in e?a(e):"":""}function a(e){return s(e&&e.line)+":"+s(e&&e.column)}function c(e){return a(e&&e.start)+"-"+a(e&&e.end)}function s(e){return e&&"number"==typeof e?e:1}class f extends Error{constructor(e,n,t){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof n&&(t=n,n=void 0),"string"==typeof t){const e=t.indexOf(":");-1===e?r[1]=t:(r[0]=t.slice(0,e),r[1]=t.slice(e+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=u(n)||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}f.prototype.file="",f.prototype.name="",f.prototype.reason="",f.prototype.message="",f.prototype.stack="",f.prototype.fatal=null,f.prototype.column=null,f.prototype.line=null,f.prototype.source=null,f.prototype.ruleId=null,f.prototype.position=null;const p=function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');y(e);let t,r=0,o=-1,i=e.length;if(void 0===n||0===n.length||n.length>e.length){for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else o<0&&(t=!0,o=i+1);return o<0?"":e.slice(r,o)}if(n===e)return"";let l=-1,u=n.length-1;for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else l<0&&(t=!0,l=i+1),u>-1&&(e.charCodeAt(i)===n.charCodeAt(u--)?u<0&&(o=i):(u=-1,o=l));return r===o?o=l:o<0&&(o=e.length),e.slice(r,o)},d=function(e){if(y(e),0===e.length)return".";let n,t=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(n){t=r;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},h=function(e){y(e);let n,t=e.length,r=-1,o=0,i=-1,l=0;for(;t--;){const u=e.charCodeAt(t);if(47!==u)r<0&&(n=!0,r=t+1),46===u?i<0?i=t:1!==l&&(l=1):i>-1&&(l=-1);else if(n){o=t+1;break}}return i<0||r<0||0===l||1===l&&i===r-1&&i===o+1?"":e.slice(i,r)},m=function(...e){let n,t=-1;for(;++t<e.length;)y(e[t]),e[t]&&(n=void 0===n?e[t]:n+"/"+e[t]);return void 0===n?".":function(e){y(e);const n=47===e.charCodeAt(0);let t=function(e,n){let t,r,o="",i=0,l=-1,u=0,a=-1;for(;++a<=e.length;){if(a<e.length)t=e.charCodeAt(a);else{if(47===t)break;t=47}if(47===t){if(l===a-1||1===u);else if(l!==a-1&&2===u){if(o.length<2||2!==i||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),l=a,u=0;continue}}else if(o.length>0){o="",i=0,l=a,u=0;continue}n&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(l+1,a):o=e.slice(l+1,a),i=a-l-1;l=a,u=0}else 46===t&&u>-1?u++:u=-1}return o}(e,!n);return 0!==t.length||n||(t="."),t.length>0&&47===e.charCodeAt(e.length-1)&&(t+="/"),n?"/"+t:t}(n)},g="/";function y(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const x=function(){return"/"};function k(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const v=["history","path","basename","stem","extname","dirname"];class b{constructor(e){let n;n=e?"string"==typeof e||function(e){return l(e)}(e)?{value:e}:k(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=x(),this.value,this.stored,this.result,this.map;let t,r=-1;for(;++r<v.length;){const e=v[r];e in n&&void 0!==n[e]&&null!==n[e]&&(this[e]="history"===e?[...n[e]]:n[e])}for(t in n)v.includes(t)||(this[t]=n[t])}get path(){return this.history[this.history.length-1]}set path(e){k(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!k(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const n=e.pathname;let t=-1;for(;++t<n.length;)if(37===n.charCodeAt(t)&&50===n.charCodeAt(t+1)){const e=n.charCodeAt(t+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(n)}(e)}(e)),S(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?d(this.path):void 0}set dirname(e){C(this.basename,"dirname"),this.path=m(e||"",this.basename)}get basename(){return"string"==typeof this.path?p(this.path):void 0}set basename(e){S(e,"basename"),w(e,"basename"),this.path=m(this.dirname||"",e)}get extname(){return"string"==typeof this.path?h(this.path):void 0}set extname(e){if(w(e,"extname"),C(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=m(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?p(this.path,this.extname):void 0}set stem(e){S(e,"stem"),w(e,"stem"),this.path=m(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,n,t){const r=new f(e,n,t);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,n,t){const r=this.message(e,n,t);return r.fatal=null,r}fail(e,n,t){const r=this.message(e,n,t);throw r.fatal=!0,r}}function w(e,n){if(e&&e.includes(g))throw new Error("`"+n+"` cannot be a path: did not expect `"+g+"`")}function S(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function C(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function E(e){if(e)throw e}var A=t(9710);function F(e){if("object"!=typeof e||null===e)return!1;const n=Object.getPrototypeOf(e);return!(null!==n&&n!==Object.prototype&&null!==Object.getPrototypeOf(n)||Symbol.toStringTag in e||Symbol.iterator in e)}const T=function e(){const n=function(){const e=[],n={run:function(...n){let t=-1;const r=n.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...l){const u=e[++t];let a=-1;if(i)r(i);else{for(;++a<n.length;)null!==l[a]&&void 0!==l[a]||(l[a]=n[a]);n=l,u?function(e,n){let t;return function(...n){const i=e.length>n.length;let l;i&&n.push(r);try{l=e.apply(this,n)}catch(e){if(i&&t)throw e;return r(e)}i||(l instanceof Promise?l.then(o,r):l instanceof Error?r(l):o(l))};function r(e,...r){t||(t=!0,n(e,...r))}function o(e){r(null,e)}}(u,o)(...l):r(null,...l)}}(null,...n)},use:function(t){if("function"!=typeof t)throw new TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),n}};return n}(),t=[];let r,o={},i=-1;return u.data=function(e,n){return"string"==typeof e?2===arguments.length?(O("data",r),o[e]=n,u):P.call(o,e)&&o[e]||null:e?(O("data",r),o=e,u):o},u.Parser=void 0,u.Compiler=void 0,u.freeze=function(){if(r)return u;for(;++i<t.length;){const[e,...r]=t[i];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const o=e.call(u,...r);"function"==typeof o&&n.use(o)}return r=!0,i=Number.POSITIVE_INFINITY,u},u.attachers=t,u.use=function(e,...n){let i;if(O("use",r),null==e);else if("function"==typeof e)s(e,...n);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?c(e):a(e)}return i&&(o.settings=Object.assign(o.settings||{},i)),u;function l(e){if("function"==typeof e)s(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[n,...t]=e;s(n,...t)}else a(e)}}function a(e){c(e.plugins),e.settings&&(i=Object.assign(i||{},e.settings))}function c(e){let n=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++n<e.length;)l(e[n])}}function s(e,n){let r,o=-1;for(;++o<t.length;)if(t[o][0]===e){r=t[o];break}r?(F(r[1])&&F(n)&&(n=A(!0,r[1],n)),r[1]=n):t.push([...arguments])}},u.parse=function(e){u.freeze();const n=R(e),t=u.Parser;return L("parse",t),D(t,"parse")?new t(String(n),n).parse():t(String(n),n)},u.stringify=function(e,n){u.freeze();const t=R(n),r=u.Compiler;return I("stringify",r),M(e),D(r,"compile")?new r(e,t).compile():r(e,t)},u.run=function(e,t,r){if(M(e),u.freeze(),r||"function"!=typeof t||(r=t,t=void 0),!r)return new Promise(o);function o(o,i){n.run(e,R(t),(function(n,t,l){t=t||e,n?i(n):o?o(t):r(null,t,l)}))}o(null,r)},u.runSync=function(e,n){let t,r;return u.run(e,n,(function(e,n){E(e),t=n,r=!0})),z("runSync","run",r),t},u.process=function(e,n){if(u.freeze(),L("process",u.Parser),I("process",u.Compiler),!n)return new Promise(t);function t(t,r){const o=R(e);function i(e,o){e||!o?r(e):t?t(o):n(null,o)}u.run(u.parse(o),o,((e,n,t)=>{if(!e&&n&&t){const o=u.stringify(n,t);null==o||("string"==typeof(r=o)||l(r)?t.value=o:t.result=o),i(e,t)}else i(e);var r}))}t(null,n)},u.processSync=function(e){let n;u.freeze(),L("processSync",u.Parser),I("processSync",u.Compiler);const t=R(e);return u.process(t,(function(e){n=!0,E(e)})),z("processSync","process",n),t},u;function u(){const n=e();let r=-1;for(;++r<t.length;)n.use(...t[r]);return n.data(A(!0,{},o)),n}}().freeze(),P={}.hasOwnProperty;function D(e,n){return"function"==typeof e&&e.prototype&&(function(e){let n;for(n in e)if(P.call(e,n))return!0;return!1}(e.prototype)||n in e.prototype)}function L(e,n){if("function"!=typeof n)throw new TypeError("Cannot `"+e+"` without `Parser`")}function I(e,n){if("function"!=typeof n)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function O(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function M(e){if(!F(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function z(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function R(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new b(e)}const B={};function N(e,n,t){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||t?e.value:"";if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return _(e.children,n,t)}return Array.isArray(e)?_(e,n,t):""}function _(e,n,t){const r=[];let o=-1;for(;++o<e.length;)r[o]=N(e[o],n,t);return r.join("")}function j(e,n,t,r){const o=e.length;let i,l=0;if(n=n<0?-n>o?0:o+n:n>o?o:n,t=t>0?t:0,r.length<1e4)i=Array.from(r),i.unshift(n,t),e.splice(...i);else for(t&&e.splice(n,t);l<r.length;)i=r.slice(l,l+1e4),i.unshift(n,0),e.splice(...i),l+=1e4,n+=1e4}function H(e,n){return e.length>0?(j(e,e.length,0,n),e):n}const U={}.hasOwnProperty;function V(e,n){let t;for(t in n){const r=(U.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let i;if(o)for(i in o){U.call(r,i)||(r[i]=[]);const e=o[i];q(r[i],Array.isArray(e)?e:e?[e]:[])}}}function q(e,n){let t=-1;const r=[];for(;++t<n.length;)("after"===n[t].add?e:r).push(n[t]);j(e,0,0,r)}const $=re(/[A-Za-z]/),W=re(/[\dA-Za-z]/),Q=re(/[#-'*+\--9=?A-Z^-~]/);function Y(e){return null!==e&&(e<32||127===e)}const Z=re(/\d/),K=re(/[\dA-Fa-f]/),X=re(/[!-/:-@[-`{-~]/);function J(e){return null!==e&&e<-2}function G(e){return null!==e&&(e<0||32===e)}function ee(e){return-2===e||-1===e||32===e}const ne=re(/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\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\u1B7D\u1B7E\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-\u2E5D\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]/),te=re(/\s/);function re(e){return function(n){return null!==n&&e.test(String.fromCharCode(n))}}function oe(e,n,t,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){return ee(r)?(e.enter(t),l(r)):n(r)};function l(r){return ee(r)&&i++<o?(e.consume(r),l):(e.exit(t),n(r))}}const ie={tokenize:function(e){const n=e.attempt(this.parser.constructs.contentInitial,(function(t){if(null!==t)return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),oe(e,n,"linePrefix");e.consume(t)}),(function(n){return e.enter("paragraph"),r(n)}));let t;return n;function r(n){const r=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=r),t=r,o(n)}function o(n){return null===n?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(n)):J(n)?(e.consume(n),e.exit("chunkText"),r):(e.consume(n),o)}}},le={tokenize:function(e){const n=this,t=[];let r,o,i,l=0;return u;function u(r){if(l<t.length){const o=t[l];return n.containerState=o[1],e.attempt(o[0].continuation,a,c)(r)}return c(r)}function a(e){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,r&&x();const t=n.events.length;let o,i=t;for(;i--;)if("exit"===n.events[i][0]&&"chunkFlow"===n.events[i][1].type){o=n.events[i][1].end;break}y(l);let u=t;for(;u<n.events.length;)n.events[u][1].end=Object.assign({},o),u++;return j(n.events,i+1,0,n.events.slice(t)),n.events.length=u,c(e)}return u(e)}function c(o){if(l===t.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);n.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ue,s,f)(o)}function s(e){return r&&x(),y(l),p(e)}function f(e){return n.parser.lazy[n.now().line]=l!==t.length,i=n.now().offset,h(e)}function p(t){return n.containerState={},e.attempt(ue,d,h)(t)}function d(e){return l++,t.push([n.currentConstruct,n.containerState]),p(e)}function h(t){return null===t?(r&&x(),y(0),void e.consume(t)):(r=r||n.parser.flow(n.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),m(t))}function m(t){return null===t?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(t)):J(t)?(e.consume(t),g(e.exit("chunkFlow")),l=0,n.interrupt=void 0,u):(e.consume(t),m)}function g(e,t){const u=n.sliceStream(e);if(t&&u.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(u),n.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const t=n.events.length;let o,u,a=t;for(;a--;)if("exit"===n.events[a][0]&&"chunkFlow"===n.events[a][1].type){if(o){u=n.events[a][1].end;break}o=!0}for(y(l),e=t;e<n.events.length;)n.events[e][1].end=Object.assign({},u),e++;j(n.events,a+1,0,n.events.slice(t)),n.events.length=e}}function y(r){let o=t.length;for(;o-- >r;){const r=t[o];n.containerState=r[1],r[0].exit.call(n,e)}t.length=r}function x(){r.write([null]),o=void 0,r=void 0,n.containerState._closeFlow=void 0}}},ue={tokenize:function(e,n,t){return oe(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ae={tokenize:function(e,n,t){return function(n){return ee(n)?oe(e,r,"linePrefix")(n):r(n)};function r(e){return null===e||J(e)?n(e):t(e)}},partial:!0};function ce(e){const n={};let t,r,o,i,l,u,a,c=-1;for(;++c<e.length;){for(;c in n;)c=n[c];if(t=e[c],c&&"chunkFlow"===t[1].type&&"listItemPrefix"===e[c-1][1].type&&(u=t[1]._tokenizer.events,o=0,o<u.length&&"lineEndingBlank"===u[o][1].type&&(o+=2),o<u.length&&"content"===u[o][1].type))for(;++o<u.length&&"content"!==u[o][1].type;)"chunkText"===u[o][1].type&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===t[0])t[1].contentType&&(Object.assign(n,se(e,c)),c=n[c],a=!0);else if(t[1]._container){for(o=c,r=void 0;o--&&(i=e[o],"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type);)"enter"===i[0]&&(r&&(e[r][1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);r&&(t[1].end=Object.assign({},e[r][1].start),l=e.slice(r,c),l.unshift(t),j(e,r,c-r+1,l))}}return!a}function se(e,n){const t=e[n][1],r=e[n][2];let o=n-1;const i=[],l=t._tokenizer||r.parser[t.contentType](t.start),u=l.events,a=[],c={};let s,f,p=-1,d=t,h=0,m=0;const g=[m];for(;d;){for(;e[++o][1]!==d;);i.push(o),d._tokenizer||(s=r.sliceStream(d),d.next||s.push(null),f&&l.defineSkip(d.start),d._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(s),d._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=t;++p<u.length;)"exit"===u[p][0]&&"enter"===u[p-1][0]&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(m=p+1,g.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(l.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){const n=u.slice(g[p],g[p+1]),t=i.pop();a.unshift([t,t+n.length-1]),j(e,t,2,n)}for(p=-1;++p<a.length;)c[h+a[p][0]]=h+a[p][1],h+=a[p][1]-a[p][0]-1;return c}const fe={tokenize:function(e,n){let t;return function(n){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),r(n)};function r(n){return null===n?o(n):J(n)?e.check(pe,i,o)(n):(e.consume(n),r)}function o(t){return e.exit("chunkContent"),e.exit("content"),n(t)}function i(n){return e.consume(n),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}},resolve:function(e){return ce(e),e}},pe={tokenize:function(e,n,t){const r=this;return function(n){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),oe(e,o,"linePrefix")};function o(o){if(null===o||J(o))return t(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}},partial:!0},de={tokenize:function(e){const n=this,t=e.attempt(ae,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,oe(e,e.attempt(this.parser.constructs.flow,r,e.attempt(fe,r)),"linePrefix")));return t;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n.currentConstruct=void 0,t;e.consume(r)}}},he={resolveAll:xe()},me=ye("string"),ge=ye("text");function ye(e){return{tokenize:function(n){const t=this,r=this.parser.constructs[e],o=n.attempt(r,i,l);return i;function i(e){return a(e)?o(e):l(e)}function l(e){if(null!==e)return n.enter("data"),n.consume(e),u;n.consume(e)}function u(e){return a(e)?(n.exit("data"),o(e)):(n.consume(e),u)}function a(e){if(null===e)return!0;const n=r[e];let o=-1;if(n)for(;++o<n.length;){const e=n[o];if(!e.previous||e.previous.call(t,t.previous))return!0}return!1}},resolveAll:xe("text"===e?ke:void 0)}}function xe(e){return function(n,t){let r,o=-1;for(;++o<=n.length;)void 0===r?n[o]&&"data"===n[o][1].type&&(r=o,o++):n[o]&&"data"===n[o][1].type||(o!==r+2&&(n[r][1].end=n[o-1][1].end,n.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(n,t):n}}function ke(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||"lineEnding"===e[t][1].type)&&"data"===e[t-1][1].type){const r=e[t-1][1],o=n.sliceStream(r);let i,l=o.length,u=-1,a=0;for(;l--;){const e=o[l];if("string"==typeof e){for(u=e.length;32===e.charCodeAt(u-1);)a++,u--;if(u)break;u=-1}else if(-2===e)i=!0,a++;else if(-1!==e){l++;break}}if(a){const o={type:t===e.length||i||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+l,_bufferIndex:l?u:r.start._bufferIndex+u},end:Object.assign({},r.end)};r.end=Object.assign({},o.start),r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(t,0,["enter",o,n],["exit",o,n]),t+=2)}t++}return e}function ve(e,n,t){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(n=i(n,t),r.push(i))}return n}function be(e,n,t){let r=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let l=[],u=[],a=!0;const c={consume:function(e){J(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,k()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=e,a=!0},enter:function(e,n){const t=n||{};return t.type=e,t.start=h(),s.events.push(["enter",t,s]),u.push(t),t},exit:function(e){const n=u.pop();return n.end=h(),s.events.push(["exit",n,s]),n},attempt:y((function(e,n){x(e,n.from)})),check:y(g),interrupt:y(g,{interrupt:!0})},s={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:d,sliceSerialize:function(e,n){return function(e,n){let t=-1;const r=[];let o;for(;++t<e.length;){const i=e[t];let l;if("string"==typeof i)l=i;else switch(i){case-5:l="\r";break;case-4:l="\n";break;case-3:l="\r\n";break;case-2:l=n?" ":"\t";break;case-1:if(!n&&o)continue;l=" ";break;default:l=String.fromCharCode(i)}o=-2===i,r.push(l)}return r.join("")}(d(e),n)},now:h,defineSkip:function(e){o[e.line]=e.column,k()},write:function(e){return l=H(l,e),function(){let e;for(;r._index<l.length;){const n=l[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;)m(n.charCodeAt(r._bufferIndex));else m(n)}}(),null!==l[l.length-1]?[]:(x(n,0),s.events=ve(i,s.events,s),s.events)}};let f,p=n.tokenize.call(s,c);return n.resolveAll&&i.push(n),s;function d(e){return function(e,n){const t=n.start._index,r=n.start._bufferIndex,o=n.end._index,i=n.end._bufferIndex;let l;if(t===o)l=[e[t].slice(r,i)];else{if(l=e.slice(t,o),r>-1){const e=l[0];"string"==typeof e?l[0]=e.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}(l,e)}function h(){const{line:e,column:n,offset:t,_index:o,_bufferIndex:i}=r;return{line:e,column:n,offset:t,_index:o,_bufferIndex:i}}function m(e){a=void 0,f=e,p=p(e)}function g(e,n){n.restore()}function y(e,n){return function(t,o,i){let l,f,p,d;return Array.isArray(t)?g(t):"tokenize"in t?g([t]):(m=t,function(e){const n=null!==e&&m[e],t=null!==e&&m.null;return g([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(t)?t:t?[t]:[]])(e)});var m;function g(e){return l=e,f=0,0===e.length?i:y(e[f])}function y(e){return function(t){return d=function(){const e=h(),n=s.previous,t=s.currentConstruct,o=s.events.length,i=Array.from(u);return{restore:function(){r=e,s.previous=n,s.currentConstruct=t,s.events.length=o,u=i,k()},from:o}}(),p=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(n?Object.assign(Object.create(s),n):s,c,x,v)(t)}}function x(n){return a=!0,e(p,d),o}function v(e){return a=!0,d.restore(),++f<l.length?y(l[f]):i}}}function x(e,n){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&j(s.events,n,s.events.length-n,e.resolve(s.events.slice(n),s)),e.resolveTo&&(s.events=e.resolveTo(s.events,s))}function k(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const we={name:"thematicBreak",tokenize:function(e,n,t){let r,o=0;return function(n){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(n)};function i(i){return i===r?(e.enter("thematicBreakSequence"),l(i)):o>=3&&(null===i||J(i))?(e.exit("thematicBreak"),n(i)):t(i)}function l(n){return n===r?(e.consume(n),o++,l):(e.exit("thematicBreakSequence"),ee(n)?oe(e,i,"whitespace")(n):i(n))}}},Se={name:"list",tokenize:function(e,n,t){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,l=0;return function(n){const o=r.containerState.type||(42===n||43===n||45===n?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||n===r.containerState.marker:Z(n)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===n||45===n?e.check(we,t,a)(n):a(n);if(!r.interrupt||49===n)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(n)}return t(n)};function u(n){return Z(n)&&++l<10?(e.consume(n),u):(!r.interrupt||l<2)&&(r.containerState.marker?n===r.containerState.marker:41===n||46===n)?(e.exit("listItemValue"),a(n)):t(n)}function a(n){return e.enter("listItemMarker"),e.consume(n),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||n,e.check(ae,r.interrupt?t:c,e.attempt(Ce,f,s))}function c(e){return r.containerState.initialBlankLine=!0,i++,f(e)}function s(n){return ee(n)?(e.enter("listItemPrefixWhitespace"),e.consume(n),e.exit("listItemPrefixWhitespace"),f):t(n)}function f(t){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(t)}},continuation:{tokenize:function(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(ae,(function(t){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(e,n,"listItemIndent",r.containerState.size+1)(t)}),(function(t){return r.containerState.furtherBlankLines||!ee(t)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(t)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ee,n,o)(t))}));function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(e,e.attempt(Se,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},Ce={tokenize:function(e,n,t){const r=this;return oe(e,(function(e){const o=r.events[r.events.length-1];return!ee(e)&&o&&"listItemPrefixWhitespace"===o[1].type?n(e):t(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},Ee={tokenize:function(e,n,t){const r=this;return oe(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(e):t(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},Ae={name:"blockQuote",tokenize:function(e,n,t){const r=this;return function(n){if(62===n){const t=r.containerState;return t.open||(e.enter("blockQuote",{_container:!0}),t.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(n),e.exit("blockQuoteMarker"),o}return t(n)};function o(t){return ee(t)?(e.enter("blockQuotePrefixWhitespace"),e.consume(t),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(t))}},continuation:{tokenize:function(e,n,t){const r=this;return function(n){return ee(n)?oe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):o(n)};function o(r){return e.attempt(Ae,n,t)(r)}}},exit:function(e){e.exit("blockQuote")}};function Fe(e,n,t,r,o,i,l,u,a){const c=a||Number.POSITIVE_INFINITY;let s=0;return function(n){return 60===n?(e.enter(r),e.enter(o),e.enter(i),e.consume(n),e.exit(i),f):null===n||32===n||41===n||Y(n)?t(n):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),h(n))};function f(t){return 62===t?(e.enter(i),e.consume(t),e.exit(i),e.exit(o),e.exit(r),n):(e.enter(u),e.enter("chunkString",{contentType:"string"}),p(t))}function p(n){return 62===n?(e.exit("chunkString"),e.exit(u),f(n)):null===n||60===n||J(n)?t(n):(e.consume(n),92===n?d:p)}function d(n){return 60===n||62===n||92===n?(e.consume(n),p):p(n)}function h(o){return s||null!==o&&41!==o&&!G(o)?s<c&&40===o?(e.consume(o),s++,h):41===o?(e.consume(o),s--,h):null===o||32===o||40===o||Y(o)?t(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),n(o))}function m(n){return 40===n||41===n||92===n?(e.consume(n),h):h(n)}}function Te(e,n,t,r,o,i){const l=this;let u,a=0;return function(n){return e.enter(r),e.enter(o),e.consume(n),e.exit(o),e.enter(i),c};function c(f){return a>999||null===f||91===f||93===f&&!u||94===f&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(f):93===f?(e.exit(i),e.enter(o),e.consume(f),e.exit(o),e.exit(r),n):J(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),s(f))}function s(n){return null===n||91===n||93===n||J(n)||a++>999?(e.exit("chunkString"),c(n)):(e.consume(n),u||(u=!ee(n)),92===n?f:s)}function f(n){return 91===n||92===n||93===n?(e.consume(n),a++,s):s(n)}}function Pe(e,n,t,r,o,i){let l;return function(n){return 34===n||39===n||40===n?(e.enter(r),e.enter(o),e.consume(n),e.exit(o),l=40===n?41:n,u):t(n)};function u(t){return t===l?(e.enter(o),e.consume(t),e.exit(o),e.exit(r),n):(e.enter(i),a(t))}function a(n){return n===l?(e.exit(i),u(l)):null===n?t(n):J(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),oe(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(n))}function c(n){return n===l||null===n||J(n)?(e.exit("chunkString"),a(n)):(e.consume(n),92===n?s:c)}function s(n){return n===l||92===n?(e.consume(n),c):c(n)}}function De(e,n){let t;return function r(o){return J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t=!0,r):ee(o)?oe(e,r,t?"linePrefix":"lineSuffix")(o):n(o)}}function Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ie={name:"definition",tokenize:function(e,n,t){const r=this;let o;return function(n){return e.enter("definition"),function(n){return Te.call(r,e,i,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)}(n)};function i(n){return o=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===n?(e.enter("definitionMarker"),e.consume(n),e.exit("definitionMarker"),l):t(n)}function l(n){return G(n)?De(e,u)(n):u(n)}function u(n){return Fe(e,a,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(n)}function a(n){return e.attempt(Oe,c,c)(n)}function c(n){return ee(n)?oe(e,s,"whitespace")(n):s(n)}function s(i){return null===i||J(i)?(e.exit("definition"),r.parser.defined.push(o),n(i)):t(i)}}},Oe={tokenize:function(e,n,t){return function(n){return G(n)?De(e,r)(n):t(n)};function r(n){return Pe(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(n)}function o(n){return ee(n)?oe(e,i,"whitespace")(n):i(n)}function i(e){return null===e||J(e)?n(e):t(e)}},partial:!0},Me={name:"codeIndented",tokenize:function(e,n,t){const r=this;return function(n){return e.enter("codeIndented"),oe(e,o,"linePrefix",5)(n)};function o(e){const n=r.events[r.events.length-1];return n&&"linePrefix"===n[1].type&&n[2].sliceSerialize(n[1],!0).length>=4?i(e):t(e)}function i(n){return null===n?u(n):J(n)?e.attempt(ze,i,u)(n):(e.enter("codeFlowValue"),l(n))}function l(n){return null===n||J(n)?(e.exit("codeFlowValue"),i(n)):(e.consume(n),l)}function u(t){return e.exit("codeIndented"),n(t)}}},ze={tokenize:function(e,n,t){const r=this;return o;function o(n){return r.parser.lazy[r.now().line]?t(n):J(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):oe(e,i,"linePrefix",5)(n)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?n(e):J(e)?o(e):t(e)}},partial:!0},Re={name:"headingAtx",tokenize:function(e,n,t){let r=0;return function(n){return e.enter("atxHeading"),function(n){return e.enter("atxHeadingSequence"),o(n)}(n)};function o(n){return 35===n&&r++<6?(e.consume(n),o):null===n||G(n)?(e.exit("atxHeadingSequence"),i(n)):t(n)}function i(t){return 35===t?(e.enter("atxHeadingSequence"),l(t)):null===t||J(t)?(e.exit("atxHeading"),n(t)):ee(t)?oe(e,i,"whitespace")(t):(e.enter("atxHeadingText"),u(t))}function l(n){return 35===n?(e.consume(n),l):(e.exit("atxHeadingSequence"),i(n))}function u(n){return null===n||35===n||G(n)?(e.exit("atxHeadingText"),i(n)):(e.consume(n),u)}},resolve:function(e,n){let t,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(t={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},j(e,i,o-i+1,[["enter",t,n],["enter",r,n],["exit",r,n],["exit",t,n]])),e}},Be={name:"setextUnderline",tokenize:function(e,n,t){const r=this;let o;return function(n){let l,u=r.events.length;for(;u--;)if("lineEnding"!==r.events[u][1].type&&"linePrefix"!==r.events[u][1].type&&"content"!==r.events[u][1].type){l="paragraph"===r.events[u][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!l?t(n):(e.enter("setextHeadingLine"),o=n,function(n){return e.enter("setextHeadingLineSequence"),i(n)}(n))};function i(n){return n===o?(e.consume(n),i):(e.exit("setextHeadingLineSequence"),ee(n)?oe(e,l,"lineSuffix")(n):l(n))}function l(r){return null===r||J(r)?(e.exit("setextHeadingLine"),n(r)):t(r)}},resolveTo:function(e,n){let t,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){t=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const l={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,n]),e.splice(o+1,0,["exit",e[t][1],n]),e[t][1].end=Object.assign({},e[o][1].end)):e[t][1]=l,e.push(["exit",l,n]),e}},Ne=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],_e=["pre","script","style","textarea"],je={name:"htmlFlow",tokenize:function(e,n,t){const r=this;let o,i,l,u,a;return function(n){return function(n){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c}(n)};function c(u){return 33===u?(e.consume(u),s):47===u?(e.consume(u),i=!0,d):63===u?(e.consume(u),o=3,r.interrupt?n:M):$(u)?(e.consume(u),l=String.fromCharCode(u),h):t(u)}function s(i){return 45===i?(e.consume(i),o=2,f):91===i?(e.consume(i),o=5,u=0,p):$(i)?(e.consume(i),o=4,r.interrupt?n:M):t(i)}function f(o){return 45===o?(e.consume(o),r.interrupt?n:M):t(o)}function p(o){return o==="CDATA[".charCodeAt(u++)?(e.consume(o),6===u?r.interrupt?n:A:p):t(o)}function d(n){return $(n)?(e.consume(n),l=String.fromCharCode(n),h):t(n)}function h(u){if(null===u||47===u||62===u||G(u)){const a=47===u,c=l.toLowerCase();return a||i||!_e.includes(c)?Ne.includes(l.toLowerCase())?(o=6,a?(e.consume(u),m):r.interrupt?n(u):A(u)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(u):i?g(u):y(u)):(o=1,r.interrupt?n(u):A(u))}return 45===u||W(u)?(e.consume(u),l+=String.fromCharCode(u),h):t(u)}function m(o){return 62===o?(e.consume(o),r.interrupt?n:A):t(o)}function g(n){return ee(n)?(e.consume(n),g):C(n)}function y(n){return 47===n?(e.consume(n),C):58===n||95===n||$(n)?(e.consume(n),x):ee(n)?(e.consume(n),y):C(n)}function x(n){return 45===n||46===n||58===n||95===n||W(n)?(e.consume(n),x):k(n)}function k(n){return 61===n?(e.consume(n),v):ee(n)?(e.consume(n),k):y(n)}function v(n){return null===n||60===n||61===n||62===n||96===n?t(n):34===n||39===n?(e.consume(n),a=n,b):ee(n)?(e.consume(n),v):w(n)}function b(n){return n===a?(e.consume(n),a=null,S):null===n||J(n)?t(n):(e.consume(n),b)}function w(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||G(n)?k(n):(e.consume(n),w)}function S(e){return 47===e||62===e||ee(e)?y(e):t(e)}function C(n){return 62===n?(e.consume(n),E):t(n)}function E(n){return null===n||J(n)?A(n):ee(n)?(e.consume(n),E):t(n)}function A(n){return 45===n&&2===o?(e.consume(n),D):60===n&&1===o?(e.consume(n),L):62===n&&4===o?(e.consume(n),z):63===n&&3===o?(e.consume(n),M):93===n&&5===o?(e.consume(n),O):!J(n)||6!==o&&7!==o?null===n||J(n)?(e.exit("htmlFlowData"),F(n)):(e.consume(n),A):(e.exit("htmlFlowData"),e.check(He,R,F)(n))}function F(n){return e.check(Ue,T,R)(n)}function T(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),P}function P(n){return null===n||J(n)?F(n):(e.enter("htmlFlowData"),A(n))}function D(n){return 45===n?(e.consume(n),M):A(n)}function L(n){return 47===n?(e.consume(n),l="",I):A(n)}function I(n){if(62===n){const t=l.toLowerCase();return _e.includes(t)?(e.consume(n),z):A(n)}return $(n)&&l.length<8?(e.consume(n),l+=String.fromCharCode(n),I):A(n)}function O(n){return 93===n?(e.consume(n),M):A(n)}function M(n){return 62===n?(e.consume(n),z):45===n&&2===o?(e.consume(n),M):A(n)}function z(n){return null===n||J(n)?(e.exit("htmlFlowData"),R(n)):(e.consume(n),z)}function R(t){return e.exit("htmlFlow"),n(t)}},resolveTo:function(e){let n=e.length;for(;n--&&("enter"!==e[n][0]||"htmlFlow"!==e[n][1].type););return n>1&&"linePrefix"===e[n-2][1].type&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e},concrete:!0},He={tokenize:function(e,n,t){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ae,n,t)}},partial:!0},Ue={tokenize:function(e,n,t){const r=this;return function(n){return J(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):t(n)};function o(e){return r.parser.lazy[r.now().line]?t(e):n(e)}},partial:!0},Ve={tokenize:function(e,n,t){const r=this;return function(n){return null===n?t(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?t(e):n(e)}},partial:!0},qe={name:"codeFenced",tokenize:function(e,n,t){const r=this,o={tokenize:function(e,n,t){let o=0;return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),l};function l(n){return e.enter("codeFencedFence"),ee(n)?oe(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):a(n)}function a(n){return n===i?(e.enter("codeFencedFenceSequence"),c(n)):t(n)}function c(n){return n===i?(o++,e.consume(n),c):o>=u?(e.exit("codeFencedFenceSequence"),ee(n)?oe(e,s,"whitespace")(n):s(n)):t(n)}function s(r){return null===r||J(r)?(e.exit("codeFencedFence"),n(r)):t(r)}},partial:!0};let i,l=0,u=0;return function(n){return function(n){const t=r.events[r.events.length-1];return l=t&&"linePrefix"===t[1].type?t[2].sliceSerialize(t[1],!0).length:0,i=n,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(n)}(n)};function a(n){return n===i?(u++,e.consume(n),a):u<3?t(n):(e.exit("codeFencedFenceSequence"),ee(n)?oe(e,c,"whitespace")(n):c(n))}function c(t){return null===t||J(t)?(e.exit("codeFencedFence"),r.interrupt?n(t):e.check(Ve,d,x)(t)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),s(t))}function s(n){return null===n||J(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(n)):ee(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),oe(e,f,"whitespace")(n)):96===n&&n===i?t(n):(e.consume(n),s)}function f(n){return null===n||J(n)?c(n):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(n))}function p(n){return null===n||J(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(n)):96===n&&n===i?t(n):(e.consume(n),p)}function d(n){return e.attempt(o,x,h)(n)}function h(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),m}function m(n){return l>0&&ee(n)?oe(e,g,"linePrefix",l+1)(n):g(n)}function g(n){return null===n||J(n)?e.check(Ve,d,x)(n):(e.enter("codeFlowValue"),y(n))}function y(n){return null===n||J(n)?(e.exit("codeFlowValue"),g(n)):(e.consume(n),y)}function x(t){return e.exit("codeFenced"),n(t)}},concrete:!0},$e=document.createElement("i");function We(e){const n="&"+e+";";$e.innerHTML=n;const t=$e.textContent;return(59!==t.charCodeAt(t.length-1)||"semi"===e)&&t!==n&&t}const Qe={name:"characterReference",tokenize:function(e,n,t){const r=this;let o,i,l=0;return function(n){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(n),e.exit("characterReferenceMarker"),u};function u(n){return 35===n?(e.enter("characterReferenceMarkerNumeric"),e.consume(n),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,i=W,c(n))}function a(n){return 88===n||120===n?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(n),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=K,c):(e.enter("characterReferenceValue"),o=7,i=Z,c(n))}function c(u){if(59===u&&l){const o=e.exit("characterReferenceValue");return i!==W||We(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),n):t(u)}return i(u)&&l++<o?(e.consume(u),c):t(u)}}},Ye={name:"characterEscape",tokenize:function(e,n,t){return function(n){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(n),e.exit("escapeMarker"),r};function r(r){return X(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(r)}}},Ze={name:"lineEnding",tokenize:function(e,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),oe(e,n,"linePrefix")}}},Ke={name:"labelEnd",tokenize:function(e,n,t){const r=this;let o,i,l=r.events.length;for(;l--;)if(("labelImage"===r.events[l][1].type||"labelLink"===r.events[l][1].type)&&!r.events[l][1]._balanced){o=r.events[l][1];break}return function(n){return o?o._inactive?s(n):(i=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelEnd"),u):t(n)};function u(n){return 40===n?e.attempt(Xe,c,i?c:s)(n):91===n?e.attempt(Je,c,i?a:s)(n):i?c(n):s(n)}function a(n){return e.attempt(Ge,c,s)(n)}function c(e){return n(e)}function s(e){return o._balanced=!0,t(e)}},resolveTo:function(e,n){let t,r,o,i,l=e.length,u=0;for(;l--;)if(t=e[l][1],r){if("link"===t.type||"labelLink"===t.type&&t._inactive)break;"enter"===e[l][0]&&"labelLink"===t.type&&(t._inactive=!0)}else if(o){if("enter"===e[l][0]&&("labelImage"===t.type||"labelLink"===t.type)&&!t._balanced&&(r=l,"labelLink"!==t.type)){u=2;break}}else"labelEnd"===t.type&&(o=l);const a={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[o][1].end)},s={type:"labelText",start:Object.assign({},e[r+u+2][1].end),end:Object.assign({},e[o-2][1].start)};return i=[["enter",a,n],["enter",c,n]],i=H(i,e.slice(r+1,r+u+3)),i=H(i,[["enter",s,n]]),i=H(i,ve(n.parser.constructs.insideSpan.null,e.slice(r+u+4,o-3),n)),i=H(i,[["exit",s,n],e[o-2],e[o-1],["exit",c,n]]),i=H(i,e.slice(o+1)),i=H(i,[["exit",a,n]]),j(e,r,e.length,i),e},resolveAll:function(e){let n=-1;for(;++n<e.length;){const t=e[n][1];"labelImage"!==t.type&&"labelLink"!==t.type&&"labelEnd"!==t.type||(e.splice(n+1,"labelImage"===t.type?4:2),t.type="data",n++)}return e}},Xe={tokenize:function(e,n,t){return function(n){return e.enter("resource"),e.enter("resourceMarker"),e.consume(n),e.exit("resourceMarker"),r};function r(n){return G(n)?De(e,o)(n):o(n)}function o(n){return 41===n?c(n):Fe(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(n)}function i(n){return G(n)?De(e,u)(n):c(n)}function l(e){return t(e)}function u(n){return 34===n||39===n||40===n?Pe(e,a,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(n):c(n)}function a(n){return G(n)?De(e,c)(n):c(n)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),n):t(r)}}},Je={tokenize:function(e,n,t){const r=this;return function(n){return Te.call(r,e,o,i,"reference","referenceMarker","referenceString")(n)};function o(e){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(e):t(e)}function i(e){return t(e)}}},Ge={tokenize:function(e,n,t){return function(n){return e.enter("reference"),e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),n):t(r)}}},en={name:"labelStartImage",tokenize:function(e,n,t){const r=this;return function(n){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(n),e.exit("labelImageMarker"),o};function o(n){return 91===n?(e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelImage"),i):t(n)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?t(e):n(e)}},resolveAll:Ke.resolveAll};function nn(e){return null===e||G(e)||te(e)?1:ne(e)?2:void 0}const tn={name:"attention",tokenize:function(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,o=nn(r);let i;return function(n){return i=n,e.enter("attentionSequence"),l(n)};function l(u){if(u===i)return e.consume(u),l;const a=e.exit("attentionSequence"),c=nn(u),s=!c||2===c&&o||t.includes(u),f=!o||2===o&&c||t.includes(r);return a._open=Boolean(42===i?s:s&&(o||!f)),a._close=Boolean(42===i?f:f&&(c||!s)),n(u)}},resolveAll:function(e,n){let t,r,o,i,l,u,a,c,s=-1;for(;++s<e.length;)if("enter"===e[s][0]&&"attentionSequence"===e[s][1].type&&e[s][1]._close)for(t=s;t--;)if("exit"===e[t][0]&&"attentionSequence"===e[t][1].type&&e[t][1]._open&&n.sliceSerialize(e[t][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[t][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[t][1].end.offset-e[t][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[t][1].end.offset-e[t][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const f=Object.assign({},e[t][1].end),p=Object.assign({},e[s][1].start);rn(f,-u),rn(p,u),i={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[t][1].end)},l={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[s][1].start),end:p},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[t][1].end),end:Object.assign({},e[s][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({}