/*! markdown-it-footnote 2.0.0 https://github.com//markdown-it/markdown-it-footnote @license MIT */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.markdownitFootnote=e()}}(function(){return function e(o,t,n){function r(f,i){if(!t[f]){if(!o[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(s)return s(f,!0);var l=new Error("Cannot find module '"+f+"'");throw l.code="MODULE_NOT_FOUND",l}var a=t[f]={exports:{}};o[f][0].call(a.exports,function(e){var t=o[f][1][e];return r(t?t:e)},a,a.exports,e,o,t,n)}return t[f].exports}for(var s="function"==typeof require&&require,f=0;f0&&(n+=":"+e[o].meta.subId),'['+t+"]"}function r(e,o,t){return(t.xhtmlOut?'
\n':'
\n')+'
\n
    \n'}function s(){return"
\n
\n"}function f(e,o){var t=Number(e[o].meta.id+1).toString();return'
  • '}function i(){return"
  • \n"}function u(e,o){var t=Number(e[o].meta.id+1).toString(),n="fnref"+t;return e[o].meta.subId>0&&(n+=":"+e[o].meta.subId),' \u21a9'}o.exports=function(e){function o(e,o,t,n){var r,s,f,i,u,l,a,c,d,h,k,v=e.bMarks[o]+e.tShift[o],b=e.eMarks[o];if(v+4>b)return!1;if(91!==e.src.charCodeAt(v))return!1;if(94!==e.src.charCodeAt(v+1))return!1;for(u=v+2;b>u;u++){if(32===e.src.charCodeAt(u))return!1;if(93===e.src.charCodeAt(u))break}if(u===v+2)return!1;if(u+1>=b||58!==e.src.charCodeAt(++u))return!1;if(n)return!0;for(u++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),l=e.src.slice(v+2,u-2),e.env.footnotes.refs[":"+l]=-1,a=new e.Token("footnote_reference_open","",1),a.meta={label:l},a.level=e.level++,e.tokens.push(a),r=e.bMarks[o],s=e.tShift[o],f=e.sCount[o],i=e.parentType,k=u,c=d=e.sCount[o]+u-(e.bMarks[o]+e.tShift[o]);b>u&&(h=e.src.charCodeAt(u),p(h));)9===h?d+=4-d%4:d++,u++;return e.tShift[o]=u-k,e.sCount[o]=d-c,e.bMarks[o]=k,e.blkIndent+=4,e.parentType="footnote",e.sCount[o]=i?!1:94!==e.src.charCodeAt(u)?!1:91!==e.src.charCodeAt(u+1)?!1:(t=u+2,n=c(e,u+1),0>n?!1:(o||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),r=e.env.footnotes.list.length,e.md.inline.parse(e.src.slice(t,n),e.md,e.env,f=[]),s=e.push("footnote_ref","",0),s.meta={id:r},e.env.footnotes.list[r]={tokens:f}),e.pos=n+1,e.posMax=i,!0))}function l(e,o){var t,n,r,s,f,i=e.posMax,u=e.pos;if(u+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(u))return!1;if(94!==e.src.charCodeAt(u+1))return!1;for(n=u+2;i>n;n++){if(32===e.src.charCodeAt(n))return!1;if(10===e.src.charCodeAt(n))return!1;if(93===e.src.charCodeAt(n))break}return n===u+2?!1:n>=i?!1:(n++,t=e.src.slice(u+2,n-1),"undefined"==typeof e.env.footnotes.refs[":"+t]?!1:(o||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+t]<0?(r=e.env.footnotes.list.length,e.env.footnotes.list[r]={label:t,count:0},e.env.footnotes.refs[":"+t]=r):r=e.env.footnotes.refs[":"+t],s=e.env.footnotes.list[r].count,e.env.footnotes.list[r].count++,f=e.push("footnote_ref","",0),f.meta={id:r,subId:s}),e.pos=n,e.posMax=i,!0))}function a(e){var o,t,n,r,s,f,i,u,l,a,c=!1,p={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(c=!0,l=[],a=e.meta.label,!1):"footnote_reference_close"===e.type?(c=!1,p[":"+a]=l,!1):(c&&l.push(e),!c)}),e.env.footnotes.list)){for(f=e.env.footnotes.list,i=new e.Token("footnote_block_open","",1),e.tokens.push(i),o=0,t=f.length;t>o;o++){for(i=new e.Token("footnote_open","",1),i.meta={id:o},e.tokens.push(i),f[o].tokens?(u=[],i=new e.Token("paragraph_open","p",1),i.block=!0,u.push(i),i=new e.Token("inline","",0),i.children=f[o].tokens,i.content="",u.push(i),i=new e.Token("paragraph_close","p",-1),i.block=!0,u.push(i)):f[o].label&&(u=p[":"+f[o].label]),e.tokens=e.tokens.concat(u),s="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,r=f[o].count>0?f[o].count:1,n=0;r>n;n++)i=new e.Token("footnote_anchor","",0),i.meta={id:o,subId:n},e.tokens.push(i);s&&e.tokens.push(s),i=new e.Token("footnote_close","",-1),e.tokens.push(i)}i=new e.Token("footnote_block_close","",-1),e.tokens.push(i)}}var c=e.helpers.parseLinkLabel,p=e.utils.isSpace;e.renderer.rules.footnote_ref=n,e.renderer.rules.footnote_block_open=r,e.renderer.rules.footnote_block_close=s,e.renderer.rules.footnote_open=f,e.renderer.rules.footnote_close=i,e.renderer.rules.footnote_anchor=u,e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",t),e.inline.ruler.after("footnote_inline","footnote_ref",l),e.core.ruler.after("inline","footnote_tail",a)}},{}]},{},[1])(1)});