!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Liquid=e()}(this,function(){"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 e(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;rs[0]&&e[1]=|<|>|\s+contains\s+/];function G(){Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var V=function(){function t(t,e){this.input=e.input,this.file=e.file,this.originalError=t,this.token=e}return t.prototype.captureStackTrace=function(t){this.name=t.constructor.name,G.call(t);var e,i,o,r,s,n=this.originalError,u=(e=this.input,i=this.token.line,o=e.split("\n"),r=Math.max(i-2,1),s=Math.min(i+3,o.length),function(t,e,r){1===arguments.length&&(e=t,t=0),r=r||1;for(var n=[],i=t;i> ":" ",r=w(String(t),String(s).length),n=o[t-1];return""+e+r+"| "+n}).join("\n"));this.message=function(t,e){t=t||"",e.file&&(t+=", file:"+e.file);e.line&&(t+=", line:"+e.line+", col:"+e.col);return t}(n.message,this.token),this.stack=this.message+"\n"+u+"\n"+(this.stack||this.message)+(n.stack?"\nFrom "+n.stack:"")},t}(),W=function(n){function t(t,e){var r=n.call(this,{message:t},e)||this;return n.prototype.captureStackTrace.call(r,r),r}return e(t,n),t}(V);W.prototype=a(Error.prototype),W.prototype.constructor=W;var B=function(n){function t(t,e){var r=n.call(this,t,e)||this;return r.message=t.message,n.prototype.captureStackTrace.call(r,r),r}return e(t,n),t}(V);B.prototype=a(Error.prototype),B.prototype.constructor=B;var J=function(n){function t(t,e){var r=n.call(this,t,e.token)||this;return r.message=t.message,n.prototype.captureStackTrace.call(r,r),r}return e(t,n),t}(V);J.prototype=a(Error.prototype),J.prototype.constructor=J;var X=function(t){G.call(this),this.message=t+""};X.prototype=a(Error.prototype),X.prototype.constructor=X;var K=function(t){G.call(this),this.message=t+""};function Q(t,e){if(!t)throw new K(e=e||"expect "+t+" to be true")}K.prototype=a(Error.prototype),K.prototype.constructor=K;var Z,tt,et={root:["."],cache:!1,extname:"",dynamicPartials:!0,trim_tag_right:!1,trim_tag_left:!1,trim_value_right:!1,trim_value_left:!1,greedy:!0,strict_filters:!1,strict_variables:!1};function rt(t){var e;return(t=t||{}).hasOwnProperty("root")&&(t.root=f(e=t.root)?e:l(e)?[e]:[]),t}(tt=Z||(Z={}))[tt.OUTPUT=0]="OUTPUT",tt[tt.STORE=1]="STORE";var nt=Z,it=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=et),this.blocks={},this.blockMode=nt.OUTPUT,this.opts=h({},et,e),this.contexts=[t||{}]}return t.prototype.getAll=function(){return this.contexts.reduce(function(t,e){return function(e){for(var t=[],r=1;r":function(t,e){return null!==t&&null!==e&&e=":function(t,e){return null!==t&&null!==e&&e<=t},"<=":function(t,e){return null!==t&&null!==e&&t<=e},contains:function(t,e){return!!t&&("function"==typeof t.indexOf&&-1"),u+=''),u+='',c.push(n),r=u,[4,this.liquid.renderer.renderTemplates(this.templates,c)];case 1:return u=r+t.sent(),u+="",c.pop(n),[2,u]}})})})];case 1:return t.sent(),0"),[2,u]}})})}},unless:{parse:function(t,e){var r,n=this;this.templates=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(e).on("start",function(){r=n.templates,n.cond=t.args}).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.raw+" not closed")});i.start()},render:function(t){return St(Tt(this.cond,t))?this.liquid.renderer.renderTemplates(this.templates,t):this.liquid.renderer.renderTemplates(this.elseTemplates,t)}},break:{render:function(){return d(this,void 0,void 0,function(){return g(this,function(t){throw new X("break")})})}},continue:{render:function(){return d(this,void 0,void 0,function(){return g(this,function(t){throw new X("continue")})})}}},se={"&":"&","<":"<",">":">",'"':""","'":"'"},ue={"&":"&","<":"<",">":">",""":'"',"'":"'"};function ae(t){return String(t).replace(/&|<|>|"|'/g,function(t){return se[t]})}var ce={escape:ae,escape_once:function(t){return ae(String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return ue[t]}))},newline_to_br:function(t){return t.replace(/\n/g,"
")},strip_html:function(t){return String(t).replace(/|||<.*?>/g,"")}},le={append:function(t,e){return t+e},prepend:function(t,e){return e+t},capitalize:function(t){return String(t).charAt(0).toUpperCase()+t.slice(1)},concat:function(t,e){return Array.prototype.concat.call(t,e)},lstrip:function(t){return String(t).replace(/^\s+/,"")},downcase:function(t){return t.toLowerCase()},upcase:function(t){return String(t).toUpperCase()},remove:function(t,e){return t.split(e).join("")},remove_first:function(t,e){return t.replace(e,"")},replace:function(t,e,r){return String(t).split(e).join(r)},replace_first:function(t,e,r){return String(t).replace(e,r)},rstrip:function(t){return String(t).replace(/\s+$/,"")},split:function(t,e){return String(t).split(e)},strip:function(t){return String(t).trim()},strip_newlines:function(t){return String(t).replace(/\n/g,"")},truncate:function(t,e,r){return r=void 0===r?"...":r,e=e||16,(t=String(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===r&&(r="...");var n=t.split(" "),i=n.slice(0,e).join(" ");return n.length>e&&(i+=r),i}},fe={abs:function(t){return Math.abs(t)},ceil:function(t){return Math.ceil(t)},divided_by:function(t,e){return t/e},floor:function(t){return Math.floor(t)},minus:he(function(t,e){return t-e}),modulo:he(function(t,e){return t%e}),round:function(t,e){var r=Math.pow(10,e||0);return Math.round(t*r)/r},plus:he(function(t,e){return Number(t)+Number(e)}),times:function(t,e){return t*e}};function pe(t){var e=String(t).split(".");return 1