bloom-layout
Version:
layout components used in bloom packages
1 lines • 211 kB
JavaScript
"use strict";function _interopDefault(r){return r&&"object"==typeof r&&"default"in r?r.default:r}function extend(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];for(var a in t)hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r}function unwrapExports(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function createCommonjsModule(r,e){return e={exports:{}},r(e,e.exports),e.exports}function create(r){function e(e){return e&&(e=format.apply(null,arguments)),new r(e)}return e.displayName=r.displayName||r.name,e}function matters(r){var e,t=[],a=-1;"string"!=typeof r&&"length"in r||(r=[r]),e=r.length;for(;++a<e;)t[a]=matter(r[a]);return t}function matter(r){var e=r;if("string"==typeof e){if(!own.call(markers,e))throw fault_1("Missing matter definition for `%s`",e);e={type:e,marker:markers[e]}}else if("object"!=typeof e)throw fault_1("Expected matter to be an object, not `%j`",e);if(!own.call(e,"type"))throw fault_1("Missing `type` in matter `%j`",e);if(!own.call(e,"marker"))throw fault_1("Missing `marker` in matter `%j`",e);return e}function create$1(r){function e(e,t,i){var s,c,u,l,p,g;if(t.charAt(0)===a&&t.charAt(1)===a&&t.charAt(2)===a&&t.charAt(3)===n)for(s=o+n,c="",g="",u=3,l=t.length;++u<l;){if((p=t.charAt(u))===a&&(g||!c)&&t.charAt(u+1)===a&&t.charAt(u+2)===a)return!!i||(s+=g+o,e(s)({type:r.type,value:c}));p===n?g+=p:(s+=g+p,c+=g+p,g="")}}var t=r.type+"FrontMatter",a=r.marker,o=a+a+a,n="\n";return e.displayName=t,e.onlyAtStart=!0,[t,e]}function create$2(r){function e(r){return o+(r.value?"\n"+r.value:"")+"\n"+o}var t=r.type,a=r.marker,o=a+a+a;return e.displayName=t+"FrontMatter",[t,e]}function frontmatter(r){var e=this.Parser,t=this.Compiler,a=matters_1(r||["yaml"]);isRemarkParser(e)&&attachParser(e,a),isRemarkCompiler(t)&&attachCompiler(t,a)}function attachParser(r,e){var t,a=r.prototype,o=wrap(parse$1,e),n=[];for(t in o)n.push(t);a.blockMethods=n.concat(a.blockMethods),a.blockTokenizers=immutable(o,a.blockTokenizers)}function attachCompiler(r,e){var t=r.prototype;t.visitors=immutable(wrap(compile,e),t.visitors)}function wrap(r,e){for(var t,a={},o=e.length,n=-1;++n<o;)a[(t=r(e[n]))[0]]=t[1];return a}function isRemarkParser(r){return Boolean(r&&r.prototype&&r.prototype.blockTokenizers)}function isRemarkCompiler(r){return Boolean(r&&r.prototype&&r.prototype.visitors)}function unherit(r){function e(e){return r.apply(this,e)}function t(){return this instanceof t?r.apply(this,arguments):new e(arguments)}var a,o,n;inherits(t,r),inherits(e,t),a=t.prototype;for(o in a)(n=a[o])&&"object"==typeof n&&(a[o]="concat"in n?n.concat():immutable(n));return t}function factory(r,e,t){return function(){var a=t||this,o=a[r];return a[r]=!e,function(){a[r]=o}}}function factory$1(r){var e=indices(String(r));return{toPosition:offsetToPositionFactory(e),toOffset:positionToOffsetFactory(e)}}function offsetToPositionFactory(r){return function(e){var t=-1,a=r.length;if(e<0)return{};for(;++t<a;)if(r[t]>e)return{line:t+1,column:e-(r[t-1]||0)+1,offset:e};return{}}}function positionToOffsetFactory(r){return function(e){var t=e&&e.line,a=e&&e.column;return!isNaN(t)&&!isNaN(a)&&t-1 in r?(r[t-2]||0)+a-1||0:-1}}function indices(r){for(var e=[],t=r.indexOf("\n");-1!==t;)e.push(t+1),t=r.indexOf("\n",t+1);return e.push(r.length+1),e}function factory$2(r,e){return function(t){for(var a,o=0,n=t.indexOf("\\"),i=r[e],s=[];-1!==n;)s.push(t.slice(o,n)),o=n+1,(a=t.charAt(o))&&-1!==i.indexOf(a)||s.push("\\"),n=t.indexOf("\\",o);return s.push(t.slice(o)),s.join("")}}function decimal(r){var e="string"==typeof r?r.charCodeAt(0):r;return e>=48&&e<=57}function hexadecimal(r){var e="string"==typeof r?r.charCodeAt(0):r;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function alphabetical(r){var e="string"==typeof r?r.charCodeAt(0):r;return e>=97&&e<=122||e>=65&&e<=90}function alphanumerical(r){return isAlphabetical(r)||isDecimal(r)}function wrapper(r,e){var t,a,o={};e||(e={});for(a in defaults)t=e[a],o[a]=null===t||void 0===t?defaults[a]:t;return(o.position.indent||o.position.start)&&(o.indent=o.position.indent||[],o.position=o.position.start),parse$5(r,o)}function parse$5(r,e){function t(){return{line:B,column:I,offset:x+(_.offset||0)}}function a(e){return r.charAt(e)}function o(){F&&(P.push(F),y&&y.call(T,F,{start:b,end:t()}),F=EMPTY)}var n,i,s,c,u,l,p,g,f,d,h,m,D,E,b,C,A,w,q=e.additional,v=e.nonTerminated,y=e.text,L=e.reference,S=e.warning,T=e.textContext,N=e.referenceContext,k=e.warningContext,_=e.position,$=e.indent||[],R=r.length,x=0,O=-1,I=_.column||1,B=_.line||1,F=EMPTY,P=[];for(b=t(),p=S?function(r,e){var a=t();a.column+=e,a.offset+=e,S.call(k,MESSAGES[r],a,r)}:noop,x--,R++;++x<R;)if(c===NEWLINE&&(I=$[O]||1),(c=a(x))!==AMPERSAND)c===NEWLINE&&(B++,O++,I=0),c?(F+=c,I++):o();else{if((l=a(x+1))===TAB||l===NEWLINE||l===FORM_FEED||l===SPACE||l===LESS_THAN||l===AMPERSAND||l===EMPTY||q&&l===q){F+=c,I++;continue}for(h=m=x+1,w=m,l!==OCTOTHORP?D=NAMED:(l=a(w=++h))===X_LOWER||l===X_UPPER?(D=HEXADECIMAL,w=++h):D=DECIMAL,n=EMPTY,d=EMPTY,s=EMPTY,E=TESTS[D],w--;++w<R&&(l=a(w),E(l));)s+=l,D===NAMED&&own$1.call(legacy,s)&&(n=s,d=legacy[s]);(i=a(w)===SEMICOLON)&&(w++,D===NAMED&&own$1.call(characterEntities$1,s)&&(n=s,d=characterEntities$1[s])),A=1+w-m,(i||v)&&(s?D===NAMED?(i&&!d?p(NAMED_UNKNOWN,1):(n!==s&&(A=1+(w=h+n.length)-h,i=!1),i||(g=n?NAMED_NOT_TERMINATED:NAMED_EMPTY,e.attribute?(l=a(w))===EQUAL?(p(g,A),d=null):isAlphanumerical(l)?d=null:p(g,A):p(g,A))),u=d):(i||p(NUMERIC_NOT_TERMINATED,A),isProhibited(u=parseInt(s,BASE[D]))?(p(NUMERIC_PROHIBITED,A),u=REPLACEMENT):u in invalid?(p(NUMERIC_DISALLOWED,A),u=invalid[u]):(f=EMPTY,isWarning(u)&&p(NUMERIC_DISALLOWED,A),u>65535&&(f+=fromCharCode((u-=65536)>>>10|55296),u=56320|1023&u),u=f+fromCharCode(u))):D!==NAMED&&p(NUMERIC_EMPTY,A)),u?(o(),b=t(),x=w-1,I+=w-m+1,P.push(u),(C=t()).offset++,L&&L.call(N,u,{start:b,end:C},r.slice(m-1,w)),b=C):(s=r.slice(m-1,w),F+=s,I+=s.length,x=w-1)}return P.join(EMPTY)}function isProhibited(r){return r>=55296&&r<=57343||r>1114111}function isWarning(r){return r>=1&&r<=8||11===r||r>=13&&r<=31||r>=127&&r<=159||r>=64976&&r<=65007||65535==(65535&r)||65534==(65535&r)}function factory$3(r){function e(e){for(var t=r.offset,a=e.line,o=[];++a&&a in t;)o.push((t[a]||0)+1);return{start:e,indent:o}}function t(e,t,a){3!==a&&r.file.message(e,t)}function a(a,o,n){parseEntities(a,{position:e(o),warning:t,text:n,reference:n,textContext:r,referenceContext:r})}return a.raw=function(r,a){return parseEntities(r,{position:e(a),warning:t})},a}function mergeable(r){var e,t;return"text"!==r.type||!r.position||(e=r.position.start,t=r.position.end,e.line!==t.line||t.column-e.column===r.value.length)}function mergeText(r,e){return r.value+=e.value,r}function mergeBlockquote(r,e){return this.options.commonmark?e:(r.children=r.children.concat(e.children),r)}function factory$4(r){return function(e,t){function a(r){for(var e=-1,t=r.indexOf("\n");-1!==t;)w++,e=t,t=r.indexOf("\n",t+1);-1===e?q+=r.length:q=r.length-e,w in E&&(-1!==e?q+=E[w]:q<=E[w]&&(q=E[w]+1))}function o(){var r=[],e=w+1;return function(){for(var t=w+1;e<t;)r.push((E[e]||0)+1),e++;return r}}function n(){var r={line:w,column:q};return r.offset=D.toOffset(r),r}function i(r){this.start=r,this.end=n()}function s(r){e.substring(0,r.length)!==r&&D.file.fail(new Error("Incorrectly eaten value: please report this warning on http://git.io/vg5Ft"),n())}function c(){var r=n();return function(e,t){var a=e.position,o=a?a.start:r,n=[],s=a&&a.end.line,c=r.line;if(e.position=new i(o),a&&t&&a.indent){if(n=a.indent,s<c){for(;++s<c;)n.push((E[s]||0)+1);n.push(r.column)}t=n.concat(t)}return e.position.indent=t||[],e}}function u(r,e){var t=e?e.children:b,a=t[t.length-1];return a&&r.type===a.type&&r.type in MERGEABLE_NODES&&mergeable(a)&&mergeable(r)&&(r=MERGEABLE_NODES[r.type].call(D,a,r)),r!==a&&t.push(r),D.atStart&&0!==b.length&&D.exitStart(),r}function l(r){function t(r,e){return g(u(g(r),e),p)}function i(){var a=t.apply(null,arguments);return w=f.line,q=f.column,e=r+e,a}function l(){var t=g({});return w=f.line,q=f.column,e=r+e,t.position}var p=o(),g=c(),f=n();return s(r),t.reset=i,i.test=l,t.test=l,e=e.substring(r.length),a(r),p=p(),t}var p,g,f,d,h,m,D=this,E=D.offset,b=[],C=D[r+"Methods"],A=D[r+"Tokenizers"],w=t.line,q=t.column;if(!e)return b;for(l.now=n,l.file=D.file,a("");e;){for(p=-1,g=C.length,h=!1;++p<g&&(d=C[p],!(f=A[d])||f.onlyAtStart&&!D.atStart||f.notInList&&D.inList||f.notInBlock&&D.inBlock||f.notInLink&&D.inLink||(m=e.length,f.apply(D,[l,e]),!(h=m!==e.length))););h||D.file.fail(new Error("Infinite loop"),l.now())}return D.eof=n(),b}}function escapes(r){var e=r||{};return e.commonmark?commonmark:e.gfm?gfm:defaults$1}function setOptions(r){var e,t,a=this,o=a.options;if(null==r)r={};else{if("object"!=typeof r)throw new Error("Invalid value `"+r+"` for setting `options`");r=immutable(r)}for(e in defaults$2){if(null==(t=r[e])&&(t=o[e]),"blocks"!==e&&"boolean"!=typeof t||"blocks"===e&&"object"!=typeof t)throw new Error("Invalid value `"+t+"` for setting `options."+e+"`");r[e]=t}return a.options=r,a.escape=markdownEscapes(r),a}function visit(r,e,t,a){function o(r,a,o){var i;return a=a||(o?0:null),e&&r.type!==e||(i=t(r,a,o||null)),r.children&&!1!==i?n(r.children,r):i}function n(r,e){for(var t,n=a?-1:1,i=r.length,s=(a?i:-1)+n;s>-1&&s<i;){if((t=r[s])&&!1===o(t,s,e))return!1;s+=n}return!0}"function"==typeof e&&(a=t,t=e,e=null),o(r)}function removePosition(r,e){return unistUtilVisit(r,e?hard:soft),r}function hard(r){delete r.position}function soft(r){r.position=void 0}function parse$6(){var r,e=this,t=String(e.file),a={line:1,column:1,offset:0},o=immutable(a);return 65279===(t=t.replace(EXPRESSION_LINE_BREAKS,C_NEWLINE)).charCodeAt(0)&&(t=t.slice(1),o.column++,o.offset++),r={type:"root",children:e.tokenizeBlock(t,o),position:{start:a,end:e.eof||immutable(a)}},e.options.position||unistUtilRemovePosition(r,!0),r}function whitespace(r){return re$1.test("number"==typeof r?fromCode(r):r.charAt(0))}function newline(r,e,t){var a,o,n,i,s=e.charAt(0);if("\n"===s){if(t)return!0;for(i=1,a=e.length,o=s,n="";i<a&&(s=e.charAt(i),isWhitespaceCharacter(s));)n+=s,"\n"===s&&(o+=n,n=""),i++;r(o)}}function repeat(r,e){if("string"!=typeof r)throw new TypeError("expected a string");if(1===e)return r;if(2===e)return r+r;var t=r.length*e;if(cache!==r||void 0===cache)cache=r,res="";else if(res.length>=t)return res.substr(0,t);for(;t>res.length&&e>1;)1&e&&(res+=r),e>>=1,r+=r;return res+=r,res=res.substr(0,t)}function trimTrailingLines(r){for(var e=String(r),t=e.length;e.charAt(--t)===line;);return e.slice(0,t+1)}function indentedCode(r,e,t){for(var a,o,n,i=-1,s=e.length,c="",u="",l="",p="";++i<s;)if(a=e.charAt(i),n)if(n=!1,c+=l,u+=p,l="",p="",a===C_NEWLINE$1)l=a,p=a;else for(c+=a,u+=a;++i<s;){if(!(a=e.charAt(i))||a===C_NEWLINE$1){p=a,l=a;break}c+=a,u+=a}else if(a===C_SPACE&&e.charAt(i+1)===a&&e.charAt(i+2)===a&&e.charAt(i+3)===a)l+=CODE_INDENT,i+=3,n=!0;else if(a===C_TAB)l+=a,n=!0;else{for(o="";a===C_TAB||a===C_SPACE;)o+=a,a=e.charAt(++i);if(a!==C_NEWLINE$1)break;l+=o+a,p+=a}if(u)return!!t||r(c)({type:"code",lang:null,value:trimTrailingLines_1(u)})}function fencedCode(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d=this,h=d.options,m=e.length+1,D=0,E="";if(h.gfm){for(;D<m&&((n=e.charAt(D))===C_SPACE$1||n===C_TAB$1);)E+=n,D++;if(g=D,(n=e.charAt(D))===C_TILDE||n===C_TICK){for(D++,o=n,a=1,E+=n;D<m&&(n=e.charAt(D))===o;)E+=n,a++,D++;if(!(a<MIN_FENCE_COUNT)){for(;D<m&&((n=e.charAt(D))===C_SPACE$1||n===C_TAB$1);)E+=n,D++;for(i="",s="";D<m&&(n=e.charAt(D))!==C_NEWLINE$2&&n!==C_TILDE&&n!==C_TICK;)n===C_SPACE$1||n===C_TAB$1?s+=n:(i+=s+n,s=""),D++;if(!(n=e.charAt(D))||n===C_NEWLINE$2){if(t)return!0;for((f=r.now()).column+=E.length,f.offset+=E.length,E+=i,i=d.decode.raw(d.unescape(i),f),s&&(E+=s),s="",l="",p="",c="",u="";D<m;)if(n=e.charAt(D),c+=l,u+=p,l="",p="",n===C_NEWLINE$2){for(c?(l+=n,p+=n):E+=n,s="",D++;D<m&&(n=e.charAt(D))===C_SPACE$1;)s+=n,D++;if(l+=s,p+=s.slice(g),!(s.length>=CODE_INDENT_COUNT$1)){for(s="";D<m&&(n=e.charAt(D))===o;)s+=n,D++;if(l+=s,p+=s,!(s.length<a)){for(s="";D<m&&((n=e.charAt(D))===C_SPACE$1||n===C_TAB$1);)l+=n,p+=n,D++;if(!n||n===C_NEWLINE$2)break}}}else c+=n,p+=n,D++;return E+=c+l,r(E)({type:"code",lang:i||null,value:trimTrailingLines_1(u)})}}}}}function interrupt(r,e,t,a){for(var o,n,i,s,c,u,l=["pedantic","commonmark"],p=l.length,g=r.length,f=-1;++f<g;){for(n=(o=r[f])[1]||{},i=o[0],s=-1,u=!1;++s<p;)if(c=l[s],void 0!==n[c]&&n[c]!==t.options[c]){u=!0;break}if(!u&&e[i].apply(t,a))return!0}return!1}function blockquote(r,e,t){for(var a,o,n,i,s,c,u,l,p,g=this,f=g.offset,d=g.blockTokenizers,h=g.interruptBlockquote,m=r.now(),D=m.line,E=e.length,b=[],C=[],A=[],w=0;w<E&&((o=e.charAt(w))===C_SPACE$2||o===C_TAB$2);)w++;if(e.charAt(w)===C_GT){if(t)return!0;for(w=0;w<E;){for(u=w,l=!1,-1===(i=e.indexOf(C_NEWLINE$3,w))&&(i=E);w<E&&((o=e.charAt(w))===C_SPACE$2||o===C_TAB$2);)w++;if(e.charAt(w)===C_GT?(w++,l=!0,e.charAt(w)===C_SPACE$2&&w++):w=u,s=e.slice(w,i),!l&&!trim_1(s)){w=u;break}if(!l&&(n=e.slice(w),interrupt_1(h,d,g,[r,n,!0])))break;c=u===w?s:e.slice(u,i),A.push(w-u),b.push(c),C.push(s),w=i+1}for(w=-1,E=A.length,a=r(b.join(C_NEWLINE$3));++w<E;)f[D]=(f[D]||0)+A[w],D++;return p=g.enterBlock(),C=g.tokenizeBlock(C.join(C_NEWLINE$3),m),p(),a({type:"blockquote",children:C})}}function atxHeading(r,e,t){for(var a,o,n,i=this,s=i.options,c=e.length+1,u=-1,l=r.now(),p="",g="";++u<c;){if((a=e.charAt(u))!==C_SPACE$3&&a!==C_TAB$3){u--;break}p+=a}for(n=0;++u<=c;){if((a=e.charAt(u))!==C_HASH){u--;break}p+=a,n++}if(!(n>MAX_ATX_COUNT)&&n&&(s.pedantic||e.charAt(u+1)!==C_HASH)){for(c=e.length+1,o="";++u<c;){if((a=e.charAt(u))!==C_SPACE$3&&a!==C_TAB$3){u--;break}o+=a}if(s.pedantic||0!==o.length||!a||a===C_NEWLINE$4){if(t)return!0;for(p+=o,o="",g="";++u<c&&(a=e.charAt(u))&&a!==C_NEWLINE$4;)if(a===C_SPACE$3||a===C_TAB$3||a===C_HASH){for(;a===C_SPACE$3||a===C_TAB$3;)o+=a,a=e.charAt(++u);for(;a===C_HASH;)o+=a,a=e.charAt(++u);for(;a===C_SPACE$3||a===C_TAB$3;)o+=a,a=e.charAt(++u);u--}else g+=o+a,o="";return l.column+=p.length,l.offset+=p.length,p+=g+o,r(p)({type:"heading",depth:n,children:i.tokenizeInline(g,l)})}}}function thematicBreak(r,e,t){for(var a,o,n,i,s=-1,c=e.length+1,u="";++s<c&&((a=e.charAt(s))===C_TAB$4||a===C_SPACE$4);)u+=a;if(a===C_ASTERISK||a===C_DASH||a===C_UNDERSCORE)for(o=a,u+=a,n=1,i="";++s<c;)if((a=e.charAt(s))===o)n++,u+=i+o,i="";else{if(a!==C_SPACE$4)return n>=THEMATIC_BREAK_MARKER_COUNT&&(!a||a===C_NEWLINE$5)?(u+=i,!!t||r(u)({type:"thematicBreak"})):void 0;i+=a}}function indentation(r){for(var e,t=0,a=0,o=r.charAt(t),n={};o in characters;)a+=e=characters[o],e>1&&(a=Math.floor(a/e)*e),n[a]=t,o=r.charAt(++t);return{indent:a,stops:n}}function indentation$1(r,e){var t,a,o,n,i=r.split(C_NEWLINE$7),s=i.length+1,c=1/0,u=[];for(i.unshift(repeatString(C_SPACE$6,e)+"!");s--;)if(a=getIndentation(i[s]),u[s]=a.stops,0!==trim_1(i[s]).length){if(!a.indent){c=1/0;break}a.indent>0&&a.indent<c&&(c=a.indent)}if(c!==1/0)for(s=i.length;s--;){for(o=u[s],t=c;t&&!(t in o);)t--;n=0!==trim_1(i[s]).length&&c&&t!==c?C_TAB$6:"",i[s]=n+i[s].slice(t in o?o[t]+1:0)}return i.shift(),i.join(C_NEWLINE$7)}function list(r,e,t){for(var a,o,n,i,s,c,u,l,p,g,f,d,h,m,D,E,b,C,A,w,q,v,y,L,S=this,T=S.options.commonmark,N=S.options.pedantic,k=S.blockTokenizers,_=S.interruptList,$=0,R=e.length,x=null,O=0;$<R;){if((i=e.charAt($))===C_TAB$5)O+=TAB_SIZE-O%TAB_SIZE;else{if(i!==C_SPACE$5)break;O++}$++}if(!(O>=TAB_SIZE)){if(i=e.charAt($),a=T?LIST_ORDERED_COMMONMARK_MARKERS:LIST_ORDERED_MARKERS,!0===LIST_UNORDERED_MARKERS[i])s=i,n=!1;else{for(n=!0,o="";$<R&&(i=e.charAt($),isDecimal(i));)o+=i,$++;if(i=e.charAt($),!o||!0!==a[i])return;x=parseInt(o,10),s=i}if((i=e.charAt(++$))===C_SPACE$5||i===C_TAB$5){if(t)return!0;for($=0,m=[],D=[],E=[];$<R;){for(u=$,l=!1,L=!1,-1===(c=e.indexOf(C_NEWLINE$6,$))&&(c=R),y=$+TAB_SIZE,O=0;$<R;){if((i=e.charAt($))===C_TAB$5)O+=TAB_SIZE-O%TAB_SIZE;else{if(i!==C_SPACE$5)break;O++}$++}if(O>=TAB_SIZE&&(L=!0),b&&O>=b.indent&&(L=!0),i=e.charAt($),p=null,!L){if(!0===LIST_UNORDERED_MARKERS[i])p=i,$++,O++;else{for(o="";$<R&&(i=e.charAt($),isDecimal(i));)o+=i,$++;i=e.charAt($),$++,o&&!0===a[i]&&(p=i,O+=o.length+1)}if(p)if((i=e.charAt($))===C_TAB$5)O+=TAB_SIZE-O%TAB_SIZE,$++;else if(i===C_SPACE$5){for(y=$+TAB_SIZE;$<y&&e.charAt($)===C_SPACE$5;)$++,O++;$===y&&e.charAt($)===C_SPACE$5&&($-=TAB_SIZE-1,O-=TAB_SIZE-1)}else i!==C_NEWLINE$6&&""!==i&&(p=null)}if(p){if(!N&&s!==p)break;l=!0}else T||L||e.charAt(u)!==C_SPACE$5?T&&b&&(L=O>=b.indent||O>TAB_SIZE):L=!0,l=!1,$=u;if(f=e.slice(u,c),g=u===$?f:e.slice($,c),(p===C_ASTERISK$1||p===C_UNDERSCORE$1||p===C_DASH$1)&&k.thematicBreak.call(S,r,f,!0))break;if(d=h,h=!trim_1(g).length,L&&b)b.value=b.value.concat(E,f),D=D.concat(E,f),E=[];else if(l)0!==E.length&&(b.value.push(""),b.trail=E.concat()),b={value:[f],indent:O,trail:[]},m.push(b),D=D.concat(E,f),E=[];else if(h){if(d)break;E.push(f)}else{if(d)break;if(interrupt_1(_,k,S,[r,f,!0]))break;b.value=b.value.concat(E,f),D=D.concat(E,f),E=[]}$=c+1}for(q=r(D.join(C_NEWLINE$6)).reset({type:"list",ordered:n,start:x,loose:null,children:[]}),C=S.enterList(),A=S.enterBlock(),w=!1,$=-1,R=m.length;++$<R;)b=m[$].value.join(C_NEWLINE$6),v=r.now(),(b=r(b)(listItem(S,b,v),q)).loose&&(w=!0),b=m[$].trail.join(C_NEWLINE$6),$!==R-1&&(b+=C_NEWLINE$6),r(b);return C(),A(),q.loose=w,q}}}function listItem(r,e,t){var a,o,n=r.offset,i=null;return e=(r.options.pedantic?pedanticListItem:normalListItem).apply(null,arguments),r.options.gfm&&(a=e.match(EXPRESSION_TASK_ITEM))&&(o=a[0].length,i=a[1].toLowerCase()===C_X_LOWER,n[t.line]+=o,e=e.slice(o)),{type:"listItem",loose:EXPRESSION_LOOSE_LIST_ITEM.test(e)||e.charAt(e.length-1)===C_NEWLINE$6,checked:i,children:r.tokenizeBlock(e,t)}}function pedanticListItem(r,e,t){function a(r){return o[n]=(o[n]||0)+r.length,n++,""}var o=r.offset,n=t.line;return e=e.replace(EXPRESSION_PEDANTIC_BULLET,a),n=t.line,e.replace(EXPRESSION_INITIAL_INDENT,a)}function normalListItem(r,e,t){var a,o,n,i,s,c,u,l=r.offset,p=t.line;for(i=(e=e.replace(EXPRESSION_BULLET,function(r,e,t,i,s){return o=e+t+i,n=s,Number(t)<10&&o.length%2==1&&(t=C_SPACE$5+t),(a=e+repeatString(C_SPACE$5,t.length)+i)+n})).split(C_NEWLINE$6),(s=removeIndentation(e,getIndentation(a).indent).split(C_NEWLINE$6))[0]=n,l[p]=(l[p]||0)+o.length,p++,c=0,u=i.length;++c<u;)l[p]=(l[p]||0)+i[c].length-s[c].length,p++;return s.join(C_NEWLINE$6)}function setextHeading(r,e,t){for(var a,o,n,i,s,c=this,u=r.now(),l=e.length,p=-1,g="";++p<l;){if((n=e.charAt(p))!==C_SPACE$7||p>=MAX_HEADING_INDENT){p--;break}g+=n}for(a="",o="";++p<l;){if((n=e.charAt(p))===C_NEWLINE$8){p--;break}n===C_SPACE$7||n===C_TAB$7?o+=n:(a+=o+n,o="")}if(u.column+=g.length,u.offset+=g.length,g+=a+o,n=e.charAt(++p),i=e.charAt(++p),n===C_NEWLINE$8&&SETEXT_MARKERS[i]){for(g+=n,o=i,s=SETEXT_MARKERS[i];++p<l;){if((n=e.charAt(p))!==i){if(n!==C_NEWLINE$8)return;p--;break}o+=n}return!!t||r(g+o)({type:"heading",depth:s,children:c.tokenizeInline(a,u)})}}function blockHTML(r,e,t){for(var a,o,n,i,s,c,u,l=this.options.blocks,p=e.length,g=0,f=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+l.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(openCloseTag.source+"\\s*$"),/^$/,!1]];g<p&&((i=e.charAt(g))===C_TAB$8||i===C_SPACE$8);)g++;if(e.charAt(g)===C_LT){for(a=-1===(a=e.indexOf(C_NEWLINE$9,g+1))?p:a,o=e.slice(g,a),n=-1,s=f.length;++n<s;)if(f[n][0].test(o)){c=f[n];break}if(c){if(t)return c[2];if(g=a,!c[1].test(o))for(;g<p;){if(a=e.indexOf(C_NEWLINE$9,g+1),a=-1===a?p:a,o=e.slice(g+1,a),c[1].test(o)){o&&(g=a);break}g=a}return u=e.slice(0,g),r(u)({type:"html",value:u})}}}function collapse(r){return String(r).replace(/\s+/g," ")}function normalize(r){return collapseWhiteSpace(r).toLowerCase()}function footnoteDefinition(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d,h=this,m=h.offset;if(h.options.footnotes){for(a=0,o=e.length,n="",i=r.now(),s=i.line;a<o&&(p=e.charAt(a),isWhitespaceCharacter(p));)n+=p,a++;if(e.charAt(a)===C_BRACKET_OPEN&&e.charAt(a+1)===C_CARET){for(a=(n+=C_BRACKET_OPEN+C_CARET).length,u="";a<o&&(p=e.charAt(a))!==C_BRACKET_CLOSE;)p===C_BACKSLASH&&(u+=p,a++,p=e.charAt(a)),u+=p,a++;if(u&&e.charAt(a)===C_BRACKET_CLOSE&&e.charAt(a+1)===C_COLON){if(t)return!0;for(g=normalize_1(u),a=(n+=u+C_BRACKET_CLOSE+C_COLON).length;a<o&&((p=e.charAt(a))===C_TAB$9||p===C_SPACE$9);)n+=p,a++;for(i.column+=n.length,i.offset+=n.length,u="",c="",l="";a<o;){if((p=e.charAt(a))===C_NEWLINE$10){for(l=p,a++;a<o&&(p=e.charAt(a))===C_NEWLINE$10;)l+=p,a++;for(u+=l,l="";a<o&&(p=e.charAt(a))===C_SPACE$9;)l+=p,a++;if(0===l.length)break;u+=l}u&&(c+=u,u=""),c+=p,a++}return n+=c,c=c.replace(EXPRESSION_INITIAL_TAB,function(r){return m[s]=(m[s]||0)+r.length,s++,""}),f=r(n),d=h.enterBlock(),c=h.tokenizeBlock(c,i),d(),f({type:"footnoteDefinition",identifier:g,children:c})}}}}function definition(r,e,t){for(var a,o,n,i,s,c,u,l,p=this,g=p.options.commonmark,f=0,d=e.length,h="";f<d&&((i=e.charAt(f))===C_SPACE$10||i===C_TAB$10);)h+=i,f++;if((i=e.charAt(f))===C_BRACKET_OPEN$1){for(f++,h+=i,n="";f<d&&(i=e.charAt(f))!==C_BRACKET_CLOSE$1;)i===C_BACKSLASH$1&&(n+=i,f++,i=e.charAt(f)),n+=i,f++;if(n&&e.charAt(f)===C_BRACKET_CLOSE$1&&e.charAt(f+1)===C_COLON$1){for(c=n,f=(h+=n+C_BRACKET_CLOSE$1+C_COLON$1).length,n="";f<d&&((i=e.charAt(f))===C_TAB$10||i===C_SPACE$10||i===C_NEWLINE$11);)h+=i,f++;if(i=e.charAt(f),n="",a=h,i===C_LT$1){for(f++;f<d&&(i=e.charAt(f),isEnclosedURLCharacter(i));)n+=i,f++;if((i=e.charAt(f))===isEnclosedURLCharacter.delimiter)h+=C_LT$1+n+i,f++;else{if(g)return;f-=n.length+1,n=""}}if(!n){for(;f<d&&(i=e.charAt(f),isUnclosedURLCharacter(i));)n+=i,f++;h+=n}if(n){for(u=n,n="";f<d&&((i=e.charAt(f))===C_TAB$10||i===C_SPACE$10||i===C_NEWLINE$11);)n+=i,f++;if(i=e.charAt(f),s=null,i===C_DOUBLE_QUOTE?s=C_DOUBLE_QUOTE:i===C_SINGLE_QUOTE?s=C_SINGLE_QUOTE:i===C_PAREN_OPEN&&(s=C_PAREN_CLOSE$1),s){if(!n)return;for(f=(h+=n+i).length,n="";f<d&&(i=e.charAt(f))!==s;){if(i===C_NEWLINE$11){if(f++,(i=e.charAt(f))===C_NEWLINE$11||i===s)return;n+=C_NEWLINE$11}n+=i,f++}if((i=e.charAt(f))!==s)return;o=h,h+=n+i,f++,l=n,n=""}else n="",f=h.length;for(;f<d&&((i=e.charAt(f))===C_TAB$10||i===C_SPACE$10);)h+=i,f++;return(i=e.charAt(f))&&i!==C_NEWLINE$11?void 0:!!t||(a=r(a).test().end,u=p.decode.raw(p.unescape(u),a),l&&(o=r(o).test().end,l=p.decode.raw(p.unescape(l),o)),r(h)({type:"definition",identifier:normalize_1(c),title:l||null,url:u}))}}}}function isEnclosedURLCharacter(r){return r!==C_GT$1&&r!==C_BRACKET_OPEN$1&&r!==C_BRACKET_CLOSE$1}function isUnclosedURLCharacter(r){return r!==C_BRACKET_OPEN$1&&r!==C_BRACKET_CLOSE$1&&!isWhitespaceCharacter(r)}function table(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d,h,m,D,E,b,C,A,w,q,v,y,L,S=this;if(S.options.gfm){for(a=0,C=0,c=e.length+1,u=[];a<c;){if(v=e.indexOf(C_NEWLINE$12,a),y=e.indexOf(C_PIPE,a+1),-1===v&&(v=e.length),-1===y||y>v){if(C<MIN_TABLE_ROWS)return;break}u.push(e.slice(a,v)),C++,a=v+1}for(i=u.join(C_NEWLINE$12),a=0,c=(o=u.splice(1,1)[0]||[]).length,C--,n=!1,f=[];a<c;){if((p=o.charAt(a))===C_PIPE){if(g=null,!1===n){if(!1===L)return}else f.push(n),n=!1;L=!1}else if(p===C_DASH$3)g=!0,n=n||TABLE_ALIGN_NONE;else if(p===C_COLON$2)n=n===TABLE_ALIGN_LEFT?TABLE_ALIGN_CENTER:g&&n===TABLE_ALIGN_NONE?TABLE_ALIGN_RIGHT:TABLE_ALIGN_LEFT;else if(!isWhitespaceCharacter(p))return;a++}if(!1!==n&&f.push(n),!(f.length<MIN_TABLE_COLUMNS)){if(t)return!0;for(b=-1,w=[],q=r(i).reset({type:"table",align:f,children:w});++b<C;){for(A=u[b],s={type:"tableRow",children:[]},b&&r(C_NEWLINE$12),r(A).reset(s,q),c=A.length+1,a=0,l="",d="",h=!0,m=null,D=null;a<c;)if((p=A.charAt(a))!==C_TAB$11&&p!==C_SPACE$11){if(""===p||p===C_PIPE)if(h)r(p);else{if(p&&D){l+=p,a++;continue}!d&&!p||h||(i=d,l.length>1&&(p?(i+=l.slice(0,l.length-1),l=l.charAt(l.length-1)):(i+=l,l="")),E=r.now(),r(i)({type:"tableCell",children:S.tokenizeInline(d,E)},s)),r(l+p),l="",d=""}else if(l&&(d+=l,l=""),d+=p,p===C_BACKSLASH$2&&a!==c-2&&(d+=A.charAt(a+1),a++),p===C_TICK$1){for(m=1;A.charAt(a+1)===p;)d+=p,a++,m++;D?m>=D&&(D=0):D=m}h=!1,a++}else d?l+=p:r(p),a++;b||r(C_NEWLINE$12+o)}return q}}}function paragraph(r,e,t){for(var a,o,n,i,s,c=this,u=c.options,l=u.commonmark,p=u.gfm,g=c.blockTokenizers,f=c.interruptParagraph,d=e.indexOf(C_NEWLINE$13),h=e.length;d<h;){if(-1===d){d=h;break}if(e.charAt(d+1)===C_NEWLINE$13)break;if(l){for(i=0,a=d+1;a<h;){if((n=e.charAt(a))===C_TAB$12){i=TAB_SIZE$1;break}if(n!==C_SPACE$12)break;i++,a++}if(i>=TAB_SIZE$1){d=e.indexOf(C_NEWLINE$13,d+1);continue}}if(o=e.slice(d+1),interrupt_1(f,g,c,[r,o,!0]))break;if(g.list.call(c,r,o,!0)&&(c.inList||l||p&&!isDecimal(trim_1.left(o).charAt(0))))break;if(a=d,-1!==(d=e.indexOf(C_NEWLINE$13,d+1))&&""===trim_1(e.slice(a,d))){d=a;break}}return o=e.slice(0,d),""===trim_1(o)?(r(o),null):!!t||(s=r.now(),o=trimTrailingLines_1(o),r(o)({type:"paragraph",children:c.tokenizeInline(o,s)}))}function locate(r,e){return r.indexOf("\\",e)}function escape(r,e,t){var a,o,n=this;if("\\"===e.charAt(0)&&(a=e.charAt(1),-1!==n.escape.indexOf(a)))return!!t||(o="\n"===a?{type:"break"}:{type:"text",value:a},r("\\"+a)(o))}function locate$2(r,e){return r.indexOf("<",e)}function autoLink(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d;if(e.charAt(0)===C_LT$2){for(a=this,o="",n=e.length,i=0,s="",u=!1,l="",i++,o=C_LT$2;i<n&&(c=e.charAt(i),!(isWhitespaceCharacter(c)||c===C_GT$2||c===C_AT_SIGN||":"===c&&e.charAt(i+1)===C_SLASH));)s+=c,i++;if(s){if(l+=s,s="",c=e.charAt(i),l+=c,i++,c===C_AT_SIGN)u=!0;else{if(":"!==c||e.charAt(i+1)!==C_SLASH)return;l+=C_SLASH,i++}for(;i<n&&(c=e.charAt(i),!isWhitespaceCharacter(c)&&c!==C_GT$2);)s+=c,i++;if(c=e.charAt(i),s&&c===C_GT$2)return!!t||(l+=s,g=l,o+=l+c,p=r.now(),p.column++,p.offset++,u&&(l.slice(0,MAILTO_LENGTH).toLowerCase()===MAILTO?(g=g.substr(MAILTO_LENGTH),p.column+=MAILTO_LENGTH,p.offset+=MAILTO_LENGTH):l=MAILTO+l),f=a.inlineTokenizers.escape,a.inlineTokenizers.escape=null,d=a.enterLink(),g=a.tokenizeInline(g,p),a.inlineTokenizers.escape=f,d(),r(o)({type:"link",title:null,url:parseEntities(l),children:g}))}}}function locate$4(r,e){var t,a=PROTOCOLS$1.length,o=-1,n=-1;if(!this.options.gfm)return-1;for(;++o<a;)-1!==(t=r.indexOf(PROTOCOLS$1[o],e))&&(t<n||-1===n)&&(n=t);return n}function url(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d,h=this;if(h.options.gfm){for(a="",i=-1,l=PROTOCOLS_LENGTH;++i<l;)if(c=PROTOCOLS[i],(u=e.slice(0,c.length)).toLowerCase()===c){a=u;break}if(a){for(i=a.length,l=e.length,p="",g=0;i<l&&(n=e.charAt(i),!isWhitespaceCharacter(n)&&n!==C_LT$3)&&("."!==n&&","!==n&&":"!==n&&";"!==n&&'"'!==n&&"'"!==n&&")"!==n&&"]"!==n||(f=e.charAt(i+1))&&!isWhitespaceCharacter(f))&&(n!==C_PAREN_OPEN$1&&n!==C_BRACKET_OPEN$2||g++,n!==C_PAREN_CLOSE$2&&n!==C_BRACKET_CLOSE$2||!(--g<0));)p+=n,i++;if(p){if(a+=p,o=a,c===MAILTO_PROTOCOL){if(-1===(s=p.indexOf(C_AT_SIGN$1))||s===l-1)return;o=o.substr(MAILTO_PROTOCOL.length)}return!!t||(d=h.enterLink(),o=h.tokenizeInline(o,r.now()),d(),r(a)({type:"link",title:null,url:parseEntities(a),children:o}))}}}}function inlineHTML(r,e,t){var a,o,n=this,i=e.length;if(!("<"!==e.charAt(0)||i<3)&&(a=e.charAt(1),(isAlphabetical(a)||"?"===a||"!"===a||"/"===a)&&(o=e.match(tag$3))))return!!t||(o=o[0],!n.inLink&&EXPRESSION_HTML_LINK_OPEN.test(o)?n.inLink=!0:n.inLink&&EXPRESSION_HTML_LINK_CLOSE.test(o)&&(n.inLink=!1),r(o)({type:"html",value:o}))}function locate$6(r,e){var t=r.indexOf("[",e),a=r.indexOf("![",e);return-1===a?t:t<a?t:a}function link(r,e,t){var a,o,n,i,s,c,u,l,p,g,f,d,h,m,D,E,b,C,A,w=this,q="",v=0,y=e.charAt(0),L=w.options.pedantic,S=w.options.commonmark,T=w.options.gfm;if("!"===y&&(p=!0,q=y,y=e.charAt(++v)),y===C_BRACKET_OPEN$3&&(p||!w.inLink)){for(q+=y,D="",v++,d=e.length,m=0,(b=r.now()).column+=v,b.offset+=v;v<d;){if(y=e.charAt(v),c=y,y===C_TICK$2){for(o=1;e.charAt(v+1)===C_TICK$2;)c+=y,v++,o++;n?o>=n&&(n=0):n=o}else if(y===C_BACKSLASH$3)v++,c+=e.charAt(v);else if(n&&!T||y!==C_BRACKET_OPEN$3){if((!n||T)&&y===C_BRACKET_CLOSE$3){if(!m){if(!L)for(;v<d&&(y=e.charAt(v+1),isWhitespaceCharacter(y));)c+=y,v++;if(e.charAt(v+1)!==C_PAREN_OPEN$2)return;c+=C_PAREN_OPEN$2,a=!0,v++;break}m--}}else m++;D+=c,c="",v++}if(a){for(g=D,q+=D+c,v++;v<d&&(y=e.charAt(v),isWhitespaceCharacter(y));)q+=y,v++;if(y=e.charAt(v),l=S?COMMONMARK_LINK_MARKERS:LINK_MARKERS,D="",i=q,y===C_LT$4){for(v++,i+=C_LT$4;v<d&&(y=e.charAt(v))!==C_GT$3;){if(S&&"\n"===y)return;D+=y,v++}if(e.charAt(v)!==C_GT$3)return;q+=C_LT$4+D+C_GT$3,E=D,v++}else{for(y=null,c="";v<d&&(y=e.charAt(v),!c||!own$2.call(l,y));){if(isWhitespaceCharacter(y)){if(!L)break;c+=y}else{if(y===C_PAREN_OPEN$2)m++;else if(y===C_PAREN_CLOSE$3){if(0===m)break;m--}D+=c,c="",y===C_BACKSLASH$3&&(D+=C_BACKSLASH$3,y=e.charAt(++v)),D+=y}v++}E=D,v=(q+=D).length}for(D="";v<d&&(y=e.charAt(v),isWhitespaceCharacter(y));)D+=y,v++;if(y=e.charAt(v),q+=D,D&&own$2.call(l,y))if(v++,q+=y,D="",f=l[y],s=q,S){for(;v<d&&(y=e.charAt(v))!==f;)y===C_BACKSLASH$3&&(D+=C_BACKSLASH$3,y=e.charAt(++v)),v++,D+=y;if((y=e.charAt(v))!==f)return;for(h=D,q+=D+y,v++;v<d&&(y=e.charAt(v),isWhitespaceCharacter(y));)q+=y,v++}else for(c="";v<d;){if((y=e.charAt(v))===f)u&&(D+=f+c,c=""),u=!0;else if(u){if(y===C_PAREN_CLOSE$3){q+=D+f+c,h=D;break}isWhitespaceCharacter(y)?c+=y:(D+=f+c+y,c="",u=!1)}else D+=y;v++}if(e.charAt(v)===C_PAREN_CLOSE$3)return!!t||(q+=C_PAREN_CLOSE$3,E=w.decode.raw(w.unescape(E),r(i).test().end),h&&(s=r(s).test().end,h=w.decode.raw(w.unescape(h),s)),A={type:p?"image":"link",title:h||null,url:E},p?A.alt=w.decode.raw(w.unescape(g),b)||null:(C=w.enterLink(),A.children=w.tokenizeInline(g,b),C()),r(q)(A))}}}function reference(r,e,t){var a,o,n,i,s,c,u,l,p=this,g=e.charAt(0),f=0,d=e.length,h="",m="",D=T_LINK,E=REFERENCE_TYPE_SHORTCUT;if("!"===g&&(D=T_IMAGE,m=g,g=e.charAt(++f)),g===C_BRACKET_OPEN$4){for(f++,m+=g,c="",p.options.footnotes&&D===T_LINK&&e.charAt(f)===C_CARET$1&&(m+=C_CARET$1,f++,D=T_FOOTNOTE),l=0;f<d;){if((g=e.charAt(f))===C_BRACKET_OPEN$4)u=!0,l++;else if(g===C_BRACKET_CLOSE$4){if(!l)break;l--}g===C_BACKSLASH$4&&(c+=C_BACKSLASH$4,g=e.charAt(++f)),c+=g,f++}if(h=c,a=c,(g=e.charAt(f))===C_BRACKET_CLOSE$4){for(f++,h+=g,c="";f<d&&(g=e.charAt(f),isWhitespaceCharacter(g));)c+=g,f++;if(g=e.charAt(f),D!==T_FOOTNOTE&&g===C_BRACKET_OPEN$4){for(o="",c+=g,f++;f<d&&(g=e.charAt(f))!==C_BRACKET_OPEN$4&&g!==C_BRACKET_CLOSE$4;)g===C_BACKSLASH$4&&(o+=C_BACKSLASH$4,g=e.charAt(++f)),o+=g,f++;(g=e.charAt(f))===C_BRACKET_CLOSE$4?(E=o?REFERENCE_TYPE_FULL:REFERENCE_TYPE_COLLAPSED,c+=o+g,f++):o="",h+=c,c=""}else{if(!a)return;o=a}if(E===REFERENCE_TYPE_FULL||!u)return h=m+h,D===T_LINK&&p.inLink?null:!!t||(D===T_FOOTNOTE&&-1!==a.indexOf(" ")?r(h)({type:"footnote",children:this.tokenizeInline(a,r.now())}):(n=r.now(),n.column+=m.length,n.offset+=m.length,o=E===REFERENCE_TYPE_FULL?o:a,i={type:D+"Reference",identifier:normalize_1(o)},D!==T_LINK&&D!==T_IMAGE||(i.referenceType=E),D===T_LINK?(s=p.enterLink(),i.children=p.tokenizeInline(a,n),s()):D===T_IMAGE&&(i.alt=p.decode.raw(p.unescape(a),n)||null),r(h)(i)))}}}function locate$8(r,e){var t=r.indexOf("**",e),a=r.indexOf("__",e);return-1===a?t:-1===t?a:a<t?a:t}function strong(r,e,t){var a,o,n,i,s,c,u,l=this,p=0,g=e.charAt(p);if(!(g!==C_ASTERISK$2&&g!==C_UNDERSCORE$2||e.charAt(++p)!==g||(o=l.options.pedantic,n=g,s=n+n,c=e.length,p++,i="",g="",o&&isWhitespaceCharacter(e.charAt(p)))))for(;p<c;){if(u=g,!((g=e.charAt(p))!==n||e.charAt(p+1)!==n||o&&isWhitespaceCharacter(u))&&(g=e.charAt(p+2))!==n){if(!trim_1(i))return;return!!t||(a=r.now(),a.column+=2,a.offset+=2,r(s+i+s)({type:"strong",children:l.tokenizeInline(i,a)}))}o||"\\"!==g||(i+=g,g=e.charAt(++p)),i+=g,p++}}function wordCharacter(r){return re$2.test("number"==typeof r?fromCode$1(r):r.charAt(0))}function locate$10(r,e){var t=r.indexOf("*",e),a=r.indexOf("_",e);return-1===a?t:-1===t?a:a<t?a:t}function emphasis(r,e,t){var a,o,n,i,s,c,u,l=this,p=0,g=e.charAt(p);if(!(g!==C_ASTERISK$3&&g!==C_UNDERSCORE$3||(o=l.options.pedantic,s=g,n=g,c=e.length,p++,i="",g="",o&&isWhitespaceCharacter(e.charAt(p)))))for(;p<c;){if(u=g,!((g=e.charAt(p))!==n||o&&isWhitespaceCharacter(u))){if((g=e.charAt(++p))!==n){if(!trim_1(i)||u===n)return;if(!o&&n===C_UNDERSCORE$3&&isWordCharacter(g)){i+=n;continue}return!!t||(a=r.now(),a.column++,a.offset++,r(s+i+n)({type:"emphasis",children:l.tokenizeInline(i,a)}))}i+=n}o||"\\"!==g||(i+=g,g=e.charAt(++p)),i+=g,p++}}function locate$12(r,e){return r.indexOf("~~",e)}function strikethrough(r,e,t){var a,o,n,i=this,s="",c="",u="",l="";if(i.options.gfm&&e.charAt(0)===C_TILDE$1&&e.charAt(1)===C_TILDE$1&&!isWhitespaceCharacter(e.charAt(2)))for(a=1,o=e.length,(n=r.now()).column+=2,n.offset+=2;++a<o;){if(!((s=e.charAt(a))!==C_TILDE$1||c!==C_TILDE$1||u&&isWhitespaceCharacter(u)))return!!t||r(DOUBLE+l+DOUBLE)({type:"delete",children:i.tokenizeInline(l,n)});l+=c,u=c,c=s}}function locate$14(r,e){return r.indexOf("`",e)}function inlineCode(r,e,t){for(var a,o,n,i,s,c,u,l,p=e.length,g=0,f="",d="";g<p&&e.charAt(g)===C_TICK$3;)f+=C_TICK$3,g++;if(f){for(s=f,i=g,f="",l=e.charAt(g),n=0;g<p;){if(c=l,l=e.charAt(g+1),c===C_TICK$3?(n++,d+=c):(n=0,f+=c),n&&l!==C_TICK$3){if(n===i){s+=f+d,u=!0;break}f+=d,d=""}g++}if(!u){if(i%2!=0)return;f=""}if(t)return!0;for(a="",o="",p=f.length,g=-1;++g<p;)c=f.charAt(g),isWhitespaceCharacter(c)?o+=c:(o&&(a&&(a+=o),o=""),a+=c);return r(s)({type:"inlineCode",value:a})}}function locate$16(r,e){for(var t=r.indexOf("\n",e);t>e&&" "===r.charAt(t-1);)t--;return t}function hardBreak(r,e,t){for(var a,o=e.length,n=-1,i="";++n<o;){if("\n"===(a=e.charAt(n))){if(n<MIN_BREAK_LENGTH)return;return!!t||(i+=a,r(i)({type:"break"}))}if(" "!==a)return;i+=a}}function text(r,e,t){var a,o,n,i,s,c,u,l,p,g,f=this;if(t)return!0;for(i=(a=f.inlineMethods).length,o=f.inlineTokenizers,n=-1,p=e.length;++n<i;)"text"!==(l=a[n])&&o[l]&&((u=o[l].locator)||r.file.fail("Missing locator: `"+l+"`"),-1!==(c=u.call(f,e,1))&&c<p&&(p=c));s=e.slice(0,p),g=r.now(),f.decode(s,g,function(e,t,a){r(a||e)({type:"text",value:e})})}function Parser(r,e){this.file=e,this.offset={},this.options=immutable(this.options),this.setOptions({}),this.inList=!1,this.inBlock=!1,this.inLink=!1,this.atStart=!0,this.toOffset=vfileLocation(e).toOffset,this.unescape=_unescape(this,"escape"),this.decode=decode(this)}function keys(r){var e,t=[];for(e in r)t.push(e);return t}function parse$4(r){var e=unherit_1(parser);e.prototype.options=immutable(e.prototype.options,this.data("settings"),r),this.Parser=e}function bail(r){if(r)throw r}function replaceExt(r,e){if("string"!=typeof r)return r;if(0===r.length)return r;var t=path.basename(r,path.extname(r))+e;return path.join(path.dirname(r),t)}function stringify(r){return r&&"object"==typeof r?own$5.call(r,"position")||own$5.call(r,"type")?location(r.position):own$5.call(r,"start")||own$5.call(r,"end")?location(r):own$5.call(r,"line")||own$5.call(r,"column")?position(r):null:null}function position(r){return r&&"object"==typeof r||(r={}),index$3(r.line)+":"+index$3(r.column)}function location(r){return r&&"object"==typeof r||(r={}),position(r.start)+"-"+position(r.end)}function index$3(r){return r&&"number"==typeof r?r:1}function isBuffer(r){return!!r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}function isSlowBuffer(r){return"function"==typeof r.readFloatLE&&"function"==typeof r.slice&&isBuffer(r.slice(0,0))}function VFile(r){var e,t,a;if(r){if("string"==typeof r||isBuffer_1(r))r={contents:r};else if("message"in r&&"messages"in r)return r}else r={};if(!(this instanceof VFile))return new VFile(r);for(this.data={},this.messages=[],this.history=[],this.cwd=process.cwd(),t=-1,a=order$1.length;++t<a;)e=order$1[t],own$4.call(r,e)&&(this[e]=r[e]);for(e in r)-1===order$1.indexOf(e)&&(this[e]=r[e])}function toString(r){var e=this.contents||"";return isBuffer_1(e)?e.toString(r):String(e)}function message(r,e,t){var a,o,n=this.path,i=unistUtilStringifyPosition(e)||"1:1";return a={start:{line:null,column:null},end:{line:null,column:null}},e&&e.position&&(e=e.position),e&&(e.start?(a=e,e=e.start):a.start=e),o=new VMessage(r.message||r),o.name=(n?n+":":"")+i,o.file=n||"",o.reason=r.message||r,o.line=e?e.line:null,o.column=e?e.column:null,o.location=a,o.ruleId=t||null,o.source=null,o.fatal=!1,r.stack&&(o.stack=r.stack),this.messages.push(o),o}function fail(){var r=this.message.apply(this,arguments);throw r.fatal=!0,r}function info(){var r=this.message.apply(this,arguments);return r.fatal=null,r}function VMessagePrototype(){}function VMessage(r){this.message=r}function assertPart(r,e){if(-1!==r.indexOf(path.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+path.sep+"`")}function assertNonEmpty(r,e){if(!r)throw new Error("`"+e+"` cannot be empty")}function assertPath(r,e){if(!r)throw new Error("Setting `"+e+"` requires `path` to be set too")}function trough(){var r=[],e={};return e.run=function(){function e(n){var i=r[++t],s=slice$1.call(arguments,0).slice(1),c=a.length,u=-1;if(n)o(n);else{for(;++u<c;)null!==s[u]&&void 0!==s[u]||(s[u]=a[u]);a=s,i?wrap$1(i,e).apply(null,a):o.apply(null,[null].concat(a))}}var t=-1,a=slice$1.call(arguments,0,-1),o=arguments[arguments.length-1];if("function"!=typeof o)throw new Error("Expected function as last argument, not "+o);e.apply(null,[null].concat(a))},e.use=function(t){if("function"!=typeof t)throw new Error("Expected `fn` to be a function, not "+t);return r.push(t),e},e}function wrap$1(r,e){function t(){o||(o=!0,e.apply(null,arguments))}function a(r){t(null,r)}var o;return function(){var e,n=slice$1.call(arguments,0),i=r.length>n.length;i&&n.push(t);try{e=r.apply(null,n)}catch(r){if(i&&o)throw r;return t(r)}i||(e&&"function"==typeof e.then?e.then(a,t):e instanceof Error?t(e):a(e))}}function isString(r){return"[object String]"===toString$1.call(r)}function pipelineParse(r,e){e.tree=r.parse(e.file)}function pipelineRun(r,e,t){r.run(e.tree,e.file,function(r,a,o){r?t(r):(e.tree=a,e.file=o,t())})}function pipelineStringify(r,e){e.file.contents=r.stringify(e.tree,e.file)}function unified(){function r(){for(var r=unified(),e=n.length,t=-1;++t<e;)r.use.apply(null,n[t]);return r.data(extend$1(!0,{},s)),r}function e(){var e,t,a,o;if(c)return r;for(;++u<n.length;)t=(e=n[u])[0],o=null,!1!==(a=e[1])&&(!0===a&&(e[1]=void 0),o=t.apply(r,e.slice(1)),xIsFunction(o)&&i.use(o));return c=!0,u=1/0,r}function t(r){for(var e,t=n.length,a=-1;++a<t;)if((e=n[a])[0]===r)return e}function a(r,t,a){function o(e,o){i.run(r,vfile(t),function(t,n,i){n=n||r,t?o(t):e?e(n):a(null,n,i)})}if(assertNode(r),e(),!a&&xIsFunction(t)&&(a=t,t=null),!a)return new Promise(o);o(null,a)}function o(t,a){function o(e,o){var n=vfile(t);pipeline.run(r,{file:n},function(r){r?o(r):e?e(n):a(null,n)})}if(e(),assertParser("process",r.Parser),assertCompiler("process",r.Compiler),!a)return new Promise(o);o(null,a)}var n=[],i=trough_1(),s={},c=!1,u=-1;return r.data=function(e,t){return xIsString(e)?2===arguments.length?(assertUnfrozen("data",c),s[e]=t,r):own$3.call(s,e)&&s[e]||null:e?(assertUnfrozen("data",c),s=e,r):s},r.freeze=e,r.attachers=n,r.use=function(e){function a(r){i(r.plugins),r.settings&&(l=extend$1(l||{},r.settings))}function o(r){if(xIsFunction(r))u(r);else{if("object"!=typeof r)throw new Error("Expected usable value, not `"+r+"`");"length"in r?u.apply(null,r):a(r)}}function i(r){var e,t;if(null===r||void 0===r);else{if(!("object"==typeof r&&"length"in r))throw new Error("Expected a list of plugins, not `"+r+"`");for(e=r.length,t=-1;++t<e;)o(r[t])}}function u(r,e){var a=t(r);a?(isPlainObj(a[1])&&isPlainObj(e)&&(e=extend$1(a[1],e)),a[1]=e):n.push(slice.call(arguments))}var l;if(assertUnfrozen("use",c),null===e||void 0===e);else if(xIsFunction(e))u.apply(null,arguments);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?i(e):a(e)}return l&&(s.settings=extend$1(s.settings||{},l)),r},r.parse=function(t){var a,o=vfile(t);return e(),a=r.Parser,assertParser("parse",a),newable(a)?new a(String(o),o).parse():a(String(o),o)},r.stringify=function(t,a){var o,n=vfile(a);return e(),o=r.Compiler,assertCompiler("stringify",o),assertNode(t),newable(o)?new o(t,n).compile():o(t,n)},r.run=a,r.runSync=function(r,e){var t,o=!1;return a(r,e,function(r,e){o=!0,bail_1(r),t=e}),assertDone("runSync","run",o),t},r.process=o,r.processSync=function(t){var a,n=!1;return e(),assertParser("processSync",r.Parser),assertCompiler("processSync",r.Compiler),a=vfile(t),o(a,function(r){n=!0,bail_1(r)}),assertDone("processSync","process",n),a},r}function newable(r){return xIsFunction(r)&&keys$1(r.prototype)}function keys$1(r){var e;for(e in r)return!0;return!1}function assertParser(r,e){if(!xIsFunction(e))throw new Error("Cannot `"+r+"` without `Parser`")}function assertCompiler(r,e){if(!xIsFunction(e))throw new Error("Cannot `"+r+"` without `Compiler`")}function assertUnfrozen(r,e){if(e)throw new Error("Cannot invoke `"+r+"` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.")}function assertNode(r){if(!r||!xIsString(r.type))throw new Error("Expected node, got `"+r+"`")}function assertDone(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function get_regex(){return create_regex(character_ranges.concat(punctuation_ranges))}function create_regex(r){return new RegExp("["+r.map(get_bracket_content).reduce(function(r,e){return r+e})+"]","g")}function get_bracket_content(r){return get_escaped_unicode(r[0])+"-"+get_escaped_unicode(r[1])}function get_escaped_unicode(r){return"\\u"+r.toString(16)}function isExportDeclaration(r){if(r)switch(r.type){case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function getParentExportDeclaration(r){const e=r.getParentNode();return"declaration"===r.getName()&&isExportDeclaration(e)?e:null}function getPenultimate(r){return r.length>1?r[r.length-2]:null}function getLast(r){return r.length>0?r[r.length-1]:null}function skip(r){return(e,t,a)=>{const o=a&&a.backwards;if(!1===t)return!1;const n=e.length;let i=t;for(;i>=0&&i<n;){const t=e.charAt(i);if(r instanceof RegExp){if(!r.test(t))return i}else if(-1===r.indexOf(t))return i;o?i--:i++}return(-1===i||i===n)&&i}}function skipInlineComment(r,e){if(!1===e)return!1;if("/"===r.charAt(e)&&"*"===r.charAt(e+1))for(let t=e+2;t<r.length;++t)if("*"===r.charAt(t)&&"/"===r.charAt(t+1))return t+2;return e}function skipTrailingComment(r,e){return!1!==e&&("/"===r.charAt(e)&&"/"===r.charAt(e+1)?skipEverythingButNewLine(r,e):e)}function skipNewline(r,e,t){const a=t&&t.backwards;if(!1===e)return!1;const o=r.charAt(e);if(a){if("\r"===r.charAt(e-1)&&"\n"===o)return e-2;if("\n"===o||"\r"===o||"\u2028"===o||"\u2029"===o)return e-1}else{if("\r"===o&&"\n"===r.charAt(e+1))return e+2;if("\n"===o||"\r"===o||"\u2028"===o||"\u2029"===o)return e+1}return e}function hasNewline(r,e,t){const a=skipSpaces(r,(t=t||{}).backwards?e-1:e,t);return a!==skipNewline(r,a,t)}function hasNewlineInRange(r,e,t){for(let a=e;a<t;++a)if("\n"===r.charAt(a))return!0;return!1}function isPreviousLineEmpty(r,e){let t=locStart(e)-1;return t=skipNewline(r,t=skipSpaces(r,t,{backwards:!0}),{backwards:!0}),(t=skipSpaces(r,t,{backwards:!0}))!==skipNewline(r,t,{backwards:!0})}function isNextLineEmptyAfterIndex(r,e){let t=null,a=e;for(;a!==t;)t=a,a=skipInlineComment(r,a=skipToLineEnd(r,a)),a=skipSpaces(r,a);return a=skipTrailingComment(r,a),a=skipNewline(r,a),hasNewline(r,a)}function isNextLineEmpty(r,e){return isNextLineEmptyAfterIndex(r,locEnd(e))}function getNextNonSpaceNonCommentCharacterIndex(r,e){let t=null,a=locEnd(e);for(;a!==t;)t=a,a=skipNewline(r,a=skipTrailingComment(r,a=skipInlineComment(r,a=skipSpaces(r,a))));return a}function getNextNonSpaceNonCommentCharacter(r,e){return r.charAt(getNextNonSpaceNonCommentCharacterIndex(r,e))}function hasSpaces(r,e,t){return skipSpaces(r,(t=t||{}).backwards?e-1:e,t)!==e}function locStart(r){return r.declaration&&r.declaration.decorators&&r.declaration.decorators.length>0?locStart(r.declaration.decorators[0]):r.decorators&&r.decorators.length>0?locStart(r.decorators[0]):r.__location?r.__location.startOffset:r.range?r.range[0]:"number"==typeof r.start?r.start:r.source?lineColumnToIndex(r.source.start,r.source.input.css)-1:r.loc?r.loc.start:void 0}function locEnd(r){const e=r.nodes&&getLast(r.nodes);e&&r.source&&!r.source.end&&(r=e);let t;return r.range?t=r.range[1]:"number"==typeof r.end?t=r.end:r.source&&(t=lineColumnToIndex(r.source.end,r.source.input.css)),r.__location?r.__location.endOffset:r.typeAnnotation?Math.max(t,locEnd(r.typeAnnotation)):r.loc&&!t?r.loc.end:t}function lineColumnToIndex(r,e){let t=0;for(let a=0;a<r.line-1;++a)if(-1===(t=e.indexOf("\n",t)+1))return-1;return t+r.column}function setLocStart(r,e){r.range?r.range[0]=e:r.start=e}function setLocEnd(r,e){r.range?r.range[1]=e:r.end=e}function getPrecedence(r){return PRECEDENCE[r]}function shouldFlatten(r,e){return getPrecedence(e)===getPrecedence(r)&&("**"!==r&&((!equalityOperators[r]||!equalityOperators[e])&&(!("%"===e&&multiplicativeOperators[r]||"%"===r&&multiplicativeOperators[e])&&(!bitshiftOperators[r]||!bitshiftOperators[e]))))}function isBitwiseOperator(r){return!!bitshiftOperators[r]||"|"===r||"^"===r||"&"===r}function startsWithNoLookaheadToken(r,e){switch((r=getLeftMost(r)).type){case"ObjectPattern":return!e;case"FunctionExpression":case"ClassExpression":return e;case"ObjectExpression":return!0;case"MemberExpression":return startsWithNoLookaheadToken(r.object,e);case"TaggedTemplateExpression":return"FunctionExpression"!==r.tag.type&&startsWithNoLookaheadToken(r.tag,e);case"CallExpression":return"FunctionExpression"!==r.callee.type&&startsWithNoLookaheadToken(r.callee,e);case"ConditionalExpression":return startsWithNoLookaheadToken(r.test,e);case"UpdateExpression":return!r.prefix&&startsWithNoLookaheadToken(r.argument,e);case"BindExpression":return r.object&&startsWithNoLookaheadToken(r.object,e);case"SequenceExpression":return startsWithNoLookaheadToken(r.expressions[0],e);case"TSAsExpression":return startsWithNoLookaheadToken(r.expression,e);default:return!1}}function getLeftMost(r){return r.left?getLeftMost(r.left):r}function hasBlockComments(r){return r.comments&&r.comments.some(isBlockComment)}function isBlockComment(r){return"Block"===r.type||"CommentBlock"===r.type}function hasClosureCompilerTypeCastComment(r,e){return e.comments&&e.comments.some(e=>e.leading&&isBlockComment(e)&&e.value.match(/^\*\s*@type\s*{[^}]+}\s*$/)&&"("===getNextNonSpaceNonCommentCharacter(r,e))}function getAlignmentSize(r,e,t){let a=0;for(let o=t=t||0;o<r.length;++o)"\t"===r[o]?a=a+e-a%e:a++;return a}function getIndentSize(r,e){const t=r.lastIndexOf("\n");return-1===t?0:getAlignmentSize(r.slice(t+1).match(/^[ \t]*/)[0],e)}function printString(r,e,t){const a=r.slice(1,-1),o={quote:'"',regex:/"/g},n={quote:"'",regex:/'/g},i=e.singleQuote?n:o,s=i===n?o:n;let c=!1,u=!1;a.includes(i.quote)||a.includes(s.quote)?c=(a.match(i.regex)||[]).length>(a.match(s.regex)||[]).length:u=!0;const l="json"===e.parser?o.quote:c?s.quote:i.quote;return t?u?l+a+l:r:makeString(a,l,!("css"===e.parser||"less"===e.parser||"scss"===e.parser))}function makeString(r,e,t){const a='"'===e?"'":'"',o=/\\([\s\S])|(['"])/g,n=r.replace(o,(r,o,n)=>o===a?o:n===e?"\\"+n:n||(t&&/^[^\\nrvtbfux\r\n\u2028\u2029"'0-7]$/.test(o)?o:"\\"+o));return e+n+e}function printNumber(r){return r.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e|$)/,"")}function getMaxContinuousCount(r,e){const t=r.match(new RegExp(`(${escapeStringRegexp(e)})+`,"g"));return null===t?0:t.reduce((r,t)=>Math.max(r,t.length/e.length),0)}function mapDoc(r,e){if(r.parts){const t=r.parts.map(r=>mapDoc(r,e));return e(Object.assign({},r,{parts:t}))}if(r.contents){const t=mapDoc(r.contents,e);return e(Object.assign({},r,{contents:t}))}return e(r)}function splitText$1(r){function e(r){const e=getLast(n);e&&"word"===e.type&&(e.kind===t&&r.kind===a&&!e.hasTrailingPunctuation||e.kind===a&&r.kind===t&&!r.hasLeadingPunctuation?n.push({type:"whitespace",value:" "}):function(t,a){return e.kind===t&&r.kind===a||e.kind===a&&r.kind===t}(t,o)||[e.value,r.value].some(r=>/\u3000/.test(r))||n.push({type:"whitespace",value:""})),n.push(r)}const t="non-cjk",a="cjk-character",o="cjk-punctuation",n=[];return r.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`,"g"),"$1$2").split(/([ \t\n]+)/).forEach((r,i,s)=>{i%2!=1?(0!==i&&i!==s.length-1||""!==r)&&r.split(new RegExp(`(${cjkPattern})`)).forEach((r,n,i)=>{(0!==n&&n!==i.length-1||""!==r)&&(n%2!=0?e(punctuationRegex.test(r)?{type:"word",value:r,kind:o,hasLeadingPunctuation:!0,hasTrailingPunctuation:!0}:{type:"word",value:r,kind:a,hasLeadingPunctuation:!1,hasTrailingPunctuation:!1}):""!==r&&e({type:"word",value:r,kind:t,hasLeadingPunctuation:punctuationRegex.test(r[0]),hasTrailingPunctuation:punctuationRegex.test(getLast(r))}))}):n.push({type:"whitespace",value:/\n/.test(r)?"\n":" "})}),n}function getStringWidth(r){return r?stringWidth(r.replace(emojiRegex," ")):0}function hasIgnoreComment(r){return hasNodeIgnoreComment(r.getValue())}function hasNodeIgnoreComment(r){return r&&r.comments&&r.comments.length>0&&r.comments.some(r=>"prettier-ignore"===r.value.trim())}function arrayify(r,e){return Object.keys(r).reduce((t,a)=>t.concat(Object.assign({[e]:a},r[a])),[])}function parse(r){const e=unified_1().use(remarkParse,{footnotes:!0,commonmark:!0}).use(remarkFrontmatter,["yaml","toml"]).use(restoreUnescapedCharacter(r)).use(mergeContinuousTexts).use(transformInlineCode).use(splitText);return e.runSync(e.parse(r))}function map(r,e){return function r(t,a,o){const n=Object.assign({},e(t,a,o));return n.children&&(n.children=n.children.map((e,t)=>r(e,t,n))),n}(r,null,null)}function transformInlineCode(){return r=>map(r,r=>"inlineCode"!==r.type?r:Object.assign({},r,{value:r.value.replace(/\s+/g," ")}))}function restoreUnescapedCharacter(r){return()=>e=>map(e,e=>"text"!==e.type?e:Object.assign({},e,{value:"*"!==e.value&&"_"!==e.value