@rhinostone/swig 2.0.0-alpha.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.changes/v1.0.0-pre1.md +2 -2
  2. package/.changes/v1.0.0.md +1 -1
  3. package/.changes/v2.0.0.md +6 -0
  4. package/.playwright-mcp/console-2026-04-22T15-34-20-480Z.log +2 -0
  5. package/.playwright-mcp/console-2026-04-22T15-35-04-265Z.log +11 -0
  6. package/.playwright-mcp/console-2026-04-22T15-37-26-953Z.log +1 -0
  7. package/.playwright-mcp/console-2026-04-22T15-51-15-160Z.log +148 -0
  8. package/.playwright-mcp/console-2026-04-22T15-51-33-405Z.log +74 -0
  9. package/.playwright-mcp/console-2026-04-22T15-51-53-922Z.log +74 -0
  10. package/.playwright-mcp/console-2026-04-22T15-53-10-736Z.log +74 -0
  11. package/.playwright-mcp/console-2026-04-22T15-53-40-091Z.log +883 -0
  12. package/.playwright-mcp/console-2026-04-22T16-12-02-541Z.log +74 -0
  13. package/.playwright-mcp/console-2026-04-22T16-33-44-982Z.log +13973 -0
  14. package/.playwright-mcp/page-2026-04-22T15-34-24-524Z.yml +1 -0
  15. package/.playwright-mcp/page-2026-04-22T15-35-04-346Z.yml +0 -0
  16. package/.playwright-mcp/page-2026-04-22T15-37-27-039Z.yml +5 -0
  17. package/.playwright-mcp/page-2026-04-22T15-51-15-600Z.yml +76 -0
  18. package/.playwright-mcp/page-2026-04-22T15-51-33-605Z.yml +0 -0
  19. package/.playwright-mcp/page-2026-04-22T15-51-54-206Z.yml +676 -0
  20. package/.playwright-mcp/page-2026-04-22T15-53-11-277Z.yml +632 -0
  21. package/.playwright-mcp/page-2026-04-22T15-53-40-297Z.yml +0 -0
  22. package/.playwright-mcp/page-2026-04-22T16-12-02-855Z.yml +0 -0
  23. package/.playwright-mcp/page-2026-04-22T16-33-45-281Z.yml +0 -0
  24. package/HISTORY.md +10 -3
  25. package/README.md +32 -6
  26. package/ROADMAP.md +29 -6
  27. package/dist/swig.js +3 -3
  28. package/dist/swig.min.js +3 -3
  29. package/dist/swig.min.js.map +1 -1
  30. package/lib/swig.js +2 -2
  31. package/package.json +2 -2
package/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ [2.0.0](https://github.com/gina-io/swig/tree/v2.0.0) / 2026-05-06
2
+ -----------------------------------------------------------------
3
+
4
+ * **Fixed** Refreshed stale external URL references across documentation surfaces from the 2026-04-13 link-health audit (gina-io/gina#18). `README.md`, `packages/swig-core/README.md`, `packages/swig-twig/README.md` — swapped `www.npmjs.org` for the canonical `www.npmjs.com` in the NPM badges (the old `.org` form now redirects). `README.md` — rewrote the "Swig v0.x → v1.x migration notes" bullet, since the `paularmstrong/swig/wiki/Migrating-from-...` page was deleted upstream (302s to repo root). `HISTORY.md` — dropped the three dead upstream-wiki links around the v1.0.0 / v1.0.0-pre1 entries; the breaking-change prose stays intact. `browser/comments.js` — updated the DateZ `@license` URL from `TomoUniversalis/DateZ` to `ocrybit/DateZ` (the upstream GitHub user was renamed). `packages/swig-core/lib/dateformatter.js` — dropped the dead `http://tomouniversalis.com` parenthetical from the DateZ copyright comment (domain NXDOMAINs). `.changes/v1.0.0.md` and `.changes/v1.0.0-pre1.md` synced to match the rewritten `HISTORY.md` lines so future `changie merge` runs stay idempotent. Documentation and comment-only; no runtime or API change.
5
+
6
+ * **Changed** `2.0.0` stable. Multi-flavor architecture (introduced across `2.0.0-alpha.1` through `2.0.0-alpha.5`) is the production-ready cut. No functional or API changes since `2.0.0-alpha.5`; the `alpha.6`–`alpha.8` cycle was metadata republishes plus removal of the soft-deprecated `exports.parse` Path B wrapper from `@rhinostone/swig-twig`. IR ABI is stable from this release onward; cross-package dependencies pin exact versions and frontends + core release in lockstep. README messaging refreshed across all three packages to reflect production-ready status; package descriptions cleaned of historical internal-tracking references.
7
+
1
8
  [2.0.0-alpha.8](https://github.com/gina-io/swig/tree/v2.0.0-alpha.8) / 2026-04-20
2
9
  ---------------------------------------------------------------------------------
3
10
 
@@ -186,7 +193,7 @@
186
193
  * **Fixed** Allow parent and other tags to work correctly nested in other tags. gh-331
187
194
  * **Fixed** Prevent lexer from matching partial logic/words in variables. gh-330
188
195
 
189
- Migrating from v0.x.x? View the [Migration Guide](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0)
196
+ Migrating from v0.x.x? The upstream wiki has since been deleted; see the individual breaking-change entries below.
190
197
 
191
198
  [1.0.0-rc3](https://github.com/paularmstrong/swig/tree/v1.0.0-rc3) / 2013-09-14
192
199
  -------------------------------------------------------------------------------
@@ -259,8 +266,8 @@ Migrating from v0.x.x? View the [Migration Guide](https://github.com/paularmstro
259
266
  * **Changed** Template parsing has been completely rewritten
260
267
  * **Changed** `swig.compileFile` returns a function that renders templates, not an object
261
268
  * **Changed** Express-compatible using `swig.renderFile`.
262
- * **Changed** `extends`, `import`, and `include` now reference files with relative paths from the current file ([info](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0#extends-include-import-changes)).
263
- * **Changed** `extends` may no longer accept variables ([info](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0#extends-include-import-changes)).
269
+ * **Changed** `extends`, `import`, and `include` now reference files with relative paths from the current file.
270
+ * **Changed** `extends` may no longer accept variables.
264
271
  * **Changed** `else if` tag is now `elseif` or `elif`.
265
272
  * **Changed** Removed `only` argument from `include`.
266
273
  * **Changed** allow `_`, `$` to start var names in templates.
package/README.md CHANGED
@@ -1,37 +1,54 @@
1
1
  Swig
2
2
  ====
3
3
 
4
- [![CI](https://github.com/gina-io/swig/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/gina-io/swig/actions/workflows/ci.yml) [![NPM version](http://img.shields.io/npm/v/@rhinostone/swig.svg?style=flat)](https://www.npmjs.org/package/@rhinostone/swig) [![NPM Downloads](http://img.shields.io/npm/dm/@rhinostone/swig.svg?style=flat)](https://www.npmjs.org/package/@rhinostone/swig) [![Socket Badge](https://socket.dev/api/badge/npm/package/@rhinostone/swig)](https://socket.dev/npm/package/@rhinostone/swig)
4
+ [![CI](https://github.com/gina-io/swig/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/gina-io/swig/actions/workflows/ci.yml) [![NPM version](http://img.shields.io/npm/v/@rhinostone/swig.svg?style=flat)](https://www.npmjs.com/package/@rhinostone/swig) [![NPM Downloads](http://img.shields.io/npm/dm/@rhinostone/swig.svg?style=flat)](https://www.npmjs.com/package/@rhinostone/swig) [![Socket Badge](https://socket.dev/api/badge/npm/package/@rhinostone/swig)](https://socket.dev/npm/package/@rhinostone/swig)
5
5
 
6
- > **Maintained fork.** This is [gina-io/swig](https://github.com/gina-io/swig), a maintained fork of the abandoned [paularmstrong/swig](https://github.com/paularmstrong/swig). Security fixes and critical bug fixes land here; no new features are planned. The original project has not had a release since 2014.
6
+ > **Maintained, multi-flavor template engine.** Originally forked from the abandoned [paularmstrong/swig](https://github.com/paularmstrong/swig); now [gina-io/swig](https://github.com/gina-io/swig), an actively developed workspace covering native Swig syntax (Jinja2/Django-inspired) and Twig syntax via dedicated frontends sharing one IR backend. Security and bug fixes ship here; the original project has not had a release since 2014.
7
7
 
8
8
  > **Part of the [Gina](https://github.com/gina-io/gina) ecosystem.** This fork is the built-in template engine for [Gina](https://gina.io) ([npm](https://www.npmjs.com/package/gina)), a Node.js MVC framework with HTTP/2, multi-bundle architecture, and scope-based data isolation.
9
9
 
10
10
  Swig is a **Jinja2/Django-inspired** template engine for node.js and browsers. The syntax will feel familiar to Jinja2 and Django users, but Swig is **not drop-in compatible** with either — porting templates from an existing project requires a handful of changes. See the [Migration Guide](https://gina.io/docs/swig/migration) for the full parity list and workaround patterns.
11
11
 
12
+ > **Coming from Twig?** Install [@rhinostone/swig-twig](https://www.npmjs.com/package/@rhinostone/swig-twig) instead — a dedicated Twig-syntax frontend with closer parity than working around incompatibilities here.
13
+
14
+ Workspace packages
15
+ ------------------
16
+
17
+ | Package | Description | When to use |
18
+ | --- | --- | --- |
19
+ | [`@rhinostone/swig`](https://www.npmjs.com/package/@rhinostone/swig) | Native Swig syntax (Jinja2/Django-inspired). Drop-in for `@rhinostone/swig@1.x` consumers. | Upgrading from `@rhinostone/swig@1.x`, or starting fresh with Swig syntax. |
20
+ | [`@rhinostone/swig-twig`](https://www.npmjs.com/package/@rhinostone/swig-twig) | Twig-syntax frontend with closer Twig parity. | Migrating from PHP Twig, or writing new templates in Twig syntax. |
21
+ | [`@rhinostone/swig-core`](https://www.npmjs.com/package/@rhinostone/swig-core) | Shared IR, backend, and runtime primitives. | Building a custom flavor frontend. Otherwise pulled in transitively. |
22
+
23
+ Each frontend pins the matching `@rhinostone/swig-core` version exactly during the alpha cycle — the IR is not stable across alpha minors. From `2.0.0` stable onward, frontends and the core release in lockstep.
24
+
12
25
  Features
13
26
  --------
14
27
 
15
- * Available for node.js **and** major web browsers!
28
+ * Available for node.js **and** major web browsers.
16
29
  * [Express](http://expressjs.com/) compatible.
17
30
  * Object-Oriented template inheritance.
18
31
  * Apply filters and transformations to output in your templates.
19
32
  * Automatically escapes all output for safe HTML rendering.
20
33
  * Lots of iteration and conditionals supported.
21
34
  * Robust without the bloat.
22
- * Extendable and customizable. See [Swig-Extras](https://github.com/paularmstrong/swig-extras) (abandoned, kept for reference) for some examples.
35
+ * Extendable and customizable register custom filters, tags, and loaders per-instance.
23
36
 
24
37
  Need Help? Have Questions? Comments?
25
38
  ------------------------------------
26
39
 
27
40
  * File an issue at [gina-io/swig/issues](https://github.com/gina-io/swig/issues).
28
- * [Swig v0.x → v1.x migration notes](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0) — original upstream wiki, still authoritative for that version jump. (For porting *from Jinja2 or Django* into Swig, see the [Migration Guide](https://gina.io/docs/swig/migration) below.)
41
+ * Swig v0.x → v1.x migration notes — the original upstream wiki has been deleted; see `HISTORY.md` entries around v1.0.0 for the individual breaking changes. For porting *from Jinja2 or Django* into Swig, see the [Migration Guide](https://gina.io/docs/swig/migration).
29
42
 
30
43
  Installation
31
44
  ------------
32
45
 
33
46
  npm install @rhinostone/swig
34
47
 
48
+ For Twig syntax:
49
+
50
+ npm install @rhinostone/swig-twig
51
+
35
52
  Documentation
36
53
  -------------
37
54
 
@@ -75,6 +92,13 @@ var output = template({
75
92
 
76
93
  For working example see [examples/basic](https://github.com/gina-io/swig/tree/master/examples/basic).
77
94
 
95
+ Migrating from `@rhinostone/swig@1.x`
96
+ -------------------------------------
97
+
98
+ `@rhinostone/swig@2.x` is **drop-in for `1.x` consumers** — `swig.compileFile`, `swig.renderFile`, `swig.setFilter`, `swig.setTag`, and the rest of the public API are unchanged. The internal carve into [@rhinostone/swig-core](https://www.npmjs.com/package/@rhinostone/swig-core) is transparent (test gate during the alpha cycle: byte-identical compiled output against the `1.x` test suite).
99
+
100
+ `2.0.0` also ships [@rhinostone/swig-twig](https://www.npmjs.com/package/@rhinostone/swig-twig), a sibling Twig-syntax frontend. Switching is opt-in — your existing `@rhinostone/swig` install keeps working.
101
+
78
102
  Migrating from Jinja2 or Django
79
103
  -------------------------------
80
104
 
@@ -94,7 +118,9 @@ Full parity tables and workaround patterns: **[Migration Guide](https://gina.io/
94
118
  How it works
95
119
  ------------
96
120
 
97
- Swig reads template files and translates them into cached javascript functions. When we later render a template we call the evaluated function, passing a context object as an argument.
121
+ Swig reads template files and translates them into cached JavaScript functions. The pipeline is: parse emit IR lower IR to JS source → `new Function(...)`. At render time, the compiled function runs against a context object to produce the output string.
122
+
123
+ In `2.x`, frontend parsers (native Swig syntax in [@rhinostone/swig](https://www.npmjs.com/package/@rhinostone/swig), Twig syntax in [@rhinostone/swig-twig](https://www.npmjs.com/package/@rhinostone/swig-twig)) emit a shared intermediate representation. The backend in [@rhinostone/swig-core](https://www.npmjs.com/package/@rhinostone/swig-core) lowers IR to JS. New flavors plug in at the frontend without touching the runtime.
98
124
 
99
125
  License
100
126
  -------
package/ROADMAP.md CHANGED
@@ -10,22 +10,45 @@ For bug reports and feature requests, file an issue at [gina-io/swig](https://gi
10
10
 
11
11
  | Status | Item |
12
12
  | --- | --- |
13
- | Planned | Port the native Swig frontend to emit IR instead of JS directly. Test gate: byte-identical compiled output for existing suites. Target: `2.0.0-alpha.2`. |
13
+ | Planned | Unfork from `paularmstrong/swig` on GitHub. Multi-flavor track is now stable; the repo is substantively its own project. Attribution stays preserved via `LICENSE` and `package.json.author`. |
14
14
 
15
15
  ## Future (post-2.0)
16
16
 
17
- Multi-flavor architecture — a single backend with swappable frontends so Twig / Jinja2 / Django templates can run on the same compile pipeline. Design: `multi-flavor-ir.md`.
18
-
19
17
  | Status | Item |
20
18
  | --- | --- |
21
- | Planned | Ship `@rhinostone/swig-twig` frontend expression sugar (`~`, `??`, `?:`, `..`, `is X`, `not in`, `#{}`), Twig tag rewrites (`apply`, `verbatim`, `set/endset`, `with/endwith`, `from import`), ~20 filter parity. |
22
- | Planned | Ship Jinja2 and Django frontends. On demand when there's concrete user demand. |
23
- | Planned | Engine bump + test framework migration. Move to Node ≥ 18, `node:test` + `node:assert/strict`, swap mocha-phantomjs for a modern browser-test harness, swap blanket for `c8`. Bundled with `2.0.0`. |
19
+ | Planned | Ship Jinja2 and Django frontends as additional `@rhinostone/swig-*` packages. On demand when there's concrete user demand. |
20
+ | Planned | Engine bump + test framework migration. Move to Node 18, `node:test` + `node:assert/strict`, swap mocha-phantomjs for a modern browser-test harness, swap blanket for `c8`. |
24
21
 
25
22
  ---
26
23
 
27
24
  ## Completed
28
25
 
26
+ ### v2.0.0 (May 2026)
27
+
28
+ - Multi-flavor template-engine workspace shipped: `@rhinostone/swig` (native syntax, drop-in for `1.x`), `@rhinostone/swig-twig` (Twig syntax), `@rhinostone/swig-core` (shared IR backend). Production-ready cut of the changeset introduced across `2.0.0-alpha.1` through `2.0.0-alpha.5`. No functional or API changes since `2.0.0-alpha.5`. IR ABI is stable from this release onward; cross-package dependencies pin exact versions and frontends + core release in lockstep.
29
+ - README messaging refreshed across all three packages to reflect production-ready status; package descriptions cleaned of historical internal-tracking references; stale documentation URLs refreshed.
30
+
31
+ ### v2.0.0-alpha.8 (April 2026)
32
+
33
+ - Remove the soft-deprecated `exports.parse(source, options)` wrapper (Path B) from `@rhinostone/swig-twig`. Soft-deprecated since `2.0.0-alpha.4`; removed now so any remaining consumer surfaces during the alpha.8 bake window before `2.0.0` stable. Migrate to the per-instance API installed by `engine.install`: `new twig.Twig(opts)` (or the default instance `exports.precompile` / `exports.compile` / `exports.render` / `exports.renderFile`). Internal plumbing (`exports.parser.parse`, `exports.parseFile`) is unaffected.
34
+
35
+ ### v2.0.0-alpha.5 (April 2026)
36
+
37
+ - Twig render-path polish — fix `~` string-concat SyntaxError in the shared backend; route literal LHS (STRING/NUMBER/BOOL) through `parsePostfix` so `{{ "hi"|upper }}` works; land a 19-fixture render corpus under `tests/swig-twig/cases/`.
38
+ - Scope-closing Twig expression sugar: `..` range via `_utils.range`; `??` undefined-fallback via new `IRVarRefExists` IR node; `is <test>` routed through `_ext._test_<name>` with seven built-in tests (`defined`, `null`, `empty`, `iterable`, `odd`, `even`, `divisibleby`).
39
+
40
+ ### v2.0.0-alpha.4 (April 2026)
41
+
42
+ - Wire `@rhinostone/swig-twig` for Path A render via `engine.install(self, frontend)`; isolate per-instance tags and filters; soft-deprecate the Path B `exports.parse` wrapper with a one-shot `console.warn`.
43
+
44
+ ### v2.0.0-alpha.3 (April 2026)
45
+
46
+ - Ship `@rhinostone/swig-twig` parser surface — Twig lexer, Pratt parser, 8 built-in tags (`apply`, `verbatim`, `set/endset`, `with/endwith`, `from import`, plus native parity), 5 Twig-specific tags, 24 filter parity. Lockstep cut of `swig-core` + `swig` + `swig-twig` fixes the broken `alpha.2` missing-dep regression.
47
+
48
+ ### v2.0.0-alpha.2 (April 2026)
49
+
50
+ - Port the native Swig frontend to emit IR instead of JS directly. All built-in tags and TokenParser expression codegen now route through `@rhinostone/swig-core`'s IR → backend pipeline. Test gate: byte-identical compiled output for existing suites.
51
+
29
52
  ### v2.0.0-alpha.1 (April 2026)
30
53
 
31
54
  - Carve `@rhinostone/swig-core` — extract IR stubs, backend (JS codegen), runtime (cache, loader, filter infra, `_dangerousProps` guards), lexer token-type enum, and TokenParser into a standalone workspace package. `@rhinostone/swig` becomes the native-syntax frontend plus a core re-export. Phase 1 of the multi-flavor architecture.
package/dist/swig.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! Swig v2.0.0-alpha.8 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
- /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/TomoUniversalis/DateZ/blob/master/LISENCE */
1
+ /*! Swig v2.0.0 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
+ /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/ocrybit/DateZ/blob/master/LISENCE */
3
3
  (() => {
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __commonJS = (cb, mod) => function __require() {
@@ -4079,7 +4079,7 @@
4079
4079
  var dateformatter = require_dateformatter2();
4080
4080
  var loaders = require_loaders2();
4081
4081
  var engine = require_engine();
4082
- exports.version = "2.0.0-alpha.8";
4082
+ exports.version = "2.0.0";
4083
4083
  var defaultOptions = {
4084
4084
  autoescape: true,
4085
4085
  varControls: ["{{", "}}"],
package/dist/swig.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! Swig v2.0.0-alpha.8 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
- /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/TomoUniversalis/DateZ/blob/master/LISENCE */
3
- (()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,u=[],p=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),p="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(u)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),u=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),p=t({"lib/tags/extends.js"(e){e.compile=function(){},e.parse=function(){return!0},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),g=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=g().iterateFilter;e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,a=o.apply(e.escape,arguments),i=t,s=0;if(void 0!==a)return a;if("string"!=typeof t)return t;if(a="","js"===r){for(i=i.replace(/\\/g,"\\u005C");s<i.length;s+=1)a+=(n=i.charCodeAt(s))<32?"\\u00"+(n=(n=n.toString(16).toUpperCase()).length<2?"0"+n:n):i[s];return a.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return i.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),d=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var u=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],u)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var u=[];for(a=0;a<c.length;a+=1)u.push(e.parseExpr(c[a]));return u}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),m=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),E=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=m().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),u="__k";r[0]&&","===r[0]&&(r.shift(),u=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var p=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(p)],u)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),v=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=m(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return u(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+u(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function u(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+p(e.path,"_ctx.")+" || "+p(e.path,"")+")"}function p(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t;function r(t){return"("+p(e,t)+" ? "+t+e.join(".")+' : "")'}return"("+(t="("+p(e,"_ctx.")+" ? "+r("_ctx.")+" : "+r("")+")")+" !== null ? "+t+' : "" )'}e.compile=function(r,n,o,c){var u="",p=t.isArray(r)?r:r.tokens,f=[];return t.each(p,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)f.push(r);else{var i=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],n,o,c,r);null!=i&&""!==i&&("string"!=typeof i?t.isArray(i)?t.each(i,function(e){f.push(e)}):"object"!=typeof i||"string"!=typeof i.type?f.push(a.legacyJS(String(i))):f.push(i):f.push(a.legacyJS(i)))}else f.push(a.text(r))}),t.each(f,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var n="";return t.each(r.branches,function(r,o){var a,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(a=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,n+=0===o?"if ("+a+") { \n"+s:"} else if ("+a+") {\n"+s):n+="} else {\n"+s}),void(u+=n+"\n}")}if("Set"===r.type){var o,a;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var c=s();t.isArray(r.target.path)&&0!==r.target.path.length||c.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,c,r.target)}),o="_ctx."+r.target.path.join(".")}else o=r.target;return a=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=o+" "+r.op+" "+a+";\n")}if("For"===r.type){var p,f=r.value,h=r.key,g="",y=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),d="_ctx.",m="_ctx.loop";return p=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(g+='_output += "'+i(e.value)+'";\n'):g+=e.js}),void(u+="(function () {\n var __l = "+p+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n if (!__l) { return; }\n var '+y+" = { loop: "+m+", "+f+": "+d+f+", "+h+": "+d+h+" };\n "+m+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+f+", "+h+") {\n "+d+f+" = "+f+";\n "+d+h+" = "+h+";\n "+m+".key = "+h+";\n "+m+".first = ("+m+".index0 === 0);\n "+m+".last = ("+m+".revindex0 === 0);\n "+g+" "+m+".index += 1; "+m+".index0 += 1; "+m+".revindex -= 1; "+m+".revindex0 -= 1;\n });\n "+m+" = "+y+".loop;\n "+d+f+" = "+y+"."+f+";\n "+d+h+" = "+y+"."+h+";\n "+y+" = undefined;\n})();\n")}if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var E,v,x;if("Include"===r.type)return E=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(v="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),x=r.isolated&&v?v:v?"_utils.extend({}, _ctx, "+v+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+E+', {resolveFrom: "'+r.resolveFrom+'"})('+x+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("With"===r.type){var O;void 0!==r.context&&(O=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var w,C="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(C+='_output += "'+i(e.value)+'";\n'):C+=e.js}),w=r.isolated?void 0!==O?O:"{}":void 0!==O?"_utils.extend({}, _ctx, "+O+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+C+"})("+w+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var T=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}T='_filters["'+r.name+'"]('+T+n+")"}),void(u+="_output += "+T+";\n")}if("Filter"!==r.type);else{var b="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(b+='_output += "'+i(e.value)+'";\n'):b+=e.js});var R='(function () {\n var _output = "";\n'+b+" return _output;\n})()",A="";if(r.args&&r.args.length){var N=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?N.push(e.emitExpr(t)):N.push(t)}),A=", "+N.join(", ")}u+='_output += _filters["'+r.name+'"]('+R+A+");\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var P="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(P+='_output += "'+i(e.value)+'";\n'):P+=e.js});var k,L,S=r.params||[];if(S.length&&"object"==typeof S[0]&&null!==S[0]&&"string"==typeof S[0].name){var I=[];t.each(S,function(e){I.push(e.name)}),k=I.join(", ");var U=[];t.each(I,function(e){U.push(JSON.stringify(e))}),L=U.join(",")}else k=S.join(""),L='"'+S.join('","')+'"';u+="_ctx."+r.name+" = function ("+k+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n _utils.each(_ctx, function (v, k) {\n if (['+L+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+P+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^[+\-]?\d+(\.\d+)?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=m().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,u=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(u&&c&&u===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),u&&u===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(u===n.BRACKETOPEN){var p=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(p)&&t.throwError('Unsafe access to "'+p+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:u!==n.FUNCTION&&u!==n.FILTER&&u!==n.ARRAYOPEN&&u!==n.CURLYOPEN&&u!==n.PARENOPEN&&u!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),u===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,u);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.COLON:u!==n.CURLYOPEN&&t.throwError("Unexpected colon",o.line,o.filename),o.state.push(e.type),o.out.push(":"),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:u===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function u(){var e=l();return e&&(c+=1),e}function p(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function g(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function d(e){var t=[],r=l();if(r&&r.type===e)return u(),t;for(;;){t.push(x(0));var o=u();if(o||p("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&p("Expected comma or closing delimiter")}return t}function m(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)u(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){u();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=u();i&&i.type===n.BRACKETCLOSE||p("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)u(),e=a.fnCall(e,d(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;u();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||p('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=d(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function E(){var e,r=u();switch(r||p("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",v());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,v());p('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=u();return i&&i.type===n.PARENCLOSE||p("Mismatched nesting state"),m(o);case n.BRACKETOPEN:return m(a.arrayLiteral(d(n.BRACKETCLOSE)));case n.CURLYOPEN:return m(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return u(),a.objectLiteral([]);for(;;){var r,o=u();o||p("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&p("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):p("Unexpected object key");var i=u();i&&i.type===n.COLON||p("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=u();if(c||p("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&p("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&p('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),m(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&p('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?m(a.fnCall(a.varRef([e]),[])):m(a.fnCall(a.varRef([e]),d(n.PARENCLOSE)))}return p('Unexpected token "'+r.match+'"'),null}function v(){return E()}function x(e){for(var t=v();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=g(r);if(!o||o.prec<e)break;u();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,u=!1,p=!1,f=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(u=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(p=!0,f<0&&(f=i))),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===f)return o();try{var h=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(h=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(h=!1),s.type===n.PARENOPEN){for(var g=i-1;g>=0&&e[g].type===n.WHITESPACE;)g-=1;g>=0&&e[g].type===n.VAR&&(h=!1)}if(u&&p){var y=r.parseExpr(e),d=h?[a.filterCall("e")]:[];return a.output(y,d.length>0?d:void 0)}var m=f>=0?f:e.length,E=e.slice(0,m),v={pos:0},x=r.parseExpr(E,v),O=!1;for(i=v.pos;i<E.length;i+=1)if(E[i].type!==n.WHITESPACE){O=!0;break}if(O)return o();var w=[];if(f>=0)for(var C=f;C<e.length;){var T=e[C];if(T.type!==n.WHITESPACE)if(T.type!==n.FILTEREMPTY)if(T.type!==n.FILTER)t.throwError('Unexpected token "'+T.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1);for(var b=1,R=C+1,A=C+1;A<e.length&&b>0;){var N=e[A];if(N.type===n.PARENOPEN||N.type===n.FUNCTION||N.type===n.BRACKETOPEN||N.type===n.CURLYOPEN||N.type===n.FILTER)b+=1;else if((N.type===n.PARENCLOSE||N.type===n.BRACKETCLOSE||N.type===n.CURLYCLOSE)&&0===(b-=1))break;A+=1}0!==b&&t.throwError('Unable to parse filter "'+T.match+'"',r.line,r.filename);var P,k=[],L=R,S=1;for(P=R;P<A;P+=1){var I=e[P];I.type===n.PARENOPEN||I.type===n.FUNCTION||I.type===n.BRACKETOPEN||I.type===n.CURLYOPEN||I.type===n.FILTER?S+=1:I.type===n.PARENCLOSE||I.type===n.BRACKETCLOSE||I.type===n.CURLYCLOSE?S-=1:I.type===n.COMMA&&1===S&&(k.push(e.slice(L,P)),L=P+1)}L<A&&k.push(e.slice(L,A));var U,_=[];for(U=0;U<k.length;U+=1){var F,j=k[U],M=!1;for(F=0;F<j.length;F+=1)if(j[F].type!==n.WHITESPACE){M=!0;break}M&&_.push(r.parseExpr(j))}w.push(a.filterCall(T.match,_)),C=A+1}else r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1),w.push(a.filterCall(T.match)),C+=1;else C+=1}return h&&w.push(a.filterCall("e")),a.output(x,w.length>0?w:void 0)}catch(e){return o()}},checkMatch:function(e){var r,n=e[0];function o(r){var o=r+n,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}function a(t){return"("+o(t)+" ? "+t+e.join(".")+' : "")'}return"("+(r="("+o("_ctx.")+" ? "+a("_ctx.")+" : "+a("")+")")+" !== null ? "+r+' : "" )'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,u){s=s.replace(/\r\n/g,"\n");var p,f=c.autoescape,h=c.tagControls[0],g=c.tagControls[1],y=c.varControls[0],d=c.varControls[1],m=i(h),E=i(g),v=i(y),x=i(d),O=new RegExp("^"+m+"-?\\s*-?|-?\\s*-?"+E+"$","g"),w=new RegExp("^"+m+"-"),C=new RegExp("-"+E+"$"),T=new RegExp("^"+v+"-?\\s*-?|-?\\s*-?"+x+"$","g"),b=new RegExp("^"+v+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],P="[\\s\\S]*?",k=new RegExp("("+m+P+E+"|"+v+P+x+"|"+i(A)+P+i(N)+")"),L=1,S=[],I=null,U=[],_={},F=!1;function j(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,u,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function M(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=j,t.each(s.split(k),function(e){var i,s,m,E,v;if(e){if(!F&&t.startsWith(e,y)&&t.endsWith(e,d))m=b.test(e),p=R.test(e),i=j(e.replace(T,""),L);else if(t.startsWith(e,h)&&t.endsWith(e,g))m=w.test(e),p=C.test(e),(i=function(e,i){var s,p,h,g,y,d,m;if(t.startsWith(e,"end")){if((m=S[S.length-1])&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":f=c.autoescape;break;case"raw":F=!1}return void S.pop()}F||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!F){switch(g=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(g)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),p=new a(s,u,!1,i,c.filename),(y=l[g]).parse(h[1],i,p,o,S,c,n)||t.throwError('Unexpected tag "'+g+'"',i,c.filename),p.parse(),d=p.out,g){case"autoescape":f="false"!==d[0]&&d[0];break;case"raw":F=!0}var E;return"function"==typeof y.lowerExpr&&(E=y.lowerExpr(p,s,h[1],i)),{block:!!l[g].block,compile:y.compile,args:d,content:[],ends:y.ends,name:g,irExpr:E}}}(e.replace(O,""),L))&&("extends"===i.name?I=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""):i.block&&!S.length&&(_[i.args.join("")]=i)),F&&!i&&(i=e);else if(F||!t.startsWith(e,A)&&!t.endsWith(e,N))i=p?e.replace(/^\s*/,""):e,p=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;m&&U.length&&("string"==typeof(E=U.pop())?E=M(E):E.content&&E.content.length&&(v=M(E.content.pop()),E.content.push(v)),U.push(E)),i&&(S.length?S[S.length-1].content.push(i):U.push(i),i.name&&i.ends&&S.push(i),s=e.match(/\n/g),L+=s?s.length:0)}}),{name:c.filename,parent:I,tokens:U,blocks:_}},e.compile=v().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=v(),o=m().dangerousProps;e.compile=function(e,r){var n=r.pop(),o=t.map(r,function(e){return e.name}).join("|"),a="_ctx."+n+' = {};\n var _output = "";\n',i=t.map(r,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+o+")","g"),re:"_ctx."+n+"."+e.name+"$1"}});return t.each(r,function(e){var r=e.compiled;t.each(i,function(e){r=r.replace(e.ex,e.re)}),a+=r}),a},e.parse=function(e,n,a,i,s,c,l){var u,p,f=w().compile,h={resolveFrom:c.filename},g=t.extend({},c,h);return a.on(i.STRING,function(e){var o=this;if(!u)return u=l.parseFile(e.match.replace(/^("|')|("|')$/g,""),h).tokens,void t.each(u,function(e){var t,n="";e&&"macro"===e.name&&e.compile&&(t=e.args[0],n+=r.compile([e.compile(f,e.args,e.content,[],g)],[],g)+"\n",o.out.push({compiled:n,name:t}))});throw new Error("Unexpected string "+e.match+" on line "+n+".")}),a.on(i.VAR,function(e){if(!u||p)throw new Error('Unexpected variable "'+e.match+'" on line '+n+".");if("as"!==e.match){if(-1!==o.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+n+".");return p=e.match,this.out.push(p),!1}}),!0},e.block=!0}}),T=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var u=r.shift(),p=r.indexOf(i),f=-1!==p&&r.splice(p,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),g=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(u=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),t.include(u,y||void 0,!!f,!!g,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,u=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===u&&a.match===n&&(u=o)):s--:s++}var p=t.length;-1!==c?p=c:-1!==u&&(p=u);var f=t.slice(0,p);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var g=t.length;-1!==l?g=l:-1!==u&&(g=u);var y=t.slice(c+1,g);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,u;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(u||"with"!==e.match){if(!u||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else u=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),b=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=m().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],u=o.length,p=0;p<u;p+=1)if((s=o[p]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(p+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],u="string"==typeof l&&n.exec(l);if(u){var p=[u[1]];if(u[2])for(var f=u[2].split("."),h=1;h<f.length;h++)p.push(f[h]);l=t.varRef(p)}var g=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],g)};var a=m().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),P=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),k=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=u(),e.elif=e.elseif,e.extends=p(),e.filter=d(),e.for=E(),e.if=l(),e.import=C(),e.include=T(),e.macro=b(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=P()}}),L=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),S=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,u=-1,p=0;p<=l;++p){if(p===l){if(c>l){if(47===t.charCodeAt(s+p))return t.slice(s+p+1);if(0===p)return t.slice(s+p)}else i>l&&(47===e.charCodeAt(n+p)?u=p:0===p&&(u=0));break}var f=e.charCodeAt(n+p);if(f!==t.charCodeAt(s+p))break;47===f&&(u=p)}var h="";for(p=n+u+1;p<=a;++p)p!==a&&47!==e.charCodeAt(p)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+u):(s+=u,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},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+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,u=e.length-1,p=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===i?i=u:1!==p&&(p=1):-1!==i&&(p=-1);else if(!l){s=u+1;break}return-1===i||-1===c||0===p||1===p&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),I=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=L(),n=S();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),U=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=S(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),_=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=I(),e.memory=U()}}),F=t({"lib/loaders/index.js"(e,t){t.exports=_()}}),j=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),M=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=v(),o=j();function a(){return""}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],u=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),u.push(i)}for(s=u.length,s=u.length-2;s>=0;s-=1)u[s].tokens=e.remapBlocks(u[s].blocks,u[s+1].tokens),e.importNonBlocks(u[s].blocks,u[s].tokens);return u},e.buildTemplateFunction=function(e,t,r){return new Function("_swig","_ctx","_filters","_utils","_fn",' var _ext = _swig.extensions,\n _output = "";\n'+n.compile(e,t,r)+"\n return _output;\n")},e.install=function(r,n){var i=n.parser,s=t.extend({},n.tags),c=t.extend({},n.filters),l=n.validateOptions,u=n.onCompileError;function p(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function f(e,t){return o.cacheGet(e,t,r.options.cache,r.cache)}function h(e,t,n){o.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');c[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');s[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){l(n);var o,a=p(n),u={};for(o in n)n.hasOwnProperty(o)&&"locals"!==o&&(u[o]=n[o]);return(n=t.extend({},r.options,u)).locals=a,i.parse(r,e,n,s,c)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a=r.parse(t,n),i=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:f})}(a,n);i.length&&(a.tokens=e.remapBlocks(a.blocks,i[0].tokens),e.importNonBlocks(a.blocks,a.tokens));try{o=e.buildTemplateFunction(a,i,n)}catch(e){u(e,n)}return{tpl:o,tokens:a}},r.compile=function(e,n){var o,i,s,l=n?n.filename:null,u=l?f(l,n):null;if(u)return u;function g(e){var n;return n=e&&i?t.extend({},o,e):e&&!i?e:!e&&i?o:{},s.tpl(r,n,c,t,a)}return o=p(n),i=t.keys(o).length,s=r.precompile(e,n),t.extend(g,s.tokens),l&&h(l,n,g),g},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=f(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){if(!n)return r.compileFile(e)(t);r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}})},r.run=function(e,n,o){var i=p({locals:n});return o&&h(o,{},e),e(r,i,c,t,a)}}}}),Y=t({"lib/swig.js"(e){var t=n(),r=k(),o=y(),a=w(),i=h(),s=F(),c=M();e.version="2.0.0-alpha.8";var l,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function p(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){p(e),l.options=t.extend(l.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){p(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},c.install(this,{parser:a,tags:r,filters:o,validateOptions:p,onCompileError:function(e,r){t.throwError(e,null,r.filename)}})},l=new e.Swig,e.setFilter=l.setFilter,e.setTag=l.setTag,e.setExtension=l.setExtension,e.parseFile=l.parseFile,e.precompile=l.precompile,e.compile=l.compile,e.compileFile=l.compileFile,e.render=l.render,e.renderFile=l.renderFile,e.run=l.run,e.invalidateCache=l.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return Y}):window.swig=Y})();
1
+ /*! Swig v2.0.0 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
+ /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/ocrybit/DateZ/blob/master/LISENCE */
3
+ (()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,u=[],p=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),p="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(u)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),u=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),p=t({"lib/tags/extends.js"(e){e.compile=function(){},e.parse=function(){return!0},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),g=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=g().iterateFilter;e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,a=o.apply(e.escape,arguments),i=t,s=0;if(void 0!==a)return a;if("string"!=typeof t)return t;if(a="","js"===r){for(i=i.replace(/\\/g,"\\u005C");s<i.length;s+=1)a+=(n=i.charCodeAt(s))<32?"\\u00"+(n=(n=n.toString(16).toUpperCase()).length<2?"0"+n:n):i[s];return a.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return i.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),d=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var u=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],u)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var u=[];for(a=0;a<c.length;a+=1)u.push(e.parseExpr(c[a]));return u}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),m=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),E=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=m().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),u="__k";r[0]&&","===r[0]&&(r.shift(),u=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var p=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(p)],u)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),v=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=m(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return u(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+u(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function u(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+p(e.path,"_ctx.")+" || "+p(e.path,"")+")"}function p(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t;function r(t){return"("+p(e,t)+" ? "+t+e.join(".")+' : "")'}return"("+(t="("+p(e,"_ctx.")+" ? "+r("_ctx.")+" : "+r("")+")")+" !== null ? "+t+' : "" )'}e.compile=function(r,n,o,c){var u="",p=t.isArray(r)?r:r.tokens,f=[];return t.each(p,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)f.push(r);else{var i=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],n,o,c,r);null!=i&&""!==i&&("string"!=typeof i?t.isArray(i)?t.each(i,function(e){f.push(e)}):"object"!=typeof i||"string"!=typeof i.type?f.push(a.legacyJS(String(i))):f.push(i):f.push(a.legacyJS(i)))}else f.push(a.text(r))}),t.each(f,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var n="";return t.each(r.branches,function(r,o){var a,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(a=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,n+=0===o?"if ("+a+") { \n"+s:"} else if ("+a+") {\n"+s):n+="} else {\n"+s}),void(u+=n+"\n}")}if("Set"===r.type){var o,a;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var c=s();t.isArray(r.target.path)&&0!==r.target.path.length||c.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,c,r.target)}),o="_ctx."+r.target.path.join(".")}else o=r.target;return a=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=o+" "+r.op+" "+a+";\n")}if("For"===r.type){var p,f=r.value,h=r.key,g="",y=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),d="_ctx.",m="_ctx.loop";return p=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(g+='_output += "'+i(e.value)+'";\n'):g+=e.js}),void(u+="(function () {\n var __l = "+p+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n if (!__l) { return; }\n var '+y+" = { loop: "+m+", "+f+": "+d+f+", "+h+": "+d+h+" };\n "+m+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+f+", "+h+") {\n "+d+f+" = "+f+";\n "+d+h+" = "+h+";\n "+m+".key = "+h+";\n "+m+".first = ("+m+".index0 === 0);\n "+m+".last = ("+m+".revindex0 === 0);\n "+g+" "+m+".index += 1; "+m+".index0 += 1; "+m+".revindex -= 1; "+m+".revindex0 -= 1;\n });\n "+m+" = "+y+".loop;\n "+d+f+" = "+y+"."+f+";\n "+d+h+" = "+y+"."+h+";\n "+y+" = undefined;\n})();\n")}if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var E,v,x;if("Include"===r.type)return E=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(v="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),x=r.isolated&&v?v:v?"_utils.extend({}, _ctx, "+v+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+E+', {resolveFrom: "'+r.resolveFrom+'"})('+x+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("With"===r.type){var O;void 0!==r.context&&(O=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var w,C="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(C+='_output += "'+i(e.value)+'";\n'):C+=e.js}),w=r.isolated?void 0!==O?O:"{}":void 0!==O?"_utils.extend({}, _ctx, "+O+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+C+"})("+w+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var T=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}T='_filters["'+r.name+'"]('+T+n+")"}),void(u+="_output += "+T+";\n")}if("Filter"!==r.type);else{var b="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(b+='_output += "'+i(e.value)+'";\n'):b+=e.js});var R='(function () {\n var _output = "";\n'+b+" return _output;\n})()",A="";if(r.args&&r.args.length){var N=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?N.push(e.emitExpr(t)):N.push(t)}),A=", "+N.join(", ")}u+='_output += _filters["'+r.name+'"]('+R+A+");\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var P="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(P+='_output += "'+i(e.value)+'";\n'):P+=e.js});var k,L,S=r.params||[];if(S.length&&"object"==typeof S[0]&&null!==S[0]&&"string"==typeof S[0].name){var I=[];t.each(S,function(e){I.push(e.name)}),k=I.join(", ");var U=[];t.each(I,function(e){U.push(JSON.stringify(e))}),L=U.join(",")}else k=S.join(""),L='"'+S.join('","')+'"';u+="_ctx."+r.name+" = function ("+k+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n _utils.each(_ctx, function (v, k) {\n if (['+L+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+P+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^[+\-]?\d+(\.\d+)?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=m().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,u=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(u&&c&&u===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),u&&u===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(u===n.BRACKETOPEN){var p=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(p)&&t.throwError('Unsafe access to "'+p+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:u!==n.FUNCTION&&u!==n.FILTER&&u!==n.ARRAYOPEN&&u!==n.CURLYOPEN&&u!==n.PARENOPEN&&u!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),u===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,u);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.COLON:u!==n.CURLYOPEN&&t.throwError("Unexpected colon",o.line,o.filename),o.state.push(e.type),o.out.push(":"),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:u===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function u(){var e=l();return e&&(c+=1),e}function p(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function g(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function d(e){var t=[],r=l();if(r&&r.type===e)return u(),t;for(;;){t.push(x(0));var o=u();if(o||p("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&p("Expected comma or closing delimiter")}return t}function m(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)u(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){u();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=u();i&&i.type===n.BRACKETCLOSE||p("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)u(),e=a.fnCall(e,d(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;u();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||p('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=d(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function E(){var e,r=u();switch(r||p("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",v());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,v());p('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=u();return i&&i.type===n.PARENCLOSE||p("Mismatched nesting state"),m(o);case n.BRACKETOPEN:return m(a.arrayLiteral(d(n.BRACKETCLOSE)));case n.CURLYOPEN:return m(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return u(),a.objectLiteral([]);for(;;){var r,o=u();o||p("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&p("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):p("Unexpected object key");var i=u();i&&i.type===n.COLON||p("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=u();if(c||p("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&p("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&p('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),m(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&p('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?m(a.fnCall(a.varRef([e]),[])):m(a.fnCall(a.varRef([e]),d(n.PARENCLOSE)))}return p('Unexpected token "'+r.match+'"'),null}function v(){return E()}function x(e){for(var t=v();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=g(r);if(!o||o.prec<e)break;u();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,u=!1,p=!1,f=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(u=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(p=!0,f<0&&(f=i))),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===f)return o();try{var h=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(h=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(h=!1),s.type===n.PARENOPEN){for(var g=i-1;g>=0&&e[g].type===n.WHITESPACE;)g-=1;g>=0&&e[g].type===n.VAR&&(h=!1)}if(u&&p){var y=r.parseExpr(e),d=h?[a.filterCall("e")]:[];return a.output(y,d.length>0?d:void 0)}var m=f>=0?f:e.length,E=e.slice(0,m),v={pos:0},x=r.parseExpr(E,v),O=!1;for(i=v.pos;i<E.length;i+=1)if(E[i].type!==n.WHITESPACE){O=!0;break}if(O)return o();var w=[];if(f>=0)for(var C=f;C<e.length;){var T=e[C];if(T.type!==n.WHITESPACE)if(T.type!==n.FILTEREMPTY)if(T.type!==n.FILTER)t.throwError('Unexpected token "'+T.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1);for(var b=1,R=C+1,A=C+1;A<e.length&&b>0;){var N=e[A];if(N.type===n.PARENOPEN||N.type===n.FUNCTION||N.type===n.BRACKETOPEN||N.type===n.CURLYOPEN||N.type===n.FILTER)b+=1;else if((N.type===n.PARENCLOSE||N.type===n.BRACKETCLOSE||N.type===n.CURLYCLOSE)&&0===(b-=1))break;A+=1}0!==b&&t.throwError('Unable to parse filter "'+T.match+'"',r.line,r.filename);var P,k=[],L=R,S=1;for(P=R;P<A;P+=1){var I=e[P];I.type===n.PARENOPEN||I.type===n.FUNCTION||I.type===n.BRACKETOPEN||I.type===n.CURLYOPEN||I.type===n.FILTER?S+=1:I.type===n.PARENCLOSE||I.type===n.BRACKETCLOSE||I.type===n.CURLYCLOSE?S-=1:I.type===n.COMMA&&1===S&&(k.push(e.slice(L,P)),L=P+1)}L<A&&k.push(e.slice(L,A));var U,_=[];for(U=0;U<k.length;U+=1){var F,j=k[U],M=!1;for(F=0;F<j.length;F+=1)if(j[F].type!==n.WHITESPACE){M=!0;break}M&&_.push(r.parseExpr(j))}w.push(a.filterCall(T.match,_)),C=A+1}else r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1),w.push(a.filterCall(T.match)),C+=1;else C+=1}return h&&w.push(a.filterCall("e")),a.output(x,w.length>0?w:void 0)}catch(e){return o()}},checkMatch:function(e){var r,n=e[0];function o(r){var o=r+n,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}function a(t){return"("+o(t)+" ? "+t+e.join(".")+' : "")'}return"("+(r="("+o("_ctx.")+" ? "+a("_ctx.")+" : "+a("")+")")+" !== null ? "+r+' : "" )'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,u){s=s.replace(/\r\n/g,"\n");var p,f=c.autoescape,h=c.tagControls[0],g=c.tagControls[1],y=c.varControls[0],d=c.varControls[1],m=i(h),E=i(g),v=i(y),x=i(d),O=new RegExp("^"+m+"-?\\s*-?|-?\\s*-?"+E+"$","g"),w=new RegExp("^"+m+"-"),C=new RegExp("-"+E+"$"),T=new RegExp("^"+v+"-?\\s*-?|-?\\s*-?"+x+"$","g"),b=new RegExp("^"+v+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],P="[\\s\\S]*?",k=new RegExp("("+m+P+E+"|"+v+P+x+"|"+i(A)+P+i(N)+")"),L=1,S=[],I=null,U=[],_={},F=!1;function j(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,u,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function M(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=j,t.each(s.split(k),function(e){var i,s,m,E,v;if(e){if(!F&&t.startsWith(e,y)&&t.endsWith(e,d))m=b.test(e),p=R.test(e),i=j(e.replace(T,""),L);else if(t.startsWith(e,h)&&t.endsWith(e,g))m=w.test(e),p=C.test(e),(i=function(e,i){var s,p,h,g,y,d,m;if(t.startsWith(e,"end")){if((m=S[S.length-1])&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":f=c.autoescape;break;case"raw":F=!1}return void S.pop()}F||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!F){switch(g=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(g)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),p=new a(s,u,!1,i,c.filename),(y=l[g]).parse(h[1],i,p,o,S,c,n)||t.throwError('Unexpected tag "'+g+'"',i,c.filename),p.parse(),d=p.out,g){case"autoescape":f="false"!==d[0]&&d[0];break;case"raw":F=!0}var E;return"function"==typeof y.lowerExpr&&(E=y.lowerExpr(p,s,h[1],i)),{block:!!l[g].block,compile:y.compile,args:d,content:[],ends:y.ends,name:g,irExpr:E}}}(e.replace(O,""),L))&&("extends"===i.name?I=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""):i.block&&!S.length&&(_[i.args.join("")]=i)),F&&!i&&(i=e);else if(F||!t.startsWith(e,A)&&!t.endsWith(e,N))i=p?e.replace(/^\s*/,""):e,p=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;m&&U.length&&("string"==typeof(E=U.pop())?E=M(E):E.content&&E.content.length&&(v=M(E.content.pop()),E.content.push(v)),U.push(E)),i&&(S.length?S[S.length-1].content.push(i):U.push(i),i.name&&i.ends&&S.push(i),s=e.match(/\n/g),L+=s?s.length:0)}}),{name:c.filename,parent:I,tokens:U,blocks:_}},e.compile=v().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=v(),o=m().dangerousProps;e.compile=function(e,r){var n=r.pop(),o=t.map(r,function(e){return e.name}).join("|"),a="_ctx."+n+' = {};\n var _output = "";\n',i=t.map(r,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+o+")","g"),re:"_ctx."+n+"."+e.name+"$1"}});return t.each(r,function(e){var r=e.compiled;t.each(i,function(e){r=r.replace(e.ex,e.re)}),a+=r}),a},e.parse=function(e,n,a,i,s,c,l){var u,p,f=w().compile,h={resolveFrom:c.filename},g=t.extend({},c,h);return a.on(i.STRING,function(e){var o=this;if(!u)return u=l.parseFile(e.match.replace(/^("|')|("|')$/g,""),h).tokens,void t.each(u,function(e){var t,n="";e&&"macro"===e.name&&e.compile&&(t=e.args[0],n+=r.compile([e.compile(f,e.args,e.content,[],g)],[],g)+"\n",o.out.push({compiled:n,name:t}))});throw new Error("Unexpected string "+e.match+" on line "+n+".")}),a.on(i.VAR,function(e){if(!u||p)throw new Error('Unexpected variable "'+e.match+'" on line '+n+".");if("as"!==e.match){if(-1!==o.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+n+".");return p=e.match,this.out.push(p),!1}}),!0},e.block=!0}}),T=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var u=r.shift(),p=r.indexOf(i),f=-1!==p&&r.splice(p,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),g=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(u=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),t.include(u,y||void 0,!!f,!!g,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,u=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===u&&a.match===n&&(u=o)):s--:s++}var p=t.length;-1!==c?p=c:-1!==u&&(p=u);var f=t.slice(0,p);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var g=t.length;-1!==l?g=l:-1!==u&&(g=u);var y=t.slice(c+1,g);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,u;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(u||"with"!==e.match){if(!u||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else u=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),b=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=m().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],u=o.length,p=0;p<u;p+=1)if((s=o[p]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(p+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],u="string"==typeof l&&n.exec(l);if(u){var p=[u[1]];if(u[2])for(var f=u[2].split("."),h=1;h<f.length;h++)p.push(f[h]);l=t.varRef(p)}var g=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],g)};var a=m().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),P=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),k=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=u(),e.elif=e.elseif,e.extends=p(),e.filter=d(),e.for=E(),e.if=l(),e.import=C(),e.include=T(),e.macro=b(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=P()}}),L=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),S=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,u=-1,p=0;p<=l;++p){if(p===l){if(c>l){if(47===t.charCodeAt(s+p))return t.slice(s+p+1);if(0===p)return t.slice(s+p)}else i>l&&(47===e.charCodeAt(n+p)?u=p:0===p&&(u=0));break}var f=e.charCodeAt(n+p);if(f!==t.charCodeAt(s+p))break;47===f&&(u=p)}var h="";for(p=n+u+1;p<=a;++p)p!==a&&47!==e.charCodeAt(p)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+u):(s+=u,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},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+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,u=e.length-1,p=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===i?i=u:1!==p&&(p=1):-1!==i&&(p=-1);else if(!l){s=u+1;break}return-1===i||-1===c||0===p||1===p&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),I=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=L(),n=S();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),U=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=S(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),_=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=I(),e.memory=U()}}),F=t({"lib/loaders/index.js"(e,t){t.exports=_()}}),j=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),M=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=v(),o=j();function a(){return""}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],u=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),u.push(i)}for(s=u.length,s=u.length-2;s>=0;s-=1)u[s].tokens=e.remapBlocks(u[s].blocks,u[s+1].tokens),e.importNonBlocks(u[s].blocks,u[s].tokens);return u},e.buildTemplateFunction=function(e,t,r){return new Function("_swig","_ctx","_filters","_utils","_fn",' var _ext = _swig.extensions,\n _output = "";\n'+n.compile(e,t,r)+"\n return _output;\n")},e.install=function(r,n){var i=n.parser,s=t.extend({},n.tags),c=t.extend({},n.filters),l=n.validateOptions,u=n.onCompileError;function p(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function f(e,t){return o.cacheGet(e,t,r.options.cache,r.cache)}function h(e,t,n){o.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');c[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');s[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){l(n);var o,a=p(n),u={};for(o in n)n.hasOwnProperty(o)&&"locals"!==o&&(u[o]=n[o]);return(n=t.extend({},r.options,u)).locals=a,i.parse(r,e,n,s,c)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a=r.parse(t,n),i=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:f})}(a,n);i.length&&(a.tokens=e.remapBlocks(a.blocks,i[0].tokens),e.importNonBlocks(a.blocks,a.tokens));try{o=e.buildTemplateFunction(a,i,n)}catch(e){u(e,n)}return{tpl:o,tokens:a}},r.compile=function(e,n){var o,i,s,l=n?n.filename:null,u=l?f(l,n):null;if(u)return u;function g(e){var n;return n=e&&i?t.extend({},o,e):e&&!i?e:!e&&i?o:{},s.tpl(r,n,c,t,a)}return o=p(n),i=t.keys(o).length,s=r.precompile(e,n),t.extend(g,s.tokens),l&&h(l,n,g),g},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=f(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){if(!n)return r.compileFile(e)(t);r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}})},r.run=function(e,n,o){var i=p({locals:n});return o&&h(o,{},e),e(r,i,c,t,a)}}}}),Y=t({"lib/swig.js"(e){var t=n(),r=k(),o=y(),a=w(),i=h(),s=F(),c=M();e.version="2.0.0";var l,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function p(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){p(e),l.options=t.extend(l.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){p(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},c.install(this,{parser:a,tags:r,filters:o,validateOptions:p,onCompileError:function(e,r){t.throwError(e,null,r.filename)}})},l=new e.Swig,e.setFilter=l.setFilter,e.setTag=l.setTag,e.setExtension=l.setExtension,e.parseFile=l.parseFile,e.precompile=l.precompile,e.compile=l.compile,e.compileFile=l.compileFile,e.render=l.render,e.renderFile=l.renderFile,e.run=l.run,e.invalidateCache=l.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return Y}):window.swig=Y})();
4
4
  /*!
5
5
  * Attach `loc` to the node if provided, skipping the assignment otherwise
6
6
  * so consumers can tell "no source location available" from