/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/soulpatch@0.0.11/src/mustache2js.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const syntax=/\{\{\s*([^\}]+)\s*\}\}\}?/g,safeAccess=function(t,e,n){var r=t;if(!e||!t)return t;if("."===e[0])return t[e];var c=e.split(" ");for(e=c[0].split(".");e.length>0&&void 0!==(t=t[e.shift()])&&null!==t;);return"string"==typeof t&&!0===n?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/>/g,"&gt;"):"function"==typeof t?t.apply(r,c.slice(1).concat(r)):"number"==typeof t?t:t||""}.toString(),toArray=function(t,e){var n=safeAccess(t,e);if(n){var r=Object.getPrototypeOf([]),c="object"==typeof n&&Object.getPrototypeOf(n)||!1;return!c||c!==r&&Object.getPrototypeOf(c)!==r?"function"==typeof n?n(t):[n]:n}return[]}.toString(),spread=function(t){var e=[];return t.forEach((function(t){e=e.concat(t)})),e}.toString(),merge=function(t){return[].slice.call(arguments,1).forEach((function(e){for(var n in e)t[n]=e[n]})),t}.toString(),baseCode="module.exports = (function() {\n\t{{helperFunctions}}\n\n\treturn {\n\t\trender: function(data) {\n\t\t\treturn [].concat({{render}}'').join('')\n\t\t}\n\t};\n}());";module.exports=function(t){let e={helperFunctions:[safeAccess],render:""},n=!1,r=!1,c=0;function o(){return"data"+(0===c?"":"$"+c)}function s(t){let e=1,n=/\n/g;for(;n.exec(t);)e+=1;return e}if(e.render=function(t,e){let a,i="",u=0,f=e?" + ":", ";if(!t.match(syntax))return i+"'"+t.substr(u).replace(/\n/g,"\\n").replace(/'/g,"\\'")+"'"+f;for(;a=syntax.exec(t);){if(a.index<u)continue;let e=t.substring(u,a.index);e.length>0&&(i+="'"+e.replace(/\n/g,"\\n").replace(/'/g,"\\'")+"'"+f),u=a.index+a[0].length;let l=a[1],p=l.substr(1);if("#"===l[0])i+=`(spread(toArray(${o()}, '${p}').map(function (e, i, a) {\n\t\t\t\t\t\tvar data$${c+1} = merge({}, data${0>=c?"":"$"+c}, {'.': e, '.index': i, '.length': a.length}, e);\n\t\t\t\t\t\treturn [].concat(`,c+=1,n=!0,r=!0;else if("/"===l[0]){if(i+="''); })).join(\"\"))"+f,c-=1,c<0)throw new Error("Unexpected end of block: "+l.substr(1)+" line "+s(t.substring(0,u)))}else"^"===l[0]?(i+=`(\n\t\t\t\t\t(\n\t\t\t\t\t\tsafeAccess(${o()}, '${p}') &&\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\ttypeof safeAccess(${o()}, '${p}') === 'boolean' ||\n\t\t\t\t\t\t\tsafeAccess(${o()}, '${p}').length > 0 ||\n\t\t\t\t\t\t\tObject.prototype.toString.call(safeAccess(${o()}, '${p}')) !== '[object Array]'\n\t\t\t\t\t\t)\n\t\t\t\t\t) ?\n\t\t\t\t\t\t[]\n\t\t\t\t\t:\n\t\t\t\t\t\tspread(\n\t\t\t\t\t\t\t[1].map(\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar data$${c+1} = merge({}, data${0>=c?"":"$"+c});\n\t\t\t\t\t\t\t\t\treturn [].concat(`,n=!0,r=!0,c+=1):">"===l[0]?i+=`require('./${p.trim()}.js').render(${o()})${f}`:"{"!==l[0]&&"!"!==l[0]?(p=l,i+=`''+safeAccess(${o()}, '${p}', true)${f}`):"!"!==l[0]&&(i+=`''+safeAccess(${o()}, '${p}')${f}`)}return t.substr(u).length>0&&(i+="'"+t.substr(u).replace(/\n/g,"\\n").replace(/'/g,"\\'")+"'"+f),i}(t,!0),c>0)throw new Error("Missing end of block");return n&&(e.helperFunctions.push(merge),e.helperFunctions.push(toArray)),r&&e.helperFunctions.push(spread),e.helperFunctions=e.helperFunctions.join(";"),baseCode.replace(/\{\{([^\}]+)\}\}/g,((t,n)=>e[n]))};
//# sourceMappingURL=/sm/e3d9ac10c49338cde3ec59ba19d5160a7a31af9d184b124ed0c03d27edd12a3f.map