!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).liquidjs={})}(this,function(l){"use strict";var M=function(e,t){return(M=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return(T=Object.assign||function(e){for(var t,r=1,n=arguments.length;ra[0]&&t[1]=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||0> ":" ",r=J(String(e),String(o).length),t="".concat(t).concat(r,"| "),r=e===n?"\n"+J("^",i+t.length):"";return t+s[e-1]+r}).join("\n")),enumerable:!1}),this.message=(e=this.message,(t=this.token).file&&(e+=", file:".concat(t.file)),t=d(t.getPosition(),2),r=t[0],t=t[1],e+=", line:".concat(r,", col:").concat(t)),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)},ie.is=function(e){return"LiquidError"===(null==e?void 0:e[re])},ie);function ie(e,t){var r=te.call(this,"string"==typeof e?e:e.message)||this;return r.context="","string"!=typeof e&&Object.defineProperty(r,"originalError",{value:e,enumerable:!1}),Object.defineProperty(r,"token",{value:t,enumerable:!1}),Object.defineProperty(r,re,{value:"LiquidError",enumerable:!1}),r}s(ae,se=ne);var se,oe=ae;function ae(e,t){e=se.call(this,e,t)||this;return e.name="TokenizationError",se.prototype.update.call(e),e}s(le,ue=ne);var ue,ce=le;function le(e,t){t=ue.call(this,e,t)||this;return t.name="ParseError",t.message=e.message,ue.prototype.update.call(t),t}s(fe,he=ne),fe.is=function(e){return"RenderError"===e.name};var he,pe=fe;function fe(e,t){t=he.call(this,e,t.token)||this;return t.name="RenderError",t.message=e.message,he.prototype.update.call(t),t}s(ge,de=ne);var de,ve=ge;function ge(e,t){t=de.call(this,e,t)||this;return t.name="UndefinedVariableError",t.message=e.message,de.prototype.update.call(t),t}s(be,ye=Error);var ye,me=be;function be(e){var t=ye.call(this,"undefined variable: ".concat(e))||this;return t.name="InternalUndefinedVariableError",t.variableName=e,t}s(Te,we=Error);var we,ke=Te;function Te(e){var t=we.call(this,e)||this;return t.name="AssertionError",t.message=e+"",t}var h=[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],xe=1,Oe=4,ze=16;function _e(e){e=e.charCodeAt(0);return 128<=e?!h[e]:h[e]&xe}function z(e,t){if(!e)throw t="function"==typeof t?t():t||"expect ".concat(e," to be true"),new ke(t)}h[160]=h[5760]=h[6158]=h[8192]=h[8193]=h[8194]=h[8195]=h[8196]=h[8197]=h[8198]=h[8199]=h[8200]=h[8201]=h[8202]=h[8232]=h[8233]=h[8239]=h[8287]=h[12288]=Oe,h[8220]=h[8221]=128;s(Re,Se=V),Re.prototype.equals=function(e){return c(m(e))},Re.prototype.gt=function(){return!1},Re.prototype.geq=function(){return!1},Re.prototype.lt=function(){return!1},Re.prototype.leq=function(){return!1},Re.prototype.valueOf=function(){return null};var Se,r=Re;function Re(){return null!==Se&&Se.apply(this,arguments)||this}s(n,Fe=V),n.prototype.equals=function(e){return!(e instanceof n||(o(e=m(e))||b(e)?0!==e.length:!W(e)||0!==Object.keys(e).length))},n.prototype.gt=function(){return!1},n.prototype.geq=function(){return!1},n.prototype.lt=function(){return!1},n.prototype.leq=function(){return!1},n.prototype.valueOf=function(){return""};var Fe,qe=n;function n(){return null!==Fe&&Fe.apply(this,arguments)||this}s(Le,Ee=qe),Le.prototype.equals=function(e){return!1===e||!!c(m(e))||(o(e)?/^\s*$/.test(e):Ee.prototype.equals.call(this,e))};var Ee,i=Le;function Le(){return null!==Ee&&Ee.apply(this,arguments)||this}s(p,De=V),p.prototype.next=function(){this.i++},p.prototype.index0=function(){return this.i},p.prototype.index=function(){return this.i+1},p.prototype.first=function(){return 0===this.i},p.prototype.last=function(){return this.i===this.length-1},p.prototype.rindex=function(){return this.length-this.i},p.prototype.rindex0=function(){return this.length-this.i-1},p.prototype.valueOf=function(){return JSON.stringify(this)};var De,Ne=p;function p(e,t,r){var n=De.call(this)||this;return n.i=0,n.length=e,n.name="".concat(r,"-").concat(t),n}s(je,Pe=V),je.prototype.super=function(){return this.superBlockRender()};var Pe,Me=je;function je(e){void 0===e&&(e=function(){return""});var t=Pe.call(this)||this;return t.superBlockRender=e,t}function f(e){return e&&u(e.equals)}var r=new r,Ve={true:!0,false:!1,nil:r,null:r,empty:new qe,blank:new i};function Ie(e){var t,r,n={};try{for(var i=O(Object.entries(e)),s=i.next();!s.done;s=i.next()){for(var o=d(s.value,2),a=o[0],u=o[1],c=n,l=0;l":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Ot={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},zt=(s(_t,Tt=e),_t.prototype.getPrecedence=function(){var e=this.getText();return e in xt?xt[e]:1},_t);function _t(e,t,r,n){var i=Tt.call(this,l.TokenKind.Operator,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.operator=i.getText(),i}s(Ft,St=e);var St,Rt=Ft;function Ft(e,t,r,n,i,s){r=St.call(this,l.TokenKind.PropertyAccess,r,n,i,s)||this;return r.variable=e,r.props=t,r}s(Lt,qt=e);var qt,Et=Lt;function Lt(e,t,r,n,i,s){r=qt.call(this,l.TokenKind.Filter,r,n,i,s)||this;return r.name=e,r.args=t,r}s(Pt,Dt=e);var Dt,Nt=Pt;function Pt(e,t,r,n,i,s){var o=Dt.call(this,l.TokenKind.Hash,e,t,r,s)||this;return o.input=e,o.begin=t,o.end=r,o.name=n,o.value=i,o.file=s,o}var Mt=/[\da-fA-F]/,jt=/[0-7]/,Vt={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function It(e){e=e.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}s(Ct,At=e);var At,Bt=Ct;function Ct(e,t,r,n){var i=At.call(this,l.TokenKind.Quoted,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.content=function(e){for(var t="",r=1;rs.getPrecedence()?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=e.sent(),o={error:o},[3,12];case 11:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return e.sent(),[3,12];case 14:return[2]}})}(e)),!1)}function S(t,r,n){return void 0===n&&(n=!1),x(this,function(e){switch(e.label){case 0:return t?"content"in t?[2,t.content]:Zr(t)?[4,function(t,r,n){var i,s,o,a,u,c,l,h,p;return x(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),s=O(t.props),o=s.next(),e.label=2;case 2:return o.done?[3,5]:(c=o.value,u=(a=i).push,[4,S(c,r,!1)]);case 3:u.apply(a,[e.sent()]),e.label=4;case 4:return o=s.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),h={error:c},[3,8];case 7:try{o&&!o.done&&(p=s.return)&&p.call(s)}finally{if(h)throw h.error}return[7];case 8:return(e.trys.push([8,14,,15]),t.variable)?[4,S(t.variable,r,n)]:[3,11];case 9:return l=e.sent(),[4,r._getFromScope(l,i)];case 10:return[2,e.sent()];case 11:return[4,r._get(i)];case 12:return[2,e.sent()];case 13:return[3,15];case 14:if(l=e.sent(),n&&"InternalUndefinedVariableError"===l.name)return[2,null];throw new ve(l,t);case 15:return[2]}})}(t,r,n)]:[3,2]:[2];case 1:return[2,e.sent()];case 2:return Gr(t)?[4,function(t,r){var n,i;return x(this,function(e){switch(e.label){case 0:return[4,S(t.lhs,r)];case 1:return n=e.sent(),[4,S(t.rhs,r)];case 2:return i=e.sent(),[2,Y(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return[2]}})}function ar(e){return e.content}function ur(e,t){return!cr(e,t)}function cr(e,t){return t.opts.jsTruthy?!e:!1===e||null==e}qe={"==":lr,"!=":function(e,t){return!lr(e,t)},">":function(e,t){return f(e)?e.gt(t):f(t)?t.lt(e):m(e)>m(t)},"<":function(e,t){return f(e)?e.lt(t):f(t)?t.gt(e):m(e)=":function(e,t){return f(e)?e.geq(t):f(t)?t.leq(e):m(e)>=m(t)},"<=":function(e,t){return f(e)?e.leq(t):f(t)?t.geq(e):m(e)<=m(t)},contains:function(e,t){return b(e=m(e))?e.some(function(e){return lr(e,t)}):!!u(null==e?void 0:e.indexOf)&&-1this.limit&&this.remove(this.tail.prev.key)},fr);function fr(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new hr("HEAD",null,null,null),this.tail=new hr("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function dr(e,t){var r=document.createElement("base"),e=(r.href=e,document.getElementsByTagName("head")[0]),n=(e.insertBefore(r,e.firstChild),document.createElement("a")),t=(n.href=t,n.href);return e.removeChild(r),t}i=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==Q(e)&&(e+="/"),dr(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(e,t,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?e:t+r+i})},readFile:function(n){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,new Promise(function(e,t){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?e(r.responseText):t(new Error(r.statusText))},r.onerror=function(){t(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(e){var t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||300<=t.status)throw new Error(t.statusText);return t.responseText},exists:function(e){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return dr(e,".")},sep:"/"});function vr(e,t){return void 0===t&&(t=0),JSON.stringify(e,null,t)}var r={raw:!0,handler:G},gr={"&":"&","<":"<",">":">",'"':""","'":"'"},yr={"&":"&","<":"<",">":">",""":'"',"'":"'"};function mr(e){return g(e).replace(/&|<|>|"|'/g,function(e){return gr[e]})}var br=Object.freeze({__proto__:null,escape:mr,escape_once:function(e){return mr((e=g(e),g(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return yr[e]})))},newline_to_br:function(e){return g(e).replace(/\r?\n/gm,"
\n")},strip_html:function(e){return g(e).replace(/||<.*?>|/g,"")}}),wr={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,cache:void 0,extname:"",fs:i,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:qe};function kr(e){var t;return e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")&&(t=void 0,t="number"==typeof e.cache?0t?e.slice(0,t-3)+"...":e));var t},F.prototype.readWord=function(){return this.readIdentifier()},F.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;!this.end()&&_e(this.peek());)++this.p;return new yt(this.input,e,this.p,this.file)},F.prototype.readNonEmptyIdentifier=function(){var e=this.readIdentifier();return e.size()?e:void 0},F.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},F.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},F.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t,r=this.p,n=this.readNonEmptyIdentifier();if(n)return this.skipBlank(),e=e?"=":":",this.peek()===e&&(++this.p,t=this.readValue()),new Nt(this.input,r,this.p,n,t,this.file)},F.prototype.remaining=function(){return this.input.slice(this.p,this.N)},F.prototype.advance=function(e){this.p+=e=void 0===e?1:e},F.prototype.end=function(){return this.p>=this.N},F.prototype.readTo=function(e){for(;this.p=this.N?0:h[this.input.charCodeAt(this.p+e)]},F.prototype.peek=function(e){return this.p+(e=void 0===e?0:e)>=this.N?"":this.input[this.p+e]},F.prototype.skipBlank=function(){for(;this.peekType()&Oe;)++this.p};var R=F;function F(e,t,r,n){void 0===t&&(t=wr.operators),this.input=e,this.file=r,this.rawBeginAt=-1,this.p=n?n[0]:0,this.N=n?n[1]:e.length,this.opTrie=Ie(t),this.literalTrie=Ie(Ve)}zr.prototype.on=function(e,t){return this.handlers[e]=t,this},zr.prototype.trigger=function(e,t){e=this.handlers[e];return!!e&&(e.call(this,t),!0)},zr.prototype.start=function(){var e,t;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)this.trigger("token",e)||Yr(e)&&this.trigger("tag:".concat(e.name),e)||(t=this.parseToken(e,this.tokens),this.trigger("template",t));return this.stopRequested||this.trigger("end"),this},zr.prototype.stop=function(){return this.stopRequested=!0,this};var Or=zr;function zr(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function _r(e){this.token=e}s(Rr,Sr=_r);var Sr,q=Rr;function Rr(e,t,r){var n=Sr.call(this,e)||this;return n.name=e.name,n.liquid=r,n.tokenizer=e.tokenizer,n}qr.prototype.render=function(t){var r,n,i,s,o,a,u,c,l;return x(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=O(Object.keys(this.hash)),i=n.next(),e.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,S(this.hash[s],t)];case 4:u=e.sent(),e.label=5;case 5:o[a]=u,e.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=e.sent(),c={error:c},[3,10];case 9:try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(c)throw c.error}return[7];case 10:return[2,r]}})};var Fr=qr;function qr(e,t){this.hash={};var r,n,e=new R(e,{});try{for(var i=O(e.readHashes(t)),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}Lr.prototype.render=function(t,r){var n,i,s,o,a,u,c,l,h,p,f;return x(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=O(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:b(o=s.value)?(u=(a=n).push,c=[o[0]],[4,S(o[1],r)]):[3,4];case 3:return u.apply(a,[c.concat([e.sent()])]),[3,6];case 4:return h=(l=n).push,[4,S(o,r)];case 5:h.apply(l,[e.sent()]),e.label=6;case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return p=e.sent(),p={error:p},[3,10];case 9:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 10:return[4,this.handler.apply({context:r,liquid:this.liquid},v([t],d(n),!1))];case 11:return[2,e.sent()]}})};var Er=Lr;function Lr(e,t,r,n){this.name=e,this.handler=u(t)?t:u(null==t?void 0:t.handler)?t.handler:G,this.raw=!u(t)&&!(null==t||!t.raw),this.args=r,this.liquid=n}Dr.prototype.value=function(t,r){var n,i,s,o,a;return x(this,function(e){switch(e.label){case 0:return r=r||t.opts.lenientIf&&0=t&&(n+=r),n}}),pn=T(T(T(T(T(T(T({},br),en),tn),an),un),cn),{json:vr,raw:r,default:function(e,t){for(var r=[],n=2;n"),r.write(''))),r.write('')),[4,s.renderTemplates(this.templates,t,r)]):[3,6];case 4:e.sent(),r.write(""),e.label=5;case 5:return u++,o.next(),[3,3];case 6:return n.length&&r.write(""),t.pop(),[2]}})};var Jn,Zn=Gn;function Gn(e,t,r){var n,i=Jn.call(this,e,t,r)||this,r=i.tokenizer.readIdentifier(),s=(i.tokenizer.skipBlank(),i.tokenizer.readIdentifier()),o=i.tokenizer.readValue();if("in"!==s.content||!o)throw new Error("illegal tag: ".concat(e.getText()));i.variable=r.content,i.collection=o,i.args=new Fr(i.tokenizer.remaining()),i.templates=[];var a=i.liquid.parser.parseStream(t).on("start",function(){return n=i.templates}).on("tag:endtablerow",function(){return a.stop()}).on("template",function(e){return n.push(e)}).on("end",function(){throw new Error("tag ".concat(e.getText()," not closed"))});return a.start(),i}s(ti,Xn=q),ti.prototype.render=function(t,r){var n,i,s,o,a,u,c,l;return x(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,e.label=1;case 1:e.trys.push([1,7,8,9]),i=O(this.branches),s=i.next(),e.label=2;case 2:return s.done?[3,6]:(a=s.value,u=a.value,o=a.test,a=a.templates,[4,u.value(t,t.opts.lenientIf)]);case 3:return(u=e.sent(),o(u,t))?[4,n.renderTemplates(a,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=e.sent(),c={error:c},[3,9];case 8:try{s&&!s.done&&(l=i.return)&&l.call(i)}finally{if(c)throw c.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 10:return e.sent(),[2]}})};var Xn,ei=ti;function ti(e,t,r){var n=Xn.call(this,e,t,r)||this,i=(n.branches=[],n.elseTemplates=[],[]),s=0;return n.liquid.parser.parseStream(t).on("start",function(){return n.branches.push({value:new E(e.args,n.liquid),test:cr,templates:i=[]})}).on("tag:elsif",function(e){0