diff --git a/CHANGELOG.md b/CHANGELOG.md index 6daad95b..630a7c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## 4.8.1 (2024-12-06) + +- fix: if template is imported in JS in compile mode and the same template function called with different variables set + then variables from previous definition must not be cached. + This fix is for all template engines. #128 + ## 4.8.0 (2024-12-05) - feat: add `minimized` tag in stats output for minimized HTML assets diff --git a/README.md b/README.md index c7f58e6d..c0eaef58 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Advanced alternative to [html-webpack-plugin](https://github.com/jantimon/html-w - **Renders** the [template engines](#template-engine) "out of the box": [Eta](#using-template-eta), [EJS](#using-template-ejs), [Handlebars](#using-template-handlebars), [Nunjucks](#using-template-nunjucks), [Pug](#using-template-pug), [Tempura](#using-template-tempura), [TwigJS](#using-template-twig), [LiquidJS](#using-template-liquidjs). It is very easy to add support for any template engine. -- Supports including of Markdown `*.md` files in the template, see [live Markdown demo](https://stackblitz.com/edit/markdown-to-html-webpack?file=webpack.config.js) in browser. +- Supports including of Markdown `*.md` files in the template, see [Markdown demo](https://stackblitz.com/edit/markdown-to-html-webpack?file=webpack.config.js) in browser. - **Source files** of [`script`](#option-js) and [`style`](#option-css) can be specified directly in HTML: - ``\ No longer need to define source style files in Webpack entry or import styles in JavaScript. diff --git a/package.json b/package.json index c3e64636..c848e856 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "html-bundler-webpack-plugin", - "version": "4.8.0", + "version": "4.8.1", "description": "HTML Bundler Plugin for Webpack renders HTML templates containing source files of scripts, styles, images. Supports template engines: Eta, EJS, Handlebars, Nunjucks, Pug, TwigJS. Alternative to html-webpack-plugin.", "keywords": [ "html", diff --git a/src/Loader/Preprocessors/Ejs/index.js b/src/Loader/Preprocessors/Ejs/index.js index b99fa45e..191b0e96 100644 --- a/src/Loader/Preprocessors/Ejs/index.js +++ b/src/Loader/Preprocessors/Ejs/index.js @@ -123,7 +123,7 @@ const preprocessor = (loaderContext, options) => { return `${templateFunction}; var data = ${stringifyJSON(data)}; - var template = (context) => ${exportFunctionName}(Object.assign(data, context)); + var template = (context) => ${exportFunctionName}(Object.assign({}, data, context)); ${exportCode}template;`; }, }; diff --git a/src/Loader/Preprocessors/Eta/index.js b/src/Loader/Preprocessors/Eta/index.js index 92430c6f..ad5d7f55 100644 --- a/src/Loader/Preprocessors/Eta/index.js +++ b/src/Loader/Preprocessors/Eta/index.js @@ -125,7 +125,7 @@ const preprocessor = (loaderContext, options) => { var eta = new Eta(${stringifyJSON(options)}); var data = ${stringifyJSON(data)}; var etaFn = ${templateFunction}; - var ${exportFunctionName} = (context) => etaFn.bind(eta)(Object.assign(data, context)); + var ${exportFunctionName} = (context) => etaFn.bind(eta)(Object.assign({}, data, context)); ${exportCode}${exportFunctionName};`; }, }; diff --git a/src/Loader/Preprocessors/Handlebars/index.js b/src/Loader/Preprocessors/Handlebars/index.js index 32ee951b..5abe47dd 100644 --- a/src/Loader/Preprocessors/Handlebars/index.js +++ b/src/Loader/Preprocessors/Handlebars/index.js @@ -257,7 +257,7 @@ const preprocessor = (loaderContext, options) => { ${precompiledTemplate}; var ${exportFunctionName} = (context) => { var template = (Handlebars['default'] || Handlebars).template(precompiledTemplate); - return template(Object.assign(data, context)); + return template(Object.assign({}, data, context)); }; ${exportCode}${exportFunctionName};`; }, @@ -271,7 +271,7 @@ const preprocessor = (loaderContext, options) => { }, /** - * CCalled when the webpack compiler is closing. + * Called when the webpack compiler is closing. * Reset cached states, needed for tests. */ shutdown() { diff --git a/src/Loader/Preprocessors/Nunjucks/index.js b/src/Loader/Preprocessors/Nunjucks/index.js index b2c3cc70..cc90c839 100644 --- a/src/Loader/Preprocessors/Nunjucks/index.js +++ b/src/Loader/Preprocessors/Nunjucks/index.js @@ -131,7 +131,7 @@ const preprocessor = (loaderContext, options = {}, { esModule, watch }) => { var nunjucks = require('${runtimeFile}'); ${precompiledTemplate}; var data = ${stringifyJSON(data)}; - var ${exportFunctionName} = (context) => nunjucks.render(templateId, Object.assign(data, context)); + var ${exportFunctionName} = (context) => nunjucks.render(templateId, Object.assign({}, data, context)); ${exportCode}${exportFunctionName};`; }, }; diff --git a/src/Loader/Preprocessors/Pug/index.js b/src/Loader/Preprocessors/Pug/index.js index 1b4ad398..6d1dc4a1 100644 --- a/src/Loader/Preprocessors/Pug/index.js +++ b/src/Loader/Preprocessors/Pug/index.js @@ -67,7 +67,7 @@ const preprocessor = (loaderContext, options, { esModule, watch }) => { return `${templateFunction}; var data = ${stringifyJSON(data)}; - var ${exportFunctionName} = (context) => ${functionName}(Object.assign(data, context)); + var ${exportFunctionName} = (context) => ${functionName}(Object.assign({}, data, context)); ${exportCode}${exportFunctionName};`; }, }; diff --git a/src/Loader/Preprocessors/Tempura/index.js b/src/Loader/Preprocessors/Tempura/index.js index cf9db6b4..0637834b 100644 --- a/src/Loader/Preprocessors/Tempura/index.js +++ b/src/Loader/Preprocessors/Tempura/index.js @@ -129,7 +129,7 @@ const preprocessor = (loaderContext, options) => { return `${templateFunction}; var data = ${stringifyJSON(data)}; var helpers = ${helpersString}; - ${exportCode} (context) => ${exportFunctionName}(Object.assign(data, context), helpers);`; + ${exportCode} (context) => ${exportFunctionName}(Object.assign({}, data, context), helpers);`; }, }; }; diff --git a/src/Loader/Preprocessors/Twig/index.js b/src/Loader/Preprocessors/Twig/index.js index c3d1cd2d..f314618b 100644 --- a/src/Loader/Preprocessors/Twig/index.js +++ b/src/Loader/Preprocessors/Twig/index.js @@ -170,7 +170,7 @@ const preprocessor = (loaderContext, options) => { ${hot === true ? `Twig.cache(false);` : ''} var data = ${stringifyJSON(data)}; var template = Twig.twig(${precompiledTemplate}); - var ${exportFunctionName} = (context) => template.render(Object.assign(data, context)); + var ${exportFunctionName} = (context) => template.render(Object.assign({}, data, context)); ${exportCode}${exportFunctionName};`; }, }; diff --git a/src/Plugin/Collection.js b/src/Plugin/Collection.js index 457c0cb7..6fc123a9 100644 --- a/src/Plugin/Collection.js +++ b/src/Plugin/Collection.js @@ -874,10 +874,10 @@ class Collection { render(assets) { const compilation = this.compilation; const { RawSource } = compilation.compiler.webpack.sources; - const LF = this.pluginOption.getLF(); - const isIntegrity = this.pluginOption.isIntegrityEnabled(); + const hasIntegrity = this.pluginOption.isIntegrityEnabled(); const isHtmlMinify = this.pluginOption.isMinify(); - + const { minifyOptions } = this.pluginOption.get(); + const LF = this.pluginOption.getLF(); const hooks = this.hooks; const promises = []; @@ -928,16 +928,14 @@ class Collection { // 2. postprocess callback if (this.pluginOption.hasPostprocess()) { // TODO: update readme for postprocess - promise = promise.then( - (value) => this.pluginOption.postprocess(value, templateInfo, this.compilation) || value - ); + promise = promise.then((value) => this.pluginOption.postprocess(value, templateInfo, compilation) || value); } // 3. minify HTML before inlining JS and CSS to avoid: // - needles minification already minified assets in production mode // - issues by parsing the inlined JS/CSS code with the html minification module if (isHtmlMinify) { - promise = promise.then((value) => minify(value, this.pluginOption.get().minifyOptions)); + promise = promise.then((value) => minify(value, minifyOptions)); } // 4. inline JS and CSS @@ -974,7 +972,7 @@ class Collection { } // 1.1 compute CSS integrity - if (isIntegrity && !inline) { + if (hasIntegrity && !inline) { // path to asset relative by output.path let pathname = asset.assetFile; if (this.pluginOption.isAutoPublicPath()) { @@ -1001,7 +999,7 @@ class Collection { break; case Collection.type.script: // 1.2 compute JS integrity - if (isIntegrity) { + if (hasIntegrity) { for (const chunk of asset.chunks) { if (!chunk.inline) { const assetContent = compilation.assets[chunk.chunkFile].source(); @@ -1046,7 +1044,7 @@ class Collection { } // 8. inject integrity - if (isIntegrity) { + if (hasIntegrity) { promise = promise.then((content) => { // 2. parse generated html for `link` and `script` tags const parsedResults = []; diff --git a/test/cases/_preprocessor/handlebars-custom-runtime/expected/app.js b/test/cases/_preprocessor/handlebars-custom-runtime/expected/app.js index 542df1c8..7ecb867f 100644 --- a/test/cases/_preprocessor/handlebars-custom-runtime/expected/app.js +++ b/test/cases/_preprocessor/handlebars-custom-runtime/expected/app.js @@ -1 +1 @@ -(()=>{var t={525:function(t){t.exports=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(){var t=new a.HandlebarsEnvironment;return l.extend(t,a),t.SafeString=u.default,t.Exception=s.default,t.Utils=l,t.escapeExpression=l.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var o=r(1).default,i=r(2).default;e.__esModule=!0;var a=o(r(3)),u=i(r(76)),s=i(r(5)),l=o(r(4)),c=o(r(77)),f=i(r(82)),p=n();p.create=n,f.default(p),p.default=p,e.default=p,t.exports=e.default},function(t,e){"use strict";e.default=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},e.__esModule=!0},function(t,e){"use strict";e.default=function(t){return t&&t.__esModule?t:{default:t}},e.__esModule=!0},function(t,e,r){"use strict";function n(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},u.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}var o=r(2).default;e.__esModule=!0,e.HandlebarsEnvironment=n;var i=r(4),a=o(r(5)),u=r(9),s=r(69),l=o(r(71)),c=r(72);e.VERSION="4.7.8";e.COMPILER_REVISION=8;e.LAST_COMPATIBLE_COMPILER_REVISION=7;e.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var f="[object Object]";n.prototype={constructor:n,logger:l.default,log:l.default.log,registerHelper:function(t,e){if(i.toString.call(t)===f){if(e)throw new a.default("Arg not supported with multiple helpers");i.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(i.toString.call(t)===f)i.extend(this.partials,t);else{if(void 0===e)throw new a.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(i.toString.call(t)===f){if(e)throw new a.default("Arg not supported with multiple decorators");i.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var p=l.default.log;e.log=p,e.createFrame=i.createFrame,e.logger=l.default},function(t,e){"use strict";function r(t){return o[t]}function n(t){for(var e=1;e":">",'"':""","'":"'","`":"`","=":"="},i=/[&<>"'`=]/g,a=/[&<>"'`=]/,u=Object.prototype.toString;e.toString=u;var s=function(t){return"function"==typeof t};s(/x/)&&(e.isFunction=s=function(t){return"function"==typeof t&&"[object Function]"===u.call(t)}),e.isFunction=s;var l=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===u.call(t)};e.isArray=l},function(t,e,r){"use strict";function n(t,e){var r=e&&e.loc,a=void 0,u=void 0,s=void 0,l=void 0;r&&(a=r.start.line,u=r.end.line,s=r.start.column,l=r.end.column,t+=" - "+a+":"+s);for(var c=Error.prototype.constructor.call(this,t),f=0;f0?(r.ids&&(r.ids=[r.name]),t.helpers.each(e,r)):o(this);if(r.data&&r.ids){var a=n.createFrame(r.data);a.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:a}}return i(e,r)}))},t.exports=e.default},function(t,e,r){"use strict";var n=r(12).default,o=r(42).default,i=r(54).default,a=r(59).default,u=r(2).default;e.__esModule=!0;var s=r(4),l=u(r(5));e.default=function(t){t.registerHelper("each",(function(t,e){function r(e,r,n){d&&(d.key=e,d.index=r,d.first=0===r,d.last=!!n,h&&(d.contextPath=h+e)),p+=u(t[e],{data:d,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(!e)throw new l.default("Must pass iterator to #each");var u=e.fn,c=e.inverse,f=0,p="",d=void 0,h=void 0;if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(d=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var v=t.length;fo;)F(t,r=n[o++],e[r]);return t},V=function(t,e){return void 0===e?P(t):R(P(t),e)},B=function(t){var e=A.call(this,t);return!(e||!i(this,t)||!i(N,t)||i(this,j)&&this[j][t])||e},G=function(t,e){var r=b(t=_(t),e);return!r||!i(N,e)||i(t,j)&&t[j][e]||(r.enumerable=!0),r},W=function(t){for(var e,r=M(_(t)),n=[],o=0;r.length>o;)i(N,e=r[o++])||e==j||n.push(e);return n},q=function(t){for(var e,r=M(_(t)),n=[],o=0;r.length>o;)i(N,e=r[o++])&&n.push(N[e]);return n},J=l((function(){var t=O();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))}));C||(O=function(){if(L(this))throw TypeError("Symbol is not a constructor");return D(p(arguments.length>0?arguments[0]:void 0))},s(O.prototype,"toString",(function(){return this._k})),L=function(t){return t instanceof O},n.create=V,n.isEnum=B,n.getDesc=G,n.setDesc=F,n.setDescs=R,n.getNames=v.get=W,n.getSymbols=q,a&&!r(40)&&s(H,"propertyIsEnumerable",B,!0));var U={for:function(t){return i(I,t+="")?I[t]:I[t]=O(t)},keyFor:function(t){return h(I,t)},useSetter:function(){E=!0},useSimple:function(){E=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),(function(t){var e=d(t);U[t]=C?e:D(e)})),E=!0,u(u.G+u.W,{Symbol:O}),u(u.S,"Symbol",U),u(u.S+u.F*!C,"Object",{create:V,defineProperty:F,defineProperties:R,getOwnPropertyDescriptor:G,getOwnPropertyNames:W,getOwnPropertySymbols:q}),S&&u(u.S+u.F*(!C||J),"JSON",{stringify:function(t){if(void 0!==t&&!L(t)){for(var e,r,n=[t],o=1,i=arguments;i.length>o;)n.push(i[o++]);return"function"==typeof(e=n[1])&&(r=e),!r&&m(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!L(e))return e}),n[1]=e,k.apply(S,n)}}}),f(O,"Symbol"),f(Math,"Math",!0),f(o.JSON,"JSON",!0)},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){t.exports=!r(18)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(15),o=r(20),i=r(21),a="prototype",u=function(t,e,r){var s,l,c,f=t&u.F,p=t&u.G,d=t&u.S,h=t&u.P,v=t&u.B,g=t&u.W,m=p?o:o[e]||(o[e]={}),y=p?n:d?n[e]:(n[e]||{})[a];for(s in p&&(r=e),r)(l=!f&&y&&s in y)&&s in m||(c=l?y[s]:r[s],m[s]=p&&"function"!=typeof y[s]?r[s]:v&&l?i(c,n):g&&y[s]==c?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[a]=t[a],e}(c):h&&"function"==typeof c?i(Function.call,c):c,h&&((m[a]||(m[a]={}))[s]=c))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,t.exports=u},function(t,e){var r=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(22);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){t.exports=r(24)},function(t,e,r){var n=r(8),o=r(25);t.exports=r(17)?function(t,e,r){return n.setDesc(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){var n=r(15),o="__core-js_shared__",i=n[o]||(n[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,r){var n=r(8).setDesc,o=r(16),i=r(28)("toStringTag");t.exports=function(t,e,r){t&&!o(t=r?t:t.prototype,i)&&n(t,i,{configurable:!0,value:e})}},function(t,e,r){var n=r(26)("wks"),o=r(29),i=r(15).Symbol;t.exports=function(t){return n[t]||(n[t]=i&&i[t]||(i||o)("Symbol."+t))}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){var n=r(8),o=r(31);t.exports=function(t,e){for(var r,i=o(t),a=n.getKeys(i),u=a.length,s=0;u>s;)if(i[r=a[s++]]===e)return r}},function(t,e,r){var n=r(32),o=r(34);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(33);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(31),o=r(8).getNames,i={}.toString,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(n(t))}},function(t,e,r){var n=r(8);t.exports=function(t){var e=n.getKeys(t),r=n.getSymbols;if(r)for(var o,i=r(t),a=n.isEnum,u=0;i.length>u;)a.call(t,o=i[u++])&&e.push(o);return e}},function(t,e,r){var n=r(33);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){var n=r(39);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=!0},function(t,e){},function(t,e,r){t.exports={default:r(43),__esModule:!0}},function(t,e,r){r(44),r(50),t.exports=r(28)("iterator")},function(t,e,r){"use strict";var n=r(45)(!0);r(47)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})}))},function(t,e,r){var n=r(46),o=r(34);t.exports=function(t){return function(e,r){var i,a,u=String(o(e)),s=n(r),l=u.length;return s<0||s>=l?t?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===l||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):i:t?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){"use strict";var n=r(40),o=r(19),i=r(23),a=r(24),u=r(16),s=r(48),l=r(49),c=r(27),f=r(8).getProto,p=r(28)("iterator"),d=!([].keys&&"next"in[].keys()),h="@@iterator",v="keys",g="values",m=function(){return this};t.exports=function(t,e,r,y,_,x,b){l(r,e,y);var w,P,M=function(t){if(!d&&t in E)return E[t];switch(t){case v:case g:return function(){return new r(this,t)}}return function(){return new r(this,t)}},O=e+" Iterator",S=_==g,k=!1,E=t.prototype,j=E[p]||E[h]||_&&E[_],A=j||M(_);if(j){var I=f(A.call(new t));c(I,O,!0),!n&&u(E,h)&&a(I,p,m),S&&j.name!==g&&(k=!0,A=function(){return j.call(this)})}if(n&&!b||!d&&!k&&E[p]||a(E,p,A),s[e]=A,s[O]=m,_)if(w={values:S?A:M(g),keys:x?A:M(v),entries:S?M("entries"):A},b)for(P in w)P in E||i(E,P,w[P]);else o(o.P+o.F*(d||k),e,w);return w}},function(t,e){t.exports={}},function(t,e,r){"use strict";var n=r(8),o=r(25),i=r(27),a={};r(24)(a,r(28)("iterator"),(function(){return this})),t.exports=function(t,e,r){t.prototype=n.create(a,{next:o(1,r)}),i(t,e+" Iterator")}},function(t,e,r){r(51);var n=r(48);n.NodeList=n.HTMLCollection=n.Array},function(t,e,r){"use strict";var n=r(52),o=r(53),i=r(48),a=r(31);t.exports=r(47)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){t.exports={default:r(55),__esModule:!0}},function(t,e,r){r(50),r(44),t.exports=r(56)},function(t,e,r){var n=r(38),o=r(57);t.exports=r(20).getIterator=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,r){var n=r(58),o=r(28)("iterator"),i=r(48);t.exports=r(20).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,e,r){var n=r(33),o=r(28)("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=(e=Object(t))[o])?r:i?n(e):"Object"==(a=n(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,r){t.exports={default:r(60),__esModule:!0}},function(t,e,r){r(61),t.exports=r(20).Object.keys},function(t,e,r){var n=r(62);r(63)("keys",(function(t){return function(e){return t(n(e))}}))},function(t,e,r){var n=r(34);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(19),o=r(20),i=r(18);t.exports=function(t,e){var r=(o.Object||{})[t]||Object[t],a={};a[t]=e(r),n(n.S+n.F*i((function(){r(1)})),"Object",a)}},function(t,e,r){"use strict";var n=r(2).default;e.__esModule=!0;var o=n(r(5));e.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},t.exports=e.default},function(t,e,r){"use strict";var n=r(2).default;e.__esModule=!0;var o=r(4),i=n(r(5));e.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new i.default("#if requires exactly one argument");return o.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||o.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,r){if(2!=arguments.length)throw new i.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],r=arguments[arguments.length-1],n=0;n=0?e:parseInt(t,10)}return t},log:function(t){if(t=o.lookupLevel(t),"undefined"!=typeof console&&o.lookupLevel(o.level)<=t){var e=o.methodMap[t];console[e]||(e="log");for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i=p.LAST_COMPATIBLE_COMPILER_REVISION&&e<=p.COMPILER_REVISION)){if(e{var n=r(525),o={title:"My Title",lang:"en"},i={1:function(t,e,r,n,o){return"
  • "+t.escapeExpression(t.lambda(e,e))+"
  • \n"},compiler:[8,">= 4.3.0"],main:function(t,e,n,o,i){var a,u,s=null!=e?e:t.nullContext||{},l=t.hooks.helperMissing,c="function",f=t.escapeExpression,p=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return"

    Hello "+f(typeof(u=null!=(u=p(n,"name")||(null!=e?p(e,"name"):e))?u:l)===c?u.call(s,{name:"name",hash:{},data:i,loc:{start:{line:1,column:10},end:{line:1,column:20}}}):u)+'!

    \n
    Global data: title = "'+f(typeof(u=null!=(u=p(n,"title")||(null!=e?p(e,"title"):e))?u:l)===c?u.call(s,{name:"title",hash:{},data:i,loc:{start:{line:2,column:27},end:{line:2,column:38}}}):u)+'"
    \n
    Query param: lang = "'+f(typeof(u=null!=(u=p(n,"lang")||(null!=e?p(e,"lang"):e))?u:l)===c?u.call(s,{name:"lang",hash:{},data:i,loc:{start:{line:3,column:26},end:{line:3,column:36}}}):u)+'"
    \n\n
      \n'+(null!=(a=p(n,"each").call(s,null!=e?p(e,"people"):e,{name:"each",hash:{},fn:t.program(1,i,0),inverse:t.noop,data:i,loc:{start:{line:6,column:4},end:{line:8,column:13}}}))?a:"")+'
    \n\n\n'},useData:!0};t.exports=t=>(n.default||n).template(i)(Object.assign(o,t))},348:(t,e,r)=>{"use strict";t.exports=r.p+"img/fig.c6809878.png"},272:(t,e,r)=>{"use strict";t.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(t,e,r)=>{"use strict";t.exports=r.p+"img/pear.6b9b072a.png"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),(()=>{"use strict";var t=r(129),e=r.n(t);document.getElementById("main").innerHTML=e()({name:"World",people:["Alexa ","Cortana ","Siri "]}),console.log(">> app")})()})(); \ No newline at end of file +(()=>{var t={525:function(t){t.exports=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(){var t=new a.HandlebarsEnvironment;return l.extend(t,a),t.SafeString=u.default,t.Exception=s.default,t.Utils=l,t.escapeExpression=l.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var o=r(1).default,i=r(2).default;e.__esModule=!0;var a=o(r(3)),u=i(r(76)),s=i(r(5)),l=o(r(4)),c=o(r(77)),f=i(r(82)),p=n();p.create=n,f.default(p),p.default=p,e.default=p,t.exports=e.default},function(t,e){"use strict";e.default=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},e.__esModule=!0},function(t,e){"use strict";e.default=function(t){return t&&t.__esModule?t:{default:t}},e.__esModule=!0},function(t,e,r){"use strict";function n(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},u.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}var o=r(2).default;e.__esModule=!0,e.HandlebarsEnvironment=n;var i=r(4),a=o(r(5)),u=r(9),s=r(69),l=o(r(71)),c=r(72);e.VERSION="4.7.8";e.COMPILER_REVISION=8;e.LAST_COMPATIBLE_COMPILER_REVISION=7;e.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var f="[object Object]";n.prototype={constructor:n,logger:l.default,log:l.default.log,registerHelper:function(t,e){if(i.toString.call(t)===f){if(e)throw new a.default("Arg not supported with multiple helpers");i.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(i.toString.call(t)===f)i.extend(this.partials,t);else{if(void 0===e)throw new a.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(i.toString.call(t)===f){if(e)throw new a.default("Arg not supported with multiple decorators");i.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var p=l.default.log;e.log=p,e.createFrame=i.createFrame,e.logger=l.default},function(t,e){"use strict";function r(t){return o[t]}function n(t){for(var e=1;e":">",'"':""","'":"'","`":"`","=":"="},i=/[&<>"'`=]/g,a=/[&<>"'`=]/,u=Object.prototype.toString;e.toString=u;var s=function(t){return"function"==typeof t};s(/x/)&&(e.isFunction=s=function(t){return"function"==typeof t&&"[object Function]"===u.call(t)}),e.isFunction=s;var l=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===u.call(t)};e.isArray=l},function(t,e,r){"use strict";function n(t,e){var r=e&&e.loc,a=void 0,u=void 0,s=void 0,l=void 0;r&&(a=r.start.line,u=r.end.line,s=r.start.column,l=r.end.column,t+=" - "+a+":"+s);for(var c=Error.prototype.constructor.call(this,t),f=0;f0?(r.ids&&(r.ids=[r.name]),t.helpers.each(e,r)):o(this);if(r.data&&r.ids){var a=n.createFrame(r.data);a.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:a}}return i(e,r)}))},t.exports=e.default},function(t,e,r){"use strict";var n=r(12).default,o=r(42).default,i=r(54).default,a=r(59).default,u=r(2).default;e.__esModule=!0;var s=r(4),l=u(r(5));e.default=function(t){t.registerHelper("each",(function(t,e){function r(e,r,n){d&&(d.key=e,d.index=r,d.first=0===r,d.last=!!n,h&&(d.contextPath=h+e)),p+=u(t[e],{data:d,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(!e)throw new l.default("Must pass iterator to #each");var u=e.fn,c=e.inverse,f=0,p="",d=void 0,h=void 0;if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(d=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var v=t.length;fo;)F(t,r=n[o++],e[r]);return t},V=function(t,e){return void 0===e?P(t):R(P(t),e)},B=function(t){var e=A.call(this,t);return!(e||!i(this,t)||!i(N,t)||i(this,j)&&this[j][t])||e},G=function(t,e){var r=b(t=_(t),e);return!r||!i(N,e)||i(t,j)&&t[j][e]||(r.enumerable=!0),r},W=function(t){for(var e,r=M(_(t)),n=[],o=0;r.length>o;)i(N,e=r[o++])||e==j||n.push(e);return n},q=function(t){for(var e,r=M(_(t)),n=[],o=0;r.length>o;)i(N,e=r[o++])&&n.push(N[e]);return n},J=l((function(){var t=O();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))}));C||(O=function(){if(L(this))throw TypeError("Symbol is not a constructor");return D(p(arguments.length>0?arguments[0]:void 0))},s(O.prototype,"toString",(function(){return this._k})),L=function(t){return t instanceof O},n.create=V,n.isEnum=B,n.getDesc=G,n.setDesc=F,n.setDescs=R,n.getNames=v.get=W,n.getSymbols=q,a&&!r(40)&&s(H,"propertyIsEnumerable",B,!0));var U={for:function(t){return i(I,t+="")?I[t]:I[t]=O(t)},keyFor:function(t){return h(I,t)},useSetter:function(){E=!0},useSimple:function(){E=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),(function(t){var e=d(t);U[t]=C?e:D(e)})),E=!0,u(u.G+u.W,{Symbol:O}),u(u.S,"Symbol",U),u(u.S+u.F*!C,"Object",{create:V,defineProperty:F,defineProperties:R,getOwnPropertyDescriptor:G,getOwnPropertyNames:W,getOwnPropertySymbols:q}),S&&u(u.S+u.F*(!C||J),"JSON",{stringify:function(t){if(void 0!==t&&!L(t)){for(var e,r,n=[t],o=1,i=arguments;i.length>o;)n.push(i[o++]);return"function"==typeof(e=n[1])&&(r=e),!r&&m(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!L(e))return e}),n[1]=e,k.apply(S,n)}}}),f(O,"Symbol"),f(Math,"Math",!0),f(o.JSON,"JSON",!0)},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){t.exports=!r(18)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(15),o=r(20),i=r(21),a="prototype",u=function(t,e,r){var s,l,c,f=t&u.F,p=t&u.G,d=t&u.S,h=t&u.P,v=t&u.B,g=t&u.W,m=p?o:o[e]||(o[e]={}),y=p?n:d?n[e]:(n[e]||{})[a];for(s in p&&(r=e),r)(l=!f&&y&&s in y)&&s in m||(c=l?y[s]:r[s],m[s]=p&&"function"!=typeof y[s]?r[s]:v&&l?i(c,n):g&&y[s]==c?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[a]=t[a],e}(c):h&&"function"==typeof c?i(Function.call,c):c,h&&((m[a]||(m[a]={}))[s]=c))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,t.exports=u},function(t,e){var r=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(22);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){t.exports=r(24)},function(t,e,r){var n=r(8),o=r(25);t.exports=r(17)?function(t,e,r){return n.setDesc(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){var n=r(15),o="__core-js_shared__",i=n[o]||(n[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,r){var n=r(8).setDesc,o=r(16),i=r(28)("toStringTag");t.exports=function(t,e,r){t&&!o(t=r?t:t.prototype,i)&&n(t,i,{configurable:!0,value:e})}},function(t,e,r){var n=r(26)("wks"),o=r(29),i=r(15).Symbol;t.exports=function(t){return n[t]||(n[t]=i&&i[t]||(i||o)("Symbol."+t))}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){var n=r(8),o=r(31);t.exports=function(t,e){for(var r,i=o(t),a=n.getKeys(i),u=a.length,s=0;u>s;)if(i[r=a[s++]]===e)return r}},function(t,e,r){var n=r(32),o=r(34);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(33);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(31),o=r(8).getNames,i={}.toString,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(n(t))}},function(t,e,r){var n=r(8);t.exports=function(t){var e=n.getKeys(t),r=n.getSymbols;if(r)for(var o,i=r(t),a=n.isEnum,u=0;i.length>u;)a.call(t,o=i[u++])&&e.push(o);return e}},function(t,e,r){var n=r(33);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){var n=r(39);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=!0},function(t,e){},function(t,e,r){t.exports={default:r(43),__esModule:!0}},function(t,e,r){r(44),r(50),t.exports=r(28)("iterator")},function(t,e,r){"use strict";var n=r(45)(!0);r(47)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})}))},function(t,e,r){var n=r(46),o=r(34);t.exports=function(t){return function(e,r){var i,a,u=String(o(e)),s=n(r),l=u.length;return s<0||s>=l?t?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===l||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):i:t?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){"use strict";var n=r(40),o=r(19),i=r(23),a=r(24),u=r(16),s=r(48),l=r(49),c=r(27),f=r(8).getProto,p=r(28)("iterator"),d=!([].keys&&"next"in[].keys()),h="@@iterator",v="keys",g="values",m=function(){return this};t.exports=function(t,e,r,y,_,x,b){l(r,e,y);var w,P,M=function(t){if(!d&&t in E)return E[t];switch(t){case v:case g:return function(){return new r(this,t)}}return function(){return new r(this,t)}},O=e+" Iterator",S=_==g,k=!1,E=t.prototype,j=E[p]||E[h]||_&&E[_],A=j||M(_);if(j){var I=f(A.call(new t));c(I,O,!0),!n&&u(E,h)&&a(I,p,m),S&&j.name!==g&&(k=!0,A=function(){return j.call(this)})}if(n&&!b||!d&&!k&&E[p]||a(E,p,A),s[e]=A,s[O]=m,_)if(w={values:S?A:M(g),keys:x?A:M(v),entries:S?M("entries"):A},b)for(P in w)P in E||i(E,P,w[P]);else o(o.P+o.F*(d||k),e,w);return w}},function(t,e){t.exports={}},function(t,e,r){"use strict";var n=r(8),o=r(25),i=r(27),a={};r(24)(a,r(28)("iterator"),(function(){return this})),t.exports=function(t,e,r){t.prototype=n.create(a,{next:o(1,r)}),i(t,e+" Iterator")}},function(t,e,r){r(51);var n=r(48);n.NodeList=n.HTMLCollection=n.Array},function(t,e,r){"use strict";var n=r(52),o=r(53),i=r(48),a=r(31);t.exports=r(47)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){t.exports={default:r(55),__esModule:!0}},function(t,e,r){r(50),r(44),t.exports=r(56)},function(t,e,r){var n=r(38),o=r(57);t.exports=r(20).getIterator=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,r){var n=r(58),o=r(28)("iterator"),i=r(48);t.exports=r(20).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,e,r){var n=r(33),o=r(28)("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=(e=Object(t))[o])?r:i?n(e):"Object"==(a=n(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,r){t.exports={default:r(60),__esModule:!0}},function(t,e,r){r(61),t.exports=r(20).Object.keys},function(t,e,r){var n=r(62);r(63)("keys",(function(t){return function(e){return t(n(e))}}))},function(t,e,r){var n=r(34);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(19),o=r(20),i=r(18);t.exports=function(t,e){var r=(o.Object||{})[t]||Object[t],a={};a[t]=e(r),n(n.S+n.F*i((function(){r(1)})),"Object",a)}},function(t,e,r){"use strict";var n=r(2).default;e.__esModule=!0;var o=n(r(5));e.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},t.exports=e.default},function(t,e,r){"use strict";var n=r(2).default;e.__esModule=!0;var o=r(4),i=n(r(5));e.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new i.default("#if requires exactly one argument");return o.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||o.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,r){if(2!=arguments.length)throw new i.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],r=arguments[arguments.length-1],n=0;n=0?e:parseInt(t,10)}return t},log:function(t){if(t=o.lookupLevel(t),"undefined"!=typeof console&&o.lookupLevel(o.level)<=t){var e=o.methodMap[t];console[e]||(e="log");for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i=p.LAST_COMPATIBLE_COMPILER_REVISION&&e<=p.COMPILER_REVISION)){if(e{var n=r(525),o={title:"My Title",lang:"en"},i={1:function(t,e,r,n,o){return"
  • "+t.escapeExpression(t.lambda(e,e))+"
  • \n"},compiler:[8,">= 4.3.0"],main:function(t,e,n,o,i){var a,u,s=null!=e?e:t.nullContext||{},l=t.hooks.helperMissing,c="function",f=t.escapeExpression,p=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return"

    Hello "+f(typeof(u=null!=(u=p(n,"name")||(null!=e?p(e,"name"):e))?u:l)===c?u.call(s,{name:"name",hash:{},data:i,loc:{start:{line:1,column:10},end:{line:1,column:20}}}):u)+'!

    \n
    Global data: title = "'+f(typeof(u=null!=(u=p(n,"title")||(null!=e?p(e,"title"):e))?u:l)===c?u.call(s,{name:"title",hash:{},data:i,loc:{start:{line:2,column:27},end:{line:2,column:38}}}):u)+'"
    \n
    Query param: lang = "'+f(typeof(u=null!=(u=p(n,"lang")||(null!=e?p(e,"lang"):e))?u:l)===c?u.call(s,{name:"lang",hash:{},data:i,loc:{start:{line:3,column:26},end:{line:3,column:36}}}):u)+'"
    \n\n
      \n'+(null!=(a=p(n,"each").call(s,null!=e?p(e,"people"):e,{name:"each",hash:{},fn:t.program(1,i,0),inverse:t.noop,data:i,loc:{start:{line:6,column:4},end:{line:8,column:13}}}))?a:"")+'
    \n\n\n'},useData:!0};t.exports=t=>(n.default||n).template(i)(Object.assign({},o,t))},348:(t,e,r)=>{"use strict";t.exports=r.p+"img/fig.c6809878.png"},272:(t,e,r)=>{"use strict";t.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(t,e,r)=>{"use strict";t.exports=r.p+"img/pear.6b9b072a.png"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),(()=>{"use strict";var t=r(129),e=r.n(t);document.getElementById("main").innerHTML=e()({name:"World",people:["Alexa ","Cortana ","Siri "]}),console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-default/expected/app.js b/test/cases/_preprocessor/js-tmpl-default/expected/app.js index ebc40011..440814d1 100644 --- a/test/cases/_preprocessor/js-tmpl-default/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-default/expected/app.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={157:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={component:{title:"My component"},name:"CommonJS"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    \n

    Common JS

    \n \x3c!-- variable passed via loader `data` option --\x3e\n

    ',__eta.res+=__eta.e(component.title),__eta.res+="

    \n \x3c!-- variable passed via template query parameter in JS --\x3e\n
    Hello ",__eta.res+=__eta.e(name),__eta.res+='!
    \n \n
    ',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},892:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={component:{title:"My component"},name:"ES Module"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    \n

    ES Module

    \n \x3c!-- variable passed via loader `data` option --\x3e\n

    ',__eta.res+=__eta.e(component.title),__eta.res+="

    \n \x3c!-- variable passed via template query parameter in JS --\x3e\n
    Hello ",__eta.res+=__eta.e(name),__eta.res+='!
    \n \n
    ',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},795:(e,t,n)=>{const a=n(157);document.getElementById("app-cjs").innerHTML=a()},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tI});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class s extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,i=a[r-1].length+1;throw e+=" at line "+r+" col "+i+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(i).join(" ")+"^",new s(e)}function _(e,t,n,a){const r=t.split("\n"),i=Math.max(n-3,0),s=Math.min(r.length,n+3),o=a,l=r.slice(i,s).map((function(e,t){const a=t+i+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new s("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,i=this.parse.call(this,e);let s=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,x=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],a=!1,r=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";__webpack_require__(795);var e=__webpack_require__(892),t=__webpack_require__.n(e);document.getElementById("app-esm").innerHTML=t()(),console.log(">> app")})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={157:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={component:{title:"My component"},name:"CommonJS"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    \n

    Common JS

    \n \x3c!-- variable passed via loader `data` option --\x3e\n

    ',__eta.res+=__eta.e(component.title),__eta.res+="

    \n \x3c!-- variable passed via template query parameter in JS --\x3e\n
    Hello ",__eta.res+=__eta.e(name),__eta.res+='!
    \n \n
    ',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},892:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={component:{title:"My component"},name:"ES Module"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    \n

    ES Module

    \n \x3c!-- variable passed via loader `data` option --\x3e\n

    ',__eta.res+=__eta.e(component.title),__eta.res+="

    \n \x3c!-- variable passed via template query parameter in JS --\x3e\n
    Hello ",__eta.res+=__eta.e(name),__eta.res+='!
    \n \n
    ',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},795:(e,t,n)=>{const a=n(157);document.getElementById("app-cjs").innerHTML=a()},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tI});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class s extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,i=a[r-1].length+1;throw e+=" at line "+r+" col "+i+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(i).join(" ")+"^",new s(e)}function _(e,t,n,a){const r=t.split("\n"),i=Math.max(n-3,0),s=Math.min(r.length,n+3),o=a,l=r.slice(i,s).map((function(e,t){const a=t+i+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new s("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,i=this.parse.call(this,e);let s=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,x=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],a=!1,r=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";__webpack_require__(795);var e=__webpack_require__(892),t=__webpack_require__.n(e);document.getElementById("app-esm").innerHTML=t()(),console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-ejs-compile/expected/app.js b/test/cases/_preprocessor/js-tmpl-ejs-compile/expected/app.js index 56120ee5..4e4255e8 100644 --- a/test/cases/_preprocessor/js-tmpl-ejs-compile/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-ejs-compile/expected/app.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{}){__append("

    Hello "),__append(escapeFn(name)),__append('!

    \n
    Global data: title = "'),__append(escapeFn(title)),__append('"
    \n
    Query param: lang = "'),__append(escapeFn(lang)),__append('"
    \n

    People:

    \n
      \n ');for(let i=0;i"),__append(escapeFn(people[i])),__append("\n ");__append("\n
    \n\n"),__append("\n"),__append(__webpack_require__(982)({...locals})),__append("\n\n"),__append("\n"),__append(__webpack_require__(982)({...locals,nested:{name:"Armageddon"},title:"Included data",lang:"de"}))}return __output}var data={title:"My Title",lang:"en"},template=e=>anonymous(Object.assign(data,e));module.exports=template},982:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('
    ++ Included partial ++
    \n
    passed variable: nested.name = "'),__append(escapeFn(nested.name)),__append('"
    \n
    passed global variable: title = "'),__append(escapeFn(title)),__append('"
    \n
    passed query variable: lang = "'),__append(escapeFn(lang)),__append('"
    \n\n'),__append("\n"),__append(__webpack_require__(684)({...locals}));return __output}var data={title:"My Title"},template=e=>anonymous(Object.assign(data,e));module.exports=template},684:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('
    ++ Included image ++
    \n');return __output}var data={title:"My Title"},template=e=>anonymous(Object.assign(data,e));module.exports=template},487:(e,_,a)=>{"use strict";e.exports=a.p+"img/stern.6adb226f.svg"}},__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var a in _)__webpack_require__.o(_,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:_[a]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var _=__webpack_require__.g.document;if(!e&&_&&(_.currentScript&&"SCRIPT"===_.currentScript.tagName.toUpperCase()&&(e=_.currentScript.src),!e)){var a=_.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{"use strict";var e=__webpack_require__(710);const _=__webpack_require__.n(e)()({name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"EJS"}});document.getElementById("main").innerHTML=_,console.log(">> app")})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{}){__append("

    Hello "),__append(escapeFn(name)),__append('!

    \n
    Global data: title = "'),__append(escapeFn(title)),__append('"
    \n
    Query param: lang = "'),__append(escapeFn(lang)),__append('"
    \n

    People:

    \n
      \n ');for(let i=0;i"),__append(escapeFn(people[i])),__append("\n ");__append("\n
    \n\n"),__append("\n"),__append(__webpack_require__(982)({...locals})),__append("\n\n"),__append("\n"),__append(__webpack_require__(982)({...locals,nested:{name:"Armageddon"},title:"Included data",lang:"de"}))}return __output}var data={title:"My Title",lang:"en"},template=e=>anonymous(Object.assign({},data,e));module.exports=template},982:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('
    ++ Included partial ++
    \n
    passed variable: nested.name = "'),__append(escapeFn(nested.name)),__append('"
    \n
    passed global variable: title = "'),__append(escapeFn(title)),__append('"
    \n
    passed query variable: lang = "'),__append(escapeFn(lang)),__append('"
    \n\n'),__append("\n"),__append(__webpack_require__(684)({...locals}));return __output}var data={title:"My Title"},template=e=>anonymous(Object.assign({},data,e));module.exports=template},684:(module,__unused_webpack_exports,__webpack_require__)=>{function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('
    ++ Included image ++
    \n');return __output}var data={title:"My Title"},template=e=>anonymous(Object.assign({},data,e));module.exports=template},487:(e,_,a)=>{"use strict";e.exports=a.p+"img/stern.6adb226f.svg"}},__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var a in _)__webpack_require__.o(_,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:_[a]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var _=__webpack_require__.g.document;if(!e&&_&&(_.currentScript&&"SCRIPT"===_.currentScript.tagName.toUpperCase()&&(e=_.currentScript.src),!e)){var a=_.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{"use strict";var e=__webpack_require__(710);const _=__webpack_require__.n(e)()({name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"EJS"}});document.getElementById("main").innerHTML=_,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-eta-compile-data-external/expected/app.js b/test/cases/_preprocessor/js-tmpl-eta-compile-data-external/expected/app.js index 25c56763..9493b289 100644 --- a/test/cases/_preprocessor/js-tmpl-eta-compile-data-external/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-eta-compile-data-external/expected/app.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({autoEscape:!0,async:!0,varName:"__myVar__"}),data={title:"My Title",lang:"en"},etaFn=function(__myVar__){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(__myVar__||{}){__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+='!

    \n
    Global data: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    Query param: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n

    People:

    \n
      \n ';for(let i=0;i",__eta.res+=__eta.e(people[i]),__eta.res+="\n ";__eta.res+="
    \n",__eta.res+=__webpack_require__(982)({...__myVar__}),__eta.res+=__webpack_require__(982)({...__myVar__,nested:{name:"Armageddon"},title:"Included data",lang:"de"}),__eta.layout&&(__eta.res=include(__eta.layout,{...__myVar__,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},982:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({autoEscape:!0,async:!0,varName:"__myVar__"}),data={title:"My Title"},etaFn=function(__myVar__){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(__myVar__||{})__eta.res+='
    ++ Included partial ++
    \n
    passed variable: nested.name = "',__eta.res+=__eta.e(nested.name),__eta.res+='"
    \n
    passed global variable: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    passed query variable: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n',__eta.layout&&(__eta.res=include(__eta.layout,{...__myVar__,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tI});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class s extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends s{constructor(e){super(e),this.name="EtaParser Error"}}class c extends s{constructor(e){super(e),this.name="EtaRuntime Error"}}class _ extends s{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,s=a[r-1].length+1;throw e+=" at line "+r+" col "+s+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(s).join(" ")+"^",new i(e)}function l(e,t,n,a){const r=t.split("\n"),s=Math.max(n-3,0),i=Math.min(r.length,n+3),_=a,o=r.slice(s,i).map((function(e,t){const a=t+s+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),l=new c((_?_+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw l.name=e.name,l}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function d(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,s=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,s)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function x(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function k(e){const t=this.config;let n=[],a=!1,r=0;const s=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(710);const t=__webpack_require__.n(e)()({name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"Eta"}});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({autoEscape:!0,async:!0,varName:"__myVar__"}),data={title:"My Title",lang:"en"},etaFn=function(__myVar__){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(__myVar__||{}){__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+='!

    \n
    Global data: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    Query param: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n

    People:

    \n
      \n ';for(let i=0;i",__eta.res+=__eta.e(people[i]),__eta.res+="\n ";__eta.res+="
    \n",__eta.res+=__webpack_require__(982)({...__myVar__}),__eta.res+=__webpack_require__(982)({...__myVar__,nested:{name:"Armageddon"},title:"Included data",lang:"de"}),__eta.layout&&(__eta.res=include(__eta.layout,{...__myVar__,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},982:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({autoEscape:!0,async:!0,varName:"__myVar__"}),data={title:"My Title"},etaFn=function(__myVar__){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(__myVar__||{})__eta.res+='
    ++ Included partial ++
    \n
    passed variable: nested.name = "',__eta.res+=__eta.e(nested.name),__eta.res+='"
    \n
    passed global variable: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    passed query variable: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n',__eta.layout&&(__eta.res=include(__eta.layout,{...__myVar__,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tI});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class s extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends s{constructor(e){super(e),this.name="EtaParser Error"}}class c extends s{constructor(e){super(e),this.name="EtaRuntime Error"}}class _ extends s{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,s=a[r-1].length+1;throw e+=" at line "+r+" col "+s+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(s).join(" ")+"^",new i(e)}function l(e,t,n,a){const r=t.split("\n"),s=Math.max(n-3,0),i=Math.min(r.length,n+3),_=a,o=r.slice(s,i).map((function(e,t){const a=t+s+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),l=new c((_?_+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw l.name=e.name,l}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function d(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,s=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,s)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function x(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function k(e){const t=this.config;let n=[],a=!1,r=0;const s=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(710);const t=__webpack_require__.n(e)()({name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"Eta"}});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-eta-compile-data-local/expected/app.js b/test/cases/_preprocessor/js-tmpl-eta-compile-data-local/expected/app.js index 8e958cd4..7536cbce 100644 --- a/test/cases/_preprocessor/js-tmpl-eta-compile-data-local/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-eta-compile-data-local/expected/app.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={551:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+="!

    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},591:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tT});class a{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class r extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const s=t.slice(0,n).split(/\n/),a=s.length,i=s[a-1].length+1;throw e+=" at line "+a+" col "+i+":\n\n "+t.split(/\n/)[a-1]+"\n "+Array(i).join(" ")+"^",new r(e)}function u(e,t,n,s){const a=t.split("\n"),i=Math.max(n-3,0),r=Math.min(a.length,n+3),o=s,l=a.slice(i,r).map((function(e,t){const s=t+i+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),u=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw u.name=e.name,u}const _=async function(){}.constructor;function h(e,t){const n=this.config,s=t&&t.async?_:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new r("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function p(e,t){const n=this.config,s=t&&t.async,a=this.compileBody,i=this.parse.call(this,e);let r=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${a.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function b(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],s=!1,a=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(551);const t=__webpack_require__.n(e)()({name:"World"});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={551:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+="!

    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},591:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tT});class a{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class r extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const s=t.slice(0,n).split(/\n/),a=s.length,i=s[a-1].length+1;throw e+=" at line "+a+" col "+i+":\n\n "+t.split(/\n/)[a-1]+"\n "+Array(i).join(" ")+"^",new r(e)}function u(e,t,n,s){const a=t.split("\n"),i=Math.max(n-3,0),r=Math.min(a.length,n+3),o=s,l=a.slice(i,r).map((function(e,t){const s=t+i+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),u=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw u.name=e.name,u}const _=async function(){}.constructor;function h(e,t){const n=this.config,s=t&&t.async?_:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new r("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function p(e,t){const n=this.config,s=t&&t.async,a=this.compileBody,i=this.parse.call(this,e);let r=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${a.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function b(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],s=!1,a=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(551);const t=__webpack_require__.n(e)()({name:"World"});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-eta-compile/expected/app.js b/test/cases/_preprocessor/js-tmpl-eta-compile/expected/app.js index a05c10f5..79e4ecde 100644 --- a/test/cases/_preprocessor/js-tmpl-eta-compile/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-eta-compile/expected/app.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={lang:"en"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{}){__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+='!

    \n
    Local data from JS: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    Query param: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n

    People:

    \n
      \n ';for(let i=0;i",__eta.res+=__eta.e(people[i]),__eta.res+="\n ";__eta.res+="
    \n",__eta.res+=__webpack_require__(982)({...it}),__eta.res+=__webpack_require__(982)({...it,nested:{name:"Armageddon"},title:"Included data",lang:"de"}),__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},982:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    ++ Included partial ++
    \n
    passed variable: nested.name = "',__eta.res+=__eta.e(nested.name),__eta.res+='"
    \n
    passed global variable: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    passed query variable: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tT});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class s extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends s{constructor(e){super(e),this.name="EtaParser Error"}}class c extends s{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends s{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,s=a[r-1].length+1;throw e+=" at line "+r+" col "+s+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(s).join(" ")+"^",new i(e)}function _(e,t,n,a){const r=t.split("\n"),s=Math.max(n-3,0),i=Math.min(r.length,n+3),o=a,l=r.slice(s,i).map((function(e,t){const a=t+s+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function d(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,s=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,s)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function x(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],a=!1,r=0;const s=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(710);const t=__webpack_require__.n(e)()({title:"My Title",name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"Eta"}});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={710:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={lang:"en"},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{}){__eta.res+="

    Hello ",__eta.res+=__eta.e(name),__eta.res+='!

    \n
    Local data from JS: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    Query param: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n

    People:

    \n
      \n ';for(let i=0;i",__eta.res+=__eta.e(people[i]),__eta.res+="\n ";__eta.res+="
    \n",__eta.res+=__webpack_require__(982)({...it}),__eta.res+=__webpack_require__(982)({...it,nested:{name:"Armageddon"},title:"Included data",lang:"de"}),__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},982:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='
    ++ Included partial ++
    \n
    passed variable: nested.name = "',__eta.res+=__eta.e(nested.name),__eta.res+='"
    \n
    passed global variable: title = "',__eta.res+=__eta.e(title),__eta.res+='"
    \n
    passed query variable: lang = "',__eta.res+=__eta.e(lang),__eta.res+='"
    \n',__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},487:(e,t,n)=>{"use strict";e.exports=n.p+"img/stern.6adb226f.svg"},591:(e,t,n)=>{"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tT});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=a({},this.cache,e)}}class s extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends s{constructor(e){super(e),this.name="EtaParser Error"}}class c extends s{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends s{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const a=t.slice(0,n).split(/\n/),r=a.length,s=a[r-1].length+1;throw e+=" at line "+r+" col "+s+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(s).join(" ")+"^",new i(e)}function _(e,t,n,a){const r=t.split("\n"),s=Math.max(n-3,0),i=Math.min(r.length,n+3),o=a,l=r.slice(s,i).map((function(e,t){const a=t+s+1;return(a==n?" >> ":" ")+a+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,a=t&&t.async?u:Function;try{return new a(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function d(e,t){const n=this.config,a=t&&t.async,r=this.compileBody,s=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,s)}\nif (__eta.layout) {\n __eta.res = ${a?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,b=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function x(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],a=!1,r=0;const s=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(710);const t=__webpack_require__.n(e)()({title:"My Title",name:"World",people:["Alexa ","Cortana ","Siri "],nested:{name:"Eta"}});document.getElementById("main").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/expected/app.js b/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/expected/app.js index 3dbdf90a..688039db 100644 --- a/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/expected/app.js @@ -1 +1 @@ -(()=>{var e={916:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var a=o(r(387)),l=n(r(16)),i=n(r(564)),s=o(r(456)),u=o(r(433)),c=n(r(157));function p(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=l.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=p();d.create=p,c.default(d),d.default=d,t.default=d,e.exports=t.default},387:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var o=r(456),a=n(r(564)),l=r(880),i=r(103),s=n(r(677)),u=r(352);t.VERSION="4.7.8",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function p(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},l.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},103:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var n,o=(n=r(731))&&n.__esModule?n:{default:n}},731:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var l=r.partials;r.partials=n.extend({},l,t.partials);var i=e(o,a);return r.partials=l,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},564:(e,t)=>{"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(e,t){var o=t&&t.loc,a=void 0,l=void 0,i=void 0,s=void 0;o&&(a=o.start.line,l=o.end.line,i=o.start.column,s=o.end.column,e+=" - "+a+":"+i);for(var u=Error.prototype.constructor.call(this,e),c=0;c{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),l.default(e),i.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var o=n(r(582)),a=n(r(646)),l=n(r(170)),i=n(r(264)),s=n(r(233)),u=n(r(205)),c=n(r(331))},582:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var o=r.inverse,a=r.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var l=n.createFrame(r.data);l.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(t,r)}))},e.exports=t.default},646:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var r,n=t.fn,l=t.inverse,i=0,s="",u=void 0,c=void 0;function p(t,r,a){u&&(u.key=t,u.index=r,u.first=0===r,u.last=!!a,c&&(u.contextPath=c+t)),s+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;i{"use strict";t.__esModule=!0;var n,o=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},264:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new a.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new a.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},233:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,r){return e?r.lookupProperty(e,t):e}))},e.exports=t.default},331:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var r=t.fn;if(o.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},955:(e,t,r)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,r){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==l[e]&&(l[e]=!0,a.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,r)},t.resetLoggedProperties=function(){Object.keys(l).forEach((function(e){delete l[e]}))};var n,o=r(955),a=(n=r(677))&&n.__esModule?n:{default:n},l=Object.create(null)},423:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){return"function"!=typeof e?e:function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},677:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},433:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t{"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},456:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var r=0,n=e.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function l(e){for(var t=1;t{e.exports=r(916).default},768:(e,t,r)=>{var n=r(128),o={title:"My Title"},a={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(a=e.invokePartial(l(n,"person"),t,{name:"person",data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(l(n,"person"),t,{name:"person",hash:{age:"30",name:"Jerry"},data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(l(n,"star"),t,{name:"star",data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")},usePartial:!0,useData:!0};n.partials.content=n.template(a),n.partials.footer=n.template({compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){return"
    MY FOOTER
    \n"},useData:!0});var l={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l,i=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"

    Hello "+e.escapeExpression("function"==typeof(l=null!=(l=i(r,"helloName")||(null!=t?i(t,"helloName"):t))?l:e.hooks.helperMissing)?l.call(null!=t?t:e.nullContext||{},{name:"helloName",hash:{},data:o,loc:{start:{line:1,column:10},end:{line:1,column:25}}}):l)+'!

    \n\n\n
    \n'+(null!=(a=e.invokePartial(i(n,"contentContainer"),t,{name:"contentContainer",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:"")+'
    \n\n"},usePartial:!0,useData:!0};n.partials.layout=n.template(l);var i={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(a=null!=(a=l(r,"navText")||(null!=t?l(t,"navText"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"navText",hash:{},data:o,loc:{start:{line:1,column:0},end:{line:1,column:11}}}):a)+': Home | People\n'},useData:!0};n.partials.nav=n.template(i);var s={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=null!=t?t:e.nullContext||{},i=e.hooks.helperMissing,s="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"
    Person: "+u(typeof(a=null!=(a=c(r,"name")||(null!=t?c(t,"name"):t))?a:i)===s?a.call(l,{name:"name",hash:{},data:o,loc:{start:{line:1,column:13},end:{line:1,column:21}}}):a)+", "+u(typeof(a=null!=(a=c(r,"age")||(null!=t?c(t,"age"):t))?a:i)===s?a.call(l,{name:"age",hash:{},data:o,loc:{start:{line:1,column:23},end:{line:1,column:30}}}):a)+"
    \n"},useData:!0};n.partials.person=n.template(s);var u={compiler:[8,">= 4.3.0"],main:function(e,t,n,o,a){return'
    Resolve image in sub partial
    \n\n'},useData:!0};n.partials.star=n.template(u);var c={1:function(e,t,r,n,o,a,l){return e.lookupProperty,""},2:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"nav"),t,{name:"nav",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},4:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"content"),t,{name:"content",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},6:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"footer"),t,{name:"footer",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o,a,l){var i,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=e.invokePartial(s(n,"layout"),t,{name:"layout",fn:e.program(1,o,0,a,l),inverse:e.noop,data:o,helpers:r,partials:n,decorators:e.decorators}))?i:""},"1_d":function(e,t,r,n,o,a,l){var i=r.decorators,s=r.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e=s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(2,o,0,a,l),inverse:r.noop,args:["navContainer"],data:o,loc:{start:{line:2,column:2},end:{line:4,column:13}}})||e,e=s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(4,o,0,a,l),inverse:r.noop,args:["contentContainer"],data:o,loc:{start:{line:5,column:2},end:{line:7,column:13}}})||e,s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(6,o,0,a,l),inverse:r.noop,args:["footerContainer"],data:o,loc:{start:{line:8,column:2},end:{line:10,column:13}}})||e},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0};e.exports=e=>(n.default||n).template(c)(Object.assign(o,e))},487:(e,t,r)=>{"use strict";e.exports=r.p+"img/stern.6adb226f.svg"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(768),t=r.n(e);document.getElementById("main").innerHTML=t()({helloName:"World",name:"Max",age:21,navText:"Navigation"}),console.log(">> app")})()})(); \ No newline at end of file +(()=>{var e={916:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var a=o(r(387)),l=n(r(16)),i=n(r(564)),s=o(r(456)),u=o(r(433)),c=n(r(157));function p(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=l.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=p();d.create=p,c.default(d),d.default=d,t.default=d,e.exports=t.default},387:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var o=r(456),a=n(r(564)),l=r(880),i=r(103),s=n(r(677)),u=r(352);t.VERSION="4.7.8",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function p(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},l.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},103:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var n,o=(n=r(731))&&n.__esModule?n:{default:n}},731:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var l=r.partials;r.partials=n.extend({},l,t.partials);var i=e(o,a);return r.partials=l,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},564:(e,t)=>{"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(e,t){var o=t&&t.loc,a=void 0,l=void 0,i=void 0,s=void 0;o&&(a=o.start.line,l=o.end.line,i=o.start.column,s=o.end.column,e+=" - "+a+":"+i);for(var u=Error.prototype.constructor.call(this,e),c=0;c{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),l.default(e),i.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var o=n(r(582)),a=n(r(646)),l=n(r(170)),i=n(r(264)),s=n(r(233)),u=n(r(205)),c=n(r(331))},582:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var o=r.inverse,a=r.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var l=n.createFrame(r.data);l.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(t,r)}))},e.exports=t.default},646:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var r,n=t.fn,l=t.inverse,i=0,s="",u=void 0,c=void 0;function p(t,r,a){u&&(u.key=t,u.index=r,u.first=0===r,u.last=!!a,c&&(u.contextPath=c+t)),s+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;i{"use strict";t.__esModule=!0;var n,o=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},264:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new a.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new a.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},233:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,r){return e?r.lookupProperty(e,t):e}))},e.exports=t.default},331:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var r=t.fn;if(o.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},955:(e,t,r)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,r){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==l[e]&&(l[e]=!0,a.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,r)},t.resetLoggedProperties=function(){Object.keys(l).forEach((function(e){delete l[e]}))};var n,o=r(955),a=(n=r(677))&&n.__esModule?n:{default:n},l=Object.create(null)},423:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){return"function"!=typeof e?e:function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},677:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},433:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t{"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},456:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var r=0,n=e.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function l(e){for(var t=1;t{e.exports=r(916).default},768:(e,t,r)=>{var n=r(128),o={title:"My Title"},a={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(a=e.invokePartial(l(n,"person"),t,{name:"person",data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(l(n,"person"),t,{name:"person",hash:{age:"30",name:"Jerry"},data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(l(n,"star"),t,{name:"star",data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")},usePartial:!0,useData:!0};n.partials.content=n.template(a),n.partials.footer=n.template({compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){return"
    MY FOOTER
    \n"},useData:!0});var l={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l,i=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"

    Hello "+e.escapeExpression("function"==typeof(l=i(r,"helloName")||e.strict(t,"helloName",{start:{line:1,column:13},end:{line:1,column:22}}))?l.call(null!=t?t:e.nullContext||{},{name:"helloName",hash:{},data:o,loc:{start:{line:1,column:10},end:{line:1,column:25}}}):l)+'!

    \n\n\n
    \n'+(null!=(a=e.invokePartial(i(n,"contentContainer"),t,{name:"contentContainer",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:"")+'
    \n\n"},usePartial:!0,useData:!0};n.partials.layout=n.template(l);var i={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(a=l(r,"navText")||e.strict(t,"navText",{start:{line:1,column:2},end:{line:1,column:9}}))?a.call(null!=t?t:e.nullContext||{},{name:"navText",hash:{},data:o,loc:{start:{line:1,column:0},end:{line:1,column:11}}}):a)+': Home | People\n'},useData:!0};n.partials.nav=n.template(i);var s={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=e.strict,i=null!=t?t:e.nullContext||{},s="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"
    Person: "+u(typeof(a=c(r,"name")||l(t,"name",{start:{line:1,column:15},end:{line:1,column:19}}))===s?a.call(i,{name:"name",hash:{},data:o,loc:{start:{line:1,column:13},end:{line:1,column:21}}}):a)+", "+u(typeof(a=c(r,"age")||l(t,"age",{start:{line:1,column:25},end:{line:1,column:28}}))===s?a.call(i,{name:"age",hash:{},data:o,loc:{start:{line:1,column:23},end:{line:1,column:30}}}):a)+"
    \n"},useData:!0};n.partials.person=n.template(s);var u={compiler:[8,">= 4.3.0"],main:function(e,t,n,o,a){return'
    Resolve image in sub partial
    \n\n'},useData:!0};n.partials.star=n.template(u);var c={1:function(e,t,r,n,o,a,l){return e.lookupProperty,""},2:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"nav"),t,{name:"nav",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},4:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"content"),t,{name:"content",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},6:function(e,t,r,n,o){var a,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(l(n,"footer"),t,{name:"footer",data:o,indent:" ",helpers:r,partials:n,decorators:e.decorators}))?a:""},compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o,a,l){var i,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=e.invokePartial(s(n,"layout"),t,{name:"layout",fn:e.program(1,o,0,a,l),inverse:e.noop,data:o,helpers:r,partials:n,decorators:e.decorators}))?i:""},"1_d":function(e,t,r,n,o,a,l){var i=r.decorators,s=r.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e=s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(2,o,0,a,l),inverse:r.noop,args:["navContainer"],data:o,loc:{start:{line:2,column:2},end:{line:4,column:13}}})||e,e=s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(4,o,0,a,l),inverse:r.noop,args:["contentContainer"],data:o,loc:{start:{line:5,column:2},end:{line:7,column:13}}})||e,s(i,"inline")(e,t,r,{name:"inline",hash:{},fn:r.program(6,o,0,a,l),inverse:r.noop,args:["footerContainer"],data:o,loc:{start:{line:8,column:2},end:{line:10,column:13}}})||e},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0};e.exports=e=>(n.default||n).template(c)(Object.assign({},o,e))},487:(e,t,r)=>{"use strict";e.exports=r.p+"img/stern.6adb226f.svg"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(768),t=r.n(e);document.getElementById("main").innerHTML=t()({helloName:"World",name:"Max",age:21,navText:"Navigation"}),console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/webpack.config.js b/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/webpack.config.js index b5250561..e13f0135 100644 --- a/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/webpack.config.js +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-partials/webpack.config.js @@ -21,6 +21,7 @@ module.exports = { }, preprocessor: 'handlebars', preprocessorOptions: { + strict: true, // test the option in the precompiled template function partials: ['src/partials'], }, data: { diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/app.js b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/app.js new file mode 100644 index 00000000..051ac31d --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/app.js @@ -0,0 +1 @@ +(()=>{var e={916:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var a=o(r(387)),l=n(r(16)),i=n(r(564)),s=o(r(456)),u=o(r(433)),c=n(r(157));function p(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=l.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=p();d.create=p,c.default(d),d.default=d,t.default=d,e.exports=t.default},387:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var o=r(456),a=n(r(564)),l=r(880),i=r(103),s=n(r(677)),u=r(352);t.VERSION="4.7.8",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function p(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},l.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},103:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var n,o=(n=r(731))&&n.__esModule?n:{default:n}},731:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var l=r.partials;r.partials=n.extend({},l,t.partials);var i=e(o,a);return r.partials=l,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},564:(e,t)=>{"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(e,t){var o=t&&t.loc,a=void 0,l=void 0,i=void 0,s=void 0;o&&(a=o.start.line,l=o.end.line,i=o.start.column,s=o.end.column,e+=" - "+a+":"+i);for(var u=Error.prototype.constructor.call(this,e),c=0;c{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),l.default(e),i.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var o=n(r(582)),a=n(r(646)),l=n(r(170)),i=n(r(264)),s=n(r(233)),u=n(r(205)),c=n(r(331))},582:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var o=r.inverse,a=r.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var l=n.createFrame(r.data);l.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(t,r)}))},e.exports=t.default},646:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var r,n=t.fn,l=t.inverse,i=0,s="",u=void 0,c=void 0;function p(t,r,a){u&&(u.key=t,u.index=r,u.first=0===r,u.last=!!a,c&&(u.contextPath=c+t)),s+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;i{"use strict";t.__esModule=!0;var n,o=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},264:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new a.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new a.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},233:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,r){return e?r.lookupProperty(e,t):e}))},e.exports=t.default},331:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var r=t.fn;if(o.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},955:(e,t,r)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,r){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==l[e]&&(l[e]=!0,a.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,r)},t.resetLoggedProperties=function(){Object.keys(l).forEach((function(e){delete l[e]}))};var n,o=r(955),a=(n=r(677))&&n.__esModule?n:{default:n},l=Object.create(null)},423:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){return"function"!=typeof e?e:function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},677:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},433:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t{"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},456:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var r=0,n=e.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function l(e){for(var t=1;t{e.exports=r(916).default},768:(e,t,r)=>{var n=r(128),o={title:"My Title"},a={compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l=null!=t?t:e.nullContext||{},i=e.hooks.helperMissing,s="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"
    Person: "+u(typeof(a=null!=(a=c(r,"firstName")||(null!=t?c(t,"firstName"):t))?a:i)===s?a.call(l,{name:"firstName",hash:{},data:o,loc:{start:{line:1,column:13},end:{line:1,column:26}}}):a)+" "+u(typeof(a=null!=(a=c(r,"lastName")||(null!=t?c(t,"lastName"):t))?a:i)===s?a.call(l,{name:"lastName",hash:{},data:o,loc:{start:{line:1,column:27},end:{line:1,column:39}}}):a)+", "+u(typeof(a=null!=(a=c(r,"age")||(null!=t?c(t,"age"):t))?a:i)===s?a.call(l,{name:"age",hash:{},data:o,loc:{start:{line:1,column:41},end:{line:1,column:48}}}):a)+"
    \n"},useData:!0};n.partials.person=n.template(a);var l={1:function(e,t,r,n,o){return"A"},3:function(e,t,r,n,o){return"B"},compiler:[8,">= 4.3.0"],main:function(e,t,r,n,o){var a,l,i=null!=t?t:e.nullContext||{},s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"

    "+e.escapeExpression("function"==typeof(l=null!=(l=s(r,"title")||(null!=t?s(t,"title"):t))?l:e.hooks.helperMissing)?l.call(i,{name:"title",hash:{},data:o,loc:{start:{line:2,column:4},end:{line:2,column:13}}}):l)+"

    \n\n"+(null!=(a=e.invokePartial(s(n,"person"),t,{name:"person",data:o,helpers:r,partials:n,decorators:e.decorators}))?a:"")+"
    Driver license: "+(null!=(a=s(r,"if").call(i,null!=t?s(t,"driverLicenseA"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:5,column:21},end:{line:5,column:51}}}))?a:"")+(null!=(a=s(r,"if").call(i,null!=t?s(t,"driverLicenseB"):t,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:5,column:51},end:{line:5,column:81}}}))?a:"")+"
    \n"},usePartial:!0,useData:!0};e.exports=e=>(n.default||n).template(l)(Object.assign({},o,e))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(768),t=r.n(e);let n=t()({firstName:"Max",lastName:"Pain",age:21,driverLicenseA:!0,driverLicenseB:!0});n+=t()({firstName:"Walter",age:50,driverLicenseB:!0}),document.getElementById("main").innerHTML=n,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/index.html b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/index.html new file mode 100644 index 00000000..3e6a465b --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/expected/index.html @@ -0,0 +1,11 @@ + + + + My Title + + + + +
    + + \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.hbs b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.hbs new file mode 100644 index 00000000..bc2ecdde --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.hbs @@ -0,0 +1,5 @@ +{{!-- the partial will be compiled with variables defined in JS --}} +

    {{title}}

    + +{{> person}} +
    Driver license: {{#if driverLicenseA}}A{{/if}}{{#if driverLicenseB}}B{{/if}}
    diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.js b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.js new file mode 100644 index 00000000..f4299c48 --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/app.js @@ -0,0 +1,25 @@ +import tmpl from './app.hbs'; + +const locals1 = { + firstName: 'Max', + lastName: 'Pain', + age: 21, + driverLicenseA: true, + driverLicenseB: true, +}; + +// test the rendering with different variables set, +// the variables from previous definition must not be cached +const locals2 = { + firstName: 'Walter', + //lastName: 'White', // the value of undefined variable must not be used from previous definition + age: 50, + driverLicenseB: true, +}; + +let html = tmpl(locals1); +html += tmpl(locals2); + +document.getElementById('main').innerHTML = html; + +console.log('>> app'); diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/index.hbs b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/index.hbs new file mode 100644 index 00000000..6c6538fb --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/index.hbs @@ -0,0 +1,11 @@ + + + + {{ title }} + + + + +
    + + \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/partials/person.hbs b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/partials/person.hbs new file mode 100644 index 00000000..1a17ed0a --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/src/partials/person.hbs @@ -0,0 +1 @@ +
    Person: {{firstName}} {{lastName}}, {{age}}
    diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/webpack.config.js b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/webpack.config.js new file mode 100644 index 00000000..ea5fa33e --- /dev/null +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile-variables/webpack.config.js @@ -0,0 +1,26 @@ +const path = require('path'); +const HtmlBundlerPlugin = require('@test/html-bundler-webpack-plugin'); + +module.exports = { + mode: 'production', + + output: { + path: path.join(__dirname, 'dist/'), + }, + + plugins: [ + new HtmlBundlerPlugin({ + entry: { + index: './src/index.hbs', + }, + preprocessor: 'handlebars', + preprocessorOptions: { + //strict: true, // check whether the variable used in template is defined + partials: ['src/partials'], + }, + data: { + title: 'My Title', + }, + }), + ], +}; diff --git a/test/cases/_preprocessor/js-tmpl-hbs-compile/expected/app.js b/test/cases/_preprocessor/js-tmpl-hbs-compile/expected/app.js index 2a1927f4..353638c2 100644 --- a/test/cases/_preprocessor/js-tmpl-hbs-compile/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-hbs-compile/expected/app.js @@ -1 +1 @@ -(()=>{var e={916:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var a=o(r(768)),l=n(r(16)),i=n(r(564)),s=o(r(456)),u=o(r(433)),c=n(r(157));function p(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=l.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=p();d.create=p,c.default(d),d.default=d,t.default=d,e.exports=t.default},768:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var o=r(456),a=n(r(564)),l=r(880),i=r(103),s=n(r(677)),u=r(352);t.VERSION="4.7.8",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function p(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},l.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},103:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var n,o=(n=r(731))&&n.__esModule?n:{default:n}},731:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var l=r.partials;r.partials=n.extend({},l,t.partials);var i=e(o,a);return r.partials=l,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},564:(e,t)=>{"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(e,t){var o=t&&t.loc,a=void 0,l=void 0,i=void 0,s=void 0;o&&(a=o.start.line,l=o.end.line,i=o.start.column,s=o.end.column,e+=" - "+a+":"+i);for(var u=Error.prototype.constructor.call(this,e),c=0;c{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),l.default(e),i.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var o=n(r(582)),a=n(r(646)),l=n(r(170)),i=n(r(264)),s=n(r(233)),u=n(r(205)),c=n(r(331))},582:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var o=r.inverse,a=r.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var l=n.createFrame(r.data);l.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(t,r)}))},e.exports=t.default},646:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var r,n=t.fn,l=t.inverse,i=0,s="",u=void 0,c=void 0;function p(t,r,a){u&&(u.key=t,u.index=r,u.first=0===r,u.last=!!a,c&&(u.contextPath=c+t)),s+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;i{"use strict";t.__esModule=!0;var n,o=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},264:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new a.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new a.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},233:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,r){return e?r.lookupProperty(e,t):e}))},e.exports=t.default},331:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var r=t.fn;if(o.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},955:(e,t,r)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,r){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==l[e]&&(l[e]=!0,a.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,r)},t.resetLoggedProperties=function(){Object.keys(l).forEach((function(e){delete l[e]}))};var n,o=r(955),a=(n=r(677))&&n.__esModule?n:{default:n},l=Object.create(null)},423:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){return"function"!=typeof e?e:function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},677:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},433:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t{"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},456:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var r=0,n=e.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function l(e){for(var t=1;t{e.exports=r(916).default},180:(e,t,r)=>{var n=r(128),o={title:"My Title",lang:"en"},a={1:function(e,t,r,n,o){return"
  • "+e.escapeExpression(e.lambda(t,t))+"
  • \n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,a){var l,i,s=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,c="function",p=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"

    Hello "+p(typeof(i=null!=(i=d(n,"name")||(null!=t?d(t,"name"):t))?i:u)===c?i.call(s,{name:"name",hash:{},data:a,loc:{start:{line:1,column:10},end:{line:1,column:20}}}):i)+'!

    \n
    Global data: title = "'+p(typeof(i=null!=(i=d(n,"title")||(null!=t?d(t,"title"):t))?i:u)===c?i.call(s,{name:"title",hash:{},data:a,loc:{start:{line:2,column:27},end:{line:2,column:38}}}):i)+'"
    \n
    Query param: lang = "'+p(typeof(i=null!=(i=d(n,"lang")||(null!=t?d(t,"lang"):t))?i:u)===c?i.call(s,{name:"lang",hash:{},data:a,loc:{start:{line:3,column:26},end:{line:3,column:36}}}):i)+'"
    \n\n
      \n'+(null!=(l=d(n,"each").call(s,null!=t?d(t,"people"):t,{name:"each",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a,loc:{start:{line:6,column:4},end:{line:8,column:13}}}))?l:"")+'
    \n\n\n'},useData:!0};e.exports=e=>(n.default||n).template(a)(Object.assign(o,e))},348:(e,t,r)=>{"use strict";e.exports=r.p+"img/fig.c6809878.png"},272:(e,t,r)=>{"use strict";e.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(e,t,r)=>{"use strict";e.exports=r.p+"img/pear.6b9b072a.png"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(180),t=r.n(e);document.getElementById("main").innerHTML=t()({name:"World",people:["Alexa ","Cortana ","Siri "]}),console.log(">> app")})()})(); \ No newline at end of file +(()=>{var e={916:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var a=o(r(768)),l=n(r(16)),i=n(r(564)),s=o(r(456)),u=o(r(433)),c=n(r(157));function p(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=l.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=p();d.create=p,c.default(d),d.default=d,t.default=d,e.exports=t.default},768:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var o=r(456),a=n(r(564)),l=r(880),i=r(103),s=n(r(677)),u=r(352);t.VERSION="4.7.8",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function p(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},l.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},103:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var n,o=(n=r(731))&&n.__esModule?n:{default:n}},731:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var l=r.partials;r.partials=n.extend({},l,t.partials);var i=e(o,a);return r.partials=l,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},564:(e,t)=>{"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(e,t){var o=t&&t.loc,a=void 0,l=void 0,i=void 0,s=void 0;o&&(a=o.start.line,l=o.end.line,i=o.start.column,s=o.end.column,e+=" - "+a+":"+i);for(var u=Error.prototype.constructor.call(this,e),c=0;c{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),l.default(e),i.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var o=n(r(582)),a=n(r(646)),l=n(r(170)),i=n(r(264)),s=n(r(233)),u=n(r(205)),c=n(r(331))},582:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var o=r.inverse,a=r.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var l=n.createFrame(r.data);l.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(t,r)}))},e.exports=t.default},646:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var r,n=t.fn,l=t.inverse,i=0,s="",u=void 0,c=void 0;function p(t,r,a){u&&(u.key=t,u.index=r,u.first=0===r,u.last=!!a,c&&(u.contextPath=c+t)),s+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;i{"use strict";t.__esModule=!0;var n,o=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new o.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},264:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new a.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new a.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},233:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,r){return e?r.lookupProperty(e,t):e}))},e.exports=t.default},331:(e,t,r)=>{"use strict";t.__esModule=!0;var n,o=r(456),a=(n=r(564))&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var r=t.fn;if(o.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},955:(e,t,r)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,r){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==l[e]&&(l[e]=!0,a.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,r)},t.resetLoggedProperties=function(){Object.keys(l).forEach((function(e){delete l[e]}))};var n,o=r(955),a=(n=r(677))&&n.__esModule?n:{default:n},l=Object.create(null)},423:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){return"function"!=typeof e?e:function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},677:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(456),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},433:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t{"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},456:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var r=0,n=e.length;r":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,o=/[&<>"'`=]/;function a(e){return r[e]}function l(e){for(var t=1;t{e.exports=r(916).default},180:(e,t,r)=>{var n=r(128),o={title:"My Title",lang:"en"},a={1:function(e,t,r,n,o){return"
  • "+e.escapeExpression(e.lambda(t,t))+"
  • \n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,a){var l,i,s=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,c="function",p=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"

    Hello "+p(typeof(i=null!=(i=d(n,"name")||(null!=t?d(t,"name"):t))?i:u)===c?i.call(s,{name:"name",hash:{},data:a,loc:{start:{line:1,column:10},end:{line:1,column:20}}}):i)+'!

    \n
    Global data: title = "'+p(typeof(i=null!=(i=d(n,"title")||(null!=t?d(t,"title"):t))?i:u)===c?i.call(s,{name:"title",hash:{},data:a,loc:{start:{line:2,column:27},end:{line:2,column:38}}}):i)+'"
    \n
    Query param: lang = "'+p(typeof(i=null!=(i=d(n,"lang")||(null!=t?d(t,"lang"):t))?i:u)===c?i.call(s,{name:"lang",hash:{},data:a,loc:{start:{line:3,column:26},end:{line:3,column:36}}}):i)+'"
    \n\n
      \n'+(null!=(l=d(n,"each").call(s,null!=t?d(t,"people"):t,{name:"each",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a,loc:{start:{line:6,column:4},end:{line:8,column:13}}}))?l:"")+'
    \n\n\n'},useData:!0};e.exports=e=>(n.default||n).template(a)(Object.assign({},o,e))},348:(e,t,r)=>{"use strict";e.exports=r.p+"img/fig.c6809878.png"},272:(e,t,r)=>{"use strict";e.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(e,t,r)=>{"use strict";e.exports=r.p+"img/pear.6b9b072a.png"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(180),t=r.n(e);document.getElementById("main").innerHTML=t()({name:"World",people:["Alexa ","Cortana ","Siri "]}),console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-njk-compile/expected/app.js b/test/cases/_preprocessor/js-tmpl-njk-compile/expected/app.js index c6d39259..d5ea1180 100644 --- a/test/cases/_preprocessor/js-tmpl-njk-compile/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-njk-compile/expected/app.js @@ -1 +1 @@ -(()=>{var t={313:function(t){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e){},function(t,e,r){"use strict";var n=Array.prototype,o=Object.prototype,i={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function u(t,e){return o.hasOwnProperty.call(t,e)}function a(t){return i[t]}function c(t,e,r){var n,o,i;if(t instanceof Error&&(t=(o=t).name+": "+o.message),Object.setPrototypeOf?Object.setPrototypeOf(n=Error(t),c.prototype):Object.defineProperty(n=this,"message",{enumerable:!1,writable:!0,value:t}),Object.defineProperty(n,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(n,this.constructor),o){var s=Object.getOwnPropertyDescriptor(o,"stack");(i=s&&(s.get||function(){return s.value}))||(i=function(){return o.stack})}else{var u=Error(t).stack;i=function(){return u}}return Object.defineProperty(n,"stack",{get:function(){return i.call(n)}}),Object.defineProperty(n,"cause",{value:o}),n.lineno=e,n.colno=r,n.firstUpdate=!0,n.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},n}function l(t){return"[object Function]"===o.toString.call(t)}function f(t){return"[object Array]"===o.toString.call(t)}function p(t){return"[object String]"===o.toString.call(t)}function h(t){return"[object Object]"===o.toString.call(t)}function v(t){var e,r=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,n=0;nt.length)s=o.slice(0,t.length),o.slice(s.length,c).forEach((function(t,r){r1024){for(var e=0,r=o.length-i;e=e)return t;var r=e-t.length,s=n.repeat(" ",r/2-r%2),u=n.repeat(" ",r/2);return o.copySafeness(t,s+t+u)},e.default=function(t,e,r){return r?t||e:void 0!==t?t:e},e.dictsort=function(t,e,r){if(!n.isObject(t))throw new n.TemplateError("dictsort filter: val must be an object");var o,i=[];for(var s in t)i.push([s,t[s]]);if(void 0===r||"key"===r)o=0;else{if("value"!==r)throw new n.TemplateError("dictsort filter: You can only sort by either key or value");o=1}return i.sort((function(t,r){var i=t[o],s=r[o];return e||(n.isString(i)&&(i=i.toUpperCase()),n.isString(s)&&(s=s.toUpperCase())),i>s?1:i===s?0:-1})),i},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof o.SafeString?t:(t=null==t?"":t,o.markSafe(n.escape(t.toString())))},e.safe=function(t){return t instanceof o.SafeString?t:(t=null==t?"":t,o.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,o.markSafe(n.escape(t.toString()))},e.groupby=function(t,e){return n.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,r){if(""===(t=i(t,"")))return"";e=e||4;var s=t.split("\n"),u=n.repeat(" ",e),a=s.map((function(t,e){return 0!==e||r?""+u+t:t})).join("\n");return o.copySafeness(t,a)},e.join=function(t,e,r){return e=e||"",r&&(t=n.map(t,(function(t){return t[r]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=i(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!n.isObject(e)||e instanceof o.SafeString?e.length:n.keys(e).length:0},e.list=a,e.lower=function(t){return(t=i(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":o.copySafeness(t,t.replace(/\r\n|\n/g,"
    \n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,r,n){var i=t;if(e instanceof RegExp)return t.replace(e,r);void 0===n&&(n=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof o.SafeString))return t;if(""===e)return s=r+t.split("").join(r)+r,o.copySafeness(t,s);var u=t.indexOf(e);if(0===n||-1===u)return t;for(var a=0,c=0;u>-1&&(-1===n||c=o&&l.push(r),i.push(l)}return i},e.sum=function(t,e,r){return void 0===r&&(r=0),e&&(t=n.map(t,(function(t){return t[e]}))),r+t.reduce((function(t,e){return t+e}),0)},e.sort=o.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,r,o){var i=this,s=n.map(t,(function(t){return t})),u=n.getAttrGetter(o);return s.sort((function(t,s){var a=o?u(t):t,c=o?u(s):s;if(i.env.opts.throwOnUndefined&&o&&(void 0===a||void 0===c))throw new TypeError('sort: attribute "'+o+'" resolved to undefined');return!r&&n.isString(a)&&n.isString(c)&&(a=a.toLowerCase(),c=c.toLowerCase()),ac?e?-1:1:0})),s})),e.string=function(t){return o.copySafeness(t,t)},e.striptags=function(t,e){var r,n=l((t=i(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return r=e?n.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):n.replace(/\s+/gi," "),o.copySafeness(t,r)},e.title=function(t){var e=(t=i(t,"")).split(" ").map((function(t){return u(t)}));return o.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,r,n){var s=t;if(e=e||255,(t=i(t,"")).length<=e)return t;if(r)t=t.substring(0,e);else{var u=t.lastIndexOf(" ",e);-1===u&&(u=e),t=t.substring(0,u)}return t+=null!=n?n:"...",o.copySafeness(s,t)},e.upper=function(t){return(t=i(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return n.isString(t)?e(t):(n.isArray(t)?t:n.r(t)).map((function(t){var r=t[0],n=t[1];return e(r)+"="+e(n)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,p=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,h=/^https?:\/\/.*$/,v=/^www\./,d=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,r){s(e)&&(e=1/0);var n=!0===r?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var r=t.match(f),o=r?r[1]:t,i=o.substr(0,e);return h.test(o)?'"+i+"":v.test(o)?'"+i+"":p.test(o)?''+o+"":d.test(o)?'"+i+"":t})).join("")},e.wordcount=function(t){var e=(t=i(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var r=parseFloat(t);return s(r)?e:r};var y=o.makeMacro(["value","default","base"],[],(function(t,e,r){void 0===r&&(r=10);var n=parseInt(t,r);return s(n)?e:n}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}y(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,o)}))},u.EventEmitter=u,u.prototype.y=void 0,u.prototype.b=0,u.prototype.w=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t.w?u.defaultMaxListeners:t.w}function f(t,e,r,n){var o,i,s;if(c(r),void 0===(i=t.y)?(i=t.y=Object.create(null),t.b=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t.y),s=i[e]),void 0===s)s=i[e]=r,++t.b;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,console&&console.warn&&console.warn(u)}return t}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(n);return o.listener=r,n.wrapFn=o,o}function h(t,e,r){var n=t.y;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var u=Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)i(a,this,e);else{var c=a.length,l=d(a,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return h(this,t,!0)},u.prototype.rawListeners=function(t){return h(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this.b>0?n(this.y):[]}},function(t,e,r){"use strict";var n=r(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof n},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var o=t;oe;i+=r)n.push(i);return n},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var r=e?"":t;return e=!1,r}}(t)}}}},function(t,e,r){var n=r(0);t.exports=function(t,e){function r(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=n.extname(t),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return r.prototype.render=function(e,r){t.render(this.name,e,r)},e.set("view",r),e.set("nunjucksEnv",t),t}},function(t,e,r){t.exports=function(){"use strict";var t,e,r=this.runtime,n=this.lib,o=this.compiler.Compiler,i=this.parser.Parser,s=(this.nodes,this.lexer,r.contextOrFrameLookup),u=r.memberLookup;function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o&&(t=o.prototype.assertType),i&&(e=i.prototype.parseAggregate),r.contextOrFrameLookup=function(t,e,r){var n=s.apply(this,arguments);if(void 0!==n)return n;switch(r){case"True":return!0;case"False":return!1;case"None":return null;default:return}};var c={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;et.length||o>0&&s>=n||o<0&&s<=n);s+=o)i.push(r.memberLookup(t,s));return i}.apply(this,arguments):(t=t||{},n.isArray(t)&&a(c,e)?c[e].bind(t):n.isObject(t)&&a(l,e)?l[e].bind(t):u.apply(this,arguments))},function(){r.contextOrFrameLookup=s,r.memberLookup=u,o&&(o.prototype.assertType=t),i&&(i.prototype.parseAggregate=e)}}}])},151:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/footer.html"]={root:function(t,e,n,o,i){var s="";try{s+="
    ",s+=o.suppressValue(t.getFilter("capitalize").call(e,o.contextOrFrameLookup(e,n,"footer")),t.opts.autoescape),i(null,s+='
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/footer.html",Object.assign(o,t))},200:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/header.html"]={root:function(t,e,r,n,o){var i=0,s=0,u="";try{u+="

    Hello ",u+=n.suppressValue(n.contextOrFrameLookup(e,r,"name"),t.opts.autoescape),u+='!

    \n
    Global data: getTitle() = "',u+=n.suppressValue((i=1,s=49,n.callWrap(n.memberLookup(n.contextOrFrameLookup(e,r,"utils"),"getTitle"),'utils["getTitle"]',e,["ABCD"])),t.opts.autoescape),u+='"
    \n
    Query param: lang = "',u+=n.suppressValue(n.contextOrFrameLookup(e,r,"lang"),t.opts.autoescape),u+='"
    \n

    People:

    \n
      \n ',r=r.push();var a=n.contextOrFrameLookup(e,r,"people");if(a)for(var c=(a=n.fromIterator(a)).length,l=0;l",u+=n.suppressValue(f,t.opts.autoescape),u+="\n "}r=r.pop(),u+="\n
    \n\x3c!-- test: include in precompiled partial --\x3e\n";var p=[];p.push((function(e){t.getTemplate("src/partials/home.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),p.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),p.push((function(t,e){u+=t,e(null)})),t.waterfall(p,(function(){u+="\n\x3c!-- test: include using partial paths --\x3e\n";var n=[];n.push((function(e){t.getTemplate("src/partials/star.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),n.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),n.push((function(t,e){u+=t,e(null)})),t.waterfall(n,(function(){u+="\n";var n=[];n.push((function(e){t.getTemplate("src/partials/settings.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),n.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),n.push((function(t,e){u+=t,e(null)})),t.waterfall(n,(function(){o(null,u)}))}))}))}catch(t){o(n.handleError(t,i,s))}}};var o=n.dependencies||(n.dependencies={});o["src/partials/home.html"]=r(755),o["src/partials/star.html"]=r(684),o["src/partials/settings.html"]=r(65);var i={title:"My Title",utils:{getTitle:t=>`My '${t}' title`},lang:"en"};t.exports=t=>n.render("src/partials/header.html",Object.assign(i,t))},755:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/home.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/home.html",Object.assign(o,t))},65:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/settings.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/settings.html",Object.assign(o,t))},684:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/star.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/star.html",Object.assign(o,t))},870:(t,e,r)=>{"use strict";t.exports=r.p+"img/home.0b0eca03.svg"},272:(t,e,r)=>{"use strict";t.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(t,e,r)=>{"use strict";t.exports=r.p+"img/settings.1de9dce9.svg"},487:(t,e,r)=>{"use strict";t.exports=r.p+"img/stern.6adb226f.svg"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),(()=>{"use strict";var t=r(200),e=r.n(t),n=r(151),o=r.n(n);document.getElementById("header").innerHTML=e()({name:"World",people:["Alexa ","Cortana ","Siri "]}),document.getElementById("footer").innerHTML=o()({footer:"my footer"}),console.log(">> app")})()})(); \ No newline at end of file +(()=>{var t={313:function(t){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e){},function(t,e,r){"use strict";var n=Array.prototype,o=Object.prototype,i={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function u(t,e){return o.hasOwnProperty.call(t,e)}function a(t){return i[t]}function c(t,e,r){var n,o,i;if(t instanceof Error&&(t=(o=t).name+": "+o.message),Object.setPrototypeOf?Object.setPrototypeOf(n=Error(t),c.prototype):Object.defineProperty(n=this,"message",{enumerable:!1,writable:!0,value:t}),Object.defineProperty(n,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(n,this.constructor),o){var s=Object.getOwnPropertyDescriptor(o,"stack");(i=s&&(s.get||function(){return s.value}))||(i=function(){return o.stack})}else{var u=Error(t).stack;i=function(){return u}}return Object.defineProperty(n,"stack",{get:function(){return i.call(n)}}),Object.defineProperty(n,"cause",{value:o}),n.lineno=e,n.colno=r,n.firstUpdate=!0,n.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},n}function l(t){return"[object Function]"===o.toString.call(t)}function f(t){return"[object Array]"===o.toString.call(t)}function p(t){return"[object String]"===o.toString.call(t)}function h(t){return"[object Object]"===o.toString.call(t)}function v(t){var e,r=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,n=0;nt.length)s=o.slice(0,t.length),o.slice(s.length,c).forEach((function(t,r){r1024){for(var e=0,r=o.length-i;e=e)return t;var r=e-t.length,s=n.repeat(" ",r/2-r%2),u=n.repeat(" ",r/2);return o.copySafeness(t,s+t+u)},e.default=function(t,e,r){return r?t||e:void 0!==t?t:e},e.dictsort=function(t,e,r){if(!n.isObject(t))throw new n.TemplateError("dictsort filter: val must be an object");var o,i=[];for(var s in t)i.push([s,t[s]]);if(void 0===r||"key"===r)o=0;else{if("value"!==r)throw new n.TemplateError("dictsort filter: You can only sort by either key or value");o=1}return i.sort((function(t,r){var i=t[o],s=r[o];return e||(n.isString(i)&&(i=i.toUpperCase()),n.isString(s)&&(s=s.toUpperCase())),i>s?1:i===s?0:-1})),i},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof o.SafeString?t:(t=null==t?"":t,o.markSafe(n.escape(t.toString())))},e.safe=function(t){return t instanceof o.SafeString?t:(t=null==t?"":t,o.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,o.markSafe(n.escape(t.toString()))},e.groupby=function(t,e){return n.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,r){if(""===(t=i(t,"")))return"";e=e||4;var s=t.split("\n"),u=n.repeat(" ",e),a=s.map((function(t,e){return 0!==e||r?""+u+t:t})).join("\n");return o.copySafeness(t,a)},e.join=function(t,e,r){return e=e||"",r&&(t=n.map(t,(function(t){return t[r]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=i(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!n.isObject(e)||e instanceof o.SafeString?e.length:n.keys(e).length:0},e.list=a,e.lower=function(t){return(t=i(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":o.copySafeness(t,t.replace(/\r\n|\n/g,"
    \n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,r,n){var i=t;if(e instanceof RegExp)return t.replace(e,r);void 0===n&&(n=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof o.SafeString))return t;if(""===e)return s=r+t.split("").join(r)+r,o.copySafeness(t,s);var u=t.indexOf(e);if(0===n||-1===u)return t;for(var a=0,c=0;u>-1&&(-1===n||c=o&&l.push(r),i.push(l)}return i},e.sum=function(t,e,r){return void 0===r&&(r=0),e&&(t=n.map(t,(function(t){return t[e]}))),r+t.reduce((function(t,e){return t+e}),0)},e.sort=o.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,r,o){var i=this,s=n.map(t,(function(t){return t})),u=n.getAttrGetter(o);return s.sort((function(t,s){var a=o?u(t):t,c=o?u(s):s;if(i.env.opts.throwOnUndefined&&o&&(void 0===a||void 0===c))throw new TypeError('sort: attribute "'+o+'" resolved to undefined');return!r&&n.isString(a)&&n.isString(c)&&(a=a.toLowerCase(),c=c.toLowerCase()),ac?e?-1:1:0})),s})),e.string=function(t){return o.copySafeness(t,t)},e.striptags=function(t,e){var r,n=l((t=i(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return r=e?n.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):n.replace(/\s+/gi," "),o.copySafeness(t,r)},e.title=function(t){var e=(t=i(t,"")).split(" ").map((function(t){return u(t)}));return o.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,r,n){var s=t;if(e=e||255,(t=i(t,"")).length<=e)return t;if(r)t=t.substring(0,e);else{var u=t.lastIndexOf(" ",e);-1===u&&(u=e),t=t.substring(0,u)}return t+=null!=n?n:"...",o.copySafeness(s,t)},e.upper=function(t){return(t=i(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return n.isString(t)?e(t):(n.isArray(t)?t:n.r(t)).map((function(t){var r=t[0],n=t[1];return e(r)+"="+e(n)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,p=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,h=/^https?:\/\/.*$/,v=/^www\./,d=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,r){s(e)&&(e=1/0);var n=!0===r?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var r=t.match(f),o=r?r[1]:t,i=o.substr(0,e);return h.test(o)?'"+i+"":v.test(o)?'"+i+"":p.test(o)?''+o+"":d.test(o)?'"+i+"":t})).join("")},e.wordcount=function(t){var e=(t=i(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var r=parseFloat(t);return s(r)?e:r};var y=o.makeMacro(["value","default","base"],[],(function(t,e,r){void 0===r&&(r=10);var n=parseInt(t,r);return s(n)?e:n}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}y(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,o)}))},u.EventEmitter=u,u.prototype.y=void 0,u.prototype.b=0,u.prototype.w=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t.w?u.defaultMaxListeners:t.w}function f(t,e,r,n){var o,i,s;if(c(r),void 0===(i=t.y)?(i=t.y=Object.create(null),t.b=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t.y),s=i[e]),void 0===s)s=i[e]=r,++t.b;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,console&&console.warn&&console.warn(u)}return t}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(n);return o.listener=r,n.wrapFn=o,o}function h(t,e,r){var n=t.y;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var u=Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)i(a,this,e);else{var c=a.length,l=d(a,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return h(this,t,!0)},u.prototype.rawListeners=function(t){return h(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this.b>0?n(this.y):[]}},function(t,e,r){"use strict";var n=r(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof n},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var o=t;oe;i+=r)n.push(i);return n},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var r=e?"":t;return e=!1,r}}(t)}}}},function(t,e,r){var n=r(0);t.exports=function(t,e){function r(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=n.extname(t),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return r.prototype.render=function(e,r){t.render(this.name,e,r)},e.set("view",r),e.set("nunjucksEnv",t),t}},function(t,e,r){t.exports=function(){"use strict";var t,e,r=this.runtime,n=this.lib,o=this.compiler.Compiler,i=this.parser.Parser,s=(this.nodes,this.lexer,r.contextOrFrameLookup),u=r.memberLookup;function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o&&(t=o.prototype.assertType),i&&(e=i.prototype.parseAggregate),r.contextOrFrameLookup=function(t,e,r){var n=s.apply(this,arguments);if(void 0!==n)return n;switch(r){case"True":return!0;case"False":return!1;case"None":return null;default:return}};var c={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;et.length||o>0&&s>=n||o<0&&s<=n);s+=o)i.push(r.memberLookup(t,s));return i}.apply(this,arguments):(t=t||{},n.isArray(t)&&a(c,e)?c[e].bind(t):n.isObject(t)&&a(l,e)?l[e].bind(t):u.apply(this,arguments))},function(){r.contextOrFrameLookup=s,r.memberLookup=u,o&&(o.prototype.assertType=t),i&&(i.prototype.parseAggregate=e)}}}])},151:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/footer.html"]={root:function(t,e,n,o,i){var s="";try{s+="
    ",s+=o.suppressValue(t.getFilter("capitalize").call(e,o.contextOrFrameLookup(e,n,"footer")),t.opts.autoescape),i(null,s+='
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/footer.html",Object.assign({},o,t))},200:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/header.html"]={root:function(t,e,r,n,o){var i=0,s=0,u="";try{u+="

    Hello ",u+=n.suppressValue(n.contextOrFrameLookup(e,r,"name"),t.opts.autoescape),u+='!

    \n
    Global data: getTitle() = "',u+=n.suppressValue((i=1,s=49,n.callWrap(n.memberLookup(n.contextOrFrameLookup(e,r,"utils"),"getTitle"),'utils["getTitle"]',e,["ABCD"])),t.opts.autoescape),u+='"
    \n
    Query param: lang = "',u+=n.suppressValue(n.contextOrFrameLookup(e,r,"lang"),t.opts.autoescape),u+='"
    \n

    People:

    \n
      \n ',r=r.push();var a=n.contextOrFrameLookup(e,r,"people");if(a)for(var c=(a=n.fromIterator(a)).length,l=0;l",u+=n.suppressValue(f,t.opts.autoescape),u+="\n "}r=r.pop(),u+="\n
    \n\x3c!-- test: include in precompiled partial --\x3e\n";var p=[];p.push((function(e){t.getTemplate("src/partials/home.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),p.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),p.push((function(t,e){u+=t,e(null)})),t.waterfall(p,(function(){u+="\n\x3c!-- test: include using partial paths --\x3e\n";var n=[];n.push((function(e){t.getTemplate("src/partials/star.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),n.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),n.push((function(t,e){u+=t,e(null)})),t.waterfall(n,(function(){u+="\n";var n=[];n.push((function(e){t.getTemplate("src/partials/settings.html",!1,"src/partials/header.html",!1,(function(t,r){t?o(t):e(null,r)}))})),n.push((function(t,n){t.render(e.getVariables(),r,(function(t,e){t?o(t):n(null,e)}))})),n.push((function(t,e){u+=t,e(null)})),t.waterfall(n,(function(){o(null,u)}))}))}))}catch(t){o(n.handleError(t,i,s))}}};var o=n.dependencies||(n.dependencies={});o["src/partials/home.html"]=r(755),o["src/partials/star.html"]=r(684),o["src/partials/settings.html"]=r(65);var i={title:"My Title",utils:{getTitle:t=>`My '${t}' title`},lang:"en"};t.exports=t=>n.render("src/partials/header.html",Object.assign({},i,t))},755:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/home.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/home.html",Object.assign({},o,t))},65:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/settings.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/settings.html",Object.assign({},o,t))},684:(t,e,r)=>{var n=r(313);(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["src/partials/star.html"]={root:function(t,e,n,o,i){var s="";try{i(null,s+='
    ++ Included partial ++
    \n')}catch(t){i(o.handleError(t,0,0))}}};var o={title:"My Title",utils:{getTitle:t=>`My '${t}' title`}};t.exports=t=>n.render("src/partials/star.html",Object.assign({},o,t))},870:(t,e,r)=>{"use strict";t.exports=r.p+"img/home.0b0eca03.svg"},272:(t,e,r)=>{"use strict";t.exports=r.p+"img/kiwi.da3e3cc9.png"},932:(t,e,r)=>{"use strict";t.exports=r.p+"img/settings.1de9dce9.svg"},487:(t,e,r)=>{"use strict";t.exports=r.p+"img/stern.6adb226f.svg"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),(()=>{"use strict";var t=r(200),e=r.n(t),n=r(151),o=r.n(n);document.getElementById("header").innerHTML=e()({name:"World",people:["Alexa ","Cortana ","Siri "]}),document.getElementById("footer").innerHTML=o()({footer:"my footer"}),console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-resolve-img-in-partial/expected/main.js b/test/cases/_preprocessor/js-tmpl-resolve-img-in-partial/expected/main.js index d0369ef0..daf11872 100644 --- a/test/cases/_preprocessor/js-tmpl-resolve-img-in-partial/expected/main.js +++ b/test/cases/_preprocessor/js-tmpl-resolve-img-in-partial/expected/main.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={197:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{}){__eta.res+='\x3c!-- resolve the source image in attribute --\x3e\n\n\n\n\x3c!-- resolve the source image directly in the template variable --\x3e\n';let pearImage=__webpack_require__(932);__eta.res+='\n\n\x3c!-- resolve the source image in the JavaScript where is imported this partial --\x3e\n\n\n

    Output image URL: ',__eta.res+=__eta.e(plumImage),__eta.res+="

    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},358:(e,t,n)=>{"use strict";e.exports=n.p+"apple.02a7c382.png"},414:(e,t,n)=>{"use strict";e.exports=n.p+"image.d4711676.webp"},932:(e,t,n)=>{"use strict";e.exports=n.p+"pear.6b9b072a.png"},546:(e,t,n)=>{"use strict";e.exports=n.p+"plum.d39e7174.png"},591:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class s{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=r({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class a extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const r=t.slice(0,n).split(/\n/),s=r.length,i=r[s-1].length+1;throw e+=" at line "+s+" col "+i+":\n\n "+t.split(/\n/)[s-1]+"\n "+Array(i).join(" ")+"^",new a(e)}function _(e,t,n,r){const s=t.split("\n"),i=Math.max(n-3,0),a=Math.min(s.length,n+3),o=r,l=s.slice(i,a).map((function(e,t){const r=t+i+1;return(r==n?" >> ":" ")+r+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,r=t&&t.async?u:Function;try{return new r(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new a("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,r=t&&t.async,s=this.compileBody,i=this.parse.call(this,e);let a=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${s.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${r?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function b(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],r=!1,s=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(197);const t=__webpack_require__.n(e)()({plumImage:__webpack_require__(546)});document.getElementById("root").innerHTML=t,console.log(t)})()})(); \ No newline at end of file +(()=>{var __webpack_modules__={197:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(591),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{}){__eta.res+='\x3c!-- resolve the source image in attribute --\x3e\n\n\n\n\x3c!-- resolve the source image directly in the template variable --\x3e\n';let pearImage=__webpack_require__(932);__eta.res+='\n\n\x3c!-- resolve the source image in the JavaScript where is imported this partial --\x3e\n\n\n

    Output image URL: ',__eta.res+=__eta.e(plumImage),__eta.res+="

    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}))}return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},358:(e,t,n)=>{"use strict";e.exports=n.p+"apple.02a7c382.png"},414:(e,t,n)=>{"use strict";e.exports=n.p+"image.d4711676.webp"},932:(e,t,n)=>{"use strict";e.exports=n.p+"pear.6b9b072a.png"},546:(e,t,n)=>{"use strict";e.exports=n.p+"plum.d39e7174.png"},591:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class s{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=r({},this.cache,e)}}class i extends Error{constructor(e){super(e),this.name="Eta Error"}}class a extends i{constructor(e){super(e),this.name="EtaParser Error"}}class c extends i{constructor(e){super(e),this.name="EtaRuntime Error"}}class o extends i{constructor(e){super(e),this.name="EtaNameResolution Error"}}function l(e,t,n){const r=t.slice(0,n).split(/\n/),s=r.length,i=r[s-1].length+1;throw e+=" at line "+s+" col "+i+":\n\n "+t.split(/\n/)[s-1]+"\n "+Array(i).join(" ")+"^",new a(e)}function _(e,t,n,r){const s=t.split("\n"),i=Math.max(n-3,0),a=Math.min(s.length,n+3),o=r,l=s.slice(i,a).map((function(e,t){const r=t+i+1;return(r==n?" >> ":" ")+r+"| "+e})).join("\n"),_=new c((o?o+":"+n+"\n":"line "+n+"\n")+l+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,r=t&&t.async?u:Function;try{return new r(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new a("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,r=t&&t.async,s=this.compileBody,i=this.parse.call(this,e);let a=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${s.call(this,i)}\nif (__eta.layout) {\n __eta.res = ${r?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function m(e){return g[e]}const f={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,m):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,w=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function b(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function S(e){const t=this.config;let n=[],r=!1,s=0;const i=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(197);const t=__webpack_require__.n(e)()({plumImage:__webpack_require__(546)});document.getElementById("root").innerHTML=t,console.log(t)})()})(); \ No newline at end of file diff --git a/test/cases/_preprocessor/js-tmpl-twig-compile/expected/app.js b/test/cases/_preprocessor/js-tmpl-twig-compile/expected/app.js index 2564d56f..647823c6 100644 --- a/test/cases/_preprocessor/js-tmpl-twig-compile/expected/app.js +++ b/test/cases/_preprocessor/js-tmpl-twig-compile/expected/app.js @@ -1 +1 @@ -(()=>{var e={766:e=>{var t;self,t=()=>{return e={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{var n=r(228);e.exports=function(e){if(Array.isArray(e))return n(e)}},713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},319:(e,t,r)=>{var n=r(646),i=r(860),o=r(379),s=r(206);e.exports=function(e){return n(e)||i(e)||o(e)||s()}},8:e=>{function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t},379:(e,t,r)=>{var n=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},452:e=>{"use strict";e.exports=function(e){return e.ParseState.prototype.parseAsync=function(e,t){return this.parse(e,t,!0)},e.expression.parseAsync=function(t,r,n){return e.expression.parse.call(this,t,r,n,!0)},e.logic.parseAsync=function(t,r,n){return e.logic.parse.call(this,t,r,n,!0)},e.Template.prototype.renderAsync=function(e,t){return this.render(e,t,!0)},e.async={},e.isPromise=function(e){return e&&e.then&&"function"==typeof e.then},e.async.potentiallyAsync=function(t,r,n){return r?e.Promise.resolve(n.call(t)):function(t,r,n){var i=n.call(t),o=null,s=!0;if(!e.isPromise(i))return i;if(i.then((function(e){i=e,s=!1})).catch((function(e){o=e})),null!==o)throw o;if(s)throw new e.Error("You are using Twig.js in sync mode in combination with async extensions.");return i}(t,0,n)},e.Thenable=function(e,t,r){this.then=e,this._value=r?t:null,this._state=r||0},e.Thenable.prototype.catch=function(e){return 1===this._state?this:this.then(null,e)},e.Thenable.resolvedThen=function(t){try{return e.Promise.resolve(t(this._value))}catch(t){return e.Promise.reject(t)}},e.Thenable.rejectedThen=function(t,r){if(!r||"function"!=typeof r)return this;var n,i=this._value;try{n=r(i)}catch(t){n=e.Promise.reject(t)}return e.Promise.resolve(n)},e.Promise=function(t){var r=0,n=null,i=function(e,t){r=e,n=t};return function(e,t,r){try{e((function(e){i(1,e)}),r)}catch(e){r(e)}}(t,0,(function(e){i(2,e)})),1===r?e.Promise.resolve(n):2===r?e.Promise.reject(n):(i=new e.FullPromise).promise},e.FullPromise=function(){var t=null;function r(e){e(s._value)}function n(e,t){t(s._value)}var i=function(e,r){t=function(e,t,r){var n=[t,r,-2];return e?-2===e[2]?e=[e,n]:e.push(n):e=n,e}(t,e,r)};function o(e,o){if(!s._state&&(s._value=o,s._state=e,i=1===e?r:n,t)){if(-2===t[2])return i(t[0],t[1]),void(t=null);t.forEach((function(e){i(e[0],e[1])})),t=null}}var s=new e.Thenable((function(t,r){var n="function"==typeof t;if(1===s._state&&!n)return e.Promise.resolve(s._value);if(1===s._state)try{return e.Promise.resolve(t(s._value))}catch(t){return e.Promise.reject(t)}var o="function"==typeof r;return new e.Promise((function(e,s){i(n?function(r){try{e(t(r))}catch(e){s(e)}}:e,o?function(t){try{e(r(t))}catch(e){s(e)}}:s)}))}));return o.promise=s,o},e.Promise.defaultResolved=new e.Thenable(e.Thenable.resolvedThen,void 0,1),e.Promise.emptyStringResolved=new e.Thenable(e.Thenable.resolvedThen,"",1),e.Promise.resolve=function(t){return 0===arguments.length||void 0===t?e.Promise.defaultResolved:e.isPromise(t)?t:""===t?e.Promise.emptyStringResolved:new e.Thenable(e.Thenable.resolvedThen,t,1)},e.Promise.reject=function(t){return new e.Thenable(e.Thenable.rejectedThen,t,2)},e.Promise.all=function(t){var r=new Array(t.length);return e.async.forEach(t,(function(t,n){if(e.isPromise(t)){if(1!==t._state)return t.then((function(e){r[n]=e}));r[n]=t._value}else r[n]=t})).then((function(){return r}))},e.async.forEach=function(t,r){var n=t?t.length:0,i=0;return function o(){var s=null;do{if(i===n)return e.Promise.resolve();s=r(t[i],i),i++}while(!s||!e.isPromise(s)||1===s._state);return s.then(o)}()},e}},383:e=>{"use strict";e.exports=function(e){return e.compiler={module:{}},e.compiler.compile=function(t,r){var n=JSON.stringify(t.tokens),i=t.id,o=null;if(r.module){if(void 0===e.compiler.module[r.module])throw new e.Error("Unable to find module type "+r.module);o=e.compiler.module[r.module](i,n,r.twig)}else o=e.compiler.wrap(i,n);return o},e.compiler.module={amd:function(t,r,n){return'define(["'+n+'"], function (Twig) {\n\tvar twig, templates;\ntwig = Twig.twig;\ntemplates = '+e.compiler.wrap(t,r)+"\n\treturn templates;\n});"},node:function(t,r){return'var twig = require("twig").twig;\nexports.template = '+e.compiler.wrap(t,r)},cjs2:function(t,r,n){return'module.declare([{ twig: "'+n+'" }], function (require, exports, module) {\n\tvar twig = require("twig").twig;\n\texports.template = '+e.compiler.wrap(t,r)+"\n});"}},e.compiler.wrap=function(e,t){return'twig({id:"'+e.replace('"','\\"')+'", data:'+t+", precompiled: true});\n"},e}},181:(e,t,r)=>{"use strict";var n=r(318)(r(713));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0&&n.open.length!==n.close.length&&o<0||(i>=0&&(null===s.position||i=0&&null!==s.position&&i===s.position&&(n.open.length>s.def.open.length?(s.position=i,s.def=n,a=o):n.open.length===s.def.open.length&&(n.close.length,s.def.close.length,o>=0&&o=0))throw new e.Error("Unable to find closing bracket '"+r.close+"' opened near template position "+n);if(s=u,a=!0,r.type===e.token.type.comment)break;if(r.type===e.token.type.raw)break;for(o=e.token.strings.length,i=0;i0&&f0;)if(i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),null===i.position)r.push({type:e.token.type.raw,value:t,position:{start:n,end:n+i.position}}),t="";else{if(i.position>0&&r.push({type:e.token.type.raw,value:t.slice(0,Math.max(0,i.position)),position:{start:n,end:n+Math.max(0,i.position)}}),t=t.slice(i.position+i.def.open.length),n+=i.position+i.def.open.length,o=e.token.findEnd(t,i.def,n),e.log.trace("Twig.tokenize: ","Token ends at ",o),r.push({type:i.def.type,value:t.slice(0,Math.max(0,o)).trim(),position:{start:n-i.def.open.length,end:n+o+i.def.close.length}}),"\n"===t.slice(o+i.def.close.length,o+i.def.close.length+1))switch(i.def.type){case"logic_whitespace_pre":case"logic_whitespace_post":case"logic_whitespace_both":case"logic":o+=1}t=t.slice(o+i.def.close.length),n+=o+i.def.close.length}return r},e.compile=function(t){var r=this;try{for(var n=[],i=[],o=[],s=null,a=null,p=null,c=null,l=null,u=null,h=null,f=null,d=null,y=null,g=null,m=function(t){e.expression.compile.call(r,t),i.length>0?o.push(t):n.push(t)},x=function(t){if((a=e.logic.compile.call(r,t)).position=t.position,d=a.type,y=e.logic.handler[d].open,g=e.logic.handler[d].next,e.log.trace("Twig.compile: ","Compiled logic token to ",a," next is: ",g," open is : ",y),void 0!==y&&!y){if(c=i.pop(),!e.logic.handler[c.type].next.includes(d))throw new Error(d+" not expected after a "+c.type);c.output=c.output||[],c.output=c.output.concat(o),o=[],f={type:e.token.type.logic,token:c,position:{open:c.position,close:t.position}},i.length>0?o.push(f):n.push(f)}void 0!==g&&g.length>0?(e.log.trace("Twig.compile: ","Pushing ",a," to logic stack."),i.length>0&&((c=i.pop()).output=c.output||[],c.output=c.output.concat(o),i.push(c),o=[]),i.push(a)):void 0!==y&&y&&(f={type:e.token.type.logic,token:a,position:a.position},i.length>0?o.push(f):n.push(f))};t.length>0;){switch(s=t.shift(),l=n[n.length-1],u=o[o.length-1],h=t[0],e.log.trace("Compiling token ",s),s.type){case e.token.type.raw:i.length>0?o.push(s):n.push(s);break;case e.token.type.logic:x.call(r,s);break;case e.token.type.comment:break;case e.token.type.output:m.call(r,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:switch(s.type!==e.token.type.outputWhitespacePost&&s.type!==e.token.type.logicWhitespacePost&&(l&&l.type===e.token.type.raw&&(n.pop(),l.value=l.value.trimEnd(),n.push(l)),u&&u.type===e.token.type.raw&&(o.pop(),u.value=u.value.trimEnd(),o.push(u))),s.type){case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:m.call(r,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:x.call(r,s)}s.type!==e.token.type.outputWhitespacePre&&s.type!==e.token.type.logicWhitespacePre&&h&&h.type===e.token.type.raw&&(t.shift(),h.value=h.value.trimStart(),t.unshift(h))}e.log.trace("Twig.compile: "," Output: ",n," Logic Stack: ",i," Pending Output: ",o)}if(i.length>0)throw p=i.pop(),new Error("Unable to find an end tag for "+p.type+", expecting one of "+p.next);return n}catch(t){if(r.options.rethrow)throw"TwigException"!==t.type||t.file||(t.file=r.id),t;e.log.error("Error compiling twig template "+r.id+": "),t.stack?e.log.error(t.stack):e.log.error(t.toString())}},e.prepare=function(t){e.log.debug("Twig.prepare: ","Tokenizing ",t);var r=e.tokenize.call(this,t);e.log.debug("Twig.prepare: ","Compiling ",r);var n=e.compile.call(this,r);return e.log.debug("Twig.prepare: ","Compiled ",n),n},e.output=function(t){var r=this.options.autoescape;if(!r)return t.join("");var n="string"==typeof r?r:"html",i=t.map((function(t){return!t||!0===t.twigMarkup||t.twigMarkup===n||"html"===n&&"html_attr"===t.twigMarkup||(t=e.filters.escape(t,[n])),t}));if(0===i.length)return"";var o=i.join("");return 0===o.length?"":new e.Markup(o,!0)},e.Templates={loaders:{},parsers:{},registry:{}},e.validateId=function(t){if("prototype"===t)throw new e.Error(t+" is not a valid twig identifier");if(e.cache&&Object.hasOwnProperty.call(e.Templates.registry,t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.registerLoader=function(t,r,n){if("function"!=typeof r)throw new e.Error("Unable to add loader for "+t+": Invalid function reference given.");n&&(r=r.bind(n)),this.loaders[t]=r},e.Templates.unRegisterLoader=function(e){this.isRegisteredLoader(e)&&delete this.loaders[e]},e.Templates.isRegisteredLoader=function(e){return Object.hasOwnProperty.call(this.loaders,e)},e.Templates.registerParser=function(t,r,n){if("function"!=typeof r)throw new e.Error("Unable to add parser for "+t+": Invalid function regerence given.");n&&(r=r.bind(n)),this.parsers[t]=r},e.Templates.unRegisterParser=function(e){this.isRegisteredParser(e)&&delete this.parsers[e]},e.Templates.isRegisteredParser=function(e){return Object.hasOwnProperty.call(this.parsers,e)},e.Templates.save=function(t){if(void 0===t.id)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return Object.hasOwnProperty.call(e.Templates.registry,t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,r,n,i){var o=void 0===r.id?t:r.id,s=e.Templates.registry[o];return e.cache&&void 0!==s?("function"==typeof n&&n(s),s):(r.parser=r.parser||"twig",r.id=o,void 0===r.async&&(r.async=!0),(this.loaders[r.method]||this.loaders.fs).call(this,t,r,n,i))},e.Block=function(e,t){this.template=e,this.token=t},e.Block.prototype.render=function(t,r){var n=t.template;return t.template=this.template,(this.token.expression?e.expression.parseAsync.call(t,this.token.output,r):t.parseAsync(this.token.output,r)).then((function(n){return e.expression.parseAsync.call(t,{type:e.expression.type.string,value:n},r)})).then((function(e){return t.template=n,e}))},e.ParseState=function(e,t,r){this.renderedBlocks={},this.overrideBlocks=void 0===t?{}:t,this.context=void 0===r?{}:r,this.macros={},this.nestingStack=[],this.template=e},e.ParseState.prototype.getBlock=function(e,t){var r;return!0!==t&&(r=this.overrideBlocks[e]),void 0===r&&(r=this.template.getBlock(e,t)),void 0===r&&null!==this.template.parentTemplate&&(r=this.template.parentTemplate.getBlock(e)),r},e.ParseState.prototype.getBlocks=function(e){var t={};return!1!==e&&null!==this.template.parentTemplate&&this.template.parentTemplate!==this.template&&(t=this.template.parentTemplate.getBlocks()),o(o(o({},t),this.template.getBlocks()),this.overrideBlocks)},e.ParseState.prototype.getNestingStackToken=function(e){var t;return this.nestingStack.forEach((function(r){void 0===t&&r.type===e&&(t=r)})),t},e.ParseState.prototype.parse=function(r,n,i){var o,s=this,a=[],p=null,c=!0,l=!0;function u(e){a.push(e)}function h(e){void 0!==e.chain&&(l=e.chain),void 0!==e.context&&(s.context=e.context),void 0!==e.output&&a.push(e.output)}if(n&&(s.context=n),o=e.async.forEach(r,(function(t){switch(e.log.debug("Twig.ParseState.parse: ","Parsing token: ",t),t.type){case e.token.type.raw:a.push(e.filters.raw(t.value));break;case e.token.type.logic:return e.logic.parseAsync.call(s,t.token,s.context,l).then(h);case e.token.type.comment:break;case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:case e.token.type.output:return e.log.debug("Twig.ParseState.parse: ","Output token: ",t.stack),e.expression.parseAsync.call(s,t.stack,s.context).then(u)}})).then((function(){return a=e.output.call(s.template,a),c=!1,a})).catch((function(e){i&&t(s,e),p=e})),i)return o;if(null!==p)return t(s,p);if(c)throw new e.Error("You are using Twig.js in sync mode in combination with async extensions.");return a},e.Template=function(t){var r,n,i=t.data,o=t.id,s=t.base,a=t.path,p=t.url,c=t.name,l=t.method,u=t.options;this.base=s,this.blocks={defined:{},imported:{}},this.id=o,this.method=l,this.name=c,this.options=u,this.parentTemplate=null,this.path=a,this.url=p,r=i,n=Object.prototype.toString.call(r).slice(8,-1),this.tokens=null!=r&&"String"===n?e.prepare.call(this,i):i,void 0!==o&&e.Templates.save(this)},e.Template.prototype.getBlock=function(e,t){var r,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!0!==t&&(r=this.blocks.defined[e]),n&&void 0===r&&(r=this.blocks.imported[e]),void 0===r&&null!==this.parentTemplate&&(r=this.parentTemplate.getBlock(e,t,n=!1)),r},e.Template.prototype.getBlocks=function(){return o(o(o({},{}),this.blocks.imported),this.blocks.defined)},e.Template.prototype.render=function(t,r,n){var i=this;return r=r||{},e.async.potentiallyAsync(i,n,(function(){var n=new e.ParseState(i,r.blocks,t);return n.parseAsync(i.tokens).then((function(t){var o,s;return null!==i.parentTemplate?(i.options.allowInlineIncludes&&(o=e.Templates.load(i.parentTemplate))&&(o.options=i.options),o||(s=e.path.parsePath(i,i.parentTemplate),o=e.Templates.loadRemote(s,{method:i.getLoaderMethod(),base:i.base,async:!1,id:s,options:i.options})),i.parentTemplate=o,i.parentTemplate.renderAsync(n.context,{blocks:n.getBlocks(!1),isInclude:!0})):!0===r.isInclude?t:t.valueOf()}))}))},e.Template.prototype.importFile=function(t){var r,n=null;if(!this.url&&this.options.allowInlineIncludes){if(t=this.path?e.path.parsePath(this,t):t,!(r=e.Templates.load(t))&&!(r=e.Templates.loadRemote(n,{id:t,method:this.getLoaderMethod(),async:!1,path:t,options:this.options})))throw new e.Error("Unable to find the template "+t);return r.options=this.options,r}return n=e.path.parsePath(this,t),e.Templates.loadRemote(n,{method:this.getLoaderMethod(),base:this.base,async:!1,options:this.options,id:n})},e.Template.prototype.getLoaderMethod=function(){return this.path?"fs":this.url?"ajax":this.method||"fs"},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e.Markup=function(e,t){if("string"!=typeof e)return e;var r=new String(e);return r.twigMarkup=void 0===t||t,r},e}},858:e=>{"use strict";e.exports=function(e){return e.exports={VERSION:e.VERSION},e.exports.twig=function(t){var r=t.id,n={strictVariables:t.strict_variables||!1,autoescape:null!==t.autoescape&&t.autoescape||!1,allowInlineIncludes:t.allowInlineIncludes||!1,rethrow:t.rethrow||!1,namespaces:t.namespaces};if(e.cache&&r&&e.validateId(r),void 0!==t.debug&&(e.debug=t.debug),void 0!==t.trace&&(e.trace=t.trace),void 0!==t.data)return e.Templates.parsers.twig({data:t.data,path:Object.hasOwnProperty.call(t,"path")?t.path:void 0,module:t.module,id:r,options:n});if(void 0!==t.ref){if(void 0!==t.id)throw new e.Error("Both ref and id cannot be set on a twig.js template.");return e.Templates.load(t.ref)}if(void 0!==t.method){if(!e.Templates.isRegisteredLoader(t.method))throw new e.Error('Loader for "'+t.method+'" is not defined.');return e.Templates.loadRemote(t.name||t.href||t.path||r||void 0,{id:r,method:t.method,parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error)}return void 0!==t.href?e.Templates.loadRemote(t.href,{id:r,method:"ajax",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0!==t.path?e.Templates.loadRemote(t.path,{id:r,method:"fs",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0},e.exports.extendFilter=function(t,r){e.filter.extend(t,r)},e.exports.extendFunction=function(t,r){e._function.extend(t,r)},e.exports.extendTest=function(t,r){e.test.extend(t,r)},e.exports.extendTag=function(t){e.logic.extend(t)},e.exports.extend=function(t){t(e)},e.exports.compile=function(t,r){var n=r.filename,i=r.filename,o=new e.Template({data:t,path:i,id:n,options:r.settings["twig options"]});return function(e){return o.render(e)}},e.exports.renderFile=function(t,r,n){"function"==typeof r&&(n=r,r={});var i=(r=r||{}).settings||{},o=i["twig options"],s={path:t,base:i.views,load:function(e){o&&o.allowAsync?e.renderAsync(r).then((function(e){return n(null,e)}),n):n(null,String(e.render(r)))},error:function(e){n(e)}};if(o)for(var a in o)Object.hasOwnProperty.call(o,a)&&(s[a]=o[a]);e.exports.twig(s)},e.exports.__express=e.exports.renderFile,e.exports.cache=function(t){e.cache=t},e.exports.path=e.path,e.exports.filters=e.filters,e.exports.tests=e.tests,e.exports.functions=e.functions,e.exports.Promise=e.Promise,e}},769:(e,t,r)=>{"use strict";var n=r(318),i=n(r(8)),o=n(r(319));e.exports=function(e){function t(t,r,n){return r?e.expression.parseAsync.call(t,r,n):e.Promise.resolve(!1)}for(e.expression={},r(35)(e),e.expression.reservedWords=["true","false","null","TRUE","FALSE","NULL","_context","and","b-and","or","b-or","b-xor","in","not in","if","matches","starts","ends","with"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",slice:"Twig.expression.type.slice",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},subexpression:{start:"Twig.expression.type.subexpression.start",end:"Twig.expression.type.subexpression.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.subexpression.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start,e.expression.type.subexpression.start,e.expression.type.operator.unary]},e.expression.set.operationsExtended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets,e.expression.type.slice]),e.expression.fn={compile:{push:function(e,t,r){r.push(e)},pushBoth:function(e,t,r){r.push(e),t.push(e)}},parse:{push:function(e,t){t.push(e)},pushValue:function(e,t){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_]\w*(\s?(?:as|by))?)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,r.push(e)},parse:function(r,n,i){var o=n.pop();return t(this,r.params,i).then((function(t){var i=e.test(r.filter,o,t);"not"===r.modifier?n.push(!i):n.push(i)}))}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile:function(t,r,n){var i,o=r.length-1;for(delete t.match,delete t.value;o>=0;o--){if((i=r.pop()).type===e.expression.type.object.start||i.type===e.expression.type.parameter.start||i.type===e.expression.type.array.start){r.push(i);break}n.push(i)}n.push(t)}},{type:e.expression.type.number,regex:/^-?\d+(\.\d+)?/,next:e.expression.set.operations,compile:function(e,t,r){e.value=Number(e.value),r.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.operator.binary,regex:/(^\?\?|^\?:|^(b-and)|^(b-or)|^(b-xor)|^[+\-~%?]|^(<=>)|^[:](?!\d\])|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^(and)[(|\s+]|^(or)[(|\s+]|^(in)[(|\s+]|^(not in)[(|\s+]|^(matches)|^(starts with)|^(ends with)|^\.\.)/,next:e.expression.set.expressions,transform:function(e,t){switch(e[0]){case"and(":case"or(":case"in(":case"not in(":return t[t.length-1].value=e[2],e[0];default:return""}},compile:function(t,r,n){delete t.match,t.value=t.value.trim();var i=t.value,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);r.length>0&&(r[r.length-1].type===e.expression.type.operator.unary||r[r.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=r[r.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>r[r.length-1].precidence);){var s=r.pop();n.push(s)}if(":"===i)if(r[r.length-1]&&"?"===r[r.length-1].value);else{var a=n.pop();if(a.type===e.expression.type.string||a.type===e.expression.type.variable)t.key=a.value;else if(a.type===e.expression.type.number)t.key=a.value.toString();else{if(!a.expression||a.type!==e.expression.type.parameter.end&&a.type!==e.expression.type.subexpression.end)throw new e.Error("Unexpected value before ':' of "+a.type+" = "+a.value);t.params=a.params}n.push(t)}else r.push(o)},parse:function(t,r,n){if(t.key)r.push(t);else{if(t.params)return e.expression.parseAsync.call(this,t.params,n).then((function(e){t.key=e,r.push(t),n.loop||delete t.params}));e.expression.operator.parse(t.value,r)}}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile:function(t,r,n){delete t.match,t.value=t.value.trim();var i=t.value,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);r.length>0&&(r[r.length-1].type===e.expression.type.operator.unary||r[r.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=r[r.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>r[r.length-1].precidence);){var s=r.pop();n.push(s)}r.push(o)},parse:function(t,r){e.expression.operator.parse(t.value,r)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2[\s\S])*?\1/,next:e.expression.set.operationsExtended,compile:function(t,r,n){var i=t.value;delete t.match,i='"'===i.slice(0,1)?i.replace('\\"','"'):i.replace("\\'","'"),t.value=i.slice(1,-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),n.push(t)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.subexpression.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.subexpression.end]),compile:function(e,t,r){e.value="(",r.push(e),t.push(e)},parse:e.expression.fn.parse.push},{type:e.expression.type.subexpression.end,regex:/^\)/,next:e.expression.set.operationsExtended,validate:function(t,r){for(var n=r.length-1,i=!1,o=!1,s=0;!i&&n>=0;){var a=r[n];(i=a.type===e.expression.type.subexpression.start)&&o&&(o=!1,i=!1),a.type===e.expression.type.parameter.start?s++:a.type===e.expression.type.parameter.end?s--:a.type===e.expression.type.subexpression.end&&(o=!0),n--}return i&&0===s},compile:function(t,r,n){var i,o=t;for(i=r.pop();r.length>0&&i.type!==e.expression.type.subexpression.start;)n.push(i),i=r.pop();for(var s=[];t.type!==e.expression.type.subexpression.start;)s.unshift(t),t=n.pop();s.unshift(t),void 0===(i=r[r.length-1])||i.type!==e.expression.type._function&&i.type!==e.expression.type.filter&&i.type!==e.expression.type.test&&i.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,n.push(o)):(o.expression=!1,i.params=s)},parse:function(t,r,n){if(t.expression)return e.expression.parseAsync.call(this,t.params,n).then((function(e){r.push(e)}));throw new e.Error("Unexpected subexpression end when token is not marked as an expression")}},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),validate:function(t,r){var n=r[r.length-1];return n&&!e.expression.reservedWords.includes(n.value.trim())},compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operationsExtended,compile:function(t,r,n){var i,o=t;for(i=r.pop();r.length>0&&i.type!==e.expression.type.parameter.start;)n.push(i),i=r.pop();for(var s=[];t.type!==e.expression.type.parameter.start;)s.unshift(t),t=n.pop();s.unshift(t),void 0===(t=n[n.length-1])||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,n.push(o)):(o.expression=!1,t.params=s)},parse:function(t,r,n){var i=[],o=!1,s=null;if(t.expression)return e.expression.parseAsync.call(this,t.params,n).then((function(e){r.push(e)}));for(;r.length>0;){if((s=r.pop())&&s.type&&s.type===e.expression.type.parameter.start){o=!0;break}i.unshift(s)}if(!o)throw new e.Error("Expected end of parameter set.");r.push(i)}},{type:e.expression.type.slice,regex:/^\[(-?\w*:-?\w*)\]/,next:e.expression.set.operationsExtended,compile:function(e,t,r){var n=e.match[1].split(":"),i=n[0],o=n[1];e.value="slice",e.params=[i,o],o||(e.params=[i]),r.push(e)},parse:function(t,r,n){var i=r.pop(),o=t.params,s=this;if(parseInt(o[0],10).toString()===o[0])o[0]=parseInt(o[0],10);else{var a=n[o[0]];if(s.template.options.strictVariables&&void 0===a)throw new e.Error('Variable "'+o[0]+'" does not exist.');o[0]=a}if(o[1])if(parseInt(o[1],10).toString()===o[1])o[1]=parseInt(o[1],10);else{var p=n[o[1]];if(s.template.options.strictVariables&&void 0===p)throw new e.Error('Variable "'+o[1]+'" does not exist.');void 0===p?o=[o[0]]:o[1]=p}r.push(e.filter.call(s,t.value,i,o))}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operationsExtended,compile:function(t,r,n){for(var i,o=r.length-1;o>=0&&(i=r.pop()).type!==e.expression.type.array.start;o--)n.push(i);n.push(t)},parse:function(t,r){for(var n=[],i=!1,o=null;r.length>0;){if((o=r.pop())&&o.type&&o.type===e.expression.type.array.start){i=!0;break}n.unshift(o)}if(!i)throw new e.Error("Expected end of array.");r.push(n)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operationsExtended,compile:function(t,r,n){for(var i,o=r.length-1;o>=0&&(!(i=r.pop())||i.type!==e.expression.type.object.start);o--)n.push(i);n.push(t)},parse:function(t,r){for(var n={},i=!1,o=null,s=!1,a=null;r.length>0;){if((o=r.pop())&&o.type&&o.type===e.expression.type.object.start){i=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!s)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");n[o.key]=a,void 0===n._keys&&(n._keys=[]),n._keys.unshift(o.key),a=null,s=!1}else s=!0,a=o}if(!i)throw new e.Error("Unexpected end of object.");r.push(n)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_-]*)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.value=e.match[1],r.push(e)},parse:function(r,n,i){var o=n.pop(),s=this;return t(s,r.params,i).then((function(t){return e.filter.call(s,r.value,o,t)})).then((function(e){n.push(e)}))}},{type:e.expression.type._function,regex:/^([a-zA-Z_]\w*)\s*\(/,next:e.expression.type.parameter.start,validate:function(t){return t[1]&&!e.expression.reservedWords.includes(t[1])},transform:function(){return"("},compile:function(e,t,r){var n=e.match[1];e.fn=n,delete e.match,delete e.value,r.push(e)},parse:function(r,n,i){var s,a=this,p=r.fn;return t(a,r.params,i).then((function(t){if(e.functions[p])s=e.functions[p].apply(a,t);else{if("function"!=typeof i[p])throw new e.Error(p+" function does not exist and is not defined in the context");s=i[p].apply(i,(0,o.default)(t))}return s})).then((function(e){n.push(e)}))}},{type:e.expression.type.variable,regex:/^[a-zA-Z_]\w*/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:function(t){return!e.expression.reservedWords.includes(t[0])},parse:function(t,r,n){var i=this;return e.expression.resolveAsync.call(i,n[t.value],n).then((function(n){if(i.template.options.strictVariables&&void 0===n)throw new e.Error('Variable "'+t.value+'" does not exist.');r.push(n)}))}},{type:e.expression.type.key.period,regex:/^\.(\w+)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.key=e.match[1],delete e.match,delete e.value,r.push(e)},parse:function(r,n,o,s){var a,p=this,c=r.key,l=n.pop();if(l&&!Object.prototype.hasOwnProperty.call(l,c)&&p.template.options.strictVariables)throw Object.keys(l).length>0?new e.Error('Key "'+c+'" for object with keys "'+Object.keys(l).join(", ")+'" does not exist.'):new e.Error('Key "'+c+'" does not exist as the object is empty.');return t(p,r.params,o).then((function(t){if(null==l)a=void 0;else{var r=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)};a="object"===(0,i.default)(l)&&c in l?l[c]:l["get"+r(c)]?l["get"+r(c)]:l["is"+r(c)]?l["is"+r(c)]:void 0}return e.expression.resolveAsync.call(p,a,o,t,s,l)})).then((function(e){n.push(e)}))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]]*)\]/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(t,r,n){var i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,n.push(t)},parse:function(r,n,o,s){var a,p,c=this,l=null;return t(c,r.params,o).then((function(t){return l=t,e.expression.parseAsync.call(c,r.stack,o)})).then((function(t){if((a=n.pop())&&!Object.prototype.hasOwnProperty.call(a,t)&&c.template.options.strictVariables){var r=Object.keys(a);throw r.length>0?new e.Error('Key "'+t+'" for array with keys "'+r.join(", ")+'" does not exist.'):new e.Error('Key "'+t+'" does not exist as the array is empty.')}return null==a?null:(p="object"===(0,i.default)(a)&&t in a?a[t]:null,e.expression.resolveAsync.call(c,p,a,l,s))})).then((function(e){n.push(e)}))}},{type:e.expression.type._null,regex:/^(null|NULL|none|NONE)/,next:e.expression.set.operations,compile:function(e,t,r){delete e.match,e.value=null,r.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse:function(e,t,r){t.push(r)}},{type:e.expression.type.bool,regex:/^(true|TRUE|false|FALSE)/,next:e.expression.set.operations,compile:function(e,t,r){e.value="true"===e.match[0].toLowerCase(),delete e.match,r.push(e)},parse:e.expression.fn.parse.pushValue}],e.expression.resolveAsync=function(t,r,n,i,o){var s=this;if("function"!=typeof t)return e.Promise.resolve(t);var a=e.Promise.resolve(n);return i&&i.type===e.expression.type.parameter.end&&(a=a.then((function(){return i.params&&e.expression.parseAsync.call(s,i.params,r,!0)})).then((function(e){return i.cleanup=!0,e}))),a.then((function(e){return t.apply(o||r,e||[])}))},e.expression.resolve=function(t,r,n,i,o){return e.async.potentiallyAsync(this,!1,(function(){return e.expression.resolveAsync.call(this,t,r,n,i,o)}))},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.expression.handler[t.type]=t};e.expression.definitions.length>0;)e.expression.extend(e.expression.definitions.shift());return e.expression.tokenize=function(t){var r,n,i,o,s,a=t.value,p=[],c=0,l=null,u=[],h=function(){for(var n=arguments.length,i=new Array(n),a=0;a0;)f[h]=i[h];if(e.log.trace("Twig.expression.tokenize","Matched a ",r," regular expression of ",f),l&&!l.includes(r))return u.push(r+" cannot follow a "+p[p.length-1].type+" at template:"+c+" near '"+f[0].slice(0,20)+"...'"),f[0];var d=e.expression.handler[r];if(d.validate&&!d.validate(f,p))return f[0];u=[];var y={type:r,value:f[0],match:f};return t.position&&(y.position=t.position),p.push(y),s=!0,l=o,c+=f[0].length,d.transform?d.transform(f,p):""};for(e.log.debug("Twig.expression.tokenize","Tokenizing expression ",a);a.length>0;){for(r in a=a.trim(),e.expression.handler)if(Object.hasOwnProperty.call(e.expression.handler,r)){if(o=e.expression.handler[r].next,n=e.expression.handler[r].regex,e.log.trace("Checking type ",r," on ",a),s=!1,Array.isArray(n))for(i=n.length;i-- >0;)a=a.replace(n[i],h);else a=a.replace(n,h);if(s)break}if(!s)throw u.length>0?new e.Error(u.join(" OR ")):new e.Error("Unable to parse '"+a+"' at template position"+c)}return e.log.trace("Twig.expression.tokenize","Tokenized to ",p),p},e.expression.compile=function(t){var r=e.expression.tokenize(t),n=null,i=[],o=[],s=null;for(e.log.trace("Twig.expression.compile: ","Compiling ",t.value);r.length>0;)n=r.shift(),s=e.expression.handler[n.type],e.log.trace("Twig.expression.compile: ","Compiling ",n),s.compile(n,o,i),e.log.trace("Twig.expression.compile: ","Stack is",o),e.log.trace("Twig.expression.compile: ","Output is",i);for(;o.length>0;)i.push(o.pop());return e.log.trace("Twig.expression.compile: ","Final output is",i),t.stack=i,delete t.value,t},e.expression.parse=function(t,r,n,i){var o=this;Array.isArray(t)||(t=[t]);var s=[],a=[],p=e.expression.type.operator.binary;return e.async.potentiallyAsync(o,i,(function(){return e.async.forEach(t,(function(n,i){var c,l=null,u=null;if(!n.cleanup)return t.length>i+1&&(u=t[i+1]),(l=e.expression.handler[n.type]).parse&&(c=l.parse.call(o,n,s,r,u)),n.type===p&&r.loop&&a.push(n),c})).then((function(){for(var e=a.length,t=null;e-- >0;)(t=a[e]).params&&t.key&&delete t.key;if(n){var r=s.splice(0);s.push(r)}return s.pop()}))}))},e}},35:e=>{"use strict";e.exports=function(e){e.expression.operator={leftToRight:"leftToRight",rightToLeft:"rightToLeft"};var t=function(e,t){if(null==t)return null;if(void 0!==t.indexOf)return(e===t||""!==e)&&t.includes(e);var r;for(r in t)if(Object.hasOwnProperty.call(t,r)&&t[r]===e)return!0;return!1};return e.expression.operator.lookup=function(t,r){switch(t){case"..":r.precidence=20,r.associativity=e.expression.operator.leftToRight;break;case",":r.precidence=18,r.associativity=e.expression.operator.leftToRight;break;case"?:":case"?":case":":r.precidence=16,r.associativity=e.expression.operator.rightToLeft;break;case"??":r.precidence=15,r.associativity=e.expression.operator.rightToLeft;break;case"or":r.precidence=14,r.associativity=e.expression.operator.leftToRight;break;case"and":r.precidence=13,r.associativity=e.expression.operator.leftToRight;break;case"b-or":r.precidence=12,r.associativity=e.expression.operator.leftToRight;break;case"b-xor":r.precidence=11,r.associativity=e.expression.operator.leftToRight;break;case"b-and":r.precidence=10,r.associativity=e.expression.operator.leftToRight;break;case"==":case"!=":case"<=>":r.precidence=9,r.associativity=e.expression.operator.leftToRight;break;case"<":case"<=":case">":case">=":case"not in":case"in":case"matches":case"starts with":case"ends with":r.precidence=8,r.associativity=e.expression.operator.leftToRight;break;case"~":case"+":case"-":r.precidence=6,r.associativity=e.expression.operator.leftToRight;break;case"//":case"**":case"*":case"/":case"%":r.precidence=5,r.associativity=e.expression.operator.leftToRight;break;case"not":r.precidence=3,r.associativity=e.expression.operator.rightToLeft;break;default:throw new e.Error("Failed to lookup operator: "+t+" is an unknown operator.")}return r.operator=t,r},e.expression.operator.parse=function(r,n){var i,o,s;if(e.log.trace("Twig.expression.operator.parse: ","Handling ",r),"?"===r&&(s=n.pop()),o=n.pop(),"not"!==r&&(i=n.pop()),"in"!==r&&"not in"!==r&&"??"!==r&&(i&&Array.isArray(i)&&(i=i.length),"?"!==r&&o&&Array.isArray(o)&&(o=o.length)),"matches"===r&&o&&"string"==typeof o){var a=o.match(/^\/(.*)\/([gims]?)$/),p=a[1],c=a[2];o=new RegExp(p,c)}switch(r){case":":break;case"??":void 0===i&&(i=o,o=s,s=void 0),null!=i?n.push(i):n.push(o);break;case"?:":e.lib.boolval(i)?n.push(i):n.push(o);break;case"?":void 0===i&&(i=o,o=s,s=void 0),e.lib.boolval(i)?n.push(o):n.push(s);break;case"+":o=parseFloat(o),i=parseFloat(i),n.push(i+o);break;case"-":o=parseFloat(o),i=parseFloat(i),n.push(i-o);break;case"*":o=parseFloat(o),i=parseFloat(i),n.push(i*o);break;case"/":o=parseFloat(o),i=parseFloat(i),n.push(i/o);break;case"//":o=parseFloat(o),i=parseFloat(i),n.push(Math.floor(i/o));break;case"%":o=parseFloat(o),i=parseFloat(i),n.push(i%o);break;case"~":n.push((null!=i?i.toString():"")+(null!=o?o.toString():""));break;case"not":case"!":n.push(!e.lib.boolval(o));break;case"<=>":n.push(i===o?0:i":n.push(i>o);break;case">=":n.push(i>=o);break;case"===":n.push(i===o);break;case"==":n.push(i==o);break;case"!==":n.push(i!==o);break;case"!=":n.push(i!=o);break;case"or":n.push(e.lib.boolval(i)||e.lib.boolval(o));break;case"b-or":n.push(i|o);break;case"b-xor":n.push(i^o);break;case"and":n.push(e.lib.boolval(i)&&e.lib.boolval(o));break;case"b-and":n.push(i&o);break;case"**":n.push(Math.pow(i,o));break;case"not in":n.push(!t(i,o));break;case"in":n.push(t(i,o));break;case"matches":n.push(o.test(i));break;case"starts with":n.push("string"==typeof i&&0===i.indexOf(o));break;case"ends with":n.push("string"==typeof i&&i.includes(o,i.length-o.length));break;case"..":n.push(e.functions.range(i,o));break;default:throw new e.Error("Failed to parse operator: "+r+" is an unknown operator.")}},e}},617:(e,t,r)=>{"use strict";e.exports=function e(){var t={VERSION:"1.17.1"};return r(181)(t),r(383)(t),r(769)(t),r(213)(t),r(799)(t),r(773)(t),r(854)(t),r(188)(t),r(341)(t),r(402)(t),r(847)(t),r(148)(t),r(439)(t),r(452)(t),r(858)(t),t.exports.factory=e,t.exports}},213:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(e){function t(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return null!=t&&r===e}return e.filters={upper:function(e){return"string"!=typeof e?e:e.toUpperCase()},lower:function(e){return"string"!=typeof e?e:e.toLowerCase()},capitalize:function(e){return"string"!=typeof e?e:e.slice(0,1).toUpperCase()+e.toLowerCase().slice(1)},title:function(e){return"string"!=typeof e?e:e.toLowerCase().replace(/(^|\s)([a-z])/g,(function(e,t,r){return t+r.toUpperCase()}))},length:function(t){return e.lib.is("Array",t)||"string"==typeof t?t.length:e.lib.is("Object",t)?void 0===t._keys?Object.keys(t).length:t._keys.length:0},reverse:function(e){if(t("Array",e))return e.reverse();if(t("String",e))return e.split("").reverse().join("");if(t("Object",e)){var r=e._keys||Object.keys(e).reverse();return e._keys=r,e}},sort:function(e){if(t("Array",e))return e.sort();if(t("Object",e)){delete e._keys;var r=Object.keys(e).sort((function(t,r){var n,i;return e[t]>e[r]==!(e[t]<=e[r])?e[t]>e[r]?1:e[t]e[r].toString()?1:e[t]e[r]?1:e[t].toString()i?1:n1)throw new e.Error("default filter expects one argument");return null==t||""===t?void 0===r?"":r[0]:t},json_encode:function(r){if(null==r)return"null";if("object"===(0,n.default)(r)&&t("Array",r)){var i=[];return r.forEach((function(t){i.push(e.filters.json_encode(t))})),"["+i.join(",")+"]"}if("object"===(0,n.default)(r)&&t("Date",r))return'"'+r.toISOString()+'"';if("object"===(0,n.default)(r)){var o=r._keys||Object.keys(r),s=[];return o.forEach((function(t){s.push(JSON.stringify(t)+":"+e.filters.json_encode(r[t]))})),"{"+s.join(",")+"}"}return JSON.stringify(r)},merge:function(r,n){var i=[],o=0;if(t("Array",r)?n.forEach((function(e){t("Array",e)||(i={})})):i={},t("Array",i)||(i._keys=[]),t("Array",r)?r.forEach((function(e){i._keys&&i._keys.push(o),i[o]=e,o++})):(r._keys||Object.keys(r)).forEach((function(e){i[e]=r[e],i._keys.push(e);var t=parseInt(e,10);!isNaN(t)&&t>=o&&(o=t+1)})),n.forEach((function(e){t("Array",e)?e.forEach((function(e){i._keys&&i._keys.push(o),i[o]=e,o++})):(e._keys||Object.keys(e)).forEach((function(t){i[t]||i._keys.push(t),i[t]=e[t];var r=parseInt(t,10);!isNaN(r)&&r>=o&&(o=r+1)}))})),0===n.length)throw new e.Error("Filter merge expects at least one parameter");return i},date:function(t,r){var n=e.functions.date(t),i=r&&Boolean(r.length)?r[0]:"F j, Y H:i";return e.lib.date(i.replace(/\\\\/g,"\\"),n)},date_modify:function(t,r){if(null!=t){if(void 0===r||1!==r.length)throw new e.Error("date_modify filter expects 1 argument");var n,i=r[0];return e.lib.is("Date",t)&&(n=e.lib.strtotime(i,t.getTime()/1e3)),e.lib.is("String",t)&&(n=e.lib.strtotime(i,e.lib.strtotime(t))),e.lib.is("Number",t)&&(n=e.lib.strtotime(i,t)),new Date(1e3*n)}},replace:function(t,r){if(null!=t){var n,i=r[0];for(n in i)Object.hasOwnProperty.call(i,n)&&"_keys"!==n&&(t=e.lib.replaceAll(t,n,i[n]));return t}},format:function(t,r){if(null!=t)return e.lib.vsprintf(t,r)},striptags:function(t,r){if(null!=t)return e.lib.stripTags(t,r)},escape:function(t,r){if(null!=t&&""!==t){var n="html";if(r&&Boolean(r.length)&&!0!==r[0]&&(n=r[0]),"html"===n){var i=t.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");return new e.Markup(i,"html")}if("js"===n){for(var o=t.toString(),s="",a=0;a"]$/))g+=y[m].replace(/&/g,"&").replace(//g,">").replace(/"/g,""");else{var x=y.charCodeAt(m);g+=x<=31&&9!==x&&10!==x&&13!==x?"�":x<128?e.lib.sprintf("&#x%02s;",x.toString(16).toUpperCase()):e.lib.sprintf("&#x%04s;",x.toString(16).toUpperCase())}return new e.Markup(g,"html_attr")}throw new e.Error("escape strategy unsupported")}},e:function(t,r){return e.filters.escape(t,r)},nl2br:function(t){if(null!=t&&""!==t){var r="BACKSLASH_n_replace",n="
    "+r;return t=e.filters.escape(t).replace(/\r\n/g,n).replace(/\r/g,n).replace(/\n/g,n),t=e.lib.replaceAll(t,r,"\n"),new e.Markup(t)}},number_format:function(e,t){var r=e,n=t&&t[0]?t[0]:void 0,i=t&&void 0!==t[1]?t[1]:".",o=t&&void 0!==t[2]?t[2]:",";r=String(r).replace(/[^0-9+\-Ee.]/g,"");var s=isFinite(Number(r))?Number(r):0,a=isFinite(Number(n))?Math.abs(n):0,p="";return p=(a?function(e,t){var r=Math.pow(10,t);return String(Math.round(e*r)/r)}(s,a):String(Math.round(s))).split("."),p[0].length>3&&(p[0]=p[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(p[1]||"").length=0;o--)if(!r.includes(n.charAt(o))){n=n.slice(0,Math.max(0,o+1));break}return r.includes(n.charAt(0))?"":n}},truncate:function(e,t){var r=30,n=!1,i="...";if(e=String(e),t&&(t[0]&&(r=t[0]),t[1]&&(n=t[1]),t[2]&&(i=t[2])),e.length>r){if(n&&-1===(r=e.indexOf(" ",r)))return e;e=e.slice(0,r)+i}return e},slice:function(t,r){if(null!=t){if(void 0===r||0===r.length)throw new e.Error("slice filter expects at least 1 argument");var n=r[0]||0,i=r.length>1?r[1]:t.length,o=n>=0?n:Math.max(t.length+n,0);if(i<0&&(i=t.length-o+i),e.lib.is("Array",t)){for(var s=[],a=o;a2)throw new e.Error("split filter expects 1 or 2 argument");if(e.lib.is("String",t)){var n=r[0],i=r[1],o=t.split(n);if(void 0===i)return o;if(i<0)return t.split(n,o.length+i);var s=[];if(""===n)for(;o.length>0;){for(var a="",p=0;p0;p++)a+=o.shift();s.push(a)}else{for(var c=0;c0;c++)s.push(o.shift());o.length>0&&s.push(o.join(n))}return s}throw new e.Error("split filter expects value to be a string")}},last:function(t){var r;return e.lib.is("Object",t)?t[(r=void 0===t._keys?Object.keys(t):t._keys)[r.length-1]]:e.lib.is("Number",t)?t.toString().slice(-1):t[t.length-1]},raw:function(t){return new e.Markup(t||"")},batch:function(t,r){var n,i,o=r.shift(),s=r.shift();if(!e.lib.is("Array",t))throw new e.Error("batch filter expects items to be an array");if(!e.lib.is("Number",o))throw new e.Error("batch filter expects size to be a number");o=Math.ceil(o);var a=e.lib.chunkArray(t,o);if(s&&t.length%o!=0){for(i=o-(n=a.pop()).length;i--;)n.push(s);a.push(n)}return a},round:function(t,r){var n=(r=r||[]).length>0?r[0]:0,i=r.length>1?r[1]:"common";if(t=parseFloat(t),n&&!e.lib.is("Number",n))throw new e.Error("round filter expects precision to be a number");if("common"===i)return e.lib.round(t,n);if(!e.lib.is("Function",Math[i]))throw new e.Error("round filter expects method to be 'floor', 'ceil', or 'common'");return Math[i](t*Math.pow(10,n))/Math.pow(10,n)},spaceless:function(e){return e.replace(/>\s+<").trim()}},e.filter=function(t,r,n){if(!e.filters[t])throw new e.Error("Unable to find filter "+t);return e.filters[t].call(this,r,n)},e.filter.extend=function(t,r){e.filters[t]=r},e}},799:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(t){return t.functions={range:function(e,t,r){var n,i,o=[],s=r||1,a=!1;if(isNaN(e)||isNaN(t)?isNaN(e)&&isNaN(t)?(a=!0,n=e.charCodeAt(0),i=t.charCodeAt(0)):(n=isNaN(e)?0:e,i=isNaN(t)?0:t):(n=parseInt(e,10),i=parseInt(t,10)),n>i)for(;n>=i;)o.push(a?String.fromCharCode(n):n),n-=s;else for(;n<=i;)o.push(a?String.fromCharCode(n):n),n+=s;return o},cycle:function(e,t){return e[t%e.length]},dump:function(){for(var e=arguments.length,t=new Array(e),r=0;r0;)e--,t+=" ";return t},c=function(e){a+=p(s),"object"===(0,n.default)(e)?l(e):"function"==typeof e?a+="function()\n":"string"==typeof e?a+="string("+e.length+') "'+e+'"'+o:"number"==typeof e?a+="number("+e+")"+o:"boolean"==typeof e&&(a+="bool("+e+")"+o)},l=function(e){var t;if(null===e)a+="NULL\n";else if(void 0===e)a+="undefined\n";else if("object"===(0,n.default)(e)){for(t in a+=p(s)+(0,n.default)(e),s++,a+="("+function(e){var t,r=0;for(t in e)Object.hasOwnProperty.call(e,t)&&r++;return r}(e)+") {"+o,e)Object.hasOwnProperty.call(e,t)&&(a+=p(s)+"["+t+"]=> "+o,c(e[t]));s--,a+=p(s)+"}"+o}else c(e)};return 0===i.length&&i.push(this.context),i.forEach((function(e){l(e)})),a},date:function(e){var r;if(null==e||""===e)r=new Date;else if(t.lib.is("Date",e))r=e;else if(t.lib.is("String",e))r=e.match(/^\d+$/)?new Date(1e3*e):new Date(1e3*t.lib.strtotime(e));else{if(!t.lib.is("Number",e))throw new t.Error("Unable to parse date "+e);r=new Date(1e3*e)}return r},block:function(e){var t=this,r=t.getBlock(e);if(void 0!==r)return r.render(t,t.context)},parent:function(){var e=this;return e.getBlock(e.getNestingStackToken(t.logic.type.block).blockName,!0).render(e,e.context)},attribute:function(e,r,n){return t.lib.is("Object",e)&&Object.hasOwnProperty.call(e,r)?"function"==typeof e[r]?e[r].apply(void 0,n):e[r]:e&&e[r]||void 0},max:function(e){if(t.lib.is("Object",e))return delete e._keys,t.lib.max(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";e.exports=r(617)()},773:(e,t,r)=>{"use strict";e.exports=function(e){return e.lib={},e.lib.sprintf=r(296),e.lib.vsprintf=r(436),e.lib.round=r(718),e.lib.max=r(673),e.lib.min=r(4),e.lib.stripTags=r(359),e.lib.strtotime=r(195),e.lib.date=r(190),e.lib.boolval=r(315),e.lib.is=function(e,t){if(null==t)return!1;switch(e){case"Array":return Array.isArray(t);case"Date":return t instanceof Date;case"String":return"string"==typeof t||t instanceof String;case"Number":return"number"==typeof t||t instanceof Number;case"Function":return"function"==typeof t;case"Object":return t instanceof Object;default:return!1}},e.lib.replaceAll=function(e,t,r){var n="string"==typeof e?e:e.toString(),i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n.replace(new RegExp(i,"g"),r)},e.lib.chunkArray=function(e,t){var r=[],n=0,i=e.length;if(t<1||!Array.isArray(e))return[];for(;n{"use strict";e.exports=function(e){e.Templates.registerLoader("ajax",(function(t,r,n,i){var o,s=r.precompiled,a=this.parsers[r.parser]||this.parser.twig;if("undefined"==typeof XMLHttpRequest)throw new e.Error('Unsupported platform: Unable to do ajax requests because there is no "XMLHTTPRequest" implementation');var p=new XMLHttpRequest;return p.onreadystatechange=function(){var c=null;4===p.readyState&&(200===p.status||window.cordova&&0===p.status?(e.log.debug("Got template ",p.responseText),c=!0===s?JSON.parse(p.responseText):p.responseText,r.url=t,r.data=c,o=a.call(this,r),"function"==typeof n&&n(o)):"function"==typeof i&&i(p))},p.open("GET",t,Boolean(r.async)),p.overrideMimeType("text/plain"),p.send(),!!r.async||o}))}},188:(e,t,r)=>{"use strict";e.exports=function(e){var t,n;try{t=r(351),n=r(470)}catch(e){console.warn("Missing fs and path modules. "+e)}e.Templates.registerLoader("fs",(function(r,i,o,s){var a,p,c=i.precompiled,l=this.parsers[i.parser]||this.parser.twig;if(!t||!n)throw new e.Error('Unsupported platform: Unable to load from file because there is no "fs" or "path" implementation');var u=function(e,t){e?"function"==typeof s&&s(e):(!0===c&&(t=JSON.parse(t)),i.data=t,i.path=i.path||r,a=l.call(this,i),"function"==typeof o&&o(a))};if(i.path=i.path||r,i.async)return t.stat(i.path,(function(r,n){!r&&n.isFile()?t.readFile(i.path,"utf8",u):"function"==typeof s&&s(new e.Error("Unable to find template file "+i.path))})),!0;try{if(!t.statSync(i.path).isFile())throw new e.Error("Unable to find template file "+i.path)}catch(t){throw new e.Error("Unable to find template file "+i.path+". "+t)}return p=t.readFileSync(i.path,"utf8"),u(void 0,p),a}))}},341:(e,t,r)=>{"use strict";var n=r(318)(r(713));function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,p=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){p=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(p)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r\s+<").trim();return r=new e.Markup(r),{chain:n,output:r}}))}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+(\w+)\s*\(\s*((?:\w+(?:\s*=\s*([\s\S]+))?(?:,\s*)?)*)\s*\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){var r=t.match[1],n=t.match[2].split(/\s*,\s*/),i=n.map((function(e){return e.split(/\s*=\s*/)[0]})),o=i.length;if(o>1)for(var s={},a=0;a0;)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var r=t.value.trim(),n=e.logic.tokenize.call(this,r),i=e.logic.handler[n.type];return i.compile&&(n=i.compile.call(this,n),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",n)),n},e.logic.tokenize=function(t){var r=null,n=null,i=null,o=null,s=null,a=null,p=null;for(r in t=t.trim(),e.logic.handler)if(Object.hasOwnProperty.call(e.logic.handler,r))for(n=e.logic.handler[r].type,o=i=e.logic.handler[r].regex,Array.isArray(i)||(o=[i]),s=o.length,a=0;a{"use strict";e.exports=function(e){e.Templates.registerParser("source",(function(e){return e.data||""}))}},847:e=>{"use strict";e.exports=function(e){e.Templates.registerParser("twig",(function(t){return new e.Template(t)}))}},148:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(e){return e.path={},e.path.expandNamespace=function(e,t){var r=Object.keys(e),n=new RegExp("^(?:@(".concat(r.join("|"),")/|(").concat(r.join("|"),")::)"));return t.replace(n,(function(t,r,n){return"".concat(e[void 0===r?n:r],"/")}))},e.path.parsePath=function(t,r){var i=t.options.namespaces,o=r||"",s=i&&"object"===(0,n.default)(i)?e.path.expandNamespace(i,o):o;return s===o&&(s=e.path.relativePath(t,o)),s},e.path.relativePath=function(t,n){var i,o,s,a="/",p=[],c=n||"";if(t.url)i=void 0===t.base?t.url:t.base.replace(/([^/])$/,"$1/");else if(t.path){var l=r(470),u=l.sep||a,h=new RegExp("^\\.{1,2}"+u.replace("\\","\\\\"));c=c.replace(/\//g,u),void 0!==t.base&&null===c.match(h)?(c=c.replace(t.base,""),i=t.base+u):i=l.normalize(t.path),i=i.replace(u+u,u),a=u}else{if(!t.name&&!t.id||!t.method||"fs"===t.method||"ajax"===t.method)throw new e.Error("Cannot extend an inline template.");i=t.base||t.name||t.id}for((o=i.split(a)).pop(),o=o.concat(c.split(a));o.length>0;)"."===(s=o.shift())||(".."===s&&p.length>0&&".."!==p[p.length-1]?p.pop():p.push(s));return p.join(a)},e}},439:e=>{"use strict";e.exports=function(e){return e.tests={empty:function(e){if(!0===e)return!1;if(null==e)return!0;if("number"==typeof e)return!1;if(e.length>0)return!1;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0},odd:function(e){return e%2==1},even:function(e){return e%2==0},"divisible by":function(e,t){return e%t[0]==0},divisibleby:function(t,r){return console.warn("`divisibleby` is deprecated use `divisible by`"),e.tests["divisible by"](t,r)},defined:function(e){return void 0!==e},none:function(e){return null===e},null:function(e){return this.none(e)},"same as":function(e,t){return e===t[0]},sameas:function(t,r){return console.warn("`sameas` is deprecated use `same as`"),e.tests["same as"](t,r)},iterable:function(t){return t&&(e.lib.is("Array",t)||e.lib.is("Object",t))}},e.test=function(t,r,n){if(!e.tests[t])throw e.Error("Test "+t+" is not defined.");return e.tests[t](r,n)},e.test.extend=function(t,r){e.tests[t]=r},e}},521:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"boolean":return e?"1":"";case"string":return e;case"number":return isNaN(e)?"NAN":isFinite(e)?e+"":(e<0?"-":"")+"INF";case"undefined":return"";case"object":return Array.isArray(e)?"Array":null!==e?"Object":"";default:throw new Error("Unsupported value type")}}},892:(e,t,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":n(e)){case"number":return e;case"string":return parseFloat(e)||0;default:return r(791)(e)}}},791:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"number":return isNaN(e)||!isFinite(e)?0:e<0?Math.ceil(e):Math.floor(e);case"string":return parseInt(e,10)||0;default:return+!!e}}},190:e=>{"use strict";e.exports=function(e,t){var r=void 0,n=void 0,i=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],o=/\\?(.?)/gi,s=function(e,t){return n[e]?n[e]():t},a=function(e,t){for(e=String(e);e.length9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var e=3600*r.getUTCHours(),t=60*r.getUTCMinutes(),n=r.getUTCSeconds();return a(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return a(n.g(),2)},H:function(){return a(n.G(),2)},i:function(){return a(r.getMinutes(),2)},s:function(){return a(r.getSeconds(),2)},u:function(){return a(1e3*r.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+a(100*Math.floor(t/60)+t%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,s)},r:function(){return"D, d M Y H:i:s O".replace(o,s)},U:function(){return r/1e3|0}},function(e,t){return r=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(o,s)}(e,t)}},195:e=>{"use strict";var t="[ \\t]+",r="[ \\t]*",n="(?:([ap])\\.?m\\.?([\\t ]|$))",i="(2[0-4]|[01]?[0-9])",o="([01][0-9]|2[0-4])",s="(0?[1-9]|1[0-2])",a="([0-5]?[0-9])",p="([0-5][0-9])",c="(60|[0-5]?[0-9])",l="(60|[0-5][0-9])",u="(?:\\.([0-9]+))",h="sunday|monday|tuesday|wednesday|thursday|friday|saturday",f="sun|mon|tue|wed|thu|fri|sat",d=h+"|"+f+"|weekdays?",y="first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth",g="next|last|previous|this",m="(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|"+d,x="([0-9]{1,4})",v="([0-9]{4})",b="(1[0-2]|0?[0-9])",w="(0[0-9]|1[0-2])",k="(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)",T="(0[0-9]|[1-2][0-9]|3[01])",A="january|february|march|april|may|june|july|august|september|october|november|december",S="jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec",E="("+A+"|"+S+"|i[vx]|vi{0,3}|xi{0,2}|i{1,3})",j="((?:GMT)?([+-])"+i+":?"+a+"?)",O=E+"[ .\\t-]*"+k+"[,.stndrh\\t ]*";function N(e,t){switch(t=t&&t.toLowerCase()){case"a":e+=12===e?-12:0;break;case"p":e+=12!==e?12:0}return e}function P(e){var t=+e;return e.length<4&&t<100&&(t+=t<70?2e3:1900),t}function _(e){return{jan:0,january:0,i:0,feb:1,february:1,ii:1,mar:2,march:2,iii:2,apr:3,april:3,iv:3,may:4,v:4,jun:5,june:5,vi:5,jul:6,july:6,vii:6,aug:7,august:7,viii:7,sep:8,sept:8,september:8,ix:8,oct:9,october:9,x:9,nov:10,november:10,xi:10,dec:11,december:11,xii:11}[e.toLowerCase()]}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{mon:1,monday:1,tue:2,tuesday:2,wed:3,wednesday:3,thu:4,thursday:4,fri:5,friday:5,sat:6,saturday:6,sun:0,sunday:0}[e.toLowerCase()]||t}function M(e,t){if(!(e=e&&e.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i)))return t;var r="-"===e[1]?-1:1,n=+e[2],i=+e[4];return e[4]||e[3]||(i=Math.floor(n%100),n=Math.floor(n/100)),r*(60*n+i)*60}var C={acdt:37800,acst:34200,addt:-7200,adt:-10800,aedt:39600,aest:36e3,ahdt:-32400,ahst:-36e3,akdt:-28800,akst:-32400,amt:-13840,apt:-10800,ast:-14400,awdt:32400,awst:28800,awt:-10800,bdst:7200,bdt:-36e3,bmt:-14309,bst:3600,cast:34200,cat:7200,cddt:-14400,cdt:-18e3,cemt:10800,cest:7200,cet:3600,cmt:-15408,cpt:-18e3,cst:-21600,cwt:-18e3,chst:36e3,dmt:-1521,eat:10800,eddt:-10800,edt:-14400,eest:10800,eet:7200,emt:-26248,ept:-14400,est:-18e3,ewt:-14400,ffmt:-14660,fmt:-4056,gdt:39600,gmt:0,gst:36e3,hdt:-34200,hkst:32400,hkt:28800,hmt:-19776,hpt:-34200,hst:-36e3,hwt:-34200,iddt:14400,idt:10800,imt:25025,ist:7200,jdt:36e3,jmt:8440,jst:32400,kdt:36e3,kmt:5736,kst:30600,lst:9394,mddt:-18e3,mdst:16279,mdt:-21600,mest:7200,met:3600,mmt:9017,mpt:-21600,msd:14400,msk:10800,mst:-25200,mwt:-21600,nddt:-5400,ndt:-9052,npt:-9e3,nst:-12600,nwt:-9e3,nzdt:46800,nzmt:41400,nzst:43200,pddt:-21600,pdt:-25200,pkst:21600,pkt:18e3,plmt:25590,pmt:-13236,ppmt:-17340,ppt:-25200,pst:-28800,pwt:-25200,qmt:-18840,rmt:5794,sast:7200,sdmt:-16800,sjmt:-20173,smt:-13884,sst:-39600,tbmt:10751,tmt:12344,uct:0,utc:0,wast:7200,wat:3600,wemt:7200,west:3600,wet:0,wib:25200,wita:28800,wit:32400,wmt:5040,yddt:-25200,ydt:-28800,ypt:-28800,yst:-32400,ywt:-28800,a:3600,b:7200,c:10800,d:14400,e:18e3,f:21600,g:25200,h:28800,i:32400,k:36e3,l:39600,m:43200,n:-3600,o:-7200,p:-10800,q:-14400,r:-18e3,s:-21600,t:-25200,u:-28800,v:-32400,w:-36e3,x:-39600,y:-43200,z:0},D={yesterday:{regex:/^yesterday/i,name:"yesterday",callback:function(){return this.rd-=1,this.resetTime()}},now:{regex:/^now/i,name:"now"},noon:{regex:/^noon/i,name:"noon",callback:function(){return this.resetTime()&&this.time(12,0,0,0)}},midnightOrToday:{regex:/^(midnight|today)/i,name:"midnight | today",callback:function(){return this.resetTime()}},tomorrow:{regex:/^tomorrow/i,name:"tomorrow",callback:function(){return this.rd+=1,this.resetTime()}},timestamp:{regex:/^@(-?\d+)/i,name:"timestamp",callback:function(e,t){return this.rs+=+t,this.y=1970,this.m=0,this.d=1,this.dates=0,this.resetTime()&&this.zone(0)}},firstOrLastDay:{regex:/^(first|last) day of/i,name:"firstdayof | lastdayof",callback:function(e,t){"first"===t.toLowerCase()?this.firstOrLastDayOfMonth=1:this.firstOrLastDayOfMonth=-1}},backOrFrontOf:{regex:RegExp("^(back|front) of "+i+r+n+"?","i"),name:"backof | frontof",callback:function(e,t,r,n){var i=+r,o=15;return"back"===t.toLowerCase()||(i-=1,o=45),i=N(i,n),this.resetTime()&&this.time(i,o,0,0)}},weekdayOf:{regex:RegExp("^("+y+"|"+g+")"+t+"("+h+"|"+f+")"+t+"of","i"),name:"weekdayof"},mssqltime:{regex:RegExp("^"+s+":"+p+":"+l+"[:.]([0-9]+)"+n,"i"),name:"mssqltime",callback:function(e,t,r,n,i,o){return this.time(N(+t,o),+r,+n,+i.substr(0,3))}},timeLong12:{regex:RegExp("^"+s+"[:.]"+a+"[:.]"+l+r+n,"i"),name:"timelong12",callback:function(e,t,r,n,i){return this.time(N(+t,i),+r,+n,0)}},timeShort12:{regex:RegExp("^"+s+"[:.]"+p+r+n,"i"),name:"timeshort12",callback:function(e,t,r,n){return this.time(N(+t,n),+r,0,0)}},timeTiny12:{regex:RegExp("^"+s+r+n,"i"),name:"timetiny12",callback:function(e,t,r){return this.time(N(+t,r),0,0,0)}},soap:{regex:RegExp("^"+v+"-"+w+"-"+T+"T"+o+":"+p+":"+l+u+j+"?","i"),name:"soap",callback:function(e,t,r,n,i,o,s,a,p){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,+a.substr(0,3))&&this.zone(M(p))}},wddx:{regex:RegExp("^"+v+"-"+b+"-"+k+"T"+i+":"+a+":"+c),name:"wddx",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},exif:{regex:RegExp("^"+v+":"+w+":"+T+" "+o+":"+p+":"+l,"i"),name:"exif",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},xmlRpc:{regex:RegExp("^"+v+w+T+"T"+i+":"+p+":"+l),name:"xmlrpc",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},xmlRpcNoColon:{regex:RegExp("^"+v+w+T+"[Tt]"+i+p+l),name:"xmlrpcnocolon",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},clf:{regex:RegExp("^"+k+"/("+S+")/"+v+":"+o+":"+p+":"+l+t+j,"i"),name:"clf",callback:function(e,t,r,n,i,o,s,a){return this.ymd(+n,_(r),+t)&&this.time(+i,+o,+s,0)&&this.zone(M(a))}},iso8601long:{regex:RegExp("^t?"+i+"[:.]"+a+"[:.]"+c+u,"i"),name:"iso8601long",callback:function(e,t,r,n,i){return this.time(+t,+r,+n,+i.substr(0,3))}},dateTextual:{regex:RegExp("^"+E+"[ .\\t-]*"+k+"[,.stndrh\\t ]+"+x,"i"),name:"datetextual",callback:function(e,t,r,n){return this.ymd(P(n),_(t),+r)}},pointedDate4:{regex:RegExp("^"+k+"[.\\t-]"+b+"[.-]"+v),name:"pointeddate4",callback:function(e,t,r,n){return this.ymd(+n,r-1,+t)}},pointedDate2:{regex:RegExp("^"+k+"[.\\t]"+b+"\\.([0-9]{2})"),name:"pointeddate2",callback:function(e,t,r,n){return this.ymd(P(n),r-1,+t)}},timeLong24:{regex:RegExp("^t?"+i+"[:.]"+a+"[:.]"+c),name:"timelong24",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},dateNoColon:{regex:RegExp("^"+v+w+T),name:"datenocolon",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},pgydotd:{regex:RegExp("^"+v+"\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),name:"pgydotd",callback:function(e,t,r){return this.ymd(+t,0,+r)}},timeShort24:{regex:RegExp("^t?"+i+"[:.]"+a,"i"),name:"timeshort24",callback:function(e,t,r){return this.time(+t,+r,0,0)}},iso8601noColon:{regex:RegExp("^t?"+o+p+l,"i"),name:"iso8601nocolon",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},iso8601dateSlash:{regex:RegExp("^"+v+"/"+w+"/"+T+"/"),name:"iso8601dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},dateSlash:{regex:RegExp("^"+v+"/"+b+"/"+k),name:"dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},american:{regex:RegExp("^"+b+"/"+k+"/"+x),name:"american",callback:function(e,t,r,n){return this.ymd(P(n),t-1,+r)}},americanShort:{regex:RegExp("^"+b+"/"+k),name:"americanshort",callback:function(e,t,r){return this.ymd(this.y,t-1,+r)}},gnuDateShortOrIso8601date2:{regex:RegExp("^"+x+"-"+b+"-"+k),name:"gnudateshort | iso8601date2",callback:function(e,t,r,n){return this.ymd(P(t),r-1,+n)}},iso8601date4:{regex:RegExp("^([+-]?[0-9]{4})-"+w+"-"+T),name:"iso8601date4",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},gnuNoColon:{regex:RegExp("^t?"+o+p,"i"),name:"gnunocolon",callback:function(e,t,r){switch(this.times){case 0:return this.time(+t,+r,0,this.f);case 1:return this.y=100*t+ +r,this.times++,!0;default:return!1}}},gnuDateShorter:{regex:RegExp("^"+v+"-"+b),name:"gnudateshorter",callback:function(e,t,r){return this.ymd(+t,r-1,1)}},pgTextReverse:{regex:RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-("+S+")-"+T,"i"),name:"pgtextreverse",callback:function(e,t,r,n){return this.ymd(P(t),_(r),+n)}},dateFull:{regex:RegExp("^"+k+"[ \\t.-]*"+E+"[ \\t.-]*"+x,"i"),name:"datefull",callback:function(e,t,r,n){return this.ymd(P(n),_(r),+t)}},dateNoDay:{regex:RegExp("^"+E+"[ .\\t-]*"+v,"i"),name:"datenoday",callback:function(e,t,r){return this.ymd(+r,_(t),1)}},dateNoDayRev:{regex:RegExp("^"+v+"[ .\\t-]*"+E,"i"),name:"datenodayrev",callback:function(e,t,r){return this.ymd(+t,_(r),1)}},pgTextShort:{regex:RegExp("^("+S+")-"+T+"-"+x,"i"),name:"pgtextshort",callback:function(e,t,r,n){return this.ymd(P(n),_(t),+r)}},dateNoYear:{regex:RegExp("^"+O,"i"),name:"datenoyear",callback:function(e,t,r){return this.ymd(this.y,_(t),+r)}},dateNoYearRev:{regex:RegExp("^"+k+"[ .\\t-]*"+E,"i"),name:"datenoyearrev",callback:function(e,t,r){return this.ymd(this.y,_(r),+t)}},isoWeekDay:{regex:RegExp("^"+v+"-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),name:"isoweekday | isoweek",callback:function(e,t,r,n){if(n=n?+n:1,!this.ymd(+t,0,1))return!1;var i=new Date(this.y,this.m,this.d).getDay();i=0-(i>4?i-7:i),this.rd+=i+7*(r-1)+n}},relativeText:{regex:RegExp("^("+y+"|"+g+")"+t+"("+m+")","i"),name:"relativetext",callback:function(e,t,r){var n={last:-1,previous:-1,this:0,first:1,next:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eight:8,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12}[t.toLowerCase()];switch(r.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=n;break;case"min":case"mins":case"minute":case"minutes":this.ri+=n;break;case"hour":case"hours":this.rh+=n;break;case"day":case"days":this.rd+=n;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*n;break;case"week":case"weeks":this.rd+=7*n;break;case"month":case"months":this.rm+=n;break;case"year":case"years":this.ry+=n;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(r,7),this.weekdayBehavior=1,this.rd+=7*(n>0?n-1:n)}}},relative:{regex:RegExp("^([+-]*)[ \\t]*(\\d+)"+r+"("+m+"|week)","i"),name:"relative",callback:function(e,t,r,n){var i=t.replace(/[^-]/g,"").length,o=+r*Math.pow(-1,i);switch(n.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=o;break;case"min":case"mins":case"minute":case"minutes":this.ri+=o;break;case"hour":case"hours":this.rh+=o;break;case"day":case"days":this.rd+=o;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*o;break;case"week":case"weeks":this.rd+=7*o;break;case"month":case"months":this.rm+=o;break;case"year":case"years":this.ry+=o;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(n,7),this.weekdayBehavior=1,this.rd+=7*(o>0?o-1:o)}}},dayText:{regex:RegExp("^("+d+")","i"),name:"daytext",callback:function(e,t){this.resetTime(),this.weekday=R(t,0),2!==this.weekdayBehavior&&(this.weekdayBehavior=1)}},relativeTextWeek:{regex:RegExp("^("+g+")"+t+"week","i"),name:"relativetextweek",callback:function(e,t){switch(this.weekdayBehavior=2,t.toLowerCase()){case"this":this.rd+=0;break;case"next":this.rd+=7;break;case"last":case"previous":this.rd-=7}isNaN(this.weekday)&&(this.weekday=1)}},monthFullOrMonthAbbr:{regex:RegExp("^("+A+"|"+S+")","i"),name:"monthfull | monthabbr",callback:function(e,t){return this.ymd(this.y,_(t),this.d)}},tzCorrection:{regex:RegExp("^"+j,"i"),name:"tzcorrection",callback:function(e){return this.zone(M(e))}},tzAbbr:{regex:RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),name:"tzabbr",callback:function(e,t){var r=C[t.toLowerCase()];return!isNaN(r)&&this.zone(r)}},ago:{regex:/^ago/i,name:"ago",callback:function(){this.ry=-this.ry,this.rm=-this.rm,this.rd=-this.rd,this.rh=-this.rh,this.ri=-this.ri,this.rs=-this.rs,this.rf=-this.rf}},year4:{regex:RegExp("^"+v),name:"year4",callback:function(e,t){return this.y=+t,!0}},whitespace:{regex:/^[ .,\t]+/,name:"whitespace"},dateShortWithTimeLong:{regex:RegExp("^"+O+"t?"+i+"[:.]"+a+"[:.]"+c,"i"),name:"dateshortwithtimelong",callback:function(e,t,r,n,i,o){return this.ymd(this.y,_(t),+r)&&this.time(+n,+i,+o,0)}},dateShortWithTimeLong12:{regex:RegExp("^"+O+s+"[:.]"+a+"[:.]"+l+r+n,"i"),name:"dateshortwithtimelong12",callback:function(e,t,r,n,i,o,s){return this.ymd(this.y,_(t),+r)&&this.time(N(+n,s),+i,+o,0)}},dateShortWithTimeShort:{regex:RegExp("^"+O+"t?"+i+"[:.]"+a,"i"),name:"dateshortwithtimeshort",callback:function(e,t,r,n,i){return this.ymd(this.y,_(t),+r)&&this.time(+n,+i,0,0)}},dateShortWithTimeShort12:{regex:RegExp("^"+O+s+"[:.]"+p+r+n,"i"),name:"dateshortwithtimeshort12",callback:function(e,t,r,n,i,o){return this.ymd(this.y,_(t),+r)&&this.time(N(+n,o),+i,0,0)}}},F={y:NaN,m:NaN,d:NaN,h:NaN,i:NaN,s:NaN,f:NaN,ry:0,rm:0,rd:0,rh:0,ri:0,rs:0,rf:0,weekday:NaN,weekdayBehavior:0,firstOrLastDayOfMonth:0,z:NaN,dates:0,times:0,zones:0,ymd:function(e,t,r){return!(this.dates>0||(this.dates++,this.y=e,this.m=t,this.d=r,0))},time:function(e,t,r,n){return!(this.times>0||(this.times++,this.h=e,this.i=t,this.s=r,this.f=n,0))},resetTime:function(){return this.h=0,this.i=0,this.s=0,this.f=0,this.times=0,!0},zone:function(e){return this.zones<=1&&(this.zones++,this.z=e,!0)},toDate:function(e){switch(this.dates&&!this.times&&(this.h=this.i=this.s=this.f=0),isNaN(this.y)&&(this.y=e.getFullYear()),isNaN(this.m)&&(this.m=e.getMonth()),isNaN(this.d)&&(this.d=e.getDate()),isNaN(this.h)&&(this.h=e.getHours()),isNaN(this.i)&&(this.i=e.getMinutes()),isNaN(this.s)&&(this.s=e.getSeconds()),isNaN(this.f)&&(this.f=e.getMilliseconds()),this.firstOrLastDayOfMonth){case 1:this.d=1;break;case-1:this.d=0,this.m+=1}if(!isNaN(this.weekday)){var t=new Date(e.getTime());t.setFullYear(this.y,this.m,this.d),t.setHours(this.h,this.i,this.s,this.f);var r=t.getDay();if(2===this.weekdayBehavior)0===r&&0!==this.weekday&&(this.weekday=-6),0===this.weekday&&0!==r&&(this.weekday=7),this.d-=r,this.d+=this.weekday;else{var n=this.weekday-r;(this.rd<0&&n<0||this.rd>=0&&n<=-this.weekdayBehavior)&&(n+=7),this.weekday>=0?this.d+=n:this.d-=7-(Math.abs(this.weekday)-r),this.weekday=NaN}}this.y+=this.ry,this.m+=this.rm,this.d+=this.rd,this.h+=this.rh,this.i+=this.ri,this.s+=this.rs,this.f+=this.rf,this.ry=this.rm=this.rd=0,this.rh=this.ri=this.rs=this.rf=0;var i=new Date(e.getTime());switch(i.setFullYear(this.y,this.m,this.d),i.setHours(this.h,this.i,this.s,this.f),this.firstOrLastDayOfMonth){case 1:i.setDate(1);break;case-1:i.setMonth(i.getMonth()+1,0)}return isNaN(this.z)||i.getTimezoneOffset()===this.z||(i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate()),i.setUTCHours(i.getHours(),i.getMinutes(),i.getSeconds()-this.z,i.getMilliseconds())),i}};e.exports=function(e,t){null==t&&(t=Math.floor(Date.now()/1e3));for(var r=[D.yesterday,D.now,D.noon,D.midnightOrToday,D.tomorrow,D.timestamp,D.firstOrLastDay,D.backOrFrontOf,D.timeTiny12,D.timeShort12,D.timeLong12,D.mssqltime,D.timeShort24,D.timeLong24,D.iso8601long,D.gnuNoColon,D.iso8601noColon,D.americanShort,D.american,D.iso8601date4,D.iso8601dateSlash,D.dateSlash,D.gnuDateShortOrIso8601date2,D.gnuDateShorter,D.dateFull,D.pointedDate4,D.pointedDate2,D.dateNoDay,D.dateNoDayRev,D.dateTextual,D.dateNoYear,D.dateNoYearRev,D.dateNoColon,D.xmlRpc,D.xmlRpcNoColon,D.soap,D.wddx,D.exif,D.pgydotd,D.isoWeekDay,D.pgTextShort,D.pgTextReverse,D.clf,D.year4,D.ago,D.dayText,D.relativeTextWeek,D.relativeText,D.monthFullOrMonthAbbr,D.tzCorrection,D.tzAbbr,D.dateShortWithTimeShort12,D.dateShortWithTimeLong12,D.dateShortWithTimeShort,D.dateShortWithTimeLong,D.relative,D.whitespace],n=Object.create(F);e.length;){for(var i=null,o=null,s=0,a=r.length;si[0].length)&&(i=c,o=p)}if(!o||o.callback&&!1===o.callback.apply(n,i))return!1;e=e.substr(i[0].length),o=null,i=null}return Math.floor(n.toDate(new Date(1e3*t))/1e3)}},673:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(){var e,r=void 0,n=void 0,i=0,o=arguments,s=o.length,a=function(e){if("[object Array]"===Object.prototype.toString.call(e))return e;var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},p=function e(r,n){var i=0,o=0,s=0,p=0,c=0;if(r===n)return 0;if("object"===(void 0===r?"undefined":t(r))){if("object"===(void 0===n?"undefined":t(n))){if(r=a(r),n=a(n),c=r.length,(p=n.length)>c)return 1;if(p0?1:-1:n===r?0:n>r?1:-1};if(0===s)throw new Error("At least one value should be passed to max()");if(1===s){if("object"!==t(o[0]))throw new Error("Wrong parameter count for max()");if(0===(r=a(o[0])).length)throw new Error("Array must contain at least one element for max()")}else r=o;for(n=r[0],i=1,e=r.length;i{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(){var e,r=void 0,n=void 0,i=0,o=arguments,s=o.length,a=function(e){if("[object Array]"===Object.prototype.toString.call(e))return e;var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},p=function e(r,n){var i=0,o=0,s=0,p=0,c=0;if(r===n)return 0;if("object"===(void 0===r?"undefined":t(r))){if("object"===(void 0===n?"undefined":t(n))){if(r=a(r),n=a(n),c=r.length,(p=n.length)>c)return 1;if(p0?1:-1:n===r?0:n>r?1:-1};if(0===s)throw new Error("At least one value should be passed to min()");if(1===s){if("object"!==t(o[0]))throw new Error("Wrong parameter count for min()");if(0===(r=a(o[0])).length)throw new Error("Array must contain at least one element for min()")}else r=o;for(n=r[0],i=1,e=r.length;i{"use strict";function n(e,t){var r=Math.floor(Math.abs(e)+.5);return("PHP_ROUND_HALF_DOWN"===t&&e===r-.5||"PHP_ROUND_HALF_EVEN"===t&&e===.5+2*Math.floor(r/2)||"PHP_ROUND_HALF_ODD"===t&&e===.5+2*Math.floor(r/2)-1)&&(r-=1),e<0?-r:r}e.exports=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"PHP_ROUND_HALF_UP",s=r(892),a=r(791);if(e=s(e),i=a(i),t=Math.pow(10,i),isNaN(e)||!isFinite(e))return e;if(Math.trunc(e)===e&&i>=0)return e;var p=14-Math.floor(Math.log10(Math.abs(e)));return p>i&&p-15{"use strict";e.exports=function(){var e=arguments,t=0,r=e[t++],n=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":new Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},i=function(e,t,r,i,o){var s=i-e.length;return s>0&&(e=r||"0"!==o?n(e,i,o,r):[e.slice(0,t.length),n("",s,"0",!0),e.slice(t.length)].join("")),e},o=function(e,t,r,o,s,a){return e=n((e>>>0).toString(t),s||0,"0",!1),i(e,"",r,o,a)},s=function(e,t,r,n,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,o)};try{return r.replace(/%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g,(function(r,a,p,c,l,u){var h=void 0,f=void 0,d=void 0,y=void 0,g=void 0;if("%%"===r)return"%";var m,x=" ",v=!1,b="",w=void 0;for(w=0,m=p.length;w-1?6:void 0,a&&0==+a)throw new Error("Argument number must be greater than zero");if(a&&+a>=e.length)throw new Error("Too few arguments");switch(g=a?e[+a]:e[t++],u){case"%":return"%";case"s":return s(g+"",v,c,l,x);case"c":return s(String.fromCharCode(+g),v,c,l,x);case"b":return o(g,2,v,c,l,x);case"o":return o(g,8,v,c,l,x);case"x":return o(g,16,v,c,l,x);case"X":return o(g,16,v,c,l,x).toUpperCase();case"u":return o(g,10,v,c,l,x);case"i":case"d":return h=+g||0,g=(f=(h=Math.round(h-h%1))<0?"-":b)+n(String(Math.abs(h)),l,"0",!1),v&&"0"===x&&(x=" "),i(g,f,v,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return f=(h=+g)<0?"-":b,d=["toExponential","toFixed","toPrecision"]["efg".indexOf(u.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(u)%2],g=f+Math.abs(h)[d](l),i(g,f,v,c,x)[y]();default:return""}}))}catch(e){return!1}}},359:(e,t,r)=>{"use strict";e.exports=function(e,t){var n=r(521);t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var i=/<\/?([a-z0-9]*)\b[^>]*>?/gi,o=/|<\?(?:php)?[\s\S]*?\?>/gi,s=n(e);for(s="<"===s.substring(s.length-1)?s.substring(0,s.length-1):s;;){var a=s;if(s=a.replace(o,"").replace(i,(function(e,r){return t.indexOf("<"+r.toLowerCase()+">")>-1?e:""})),a===s)return s}}},436:(e,t,r)=>{"use strict";e.exports=function(e,t){return r(296).apply(this,[e].concat(t))}},315:e=>{"use strict";e.exports=function(e){return!1!==e&&0!==e&&0!==e&&""!==e&&"0"!==e&&(!Array.isArray(e)||0!==e.length)&&null!=e}},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a2){var p=n.lastIndexOf("/");if(p!==n.length-1){-1===p?(n="",i=0):i=(n=n.slice(0,p)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;ic){if(47===r.charCodeAt(a+u))return r.slice(a+u+1);if(0===u)return r.slice(a+u)}else s>c&&(47===e.charCodeAt(i+u)?l=u:0===u&&(l=0));break}var h=e.charCodeAt(i+u);if(h!==r.charCodeAt(a+u))break;47===h&&(l=u)}var f="";for(u=i+l+1;u<=o;++u)u!==o&&47!==e.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(a+l):(a+=l,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,p=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===p&&(s=!1,p=n+1),a>=0&&(c===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=p))}return i===o?o=p:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var p=e.charCodeAt(a);if(47!==p)-1===i&&(o=!1,i=a+1),46===p?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,p=-1,c=!0,l=e.length-1,u=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(c=!1,p=l+1),46===i?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){a=l+1;break}return-1===s||-1===p||0===u||1===u&&s===p-1&&s===a+1?-1!==p&&(r.base=r.name=0===a&&o?e.slice(1,p):e.slice(a,p)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,p)):(r.name=e.slice(a,s),r.base=e.slice(a,p)),r.ext=e.slice(s,p)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},351:()=>{}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(209);var e,t},e.exports=t()},860:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad"},o=n.twig({id:"src/views/partials/header.twig",data:[{type:"raw",value:"\n
    Header: ",position:{start:43,end:57}},{type:"output",position:{start:57,end:71},stack:[{type:"Twig.expression.type.variable",value:"headline",match:["headline"],position:{start:57,end:71}}]},{type:"raw",value:"
    \n",position:{start:71,end:78}},{type:"raw",value:"\n
    Lang: ",position:{start:146,end:158}},{type:"output",position:{start:158,end:168},stack:[{type:"Twig.expression.type.variable",value:"lang",match:["lang"],position:{start:158,end:168}}]},{type:"raw",value:"
    \n",position:{start:168,end:168}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign(i,e))},175:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad",lang:"en"},o=n.twig({id:"src/views/partials/people.twig",data:[{type:"raw",value:"\n",position:{start:33,end:34}},{type:"logic",token:{type:"Twig.logic.type.include",only:!1,ignoreMissing:!1,stack:[{type:"Twig.expression.type.string",value:"src/views/partials/header.twig"}],position:{start:34,end:61}},position:{start:34,end:61}},{type:"raw",value:"\n",position:{start:62,end:63}},{type:"raw",value:'\n
      \n ',position:{start:98,end:120}},{type:"logic",token:{type:"Twig.logic.type.for",keyVar:null,valueVar:"item",expression:[{type:"Twig.expression.type.variable",value:"people",match:["people"]}],position:{start:120,end:144},output:[{type:"raw",value:"
    • ",position:{start:145,end:157}},{type:"output",position:{start:157,end:167},stack:[{type:"Twig.expression.type.variable",value:"item",match:["item"],position:{start:157,end:167}}]},{type:"raw",value:"
    • \n ",position:{start:167,end:177}}]},position:{open:{start:120,end:144},close:{start:177,end:189}}},{type:"raw",value:"
    \n\n",position:{start:190,end:197}},{type:"raw",value:"\n",position:{start:234,end:235}},{type:"logic",token:{type:"Twig.logic.type.include",only:!1,ignoreMissing:!1,stack:[{type:"Twig.expression.type.string",value:"src/views/partials/star.twig"}],position:{start:235,end:270}},position:{start:235,end:270}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign(i,e))},197:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad"},o=n.twig({id:"src/views/partials/star.twig",data:[{type:"raw",value:'
    ++ Included partial ++
    \n',position:{start:0,end:0}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign(i,e))},487:(e,t,r)=>{"use strict";e.exports=r.p+"img/stern.6adb226f.svg"}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(175);const t=r.n(e)()({people:["Walter White","Jesse Pinkman"]});document.getElementById("content").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file +(()=>{var e={766:e=>{var t;self,t=()=>{return e={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{var n=r(228);e.exports=function(e){if(Array.isArray(e))return n(e)}},713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},319:(e,t,r)=>{var n=r(646),i=r(860),o=r(379),s=r(206);e.exports=function(e){return n(e)||i(e)||o(e)||s()}},8:e=>{function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t},379:(e,t,r)=>{var n=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},452:e=>{"use strict";e.exports=function(e){return e.ParseState.prototype.parseAsync=function(e,t){return this.parse(e,t,!0)},e.expression.parseAsync=function(t,r,n){return e.expression.parse.call(this,t,r,n,!0)},e.logic.parseAsync=function(t,r,n){return e.logic.parse.call(this,t,r,n,!0)},e.Template.prototype.renderAsync=function(e,t){return this.render(e,t,!0)},e.async={},e.isPromise=function(e){return e&&e.then&&"function"==typeof e.then},e.async.potentiallyAsync=function(t,r,n){return r?e.Promise.resolve(n.call(t)):function(t,r,n){var i=n.call(t),o=null,s=!0;if(!e.isPromise(i))return i;if(i.then((function(e){i=e,s=!1})).catch((function(e){o=e})),null!==o)throw o;if(s)throw new e.Error("You are using Twig.js in sync mode in combination with async extensions.");return i}(t,0,n)},e.Thenable=function(e,t,r){this.then=e,this._value=r?t:null,this._state=r||0},e.Thenable.prototype.catch=function(e){return 1===this._state?this:this.then(null,e)},e.Thenable.resolvedThen=function(t){try{return e.Promise.resolve(t(this._value))}catch(t){return e.Promise.reject(t)}},e.Thenable.rejectedThen=function(t,r){if(!r||"function"!=typeof r)return this;var n,i=this._value;try{n=r(i)}catch(t){n=e.Promise.reject(t)}return e.Promise.resolve(n)},e.Promise=function(t){var r=0,n=null,i=function(e,t){r=e,n=t};return function(e,t,r){try{e((function(e){i(1,e)}),r)}catch(e){r(e)}}(t,0,(function(e){i(2,e)})),1===r?e.Promise.resolve(n):2===r?e.Promise.reject(n):(i=new e.FullPromise).promise},e.FullPromise=function(){var t=null;function r(e){e(s._value)}function n(e,t){t(s._value)}var i=function(e,r){t=function(e,t,r){var n=[t,r,-2];return e?-2===e[2]?e=[e,n]:e.push(n):e=n,e}(t,e,r)};function o(e,o){if(!s._state&&(s._value=o,s._state=e,i=1===e?r:n,t)){if(-2===t[2])return i(t[0],t[1]),void(t=null);t.forEach((function(e){i(e[0],e[1])})),t=null}}var s=new e.Thenable((function(t,r){var n="function"==typeof t;if(1===s._state&&!n)return e.Promise.resolve(s._value);if(1===s._state)try{return e.Promise.resolve(t(s._value))}catch(t){return e.Promise.reject(t)}var o="function"==typeof r;return new e.Promise((function(e,s){i(n?function(r){try{e(t(r))}catch(e){s(e)}}:e,o?function(t){try{e(r(t))}catch(e){s(e)}}:s)}))}));return o.promise=s,o},e.Promise.defaultResolved=new e.Thenable(e.Thenable.resolvedThen,void 0,1),e.Promise.emptyStringResolved=new e.Thenable(e.Thenable.resolvedThen,"",1),e.Promise.resolve=function(t){return 0===arguments.length||void 0===t?e.Promise.defaultResolved:e.isPromise(t)?t:""===t?e.Promise.emptyStringResolved:new e.Thenable(e.Thenable.resolvedThen,t,1)},e.Promise.reject=function(t){return new e.Thenable(e.Thenable.rejectedThen,t,2)},e.Promise.all=function(t){var r=new Array(t.length);return e.async.forEach(t,(function(t,n){if(e.isPromise(t)){if(1!==t._state)return t.then((function(e){r[n]=e}));r[n]=t._value}else r[n]=t})).then((function(){return r}))},e.async.forEach=function(t,r){var n=t?t.length:0,i=0;return function o(){var s=null;do{if(i===n)return e.Promise.resolve();s=r(t[i],i),i++}while(!s||!e.isPromise(s)||1===s._state);return s.then(o)}()},e}},383:e=>{"use strict";e.exports=function(e){return e.compiler={module:{}},e.compiler.compile=function(t,r){var n=JSON.stringify(t.tokens),i=t.id,o=null;if(r.module){if(void 0===e.compiler.module[r.module])throw new e.Error("Unable to find module type "+r.module);o=e.compiler.module[r.module](i,n,r.twig)}else o=e.compiler.wrap(i,n);return o},e.compiler.module={amd:function(t,r,n){return'define(["'+n+'"], function (Twig) {\n\tvar twig, templates;\ntwig = Twig.twig;\ntemplates = '+e.compiler.wrap(t,r)+"\n\treturn templates;\n});"},node:function(t,r){return'var twig = require("twig").twig;\nexports.template = '+e.compiler.wrap(t,r)},cjs2:function(t,r,n){return'module.declare([{ twig: "'+n+'" }], function (require, exports, module) {\n\tvar twig = require("twig").twig;\n\texports.template = '+e.compiler.wrap(t,r)+"\n});"}},e.compiler.wrap=function(e,t){return'twig({id:"'+e.replace('"','\\"')+'", data:'+t+", precompiled: true});\n"},e}},181:(e,t,r)=>{"use strict";var n=r(318)(r(713));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0&&n.open.length!==n.close.length&&o<0||(i>=0&&(null===s.position||i=0&&null!==s.position&&i===s.position&&(n.open.length>s.def.open.length?(s.position=i,s.def=n,a=o):n.open.length===s.def.open.length&&(n.close.length,s.def.close.length,o>=0&&o=0))throw new e.Error("Unable to find closing bracket '"+r.close+"' opened near template position "+n);if(s=u,a=!0,r.type===e.token.type.comment)break;if(r.type===e.token.type.raw)break;for(o=e.token.strings.length,i=0;i0&&f0;)if(i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),null===i.position)r.push({type:e.token.type.raw,value:t,position:{start:n,end:n+i.position}}),t="";else{if(i.position>0&&r.push({type:e.token.type.raw,value:t.slice(0,Math.max(0,i.position)),position:{start:n,end:n+Math.max(0,i.position)}}),t=t.slice(i.position+i.def.open.length),n+=i.position+i.def.open.length,o=e.token.findEnd(t,i.def,n),e.log.trace("Twig.tokenize: ","Token ends at ",o),r.push({type:i.def.type,value:t.slice(0,Math.max(0,o)).trim(),position:{start:n-i.def.open.length,end:n+o+i.def.close.length}}),"\n"===t.slice(o+i.def.close.length,o+i.def.close.length+1))switch(i.def.type){case"logic_whitespace_pre":case"logic_whitespace_post":case"logic_whitespace_both":case"logic":o+=1}t=t.slice(o+i.def.close.length),n+=o+i.def.close.length}return r},e.compile=function(t){var r=this;try{for(var n=[],i=[],o=[],s=null,a=null,p=null,c=null,l=null,u=null,h=null,f=null,d=null,y=null,g=null,m=function(t){e.expression.compile.call(r,t),i.length>0?o.push(t):n.push(t)},x=function(t){if((a=e.logic.compile.call(r,t)).position=t.position,d=a.type,y=e.logic.handler[d].open,g=e.logic.handler[d].next,e.log.trace("Twig.compile: ","Compiled logic token to ",a," next is: ",g," open is : ",y),void 0!==y&&!y){if(c=i.pop(),!e.logic.handler[c.type].next.includes(d))throw new Error(d+" not expected after a "+c.type);c.output=c.output||[],c.output=c.output.concat(o),o=[],f={type:e.token.type.logic,token:c,position:{open:c.position,close:t.position}},i.length>0?o.push(f):n.push(f)}void 0!==g&&g.length>0?(e.log.trace("Twig.compile: ","Pushing ",a," to logic stack."),i.length>0&&((c=i.pop()).output=c.output||[],c.output=c.output.concat(o),i.push(c),o=[]),i.push(a)):void 0!==y&&y&&(f={type:e.token.type.logic,token:a,position:a.position},i.length>0?o.push(f):n.push(f))};t.length>0;){switch(s=t.shift(),l=n[n.length-1],u=o[o.length-1],h=t[0],e.log.trace("Compiling token ",s),s.type){case e.token.type.raw:i.length>0?o.push(s):n.push(s);break;case e.token.type.logic:x.call(r,s);break;case e.token.type.comment:break;case e.token.type.output:m.call(r,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:switch(s.type!==e.token.type.outputWhitespacePost&&s.type!==e.token.type.logicWhitespacePost&&(l&&l.type===e.token.type.raw&&(n.pop(),l.value=l.value.trimEnd(),n.push(l)),u&&u.type===e.token.type.raw&&(o.pop(),u.value=u.value.trimEnd(),o.push(u))),s.type){case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:m.call(r,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:x.call(r,s)}s.type!==e.token.type.outputWhitespacePre&&s.type!==e.token.type.logicWhitespacePre&&h&&h.type===e.token.type.raw&&(t.shift(),h.value=h.value.trimStart(),t.unshift(h))}e.log.trace("Twig.compile: "," Output: ",n," Logic Stack: ",i," Pending Output: ",o)}if(i.length>0)throw p=i.pop(),new Error("Unable to find an end tag for "+p.type+", expecting one of "+p.next);return n}catch(t){if(r.options.rethrow)throw"TwigException"!==t.type||t.file||(t.file=r.id),t;e.log.error("Error compiling twig template "+r.id+": "),t.stack?e.log.error(t.stack):e.log.error(t.toString())}},e.prepare=function(t){e.log.debug("Twig.prepare: ","Tokenizing ",t);var r=e.tokenize.call(this,t);e.log.debug("Twig.prepare: ","Compiling ",r);var n=e.compile.call(this,r);return e.log.debug("Twig.prepare: ","Compiled ",n),n},e.output=function(t){var r=this.options.autoescape;if(!r)return t.join("");var n="string"==typeof r?r:"html",i=t.map((function(t){return!t||!0===t.twigMarkup||t.twigMarkup===n||"html"===n&&"html_attr"===t.twigMarkup||(t=e.filters.escape(t,[n])),t}));if(0===i.length)return"";var o=i.join("");return 0===o.length?"":new e.Markup(o,!0)},e.Templates={loaders:{},parsers:{},registry:{}},e.validateId=function(t){if("prototype"===t)throw new e.Error(t+" is not a valid twig identifier");if(e.cache&&Object.hasOwnProperty.call(e.Templates.registry,t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.registerLoader=function(t,r,n){if("function"!=typeof r)throw new e.Error("Unable to add loader for "+t+": Invalid function reference given.");n&&(r=r.bind(n)),this.loaders[t]=r},e.Templates.unRegisterLoader=function(e){this.isRegisteredLoader(e)&&delete this.loaders[e]},e.Templates.isRegisteredLoader=function(e){return Object.hasOwnProperty.call(this.loaders,e)},e.Templates.registerParser=function(t,r,n){if("function"!=typeof r)throw new e.Error("Unable to add parser for "+t+": Invalid function regerence given.");n&&(r=r.bind(n)),this.parsers[t]=r},e.Templates.unRegisterParser=function(e){this.isRegisteredParser(e)&&delete this.parsers[e]},e.Templates.isRegisteredParser=function(e){return Object.hasOwnProperty.call(this.parsers,e)},e.Templates.save=function(t){if(void 0===t.id)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return Object.hasOwnProperty.call(e.Templates.registry,t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,r,n,i){var o=void 0===r.id?t:r.id,s=e.Templates.registry[o];return e.cache&&void 0!==s?("function"==typeof n&&n(s),s):(r.parser=r.parser||"twig",r.id=o,void 0===r.async&&(r.async=!0),(this.loaders[r.method]||this.loaders.fs).call(this,t,r,n,i))},e.Block=function(e,t){this.template=e,this.token=t},e.Block.prototype.render=function(t,r){var n=t.template;return t.template=this.template,(this.token.expression?e.expression.parseAsync.call(t,this.token.output,r):t.parseAsync(this.token.output,r)).then((function(n){return e.expression.parseAsync.call(t,{type:e.expression.type.string,value:n},r)})).then((function(e){return t.template=n,e}))},e.ParseState=function(e,t,r){this.renderedBlocks={},this.overrideBlocks=void 0===t?{}:t,this.context=void 0===r?{}:r,this.macros={},this.nestingStack=[],this.template=e},e.ParseState.prototype.getBlock=function(e,t){var r;return!0!==t&&(r=this.overrideBlocks[e]),void 0===r&&(r=this.template.getBlock(e,t)),void 0===r&&null!==this.template.parentTemplate&&(r=this.template.parentTemplate.getBlock(e)),r},e.ParseState.prototype.getBlocks=function(e){var t={};return!1!==e&&null!==this.template.parentTemplate&&this.template.parentTemplate!==this.template&&(t=this.template.parentTemplate.getBlocks()),o(o(o({},t),this.template.getBlocks()),this.overrideBlocks)},e.ParseState.prototype.getNestingStackToken=function(e){var t;return this.nestingStack.forEach((function(r){void 0===t&&r.type===e&&(t=r)})),t},e.ParseState.prototype.parse=function(r,n,i){var o,s=this,a=[],p=null,c=!0,l=!0;function u(e){a.push(e)}function h(e){void 0!==e.chain&&(l=e.chain),void 0!==e.context&&(s.context=e.context),void 0!==e.output&&a.push(e.output)}if(n&&(s.context=n),o=e.async.forEach(r,(function(t){switch(e.log.debug("Twig.ParseState.parse: ","Parsing token: ",t),t.type){case e.token.type.raw:a.push(e.filters.raw(t.value));break;case e.token.type.logic:return e.logic.parseAsync.call(s,t.token,s.context,l).then(h);case e.token.type.comment:break;case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:case e.token.type.output:return e.log.debug("Twig.ParseState.parse: ","Output token: ",t.stack),e.expression.parseAsync.call(s,t.stack,s.context).then(u)}})).then((function(){return a=e.output.call(s.template,a),c=!1,a})).catch((function(e){i&&t(s,e),p=e})),i)return o;if(null!==p)return t(s,p);if(c)throw new e.Error("You are using Twig.js in sync mode in combination with async extensions.");return a},e.Template=function(t){var r,n,i=t.data,o=t.id,s=t.base,a=t.path,p=t.url,c=t.name,l=t.method,u=t.options;this.base=s,this.blocks={defined:{},imported:{}},this.id=o,this.method=l,this.name=c,this.options=u,this.parentTemplate=null,this.path=a,this.url=p,r=i,n=Object.prototype.toString.call(r).slice(8,-1),this.tokens=null!=r&&"String"===n?e.prepare.call(this,i):i,void 0!==o&&e.Templates.save(this)},e.Template.prototype.getBlock=function(e,t){var r,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!0!==t&&(r=this.blocks.defined[e]),n&&void 0===r&&(r=this.blocks.imported[e]),void 0===r&&null!==this.parentTemplate&&(r=this.parentTemplate.getBlock(e,t,n=!1)),r},e.Template.prototype.getBlocks=function(){return o(o(o({},{}),this.blocks.imported),this.blocks.defined)},e.Template.prototype.render=function(t,r,n){var i=this;return r=r||{},e.async.potentiallyAsync(i,n,(function(){var n=new e.ParseState(i,r.blocks,t);return n.parseAsync(i.tokens).then((function(t){var o,s;return null!==i.parentTemplate?(i.options.allowInlineIncludes&&(o=e.Templates.load(i.parentTemplate))&&(o.options=i.options),o||(s=e.path.parsePath(i,i.parentTemplate),o=e.Templates.loadRemote(s,{method:i.getLoaderMethod(),base:i.base,async:!1,id:s,options:i.options})),i.parentTemplate=o,i.parentTemplate.renderAsync(n.context,{blocks:n.getBlocks(!1),isInclude:!0})):!0===r.isInclude?t:t.valueOf()}))}))},e.Template.prototype.importFile=function(t){var r,n=null;if(!this.url&&this.options.allowInlineIncludes){if(t=this.path?e.path.parsePath(this,t):t,!(r=e.Templates.load(t))&&!(r=e.Templates.loadRemote(n,{id:t,method:this.getLoaderMethod(),async:!1,path:t,options:this.options})))throw new e.Error("Unable to find the template "+t);return r.options=this.options,r}return n=e.path.parsePath(this,t),e.Templates.loadRemote(n,{method:this.getLoaderMethod(),base:this.base,async:!1,options:this.options,id:n})},e.Template.prototype.getLoaderMethod=function(){return this.path?"fs":this.url?"ajax":this.method||"fs"},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e.Markup=function(e,t){if("string"!=typeof e)return e;var r=new String(e);return r.twigMarkup=void 0===t||t,r},e}},858:e=>{"use strict";e.exports=function(e){return e.exports={VERSION:e.VERSION},e.exports.twig=function(t){var r=t.id,n={strictVariables:t.strict_variables||!1,autoescape:null!==t.autoescape&&t.autoescape||!1,allowInlineIncludes:t.allowInlineIncludes||!1,rethrow:t.rethrow||!1,namespaces:t.namespaces};if(e.cache&&r&&e.validateId(r),void 0!==t.debug&&(e.debug=t.debug),void 0!==t.trace&&(e.trace=t.trace),void 0!==t.data)return e.Templates.parsers.twig({data:t.data,path:Object.hasOwnProperty.call(t,"path")?t.path:void 0,module:t.module,id:r,options:n});if(void 0!==t.ref){if(void 0!==t.id)throw new e.Error("Both ref and id cannot be set on a twig.js template.");return e.Templates.load(t.ref)}if(void 0!==t.method){if(!e.Templates.isRegisteredLoader(t.method))throw new e.Error('Loader for "'+t.method+'" is not defined.');return e.Templates.loadRemote(t.name||t.href||t.path||r||void 0,{id:r,method:t.method,parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error)}return void 0!==t.href?e.Templates.loadRemote(t.href,{id:r,method:"ajax",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0!==t.path?e.Templates.loadRemote(t.path,{id:r,method:"fs",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0},e.exports.extendFilter=function(t,r){e.filter.extend(t,r)},e.exports.extendFunction=function(t,r){e._function.extend(t,r)},e.exports.extendTest=function(t,r){e.test.extend(t,r)},e.exports.extendTag=function(t){e.logic.extend(t)},e.exports.extend=function(t){t(e)},e.exports.compile=function(t,r){var n=r.filename,i=r.filename,o=new e.Template({data:t,path:i,id:n,options:r.settings["twig options"]});return function(e){return o.render(e)}},e.exports.renderFile=function(t,r,n){"function"==typeof r&&(n=r,r={});var i=(r=r||{}).settings||{},o=i["twig options"],s={path:t,base:i.views,load:function(e){o&&o.allowAsync?e.renderAsync(r).then((function(e){return n(null,e)}),n):n(null,String(e.render(r)))},error:function(e){n(e)}};if(o)for(var a in o)Object.hasOwnProperty.call(o,a)&&(s[a]=o[a]);e.exports.twig(s)},e.exports.__express=e.exports.renderFile,e.exports.cache=function(t){e.cache=t},e.exports.path=e.path,e.exports.filters=e.filters,e.exports.tests=e.tests,e.exports.functions=e.functions,e.exports.Promise=e.Promise,e}},769:(e,t,r)=>{"use strict";var n=r(318),i=n(r(8)),o=n(r(319));e.exports=function(e){function t(t,r,n){return r?e.expression.parseAsync.call(t,r,n):e.Promise.resolve(!1)}for(e.expression={},r(35)(e),e.expression.reservedWords=["true","false","null","TRUE","FALSE","NULL","_context","and","b-and","or","b-or","b-xor","in","not in","if","matches","starts","ends","with"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",slice:"Twig.expression.type.slice",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},subexpression:{start:"Twig.expression.type.subexpression.start",end:"Twig.expression.type.subexpression.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.subexpression.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start,e.expression.type.subexpression.start,e.expression.type.operator.unary]},e.expression.set.operationsExtended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets,e.expression.type.slice]),e.expression.fn={compile:{push:function(e,t,r){r.push(e)},pushBoth:function(e,t,r){r.push(e),t.push(e)}},parse:{push:function(e,t){t.push(e)},pushValue:function(e,t){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_]\w*(\s?(?:as|by))?)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,r.push(e)},parse:function(r,n,i){var o=n.pop();return t(this,r.params,i).then((function(t){var i=e.test(r.filter,o,t);"not"===r.modifier?n.push(!i):n.push(i)}))}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile:function(t,r,n){var i,o=r.length-1;for(delete t.match,delete t.value;o>=0;o--){if((i=r.pop()).type===e.expression.type.object.start||i.type===e.expression.type.parameter.start||i.type===e.expression.type.array.start){r.push(i);break}n.push(i)}n.push(t)}},{type:e.expression.type.number,regex:/^-?\d+(\.\d+)?/,next:e.expression.set.operations,compile:function(e,t,r){e.value=Number(e.value),r.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.operator.binary,regex:/(^\?\?|^\?:|^(b-and)|^(b-or)|^(b-xor)|^[+\-~%?]|^(<=>)|^[:](?!\d\])|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^(and)[(|\s+]|^(or)[(|\s+]|^(in)[(|\s+]|^(not in)[(|\s+]|^(matches)|^(starts with)|^(ends with)|^\.\.)/,next:e.expression.set.expressions,transform:function(e,t){switch(e[0]){case"and(":case"or(":case"in(":case"not in(":return t[t.length-1].value=e[2],e[0];default:return""}},compile:function(t,r,n){delete t.match,t.value=t.value.trim();var i=t.value,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);r.length>0&&(r[r.length-1].type===e.expression.type.operator.unary||r[r.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=r[r.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>r[r.length-1].precidence);){var s=r.pop();n.push(s)}if(":"===i)if(r[r.length-1]&&"?"===r[r.length-1].value);else{var a=n.pop();if(a.type===e.expression.type.string||a.type===e.expression.type.variable)t.key=a.value;else if(a.type===e.expression.type.number)t.key=a.value.toString();else{if(!a.expression||a.type!==e.expression.type.parameter.end&&a.type!==e.expression.type.subexpression.end)throw new e.Error("Unexpected value before ':' of "+a.type+" = "+a.value);t.params=a.params}n.push(t)}else r.push(o)},parse:function(t,r,n){if(t.key)r.push(t);else{if(t.params)return e.expression.parseAsync.call(this,t.params,n).then((function(e){t.key=e,r.push(t),n.loop||delete t.params}));e.expression.operator.parse(t.value,r)}}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile:function(t,r,n){delete t.match,t.value=t.value.trim();var i=t.value,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);r.length>0&&(r[r.length-1].type===e.expression.type.operator.unary||r[r.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=r[r.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>r[r.length-1].precidence);){var s=r.pop();n.push(s)}r.push(o)},parse:function(t,r){e.expression.operator.parse(t.value,r)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2[\s\S])*?\1/,next:e.expression.set.operationsExtended,compile:function(t,r,n){var i=t.value;delete t.match,i='"'===i.slice(0,1)?i.replace('\\"','"'):i.replace("\\'","'"),t.value=i.slice(1,-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),n.push(t)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.subexpression.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.subexpression.end]),compile:function(e,t,r){e.value="(",r.push(e),t.push(e)},parse:e.expression.fn.parse.push},{type:e.expression.type.subexpression.end,regex:/^\)/,next:e.expression.set.operationsExtended,validate:function(t,r){for(var n=r.length-1,i=!1,o=!1,s=0;!i&&n>=0;){var a=r[n];(i=a.type===e.expression.type.subexpression.start)&&o&&(o=!1,i=!1),a.type===e.expression.type.parameter.start?s++:a.type===e.expression.type.parameter.end?s--:a.type===e.expression.type.subexpression.end&&(o=!0),n--}return i&&0===s},compile:function(t,r,n){var i,o=t;for(i=r.pop();r.length>0&&i.type!==e.expression.type.subexpression.start;)n.push(i),i=r.pop();for(var s=[];t.type!==e.expression.type.subexpression.start;)s.unshift(t),t=n.pop();s.unshift(t),void 0===(i=r[r.length-1])||i.type!==e.expression.type._function&&i.type!==e.expression.type.filter&&i.type!==e.expression.type.test&&i.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,n.push(o)):(o.expression=!1,i.params=s)},parse:function(t,r,n){if(t.expression)return e.expression.parseAsync.call(this,t.params,n).then((function(e){r.push(e)}));throw new e.Error("Unexpected subexpression end when token is not marked as an expression")}},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),validate:function(t,r){var n=r[r.length-1];return n&&!e.expression.reservedWords.includes(n.value.trim())},compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operationsExtended,compile:function(t,r,n){var i,o=t;for(i=r.pop();r.length>0&&i.type!==e.expression.type.parameter.start;)n.push(i),i=r.pop();for(var s=[];t.type!==e.expression.type.parameter.start;)s.unshift(t),t=n.pop();s.unshift(t),void 0===(t=n[n.length-1])||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,n.push(o)):(o.expression=!1,t.params=s)},parse:function(t,r,n){var i=[],o=!1,s=null;if(t.expression)return e.expression.parseAsync.call(this,t.params,n).then((function(e){r.push(e)}));for(;r.length>0;){if((s=r.pop())&&s.type&&s.type===e.expression.type.parameter.start){o=!0;break}i.unshift(s)}if(!o)throw new e.Error("Expected end of parameter set.");r.push(i)}},{type:e.expression.type.slice,regex:/^\[(-?\w*:-?\w*)\]/,next:e.expression.set.operationsExtended,compile:function(e,t,r){var n=e.match[1].split(":"),i=n[0],o=n[1];e.value="slice",e.params=[i,o],o||(e.params=[i]),r.push(e)},parse:function(t,r,n){var i=r.pop(),o=t.params,s=this;if(parseInt(o[0],10).toString()===o[0])o[0]=parseInt(o[0],10);else{var a=n[o[0]];if(s.template.options.strictVariables&&void 0===a)throw new e.Error('Variable "'+o[0]+'" does not exist.');o[0]=a}if(o[1])if(parseInt(o[1],10).toString()===o[1])o[1]=parseInt(o[1],10);else{var p=n[o[1]];if(s.template.options.strictVariables&&void 0===p)throw new e.Error('Variable "'+o[1]+'" does not exist.');void 0===p?o=[o[0]]:o[1]=p}r.push(e.filter.call(s,t.value,i,o))}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operationsExtended,compile:function(t,r,n){for(var i,o=r.length-1;o>=0&&(i=r.pop()).type!==e.expression.type.array.start;o--)n.push(i);n.push(t)},parse:function(t,r){for(var n=[],i=!1,o=null;r.length>0;){if((o=r.pop())&&o.type&&o.type===e.expression.type.array.start){i=!0;break}n.unshift(o)}if(!i)throw new e.Error("Expected end of array.");r.push(n)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operationsExtended,compile:function(t,r,n){for(var i,o=r.length-1;o>=0&&(!(i=r.pop())||i.type!==e.expression.type.object.start);o--)n.push(i);n.push(t)},parse:function(t,r){for(var n={},i=!1,o=null,s=!1,a=null;r.length>0;){if((o=r.pop())&&o.type&&o.type===e.expression.type.object.start){i=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!s)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");n[o.key]=a,void 0===n._keys&&(n._keys=[]),n._keys.unshift(o.key),a=null,s=!1}else s=!0,a=o}if(!i)throw new e.Error("Unexpected end of object.");r.push(n)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_-]*)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.value=e.match[1],r.push(e)},parse:function(r,n,i){var o=n.pop(),s=this;return t(s,r.params,i).then((function(t){return e.filter.call(s,r.value,o,t)})).then((function(e){n.push(e)}))}},{type:e.expression.type._function,regex:/^([a-zA-Z_]\w*)\s*\(/,next:e.expression.type.parameter.start,validate:function(t){return t[1]&&!e.expression.reservedWords.includes(t[1])},transform:function(){return"("},compile:function(e,t,r){var n=e.match[1];e.fn=n,delete e.match,delete e.value,r.push(e)},parse:function(r,n,i){var s,a=this,p=r.fn;return t(a,r.params,i).then((function(t){if(e.functions[p])s=e.functions[p].apply(a,t);else{if("function"!=typeof i[p])throw new e.Error(p+" function does not exist and is not defined in the context");s=i[p].apply(i,(0,o.default)(t))}return s})).then((function(e){n.push(e)}))}},{type:e.expression.type.variable,regex:/^[a-zA-Z_]\w*/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:function(t){return!e.expression.reservedWords.includes(t[0])},parse:function(t,r,n){var i=this;return e.expression.resolveAsync.call(i,n[t.value],n).then((function(n){if(i.template.options.strictVariables&&void 0===n)throw new e.Error('Variable "'+t.value+'" does not exist.');r.push(n)}))}},{type:e.expression.type.key.period,regex:/^\.(\w+)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(e,t,r){e.key=e.match[1],delete e.match,delete e.value,r.push(e)},parse:function(r,n,o,s){var a,p=this,c=r.key,l=n.pop();if(l&&!Object.prototype.hasOwnProperty.call(l,c)&&p.template.options.strictVariables)throw Object.keys(l).length>0?new e.Error('Key "'+c+'" for object with keys "'+Object.keys(l).join(", ")+'" does not exist.'):new e.Error('Key "'+c+'" does not exist as the object is empty.');return t(p,r.params,o).then((function(t){if(null==l)a=void 0;else{var r=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)};a="object"===(0,i.default)(l)&&c in l?l[c]:l["get"+r(c)]?l["get"+r(c)]:l["is"+r(c)]?l["is"+r(c)]:void 0}return e.expression.resolveAsync.call(p,a,o,t,s,l)})).then((function(e){n.push(e)}))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]]*)\]/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:function(t,r,n){var i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,n.push(t)},parse:function(r,n,o,s){var a,p,c=this,l=null;return t(c,r.params,o).then((function(t){return l=t,e.expression.parseAsync.call(c,r.stack,o)})).then((function(t){if((a=n.pop())&&!Object.prototype.hasOwnProperty.call(a,t)&&c.template.options.strictVariables){var r=Object.keys(a);throw r.length>0?new e.Error('Key "'+t+'" for array with keys "'+r.join(", ")+'" does not exist.'):new e.Error('Key "'+t+'" does not exist as the array is empty.')}return null==a?null:(p="object"===(0,i.default)(a)&&t in a?a[t]:null,e.expression.resolveAsync.call(c,p,a,l,s))})).then((function(e){n.push(e)}))}},{type:e.expression.type._null,regex:/^(null|NULL|none|NONE)/,next:e.expression.set.operations,compile:function(e,t,r){delete e.match,e.value=null,r.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse:function(e,t,r){t.push(r)}},{type:e.expression.type.bool,regex:/^(true|TRUE|false|FALSE)/,next:e.expression.set.operations,compile:function(e,t,r){e.value="true"===e.match[0].toLowerCase(),delete e.match,r.push(e)},parse:e.expression.fn.parse.pushValue}],e.expression.resolveAsync=function(t,r,n,i,o){var s=this;if("function"!=typeof t)return e.Promise.resolve(t);var a=e.Promise.resolve(n);return i&&i.type===e.expression.type.parameter.end&&(a=a.then((function(){return i.params&&e.expression.parseAsync.call(s,i.params,r,!0)})).then((function(e){return i.cleanup=!0,e}))),a.then((function(e){return t.apply(o||r,e||[])}))},e.expression.resolve=function(t,r,n,i,o){return e.async.potentiallyAsync(this,!1,(function(){return e.expression.resolveAsync.call(this,t,r,n,i,o)}))},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.expression.handler[t.type]=t};e.expression.definitions.length>0;)e.expression.extend(e.expression.definitions.shift());return e.expression.tokenize=function(t){var r,n,i,o,s,a=t.value,p=[],c=0,l=null,u=[],h=function(){for(var n=arguments.length,i=new Array(n),a=0;a0;)f[h]=i[h];if(e.log.trace("Twig.expression.tokenize","Matched a ",r," regular expression of ",f),l&&!l.includes(r))return u.push(r+" cannot follow a "+p[p.length-1].type+" at template:"+c+" near '"+f[0].slice(0,20)+"...'"),f[0];var d=e.expression.handler[r];if(d.validate&&!d.validate(f,p))return f[0];u=[];var y={type:r,value:f[0],match:f};return t.position&&(y.position=t.position),p.push(y),s=!0,l=o,c+=f[0].length,d.transform?d.transform(f,p):""};for(e.log.debug("Twig.expression.tokenize","Tokenizing expression ",a);a.length>0;){for(r in a=a.trim(),e.expression.handler)if(Object.hasOwnProperty.call(e.expression.handler,r)){if(o=e.expression.handler[r].next,n=e.expression.handler[r].regex,e.log.trace("Checking type ",r," on ",a),s=!1,Array.isArray(n))for(i=n.length;i-- >0;)a=a.replace(n[i],h);else a=a.replace(n,h);if(s)break}if(!s)throw u.length>0?new e.Error(u.join(" OR ")):new e.Error("Unable to parse '"+a+"' at template position"+c)}return e.log.trace("Twig.expression.tokenize","Tokenized to ",p),p},e.expression.compile=function(t){var r=e.expression.tokenize(t),n=null,i=[],o=[],s=null;for(e.log.trace("Twig.expression.compile: ","Compiling ",t.value);r.length>0;)n=r.shift(),s=e.expression.handler[n.type],e.log.trace("Twig.expression.compile: ","Compiling ",n),s.compile(n,o,i),e.log.trace("Twig.expression.compile: ","Stack is",o),e.log.trace("Twig.expression.compile: ","Output is",i);for(;o.length>0;)i.push(o.pop());return e.log.trace("Twig.expression.compile: ","Final output is",i),t.stack=i,delete t.value,t},e.expression.parse=function(t,r,n,i){var o=this;Array.isArray(t)||(t=[t]);var s=[],a=[],p=e.expression.type.operator.binary;return e.async.potentiallyAsync(o,i,(function(){return e.async.forEach(t,(function(n,i){var c,l=null,u=null;if(!n.cleanup)return t.length>i+1&&(u=t[i+1]),(l=e.expression.handler[n.type]).parse&&(c=l.parse.call(o,n,s,r,u)),n.type===p&&r.loop&&a.push(n),c})).then((function(){for(var e=a.length,t=null;e-- >0;)(t=a[e]).params&&t.key&&delete t.key;if(n){var r=s.splice(0);s.push(r)}return s.pop()}))}))},e}},35:e=>{"use strict";e.exports=function(e){e.expression.operator={leftToRight:"leftToRight",rightToLeft:"rightToLeft"};var t=function(e,t){if(null==t)return null;if(void 0!==t.indexOf)return(e===t||""!==e)&&t.includes(e);var r;for(r in t)if(Object.hasOwnProperty.call(t,r)&&t[r]===e)return!0;return!1};return e.expression.operator.lookup=function(t,r){switch(t){case"..":r.precidence=20,r.associativity=e.expression.operator.leftToRight;break;case",":r.precidence=18,r.associativity=e.expression.operator.leftToRight;break;case"?:":case"?":case":":r.precidence=16,r.associativity=e.expression.operator.rightToLeft;break;case"??":r.precidence=15,r.associativity=e.expression.operator.rightToLeft;break;case"or":r.precidence=14,r.associativity=e.expression.operator.leftToRight;break;case"and":r.precidence=13,r.associativity=e.expression.operator.leftToRight;break;case"b-or":r.precidence=12,r.associativity=e.expression.operator.leftToRight;break;case"b-xor":r.precidence=11,r.associativity=e.expression.operator.leftToRight;break;case"b-and":r.precidence=10,r.associativity=e.expression.operator.leftToRight;break;case"==":case"!=":case"<=>":r.precidence=9,r.associativity=e.expression.operator.leftToRight;break;case"<":case"<=":case">":case">=":case"not in":case"in":case"matches":case"starts with":case"ends with":r.precidence=8,r.associativity=e.expression.operator.leftToRight;break;case"~":case"+":case"-":r.precidence=6,r.associativity=e.expression.operator.leftToRight;break;case"//":case"**":case"*":case"/":case"%":r.precidence=5,r.associativity=e.expression.operator.leftToRight;break;case"not":r.precidence=3,r.associativity=e.expression.operator.rightToLeft;break;default:throw new e.Error("Failed to lookup operator: "+t+" is an unknown operator.")}return r.operator=t,r},e.expression.operator.parse=function(r,n){var i,o,s;if(e.log.trace("Twig.expression.operator.parse: ","Handling ",r),"?"===r&&(s=n.pop()),o=n.pop(),"not"!==r&&(i=n.pop()),"in"!==r&&"not in"!==r&&"??"!==r&&(i&&Array.isArray(i)&&(i=i.length),"?"!==r&&o&&Array.isArray(o)&&(o=o.length)),"matches"===r&&o&&"string"==typeof o){var a=o.match(/^\/(.*)\/([gims]?)$/),p=a[1],c=a[2];o=new RegExp(p,c)}switch(r){case":":break;case"??":void 0===i&&(i=o,o=s,s=void 0),null!=i?n.push(i):n.push(o);break;case"?:":e.lib.boolval(i)?n.push(i):n.push(o);break;case"?":void 0===i&&(i=o,o=s,s=void 0),e.lib.boolval(i)?n.push(o):n.push(s);break;case"+":o=parseFloat(o),i=parseFloat(i),n.push(i+o);break;case"-":o=parseFloat(o),i=parseFloat(i),n.push(i-o);break;case"*":o=parseFloat(o),i=parseFloat(i),n.push(i*o);break;case"/":o=parseFloat(o),i=parseFloat(i),n.push(i/o);break;case"//":o=parseFloat(o),i=parseFloat(i),n.push(Math.floor(i/o));break;case"%":o=parseFloat(o),i=parseFloat(i),n.push(i%o);break;case"~":n.push((null!=i?i.toString():"")+(null!=o?o.toString():""));break;case"not":case"!":n.push(!e.lib.boolval(o));break;case"<=>":n.push(i===o?0:i":n.push(i>o);break;case">=":n.push(i>=o);break;case"===":n.push(i===o);break;case"==":n.push(i==o);break;case"!==":n.push(i!==o);break;case"!=":n.push(i!=o);break;case"or":n.push(e.lib.boolval(i)||e.lib.boolval(o));break;case"b-or":n.push(i|o);break;case"b-xor":n.push(i^o);break;case"and":n.push(e.lib.boolval(i)&&e.lib.boolval(o));break;case"b-and":n.push(i&o);break;case"**":n.push(Math.pow(i,o));break;case"not in":n.push(!t(i,o));break;case"in":n.push(t(i,o));break;case"matches":n.push(o.test(i));break;case"starts with":n.push("string"==typeof i&&0===i.indexOf(o));break;case"ends with":n.push("string"==typeof i&&i.includes(o,i.length-o.length));break;case"..":n.push(e.functions.range(i,o));break;default:throw new e.Error("Failed to parse operator: "+r+" is an unknown operator.")}},e}},617:(e,t,r)=>{"use strict";e.exports=function e(){var t={VERSION:"1.17.1"};return r(181)(t),r(383)(t),r(769)(t),r(213)(t),r(799)(t),r(773)(t),r(854)(t),r(188)(t),r(341)(t),r(402)(t),r(847)(t),r(148)(t),r(439)(t),r(452)(t),r(858)(t),t.exports.factory=e,t.exports}},213:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(e){function t(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return null!=t&&r===e}return e.filters={upper:function(e){return"string"!=typeof e?e:e.toUpperCase()},lower:function(e){return"string"!=typeof e?e:e.toLowerCase()},capitalize:function(e){return"string"!=typeof e?e:e.slice(0,1).toUpperCase()+e.toLowerCase().slice(1)},title:function(e){return"string"!=typeof e?e:e.toLowerCase().replace(/(^|\s)([a-z])/g,(function(e,t,r){return t+r.toUpperCase()}))},length:function(t){return e.lib.is("Array",t)||"string"==typeof t?t.length:e.lib.is("Object",t)?void 0===t._keys?Object.keys(t).length:t._keys.length:0},reverse:function(e){if(t("Array",e))return e.reverse();if(t("String",e))return e.split("").reverse().join("");if(t("Object",e)){var r=e._keys||Object.keys(e).reverse();return e._keys=r,e}},sort:function(e){if(t("Array",e))return e.sort();if(t("Object",e)){delete e._keys;var r=Object.keys(e).sort((function(t,r){var n,i;return e[t]>e[r]==!(e[t]<=e[r])?e[t]>e[r]?1:e[t]e[r].toString()?1:e[t]e[r]?1:e[t].toString()i?1:n1)throw new e.Error("default filter expects one argument");return null==t||""===t?void 0===r?"":r[0]:t},json_encode:function(r){if(null==r)return"null";if("object"===(0,n.default)(r)&&t("Array",r)){var i=[];return r.forEach((function(t){i.push(e.filters.json_encode(t))})),"["+i.join(",")+"]"}if("object"===(0,n.default)(r)&&t("Date",r))return'"'+r.toISOString()+'"';if("object"===(0,n.default)(r)){var o=r._keys||Object.keys(r),s=[];return o.forEach((function(t){s.push(JSON.stringify(t)+":"+e.filters.json_encode(r[t]))})),"{"+s.join(",")+"}"}return JSON.stringify(r)},merge:function(r,n){var i=[],o=0;if(t("Array",r)?n.forEach((function(e){t("Array",e)||(i={})})):i={},t("Array",i)||(i._keys=[]),t("Array",r)?r.forEach((function(e){i._keys&&i._keys.push(o),i[o]=e,o++})):(r._keys||Object.keys(r)).forEach((function(e){i[e]=r[e],i._keys.push(e);var t=parseInt(e,10);!isNaN(t)&&t>=o&&(o=t+1)})),n.forEach((function(e){t("Array",e)?e.forEach((function(e){i._keys&&i._keys.push(o),i[o]=e,o++})):(e._keys||Object.keys(e)).forEach((function(t){i[t]||i._keys.push(t),i[t]=e[t];var r=parseInt(t,10);!isNaN(r)&&r>=o&&(o=r+1)}))})),0===n.length)throw new e.Error("Filter merge expects at least one parameter");return i},date:function(t,r){var n=e.functions.date(t),i=r&&Boolean(r.length)?r[0]:"F j, Y H:i";return e.lib.date(i.replace(/\\\\/g,"\\"),n)},date_modify:function(t,r){if(null!=t){if(void 0===r||1!==r.length)throw new e.Error("date_modify filter expects 1 argument");var n,i=r[0];return e.lib.is("Date",t)&&(n=e.lib.strtotime(i,t.getTime()/1e3)),e.lib.is("String",t)&&(n=e.lib.strtotime(i,e.lib.strtotime(t))),e.lib.is("Number",t)&&(n=e.lib.strtotime(i,t)),new Date(1e3*n)}},replace:function(t,r){if(null!=t){var n,i=r[0];for(n in i)Object.hasOwnProperty.call(i,n)&&"_keys"!==n&&(t=e.lib.replaceAll(t,n,i[n]));return t}},format:function(t,r){if(null!=t)return e.lib.vsprintf(t,r)},striptags:function(t,r){if(null!=t)return e.lib.stripTags(t,r)},escape:function(t,r){if(null!=t&&""!==t){var n="html";if(r&&Boolean(r.length)&&!0!==r[0]&&(n=r[0]),"html"===n){var i=t.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");return new e.Markup(i,"html")}if("js"===n){for(var o=t.toString(),s="",a=0;a"]$/))g+=y[m].replace(/&/g,"&").replace(//g,">").replace(/"/g,""");else{var x=y.charCodeAt(m);g+=x<=31&&9!==x&&10!==x&&13!==x?"�":x<128?e.lib.sprintf("&#x%02s;",x.toString(16).toUpperCase()):e.lib.sprintf("&#x%04s;",x.toString(16).toUpperCase())}return new e.Markup(g,"html_attr")}throw new e.Error("escape strategy unsupported")}},e:function(t,r){return e.filters.escape(t,r)},nl2br:function(t){if(null!=t&&""!==t){var r="BACKSLASH_n_replace",n="
    "+r;return t=e.filters.escape(t).replace(/\r\n/g,n).replace(/\r/g,n).replace(/\n/g,n),t=e.lib.replaceAll(t,r,"\n"),new e.Markup(t)}},number_format:function(e,t){var r=e,n=t&&t[0]?t[0]:void 0,i=t&&void 0!==t[1]?t[1]:".",o=t&&void 0!==t[2]?t[2]:",";r=String(r).replace(/[^0-9+\-Ee.]/g,"");var s=isFinite(Number(r))?Number(r):0,a=isFinite(Number(n))?Math.abs(n):0,p="";return p=(a?function(e,t){var r=Math.pow(10,t);return String(Math.round(e*r)/r)}(s,a):String(Math.round(s))).split("."),p[0].length>3&&(p[0]=p[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(p[1]||"").length=0;o--)if(!r.includes(n.charAt(o))){n=n.slice(0,Math.max(0,o+1));break}return r.includes(n.charAt(0))?"":n}},truncate:function(e,t){var r=30,n=!1,i="...";if(e=String(e),t&&(t[0]&&(r=t[0]),t[1]&&(n=t[1]),t[2]&&(i=t[2])),e.length>r){if(n&&-1===(r=e.indexOf(" ",r)))return e;e=e.slice(0,r)+i}return e},slice:function(t,r){if(null!=t){if(void 0===r||0===r.length)throw new e.Error("slice filter expects at least 1 argument");var n=r[0]||0,i=r.length>1?r[1]:t.length,o=n>=0?n:Math.max(t.length+n,0);if(i<0&&(i=t.length-o+i),e.lib.is("Array",t)){for(var s=[],a=o;a2)throw new e.Error("split filter expects 1 or 2 argument");if(e.lib.is("String",t)){var n=r[0],i=r[1],o=t.split(n);if(void 0===i)return o;if(i<0)return t.split(n,o.length+i);var s=[];if(""===n)for(;o.length>0;){for(var a="",p=0;p0;p++)a+=o.shift();s.push(a)}else{for(var c=0;c0;c++)s.push(o.shift());o.length>0&&s.push(o.join(n))}return s}throw new e.Error("split filter expects value to be a string")}},last:function(t){var r;return e.lib.is("Object",t)?t[(r=void 0===t._keys?Object.keys(t):t._keys)[r.length-1]]:e.lib.is("Number",t)?t.toString().slice(-1):t[t.length-1]},raw:function(t){return new e.Markup(t||"")},batch:function(t,r){var n,i,o=r.shift(),s=r.shift();if(!e.lib.is("Array",t))throw new e.Error("batch filter expects items to be an array");if(!e.lib.is("Number",o))throw new e.Error("batch filter expects size to be a number");o=Math.ceil(o);var a=e.lib.chunkArray(t,o);if(s&&t.length%o!=0){for(i=o-(n=a.pop()).length;i--;)n.push(s);a.push(n)}return a},round:function(t,r){var n=(r=r||[]).length>0?r[0]:0,i=r.length>1?r[1]:"common";if(t=parseFloat(t),n&&!e.lib.is("Number",n))throw new e.Error("round filter expects precision to be a number");if("common"===i)return e.lib.round(t,n);if(!e.lib.is("Function",Math[i]))throw new e.Error("round filter expects method to be 'floor', 'ceil', or 'common'");return Math[i](t*Math.pow(10,n))/Math.pow(10,n)},spaceless:function(e){return e.replace(/>\s+<").trim()}},e.filter=function(t,r,n){if(!e.filters[t])throw new e.Error("Unable to find filter "+t);return e.filters[t].call(this,r,n)},e.filter.extend=function(t,r){e.filters[t]=r},e}},799:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(t){return t.functions={range:function(e,t,r){var n,i,o=[],s=r||1,a=!1;if(isNaN(e)||isNaN(t)?isNaN(e)&&isNaN(t)?(a=!0,n=e.charCodeAt(0),i=t.charCodeAt(0)):(n=isNaN(e)?0:e,i=isNaN(t)?0:t):(n=parseInt(e,10),i=parseInt(t,10)),n>i)for(;n>=i;)o.push(a?String.fromCharCode(n):n),n-=s;else for(;n<=i;)o.push(a?String.fromCharCode(n):n),n+=s;return o},cycle:function(e,t){return e[t%e.length]},dump:function(){for(var e=arguments.length,t=new Array(e),r=0;r0;)e--,t+=" ";return t},c=function(e){a+=p(s),"object"===(0,n.default)(e)?l(e):"function"==typeof e?a+="function()\n":"string"==typeof e?a+="string("+e.length+') "'+e+'"'+o:"number"==typeof e?a+="number("+e+")"+o:"boolean"==typeof e&&(a+="bool("+e+")"+o)},l=function(e){var t;if(null===e)a+="NULL\n";else if(void 0===e)a+="undefined\n";else if("object"===(0,n.default)(e)){for(t in a+=p(s)+(0,n.default)(e),s++,a+="("+function(e){var t,r=0;for(t in e)Object.hasOwnProperty.call(e,t)&&r++;return r}(e)+") {"+o,e)Object.hasOwnProperty.call(e,t)&&(a+=p(s)+"["+t+"]=> "+o,c(e[t]));s--,a+=p(s)+"}"+o}else c(e)};return 0===i.length&&i.push(this.context),i.forEach((function(e){l(e)})),a},date:function(e){var r;if(null==e||""===e)r=new Date;else if(t.lib.is("Date",e))r=e;else if(t.lib.is("String",e))r=e.match(/^\d+$/)?new Date(1e3*e):new Date(1e3*t.lib.strtotime(e));else{if(!t.lib.is("Number",e))throw new t.Error("Unable to parse date "+e);r=new Date(1e3*e)}return r},block:function(e){var t=this,r=t.getBlock(e);if(void 0!==r)return r.render(t,t.context)},parent:function(){var e=this;return e.getBlock(e.getNestingStackToken(t.logic.type.block).blockName,!0).render(e,e.context)},attribute:function(e,r,n){return t.lib.is("Object",e)&&Object.hasOwnProperty.call(e,r)?"function"==typeof e[r]?e[r].apply(void 0,n):e[r]:e&&e[r]||void 0},max:function(e){if(t.lib.is("Object",e))return delete e._keys,t.lib.max(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";e.exports=r(617)()},773:(e,t,r)=>{"use strict";e.exports=function(e){return e.lib={},e.lib.sprintf=r(296),e.lib.vsprintf=r(436),e.lib.round=r(718),e.lib.max=r(673),e.lib.min=r(4),e.lib.stripTags=r(359),e.lib.strtotime=r(195),e.lib.date=r(190),e.lib.boolval=r(315),e.lib.is=function(e,t){if(null==t)return!1;switch(e){case"Array":return Array.isArray(t);case"Date":return t instanceof Date;case"String":return"string"==typeof t||t instanceof String;case"Number":return"number"==typeof t||t instanceof Number;case"Function":return"function"==typeof t;case"Object":return t instanceof Object;default:return!1}},e.lib.replaceAll=function(e,t,r){var n="string"==typeof e?e:e.toString(),i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n.replace(new RegExp(i,"g"),r)},e.lib.chunkArray=function(e,t){var r=[],n=0,i=e.length;if(t<1||!Array.isArray(e))return[];for(;n{"use strict";e.exports=function(e){e.Templates.registerLoader("ajax",(function(t,r,n,i){var o,s=r.precompiled,a=this.parsers[r.parser]||this.parser.twig;if("undefined"==typeof XMLHttpRequest)throw new e.Error('Unsupported platform: Unable to do ajax requests because there is no "XMLHTTPRequest" implementation');var p=new XMLHttpRequest;return p.onreadystatechange=function(){var c=null;4===p.readyState&&(200===p.status||window.cordova&&0===p.status?(e.log.debug("Got template ",p.responseText),c=!0===s?JSON.parse(p.responseText):p.responseText,r.url=t,r.data=c,o=a.call(this,r),"function"==typeof n&&n(o)):"function"==typeof i&&i(p))},p.open("GET",t,Boolean(r.async)),p.overrideMimeType("text/plain"),p.send(),!!r.async||o}))}},188:(e,t,r)=>{"use strict";e.exports=function(e){var t,n;try{t=r(351),n=r(470)}catch(e){console.warn("Missing fs and path modules. "+e)}e.Templates.registerLoader("fs",(function(r,i,o,s){var a,p,c=i.precompiled,l=this.parsers[i.parser]||this.parser.twig;if(!t||!n)throw new e.Error('Unsupported platform: Unable to load from file because there is no "fs" or "path" implementation');var u=function(e,t){e?"function"==typeof s&&s(e):(!0===c&&(t=JSON.parse(t)),i.data=t,i.path=i.path||r,a=l.call(this,i),"function"==typeof o&&o(a))};if(i.path=i.path||r,i.async)return t.stat(i.path,(function(r,n){!r&&n.isFile()?t.readFile(i.path,"utf8",u):"function"==typeof s&&s(new e.Error("Unable to find template file "+i.path))})),!0;try{if(!t.statSync(i.path).isFile())throw new e.Error("Unable to find template file "+i.path)}catch(t){throw new e.Error("Unable to find template file "+i.path+". "+t)}return p=t.readFileSync(i.path,"utf8"),u(void 0,p),a}))}},341:(e,t,r)=>{"use strict";var n=r(318)(r(713));function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,p=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){p=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(p)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r\s+<").trim();return r=new e.Markup(r),{chain:n,output:r}}))}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+(\w+)\s*\(\s*((?:\w+(?:\s*=\s*([\s\S]+))?(?:,\s*)?)*)\s*\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){var r=t.match[1],n=t.match[2].split(/\s*,\s*/),i=n.map((function(e){return e.split(/\s*=\s*/)[0]})),o=i.length;if(o>1)for(var s={},a=0;a0;)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var r=t.value.trim(),n=e.logic.tokenize.call(this,r),i=e.logic.handler[n.type];return i.compile&&(n=i.compile.call(this,n),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",n)),n},e.logic.tokenize=function(t){var r=null,n=null,i=null,o=null,s=null,a=null,p=null;for(r in t=t.trim(),e.logic.handler)if(Object.hasOwnProperty.call(e.logic.handler,r))for(n=e.logic.handler[r].type,o=i=e.logic.handler[r].regex,Array.isArray(i)||(o=[i]),s=o.length,a=0;a{"use strict";e.exports=function(e){e.Templates.registerParser("source",(function(e){return e.data||""}))}},847:e=>{"use strict";e.exports=function(e){e.Templates.registerParser("twig",(function(t){return new e.Template(t)}))}},148:(e,t,r)=>{"use strict";var n=r(318)(r(8));e.exports=function(e){return e.path={},e.path.expandNamespace=function(e,t){var r=Object.keys(e),n=new RegExp("^(?:@(".concat(r.join("|"),")/|(").concat(r.join("|"),")::)"));return t.replace(n,(function(t,r,n){return"".concat(e[void 0===r?n:r],"/")}))},e.path.parsePath=function(t,r){var i=t.options.namespaces,o=r||"",s=i&&"object"===(0,n.default)(i)?e.path.expandNamespace(i,o):o;return s===o&&(s=e.path.relativePath(t,o)),s},e.path.relativePath=function(t,n){var i,o,s,a="/",p=[],c=n||"";if(t.url)i=void 0===t.base?t.url:t.base.replace(/([^/])$/,"$1/");else if(t.path){var l=r(470),u=l.sep||a,h=new RegExp("^\\.{1,2}"+u.replace("\\","\\\\"));c=c.replace(/\//g,u),void 0!==t.base&&null===c.match(h)?(c=c.replace(t.base,""),i=t.base+u):i=l.normalize(t.path),i=i.replace(u+u,u),a=u}else{if(!t.name&&!t.id||!t.method||"fs"===t.method||"ajax"===t.method)throw new e.Error("Cannot extend an inline template.");i=t.base||t.name||t.id}for((o=i.split(a)).pop(),o=o.concat(c.split(a));o.length>0;)"."===(s=o.shift())||(".."===s&&p.length>0&&".."!==p[p.length-1]?p.pop():p.push(s));return p.join(a)},e}},439:e=>{"use strict";e.exports=function(e){return e.tests={empty:function(e){if(!0===e)return!1;if(null==e)return!0;if("number"==typeof e)return!1;if(e.length>0)return!1;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0},odd:function(e){return e%2==1},even:function(e){return e%2==0},"divisible by":function(e,t){return e%t[0]==0},divisibleby:function(t,r){return console.warn("`divisibleby` is deprecated use `divisible by`"),e.tests["divisible by"](t,r)},defined:function(e){return void 0!==e},none:function(e){return null===e},null:function(e){return this.none(e)},"same as":function(e,t){return e===t[0]},sameas:function(t,r){return console.warn("`sameas` is deprecated use `same as`"),e.tests["same as"](t,r)},iterable:function(t){return t&&(e.lib.is("Array",t)||e.lib.is("Object",t))}},e.test=function(t,r,n){if(!e.tests[t])throw e.Error("Test "+t+" is not defined.");return e.tests[t](r,n)},e.test.extend=function(t,r){e.tests[t]=r},e}},521:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"boolean":return e?"1":"";case"string":return e;case"number":return isNaN(e)?"NAN":isFinite(e)?e+"":(e<0?"-":"")+"INF";case"undefined":return"";case"object":return Array.isArray(e)?"Array":null!==e?"Object":"";default:throw new Error("Unsupported value type")}}},892:(e,t,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":n(e)){case"number":return e;case"string":return parseFloat(e)||0;default:return r(791)(e)}}},791:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"number":return isNaN(e)||!isFinite(e)?0:e<0?Math.ceil(e):Math.floor(e);case"string":return parseInt(e,10)||0;default:return+!!e}}},190:e=>{"use strict";e.exports=function(e,t){var r=void 0,n=void 0,i=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],o=/\\?(.?)/gi,s=function(e,t){return n[e]?n[e]():t},a=function(e,t){for(e=String(e);e.length9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var e=3600*r.getUTCHours(),t=60*r.getUTCMinutes(),n=r.getUTCSeconds();return a(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return a(n.g(),2)},H:function(){return a(n.G(),2)},i:function(){return a(r.getMinutes(),2)},s:function(){return a(r.getSeconds(),2)},u:function(){return a(1e3*r.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+a(100*Math.floor(t/60)+t%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,s)},r:function(){return"D, d M Y H:i:s O".replace(o,s)},U:function(){return r/1e3|0}},function(e,t){return r=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(o,s)}(e,t)}},195:e=>{"use strict";var t="[ \\t]+",r="[ \\t]*",n="(?:([ap])\\.?m\\.?([\\t ]|$))",i="(2[0-4]|[01]?[0-9])",o="([01][0-9]|2[0-4])",s="(0?[1-9]|1[0-2])",a="([0-5]?[0-9])",p="([0-5][0-9])",c="(60|[0-5]?[0-9])",l="(60|[0-5][0-9])",u="(?:\\.([0-9]+))",h="sunday|monday|tuesday|wednesday|thursday|friday|saturday",f="sun|mon|tue|wed|thu|fri|sat",d=h+"|"+f+"|weekdays?",y="first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth",g="next|last|previous|this",m="(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|"+d,x="([0-9]{1,4})",v="([0-9]{4})",b="(1[0-2]|0?[0-9])",w="(0[0-9]|1[0-2])",k="(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)",T="(0[0-9]|[1-2][0-9]|3[01])",A="january|february|march|april|may|june|july|august|september|october|november|december",S="jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec",E="("+A+"|"+S+"|i[vx]|vi{0,3}|xi{0,2}|i{1,3})",j="((?:GMT)?([+-])"+i+":?"+a+"?)",O=E+"[ .\\t-]*"+k+"[,.stndrh\\t ]*";function N(e,t){switch(t=t&&t.toLowerCase()){case"a":e+=12===e?-12:0;break;case"p":e+=12!==e?12:0}return e}function P(e){var t=+e;return e.length<4&&t<100&&(t+=t<70?2e3:1900),t}function _(e){return{jan:0,january:0,i:0,feb:1,february:1,ii:1,mar:2,march:2,iii:2,apr:3,april:3,iv:3,may:4,v:4,jun:5,june:5,vi:5,jul:6,july:6,vii:6,aug:7,august:7,viii:7,sep:8,sept:8,september:8,ix:8,oct:9,october:9,x:9,nov:10,november:10,xi:10,dec:11,december:11,xii:11}[e.toLowerCase()]}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{mon:1,monday:1,tue:2,tuesday:2,wed:3,wednesday:3,thu:4,thursday:4,fri:5,friday:5,sat:6,saturday:6,sun:0,sunday:0}[e.toLowerCase()]||t}function M(e,t){if(!(e=e&&e.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i)))return t;var r="-"===e[1]?-1:1,n=+e[2],i=+e[4];return e[4]||e[3]||(i=Math.floor(n%100),n=Math.floor(n/100)),r*(60*n+i)*60}var C={acdt:37800,acst:34200,addt:-7200,adt:-10800,aedt:39600,aest:36e3,ahdt:-32400,ahst:-36e3,akdt:-28800,akst:-32400,amt:-13840,apt:-10800,ast:-14400,awdt:32400,awst:28800,awt:-10800,bdst:7200,bdt:-36e3,bmt:-14309,bst:3600,cast:34200,cat:7200,cddt:-14400,cdt:-18e3,cemt:10800,cest:7200,cet:3600,cmt:-15408,cpt:-18e3,cst:-21600,cwt:-18e3,chst:36e3,dmt:-1521,eat:10800,eddt:-10800,edt:-14400,eest:10800,eet:7200,emt:-26248,ept:-14400,est:-18e3,ewt:-14400,ffmt:-14660,fmt:-4056,gdt:39600,gmt:0,gst:36e3,hdt:-34200,hkst:32400,hkt:28800,hmt:-19776,hpt:-34200,hst:-36e3,hwt:-34200,iddt:14400,idt:10800,imt:25025,ist:7200,jdt:36e3,jmt:8440,jst:32400,kdt:36e3,kmt:5736,kst:30600,lst:9394,mddt:-18e3,mdst:16279,mdt:-21600,mest:7200,met:3600,mmt:9017,mpt:-21600,msd:14400,msk:10800,mst:-25200,mwt:-21600,nddt:-5400,ndt:-9052,npt:-9e3,nst:-12600,nwt:-9e3,nzdt:46800,nzmt:41400,nzst:43200,pddt:-21600,pdt:-25200,pkst:21600,pkt:18e3,plmt:25590,pmt:-13236,ppmt:-17340,ppt:-25200,pst:-28800,pwt:-25200,qmt:-18840,rmt:5794,sast:7200,sdmt:-16800,sjmt:-20173,smt:-13884,sst:-39600,tbmt:10751,tmt:12344,uct:0,utc:0,wast:7200,wat:3600,wemt:7200,west:3600,wet:0,wib:25200,wita:28800,wit:32400,wmt:5040,yddt:-25200,ydt:-28800,ypt:-28800,yst:-32400,ywt:-28800,a:3600,b:7200,c:10800,d:14400,e:18e3,f:21600,g:25200,h:28800,i:32400,k:36e3,l:39600,m:43200,n:-3600,o:-7200,p:-10800,q:-14400,r:-18e3,s:-21600,t:-25200,u:-28800,v:-32400,w:-36e3,x:-39600,y:-43200,z:0},D={yesterday:{regex:/^yesterday/i,name:"yesterday",callback:function(){return this.rd-=1,this.resetTime()}},now:{regex:/^now/i,name:"now"},noon:{regex:/^noon/i,name:"noon",callback:function(){return this.resetTime()&&this.time(12,0,0,0)}},midnightOrToday:{regex:/^(midnight|today)/i,name:"midnight | today",callback:function(){return this.resetTime()}},tomorrow:{regex:/^tomorrow/i,name:"tomorrow",callback:function(){return this.rd+=1,this.resetTime()}},timestamp:{regex:/^@(-?\d+)/i,name:"timestamp",callback:function(e,t){return this.rs+=+t,this.y=1970,this.m=0,this.d=1,this.dates=0,this.resetTime()&&this.zone(0)}},firstOrLastDay:{regex:/^(first|last) day of/i,name:"firstdayof | lastdayof",callback:function(e,t){"first"===t.toLowerCase()?this.firstOrLastDayOfMonth=1:this.firstOrLastDayOfMonth=-1}},backOrFrontOf:{regex:RegExp("^(back|front) of "+i+r+n+"?","i"),name:"backof | frontof",callback:function(e,t,r,n){var i=+r,o=15;return"back"===t.toLowerCase()||(i-=1,o=45),i=N(i,n),this.resetTime()&&this.time(i,o,0,0)}},weekdayOf:{regex:RegExp("^("+y+"|"+g+")"+t+"("+h+"|"+f+")"+t+"of","i"),name:"weekdayof"},mssqltime:{regex:RegExp("^"+s+":"+p+":"+l+"[:.]([0-9]+)"+n,"i"),name:"mssqltime",callback:function(e,t,r,n,i,o){return this.time(N(+t,o),+r,+n,+i.substr(0,3))}},timeLong12:{regex:RegExp("^"+s+"[:.]"+a+"[:.]"+l+r+n,"i"),name:"timelong12",callback:function(e,t,r,n,i){return this.time(N(+t,i),+r,+n,0)}},timeShort12:{regex:RegExp("^"+s+"[:.]"+p+r+n,"i"),name:"timeshort12",callback:function(e,t,r,n){return this.time(N(+t,n),+r,0,0)}},timeTiny12:{regex:RegExp("^"+s+r+n,"i"),name:"timetiny12",callback:function(e,t,r){return this.time(N(+t,r),0,0,0)}},soap:{regex:RegExp("^"+v+"-"+w+"-"+T+"T"+o+":"+p+":"+l+u+j+"?","i"),name:"soap",callback:function(e,t,r,n,i,o,s,a,p){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,+a.substr(0,3))&&this.zone(M(p))}},wddx:{regex:RegExp("^"+v+"-"+b+"-"+k+"T"+i+":"+a+":"+c),name:"wddx",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},exif:{regex:RegExp("^"+v+":"+w+":"+T+" "+o+":"+p+":"+l,"i"),name:"exif",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},xmlRpc:{regex:RegExp("^"+v+w+T+"T"+i+":"+p+":"+l),name:"xmlrpc",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},xmlRpcNoColon:{regex:RegExp("^"+v+w+T+"[Tt]"+i+p+l),name:"xmlrpcnocolon",callback:function(e,t,r,n,i,o,s){return this.ymd(+t,r-1,+n)&&this.time(+i,+o,+s,0)}},clf:{regex:RegExp("^"+k+"/("+S+")/"+v+":"+o+":"+p+":"+l+t+j,"i"),name:"clf",callback:function(e,t,r,n,i,o,s,a){return this.ymd(+n,_(r),+t)&&this.time(+i,+o,+s,0)&&this.zone(M(a))}},iso8601long:{regex:RegExp("^t?"+i+"[:.]"+a+"[:.]"+c+u,"i"),name:"iso8601long",callback:function(e,t,r,n,i){return this.time(+t,+r,+n,+i.substr(0,3))}},dateTextual:{regex:RegExp("^"+E+"[ .\\t-]*"+k+"[,.stndrh\\t ]+"+x,"i"),name:"datetextual",callback:function(e,t,r,n){return this.ymd(P(n),_(t),+r)}},pointedDate4:{regex:RegExp("^"+k+"[.\\t-]"+b+"[.-]"+v),name:"pointeddate4",callback:function(e,t,r,n){return this.ymd(+n,r-1,+t)}},pointedDate2:{regex:RegExp("^"+k+"[.\\t]"+b+"\\.([0-9]{2})"),name:"pointeddate2",callback:function(e,t,r,n){return this.ymd(P(n),r-1,+t)}},timeLong24:{regex:RegExp("^t?"+i+"[:.]"+a+"[:.]"+c),name:"timelong24",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},dateNoColon:{regex:RegExp("^"+v+w+T),name:"datenocolon",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},pgydotd:{regex:RegExp("^"+v+"\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),name:"pgydotd",callback:function(e,t,r){return this.ymd(+t,0,+r)}},timeShort24:{regex:RegExp("^t?"+i+"[:.]"+a,"i"),name:"timeshort24",callback:function(e,t,r){return this.time(+t,+r,0,0)}},iso8601noColon:{regex:RegExp("^t?"+o+p+l,"i"),name:"iso8601nocolon",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},iso8601dateSlash:{regex:RegExp("^"+v+"/"+w+"/"+T+"/"),name:"iso8601dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},dateSlash:{regex:RegExp("^"+v+"/"+b+"/"+k),name:"dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},american:{regex:RegExp("^"+b+"/"+k+"/"+x),name:"american",callback:function(e,t,r,n){return this.ymd(P(n),t-1,+r)}},americanShort:{regex:RegExp("^"+b+"/"+k),name:"americanshort",callback:function(e,t,r){return this.ymd(this.y,t-1,+r)}},gnuDateShortOrIso8601date2:{regex:RegExp("^"+x+"-"+b+"-"+k),name:"gnudateshort | iso8601date2",callback:function(e,t,r,n){return this.ymd(P(t),r-1,+n)}},iso8601date4:{regex:RegExp("^([+-]?[0-9]{4})-"+w+"-"+T),name:"iso8601date4",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},gnuNoColon:{regex:RegExp("^t?"+o+p,"i"),name:"gnunocolon",callback:function(e,t,r){switch(this.times){case 0:return this.time(+t,+r,0,this.f);case 1:return this.y=100*t+ +r,this.times++,!0;default:return!1}}},gnuDateShorter:{regex:RegExp("^"+v+"-"+b),name:"gnudateshorter",callback:function(e,t,r){return this.ymd(+t,r-1,1)}},pgTextReverse:{regex:RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-("+S+")-"+T,"i"),name:"pgtextreverse",callback:function(e,t,r,n){return this.ymd(P(t),_(r),+n)}},dateFull:{regex:RegExp("^"+k+"[ \\t.-]*"+E+"[ \\t.-]*"+x,"i"),name:"datefull",callback:function(e,t,r,n){return this.ymd(P(n),_(r),+t)}},dateNoDay:{regex:RegExp("^"+E+"[ .\\t-]*"+v,"i"),name:"datenoday",callback:function(e,t,r){return this.ymd(+r,_(t),1)}},dateNoDayRev:{regex:RegExp("^"+v+"[ .\\t-]*"+E,"i"),name:"datenodayrev",callback:function(e,t,r){return this.ymd(+t,_(r),1)}},pgTextShort:{regex:RegExp("^("+S+")-"+T+"-"+x,"i"),name:"pgtextshort",callback:function(e,t,r,n){return this.ymd(P(n),_(t),+r)}},dateNoYear:{regex:RegExp("^"+O,"i"),name:"datenoyear",callback:function(e,t,r){return this.ymd(this.y,_(t),+r)}},dateNoYearRev:{regex:RegExp("^"+k+"[ .\\t-]*"+E,"i"),name:"datenoyearrev",callback:function(e,t,r){return this.ymd(this.y,_(r),+t)}},isoWeekDay:{regex:RegExp("^"+v+"-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),name:"isoweekday | isoweek",callback:function(e,t,r,n){if(n=n?+n:1,!this.ymd(+t,0,1))return!1;var i=new Date(this.y,this.m,this.d).getDay();i=0-(i>4?i-7:i),this.rd+=i+7*(r-1)+n}},relativeText:{regex:RegExp("^("+y+"|"+g+")"+t+"("+m+")","i"),name:"relativetext",callback:function(e,t,r){var n={last:-1,previous:-1,this:0,first:1,next:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eight:8,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12}[t.toLowerCase()];switch(r.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=n;break;case"min":case"mins":case"minute":case"minutes":this.ri+=n;break;case"hour":case"hours":this.rh+=n;break;case"day":case"days":this.rd+=n;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*n;break;case"week":case"weeks":this.rd+=7*n;break;case"month":case"months":this.rm+=n;break;case"year":case"years":this.ry+=n;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(r,7),this.weekdayBehavior=1,this.rd+=7*(n>0?n-1:n)}}},relative:{regex:RegExp("^([+-]*)[ \\t]*(\\d+)"+r+"("+m+"|week)","i"),name:"relative",callback:function(e,t,r,n){var i=t.replace(/[^-]/g,"").length,o=+r*Math.pow(-1,i);switch(n.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=o;break;case"min":case"mins":case"minute":case"minutes":this.ri+=o;break;case"hour":case"hours":this.rh+=o;break;case"day":case"days":this.rd+=o;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*o;break;case"week":case"weeks":this.rd+=7*o;break;case"month":case"months":this.rm+=o;break;case"year":case"years":this.ry+=o;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(n,7),this.weekdayBehavior=1,this.rd+=7*(o>0?o-1:o)}}},dayText:{regex:RegExp("^("+d+")","i"),name:"daytext",callback:function(e,t){this.resetTime(),this.weekday=R(t,0),2!==this.weekdayBehavior&&(this.weekdayBehavior=1)}},relativeTextWeek:{regex:RegExp("^("+g+")"+t+"week","i"),name:"relativetextweek",callback:function(e,t){switch(this.weekdayBehavior=2,t.toLowerCase()){case"this":this.rd+=0;break;case"next":this.rd+=7;break;case"last":case"previous":this.rd-=7}isNaN(this.weekday)&&(this.weekday=1)}},monthFullOrMonthAbbr:{regex:RegExp("^("+A+"|"+S+")","i"),name:"monthfull | monthabbr",callback:function(e,t){return this.ymd(this.y,_(t),this.d)}},tzCorrection:{regex:RegExp("^"+j,"i"),name:"tzcorrection",callback:function(e){return this.zone(M(e))}},tzAbbr:{regex:RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),name:"tzabbr",callback:function(e,t){var r=C[t.toLowerCase()];return!isNaN(r)&&this.zone(r)}},ago:{regex:/^ago/i,name:"ago",callback:function(){this.ry=-this.ry,this.rm=-this.rm,this.rd=-this.rd,this.rh=-this.rh,this.ri=-this.ri,this.rs=-this.rs,this.rf=-this.rf}},year4:{regex:RegExp("^"+v),name:"year4",callback:function(e,t){return this.y=+t,!0}},whitespace:{regex:/^[ .,\t]+/,name:"whitespace"},dateShortWithTimeLong:{regex:RegExp("^"+O+"t?"+i+"[:.]"+a+"[:.]"+c,"i"),name:"dateshortwithtimelong",callback:function(e,t,r,n,i,o){return this.ymd(this.y,_(t),+r)&&this.time(+n,+i,+o,0)}},dateShortWithTimeLong12:{regex:RegExp("^"+O+s+"[:.]"+a+"[:.]"+l+r+n,"i"),name:"dateshortwithtimelong12",callback:function(e,t,r,n,i,o,s){return this.ymd(this.y,_(t),+r)&&this.time(N(+n,s),+i,+o,0)}},dateShortWithTimeShort:{regex:RegExp("^"+O+"t?"+i+"[:.]"+a,"i"),name:"dateshortwithtimeshort",callback:function(e,t,r,n,i){return this.ymd(this.y,_(t),+r)&&this.time(+n,+i,0,0)}},dateShortWithTimeShort12:{regex:RegExp("^"+O+s+"[:.]"+p+r+n,"i"),name:"dateshortwithtimeshort12",callback:function(e,t,r,n,i,o){return this.ymd(this.y,_(t),+r)&&this.time(N(+n,o),+i,0,0)}}},F={y:NaN,m:NaN,d:NaN,h:NaN,i:NaN,s:NaN,f:NaN,ry:0,rm:0,rd:0,rh:0,ri:0,rs:0,rf:0,weekday:NaN,weekdayBehavior:0,firstOrLastDayOfMonth:0,z:NaN,dates:0,times:0,zones:0,ymd:function(e,t,r){return!(this.dates>0||(this.dates++,this.y=e,this.m=t,this.d=r,0))},time:function(e,t,r,n){return!(this.times>0||(this.times++,this.h=e,this.i=t,this.s=r,this.f=n,0))},resetTime:function(){return this.h=0,this.i=0,this.s=0,this.f=0,this.times=0,!0},zone:function(e){return this.zones<=1&&(this.zones++,this.z=e,!0)},toDate:function(e){switch(this.dates&&!this.times&&(this.h=this.i=this.s=this.f=0),isNaN(this.y)&&(this.y=e.getFullYear()),isNaN(this.m)&&(this.m=e.getMonth()),isNaN(this.d)&&(this.d=e.getDate()),isNaN(this.h)&&(this.h=e.getHours()),isNaN(this.i)&&(this.i=e.getMinutes()),isNaN(this.s)&&(this.s=e.getSeconds()),isNaN(this.f)&&(this.f=e.getMilliseconds()),this.firstOrLastDayOfMonth){case 1:this.d=1;break;case-1:this.d=0,this.m+=1}if(!isNaN(this.weekday)){var t=new Date(e.getTime());t.setFullYear(this.y,this.m,this.d),t.setHours(this.h,this.i,this.s,this.f);var r=t.getDay();if(2===this.weekdayBehavior)0===r&&0!==this.weekday&&(this.weekday=-6),0===this.weekday&&0!==r&&(this.weekday=7),this.d-=r,this.d+=this.weekday;else{var n=this.weekday-r;(this.rd<0&&n<0||this.rd>=0&&n<=-this.weekdayBehavior)&&(n+=7),this.weekday>=0?this.d+=n:this.d-=7-(Math.abs(this.weekday)-r),this.weekday=NaN}}this.y+=this.ry,this.m+=this.rm,this.d+=this.rd,this.h+=this.rh,this.i+=this.ri,this.s+=this.rs,this.f+=this.rf,this.ry=this.rm=this.rd=0,this.rh=this.ri=this.rs=this.rf=0;var i=new Date(e.getTime());switch(i.setFullYear(this.y,this.m,this.d),i.setHours(this.h,this.i,this.s,this.f),this.firstOrLastDayOfMonth){case 1:i.setDate(1);break;case-1:i.setMonth(i.getMonth()+1,0)}return isNaN(this.z)||i.getTimezoneOffset()===this.z||(i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate()),i.setUTCHours(i.getHours(),i.getMinutes(),i.getSeconds()-this.z,i.getMilliseconds())),i}};e.exports=function(e,t){null==t&&(t=Math.floor(Date.now()/1e3));for(var r=[D.yesterday,D.now,D.noon,D.midnightOrToday,D.tomorrow,D.timestamp,D.firstOrLastDay,D.backOrFrontOf,D.timeTiny12,D.timeShort12,D.timeLong12,D.mssqltime,D.timeShort24,D.timeLong24,D.iso8601long,D.gnuNoColon,D.iso8601noColon,D.americanShort,D.american,D.iso8601date4,D.iso8601dateSlash,D.dateSlash,D.gnuDateShortOrIso8601date2,D.gnuDateShorter,D.dateFull,D.pointedDate4,D.pointedDate2,D.dateNoDay,D.dateNoDayRev,D.dateTextual,D.dateNoYear,D.dateNoYearRev,D.dateNoColon,D.xmlRpc,D.xmlRpcNoColon,D.soap,D.wddx,D.exif,D.pgydotd,D.isoWeekDay,D.pgTextShort,D.pgTextReverse,D.clf,D.year4,D.ago,D.dayText,D.relativeTextWeek,D.relativeText,D.monthFullOrMonthAbbr,D.tzCorrection,D.tzAbbr,D.dateShortWithTimeShort12,D.dateShortWithTimeLong12,D.dateShortWithTimeShort,D.dateShortWithTimeLong,D.relative,D.whitespace],n=Object.create(F);e.length;){for(var i=null,o=null,s=0,a=r.length;si[0].length)&&(i=c,o=p)}if(!o||o.callback&&!1===o.callback.apply(n,i))return!1;e=e.substr(i[0].length),o=null,i=null}return Math.floor(n.toDate(new Date(1e3*t))/1e3)}},673:e=>{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(){var e,r=void 0,n=void 0,i=0,o=arguments,s=o.length,a=function(e){if("[object Array]"===Object.prototype.toString.call(e))return e;var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},p=function e(r,n){var i=0,o=0,s=0,p=0,c=0;if(r===n)return 0;if("object"===(void 0===r?"undefined":t(r))){if("object"===(void 0===n?"undefined":t(n))){if(r=a(r),n=a(n),c=r.length,(p=n.length)>c)return 1;if(p0?1:-1:n===r?0:n>r?1:-1};if(0===s)throw new Error("At least one value should be passed to max()");if(1===s){if("object"!==t(o[0]))throw new Error("Wrong parameter count for max()");if(0===(r=a(o[0])).length)throw new Error("Array must contain at least one element for max()")}else r=o;for(n=r[0],i=1,e=r.length;i{"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(){var e,r=void 0,n=void 0,i=0,o=arguments,s=o.length,a=function(e){if("[object Array]"===Object.prototype.toString.call(e))return e;var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},p=function e(r,n){var i=0,o=0,s=0,p=0,c=0;if(r===n)return 0;if("object"===(void 0===r?"undefined":t(r))){if("object"===(void 0===n?"undefined":t(n))){if(r=a(r),n=a(n),c=r.length,(p=n.length)>c)return 1;if(p0?1:-1:n===r?0:n>r?1:-1};if(0===s)throw new Error("At least one value should be passed to min()");if(1===s){if("object"!==t(o[0]))throw new Error("Wrong parameter count for min()");if(0===(r=a(o[0])).length)throw new Error("Array must contain at least one element for min()")}else r=o;for(n=r[0],i=1,e=r.length;i{"use strict";function n(e,t){var r=Math.floor(Math.abs(e)+.5);return("PHP_ROUND_HALF_DOWN"===t&&e===r-.5||"PHP_ROUND_HALF_EVEN"===t&&e===.5+2*Math.floor(r/2)||"PHP_ROUND_HALF_ODD"===t&&e===.5+2*Math.floor(r/2)-1)&&(r-=1),e<0?-r:r}e.exports=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"PHP_ROUND_HALF_UP",s=r(892),a=r(791);if(e=s(e),i=a(i),t=Math.pow(10,i),isNaN(e)||!isFinite(e))return e;if(Math.trunc(e)===e&&i>=0)return e;var p=14-Math.floor(Math.log10(Math.abs(e)));return p>i&&p-15{"use strict";e.exports=function(){var e=arguments,t=0,r=e[t++],n=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":new Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},i=function(e,t,r,i,o){var s=i-e.length;return s>0&&(e=r||"0"!==o?n(e,i,o,r):[e.slice(0,t.length),n("",s,"0",!0),e.slice(t.length)].join("")),e},o=function(e,t,r,o,s,a){return e=n((e>>>0).toString(t),s||0,"0",!1),i(e,"",r,o,a)},s=function(e,t,r,n,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,o)};try{return r.replace(/%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g,(function(r,a,p,c,l,u){var h=void 0,f=void 0,d=void 0,y=void 0,g=void 0;if("%%"===r)return"%";var m,x=" ",v=!1,b="",w=void 0;for(w=0,m=p.length;w-1?6:void 0,a&&0==+a)throw new Error("Argument number must be greater than zero");if(a&&+a>=e.length)throw new Error("Too few arguments");switch(g=a?e[+a]:e[t++],u){case"%":return"%";case"s":return s(g+"",v,c,l,x);case"c":return s(String.fromCharCode(+g),v,c,l,x);case"b":return o(g,2,v,c,l,x);case"o":return o(g,8,v,c,l,x);case"x":return o(g,16,v,c,l,x);case"X":return o(g,16,v,c,l,x).toUpperCase();case"u":return o(g,10,v,c,l,x);case"i":case"d":return h=+g||0,g=(f=(h=Math.round(h-h%1))<0?"-":b)+n(String(Math.abs(h)),l,"0",!1),v&&"0"===x&&(x=" "),i(g,f,v,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return f=(h=+g)<0?"-":b,d=["toExponential","toFixed","toPrecision"]["efg".indexOf(u.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(u)%2],g=f+Math.abs(h)[d](l),i(g,f,v,c,x)[y]();default:return""}}))}catch(e){return!1}}},359:(e,t,r)=>{"use strict";e.exports=function(e,t){var n=r(521);t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var i=/<\/?([a-z0-9]*)\b[^>]*>?/gi,o=/|<\?(?:php)?[\s\S]*?\?>/gi,s=n(e);for(s="<"===s.substring(s.length-1)?s.substring(0,s.length-1):s;;){var a=s;if(s=a.replace(o,"").replace(i,(function(e,r){return t.indexOf("<"+r.toLowerCase()+">")>-1?e:""})),a===s)return s}}},436:(e,t,r)=>{"use strict";e.exports=function(e,t){return r(296).apply(this,[e].concat(t))}},315:e=>{"use strict";e.exports=function(e){return!1!==e&&0!==e&&0!==e&&""!==e&&"0"!==e&&(!Array.isArray(e)||0!==e.length)&&null!=e}},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a2){var p=n.lastIndexOf("/");if(p!==n.length-1){-1===p?(n="",i=0):i=(n=n.slice(0,p)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;ic){if(47===r.charCodeAt(a+u))return r.slice(a+u+1);if(0===u)return r.slice(a+u)}else s>c&&(47===e.charCodeAt(i+u)?l=u:0===u&&(l=0));break}var h=e.charCodeAt(i+u);if(h!==r.charCodeAt(a+u))break;47===h&&(l=u)}var f="";for(u=i+l+1;u<=o;++u)u!==o&&47!==e.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(a+l):(a+=l,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,p=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===p&&(s=!1,p=n+1),a>=0&&(c===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=p))}return i===o?o=p:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var p=e.charCodeAt(a);if(47!==p)-1===i&&(o=!1,i=a+1),46===p?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,p=-1,c=!0,l=e.length-1,u=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(c=!1,p=l+1),46===i?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){a=l+1;break}return-1===s||-1===p||0===u||1===u&&s===p-1&&s===a+1?-1!==p&&(r.base=r.name=0===a&&o?e.slice(1,p):e.slice(a,p)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,p)):(r.name=e.slice(a,s),r.base=e.slice(a,p)),r.ext=e.slice(s,p)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},351:()=>{}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(209);var e,t},e.exports=t()},860:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad"},o=n.twig({id:"src/views/partials/header.twig",data:[{type:"raw",value:"\n
    Header: ",position:{start:43,end:57}},{type:"output",position:{start:57,end:71},stack:[{type:"Twig.expression.type.variable",value:"headline",match:["headline"],position:{start:57,end:71}}]},{type:"raw",value:"
    \n",position:{start:71,end:78}},{type:"raw",value:"\n
    Lang: ",position:{start:146,end:158}},{type:"output",position:{start:158,end:168},stack:[{type:"Twig.expression.type.variable",value:"lang",match:["lang"],position:{start:158,end:168}}]},{type:"raw",value:"
    \n",position:{start:168,end:168}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign({},i,e))},175:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad",lang:"en"},o=n.twig({id:"src/views/partials/people.twig",data:[{type:"raw",value:"\n",position:{start:33,end:34}},{type:"logic",token:{type:"Twig.logic.type.include",only:!1,ignoreMissing:!1,stack:[{type:"Twig.expression.type.string",value:"src/views/partials/header.twig"}],position:{start:34,end:61}},position:{start:34,end:61}},{type:"raw",value:"\n",position:{start:62,end:63}},{type:"raw",value:'\n
      \n ',position:{start:98,end:120}},{type:"logic",token:{type:"Twig.logic.type.for",keyVar:null,valueVar:"item",expression:[{type:"Twig.expression.type.variable",value:"people",match:["people"]}],position:{start:120,end:144},output:[{type:"raw",value:"
    • ",position:{start:145,end:157}},{type:"output",position:{start:157,end:167},stack:[{type:"Twig.expression.type.variable",value:"item",match:["item"],position:{start:157,end:167}}]},{type:"raw",value:"
    • \n ",position:{start:167,end:177}}]},position:{open:{start:120,end:144},close:{start:177,end:189}}},{type:"raw",value:"
    \n\n",position:{start:190,end:197}},{type:"raw",value:"\n",position:{start:234,end:235}},{type:"logic",token:{type:"Twig.logic.type.include",only:!1,ignoreMissing:!1,stack:[{type:"Twig.expression.type.string",value:"src/views/partials/star.twig"}],position:{start:235,end:270}},position:{start:235,end:270}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign({},i,e))},197:(e,t,r)=>{r(860),r(197);var n=r(766),i={headline:"Breaking Bad"},o=n.twig({id:"src/views/partials/star.twig",data:[{type:"raw",value:'
    ++ Included partial ++
    \n',position:{start:0,end:0}}],allowInlineIncludes:!0,rethrow:!0,precompiled:!0});e.exports=e=>o.render(Object.assign({},i,e))},487:(e,t,r)=>{"use strict";e.exports=r.p+"img/stern.6adb226f.svg"}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{"use strict";var e=r(175);const t=r.n(e)()({people:["Walter White","Jesse Pinkman"]});document.getElementById("content").innerHTML=t,console.log(">> app")})()})(); \ No newline at end of file diff --git a/test/cases/_pug/js-tmpl-data-external-compile/expected/main.js b/test/cases/_pug/js-tmpl-data-external-compile/expected/main.js index c0bf8373..3a17abcb 100644 --- a/test/cases/_pug/js-tmpl-data-external-compile/expected/main.js +++ b/test/cases/_pug/js-tmpl-data-external-compile/expected/main.js @@ -1 +1 @@ -(()=>{var e={323:e=>{function t(e){var t=""+e,n=r.exec(t);if(!n)return e;var a,i,o,u="";for(a=n.index,i=0;a]/,n={title:{create:e=>`My '${e}' title!`},a:"abc",b:123};e.exports=e=>function(e){var r,n="",i=e||{};return function(e,a,i){n=n+"

    Title: "+t(null==(r=i.create("customized"))?"":r)+"

    Param[a]: "+t(null==(r=e)?"":r)+"
    Param[b]: "+t(null==(r=a)?"":r)+"
    "}.call(this,"a"in i?i.a:"undefined"!=typeof a?a:void 0,"b"in i?i.b:"undefined"!=typeof b?b:void 0,"title"in i?i.title:"undefined"!=typeof title?title:void 0),n}(Object.assign(n,e))}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(323),t=r.n(e);document.getElementById("root").innerHTML=t()({b:987}),console.log(">> main")})()})(); \ No newline at end of file +(()=>{var e={323:e=>{function t(e){var t=""+e,n=r.exec(t);if(!n)return e;var a,i,o,u="";for(a=n.index,i=0;a]/,n={title:{create:e=>`My '${e}' title!`},a:"abc",b:123};e.exports=e=>function(e){var r,n="",i=e||{};return function(e,a,i){n=n+"

    Title: "+t(null==(r=i.create("customized"))?"":r)+"

    Param[a]: "+t(null==(r=e)?"":r)+"
    Param[b]: "+t(null==(r=a)?"":r)+"
    "}.call(this,"a"in i?i.a:"undefined"!=typeof a?a:void 0,"b"in i?i.b:"undefined"!=typeof b?b:void 0,"title"in i?i.title:"undefined"!=typeof title?title:void 0),n}(Object.assign({},n,e))}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(323),t=r.n(e);document.getElementById("root").innerHTML=t()({b:987}),console.log(">> main")})()})(); \ No newline at end of file diff --git a/test/cases/js-import-css-modules-cjs/expected/index.html b/test/cases/js-import-css-modules-cjs/expected/index.html index 37af4fa5..91dc19d4 100644 --- a/test/cases/js-import-css-modules-cjs/expected/index.html +++ b/test/cases/js-import-css-modules-cjs/expected/index.html @@ -3,7 +3,7 @@ CJS - +
    diff --git a/test/cases/js-import-css-modules-cjs/expected/js/main.09b19148.js b/test/cases/js-import-css-modules-cjs/expected/js/main.09b19148.js deleted file mode 100644 index d508a0f3..00000000 --- a/test/cases/js-import-css-modules-cjs/expected/js/main.09b19148.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var __webpack_modules__={654:e=>{e.exports={red:"style__red--gvFM4","lime-green":"style__lime-green--joDXV",limeGreen:"style__lime-green--joDXV",royal_blue:"style__royal_blue--ATLkt",royalBlue:"style__royal_blue--ATLkt"}},449:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(742),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='

    Hello World!

    \n
    Red: ',__eta.res+=__eta.e(styles.red),__eta.res+='
    \n
    Green: ',__eta.res+=__eta.e(styles.limeGreen),__eta.res+='
    \n
    Blue: ',__eta.res+=__eta.e(styles.royalBlue),__eta.res+="
    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},742:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class a extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends a{constructor(e){super(e),this.name="EtaParser Error"}}class c extends a{constructor(e){super(e),this.name="EtaRuntime Error"}}class l extends a{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const s=t.slice(0,n).split(/\n/),r=s.length,a=s[r-1].length+1;throw e+=" at line "+r+" col "+a+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^",new i(e)}function _(e,t,n,s){const r=t.split("\n"),a=Math.max(n-3,0),i=Math.min(r.length,n+3),l=s,o=r.slice(a,i).map((function(e,t){const s=t+a+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),_=new c((l?l+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,s=t&&t.async?u:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,s=t&&t.async,r=this.compileBody,a=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,a)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,b=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function k(e){const t=this.config;let n=[],s=!1,r=0;const a=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(449),t=__webpack_require__.n(e),n=__webpack_require__(654),s=__webpack_require__.n(n);document.getElementById("root").innerHTML=t()({styles:s()})})()})(); \ No newline at end of file diff --git a/test/cases/js-import-css-modules-cjs/expected/js/main.64fa9b92.js b/test/cases/js-import-css-modules-cjs/expected/js/main.64fa9b92.js new file mode 100644 index 00000000..9ee13df4 --- /dev/null +++ b/test/cases/js-import-css-modules-cjs/expected/js/main.64fa9b92.js @@ -0,0 +1 @@ +(()=>{var __webpack_modules__={654:e=>{e.exports={red:"style__red--gvFM4","lime-green":"style__lime-green--joDXV",limeGreen:"style__lime-green--joDXV",royal_blue:"style__royal_blue--ATLkt",royalBlue:"style__royal_blue--ATLkt"}},449:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(742),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='

    Hello World!

    \n
    Red: ',__eta.res+=__eta.e(styles.red),__eta.res+='
    \n
    Green: ',__eta.res+=__eta.e(styles.limeGreen),__eta.res+='
    \n
    Blue: ',__eta.res+=__eta.e(styles.royalBlue),__eta.res+="
    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},742:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class a extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends a{constructor(e){super(e),this.name="EtaParser Error"}}class c extends a{constructor(e){super(e),this.name="EtaRuntime Error"}}class l extends a{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const s=t.slice(0,n).split(/\n/),r=s.length,a=s[r-1].length+1;throw e+=" at line "+r+" col "+a+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^",new i(e)}function _(e,t,n,s){const r=t.split("\n"),a=Math.max(n-3,0),i=Math.min(r.length,n+3),l=s,o=r.slice(a,i).map((function(e,t){const s=t+a+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),_=new c((l?l+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function p(e,t){const n=this.config,s=t&&t.async?u:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function h(e,t){const n=this.config,s=t&&t.async,r=this.compileBody,a=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,a)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,b=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function k(e){const t=this.config;let n=[],s=!1,r=0;const a=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(449),t=__webpack_require__.n(e),n=__webpack_require__(654),s=__webpack_require__.n(n);document.getElementById("root").innerHTML=t()({styles:s()})})()})(); \ No newline at end of file diff --git a/test/cases/js-import-css-modules-esm/expected/index.html b/test/cases/js-import-css-modules-esm/expected/index.html index a6f1bbff..a8fec1f5 100644 --- a/test/cases/js-import-css-modules-esm/expected/index.html +++ b/test/cases/js-import-css-modules-esm/expected/index.html @@ -3,7 +3,7 @@ ESM - +
    diff --git a/test/cases/js-import-css-modules-esm/expected/js/main.b360f9a6.js b/test/cases/js-import-css-modules-esm/expected/js/main.b360f9a6.js new file mode 100644 index 00000000..4daccc7c --- /dev/null +++ b/test/cases/js-import-css-modules-esm/expected/js/main.b360f9a6.js @@ -0,0 +1 @@ +(()=>{var __webpack_modules__={449:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(742),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='

    Hello World!

    \n
    Red: ',__eta.res+=__eta.e(styles.red),__eta.res+='
    \n
    Green: ',__eta.res+=__eta.e(styles.limeGreen),__eta.res+='
    \n
    Blue: ',__eta.res+=__eta.e(styles.royalBlue),__eta.res+="
    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign({},data,e));module.exports=templateFn},742:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class a extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends a{constructor(e){super(e),this.name="EtaParser Error"}}class c extends a{constructor(e){super(e),this.name="EtaRuntime Error"}}class l extends a{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const s=t.slice(0,n).split(/\n/),r=s.length,a=s[r-1].length+1;throw e+=" at line "+r+" col "+a+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^",new i(e)}function _(e,t,n,s){const r=t.split("\n"),a=Math.max(n-3,0),i=Math.min(r.length,n+3),l=s,o=r.slice(a,i).map((function(e,t){const s=t+a+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),_=new c((l?l+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function h(e,t){const n=this.config,s=t&&t.async?u:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function p(e,t){const n=this.config,s=t&&t.async,r=this.compileBody,a=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,a)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,b=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function F(e){const t=this.config;let n=[],s=!1,r=0;const a=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(449),t=__webpack_require__.n(e);document.getElementById("root").innerHTML=t()({styles:{"lime-green":"style__lime-green--joDXV",limeGreen:"style__lime-green--joDXV",red:"style__red--gvFM4",royalBlue:"style__royal_blue--ATLkt",royal_blue:"style__royal_blue--ATLkt"}})})()})(); \ No newline at end of file diff --git a/test/cases/js-import-css-modules-esm/expected/js/main.f73732d8.js b/test/cases/js-import-css-modules-esm/expected/js/main.f73732d8.js deleted file mode 100644 index 18cb6589..00000000 --- a/test/cases/js-import-css-modules-esm/expected/js/main.f73732d8.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var __webpack_modules__={449:(module,__unused_webpack_exports,__webpack_require__)=>{var{Eta}=__webpack_require__(742),eta=new Eta({}),data={},etaFn=function(it){let include=(e,t)=>this.render(e,t,options),includeAsync=(e,t)=>this.renderAsync(e,t,options),__eta={res:"",e:this.config.escapeFunction,f:this.config.filterFunction};function layout(e,t){__eta.layout=e,__eta.layoutData=t}with(it||{})__eta.res+='

    Hello World!

    \n
    Red: ',__eta.res+=__eta.e(styles.red),__eta.res+='
    \n
    Green: ',__eta.res+=__eta.e(styles.limeGreen),__eta.res+='
    \n
    Blue: ',__eta.res+=__eta.e(styles.royalBlue),__eta.res+="
    ",__eta.layout&&(__eta.res=include(__eta.layout,{...it,body:__eta.res,...__eta.layoutData}));return __eta.res},templateFn=e=>etaFn.bind(eta)(Object.assign(data,e));module.exports=templateFn},742:(e,t,n)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t$});class r{constructor(e){this.cache=void 0,this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache=s({},this.cache,e)}}class a extends Error{constructor(e){super(e),this.name="Eta Error"}}class i extends a{constructor(e){super(e),this.name="EtaParser Error"}}class c extends a{constructor(e){super(e),this.name="EtaRuntime Error"}}class l extends a{constructor(e){super(e),this.name="EtaNameResolution Error"}}function o(e,t,n){const s=t.slice(0,n).split(/\n/),r=s.length,a=s[r-1].length+1;throw e+=" at line "+r+" col "+a+":\n\n "+t.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^",new i(e)}function _(e,t,n,s){const r=t.split("\n"),a=Math.max(n-3,0),i=Math.min(r.length,n+3),l=s,o=r.slice(a,i).map((function(e,t){const s=t+a+1;return(s==n?" >> ":" ")+s+"| "+e})).join("\n"),_=new c((l?l+":"+n+"\n":"line "+n+"\n")+o+"\n\n"+e.message);throw _.name=e.name,_}const u=async function(){}.constructor;function h(e,t){const n=this.config,s=t&&t.async?u:Function;try{return new s(n.varName,"options",this.compileToString.call(this,e,t))}catch(n){throw n instanceof SyntaxError?new i("Bad template syntax\n\n"+n.message+"\n"+Array(n.message.length+1).join("=")+"\n"+this.compileToString.call(this,e,t)+"\n"):n}}function p(e,t){const n=this.config,s=t&&t.async,r=this.compileBody,a=this.parse.call(this,e);let i=`${n.functionHeader}\nlet include = (template, data) => this.render(template, data, options);\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\n\nlet __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?', line: 1, templateStr: "'+e.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${n.debug?"try {":""}${n.useWith?"with("+n.varName+"||{}){":""}\n\n${r.call(this,a)}\nif (__eta.layout) {\n __eta.res = ${s?"await includeAsync":"include"} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});\n}\n${n.useWith?"}":""}${n.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}\nreturn __eta.res;\n`;if(n.plugins)for(let e=0;e":">",'"':""","'":"'"};function f(e){return g[e]}const m={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:function(e){const t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,f):t},filterFunction:e=>String(e),functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},y=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,b=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function w(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e.slice(0,t).split("\n").length}function F(e){const t=this.config;let n=[],s=!1,r=0;const a=t.parse;if(t.plugins)for(let n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(449),t=__webpack_require__.n(e);document.getElementById("root").innerHTML=t()({styles:{"lime-green":"style__lime-green--joDXV",limeGreen:"style__lime-green--joDXV",red:"style__red--gvFM4",royalBlue:"style__royal_blue--ATLkt",royal_blue:"style__royal_blue--ATLkt"}})})()})(); \ No newline at end of file diff --git a/test/preprocessor.test.js b/test/preprocessor.test.js index 3f79b560..d9c79cec 100644 --- a/test/preprocessor.test.js +++ b/test/preprocessor.test.js @@ -99,6 +99,7 @@ describe('usage template in js on client side', () => { // Handlebars test('hbs: compile to fn', () => compareFiles('_preprocessor/js-tmpl-hbs-compile')); test('hbs: compile to fn with partials', () => compareFiles('_preprocessor/js-tmpl-hbs-compile-partials')); + test('hbs: compile to fn with variables', () => compareFiles('_preprocessor/js-tmpl-hbs-compile-variables')); // Nunjucks test('njk: compile to fn', () => compareFiles('_preprocessor/js-tmpl-njk-compile'));