@kosatyi/ejs 0.0.105 → 0.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e){this.v=t,this.k=e}function n(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function r(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function o(t,e,n){return e=p(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,n||[],p(t).constructor):e.apply(t,n))}function i(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){return t.get(n(t,e))}function a(t,e,n){i(t,e),e.set(t,n)}function s(t,e,r){return t.set(n(t,e),r),r}function f(t,e){i(t,e),e.add(t)}function l(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,E(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,n){return(e=E(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function d(){
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e){this.v=t,this.k=e}function n(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function r(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof c?r:c,s=Object.create(a.prototype);return w(s,"_invoke",function(n,r,o){var i,c,a,s=0,f=o||[],l=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,a=t,h.n=n,u}};function p(n,r){for(c=n,a=r,e=0;!l&&s&&!o&&e<f.length;e++){var o,i=f[e],p=h.p,v=i[2];n>3?(o=v===r)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,h.v=r,h.n=i[1]):p<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,h.n=v,c=0))}if(o||n>1)return u;throw l=!0,r}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&p(f,v),c=f,a=v;(e=c<2?t:a)||!l;){i||(c?c<3?(c>1&&(h.n=-1),p(c,a)):h.n=a:h.v=a);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(l=h.n<0)?a:n.call(r,h))!==u)break}catch(e){i=t,c=1,a=e}finally{s=1}}return{value:e,done:l}}}(n,o,i),!0),s}var u={};function c(){}function a(){}function s(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(w(e={},r,(function(){return this})),e),l=s.prototype=c.prototype=Object.create(f);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,w(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return a.prototype=s,w(l,"constructor",s),w(s,"constructor",a),a.displayName="GeneratorFunction",w(s,o,"GeneratorFunction"),w(l),w(l,o,"Generator"),w(l,r,(function(){return this})),w(l,"toString",(function(){return"[object Generator]"})),(d=function(){return{w:i,m:h}})()}function b(t,e,n,r,o){var i=g(t,e,n,r,o);return i.next().then((function(t){return t.done?t.value:i.next()}))}function g(t,e,n,r,o){return new m(d().w(t,e,n,r),o||Promise)}function m(t,n){function r(o,i,u,c){try{var a=t[o](i),s=a.value;return s instanceof e?n.resolve(s.v).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(s).then((function(t){a.value=t,u(a)}),(function(t){return r("throw",t,u,c)}))}catch(t){c(t)}}var o;this.next||(w(m.prototype),w(m.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),w(this,"_invoke",(function(t,e,i){function u(){return new n((function(e,n){r(t,i,e,n)}))}return o=o?o.then(u,u):u()}),!0)}function w(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}w=function(t,e,n,r){function i(e,n){w(t,e,(function(t){return this._invoke(e,n,t)}))}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},w(t,e,n,r)}function k(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function j(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(typeof t+" is not iterable")}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function E(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function x(t){var e="function"==typeof Map?new Map:void 0;return x=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&O(o,n.prototype),o}(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,t)},x(t)}function P(){var t=d(),n=t.m(P),r=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function o(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===r||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function u(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,o,i){return e.resultName=o,n(r.d,j(t),i)},finish:function(t){return n(r.f,t)}},n=function(t,n,o){r.p=e.prev,r.n=e.next;try{return t(n,o)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(P=function(){return{wrap:function(e,n,r,o){return t.w(u(e),n,r,o&&o.reverse())},isGeneratorFunction:o,mark:t.m,awrap:function(t,n){return new e(t,n)},AsyncIterator:m,async:function(t,e,n,r,i){return(o(e)?g:b)(u(t),e,n,r,i)},keys:k,values:j}})()}var S=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},T=function(t){return Array.isArray(t)},M=function(t){return"function"==typeof t},F=function(t){return"string"==typeof t},W=function(t){return"boolean"==typeof t},N=function(t){return void 0===t},B="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),R={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},C=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},A=C(_),L=C(R),$=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(A,(function(t){return _[t]}))},U=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?$(n):n},q=function(t,e){if(!1===function(t,e){return Boolean(t instanceof e)}(t,e))throw new TypeError("".concat(t," in not instance of ").concat(e))},H=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),u=0;u<o.length;u++){var c=o[u];if(M(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(c)){r={};break}r=r[c]=r[c]||{}}return M(r.toJSON)&&(r=r.toJSON()),[r,i]},G=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},J=function(){},D=function(t,e){var n;for(n in t)Y(t,n)&&e(t[n],n,t)},I=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return D(t,(function(t,o,i){var u=e(t,o,i);!1===N(u)&&(n?r.push(u):r[o]=u)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},Y=function(t,e){return t&&t.hasOwnProperty(e)},K={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",ELEMENT:"el",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},V=function(t,e){G(t,{path:S(F,K.path,t.path,e.path),export:S(F,K.export,t.export,e.export),resolver:S(M,K.resolver,t.resolver,e.resolver),extension:S(F,K.extension,t.extension,e.extension),withObject:S(W,K.withObject,t.withObject,e.withObject),rmWhitespace:S(W,K.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:S(W,K.cache,t.cache,e.cache),token:G({},K.token,t.token,e.token),vars:G({},K.vars,t.vars,e.vars),globalHelpers:S(T,K.globalHelpers,t.globalHelpers,e.globalHelpers)})},X="undefined"!=typeof globalThis?globalThis:window||self,z=new WeakMap,Q=new WeakMap,Z=function(){return l((function t(e){u(this,t),a(this,z,!0),a(this,Q,{}),this.configure(e)}),[{key:"load",value:function(t){c(z,this)&&G(c(Q,this),t||{})}},{key:"get",value:function(t){if(c(z,this))return c(Q,this)[t]}},{key:"set",value:function(t,e){c(z,this)&&(c(Q,this)[t]=e)}},{key:"exist",value:function(t){if(c(z,this))return Y(c(Q,this),t)}},{key:"clear",value:function(){s(Q,this,{})}},{key:"remove",value:function(t){delete c(Q,this)[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"configure",value:function(t){s(z,this,t.cache),!1===B&&this.load(X[t.export])}}])}(),tt=new WeakMap,et=new WeakMap,nt=function(){return l((function t(e){u(this,t),a(this,tt,{}),a(this,et,[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}]),this.configure(e)}),[{key:"configure",value:function(t){var e=this;c(tt,this).withObject=t.withObject,c(tt,this).rmWhitespace=t.rmWhitespace,c(tt,this).token=t.token,c(tt,this).vars=t.vars,c(tt,this).globalHelpers=t.globalHelpers,c(tt,this).matches=[],c(tt,this).formats=[],c(tt,this).slurp={match:"[s\t\n]*",start:[c(tt,this).token.start,"_"],end:["_",c(tt,this).token.end]},c(et,this).forEach((function(t){c(tt,e).matches.push(c(tt,e).token.start.concat(t.symbol).concat(c(tt,e).token.regex).concat(c(tt,e).token.end)),c(tt,e).formats.push(t.format.bind(c(tt,e).vars))})),c(tt,this).regex=new RegExp(c(tt,this).matches.join("|").concat("|$"),"g"),c(tt,this).slurpStart=new RegExp([c(tt,this).slurp.match,c(tt,this).slurp.start.join("")].join(""),"gm"),c(tt,this).slurpEnd=new RegExp([c(tt,this).slurp.end.join(""),c(tt,this).slurp.match].join(""),"gm")}},{key:"compile",value:function(t,e){var n=this,r=c(tt,this).vars,o=r.SCOPE,i=r.SAFE,u=r.BUFFER,a=r.COMPONENT,s=r.ELEMENT,f=c(tt,this).globalHelpers;c(tt,this).rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(c(tt,this).slurpStart,c(tt,this).token.start).replace(c(tt,this).slurpEnd,c(tt,this).token.end);var l,h,p,v="".concat(u,"('");l=c(tt,this).regex,h=function(e,r,o){v+=(""+t.slice(r,o)).replace(L,(function(t){return"\\"+R[t]})),e.forEach((function(t,e){t&&(v+=c(tt,n).formats[e](t))}))},p=0,t.replace(l,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return h(t,p,e),p=e+n.length,n})),v="try{".concat(v+="');","}catch(e){return ").concat(u,".error(e)}"),c(tt,this).withObject&&(v="with(".concat(o,"){").concat(v,"}")),v="".concat(u,".start();").concat(v,"return ").concat(u,".end();"),v+="\n//# sourceURL=".concat(e);var y=null,d=[o,a,s,u,i].concat(f);try{(y=Function.apply(null,d.concat(v))).source="(function(".concat(d.join(","),"){\n").concat(v,"\n});")}catch(t){throw t.filename=e,t.source=v,t}return y}}])}(),rt=new WeakMap,ot=new WeakMap,it=new WeakMap,ut=new WeakMap,ct=new WeakSet,at=function(){return l((function t(e,n,r){u(this,t),f(this,ct),a(this,rt,void 0),a(this,ot,void 0),a(this,it,void 0),a(this,ut,void 0),q(n,Z),q(r,nt),s(ot,this,n),s(it,this,r),this.configure(e)}),[{key:"configure",value:function(t){s(rt,this,t.path),M(t.resolver)&&s(ut,this,t.resolver)}},{key:"get",value:function(t){var e=this;return c(ot,this).exist(t)?c(ot,this).resolve(t):n(ct,this,st).call(this,t).then((function(r){return n(ct,e,ft).call(e,t,n(ct,e,lt).call(e,r,t))}))}}])}();function st(t){return c(ut,this).call(this,c(rt,this),t)}function ft(t,e){return c(ot,this).set(t,e),e}function lt(t,e){return M(t)?t:c(it,this).compile(t,e)}var ht=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],pt=" ",vt='"',yt="/",dt="<",bt=">",gt=function(t,e,n){var r=[],o=-1===ht.indexOf(t),i=function(t,e){var n=[];return D(t,(function(t,r,o){var i=e(t,r,o);!1===N(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[$(e),[vt,$(t),vt].join("")].join("=")})).join(pt);return r.push([dt,t,pt,i,bt].join("")),n&&o&&r.push(n instanceof Array?n.join(""):n),o&&r.push([dt,yt,t,bt].join("")),r.join("")},mt=function(t){function e(t){var n;return u(this,e),h(n=o(this,e),"code",0),n.message=t,n}return v(e,t),l(e,[{key:"getCode",value:function(){return this.code}},{key:"getMessage",value:function(){return this.message}},{key:"toString",value:function(){return this.getMessage()}}])}(x(Error)),wt=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return h(t=o(this,e,[].concat(r)),"code",404),t}return v(e,t),l(e)}(mt),kt=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return h(t=o(this,e,[].concat(r)),"code",500),t}return v(e,t),l(e)}(mt);function jt(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function Ot(){var t=[],e=[],n=function(t){e.push(t)};return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),jt(n)},n.error=function(t){return e=t,Promise.reject(new kt(e.message));var e},n.end=function(){return jt(e)},n}var Et=Symbol("ContextScope.parentTemplate"),xt=new WeakMap,Pt=function(){return l((function t(e,n){u(this,t),a(this,xt,void 0),this.configure(e,n)}),[{key:"create",value:function(t){return new(c(xt,this))(t)}},{key:"configure",value:function(t,e){s(xt,this,function(t,e){var n=t.vars,r=n.BLOCKS,o=n.MACRO,i=n.EXTEND,u=n.LAYOUT,c=n.BUFFER,a=n.SAFE,s=n.SCOPE,f=n.COMPONENT,l=n.ELEMENT;function h(t){this[Et]=null,this[r]={},this[o]={},Object.assign(this,I(t,[s,c,a,f,l]))}return Object.assign(h.prototype,e),Object.defineProperty(h.prototype,c,{value:Ot()}),Object.defineProperty(h.prototype,r,{value:{},writable:!0}),Object.defineProperty(h.prototype,o,{value:{},writable:!0}),Object.defineProperty(h.prototype,u,{value:!1,writable:!0}),Object.defineProperty(h.prototype,i,{value:!1,writable:!0}),Object.defineProperty(h.prototype,Et,{value:null,writable:!0}),Object.defineProperties(h.prototype,{setParentTemplate:{value:function(t){return this[Et]=t,this}},getParentTemplate:{value:function(){return this[Et]}},useSafeValue:{get:function(){return U}},useComponent:{get:function(){return M(this[f])?this[f].bind(this):function(){throw new Error("".concat(f," must be a function"))}}},useElement:{get:function(){return M(this[l])?this[l].bind(this):function(){throw new Error("".concat(l," must be a function"))}}},getMacro:{value:function(){return this[o]}},getBuffer:{value:function(){return this[c]}},getBlocks:{value:function(){return this[r]}},setExtend:{value:function(t){return this[i]=t,this}},getExtend:{value:function(){return this[i]}},setLayout:{value:function(t){return this[u]=t,this}},getLayout:{value:function(){return this[u]}},clone:{value:function(t){var e=[u,i,c];return!0===t&&e.push(r),I(this,e)}},extend:{value:function(t){this.setExtend(!0),this.setLayout(t)}},echo:{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}},fn:{value:function(t){var e=this.getBuffer(),n=this;return function(){if(M(t))return e.backup(),e(t.apply(n,arguments)),e.restore()}}},macro:{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}}},call:{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(M(e))return e.apply(e,n)}},block:{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()},u=function(){var t=i();return t?function(){n.echo(t(u()))}:J};this.echo(i()(u()))}}},hasBlock:{value:function(t){return this.getBlocks().hasOwnProperty(t)}},include:{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=G(r,e||{}),i=this.render(t,o);this.echo(i)}},use:{value:function(t,e){var n=this;this.echo(Promise.resolve(this.require(t)).then((function(t){var r=n.getMacro();D(t,(function(t,n){r[[e,n].join(".")]=t}))})))}},async:{value:function(t,e){this.echo(Promise.resolve(t).then(e))}},get:{value:function(t,e){var n=H(this,t,!0),r=n.shift(),o=n.pop();return Y(r,o)?r[o]:e}},set:{value:function(t,e){var n=H(this,t,!1),r=n.shift(),o=n.pop();return this.getParentTemplate()&&Y(r,o)?r[o]:r[o]=e}},each:{value:function(t,e){F(t)&&(t=this.get(t,[])),D(t,e)},writable:!0},el:{value:function(t,e,n){n=M(n)?this.fn(n)():n,this.echo(Promise.resolve(n).then((function(n){return gt(t,e,n)})))},writable:!0},ui:{value:function(t){},writable:!0}}),h}(t,e))}},{key:"helpers",value:function(t){G(c(xt,this).prototype,t||{})}}])}(),St=new WeakMap,Tt=new WeakMap,Mt=new WeakMap,Ft=new WeakMap,Wt=new WeakMap,Nt=new WeakMap,Bt=new WeakSet,Rt=function(){return l((function t(e){u(this,t),f(this,Bt),a(this,St,{}),a(this,Tt,{}),a(this,Mt,void 0),a(this,Ft,void 0),a(this,Wt,void 0),a(this,Nt,void 0),V(c(St,this),e||{}),s(Mt,this,new Pt(c(St,this),c(Tt,this))),s(Ft,this,new nt(c(St,this))),s(Wt,this,new Z(c(St,this))),s(Nt,this,new at(c(St,this),c(Wt,this),c(Ft,this))),function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((function(e){e in t&&(t[e]=t[e].bind(t))}))}(this,["configure","create","render","require","context","preload","compile","helpers"]),this.helpers({require:this.require,render:this.render})}),[{key:"configure",value:function(t){return V(c(St,this),t||{}),c(Mt,this).configure(c(St,this),c(Tt,this)),c(Ft,this).configure(c(St,this)),c(Wt,this).configure(c(St,this)),c(Nt,this).configure(c(St,this)),c(St,this)}},{key:"filePath",value:function(t){return function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t}(t,c(St,this).extension)}},{key:"require",value:function(t){var e=this.context({});return n(Bt,this,_t).call(this,this.filePath(t),e).then((function(){return e.getMacro()}))}},{key:"render",value:function(t,e){var r=this.context(e);return n(Bt,this,_t).call(this,this.filePath(t),r).then(this.outputContent(t,r))}},{key:"outputContent",value:function(t,e){var n=this;return function(r){return e.getExtend()?(e.setExtend(!1),n.renderLayout(e.getLayout(),e,t)):r}}},{key:"renderLayout",value:function(t,e,r){var o=this.context(e);return r&&o.setParentTemplate(r),n(Bt,this,_t).call(this,this.filePath(t),o).then(this.outputContent(t,o))}},{key:"helpers",value:function(t){c(Mt,this).helpers(G(c(Tt,this),t))}},{key:"context",value:function(t){return c(Mt,this).create(t)}},{key:"compile",value:function(t,e){return c(Ft,this).compile(t,e)}},{key:"preload",value:function(t){return c(Wt,this).load(t||{})}},{key:"create",value:function(t){return new this.constructor(t)}}])}();function _t(t,e){var n=c(St,this).globalHelpers,r=[e,e.useComponent,e.useElement,e.getBuffer(),e.useSafeValue],o=n.filter((function(t){return M(e[t])})).map((function(t){return e[t].bind(e)}));return c(Nt,this).get(t).then((function(t){return t.apply(e,r.concat(o))}))}var Ct={},At=function(t,e){return(t=URL.parse(t)).protocol=e?"https:":"http:",t.origin},Lt=new Rt({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){M(Ct[e])?t(Ct[e]):n(new wt("template ".concat(e," not found")))}))}}),$t=Lt.render,Ut=Lt.context,qt=Lt.helpers,Ht=Lt.configure;function Gt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(Ct,t)}var Jt=Gt;function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.templates,n=void 0===e?{}:e,o=t.version,i=t.secure,u=void 0===i||i;return Gt(n),function(){var t,e=(t=P().mark((function t(e,n){return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.data=Ut({}),e.data.set("version",o),e.data.set("origin",At(e.req.url,u)),e.data.set("path",e.req.path),e.data.set("query",e.req.query()),e.ejs=function(t,n){return $t(t,Object.assign({param:e.req.param()},e.data,n))},e.helpers=function(t){return qt(t)},e.render=function(t,n){return e.html(e.ejs(t,n))},t.next=10,n();case 10:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(o,i){var u=t.apply(e,n);function c(t){r(u,o,i,c,a,"next",t)}function a(t){r(u,o,i,c,a,"throw",t)}c(void 0)}))});return function(t,n){return e.apply(this,arguments)}}()}var It=Dt;t.TemplateError=mt,t.TemplateNotFound=wt,t.TemplateSyntaxError=kt,t.configure=Ht,t.context=Ut,t.helpers=qt,t.render=$t,t.setRenderer=It,t.setTemplates=Jt,t.useRenderer=Dt,t.useTemplates=Gt}));
3
+ var t,e,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function u(n,r,o,i){var u=r&&r.prototype instanceof s?r:s,f=Object.create(u.prototype);return c(f,"_invoke",function(n,r,o){var i,u,c,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,u=0,c=t,p.n=n,a}};function h(n,r){for(u=n,c=r,e=0;!l&&s&&!o&&e<f.length;e++){var o,i=f[e],h=p.p,v=i[2];n>3?(o=v===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(u=0,p.v=r,p.n=i[1]):h<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,v),u=f,c=v;(e=u<2?t:c)||!l;){i||(u?u<3?(u>1&&(p.n=-1),h(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(l=p.n<0)?c:n.call(r,p))!==a)break}catch(e){i=t,u=1,c=e}finally{s=1}}return{value:e,done:l}}}(n,o,i),!0),f}var a={};function s(){}function f(){}function l(){}e=Object.getPrototypeOf;var p=[][o]?e(e([][o]())):(c(e={},o,(function(){return this})),e),h=l.prototype=s.prototype=Object.create(p);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,c(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return f.prototype=l,c(h,"constructor",l),c(l,"constructor",f),f.displayName="GeneratorFunction",c(l,i,"GeneratorFunction"),c(h),c(h,i,"Generator"),c(h,o,(function(){return this})),c(h,"toString",(function(){return"[object Generator]"})),(r=function(){return{w:u,m:v}})()}function o(t,e,n,r,o){var u=i(t,e,n,r,o);return u.next().then((function(t){return t.done?t.value:u.next()}))}function i(t,e,n,o,i){return new u(r().w(t,e,n,o),i||Promise)}function u(t,n){function r(o,i,u,c){try{var a=t[o](i),s=a.value;return s instanceof e?n.resolve(s.v).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(s).then((function(t){a.value=t,u(a)}),(function(t){return r("throw",t,u,c)}))}catch(t){c(t)}}var o;this.next||(c(u.prototype),c(u.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),c(this,"_invoke",(function(t,e,i){function u(){return new n((function(e,n){r(t,i,e,n)}))}return o=o?o.then(u,u):u()}),!0)}function c(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}c=function(t,e,n,r){function i(e,n){c(t,e,(function(t){return this._invoke(e,n,t)}))}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},c(t,e,n,r)}function a(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function s(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(typeof t+" is not iterable")}function f(){var t=r(),n=t.m(f),c=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function l(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))}var p={throw:1,return:2,break:3,continue:3};function h(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,p[t],e)},delegateYield:function(t,o,i){return e.resultName=o,n(r.d,s(t),i)},finish:function(t){return n(r.f,t)}},n=function(t,n,o){r.p=e.prev,r.n=e.next;try{return t(n,o)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(f=function(){return{wrap:function(e,n,r,o){return t.w(h(e),n,r,o&&o.reverse())},isGeneratorFunction:l,mark:t.m,awrap:function(t,n){return new e(t,n)},AsyncIterator:u,async:function(t,e,n,r,u){return(l(e)?i:o)(h(t),e,n,r,u)},keys:a,values:s}})()}var l=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},p=function(t){return Array.isArray(t)},h=function(t){return"function"==typeof t},v=function(t){return"string"==typeof t},y=function(t){return"boolean"==typeof t},g=function(t){return void 0===t},d="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),b={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},m={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},O=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},j=O(m),w=O(b),E=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(j,(function(t){return m[t]}))},x=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?E(n):n},P=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),u=0;u<o.length;u++){var c=o[u];if(h(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(c)){r={};break}r=r[c]=r[c]||{}}return h(r.toJSON)&&(r=r.toJSON()),[r,i]},k=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},S=function(){},T=function(t,e){var n;for(n in t)N(t,n)&&e(t[n],n,t)},F=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return T(t,(function(t,o,i){var u=e(t,o,i);!1===g(u)&&(n?r.push(u):r[o]=u)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},N=function(t,e){return t&&t.hasOwnProperty(e)},B={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",ELEMENT:"el",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},R=function(t,e){return k(t,{path:l(v,B.path,t.path,e.path),export:l(v,B.export,t.export,e.export),resolver:l(h,B.resolver,t.resolver,e.resolver),extension:l(v,B.extension,t.extension,e.extension),withObject:l(y,B.withObject,t.withObject,e.withObject),rmWhitespace:l(y,B.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:l(y,B.cache,t.cache,e.cache),token:k({},B.token,t.token,e.token),vars:k({},B.vars,t.vars,e.vars),globalHelpers:l(p,B.globalHelpers,t.globalHelpers,e.globalHelpers)})},C=function(t,e,n){var r={path:null,resolver:null},o=function(t,e){return h(t)?t:n.compile(t,e)},i=function(t){r.path=t.path,h(t.resolver)&&(r.resolver=t.resolver)};return i(t),{get:function(t){return e.exist(t)?e.resolve(t):(n=t,r.resolver(r.path,n)).then((function(n){return function(t,n){return e.set(t,n),n}(t,o(n,t))}));var n},configure:i,compile:o}},A=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}],M=function(t){var e={},n=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[s\t\n]*",start:[e.token.start,"_"],end:["_",e.token.end]},A.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")};return n(t),{configure:n,compile:function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,u=r.BUFFER,c=r.COMPONENT,a=r.ELEMENT,s=e.globalHelpers;e.rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var f,l,p,h="".concat(u,"('");f=e.regex,l=function(n,r,o){h+=(""+t.slice(r,o)).replace(w,(function(t){return"\\"+b[t]})),n.forEach((function(t,n){t&&(h+=e.formats[n](t))}))},p=0,t.replace(f,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,p,e),p=e+n.length,n})),h="try{".concat(h+="');","}catch(e){return ").concat(u,".error(e)}"),e.withObject&&(h="with(".concat(o,"){").concat(h,"}")),h="".concat(u,".start();").concat(h,"return ").concat(u,".end();"),h+="\n//# sourceURL=".concat(n);var v=null,y=[o,c,a,u,i].concat(s);try{(v=Function.apply(null,y.concat(h))).source="(function(".concat(y.join(","),"){\n").concat(h,"\n});")}catch(t){throw t.filename=n,t.source=h,t}return v}}},$="undefined"!=typeof globalThis?globalThis:window||self,L=function(){var t={},e={},n=function(n){t.enabled&&k(e,n||{})},r=function(n){if(t.enabled)return e[n]},o=function(t){delete e[t]},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.enabled=e.cache,t.export=e.export,!1===d&&n($[t.export])};return i(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{configure:i,load:n,set:function(n,r){t.enabled&&(e[n]=r)},get:r,exist:function(n){if(t.enabled)return N(e,n)},clear:function(){Object.keys(e).forEach(o)},remove:o,resolve:function(t){return Promise.resolve(r(t))}}},U=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],_=" ",q='"',H="/",G="<",W=">",J=function(t,e,n){var r=[],o=-1===U.indexOf(t),i=function(t,e){var n=[];return T(t,(function(t,r,o){var i=e(t,r,o);!1===g(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[E(e),[q,E(t),q].join("")].join("=")})).join(_);return r.push([G,t,_,i,W].join("")),n&&o&&r.push(n instanceof Array?n.join(""):n),o&&r.push([G,H,t,W].join("")),r.join("")};function I(){I.call(this)}function Y(){I.call(this)}function D(){I.call(this)}function K(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function V(){var t=[],e=[],n=function(t){e.push(t)};return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),K(n)},n.error=function(t){return e=t,Promise.reject(new D(e.message));var e},n.end=function(){return K(e)},n}Object.setPrototypeOf(I.prototype,Error.prototype),Object.assign(I.prototype,{code:0,getCode:function(){return this.code},getMessage:function(){return this.message},toString:function(){return this.getMessage()}}),Object.setPrototypeOf(Y.prototype,I.prototype),Object.assign(Y.prototype,{code:404}),Object.setPrototypeOf(D.prototype,I.prototype),Object.assign(D.prototype,{code:500});var X=Symbol("ContextScope.parentTemplate"),z=function(t,e){var n,r=function(t,e){n=function(t,e){var n=t.vars,r=n.BLOCKS,o=n.MACRO,i=n.EXTEND,u=n.LAYOUT,c=n.BUFFER,a=n.SAFE,s=n.SCOPE,f=n.COMPONENT,l=n.ELEMENT;function p(t){this[X]=null,this[r]={},this[o]={},Object.assign(this,F(t,[s,c,a,f,l]))}return Object.assign(p.prototype,e),Object.defineProperty(p.prototype,c,{value:V()}),Object.defineProperty(p.prototype,r,{value:{},writable:!0}),Object.defineProperty(p.prototype,o,{value:{},writable:!0}),Object.defineProperty(p.prototype,u,{value:!1,writable:!0}),Object.defineProperty(p.prototype,i,{value:!1,writable:!0}),Object.defineProperty(p.prototype,X,{value:null,writable:!0}),Object.defineProperties(p.prototype,{setParentTemplate:{value:function(t){return this[X]=t,this}},getParentTemplate:{value:function(){return this[X]}},useSafeValue:{get:function(){return x}},useComponent:{get:function(){return h(this[f])?this[f].bind(this):function(){throw new Error("".concat(f," must be a function"))}}},useElement:{get:function(){return h(this[l])?this[l].bind(this):function(){throw new Error("".concat(l," must be a function"))}}},getMacro:{value:function(){return this[o]}},getBuffer:{value:function(){return this[c]}},getBlocks:{value:function(){return this[r]}},setExtend:{value:function(t){return this[i]=t,this}},getExtend:{value:function(){return this[i]}},setLayout:{value:function(t){return this[u]=t,this}},getLayout:{value:function(){return this[u]}},clone:{value:function(t){var e=[u,i,c];return!0===t&&e.push(r),F(this,e)}},extend:{value:function(t){this.setExtend(!0),this.setLayout(t)}},echo:{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}},fn:{value:function(t){var e=this.getBuffer(),n=this;return function(){if(h(t))return e.backup(),e(t.apply(n,arguments)),e.restore()}}},macro:{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}}},call:{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(h(e))return e.apply(e,n)}},block:{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()},u=function(){var t=i();return t?function(){n.echo(t(u()))}:S};this.echo(i()(u()))}}},hasBlock:{value:function(t){return this.getBlocks().hasOwnProperty(t)}},include:{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=k(r,e||{}),i=this.render(t,o);this.echo(i)}},use:{value:function(t,e){var n=this;this.echo(Promise.resolve(this.require(t)).then((function(t){var r=n.getMacro();T(t,(function(t,n){r[[e,n].join(".")]=t}))})))}},async:{value:function(t,e){this.echo(Promise.resolve(t).then(e))}},get:{value:function(t,e){var n=P(this,t,!0),r=n.shift(),o=n.pop();return N(r,o)?r[o]:e}},set:{value:function(t,e){var n=P(this,t,!1),r=n.shift(),o=n.pop();return this.getParentTemplate()&&N(r,o)?r[o]:r[o]=e}},each:{value:function(t,e){v(t)&&(t=this.get(t,[])),T(t,e)},writable:!0},el:{value:function(t,e,n){n=h(n)?this.fn(n)():n,this.echo(Promise.resolve(n).then((function(n){return J(t,e,n)})))},writable:!0},ui:{value:function(t){},writable:!0}}),p}(t,e)};return r(t,e),{configure:r,create:function(t){return new n(t)},helpers:function(t){k(n.prototype,t||{})}}},Q=function(){var t=R({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),e={},n=z(t,e),r=M(t),o=L(t),i=C(t,o,r),u=function(e){return function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t}(e,t.extension)},c=function(t){var e=p({});return v(u(t),e).then((function(){return e.getMacro()}))},a=function(t,e){var n=p(e);return v(u(t),n).then(s(t,n))},s=function(t,e){return function(n){return e.getExtend()?(e.setExtend(!1),f(e.getLayout(),e,t)):n}},f=function(t,e,n){var r=p(e);return n&&r.setParentTemplate(n),v(u(t),r).then(s(t,r))},l=function(t){n.helpers(k(e,t))},p=function(t){return n.create(t)},v=function(e,n){var r=[n,n.useComponent,n.useElement,n.getBuffer(),n.useSafeValue],o=t.globalHelpers.filter((function(t){return h(n[t])})).map((function(t){return n[t].bind(n)}));return i.get(e).then((function(t){return t.apply(n,r.concat(o))}))};return l({render:a,require:c}),{configure:function(){return R(t,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})||{}),n.configure(t,e),r.configure(t),o.configure(t),i.configure(t),t},create:function(t){return Q(t)},createContext:p,render:a,require:c,preload:function(t){return o.load(t||{})},compile:function(t,e){return r.compile(t,e)},helpers:l}},Z={},tt=function(t,e){return(t=URL.parse(t)).protocol=e?"https:":"http:",t.origin},et=Q({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){h(Z[e])?t(Z[e]):n(new Y)}))}}),nt=et.render,rt=et.createContext,ot=et.helpers,it=et.configure;function ut(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(Z,t)}var ct=ut;function at(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.templates,r=void 0===e?{}:e,o=t.version,i=t.secure,u=void 0===i||i;return ut(r),function(){var t,e=(t=f().mark((function t(e,n){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.data=rt({}),e.data.set("version",o),e.data.set("origin",tt(e.req.url,u)),e.data.set("path",e.req.path),e.data.set("query",e.req.query()),e.ejs=function(t,n){return nt(t,Object.assign({param:e.req.param()},e.data,n))},e.helpers=function(t){return ot(t)},e.render=function(t,n){return e.html(e.ejs(t,n))},t.next=10,n();case 10:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var u=t.apply(e,r);function c(t){n(u,o,i,c,a,"next",t)}function a(t){n(u,o,i,c,a,"throw",t)}c(void 0)}))});return function(t,n){return e.apply(this,arguments)}}()}var st=at;t.TemplateError=I,t.TemplateNotFound=Y,t.TemplateSyntaxError=D,t.configure=it,t.createContext=rt,t.helpers=ot,t.render=nt,t.setRenderer=st,t.setTemplates=ct,t.useRenderer=at,t.useTemplates=ut}));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "EJS Templates",
4
4
  "homepage": "https://github.com/kosatyi/ejs",
5
5
  "type": "module",
6
- "version": "0.0.105",
6
+ "version": "0.0.106",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "browser": "dist/umd/browser.js",