function findTokenInstances(e){const n=[];if(!e)return n;const t=/{\s*([^\{\}]*[^\s\{\}])\s*}/gm;let r=t.exec(e);for(;r;){var s=r[1],o=t.lastIndex,a=o-r[0].length;n.push({token:s,start:a,end:o}),r=t.exec(e)}return n}function getTokenValueString(e,n){return void 0===n?`{${e}}`:null===n?"":String(n)}function replacePlaceholders(e,n,t){let r="",s=0;for(const a of n){var o=a.token;if(s>a.start){console.error("Invalid token data. Data must be supplied in order",n),r=e;break}s<a.start&&(r+=e.substring(s,a.start),s=a.start),r+=t[o],s=a.end}return r+=e.substring(s),{markdown:r}}export{findTokenInstances,getTokenValueString,replacePlaceholders};