Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

liquidjs

Package Overview
Dependencies
Maintainers
1
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidjs - npm Package Compare versions

Comparing version 9.25.1 to 9.26.0

dist/emitters/emitter.d.ts

15

CHANGELOG.md

@@ -0,1 +1,16 @@

# [9.26.0](https://github.com/harttle/liquidjs/compare/v9.25.1...v9.26.0) (2021-09-30)
### Features
* orderedFilterParameters, closes [#312](https://github.com/harttle/liquidjs/issues/312) ([10e8c8f](https://github.com/harttle/liquidjs/commit/10e8c8ff7e1cca6df43087953cd8daf4bd618563))
* stream rendering, closed [#361](https://github.com/harttle/liquidjs/issues/361) fixes [#360](https://github.com/harttle/liquidjs/issues/360) ([9012133](https://github.com/harttle/liquidjs/commit/9012133e0717b1813c6a74a6a282f43ba14d0ada))
* timezoneOffset option to specify output timezone, see [#375](https://github.com/harttle/liquidjs/issues/375) ([6b9f872](https://github.com/harttle/liquidjs/commit/6b9f872bccb4b0c636dc7be2088cafa9bc6c900a))
### Performance Improvements
* improve performance by 4x by simplified parseFile ([24f5346](https://github.com/harttle/liquidjs/commit/24f534608489fccc155f30bbaf37397c46278da6))
* parse filenames in parse() insteadof render() ([8273c17](https://github.com/harttle/liquidjs/commit/8273c17dab3dc09858330ce45e3617a650e7fcaa))
## [9.25.1](https://github.com/harttle/liquidjs/compare/v9.25.0...v9.25.1) (2021-06-20)

@@ -2,0 +17,0 @@

12

dist/builtin/tags/render.d.ts

@@ -1,3 +0,13 @@

import { TagImplOptions } from '../../types';
import { Liquid } from '../../liquid';
import { Token, Template, Tokenizer, Context, TagImplOptions } from '../../types';
declare const _default: TagImplOptions;
export default _default;
declare type ParsedFileName = Template[] | Token | string | undefined;
/**
* @return null for "none",
* @return Template[] for quoted with tags and/or filters
* @return Token for expression (not quoted)
* @throws TypeError if cannot read next token
*/
export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid): ParsedFileName | null;
export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): any;

@@ -23,2 +23,4 @@ import { Template } from './template/template';

lenientIf?: boolean;
/** JavaScript timezoneOffset for `date` filter, default to local time. That means if you're in Australia (UTC+10), it'll default to -600 */
timezoneOffset?: number;
/** Strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */

@@ -48,6 +50,8 @@ trimTagRight?: boolean;

globals?: object;
/** Whether or not to keep value type when writing the Output. Defaults to `false`. */
/** Whether or not to keep value type when writing the Output, not working for streamed rendering. Defaults to `false`. */
keepOutputType?: boolean;
/** An object of operators for conditional statements. Defaults to the regular Liquid operators. */
operators?: Operators;
/** Respect parameter order when using filters like "for ... reversed limit", Defaults to `false`. */
orderedFilterParameters?: boolean;
}

@@ -54,0 +58,0 @@ interface NormalizedOptions extends LiquidOptions {

2

dist/liquid.browser.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var m=function(){return(m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function S(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function q(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function w(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function T(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(w(arguments[e]));return t}var i=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,o=String.prototype.toLowerCase;function a(t){return"[object String]"===r.call(t)}function u(t){return"function"==typeof t}function c(t){return h(t=f(t))?"":String(t)}function f(t){return t instanceof i?t.valueOf():t}function l(t){return"number"==typeof t}function h(t){return null==t}function d(t){return"[object Array]"===r.call(t)}function v(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function g(t){return t[t.length-1]}function y(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function b(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function k(t,e,r){return void 0===r&&(r=" "),x(t,e,r,function(t,e){return e+t})}function x(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function O(t){return t}function E(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=o.call(t))<(e=o.call(e))?-1:e<t?1:0}var L=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},F=(M.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new L(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},M.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},M.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},M.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},M.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},M);function M(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new L("HEAD",null,null,null),this.tail=new L("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}var D=Object.freeze({resolve:function(t,e,i){return t.length&&"/"!==g(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})},readFile:function(n){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function N(t){return t&&u(t.equals)}function P(t,e){return!A(t,e)}function A(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var I={"==":function(t,e){return N(t)?t.equals(e):N(e)?e.equals(t):t===e},"!=":function(t,e){return N(t)?!t.equals(e):N(e)?!e.equals(t):t!==e},">":function(t,e){return N(t)?t.gt(e):N(e)?e.lt(t):e<t},"<":function(t,e){return N(t)?t.lt(e):N(e)?e.gt(t):t<e},">=":function(t,e){return N(t)?t.geq(e):N(e)?e.leq(t):e<=t},"<=":function(t,e){return N(t)?t.leq(e):N(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!u(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return P(t,r)&&P(e,r)},or:function(t,e,r){return P(t,r)||P(e,r)}},V=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],_=1,j=4,B=16;function z(t){var e,r,n={};try{for(var i=q(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=w(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&V[a.charCodeAt(l)]&_&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}V[160]=V[5760]=V[6158]=V[8192]=V[8193]=V[8194]=V[8195]=V[8196]=V[8197]=V[8198]=V[8199]=V[8200]=V[8201]=V[8202]=V[8232]=V[8233]=V[8239]=V[8287]=V[12288]=j;var C={root:["."],cache:void 0,extname:"",fs:D,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,operators:I,operatorsTrie:z(I)};function H(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=K(t.root)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new F(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new F(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=z(t.operators)),t}function K(t){return d(t)?t:a(t)?[t]:[]}var U,Q=(t(W,U=Error),W.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=w(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return b(n,i+1).map(function(t){return(t===e?">> ":" ")+k(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=w(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},W);function W(t,e){var r=U.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var J,Y=(t(Z,J=Q),Z);function Z(t,e){var r=J.call(this,new Error(t),e)||this;return r.name="TokenizationError",J.prototype.update.call(r),r}var $,G=(t(X,$=Q),X);function X(t,e){var r=$.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,$.prototype.update.call(r),r}var tt,et=(t(rt,tt=Q),rt.is=function(t){return"RenderError"===t.name},rt);function rt(t,e){var r=tt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,tt.prototype.update.call(r),r}var nt,it=(t(st,nt=Q),st);function st(t,e){var r=nt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,nt.prototype.update.call(r),r}var ot,at=(t(ut,ot=Error),ut);function ut(t){var e=ot.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var ct,lt=(t(ht,ct=Error),ht);function ht(t){var e=ct.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var pt,ft=(dt.prototype.getRegister=function(t,e){return void 0===e&&(e={}),this.registers[t]=this.registers[t]||e},dt.prototype.setRegister=function(t,e){return this.registers[t]=e},dt.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},dt.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=w(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},dt.prototype.getAll=function(){return T([this.globals,this.environments],this.scopes).reduce(function(t,e){return m(t,e)},{})},dt.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},dt.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(h(t=function(t,e){return h(t)?t:u((t=function t(e){return e&&u(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof i?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return d(t)||a(t)?t.length:t.size}(t):"first"===e?function(t){return d(t)?t[0]:t.first}(t):"last"===e?function(t){return d(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new at(e);return t},t)},dt.prototype.push=function(t){return this.scopes.push(t)},dt.prototype.pop=function(){return this.scopes.pop()},dt.prototype.bottom=function(){return this.scopes[0]},dt.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},dt);function dt(t,e,r){void 0===t&&(t={}),void 0===e&&(e=C),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}function vt(t){return!!(qt(t)&p.TokenKind.Delimited)}function gt(t){return qt(t)===p.TokenKind.Operator}function yt(t){return qt(t)===p.TokenKind.HTML}function mt(t){return qt(t)===p.TokenKind.Output}function wt(t){return qt(t)===p.TokenKind.Tag}function Tt(t){return qt(t)===p.TokenKind.Quoted}function bt(t){return qt(t)===p.TokenKind.Literal}function kt(t){return qt(t)===p.TokenKind.Number}function xt(t){return qt(t)===p.TokenKind.PropertyAccess}function Ot(t){return qt(t)===p.TokenKind.Word}function St(t){return qt(t)===p.TokenKind.Range}function qt(t){return t?t.kind:-1}(pt=p.TokenKind||(p.TokenKind={}))[pt.Number=1]="Number",pt[pt.Literal=2]="Literal",pt[pt.Tag=4]="Tag",pt[pt.Output=8]="Output",pt[pt.HTML=16]="HTML",pt[pt.Filter=32]="Filter",pt[pt.Hash=64]="Hash",pt[pt.PropertyAccess=128]="PropertyAccess",pt[pt.Word=256]="Word",pt[pt.Range=512]="Range",pt[pt.Quoted=1024]="Quoted",pt[pt.Operator=2048]="Operator",pt[pt.Delimited=12]="Delimited";var Et=Object.freeze({isDelimitedToken:vt,isOperatorToken:gt,isHTMLToken:yt,isOutputToken:mt,isTagToken:wt,isQuotedToken:Tt,isLiteralToken:bt,isNumberToken:kt,isPropertyAccessToken:xt,isWordToken:Ot,isRangeToken:St});function Rt(t,e){if(t&&yt(t))for(var r=e?j:B;V[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function Lt(t,e){if(t&&yt(t)){for(var r=e?j:B;V[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Ft=(Mt.prototype.getText=function(){return this.input.slice(this.begin,this.end)},Mt.prototype.getPosition=function(){for(var t=w([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},Mt.prototype.size=function(){return this.end-this.begin},Mt);function Mt(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var Dt,Nt=(t(Pt,Dt=Ft),Pt);function Pt(t,e){var r=Dt.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var At,It=(t(Vt,At=Ft),Vt.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&V[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&V[this.input.charCodeAt(e)]))return!1;return!0},Vt);function Vt(t,e,r,n){var i=At.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var _t,jt=(t(Bt,_t=i),Bt.prototype.equals=function(t){return h(f(t))},Bt.prototype.gt=function(){return!1},Bt.prototype.geq=function(){return!1},Bt.prototype.lt=function(){return!1},Bt.prototype.leq=function(){return!1},Bt.prototype.valueOf=function(){return null},Bt);function Bt(){return null!==_t&&_t.apply(this,arguments)||this}var zt,Ct=(t(Ht,zt=i),Ht.prototype.equals=function(t){return!(t instanceof Ht||(a(t=f(t))||d(t)?0!==t.length:!y(t)||0!==Object.keys(t).length))},Ht.prototype.gt=function(){return!1},Ht.prototype.geq=function(){return!1},Ht.prototype.lt=function(){return!1},Ht.prototype.leq=function(){return!1},Ht.prototype.valueOf=function(){return""},Ht);function Ht(){return null!==zt&&zt.apply(this,arguments)||this}var Kt,Ut=(t(Qt,Kt=Ct),Qt.prototype.equals=function(t){return!1===t||!!h(f(t))||(a(t)?/^\s*$/.test(t):Kt.prototype.equals.call(this,t))},Qt);function Qt(){return null!==Kt&&Kt.apply(this,arguments)||this}var Wt,Jt=new jt,Yt={true:!0,false:!1,nil:Jt,null:Jt,empty:new Ct,blank:new Ut},Zt=(t($t,Wt=Ft),$t);function $t(t,e,r,n){var i=Wt.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var Gt,Xt={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},te=(t(ee,Gt=Ft),ee.prototype.getPrecedence=function(){var t=this.getText();return t in Xt?Xt[t]:1},ee);function ee(t,e,r,n){var i=Gt.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var re=/[\da-fA-F]/,ne=/[0-7]/,ie={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function se(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function oe(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==ie[t[r+1]])e+=ie[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&re.test(t[i]);)n=16*n+se(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(ne.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&ne.test(t[i]);)n=8*n+se(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var ae,ue=(t(ce,ae=Ft),ce.prototype.getVariableAsText=function(){return this.variable instanceof It?this.variable.getText():oe(this.variable.getText())},ce);function ce(t,e,r){var n=ae.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n}function le(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new lt(r)}}var he,pe=(t(fe,he=Ft),fe);function fe(t,e,r,n,i,s){var o=he.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var de,ve=(t(ge,de=Ft),ge);function ge(t,e,r,n,i,s){var o=de.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var ye,me=(t(we,ye=Ft),we);function we(t,e,r,n){var i=ye.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var Te,be=(t(ke,Te=Ft),ke.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},ke);function ke(t,e,r,n){var i=Te.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var xe,Oe=(t(Se,xe=Ft),Se);function Se(t,e,r,n,i,s,o,a){var u=xe.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===g(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}var qe,Ee=(t(Re,qe=Oe),Re);function Re(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=qe.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new je(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new Y("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var Le,Fe=(t(Me,Le=Ft),Me);function Me(t,e,r,n,i,s){var o=Le.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var De,Ne=(t(Pe,De=Oe),Pe);function Pe(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return De.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var Ae=(Ie.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return S(this,function(t){switch(t.label){case 0:le(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=q(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:gt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,Ve(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},Ie);function Ie(t){this.postfix=T(function(e){var r,n,i,s,o,a,u;return S(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=q(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!gt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function Ve(t,e,r){return void 0===r&&(r=!1),xt(t)?function(e,r,n){var t=e.getVariableAsText(),i=e.props.map(function(t){return Ve(t,r,!1)});try{return r.get(T([t],i))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new it(t,e)}}(t,e,r):St(t)?function(t,e){var r=Ve(t.lhs,e),n=Ve(t.rhs,e);return b(+r,+n+1)}(t,e):bt(t)?function(t){return Yt[t.literal]}(t):kt(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):Ot(t)?t.getText():Tt(t)?_e(t):void 0}function _e(t){return oe(t.getText())}var je=(Be.prototype.readExpression=function(){return new Ae(this.readExpressionTokens())},Be.prototype.readExpressionTokens=function(){var e,r,n;return S(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},Be.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&V[t.charCodeAt(o)]&_?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new te(this.input,this.p,this.p=t,this.file)},Be.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},Be.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;le("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new pe(r.getText(),n,this.input,e,this.p,this.file)},Be.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},Be.prototype.readTopLevelTokens=function(t){void 0===t&&(t=C);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];vt(i)&&(!r&&i.trimLeft&&Rt(t[n-1],e.greedy),wt(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&Lt(t[n+1],e.greedy))}}(e,t),e},Be.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},Be.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new be(this.input,e,this.p,this.file)},Be.prototype.readTagToken=function(t){void 0===t&&(t=C);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new Ee(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},Be.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},Be.prototype.readOutputToken=function(t){void 0===t&&(t=C);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new Ne(r,i,this.p,t,e)},Be.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new Ee(this.input,n,s,t,this.file)):(this.p=i,new be(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},Be.prototype.mkError=function(t,e){return new Y(t,new It(this.input,e,this.N,this.file))},Be.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},Be.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},Be.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&_;)++this.p;return new It(this.input,t,this.p,this.file)},Be.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},Be.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new ve(this.input,e,this.p,r,t,this.file)},Be.prototype.remaining=function(){return this.input.slice(this.p)},Be.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},Be.prototype.end=function(){return this.p>=this.N},Be.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},Be.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new ue(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new It(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&Yt.hasOwnProperty(e.content)?new Zt(this.input,e.begin,e.end,this.file):r?new Nt(e,n[0]):new ue(e,n,this.p)}},Be.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new Fe(this.input,t,this.p,e,r,this.file)}},Be.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return le(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},Be.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new me(this.input,t,this.p,this.file)}},Be.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&j)&&","!==this.peek()&&this.p<this.N;)this.p++;return new It(this.input,t,this.p,this.file)},Be.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},Be.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},Be.prototype.peekType=function(t){return void 0===t&&(t=0),V[this.input.charCodeAt(this.p+t)]},Be.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},Be.prototype.skipBlank=function(){for(;this.peekType()&j;)++this.p},Be);function Be(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var ze=(Ce.prototype.write=function(t){t=!0===this.keepOutputType?f(t):c(f(t)),!0===this.keepOutputType&&"string"!=typeof t&&""===this.html?this.html=t:this.html=c(this.html)+c(t)},Ce);function Ce(t){this.html="",this.break=!1,this.continue=!1,this.keepOutputType=!1,this.keepOutputType=t}var He=(Ke.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return S(this,function(t){switch(t.label){case 0:n=n||new ze(r.opts.keepOutputType),t.label=1;case 1:t.trys.push([1,8,9,10]),i=q(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),et.is(u)?u:new et(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.html]}})},Ke);function Ke(){}var Ue=(Qe.prototype.on=function(t,e){return this.handlers[t]=e,this},Qe.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r(e),!0)},Qe.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||wt(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},Qe.prototype.stop=function(){return this.stopRequested=!0,this},Qe);function Qe(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function We(t){this.token=t}var Je=(Ye.prototype.render=function(e){var r,n,i,s,o,a,u,c,l;return S(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,6,7,8]),n=q(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,5]:(s=i.value,o=r,a=s,[4,Ve(this.hash[s],e)]);case 3:o[a]=t.sent(),t.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return u=t.sent(),c={error:u},[3,8];case 7:try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(c)throw c.error}return[7];case 8:return[2,r]}})},Ye);function Ye(t){var e,r;this.hash={};var n=new je(t,{});try{for(var i=q(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var Ze=($e.prototype.render=function(t,e){var r,n,i=[];try{for(var s=q(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;d(a)?i.push([a[0],Ve(a[1],e)]):i.push(Ve(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},T([t],i))},$e);function $e(t,e,r,n){this.name=t,this.impl=e||O,this.args=r,this.liquid=n}var Ge=(Xe.prototype.value=function(e,r){var n,i,s,o,a,u;return S(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=q(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},Xe);function Xe(t,n){this.filters=[];var e=new je(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new Ze(e,n.filters.get(e),r,n)})}function tr(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function er(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function rr(n){return function(t){return t&&u(t.then)}(n)?n:function(t){return t&&u(t.next)&&u(t.throw)&&u(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return er(t)}if(e.done)return tr(e.value);return rr(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return er(t)}return e.done?tr(e.value):r(e.value)})}():tr(n)}function nr(t){return Promise.resolve(rr(t))}function ir(t){var e;return rr(t).then(function(t){return tr(e=t)}).catch(function(t){throw t}),e}var sr,or=(t(ar,sr=We),ar.prototype.render=function(e,r){var n,i;return S(this,function(t){switch(t.label){case 0:return[4,new Je(this.token.args).render(e)];case 1:return n=t.sent(),u((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},ar);function ar(t,e,r){var n=sr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var ur,cr=(t(lr,ur=We),lr.prototype.render=function(e,r){var n;return S(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},lr);function lr(t,e){var r=ur.call(this,t)||this;return r.value=new Ge(t.content,e),r}var hr,pr=(t(fr,hr=We),fr.prototype.render=function(t,e){return S(this,function(t){return e.write(this.str),[2]})},fr);function fr(t){var e=hr.call(this,t)||this;return e.str=t.getContent(),e}var dr=(vr.prototype.parse=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},vr.prototype.parseToken=function(e,t){try{return wt(e)?new or(e,t,this.liquid):mt(e)?new cr(e,this.liquid):new pr(e)}catch(t){throw new G(t,e)}},vr.prototype.parseStream=function(t){var r=this;return new Ue(t,function(t,e){return r.parseToken(t,e)})},vr);function vr(t){this.liquid=t}var gr={parse:function(t){var e=new je(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),le("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return S(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function yr(e){return d(e)?e:a(e)&&0<e.length?[e]:y(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function mr(t){return d(t)?t:[t]}var wr,Tr=(t(br,wr=i),br.prototype.next=function(){this.i++},br.prototype.index0=function(){return this.i},br.prototype.index=function(){return this.i+1},br.prototype.first=function(){return 0===this.i},br.prototype.last=function(){return this.i===this.length-1},br.prototype.rindex=function(){return this.length-this.i},br.prototype.rindex0=function(){return this.length-this.i-1},br.prototype.valueOf=function(){return JSON.stringify(this)},br);function br(t){var e=wr.call(this)||this;return e.i=0,e.length=t,e}var kr={type:"block",parse:function(t,e){var r,n=this,i=new je(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();le(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new Je(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v;return S(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=yr,[4,Ve(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=o.offset||0,u=void 0===o.limit?i.length:o.limit,i=i.slice(a,a+u),"reversed"in o&&i.reverse(),c={forloop:new Tr(i.length)},e.push(c),t.label=5;case 5:t.trys.push([5,10,11,12]),l=q(i),h=l.next(),t.label=6;case 6:return h.done?[3,9]:(p=h.value,c[this.variable]=p,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,c.forloop.next(),t.label=8;case 8:return h=l.next(),[3,6];case 9:return[3,12];case 10:return f=t.sent(),d={error:f},[3,12];case 11:try{h&&!h.done&&(v=l.return)&&v.call(l)}finally{if(d)throw d.error}return[7];case 12:return e.pop(),[2]}})}},xr={parse:function(t,e){var r=this,n=new je(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return _e(r)}(n),le(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return S(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Or,Sr,qr={parse:function(t,e){var n=this;this.cond=new Ge(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new je(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();r&&n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return S(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=q(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,Ve(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Er={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Sr=Or=Or||{})[Sr.OUTPUT=0]="OUTPUT",Sr[Sr.STORE=1]="STORE";var Rr,Lr=Or,Fr={parse:function(t){var e=t.args,r=new je(e,this.liquid.options.operatorsTrie);this.file=this.liquid.options.dynamicPartials?r.readValue():r.readFileName(),le(this.file,function(){return'illegal argument "'+t.args+'"'});var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new Je(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return S(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=n.file,u=i.renderer,e.opts.dynamicPartials?Tt(a)?[4,u.renderTemplates(i.parse(_e(a)),e)]:[3,2]:[3,5];case 1:return h=t.sent(),[3,4];case 2:return[4,Ve(a,e)];case 3:h=t.sent(),t.label=4;case 4:return l=h,[3,6];case 5:l=a.getText(),t.label=6;case 6:return le(c=l,function(){return'illegal filename "'+a.getText()+'":"'+c+'"'}),p=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",Lr.OUTPUT),[4,s.render(e)];case 7:return f=t.sent(),o&&(f[c]=Ve(o,e)),[4,i._parseFile(c,e.opts,e.sync)];case 8:return d=t.sent(),e.push(f),[4,u.renderTemplates(d,e,r)];case 9:return t.sent(),e.pop(),e.restoreRegister(p),[2]}})}},Mr={parse:function(t){var e=t.args,r=new je(e,this.liquid.options.operatorsTrie);for(this.file=this.liquid.options.dynamicPartials?r.readValue():r.readFileName(),le(this.file,function(){return'illegal argument "'+t.args+'"'});!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new Je(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,T,b,k,x,O;return S(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.file,o=n.hash,a=i.renderer,e.opts.dynamicPartials?Tt(s)?[4,a.renderTemplates(i.parse(_e(s)),e)]:[3,2]:[3,4];case 1:return l=t.sent(),[3,3];case 2:l=Ve(s,e),t.label=3;case 3:return c=l,[3,5];case 4:c=s.getText(),t.label=5;case 5:return le(u=c,function(){return'illegal filename "'+s.getText()+'":"'+u+'"'}),h=new ft({},e.opts,e.sync),[4,o.render(e)];case 6:if(p=t.sent(),this.with&&(f=this.with,v=f.value,g=f.alias,p[g||u]=Ve(v,e)),h.push(p),!this.for)return[3,16];d=this.for,v=d.value,g=d.alias,y=yr(y=Ve(v,e)),p.forloop=new Tr(y.length),t.label=7;case 7:t.trys.push([7,13,14,15]),m=q(y),w=m.next(),t.label=8;case 8:return w.done?[3,12]:(T=w.value,p[g]=T,[4,i._parseFile(u,h.opts,h.sync)]);case 9:return k=t.sent(),[4,a.renderTemplates(k,h,r)];case 10:t.sent(),p.forloop.next(),t.label=11;case 11:return w=m.next(),[3,8];case 12:return[3,15];case 13:return b=t.sent(),x={error:b},[3,15];case 14:try{w&&!w.done&&(O=m.return)&&O.call(m)}finally{if(x)throw x.error}return[7];case 15:return[3,19];case 16:return[4,i._parseFile(u,h.opts,h.sync)];case 17:return k=t.sent(),[4,a.renderTemplates(k,h,r)];case 18:t.sent(),t.label=19;case 19:return[2]}})}},Dr={parse:function(t){var e=new je(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;l(r[this.variable])||(r[this.variable]=0),e.write(c(--r[this.variable]))}},Nr={parse:function(t){var e=new je(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}le(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+Ve(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=Ve(s,t);e.write(o)}},Pr={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({cond:new Ge(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){n.branches.push({cond:new Ge(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){return i.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n,i,s,o,a,u,c;return S(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=q(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:[4,(o=s.value).cond.value(e,e.opts.lenientIf)];case 3:return P(t.sent(),e)?[4,n.renderTemplates(o.templates,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return a=t.sent(),u={error:a},[3,9];case 8:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(u)throw u.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Ar={parse:function(t){var e=new je(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;l(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(c(n))}},Ir={parse:function(t,e){var r=new je(t.args,this.liquid.options.operatorsTrie),n=this.liquid.options.dynamicPartials?r.readValue():r.readFileName();le(n,function(){return'illegal argument "'+t.args+'"'}),this.file=n,this.hash=new Je(r.remaining()),this.tpls=this.liquid.parser.parse(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y;return S(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,"none"!==o.getText()?[3,2]:(e.setRegister("blockMode",Lr.OUTPUT),[4,a.renderTemplates(this.tpls,e)]);case 1:return u=t.sent(),r.write(u),[2];case 2:return e.opts.dynamicPartials?Tt(o)?[4,a.renderTemplates(i.parse(_e(o)),e)]:[3,4]:[3,6];case 3:return h=t.sent(),[3,5];case 4:h=Ve(this.file,e),t.label=5;case 5:return l=h,[3,7];case 6:l=o.getText(),t.label=7;case 7:return le(c=l,function(){return'file "'+o.getText()+'"("'+c+'") not available'}),[4,i._parseFile(c,e.opts,e.sync)];case 8:return p=t.sent(),e.setRegister("blockMode",Lr.STORE),[4,a.renderTemplates(this.tpls,e)];case 9:return f=t.sent(),void 0===(d=e.getRegister("blocks"))[""]&&(d[""]=function(){return f}),e.setRegister("blockMode",Lr.OUTPUT),g=(v=e).push,[4,s.render(e)];case 10:return g.apply(v,[t.sent()]),[4,a.renderTemplates(p,e)];case 11:return y=t.sent(),e.pop(),r.write(y),[2]}})}},Vr=(t(_r,Rr=i),_r.prototype.super=function(){return this.superBlockRender()},_r);function _r(t){void 0===t&&(t=function(){return""});var e=Rr.call(this)||this;return e.superBlockRender=t,e}var jr,Br={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[];var i=this.liquid.parser.parseStream(e).on("tag:endblock",function(){return i.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n;return S(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),[4,this.emitHTML(e,r,n)];case 1:return t.sent(),[2]}})},getBlockRender:function(n){function e(e){var r;return S(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n)];case 1:return r=t.sent(),n.pop(),[2,r]}})}var i=this.liquid,s=this.tpls,r=n.getRegister("blocks")[this.block];return r?function(t){return r(new Vr(function(){return e(t)}))}:e},emitHTML:function(e,r,n){var i,s;return S(this,function(t){switch(t.label){case 0:return e.getRegister("blockMode",Lr.OUTPUT)!==Lr.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return s=(i=r).write,[4,n(new Vr)];case 2:s.apply(i,[t.sent()]),t.label=3;case 3:return[2]}})}},zr={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},Cr=(t(Hr,jr=Tr),Hr.prototype.row=function(){return Math.floor(this.i/this.cols)+1},Hr.prototype.col0=function(){return this.i%this.cols},Hr.prototype.col=function(){return this.col0()+1},Hr.prototype.col_first=function(){return 0===this.col0()},Hr.prototype.col_last=function(){return this.col()===this.cols},Hr);function Hr(t,e){var r=jr.call(this,t)||this;return r.length=t,r.cols=e,r}var Kr={assign:gr,for:kr,capture:xr,case:qr,comment:Er,include:Fr,render:Mr,decrement:Dr,increment:Ar,cycle:Nr,if:Pr,layout:Ir,block:Br,raw:zr,tablerow:{parse:function(t,e){var r=this,n=new je(t.args,this.liquid.options.operatorsTrie);this.variable=n.readIdentifier(),n.skipBlank();var i,s=n.readIdentifier();le(s&&"in"===s.content,function(){return"illegal tag: "+t.getText()}),this.collection=n.readValue(),this.hash=new Je(n.remaining()),this.templates=[];var o=this.liquid.parser.parseStream(e).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(){return o.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});o.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return S(this,function(t){switch(t.label){case 0:return i=yr,[4,Ve(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new Cr(n.length,u),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable.content]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.templates=[],this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(e).on("start",function(){r=n.templates,n.cond=new Ge(t.args,n.liquid)}).on("tag:elsif",function(t){n.branches.push({cond:new Ge(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){return i.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n,i,s,o,a,u,c;return S(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,[4,this.cond.value(e,e.opts.lenientIf)];case 1:return A(t.sent(),e)?[4,n.renderTemplates(this.templates,e,r)]:[3,3];case 2:return t.sent(),[2];case 3:t.trys.push([3,9,10,11]),i=q(this.branches),s=i.next(),t.label=4;case 4:return s.done?[3,8]:[4,(o=s.value).cond.value(e,e.opts.lenientIf)];case 5:return P(t.sent(),e)?[4,n.renderTemplates(o.templates,e,r)]:[3,7];case 6:return t.sent(),[2];case 7:return s=i.next(),[3,4];case 8:return[3,11];case 9:return a=t.sent(),u={error:a},[3,11];case 10:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(u)throw u.error}return[7];case 11:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 12:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},Ur={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},Qr={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function Wr(t){return c(t).replace(/&|<|>|"|'/g,function(t){return Ur[t]})}var Jr=Math.abs,Yr=Math.max,Zr=Math.min,$r=Math.ceil,Gr=Math.floor;var Xr=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,tn=["January","February","March","April","May","June","July","August","September","October","November","December"],en=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],rn=tn.map(on),nn=en.map(on),sn={1:"st",2:"nd",3:"rd",default:"th"};function on(t){return t.slice(0,3)}function an(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function un(t,e){var r=an(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var cn={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},ln={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},hn={a:function(t){return nn[t.getDay()]},A:function(t){return en[t.getDay()]},b:function(t){return rn[t.getMonth()]},B:function(t){return tn[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return an(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),x(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return sn[r]||sn.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return un(t,0)},w:function(t){return t.getDay()},W:function(t){return un(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=t.getTimezoneOffset(),n=Math.abs(r),i=n%60;return(0<r?"-":"+")+k(Math.floor(n/60),2,"0")+(e.flags[":"]?":":"")+k(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function pn(t,e){var r,n,i=w(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=hn[l];if(!h)return s;var p={};try{for(var f=q(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=ln[l]||"0",y=u||cn[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return T(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(y=0),k(v,y,g)}hn.h=hn.b;var fn,dn=(t(vn,fn=Date),vn.prototype.getDisplayDate=function(){return new Date(+this+60*this.inputTimezoneOffset*1e3)},vn);function vn(t){var e=fn.call(this,t)||this;e.dateString=t,e.ISO8601_TIMEZONE_PATTERN=/([zZ]|([+-])(\d{2}):(\d{2}))$/,e.inputTimezoneOffset=0;var r=t.match(e.ISO8601_TIMEZONE_PATTERN);if(r&&"Z"===r[1])e.inputTimezoneOffset=e.getTimezoneOffset();else if(r&&r[2]&&r[3]&&r[4]){var n=w(r,5),i=n[2],s=n[3],o=n[4],a=("+"===i?1:-1)*(60*parseInt(s,10)+parseInt(o,10));e.inputTimezoneOffset=e.getTimezoneOffset()+a}return e}var gn=Object.freeze({escape:Wr,escapeOnce:function(t){return Wr(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return Qr[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:Jr,atLeast:Yr,atMost:Zr,ceil:$r,dividedBy:function(t,e){return t/e},floor:Gr,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?T(t).sort(function(t,e){return R(t[r],e[r])}):T(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return d(t)?g(t):""},first:function(t){return d(t)?t[0]:""},reverse:function(t){return T(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return mr(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return mr(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return mr(t).filter(function(t){return!h(t)})},concat:function(t,e){return mr(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return mr(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?P(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r=t;return"now"===t||"today"===t?r=new Date:l(t)?r=new Date(1e3*t):a(t)&&(r=/^\d+$/.test(t)?new Date(1e3*+t):this.context.opts.preserveTimezones?new dn(t):new Date(t)),function(t){return t instanceof Date&&!isNaN(t.getTime())}(r)?function(t,e){var r=t;r instanceof dn&&(r=r.getDisplayDate());for(var n,i="",s=e;n=Xr.exec(s);)i+=s.slice(0,n.index),s=s.slice(n.index+n[0].length),i+=pn(r,n);return i+s}(r,e):t},Default:function(t,e){return d(t)||a(t)?t.length?t:e:A(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return le(2===arguments.length,function(){return"append expect 2 arguments"}),c(t)+c(e)},prepend:function(t,e){return le(2===arguments.length,function(){return"prepend expect 2 arguments"}),c(e)+c(t)},lstrip:function(t){return c(t).replace(/^\s+/,"")},downcase:function(t){return c(t).toLowerCase()},upcase:function(t){return c(t).toUpperCase()},remove:function(t,e){return c(t).split(String(e)).join("")},removeFirst:function(t,e){return c(t).replace(String(e),"")},rstrip:function(t){return c(t).replace(/\s+$/,"")},split:function(t,e){return c(t).split(String(e))},strip:function(t){return c(t).trim()},stripNewlines:function(t){return c(t).replace(/\n/g,"")},capitalize:function(t){return(t=c(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return c(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return c(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=c(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),yn=(mn.prototype.get=function(t){var e=this.impls[t];return le(e,function(){return'tag "'+t+'" not found'}),e},mn.prototype.set=function(t,e){this.impls[t]=e},mn);function mn(){this.impls={}}var wn=(Tn.prototype.get=function(t){var e=this.impls[t];return le(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},Tn.prototype.set=function(t,e){this.impls[t]=e},Tn.prototype.create=function(t,e){return new Ze(t,this.get(t),e,this.liquid)},Tn);function Tn(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var bn=(kn.prototype.parse=function(t,e){var r=new je(t,this.options.operatorsTrie,e).readTopLevelTokens(this.options);return this.parser.parse(r)},kn.prototype._render=function(t,e,r,n){var i=m({},this.options,H(r)),s=new ft(e,i,n),o=new ze(i.keepOutputType);return this.renderer.renderTemplates(t,s,o)},kn.prototype.render=function(e,r,n){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,nr(this._render(e,r,n,!1))]})})},kn.prototype.renderSync=function(t,e,r){return ir(this._render(t,e,r,!0))},kn.prototype._parseAndRender=function(t,e,r,n){var i=this.parse(t);return this._render(i,e,r,n)},kn.prototype.parseAndRender=function(e,r,n){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,nr(this._parseAndRender(e,r,n,!1))]})})},kn.prototype.parseAndRenderSync=function(t,e,r){return ir(this._parseAndRender(t,e,r,!0))},kn.prototype._parseFile=function(e,r,n){var i,s,o,a,u,c,l,h,p,f,d,v,g,y;return S(this,function(t){switch(t.label){case 0:i=m({},this.options,H(r)),s=i.root.map(function(t){return i.fs.resolve(t,e,i.extname)}),void 0!==i.fs.fallback&&void 0!==(u=i.fs.fallback(e))&&s.push(u),t.label=1;case 1:t.trys.push([1,13,14,15]),o=q(s),a=o.next(),t.label=2;case 2:return a.done?[3,12]:(u=a.value,(c=i.cache)?[4,c.read(u)]:[3,4]);case 3:if(l=t.sent())return[2,l];t.label=4;case 4:return n?(h=i.fs.existsSync(u),[3,7]):[3,5];case 5:return[4,i.fs.exists(u)];case 6:h=t.sent(),t.label=7;case 7:return h?(f=this.parse,n?(d=i.fs.readFileSync(u),[3,10]):[3,8]):[3,11];case 8:return[4,i.fs.readFile(u)];case 9:d=t.sent(),t.label=10;case 10:return p=f.apply(this,[d,u]),c&&c.write(u,p),[2,p];case 11:return a=o.next(),[3,2];case 12:return[3,15];case 13:return v=t.sent(),g={error:v},[3,15];case 14:try{a&&!a.done&&(y=o.return)&&y.call(o)}finally{if(g)throw g.error}return[7];case 15:throw this.lookupError(e,i.root)}})},kn.prototype.parseFile=function(e,r){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,nr(this._parseFile(e,r,!1))]})})},kn.prototype.parseFileSync=function(t,e){return ir(this._parseFile(t,e,!0))},kn.prototype.renderFile=function(r,n,i){return s(this,void 0,void 0,function(){var e;return S(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r,i)];case 1:return e=t.sent(),[2,this.render(e,n,i)]}})})},kn.prototype.renderFileSync=function(t,e,r){var n=this.parseFileSync(t,r);return this.renderSync(n,e,r)},kn.prototype._evalValue=function(t,e){return new Ge(t,this).value(e,!1)},kn.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,nr(this._evalValue(e,r))]})})},kn.prototype.evalValueSync=function(t,e){return ir(this._evalValue(t,e))},kn.prototype.registerFilter=function(t,e){this.filters.set(t,e)},kn.prototype.registerTag=function(t,e){this.tags.set(t,e)},kn.prototype.plugin=function(t){return t.call(this,kn)},kn.prototype.express=function(){var i=this;return function(t,e,r){var n={root:T(K(this.root),i.options.root)};i.renderFile(t,e,n).then(function(t){return r(null,t)},r)}},kn.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},kn.prototype.getTemplate=function(e,r){return s(this,void 0,void 0,function(){return S(this,function(t){return[2,this.parseFile(e,r)]})})},kn.prototype.getTemplateSync=function(t,e){return this.parseFileSync(t,e)},kn);function kn(t){var r=this;void 0===t&&(t={}),this.options=function(t){return m({},C,t)}(H(t)),this.parser=new dr(this),this.renderer=new He,this.filters=new wn(this.options.strictFilters,this),this.tags=new yn,v(Kr,function(t,e){return r.registerTag(E(e),t)}),v(gn,function(t,e){return r.registerFilter(E(e),t)})}p.AssertionError=lt,p.Context=ft,p.Drop=i,p.Emitter=ze,p.Expression=Ae,p.Hash=Je,p.InternalUndefinedVariableError=at,p.Liquid=bn,p.LiquidError=Q,p.ParseError=G,p.ParseStream=Ue,p.RenderError=et,p.TagToken=Ee,p.Token=Ft,p.TokenizationError=Y,p.Tokenizer=je,p.TypeGuards=Et,p.UndefinedVariableError=it,p.Value=Ge,p.assert=le,p.createTrie=z,p.defaultOperators=I,p.evalQuotedToken=_e,p.evalToken=Ve,p.isFalsy=A,p.isTruthy=P,p.toPromise=nr,p.toThenable=rr,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function T(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function k(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function y(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}var o=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,a=String.prototype.toLowerCase;function u(t){return"string"==typeof t}function c(t){return"function"==typeof t}function l(t){return u(t=f(t))?t:d(t)?"":String(t)}function f(t){return t instanceof o?t.valueOf():t}function h(t){return"number"==typeof t}function d(t){return null==t}function v(t){return"[object Array]"===r.call(t)}function g(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function m(t){return t[t.length-1]}function b(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function x(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function q(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return e+t})}function O(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function S(t){return t}function F(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=a.call(t))<(e=a.call(e))?-1:e<t?1:0}var E=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},L=(P.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new E(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},P.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},P.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},P.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},P.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},P);function P(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new E("HEAD",null,null,null),this.tail=new E("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}var D=Object.freeze({resolve:function(t,e,i){return t.length&&"/"!==m(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})},readFile:function(n){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function M(t){return t&&c(t.equals)}function N(t,e){return!I(t,e)}function I(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var A={"==":function(t,e){return M(t)?t.equals(e):M(e)?e.equals(t):t===e},"!=":function(t,e){return M(t)?!t.equals(e):M(e)?!e.equals(t):t!==e},">":function(t,e){return M(t)?t.gt(e):M(e)?e.lt(t):e<t},"<":function(t,e){return M(t)?t.lt(e):M(e)?e.gt(t):t<e},">=":function(t,e){return M(t)?t.geq(e):M(e)?e.leq(t):e<=t},"<=":function(t,e){return M(t)?t.leq(e):M(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!c(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return N(t,r)&&N(e,r)},or:function(t,e,r){return N(t,r)||N(e,r)}},V=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=1,B=4,C=16;function _(t){var e,r,n={};try{for(var i=k(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=y(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&V[a.charCodeAt(l)]&j&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}V[160]=V[5760]=V[6158]=V[8192]=V[8193]=V[8194]=V[8195]=V[8196]=V[8197]=V[8198]=V[8199]=V[8200]=V[8201]=V[8202]=V[8232]=V[8233]=V[8239]=V[8287]=V[12288]=B;var z=(new Date).getTimezoneOffset(),H=/([zZ]|([+-])(\d{2}):(\d{2}))$/,K=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W=U.map($),J=Q.map($),Y={1:"st",2:"nd",3:"rd",default:"th"};function $(t){return t.slice(0,3)}function G(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function X(t,e){var r=G(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var Z={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},tt={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},et={a:function(t){return J[t.getDay()]},A:function(t){return Q[t.getDay()]},b:function(t){return W[t.getMonth()]},B:function(t){return U[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return G(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return Y[r]||Y.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return X(t,0)},w:function(t){return t.getDay()},W:function(t){return X(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=Math.abs(z),n=Math.floor(r/60),i=r%60;return(0<z?"-":"+")+q(n,2,"0")+(e.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function rt(t,e){var r,n,i=y(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=et[l];if(!h)return s;var p={};try{for(var f=k(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=tt[l]||"0",m=u||Z[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return w(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(m=0),q(v,m,g)}et.h=et.b;var nt={root:["."],cache:void 0,extname:"",fs:D,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,timezoneOffset:z,operators:A,operatorsTrie:_(A)};function it(t){return v(t)?t:u(t)?[t]:[]}var st,ot=(t(at,st=Error),at.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=y(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return x(n,i+1).map(function(t){return(t===e?">> ":" ")+q(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=y(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},at);function at(t,e){var r=st.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var ut,ct=(t(lt,ut=ot),lt);function lt(t,e){var r=ut.call(this,new Error(t),e)||this;return r.name="TokenizationError",ut.prototype.update.call(r),r}var ht,pt=(t(ft,ht=ot),ft);function ft(t,e){var r=ht.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,ht.prototype.update.call(r),r}var dt,vt=(t(gt,dt=ot),gt.is=function(t){return"RenderError"===t.name},gt);function gt(t,e){var r=dt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,dt.prototype.update.call(r),r}var mt,yt=(t(wt,mt=ot),wt);function wt(t,e){var r=mt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,mt.prototype.update.call(r),r}var bt,Tt=(t(kt,bt=Error),kt);function kt(t){var e=bt.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var xt,qt=(t(Ot,xt=Error),Ot);function Ot(t){var e=xt.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var St,Ft=(Rt.prototype.getRegister=function(t,e){return void 0===e&&(e={}),this.registers[t]=this.registers[t]||e},Rt.prototype.setRegister=function(t,e){return this.registers[t]=e},Rt.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},Rt.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=y(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},Rt.prototype.getAll=function(){return w([this.globals,this.environments],this.scopes).reduce(function(t,e){return i(t,e)},{})},Rt.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},Rt.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(d(t=function(t,e){return d(t)?t:c((t=function t(e){return e&&c(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof o?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return v(t)||u(t)?t.length:t.size}(t):"first"===e?function(t){return v(t)?t[0]:t.first}(t):"last"===e?function(t){return v(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new Tt(e);return t},t)},Rt.prototype.push=function(t){return this.scopes.push(t)},Rt.prototype.pop=function(){return this.scopes.pop()},Rt.prototype.bottom=function(){return this.scopes[0]},Rt.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},Rt);function Rt(t,e,r){void 0===t&&(t={}),void 0===e&&(e=nt),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}function Et(t){return!!(Ct(t)&p.TokenKind.Delimited)}function Lt(t){return Ct(t)===p.TokenKind.Operator}function Pt(t){return Ct(t)===p.TokenKind.HTML}function Dt(t){return Ct(t)===p.TokenKind.Output}function Mt(t){return Ct(t)===p.TokenKind.Tag}function Nt(t){return Ct(t)===p.TokenKind.Quoted}function It(t){return Ct(t)===p.TokenKind.Literal}function At(t){return Ct(t)===p.TokenKind.Number}function Vt(t){return Ct(t)===p.TokenKind.PropertyAccess}function jt(t){return Ct(t)===p.TokenKind.Word}function Bt(t){return Ct(t)===p.TokenKind.Range}function Ct(t){return t?t.kind:-1}(St=p.TokenKind||(p.TokenKind={}))[St.Number=1]="Number",St[St.Literal=2]="Literal",St[St.Tag=4]="Tag",St[St.Output=8]="Output",St[St.HTML=16]="HTML",St[St.Filter=32]="Filter",St[St.Hash=64]="Hash",St[St.PropertyAccess=128]="PropertyAccess",St[St.Word=256]="Word",St[St.Range=512]="Range",St[St.Quoted=1024]="Quoted",St[St.Operator=2048]="Operator",St[St.Delimited=12]="Delimited";var _t=Object.freeze({isDelimitedToken:Et,isOperatorToken:Lt,isHTMLToken:Pt,isOutputToken:Dt,isTagToken:Mt,isQuotedToken:Nt,isLiteralToken:It,isNumberToken:At,isPropertyAccessToken:Vt,isWordToken:jt,isRangeToken:Bt});function zt(t,e){if(t&&Pt(t))for(var r=e?B:C;V[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function Ht(t,e){if(t&&Pt(t)){for(var r=e?B:C;V[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Kt=(Ut.prototype.getText=function(){return this.input.slice(this.begin,this.end)},Ut.prototype.getPosition=function(){for(var t=y([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},Ut.prototype.size=function(){return this.end-this.begin},Ut);function Ut(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var Qt,Wt=(t(Jt,Qt=Kt),Jt);function Jt(t,e){var r=Qt.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var Yt,$t=(t(Gt,Yt=Kt),Gt.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&V[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&V[this.input.charCodeAt(e)]))return!1;return!0},Gt);function Gt(t,e,r,n){var i=Yt.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var Xt,Zt=(t(te,Xt=o),te.prototype.equals=function(t){return d(f(t))},te.prototype.gt=function(){return!1},te.prototype.geq=function(){return!1},te.prototype.lt=function(){return!1},te.prototype.leq=function(){return!1},te.prototype.valueOf=function(){return null},te);function te(){return null!==Xt&&Xt.apply(this,arguments)||this}var ee,re=(t(ne,ee=o),ne.prototype.equals=function(t){return!(t instanceof ne||(u(t=f(t))||v(t)?0!==t.length:!b(t)||0!==Object.keys(t).length))},ne.prototype.gt=function(){return!1},ne.prototype.geq=function(){return!1},ne.prototype.lt=function(){return!1},ne.prototype.leq=function(){return!1},ne.prototype.valueOf=function(){return""},ne);function ne(){return null!==ee&&ee.apply(this,arguments)||this}var ie,se=(t(oe,ie=re),oe.prototype.equals=function(t){return!1===t||!!d(f(t))||(u(t)?/^\s*$/.test(t):ie.prototype.equals.call(this,t))},oe);function oe(){return null!==ie&&ie.apply(this,arguments)||this}var ae,ue=new Zt,ce={true:!0,false:!1,nil:ue,null:ue,empty:new re,blank:new se},le=(t(he,ae=Kt),he);function he(t,e,r,n){var i=ae.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var pe,fe={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},de=(t(ve,pe=Kt),ve.prototype.getPrecedence=function(){var t=this.getText();return t in fe?fe[t]:1},ve);function ve(t,e,r,n){var i=pe.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var ge=/[\da-fA-F]/,me=/[0-7]/,ye={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function we(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function be(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==ye[t[r+1]])e+=ye[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&ge.test(t[i]);)n=16*n+we(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(me.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&me.test(t[i]);)n=8*n+we(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var Te,ke=(t(xe,Te=Kt),xe);function xe(t,e,r){var n=Te.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n.propertyName=n.variable instanceof $t?n.variable.getText():be(n.variable.getText()),n}function qe(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new qt(r)}}var Oe,Se=(t(Fe,Oe=Kt),Fe);function Fe(t,e,r,n,i,s){var o=Oe.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var Re,Ee=(t(Le,Re=Kt),Le);function Le(t,e,r,n,i,s){var o=Re.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var Pe,De=(t(Me,Pe=Kt),Me);function Me(t,e,r,n){var i=Pe.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var Ne,Ie=(t(Ae,Ne=Kt),Ae.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},Ae);function Ae(t,e,r,n){var i=Ne.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var Ve,je=(t(Be,Ve=Kt),Be);function Be(t,e,r,n,i,s,o,a){var u=Ve.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===m(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}var Ce,_e=(t(ze,Ce=je),ze);function ze(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=Ce.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new Ze(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new ct("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var He,Ke=(t(Ue,He=Kt),Ue);function Ue(t,e,r,n,i,s){var o=He.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var Qe,We=(t(Je,Qe=je),Je);function Je(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return Qe.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var Ye=($e.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:qe(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=k(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:Lt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,Ge(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},$e);function $e(t){this.postfix=w(function(e){var r,n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=k(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!Lt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function Ge(t,e,r){return void 0===r&&(r=!1),Vt(t)?function(e,r,n){var t=e.props.map(function(t){return Ge(t,r,!1)});try{return r.get(w([e.propertyName],t))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new yt(t,e)}}(t,e,r):Bt(t)?function(t,e){var r=Ge(t.lhs,e),n=Ge(t.rhs,e);return x(+r,+n+1)}(t,e):It(t)?function(t){return ce[t.literal]}(t):At(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):jt(t)?t.getText():Nt(t)?Xe(t):void 0}function Xe(t){return be(t.getText())}var Ze=(tr.prototype.readExpression=function(){return new Ye(this.readExpressionTokens())},tr.prototype.readExpressionTokens=function(){var e,r,n;return T(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},tr.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&V[t.charCodeAt(o)]&j?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new de(this.input,this.p,this.p=t,this.file)},tr.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},tr.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;qe("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new Se(r.getText(),n,this.input,e,this.p,this.file)},tr.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},tr.prototype.readTopLevelTokens=function(t){void 0===t&&(t=nt);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];Et(i)&&(!r&&i.trimLeft&&zt(t[n-1],e.greedy),Mt(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&Ht(t[n+1],e.greedy))}}(e,t),e},tr.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},tr.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new Ie(this.input,e,this.p,this.file)},tr.prototype.readTagToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new _e(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},tr.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},tr.prototype.readOutputToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new We(r,i,this.p,t,e)},tr.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new _e(this.input,n,s,t,this.file)):(this.p=i,new Ie(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},tr.prototype.mkError=function(t,e){return new ct(t,new $t(this.input,e,this.N,this.file))},tr.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},tr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},tr.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&j;)++this.p;return new $t(this.input,t,this.p,this.file)},tr.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},tr.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new Ee(this.input,e,this.p,r,t,this.file)},tr.prototype.remaining=function(){return this.input.slice(this.p)},tr.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},tr.prototype.end=function(){return this.p>=this.N},tr.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},tr.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new ke(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new $t(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&ce.hasOwnProperty(e.content)?new le(this.input,e.begin,e.end,this.file):r?new Wt(e,n[0]):new ke(e,n,this.p)}},tr.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new Ke(this.input,t,this.p,e,r,this.file)}},tr.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return qe(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},tr.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new De(this.input,t,this.p,this.file)}},tr.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&B)&&","!==this.peek()&&this.p<this.N;)this.p++;return new $t(this.input,t,this.p,this.file)},tr.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},tr.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},tr.prototype.peekType=function(t){return void 0===t&&(t=0),V[this.input.charCodeAt(this.p+t)]},tr.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},tr.prototype.skipBlank=function(){for(;this.peekType()&B;)++this.p},tr);function tr(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var er=(rr.prototype.write=function(t){this.html+=l(t)},rr.prototype.end=function(){return this.html},rr);function rr(){this.html=""}var nr=(ir.prototype.write=function(t){this.stream.write(l(t))},ir.prototype.end=function(){this.stream.end()},ir);function ir(){this.html="",this.stream=new(require("stream").PassThrough)}function sr(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function or(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function ar(n){return function(t){return t&&c(t.then)}(n)?n:function(t){return t&&c(t.next)&&c(t.throw)&&c(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return or(t)}if(e.done)return sr(e.value);return ar(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return or(t)}return e.done?sr(e.value):r(e.value)})}():sr(n)}function ur(t){return Promise.resolve(ar(t))}function cr(t){var e;return ar(t).then(function(t){return sr(e=t)}).catch(function(t){throw t}),e}var lr=(hr.prototype.write=function(t){"string"!=typeof(t=f(t))&&""===this.html?this.html=t:this.html=l(this.html)+l(t)},hr.prototype.end=function(){return this.html},hr);function hr(){this.html=""}var pr=(fr.prototype.renderTemplatesToNodeStream=function(t,e){var r=new nr;return ar(this.renderTemplates(t,e,r)),r.stream},fr.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=n||(r.opts.keepOutputType?new lr:new er),t.label=1;case 1:t.trys.push([1,8,9,10]),i=k(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),vt.is(u)?u:new vt(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.end()]}})},fr);function fr(){}var dr=(vr.prototype.on=function(t,e){return this.handlers[t]=e,this},vr.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r(e),!0)},vr.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||Mt(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},vr.prototype.stop=function(){return this.stopRequested=!0,this},vr);function vr(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function gr(t){this.token=t}var mr=(yr.prototype.render=function(e){var r,n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,8,9,10]),n=k(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,Ge(this.hash[s],e)];case 4:u=t.sent(),t.label=5;case 5:o[a]=u,t.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},yr);function yr(t){var e,r;this.hash={};var n=new Ze(t,{});try{for(var i=k(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var wr=(br.prototype.render=function(t,e){var r,n,i=[];try{for(var s=k(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;v(a)?i.push([a[0],Ge(a[1],e)]):i.push(Ge(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},w([t],i))},br);function br(t,e,r,n){this.name=t,this.impl=e||S,this.args=r,this.liquid=n}var Tr=(kr.prototype.value=function(e,r){var n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=k(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},kr);function kr(t,n){this.filters=[];var e=new Ze(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new wr(e,n.filters.get(e),r,n)})}var xr,qr=(t(Or,xr=gr),Or.prototype.render=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,new mr(this.token.args).render(e)];case 1:return n=t.sent(),c((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},Or);function Or(t,e,r){var n=xr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var Sr,Fr=(t(Rr,Sr=gr),Rr.prototype.render=function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},Rr);function Rr(t,e){var r=Sr.call(this,t)||this;return r.value=new Tr(t.content,e),r}var Er,Lr=(t(Pr,Er=gr),Pr.prototype.render=function(t,e){return T(this,function(t){return e.write(this.str),[2]})},Pr);function Pr(t){var e=Er.call(this,t)||this;return e.str=t.getContent(),e}var Dr=(Mr.prototype.parse=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},Mr.prototype.parseToken=function(e,t){try{return Mt(e)?new qr(e,t,this.liquid):Dt(e)?new Fr(e,this.liquid):new Lr(e)}catch(t){throw new pt(t,e)}},Mr.prototype.parseStream=function(t){var r=this;return new dr(t,function(t,e){return r.parseToken(t,e)})},Mr);function Mr(t){this.liquid=t}var Nr={parse:function(t){var e=new Ze(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),qe("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return T(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function Ir(e){return v(e)?e:u(e)&&0<e.length?[e]:b(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function Ar(t){return v(t)?t:[t]}var Vr,jr=(t(Br,Vr=o),Br.prototype.next=function(){this.i++},Br.prototype.index0=function(){return this.i},Br.prototype.index=function(){return this.i+1},Br.prototype.first=function(){return 0===this.i},Br.prototype.last=function(){return this.i===this.length-1},Br.prototype.rindex=function(){return this.length-this.i},Br.prototype.rindex0=function(){return this.length-this.i-1},Br.prototype.valueOf=function(){return JSON.stringify(this)},Br);function Br(t){var e=Vr.call(this)||this;return e.i=0,e.length=t,e}var Cr=["offset","limit","reversed"],_r={type:"block",parse:function(t,e){var r,n=this,i=new Ze(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();qe(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new mr(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=Ir,[4,Ge(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(t){return Cr.includes(t)}):Cr.filter(function(t){return void 0!==o[t]}),i=a.reduce(function(t,e){return"offset"===e?function(t,e){return t.slice(e)}(t,o.offset):"limit"===e?function(t,e){return t.slice(0,e)}(t,o.limit):function(t){return w(t).reverse()}(t)},i),u={forloop:new jr(i.length)},e.push(u),t.label=5;case 5:t.trys.push([5,10,11,12]),c=k(i),l=c.next(),t.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),t.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=t.sent(),f={error:p},[3,12];case 11:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 12:return e.pop(),[2]}})}};var zr={parse:function(t,e){var r=this,n=new Ze(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return Xe(r)}(n),qe(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return T(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Hr,Kr,Ur={parse:function(t,e){var n=this;this.cond=new Tr(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new Ze(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();r&&n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=k(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,Ge(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Qr={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Kr=Hr=Hr||{})[Kr.OUTPUT=0]="OUTPUT",Kr[Kr.STORE=1]="STORE";var Wr=Hr,Jr={parseFilePath:Yr,renderFilePath:$r,parse:function(t){var e=t.args,r=new Ze(e,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(r,this.liquid);!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new mr(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,m,y,w,b;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,[4,this.renderFilePath(this.file,e,i)];case 1:return qe(o=t.sent(),function(){return'illegal filename "'+o+'"'}),a=new Ft({},e.opts,e.sync),[4,s.render(e)];case 2:if(u=t.sent(),this.with&&(c=this.with,h=c.value,p=c.alias,u[p||o]=Ge(h,e)),a.push(u),!this.for)return[3,12];l=this.for,h=l.value,p=l.alias,f=Ir(f=Ge(h,e)),u.forloop=new jr(f.length),t.label=3;case 3:t.trys.push([3,9,10,11]),d=k(f),v=d.next(),t.label=4;case 4:return v.done?[3,8]:(g=v.value,u[p]=g,[4,i.parseFileImpl(o,a.sync)]);case 5:return y=t.sent(),[4,i.renderer.renderTemplates(y,a,r)];case 6:t.sent(),u.forloop.next(),t.label=7;case 7:return v=d.next(),[3,4];case 8:return[3,11];case 9:return m=t.sent(),w={error:m},[3,11];case 10:try{v&&!v.done&&(b=d.return)&&b.call(d)}finally{if(w)throw w.error}return[7];case 11:return[3,15];case 12:return[4,i.parseFileImpl(o,a.sync)];case 13:return y=t.sent(),[4,i.renderer.renderTemplates(y,a,r)];case 14:t.sent(),t.label=15;case 15:return[2]}})}};function Yr(t,e){if(e.options.dynamicPartials){var r=t.readValue();if(void 0===r)throw new TypeError('illegal argument "'+t.input+'"');if("none"===r.getText())return null;if(Nt(r)){var n=e.parse(Xe(r));if(1===n.length){var i=n[0];if(Pt(i))return i.getText()}return n}return r}var s=t.readFileName().getText();return"none"===s?null:s}function $r(t,e,r){return"string"==typeof t?t:Array.isArray(t)?r.renderer.renderTemplates(t,e):Ge(t,e)}var Gr,Xr={parseFilePath:Yr,renderFilePath:$r,parse:function(t){var e=t.args,r=new Ze(e,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid);var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new mr(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=i.renderer,[4,this.renderFilePath(this.file,e,i)];case 1:return qe(u=t.sent(),function(){return'illegal filename "'+u+'"'}),c=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",Wr.OUTPUT),[4,s.render(e)];case 2:return l=t.sent(),o&&(l[u]=Ge(o,e)),[4,i.parseFileImpl(u,e.sync)];case 3:return h=t.sent(),e.push(l),[4,a.renderTemplates(h,e,r)];case 4:return t.sent(),e.pop(),e.restoreRegister(c),[2]}})}},Zr={parse:function(t){var e=new Ze(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0),e.write(l(--r[this.variable]))}},tn={parse:function(t){var e=new Ze(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}qe(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+Ge(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=Ge(s,t);e.write(o)}},en={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({cond:new Tr(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){n.branches.push({cond:new Tr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){return i.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n,i,s,o,a,u,c;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:[4,(o=s.value).cond.value(e,e.opts.lenientIf)];case 3:return N(t.sent(),e)?[4,n.renderTemplates(o.templates,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return a=t.sent(),u={error:a},[3,9];case 8:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(u)throw u.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},rn={parse:function(t){var e=new Ze(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(l(n))}},nn={parseFilePath:Yr,renderFilePath:$r,parse:function(t,e){var r=new Ze(t.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.hash=new mr(r.remaining()),this.tpls=this.liquid.parser.parse(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,null!==o?[3,2]:(e.setRegister("blockMode",Wr.OUTPUT),[4,a.renderTemplates(this.tpls,e)]);case 1:return u=t.sent(),r.write(u),[2];case 2:return[4,this.renderFilePath(this.file,e,i)];case 3:return qe(c=t.sent(),function(){return'illegal filename "'+c+'"'}),[4,i.parseFileImpl(c,e.sync)];case 4:return l=t.sent(),e.setRegister("blockMode",Wr.STORE),[4,a.renderTemplates(this.tpls,e)];case 5:return h=t.sent(),void 0===(p=e.getRegister("blocks"))[""]&&(p[""]=function(){return h}),e.setRegister("blockMode",Wr.OUTPUT),d=(f=e).push,[4,s.render(e)];case 6:return d.apply(f,[t.sent()]),[4,a.renderTemplates(l,e)];case 7:return v=t.sent(),e.pop(),r.write(v),[2]}})}},sn=(t(on,Gr=o),on.prototype.super=function(){return this.superBlockRender()},on);function on(t){void 0===t&&(t=function(){return""});var e=Gr.call(this)||this;return e.superBlockRender=t,e}var an,un={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[];var i=this.liquid.parser.parseStream(e).on("tag:endblock",function(){return i.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),[4,this.emitHTML(e,r,n)];case 1:return t.sent(),[2]}})},getBlockRender:function(n){function e(e){var r;return T(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n)];case 1:return r=t.sent(),n.pop(),[2,r]}})}var i=this.liquid,s=this.tpls,r=n.getRegister("blocks")[this.block];return r?function(t){return r(new sn(function(){return e(t)}))}:e},emitHTML:function(e,r,n){var i,s;return T(this,function(t){switch(t.label){case 0:return e.getRegister("blockMode",Wr.OUTPUT)!==Wr.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return s=(i=r).write,[4,n(new sn)];case 2:s.apply(i,[t.sent()]),t.label=3;case 3:return[2]}})}},cn={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},ln=(t(hn,an=jr),hn.prototype.row=function(){return Math.floor(this.i/this.cols)+1},hn.prototype.col0=function(){return this.i%this.cols},hn.prototype.col=function(){return this.col0()+1},hn.prototype.col_first=function(){return 0===this.col0()},hn.prototype.col_last=function(){return this.col()===this.cols},hn);function hn(t,e){var r=an.call(this,t)||this;return r.length=t,r.cols=e,r}var pn={assign:Nr,for:_r,capture:zr,case:Ur,comment:Qr,include:Xr,render:Jr,decrement:Zr,increment:rn,cycle:tn,if:en,layout:nn,block:un,raw:cn,tablerow:{parse:function(t,e){var r=this,n=new Ze(t.args,this.liquid.options.operatorsTrie);this.variable=n.readIdentifier(),n.skipBlank();var i,s=n.readIdentifier();qe(s&&"in"===s.content,function(){return"illegal tag: "+t.getText()}),this.collection=n.readValue(),this.hash=new mr(n.remaining()),this.templates=[];var o=this.liquid.parser.parseStream(e).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(){return o.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});o.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:return i=Ir,[4,Ge(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new ln(n.length,u),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable.content]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.templates=[],this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(e).on("start",function(){r=n.templates,n.cond=new Tr(t.args,n.liquid)}).on("tag:elsif",function(t){n.branches.push({cond:new Tr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){return i.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});i.start()},render:function(e,r){var n,i,s,o,a,u,c;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,[4,this.cond.value(e,e.opts.lenientIf)];case 1:return I(t.sent(),e)?[4,n.renderTemplates(this.templates,e,r)]:[3,3];case 2:return t.sent(),[2];case 3:t.trys.push([3,9,10,11]),i=k(this.branches),s=i.next(),t.label=4;case 4:return s.done?[3,8]:[4,(o=s.value).cond.value(e,e.opts.lenientIf)];case 5:return N(t.sent(),e)?[4,n.renderTemplates(o.templates,e,r)]:[3,7];case 6:return t.sent(),[2];case 7:return s=i.next(),[3,4];case 8:return[3,11];case 9:return a=t.sent(),u={error:a},[3,11];case 10:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(u)throw u.error}return[7];case 11:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 12:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},fn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},dn={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function vn(t){return l(t).replace(/&|<|>|"|'/g,function(t){return fn[t]})}var gn=Math.abs,mn=Math.max,yn=Math.min,wn=Math.ceil,bn=Math.floor;var Tn=Object.freeze({escape:vn,escapeOnce:function(t){return vn(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return dn[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:gn,atLeast:mn,atMost:yn,ceil:wn,dividedBy:function(t,e){return t/e},floor:bn,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?w(t).sort(function(t,e){return R(t[r],e[r])}):w(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return v(t)?m(t):""},first:function(t){return v(t)?t[0]:""},reverse:function(t){return w(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return Ar(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return Ar(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return Ar(t).filter(function(t){return!d(t)})},concat:function(t,e){return Ar(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return Ar(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?N(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r;return function(t){return t instanceof Date&&!isNaN(t.getTime())}(r="now"===t||"today"===t?new Date:h(t)?new Date(1e3*t):u(t)?/^\d+$/.test(t)?new Date(1e3*+t):this.context.opts.preserveTimezones?function(t){var e=t.match(H);if(e&&"Z"===e[1])return new Date(+new Date(t)+6e4*z);if(e&&e[2]&&e[3]&&e[4]){var r=y(e,5),n=r[2],i=r[3],s=r[4],o=("+"===n?1:-1)*(60*parseInt(i,10)+parseInt(s,10));return new Date(+new Date(t)+6e4*(z+o))}return new Date(t)}(t):new Date(t):t)?function(t,e){for(var r,n="",i=e;r=K.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=rt(t,r);return n+i}(r,e):t},Default:function(t,e){return v(t)||u(t)?t.length?t:e:I(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return qe(2===arguments.length,function(){return"append expect 2 arguments"}),l(t)+l(e)},prepend:function(t,e){return qe(2===arguments.length,function(){return"prepend expect 2 arguments"}),l(e)+l(t)},lstrip:function(t){return l(t).replace(/^\s+/,"")},downcase:function(t){return l(t).toLowerCase()},upcase:function(t){return l(t).toUpperCase()},remove:function(t,e){return l(t).split(String(e)).join("")},removeFirst:function(t,e){return l(t).replace(String(e),"")},rstrip:function(t){return l(t).replace(/\s+$/,"")},split:function(t,e){return l(t).split(String(e))},strip:function(t){return l(t).trim()},stripNewlines:function(t){return l(t).replace(/\n/g,"")},capitalize:function(t){return(t=l(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return l(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return l(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=l(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),kn=(xn.prototype.get=function(t){var e=this.impls[t];return qe(e,function(){return'tag "'+t+'" not found'}),e},xn.prototype.set=function(t,e){this.impls[t]=e},xn);function xn(){this.impls={}}var qn=(On.prototype.get=function(t){var e=this.impls[t];return qe(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},On.prototype.set=function(t,e){this.impls[t]=e},On.prototype.create=function(t,e){return new wr(t,this.get(t),e,this.liquid)},On);function On(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var Sn=(Fn.prototype.parse=function(t,e){var r=new Ze(t,this.options.operatorsTrie,e).readTopLevelTokens(this.options);return this.parser.parse(r)},Fn.prototype._render=function(t,e,r){var n=new Ft(e,this.options,r);return this.renderer.renderTemplates(t,n)},Fn.prototype.render=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,ur(this._render(e,r,!1))]})})},Fn.prototype.renderSync=function(t,e){return cr(this._render(t,e,!0))},Fn.prototype.renderToNodeStream=function(t,e){var r=new Ft(e,this.options);return this.renderer.renderTemplatesToNodeStream(t,r)},Fn.prototype._parseAndRender=function(t,e,r){var n=this.parse(t);return this._render(n,e,r)},Fn.prototype.parseAndRender=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,ur(this._parseAndRender(e,r,!1))]})})},Fn.prototype.parseAndRenderSync=function(t,e){return cr(this._parseAndRender(t,e,!0))},Fn.prototype._parseFileCached=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,(n=this.options.cache).read(e)];case 1:return(i=t.sent())?[2,i]:[4,this._parseFile(e,r)];case 2:return i=t.sent(),n.write(e,i),[2,i]}})},Fn.prototype._parseFile=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:n=this.options,i=n.fs,s=n.root,t.label=1;case 1:t.trys.push([1,11,12,13]),o=k(this.lookupFiles(e,this.options)),a=o.next(),t.label=2;case 2:return a.done?[3,10]:(u=a.value,r?(c=i.existsSync(u),[3,5]):[3,3]);case 3:return[4,i.exists(u)];case 4:c=t.sent(),t.label=5;case 5:return c?(l=this.parse,r?(h=i.readFileSync(u),[3,8]):[3,6]):[3,9];case 6:return[4,i.readFile(u)];case 7:h=t.sent(),t.label=8;case 8:return[2,l.apply(this,[h,u])];case 9:return a=o.next(),[3,2];case 10:return[3,13];case 11:return p=t.sent(),f={error:p},[3,13];case 12:try{a&&!a.done&&(d=o.return)&&d.call(o)}finally{if(f)throw f.error}return[7];case 13:throw this.lookupError(e,s)}})},Fn.prototype.parseFile=function(e){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,ur(this.parseFileImpl(e,!1))]})})},Fn.prototype.parseFileSync=function(t){return cr(this.parseFileImpl(t,!0))},Fn.prototype.renderFile=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.render(e,n)]}})})},Fn.prototype.renderFileSync=function(t,e){var r=this.parseFileSync(t);return this.renderSync(r,e)},Fn.prototype._evalValue=function(t,e){return new Tr(t,this).value(e,!1)},Fn.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,ur(this._evalValue(e,r))]})})},Fn.prototype.evalValueSync=function(t,e){return cr(this._evalValue(t,e))},Fn.prototype.registerFilter=function(t,e){this.filters.set(t,e)},Fn.prototype.registerTag=function(t,e){this.tags.set(t,e)},Fn.prototype.plugin=function(t){return t.call(this,Fn)},Fn.prototype.express=function(){var i=this,s=!0;return function(t,e,r){var n;s&&(s=!1,(n=i.options.root).unshift.apply(n,w(it(this.root)))),i.renderFile(t,e).then(function(t){return r(null,t)},r)}},Fn.prototype.lookupFiles=function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:n=r.root,i=r.fs,s=r.extname,t.label=1;case 1:t.trys.push([1,6,7,8]),o=k(n),a=o.next(),t.label=2;case 2:return a.done?[3,5]:(u=a.value,[4,i.resolve(u,e,s)]);case 3:t.sent(),t.label=4;case 4:return a=o.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),h={error:c},[3,8];case 7:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 8:return void 0===i.fallback?[3,10]:void 0===(l=i.fallback(e))?[3,10]:[4,l];case 9:t.sent(),t.label=10;case 10:return[2]}})},Fn.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},Fn);function Fn(t){var r=this;void 0===t&&(t={}),this.options=function(t){return i({},nt,t)}(function(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=it(t.root)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new L(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new L(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=_(t.operators)),t}(t)),this.parser=new Dr(this),this.renderer=new pr,this.filters=new qn(this.options.strictFilters,this),this.tags=new kn,this.parseFileImpl=this.options.cache?this._parseFileCached:this._parseFile,g(pn,function(t,e){return r.registerTag(F(e),t)}),g(Tn,function(t,e){return r.registerFilter(F(e),t)})}p.AssertionError=qt,p.Context=Ft,p.Drop=o,p.Expression=Ye,p.Hash=mr,p.InternalUndefinedVariableError=Tt,p.Liquid=Sn,p.LiquidError=ot,p.ParseError=pt,p.ParseStream=dr,p.RenderError=vt,p.TagToken=_e,p.Token=Kt,p.TokenizationError=ct,p.Tokenizer=Ze,p.TypeGuards=_t,p.UndefinedVariableError=yt,p.Value=Tr,p.assert=qe,p.createTrie=_,p.defaultOperators=A,p.evalQuotedToken=Xe,p.evalToken=Ge,p.isFalsy=I,p.isTruthy=N,p.toPromise=ur,p.toThenable=ar,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})});
//# sourceMappingURL=liquid.browser.min.js.map

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { Context } from './context/context';

@@ -18,15 +19,18 @@ import { Template } from './template/template';

tags: TagMap;
parseFileImpl: (file: string, sync?: boolean) => Iterator<Template[]>;
constructor(opts?: LiquidOptions);
parse(html: string, filepath?: string): Template[];
_render(tpl: Template[], scope?: object, opts?: LiquidOptions, sync?: boolean): IterableIterator<any>;
render(tpl: Template[], scope?: object, opts?: LiquidOptions): Promise<any>;
renderSync(tpl: Template[], scope?: object, opts?: LiquidOptions): any;
_parseAndRender(html: string, scope?: object, opts?: LiquidOptions, sync?: boolean): IterableIterator<any>;
parseAndRender(html: string, scope?: object, opts?: LiquidOptions): Promise<any>;
parseAndRenderSync(html: string, scope?: object, opts?: LiquidOptions): any;
_parseFile(file: string, opts?: LiquidOptions, sync?: boolean): IterableIterator<any>;
parseFile(file: string, opts?: LiquidOptions): Promise<Template[]>;
parseFileSync(file: string, opts?: LiquidOptions): Template[];
renderFile(file: string, ctx?: object, opts?: LiquidOptions): Promise<any>;
renderFileSync(file: string, ctx?: object, opts?: LiquidOptions): any;
_render(tpl: Template[], scope?: object, sync?: boolean): IterableIterator<any>;
render(tpl: Template[], scope?: object): Promise<any>;
renderSync(tpl: Template[], scope?: object): any;
renderToNodeStream(tpl: Template[], scope?: object): NodeJS.ReadableStream;
_parseAndRender(html: string, scope?: object, sync?: boolean): IterableIterator<any>;
parseAndRender(html: string, scope?: object): Promise<any>;
parseAndRenderSync(html: string, scope?: object): any;
private _parseFileCached;
private _parseFile;
parseFile(file: string): Promise<Template[]>;
parseFileSync(file: string): Template[];
renderFile(file: string, ctx?: object): Promise<any>;
renderFileSync(file: string, ctx?: object): any;
_evalValue(str: string, ctx: Context): IterableIterator<any>;

@@ -39,11 +43,4 @@ evalValue(str: string, ctx: Context): Promise<any>;

express(): (this: any, filePath: string, ctx: object, callback: (err: Error | null, rendered: string) => void) => void;
private lookupFiles;
private lookupError;
/**
* @deprecated use parseFile instead
*/
getTemplate(file: string, opts?: LiquidOptions): Promise<Template[]>;
/**
* @deprecated use parseFileSync instead
*/
getTemplateSync(file: string, opts?: LiquidOptions): Template[];
}

@@ -19,3 +19,3 @@ import { IdentifierToken } from '../tokens/identifier-token';

export declare class Tokenizer {
private input;
input: string;
private trie;

@@ -22,0 +22,0 @@ private file;

@@ -1,8 +0,15 @@

export declare class Emitter {
html: any;
break: boolean;
continue: boolean;
private keepOutputType?;
constructor(keepOutputType: boolean | undefined);
export interface Emitter {
/**
* Write a html value into emitter
* @param html string, Drop or other primitive value
*/
write(html: any): void;
/**
* Notify the emitter render has ended
*/
end(): void;
/**
* Collect rendered string value immediately
*/
collect(): string;
}

@@ -0,6 +1,8 @@

/// <reference types="node" />
import { Context } from '../context/context';
import { Template } from '../template/template';
import { Emitter } from './emitter';
import { Emitter } from '../emitters/emitter';
export declare class Render {
renderTemplatesToNodeStream(templates: Template[], ctx: Context): NodeJS.ReadableStream;
renderTemplates(templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator<any>;
}

@@ -5,3 +5,3 @@ import { TemplateImpl } from '../template/template-impl';

import { Context } from '../context/context';
import { Emitter } from '../render/emitter';
import { Emitter } from '../emitters/emitter';
export declare class HTML extends TemplateImpl<HTMLToken> implements Template {

@@ -8,0 +8,0 @@ private str;

import { TemplateImpl } from '../template/template-impl';
import { Template } from '../template/template';
import { Context } from '../context/context';
import { Emitter } from '../render/emitter';
import { Emitter } from '../emitters/emitter';
import { OutputToken } from '../tokens/output-token';

@@ -6,0 +6,0 @@ import { Liquid } from '../liquid';

@@ -6,3 +6,3 @@ import { Context } from '../../context/context';

import { Hash } from '../../template/tag/hash';
import { Emitter } from '../../render/emitter';
import { Emitter } from '../../emitters/emitter';
export interface TagImplOptions {

@@ -9,0 +9,0 @@ parse?: (this: TagImpl, token: TagToken, remainingTokens: TopLevelToken[]) => void;

import { Context } from '../context/context';
import { Token } from '../tokens/token';
import { Emitter } from '../render/emitter';
import { Emitter } from '../emitters/emitter';
export interface Template {

@@ -5,0 +5,0 @@ token: Token;

@@ -7,4 +7,4 @@ import { Token } from './token';

props: (IdentifierToken | QuotedToken | PropertyAccessToken)[];
propertyName: string;
constructor(variable: IdentifierToken | QuotedToken, props: (IdentifierToken | QuotedToken | PropertyAccessToken)[], end: number);
getVariableAsText(): string;
}

@@ -6,3 +6,3 @@ import * as TypeGuards from './util/type-guards';

export { Drop } from './drop/drop';
export { Emitter } from './render/emitter';
export { Emitter } from './emitters/emitter';
export { Expression } from './render/expression';

@@ -9,0 +9,0 @@ export { isFalsy, isTruthy } from './render/boolean';

@@ -1,8 +0,16 @@

export default function (inputDate: Date, formatStr: string): string;
export declare class TimezoneDate extends Date {
dateString: string;
ISO8601_TIMEZONE_PATTERN: RegExp;
inputTimezoneOffset: number;
constructor(dateString: string);
getDisplayDate(): Date;
}
export declare const timezoneOffset: number;
export default function (d: Date, formatStr: string): string;
/**
* Create a Date object fixed to it's declared Timezone. Both
* - 2021-08-06T02:29:00.000Z and
* - 2021-08-06T02:29:00.000+08:00
* will always be displayed as
* - 2021-08-06 02:29:00
* regardless timezoneOffset in JavaScript realm
*
* The implementation hack:
* Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,
* we create a different Date to trick strftime, it's both simpler and more performant.
* Given that a template is expected to be parsed fewer times than rendered.
*/
export declare function createDateFixedToTimezone(dateString: string): Date;
{
"name": "liquidjs",
"version": "9.25.1",
"description": "A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.",
"version": "9.26.0",
"description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.",
"main": "dist/liquid.node.cjs.js",

@@ -16,9 +16,4 @@ "module": "dist/liquid.node.esm.js",

"check": "npm test && npm run lint",
"unit": "mocha \"test/unit/**/*.ts\"",
"integration": "mocha \"test/integration/**/*.ts\"",
"e2e": "mocha \"test/e2e/**/*.ts\"",
"test": "nyc mocha \"test/**/*.ts\"",
"benchmark:prepare": "cd benchmark && npm ci",
"benchmark": "cd benchmark && npm start",
"benchmark:engines": "cd benchmark && npm run engines",
"benchmark": "cd benchmark && npm ci && npm start",
"build": "npm run build:dist && npm run build:docs",

@@ -81,3 +76,3 @@ "build:dist": "rm -rf dist && rollup -c rollup.config.ts && ls -lh dist",

"@typescript-eslint/parser": "^2.0.0",
"all-contributors-cli": "^6.8.1",
"all-contributors-cli": "^6.20.0",
"benchmark": "^2.1.4",

@@ -84,0 +79,0 @@ "chai": "^4.2.0",

@@ -15,3 +15,3 @@ # liquidjs

A simple, expressive, safe and [Shopify][shopify/liquid] compatible template engine in pure JavaScript.
A simple, expressive and safe [Shopify][shopify/liquid] / Github Pages compatible template engine in pure JavaScript.
**The purpose of this repo** is to provide a standard Liquid implementation for the JavaScript community so that [Jekyll sites](https://jekyllrb.com), [Github Pages](https://pages.github.com/) and [Shopify templates](https://themes.shopify.com/) can be ported to Node.js without pain.

@@ -112,2 +112,5 @@

<td align="center"><a href="https://memmie.lenglet.name"><img src="https://avatars.githubusercontent.com/u/729275?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Memmie Lenglet</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mems" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/ilhamdev0"><img src="https://avatars.githubusercontent.com/u/57636145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ilhamdev0</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ilhamdev0" title="Documentation">๐Ÿ“–</a></td>
<td align="center"><a href="https://github.com/c412216887"><img src="https://avatars.githubusercontent.com/u/29691650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ไธ€้ฅฎไธ€ๅ•„็š†ๆ˜ฏไบบ็”Ÿ</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=c412216887" title="Documentation">๐Ÿ“–</a></td>
<td align="center"><a href="https://digitalinspiration.com/"><img src="https://avatars.githubusercontent.com/u/1344071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amit Agarwal</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=labnol" title="Documentation">๐Ÿ“–</a></td>
</tr>

@@ -114,0 +117,0 @@ </table>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc