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AC3B,KAAK,GAAI,GAAU,OAAQ,MAC3B,KAAK,GAAI,GAAU,SAAU,MAC7B,KAAK,GAAI,GAAU,SAAU,MAC7B,KAAK,GAAI,GAAU,QAAS,MAC5B,QAAS,GAAU,EAAI,GAGzB,OAAO,CACR,CACA,CAnBqB,GAmDtB,SAAS,IAAM,SAAU,GACxB,MAAM,EAAM,SAAS,IACrB,OAAO,EAAM,EAAI,GAAM,SAAS,eAAe,GAAI,SACpD,SACS,SAAU","file":"/npm/micro-template@3.0.0/lib/micro-template.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/micro-template@3.0.0/lib/micro-template.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * https://github.com/cho45/micro-template.js\n * (c) cho45 http://cho45.github.com/mit-license\n */\nconst template = function (id, data) {\n\tif (arguments.length < 2) throw new Error('template() must be called with (template, data)');\n\tconst me = template, isArray = Array.isArray(data), keys = isArray ? data : Object.keys(data || {}), key = `data:${id}:${keys.sort().join(':')}`;\n\tif (!me.cache.has(key)) me.cache.set(key, (function () {\n\t\tlet name = id, string = /^[/\\w\\-]+$/.test(id) ? me.get(id): (name = `template-${Math.random().toString(36).slice(2)}`, id); // no warnings\n\t\tlet line = 1;\n\t\tconst body = (\n\t\t\t`try {` +\n\t\t\t\t(me.variable ?  `let ${me.variable}=__this.stash;` : ``) +\n\t\t\t\tstring.trim().split(/(<%.+?%>)/g).map(part =>\n\t\t\t\t\tpart.startsWith('<%=raw') && part.endsWith('%>') ? `/*raw*/__this.ret+=(${part.slice(6, -2)});` :\n\t\t\t\t\tpart.startsWith('<%=') && part.endsWith('%>')    ? `/*=*/__this.ret+=__this.escapeHTML(${part.slice(3, -2)});` :\n\t\t\t\t\tpart.startsWith('<%') && part.endsWith('%>')     ? `/* */${part.slice(2, -2)};` :\n\t\t\t\t\t(\n\t\t\t\t\t\tpart = part.replace(/\\\\/g, \"\\\\\\\\\")\n\t\t\t\t\t\t\t\t.replace(/'/g, \"\\\\'\")\n\t\t\t\t\t\t\t\t.replace(/\\n|\\r\\n/g, () => `';\\n__this.line=${++line};__this.ret+='\\\\n`),\n\t\t\t\t\t\tpart ? `/*+*/__this.ret+='${part}';` : ''\n\t\t\t\t\t)\n\t\t\t\t).join('') +\n\t\t\t\t`/*end*/ return __this.ret;` +\n\t\t\t`} catch (e) { throw new Error('TemplateError: '+e+' (on ${name} line ' + __this.line + ')',{cause:e}); }` +\n\t\t\t`//# sourceURL=${name}\\n` + \n\t\t\t`//# sourceMappingURL=data:application/json,${encodeURIComponent(JSON.stringify({version:3, file:name, sources:[`${name}.ejs`], sourcesContent:[string], mappings:\";;AAAA;\"+Array(line-1).fill('AACA').join(';')}))}`\n\t\t);\n\t\tconst compiled = new Function(\"__this\", ...keys, body);\n\t\tconst ret = function (stash) { return compiled.call(null, me.context = { escapeHTML: me.escapeHTML, line: 1, ret : '', stash: stash }, ...keys.map(key => stash[key])) };\n\t\treturn (ret.compiled = compiled, ret.keys = keys, ret);\n\t})());\n\treturn isArray ? me.cache.get(key) : me.cache.get(key)(data);\n}\ntemplate.cache = new Map();\ntemplate.get = function (id) { return document.getElementById(id).innerHTML };\ntemplate.escapeHTML = (function () {\n\tconst regexp = /[<>\"'&]/;\n\treturn function (str) {\n\t\tif (typeof str !== 'string') str = String(str);\n\t\tlet match = regexp.exec(str);\n\t\tif (match === null) return str;\n\t\tlet result = str.slice(0, match.index);\n\t\tfor (let i = match.index, len = str.length; i < len; i++) {\n\t\t\tswitch (str.charCodeAt(i)) {\n\t\t\t\tcase 60: result += '&lt;'; break; // <\n\t\t\t\tcase 62: result += '&gt;'; break; // >\n\t\t\t\tcase 34: result += '&#x22;'; break; // \"\n\t\t\t\tcase 39: result += '&#x27;'; break; // '\n\t\t\t\tcase 38: result += '&amp;'; break; // &\n\t\t\t\tdefault: result += str[i]; break;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n})();\n\n/**\n * Extended template function:\n *   requires: basic template() function\n *   provides:\n *     include(id)\n *     wrapper(id, function () {})\n */\nfunction extended (id, data) {\n\tconst inject = {\n\t\tinclude : function (name, args) {\n\t\t\tconst stash =  Object.assign({}, template.context.stash, args);\n\t\t\tconst context = template.context;\n\t\t\tcontext.ret += template(name, stash);\n\t\t\ttemplate.context = context;\n\t\t},\n\n\t\twrapper : function (name, fun) {\n\t\t\tconst current = template.context.ret;\n\t\t\ttemplate.context.ret = '';\n\t\t\tfun.apply(template.context);\n\t\t\tconst content = template.context.ret;\n\t\t\tconst orig_content = template.context.stash.content;\n\t\t\ttemplate.context.stash.content = content;\n\t\t\ttemplate.context.ret = current + template(name, template.context.stash);\n\t\t\ttemplate.context.stash.content = orig_content;\n\t\t},\n\t}\n\treturn template(id, Array.isArray(data) ? Object.keys(inject).concat(data) : Object.assign({}, data, inject));\n}\n\ntemplate.get = function (id) {\n\tconst fun = extended.get;\n\treturn fun ? fun(id) : document.getElementById(id).innerHTML;\n};\nexport { template, extended };\n"]}