(function(){functiona(a,b){"use strict";vard=b?"Error in "+b+" extension->":"Error in unnamed extension",e={valid:!0,error:""};c.helper.isArray(a)||(a=[a]);for(varf=0;f<a.length;++f){varg=d+"sub-extension "+f+": ",h=a[f];if("object"!=typeofh)returne.valid=!1,e.error=g+"must be an object, but "+typeofh+" given",e;if(!c.helper.isString(h.type))returne.valid=!1,e.error=g+'property "type" must be a string, but '+typeofh.type+" given",e;vari=h.type=h.type.toLowerCase();if("language"===i&&(i=h.type="lang"),"html"===i&&(i=h.type="output"),"lang"!==i&&"output"!==i)returne.valid=!1,e.error=g+"type "+i+' is not recognized. Valid values: "lang" or "output"',e;if(h.filter){if("function"!=typeofh.filter)returne.valid=!1,e.error=g+'"filter" must be a function, but '+typeofh.filter+" given",e}else{if(!h.regex)returne.valid=!1,e.error=g+'extensions must define either a "regex" property or a "filter" method',e;if(c.helper.isString(h.regex)&&(h.regex=newRegExp(h.regex,"g")),!h.regexinstanceofRegExp)returne.valid=!1,e.error=g+'"regex" property must either be a string or a RegExp object, but '+typeofh.regex+" given",e;if(c.helper.isUndefined(h.replace))returne.valid=!1,e.error=g+'"regex" extensions must implement a replace string or function',e}if(c.helper.isUndefined(h.filter)&&c.helper.isUndefined(h.regex))returne.valid=!1,e.error=g+"output extensions must define a filter property",e}returne}functionb(a,b){"use strict";varc=b.charCodeAt(0);return"~E"+c+"E"}varc={},d={},e={},f={omitExtraWLInCodeBlocks:!1,prefixHeaderId:!1,noHeaderId:!1,headerLevelStart:1,parseImgDimensions:!1,simplifiedAutoLink:!1,literalMidWordUnderscores:!1,strikethrough:!1,tables:!1,tablesHeaderId:!1,ghCodeBlocks:!0},g=JSON.parse(JSON.stringify(f));c.helper={},c.extensions={},c.setOption=function(a,b){"use strict";returng[a]=b,this},c.getOption=function(a){"use strict";returng[a]},c.getOptions=function(){"use strict";returng},c.resetOptions=function(){"use strict";g=JSON.parse(JSON.stringify(f))},c.getDefaultOptions=function(){"use strict";returnf},c.subParser=function(a,b){"use strict";if(c.helper.isString(a)){if("undefined"==typeofb){if(d.hasOwnProperty(a))returnd[a];throwError("SubParser named "+a+" not registered!")}d[a]=b}},c.extension=function(b,d){"use strict";if(!c.helper.isString(b))throwError("Extension 'name' must be a string");if(b=c.helper.stdExtName(b),c.helper.isUndefined(d)){if(!e.hasOwnProperty(b))throwError("Extension named "+b+" is not registered!");returne[b]}"function"==typeofd&&(d=d()),c.helper.isArray(d)||(d=[d]);varf=a(d,b);if(!f.valid)throwError(f.error);e[b]=d},c.getAllExtensions=function(){"use strict";returne},c.removeExtension=function(a){"use strict";deletee[a]},c.resetExtensions=function(){"use strict";e={}},c.validateExtension=function(b){"use strict";varc=a(b,null);returnc.valid?!0:(console.warn(c.error),!1)},c.hasOwnProperty("helper")||(c.helper={}),c.helper.isString=function(a){"use strict";return"string"==typeofa||ainstanceofString},c.helper.forEach=function(a,b){"use strict";if("function"==typeofa.forEach)a.forEach(b);elsefor(varc=0;c<a.length;c++)b(a[c],c,a)},c.helper.isArray=function(a){"use strict";returna.constructor===Array},c.helper.isUndefined=function(a){"use strict";return"undefined"==typeofa},c.helper.stdExtName=function(a){"use strict";returna.replace(/[_-]||\s/g,"").toLowerCase()},c.helper.escapeCharactersCallback=b,c.helper.escapeCharacters=function(a,c,d){"use strict";vare="(["+c.replace(/([\[\]\\])/g,"\\$1")+"])";d&&(e="\\\\"+e);varf=newRegExp(e,"g");returna=a.replace(f,b)},c.helper.isUndefined(console)&&(console={warn:function(a){"use strict";alert(a)},log:function(a){"use strict";alert(a)}}),c.Converter=function(b){"use strict";functionf(){b=b||{};for(varaing)g.hasOwnProperty(a)&&(j[a]=g[a]);if("object"!=typeofb)throwError("Converter expects the passed parameter to be an object, but "+typeofb+" was passed instead.");for(vardinb)b.hasOwnProperty(d)&&(j[d]=b[d]);j.extensions&&c.helper.forEach(j.extensions,h)}functionh(a){if(c.helper.isString(a)){if(a=c