!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findTokenInstances=function(e){var t=[];if(!e)return t;for(var r=/{\s*([^\{\}]*[^\s\{\}])\s*}/gm,n=r.exec(e);n;){var o=n[1],s=r.lastIndex,a=s-n[0].length;t.push({token:o,start:a,end:s}),n=r.exec(e)}return t},t.getTokenValueString=function(e,t){return void 0===t?"{"+e+"}":null===t?"":String(t)},t.replacePlaceholders=function(e,t,r){for(var n="",o=0,s=0,a=t;s<a.length;s++){var i=a[s],u=i.token;if(o>i.start){console.error("Invalid token data. Data must be supplied in order",t),n=e;break}o<i.start&&(n+=e.substring(o,i.start),o=i.start),n+=r[u],o=i.end}return{markdown:n+=e.substring(o)}}});