UNPKG

liquidjs

Version:

A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.

1 lines 76.2 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).liquidjs={})}(this,function(h){"use strict";var n=function(e,t){return(n=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 r(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var _=function(){return(_=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,s,a,u){return new(a=a||Promise)(function(t,r){function n(e){try{o(u.next(e))}catch(e){r(e)}}function i(e){try{o(u.throw(e))}catch(e){r(e)}}function o(e){e.done?t(e.value):function(t){return t instanceof a?t:new a(function(e){e(t)})}(e.value).then(n,i)}o((u=u.apply(e,s||[])).next())})}function S(r,n){var i,o,s,e,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],o=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function R(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||((n=n||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var e=(t.prototype.getText=function(){return this.input.slice(this.begin,this.end)},t.prototype.getPosition=function(){for(var e=m([1,1],2),t=e[0],r=e[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(t++,r=1):r++;return[t,r]},t.prototype.size=function(){return this.end-this.begin},t);function t(e,t,r,n,i){this.kind=e,this.input=t,this.begin=r,this.end=n,this.file=i}var i=(s.prototype.liquidMethodMissing=function(e){},s);function s(){}var a=Object.prototype.toString,u=String.prototype.toLowerCase,c=Object.hasOwnProperty;function l(e){return"string"==typeof e}function p(e){return"function"==typeof e}function f(e){return e&&p(e.next)&&p(e.throw)&&p(e.return)}function d(e){return l(e=b(e))?e:g(e)?"":y(e)?e.map(function(e){return d(e)}).join(""):String(e)}function b(e){return e instanceof i&&p(e.valueOf)?e.valueOf():e}function v(e){return"number"==typeof e}function g(e){return null==e}function y(e){return"[object Array]"===a.call(e)}function T(e,t){for(var r in e=e||{})if(c.call(e,r)&&!1===t(e[r],r,e))break;return e}function k(e){return e[e.length-1]}function x(e){var t=typeof e;return null!==e&&("object"==t||"function"==t)}function O(e,t,r){void 0===r&&(r=1);for(var n=[],i=e;i<t;i+=r)n.push(i);return n}function q(e,t,r){return void 0===r&&(r=" "),E(e,t,r,function(e,t){return t+e})}function E(e,t,r,n){for(var i=t-(e=String(e)).length;0<i--;)e=n(e,r);return e}function F(e){return e}function L(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:(e=u.call(e))<(t=u.call(t))?-1:t<e?1:0}function D(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.apply(void 0,w([],m(e.map(b)),!1))}}function M(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var P,j=(r(N,P=Error),N.prototype.update=function(){var e=this.originalError;this.context=function(e){var i=m(e.getPosition(),1)[0],o=e.input.split("\n"),t=Math.max(i-2,1),s=Math.min(i+3,o.length);return O(t,s+1).map(function(e){var t=e===i?">> ":" ",r=q(String(e),String(s).length),n=o[e-1];return"".concat(t).concat(r,"| ").concat(n)}).join("\n")}(this.token),this.message=function(e,t){t.file&&(e+=", file:".concat(t.file));var r=m(t.getPosition(),2),n=r[0],i=r[1];return e+=", line:".concat(n,", col:").concat(i)}(e.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+e.stack},N);function N(e,t){var r=P.call(this,e.message)||this;return r.originalError=e,r.token=t,r.context="",r}var I,A=(r(z,I=j),z);function z(e,t){var r=I.call(this,new Error(e),t)||this;return r.name="TokenizationError",I.prototype.update.call(r),r}var C,B=(r(V,C=j),V);function V(e,t){var r=C.call(this,e,t)||this;return r.name="ParseError",r.message=e.message,C.prototype.update.call(r),r}var H,K=(r(U,H=j),U.is=function(e){return"RenderError"===e.name},U);function U(e,t){var r=H.call(this,e,t.token)||this;return r.name="RenderError",r.message=e.message,H.prototype.update.call(r),r}var Q,$=(r(W,Q=j),W);function W(e,t){var r=Q.call(this,e,t)||this;return r.name="UndefinedVariableError",r.message=e.message,Q.prototype.update.call(r),r}var Y,J=(r(G,Y=Error),G);function G(e){var t=Y.call(this,"undefined variable: ".concat(e))||this;return t.name="InternalUndefinedVariableError",t.variableName=e,t}var Z,X=(r(ee,Z=Error),ee);function ee(e){var t=Z.call(this,e)||this;return t.name="AssertionError",t.message=e+"",t}var te=[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],re=1,ne=4,ie=16;function oe(e,t){if(!e){var r="function"==typeof t?t():t||"expect ".concat(e," to be true");throw new X(r)}}te[160]=te[5760]=te[6158]=te[8192]=te[8193]=te[8194]=te[8195]=te[8196]=te[8197]=te[8198]=te[8199]=te[8200]=te[8201]=te[8202]=te[8232]=te[8233]=te[8239]=te[8287]=te[12288]=ne;var se,ae=(r(ue,se=i),ue.prototype.equals=function(e){return g(b(e))},ue.prototype.gt=function(){return!1},ue.prototype.geq=function(){return!1},ue.prototype.lt=function(){return!1},ue.prototype.leq=function(){return!1},ue.prototype.valueOf=function(){return null},ue);function ue(){return null!==se&&se.apply(this,arguments)||this}var ce,le=(r(pe,ce=i),pe.prototype.equals=function(e){return!(e instanceof pe||(l(e=b(e))||y(e)?0!==e.length:!x(e)||0!==Object.keys(e).length))},pe.prototype.gt=function(){return!1},pe.prototype.geq=function(){return!1},pe.prototype.lt=function(){return!1},pe.prototype.leq=function(){return!1},pe.prototype.valueOf=function(){return""},pe);function pe(){return null!==ce&&ce.apply(this,arguments)||this}var he,fe=(r(de,he=le),de.prototype.equals=function(e){return!1===e||!!g(b(e))||(l(e)?/^\s*$/.test(e):he.prototype.equals.call(this,e))},de);function de(){return null!==he&&he.apply(this,arguments)||this}var ve,ge=(r(ye,ve=i),ye.prototype.next=function(){this.i++},ye.prototype.index0=function(){return this.i},ye.prototype.index=function(){return this.i+1},ye.prototype.first=function(){return 0===this.i},ye.prototype.last=function(){return this.i===this.length-1},ye.prototype.rindex=function(){return this.length-this.i},ye.prototype.rindex0=function(){return this.length-this.i-1},ye.prototype.valueOf=function(){return JSON.stringify(this)},ye);function ye(e,t,r){var n=ve.call(this)||this;return n.i=0,n.length=e,n.name="".concat(r,"-").concat(t),n}var me,we=(r(be,me=i),be.prototype.super=function(){return this.superBlockRender()},be);function be(e){void 0===e&&(e=function(){return""});var t=me.call(this)||this;return t.superBlockRender=e,t}function Te(e){return e&&p(e.equals)}var ke=new ae,xe={true:!0,false:!1,nil:ke,null:ke,empty:new le,blank:new fe};function Oe(e){var t,r,n={};try{for(var i=R(Object.entries(e)),o=i.next();!o.done;o=i.next()){for(var s=m(o.value,2),a=s[0],u=s[1],c=n,l=0;l<a.length;l++){var p=a[l];c[p]=c[p]||{},l===a.length-1&&te[a.charCodeAt(l)]&re&&(c[p].needBoundary=!0),c=c[p]}c.handler=u,c.end=!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}function qe(s){return o(this,void 0,void 0,function(){var t,r,n,i,o;return S(this,function(e){switch(e.label){case 0:if(!f(s))return[2,s];r=!1,n="next",e.label=1;case 1:i=s[n](t),r=i.done,t=i.value,n="next",e.label=2;case 2:return e.trys.push([2,5,,6]),f(t)&&(t=qe(t)),function(e){return e&&p(e.then)}(t)?[4,t]:[3,4];case 3:t=e.sent(),e.label=4;case 4:return[3,6];case 5:return o=e.sent(),n="throw",t=o,[3,6];case 6:if(!r)return[3,1];e.label=7;case 7:return[2,t]}})})}function _e(e){if(!f(e))return e;var t,r=!1,n="next";do{var i=e[n](t);if(r=i.done,n="next",f(t=i.value))try{t=_e(t)}catch(e){n="throw",t=e}}while(!r);return t}function Se(t){return y(t=b(t))?t:l(t)&&0<t.length?[t]:function(e){return x(e)&&Symbol.iterator in e}(t)?Array.from(t):x(t)?Object.keys(t).map(function(e){return[e,t[e]]}):[]}function Re(e){return g(e)?[]:y(e)?e:[e]}var Ee=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,Fe=["January","February","March","April","May","June","July","August","September","October","November","December"],Le=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],De=Fe.map(je),Me=Le.map(je),Pe={1:"st",2:"nd",3:"rd",default:"th"};function je(e){return e.slice(0,3)}function Ne(e){for(var t=0,r=0;r<e.getMonth();++r)t+=[31,function(e){var t=e.getFullYear();return!(0!=(3&t)||!(t%100||t%400==0&&t))}(e)?29:28,31,30,31,30,31,31,30,31,30,31][r];return t+e.getDate()}function Ie(e,t){var r=Ne(e)+(t-e.getDay()),n=7-new Date(e.getFullYear(),0,1).getDay()+t;return String(Math.floor((r-n)/7)+1)}var Ae={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},ze={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},Ce={a:function(e){return Me[e.getDay()]},A:function(e){return Le[e.getDay()]},b:function(e){return De[e.getMonth()]},B:function(e){return Fe[e.getMonth()]},c:function(e){return e.toLocaleString()},C:function(e){return function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}(e)},d:function(e){return e.getDate()},e:function(e){return e.getDate()},H:function(e){return e.getHours()},I:function(e){return String(e.getHours()%12||12)},j:function(e){return Ne(e)},k:function(e){return e.getHours()},l:function(e){return String(e.getHours()%12||12)},L:function(e){return e.getMilliseconds()},m:function(e){return e.getMonth()+1},M:function(e){return e.getMinutes()},N:function(e,t){var r=Number(t.width)||9;return function(e,t,r){return void 0===r&&(r=" "),E(e,t,r,function(e,t){return e+t})}(String(e.getMilliseconds()).slice(0,r),r,"0")},p:function(e){return e.getHours()<12?"AM":"PM"},P:function(e){return e.getHours()<12?"am":"pm"},q:function(e){return function(e){var t=e.getDate().toString(),r=parseInt(t.slice(-1));return Pe[r]||Pe.default}(e)},s:function(e){return Math.round(e.getTime()/1e3)},S:function(e){return e.getSeconds()},u:function(e){return e.getDay()||7},U:function(e){return Ie(e,0)},w:function(e){return e.getDay()},W:function(e){return Ie(e,1)},x:function(e){return e.toLocaleDateString()},X:function(e){return e.toLocaleTimeString()},y:function(e){return e.getFullYear().toString().slice(2,4)},Y:function(e){return e.getFullYear()},z:function(e,t){var r=Math.abs(e.getTimezoneOffset()),n=Math.floor(r/60),i=r%60;return(0<e.getTimezoneOffset()?"-":"+")+q(n,2,"0")+(t.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function Be(e,t){var r,n,i=m(t,5),o=i[0],s=i[1],a=void 0===s?"":s,u=i[2],c=i[3],l=i[4],p=Ce[l];if(!p)return o;var h={};try{for(var f=R(a),d=f.next();!d.done;d=f.next()){h[d.value]=!0}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(p(e,{flags:h,width:u,modifier:c})),g=ze[l]||"0",y=u||Ae[l]||0;return h["^"]?v=v.toUpperCase():h["#"]&&(v=function(e){return w([],m(e),!1).some(function(e){return"a"<=e&&e<="z"})?e.toUpperCase():e.toLowerCase()}(v)),h._?g=" ":h[0]&&(g="0"),h["-"]&&(y=0),q(v,y,g)}Ce.h=Ce.b;var Ve=(new Date).getTimezoneOffset(),He=/([zZ]|([+-])(\d{2}):(\d{2}))$/,Ke=(Ue.prototype.getTime=function(){return this.date.getTime()},Ue.prototype.getMilliseconds=function(){return this.date.getMilliseconds()},Ue.prototype.getSeconds=function(){return this.date.getSeconds()},Ue.prototype.getMinutes=function(){return this.date.getMinutes()},Ue.prototype.getHours=function(){return this.date.getHours()},Ue.prototype.getDay=function(){return this.date.getDay()},Ue.prototype.getDate=function(){return this.date.getDate()},Ue.prototype.getMonth=function(){return this.date.getMonth()},Ue.prototype.getFullYear=function(){return this.date.getFullYear()},Ue.prototype.toLocaleTimeString=function(e){return this.date.toLocaleTimeString(e)},Ue.prototype.toLocaleDateString=function(e){return this.date.toLocaleDateString(e)},Ue.prototype.getTimezoneOffset=function(){return this.timezoneOffset},Ue.createDateFixedToTimezone=function(e){var t=e.match(He);if(t&&"Z"===t[1])return new Ue(+new Date(e),0);if(t&&t[2]&&t[3]&&t[4]){var r=m(t,5),n=r[2],i=r[3],o=r[4],s=("+"===n?-1:1)*(60*parseInt(i,10)+parseInt(o,10));return new Ue(+new Date(e),s)}return new Date(e)},Ue);function Ue(e,t){if(e instanceof Ue)this.date=e.date,t=e.timezoneOffset;else{var r=6e4*(Ve-t),n=new Date(e).getTime()+r;this.date=new Date(n)}this.timezoneOffset=t}var Qe,$e=(r(We,Qe=e),We);function We(e,t,r,n,i,o,s,a){var u=Qe.call(this,e,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===t[0],l="-"===k(t);return u.content=t.slice(c?1:0,l?-1:t.length).trim(),u.trimLeft=c||o,u.trimRight=l||s,u}var Ye,Je=(r(Ge,Ye=$e),Ge);function Ge(e,t,r,n,i){var o=this,s=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=e.slice(t+u.length,r-c.length);o=Ye.call(this,h.TokenKind.Tag,l,e,t,r,s,a,i)||this;var p=new hr(o.content,n.operators);if(o.name=p.readTagName(),!o.name)throw new A("illegal tag syntax",o);return p.skipBlank(),o.args=p.remaining(),o}var Ze,Xe=(r(et,Ze=$e),et);function et(e,t,r,n,i){var o=n.trimOutputLeft,s=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=e.slice(t+a.length,r-u.length);return Ze.call(this,h.TokenKind.Output,c,e,t,r,o,s,i)||this}var tt,rt=(r(nt,tt=e),nt.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},nt);function nt(e,t,r,n){var i=tt.call(this,h.TokenKind.HTML,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var it,ot=(r(st,it=e),st);function st(e,t){var r=it.call(this,h.TokenKind.Number,e.input,e.begin,t?t.end:e.end,e.file)||this;return r.whole=e,r.decimal=t,r}var at,ut=(r(ct,at=e),ct.prototype.isNumber=function(e){void 0===e&&(e=!1);for(var t=e&&64&te[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;t<this.end;t++)if(!(32&te[this.input.charCodeAt(t)]))return!1;return!0},ct);function ct(e,t,r,n){var i=at.call(this,h.TokenKind.Word,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.content=i.getText(),i}var lt,pt=(r(ht,lt=e),ht);function ht(e,t,r,n){var i=lt.call(this,h.TokenKind.Literal,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.literal=i.getText(),i}var ft,dt={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},vt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},gt=(r(yt,ft=e),yt.prototype.getPrecedence=function(){var e=this.getText();return e in dt?dt[e]:1},yt);function yt(e,t,r,n){var i=ft.call(this,h.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}var mt,wt=(r(bt,mt=e),bt);function bt(e,t,r){var n=mt.call(this,h.TokenKind.PropertyAccess,e.input,e.begin,r,e.file)||this;return n.variable=e,n.props=t,n.propertyName=n.variable instanceof ut?n.variable.getText():Hr(n.variable.getText()),n}var Tt,kt=(r(xt,Tt=e),xt);function xt(e,t,r,n,i,o){var s=Tt.call(this,h.TokenKind.Filter,r,n,i,o)||this;return s.name=e,s.args=t,s}var Ot,qt=(r(_t,Ot=e),_t);function _t(e,t,r,n,i,o){var s=Ot.call(this,h.TokenKind.Hash,e,t,r,o)||this;return s.input=e,s.begin=t,s.end=r,s.name=n,s.value=i,s.file=o,s}var St,Rt=(r(Et,St=e),Et);function Et(e,t,r,n){var i=St.call(this,h.TokenKind.Quoted,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i}var Ft,Lt=(r(Dt,Ft=e),Dt);function Dt(e,t,r,n,i,o){var s=Ft.call(this,h.TokenKind.Range,e,t,r,o)||this;return s.input=e,s.begin=t,s.end=r,s.lhs=n,s.rhs=i,s.file=o,s}var Mt,Pt=(r(jt,Mt=$e),jt);function jt(e,t,r,n,i){var o=this,s=e.slice(t,r);if(o=Mt.call(this,h.TokenKind.Tag,s,e,t,r,!1,!1,i)||this,/\S/.test(s)){var a=new hr(o.content,n.operators);if(o.name=a.readTagName(),!o.name)throw new A("illegal liquid tag syntax",o);a.skipBlank(),o.args=a.remaining()}else o.name="",o.args="";return o}var Nt=(It.prototype.write=function(e){this.buffer+=d(e)},It);function It(){this.buffer=""}var At=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")},zt=(Ct.prototype.write=function(e){"string"!=typeof(e=b(e))&&""===this.buffer?this.buffer=e:this.buffer=d(this.buffer)+d(e)},Ct);function Ct(){this.buffer=""}var Bt=(Vt.prototype.renderTemplatesToNodeStream=function(e,t){var r=this,n=new At;return Promise.resolve().then(function(){return qe(r.renderTemplates(e,t,n))}).then(function(){return n.end()},function(e){return n.error(e)}),n.stream},Vt.prototype.renderTemplates=function(t,r,n){var i,o,s,a,u,c,l,p;return S(this,function(e){switch(e.label){case 0:n=n||(r.opts.keepOutputType?new zt:new Nt),e.label=1;case 1:e.trys.push([1,8,9,10]),i=R(t),o=i.next(),e.label=2;case 2:if(o.done)return[3,7];s=o.value,e.label=3;case 3:return e.trys.push([3,5,,6]),[4,s.render(r,n)];case 4:return(a=e.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=e.sent(),K.is(u)?u:new K(u,s);case 6:return o=i.next(),[3,2];case 7:return[3,10];case 8:return c=e.sent(),l={error:c},[3,10];case 9:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.buffer]}})},Vt);function Vt(){}var Ht=(Kt.prototype.evaluate=function(t,r){var n,i,o,s,a,u,c,l,p,h,f,d;return S(this,function(e){switch(e.label){case 0:oe(t,"unable to evaluate: context not defined"),n=[],e.label=1;case 1:e.trys.push([1,11,12,13]),i=R(this.postfix),o=i.next(),e.label=2;case 2:return o.done?[3,10]:Ur(s=o.value)?(a=n.pop(),u=void 0,1!==vt[s.operator]?[3,4]:[4,t.opts.operators[s.operator](a,t)]):[3,7];case 3:return u=e.sent(),[3,6];case 4:return c=n.pop(),[4,t.opts.operators[s.operator](c,a,t)];case 5:u=e.sent(),e.label=6;case 6:return n.push(u),[3,9];case 7:return p=(l=n).push,[4,Ut(s,t,r&&1===this.postfix.length)];case 8:p.apply(l,[e.sent()]),e.label=9;case 9:return o=i.next(),[3,2];case 10:return[3,13];case 11:return h=e.sent(),f={error:h},[3,13];case 12:try{o&&!o.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 13:return[2,n[0]]}})},Kt);function Kt(e){this.postfix=w([],m(function(t){var r,n,i,o,s,a,u;return S(this,function(e){switch(e.label){case 0:r=[],e.label=1;case 1:e.trys.push([1,10,11,12]),n=R(t),i=n.next(),e.label=2;case 2:if(i.done)return[3,9];if(!Ur(o=i.value))return[3,6];e.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>o.getPrecedence()?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(o),[3,8];case 6:return[4,o];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return s=e.sent(),a={error:s},[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 e.sent(),[3,12];case 14:return[2]}})}(e)),!1)}function Ut(t,r,n){return void 0===n&&(n=!1),S(this,function(e){switch(e.label){case 0:return Zr(t)?[4,function(t,r,n){var i,o,s,a,u,c,l,p,h,f;return S(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),o=R(t.props),s=o.next(),e.label=2;case 2:return s.done?[3,5]:(a=s.value,c=(u=i).push,[4,Ut(a,r,!1)]);case 3:c.apply(u,[e.sent()]),e.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return l=e.sent(),h={error:l},[3,8];case 7:try{s&&!s.done&&(f=o.return)&&f.call(o)}finally{if(h)throw h.error}return[7];case 8:return e.trys.push([8,10,,11]),[4,r._get(w([t.propertyName],m(i),!1))];case 9:return[2,e.sent()];case 10:if(p=e.sent(),n&&"InternalUndefinedVariableError"===p.name)return[2,null];throw new $(p,t);case 11:return[2]}})}(t,r,n)]:[3,2];case 1:return[2,e.sent()];case 2:return en(t)?[4,function(t,r){var n,i;return S(this,function(e){switch(e.label){case 0:return[4,Ut(t.lhs,r)];case 1:return n=e.sent(),[4,Ut(t.rhs,r)];case 2:return i=e.sent(),[2,O(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return Jr(t)?[2,function(e){return xe[e.literal]}(t)]:Gr(t)?[2,function(e){var t=e.whole.content+"."+(e.decimal?e.decimal.content:"");return Number(t)}(t)]:Xr(t)?[2,t.getText()]:Yr(t)?[2,Qt(t)]:[2]}})}function Qt(e){return Hr(e.getText())}function $t(e,t){return!Wt(e,t)}function Wt(e,t){return t.opts.jsTruthy?!e:!1===e||null==e}var Yt={"==":function(e,t){return Te(e)?e.equals(t):Te(t)?t.equals(e):b(e)===b(t)},"!=":function(e,t){return Te(e)?!e.equals(t):Te(t)?!t.equals(e):b(e)!==b(t)},">":function(e,t){return Te(e)?e.gt(t):Te(t)?t.lt(e):b(e)>b(t)},"<":function(e,t){return Te(e)?e.lt(t):Te(t)?t.gt(e):b(e)<b(t)},">=":function(e,t){return Te(e)?e.geq(t):Te(t)?t.leq(e):b(e)>=b(t)},"<=":function(e,t){return Te(e)?e.leq(t):Te(t)?t.geq(e):b(e)<=b(t)},contains:function(e,t){return e=b(e),t=b(t),!(!e||!p(e.indexOf))&&-1<e.indexOf(t)},not:function(e,t){return Wt(b(e),t)},and:function(e,t,r){return $t(b(e),r)&&$t(b(t),r)},or:function(e,t,r){return $t(b(e),r)||$t(b(t),r)}},Jt=function(e,t,r,n){this.key=e,this.value=t,this.next=r,this.prev=n},Gt=(Zt.prototype.write=function(e,t){if(this.cache[e])this.cache[e].value=t;else{var r=new Jt(e,t,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[e]=r,this.size++,this.ensureLimit()}},Zt.prototype.read=function(e){if(this.cache[e]){var t=this.cache[e].value;return this.remove(e),this.write(e,t),t}},Zt.prototype.remove=function(e){var t=this.cache[e];t.prev.next=t.next,t.next.prev=t.prev,delete this.cache[e],this.size--},Zt.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},Zt.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},Zt);function Zt(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new Jt("HEAD",null,null,null),this.tail=new Jt("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function Xt(e,t){var r=document.createElement("base");r.href=e;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=t;var o=i.href;return n.removeChild(r),o}var er=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==k(e)&&(e+="/"),Xt(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 o(this,void 0,void 0,function(){return S(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 o(this,void 0,void 0,function(){return S(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return Xt(e,".")},sep:"/"});function tr(e){return JSON.stringify(e)}var rr={raw:!0,handler:F},nr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},ir={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function or(e){return d(e).replace(/&|<|>|"|'/g,function(e){return nr[e]})}var sr=Object.freeze({__proto__:null,escape:or,escape_once:function(e){return or(function(e){return d(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return ir[e]})}(d(e)))},newline_to_br:function(e){return d(e).replace(/\n/g,"<br />\n")},strip_html:function(e){return d(e).replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")}}),ar={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,cache:void 0,extname:"",fs:er,dynamicPartials:!0,jsTruthy:!1,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:Yt};function ur(e){if(e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")){var t=void 0;t="number"==typeof e.cache?0<e.cache?new Gt(e.cache):void 0:"object"==typeof e.cache?e.cache:e.cache?new Gt(1024):void 0,e.cache=t}return!(e=_(_(_({},ar),e.jekyllInclude?{dynamicPartials:!1}:{}),e)).fs.dirname&&e.relativeReference&&(console.warn("[LiquidJS] `fs.dirname` is required for relativeReference, set relativeReference to `false` to suppress this warning, or provide implementation for `fs.dirname`"),e.relativeReference=!1),e.root=cr(e.root),e.partials=cr(e.partials),e.layouts=cr(e.layouts),e.outputEscape=e.outputEscape&&function(e){return"escape"===e?or:"json"===e?tr:(oe(p(e),"`outputEscape` need to be of type string or function"),e)}(e.outputEscape),e}function cr(e){var t=[];return y(e)&&(t=e),l(e)&&(t=[e]),t}function lr(e,t){if(e&&Qr(e))for(var r=t?ne:ie;te[e.input.charCodeAt(e.end-1-e.trimRight)]&r;)e.trimRight++}function pr(e,t){if(e&&Qr(e)){for(var r=t?ne:ie;te[e.input.charCodeAt(e.begin+e.trimLeft)]&r;)e.trimLeft++;"\n"===e.input.charAt(e.begin+e.trimLeft)&&e.trimLeft++}}var hr=(fr.prototype.readExpression=function(){return new Ht(this.readExpressionTokens())},fr.prototype.readExpressionTokens=function(){var t,r;return S(this,function(e){switch(e.label){case 0:return this.p<this.N?(t=this.readOperator())?[4,t]:[3,2]:[3,5];case 1:return e.sent(),[3,0];case 2:return(r=this.readValue())?[4,r]:[3,4];case 3:return e.sent(),[3,0];case 4:case 5:return[2]}})},fr.prototype.readOperator=function(){this.skipBlank();var e=function(e,t,r,n){void 0===n&&(n=e.length);for(var i,o=r,s=t;o[e[s]]&&s<n;)(o=o[e[s++]]).end&&(i=o);return i?i.needBoundary&&te[e.charCodeAt(s)]&re?-1:s:-1}(this.input,this.p,this.opTrie);if(-1!==e)return new gt(this.input,this.p,this.p=e,this.file)},fr.prototype.readFilters=function(){for(var e=[];;){var t=this.readFilter();if(!t)return e;e.push(t)}},fr.prototype.readFilter=function(){var e=this;if(this.skipBlank(),this.end())return null;oe("|"===this.peek(),function(){return"unexpected token at ".concat(e.snapshot())}),this.p++;var t=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();i&&n.push(i),this.skipBlank(),oe(this.end()||","===this.peek()||"|"===this.peek(),function(){return"unexpected character ".concat(e.snapshot())})}while(","===this.peek());return new kt(r.getText(),n,this.input,t,this.p,this.file)},fr.prototype.readFilterArg=function(){var e=this.readValue();if(e){if(this.skipBlank(),":"!==this.peek())return e;++this.p;var t=this.readValue();return[e.getText(),t]}},fr.prototype.readTopLevelTokens=function(e){void 0===e&&(e=ar);for(var t=[];this.p<this.N;){var r=this.readTopLevelToken(e);t.push(r)}return function(e,t){for(var r=!1,n=0;n<e.length;n++){var i=e[n];Kr(i)&&(!r&&i.trimLeft&&lr(e[n-1],t.greedy),Wr(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&pr(e[n+1],t.greedy))}}(t,e),t},fr.prototype.readTopLevelToken=function(e){var t=e.tagDelimiterLeft,r=e.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(e):this.match(t)?this.readTagToken(e):this.match(r)?this.readOutputToken(e):this.readHTMLToken([t,r])},fr.prototype.readHTMLToken=function(e){for(var t=this,r=this.p;this.p<this.N&&!e.some(function(e){return t.match(e)});)++this.p;return new rt(this.input,r,this.p,this.file)},fr.prototype.readTagToken=function(e){void 0===e&&(e=ar);var t=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(e.tagDelimiterRight))throw this.mkError("tag ".concat(this.snapshot(n)," not closed"),n);var i=new Je(r,n,this.p,e,t);return"raw"===i.name&&(this.rawBeginAt=n),i},fr.prototype.readToDelimiter=function(e){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(e))return this.p;return-1},fr.prototype.readOutputToken=function(e){void 0===e&&(e=ar);var t=this.file,r=this.input,n=e.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output ".concat(this.snapshot(i)," not closed"),i);return new Xe(r,i,this.p,e,t)},fr.prototype.readEndrawOrRawContent=function(e){for(var t=e.tagDelimiterLeft,r=e.tagDelimiterRight,n=this.p,i=this.readTo(t)-t.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var o=this.p;return n===i?(this.rawBeginAt=-1,new Je(this.input,n,o,e,this.file)):(this.p=i,new rt(this.input,n,i,this.file))}if(this.rmatch(t))break;this.p++}else i=this.readTo(t)-t.length;throw this.mkError("raw ".concat(this.snapshot(this.rawBeginAt)," not closed"),n)},fr.prototype.readLiquidTagTokens=function(e){void 0===e&&(e=ar);for(var t=[];this.p<this.N;){var r=this.readLiquidTagToken(e);r.name&&t.push(r)}return t},fr.prototype.readLiquidTagToken=function(e){var t=this.file,r=this.input,n=this.p,i=this.N;return-1!==this.readToDelimiter("\n")&&(i=this.p),new Pt(r,n,i,e,t)},fr.prototype.mkError=function(e,t){return new A(e,new ut(this.input,t,this.N,this.file))},fr.prototype.snapshot=function(e){return void 0===e&&(e=this.p),JSON.stringify(function(e,t){return e.length>t?e.slice(0,t-3)+"...":e}(this.input.slice(e),16))},fr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},fr.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;this.peekType()&re;)++this.p;return new ut(this.input,e,this.p,this.file)},fr.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},fr.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},fr.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t=this.p,r=this.readIdentifier();if(r.size()){var n;this.skipBlank();var i=e?"=":":";return this.peek()===i&&(++this.p,n=this.readValue()),new qt(this.input,t,this.p,r,n,this.file)}},fr.prototype.remaining=function(){return this.input.slice(this.p)},fr.prototype.advance=function(e){void 0===e&&(e=1),this.p+=e},fr.prototype.end=function(){return this.p>=this.N},fr.prototype.readTo=function(e){for(;this.p<this.N;)if(++this.p,this.rmatch(e))return this.p;return-1},fr.prototype.readValue=function(){var e=this.readQuoted()||this.readRange();if(e)return e;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new wt(i,[],this.p)}var t=this.readIdentifier();if(t.size()){for(var r=t.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new ut(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&&xe.hasOwnProperty(t.content)?new pt(this.input,t.begin,t.end,this.file):r?new ot(t,n[0]):new wt(t,n,this.p)}},fr.prototype.readRange=function(){this.skipBlank();var e=this.p;if("("===this.peek()){++this.p;var t=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new Lt(this.input,e,this.p,t,r,this.file)}},fr.prototype.readValueOrThrow=function(){var e=this,t=this.readValue();return oe(t,function(){return"unexpected token ".concat(e.snapshot(),", value expected")}),t},fr.prototype.readQuoted=function(){this.skipBlank();var e=this.p;if(8&this.peekType()){++this.p;for(var t=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[e]||t);)t?t=!1:"\\"===this.input[this.p-1]&&(t=!0);return new Rt(this.input,e,this.p,this.file)}},fr.prototype.readFileNameTemplate=function(t){var r,n,i;return S(this,function(e){switch(e.label){case 0:r=t.outputDelimiterLeft,n=[","," ",r],i=new Set(n),e.label=1;case 1:return this.p<this.N&&!i.has(this.peek())?[4,this.match(r)?this.readOutputToken(t):this.readHTMLToken(n)]:[3,3];case 2:return e.sent(),[3,1];case 3:return[2]}})},fr.prototype.match=function(e){for(var t=0;t<e.length;t++)if(e[t]!==this.input[this.p+t])return!1;return!0},fr.prototype.rmatch=function(e){for(var t=0;t<e.length;t++)if(e[e.length-1-t]!==this.input[this.p-1-t])return!1;return!0},fr.prototype.peekType=function(e){return void 0===e&&(e=0),te[this.input.charCodeAt(this.p+e)]},fr.prototype.peek=function(e){return void 0===e&&(e=0),this.input[this.p+e]},fr.prototype.skipBlank=function(){for(;this.peekType()&ne;)++this.p},fr);function fr(e,t,r){void 0===t&&(t=ar.operators),this.input=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=e.length,this.opTrie=Oe(t)}var dr=(vr.prototype.on=function(e,t){return this.handlers[e]=t,this},vr.prototype.trigger=function(e,t){var r=this.handlers[e];return!!r&&(r.call(this,t),!0)},vr.prototype.start=function(){var e;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)if(!(this.trigger("token",e)||Wr(e)&&this.trigger("tag:".concat(e.name),e))){var t=this.parseToken(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this},vr.prototype.stop=function(){return this.stopRequested=!0,this},vr);function vr(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function gr(e){this.token=e}var yr,mr=(r(wr,yr=gr),wr);function wr(e,t,r){var n=yr.call(this,e)||this;return n.name=e.name,n.liquid=r,n}var br=(Tr.prototype.render=function(t){var r,n,i,o,s,a,u,c,l,p;return S(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=R(Object.keys(this.hash)),i=n.next(),e.label=2;case 2:return i.done?[3,7]:(o=i.value,s=r,a=o,void 0!==this.hash[o]?[3,3]:(u=!0,[3,5]));case 3:return[4,Ut(this.hash[o],t)];case 4:u=e.sent(),e.label=5;case 5:s[a]=u,e.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=e.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(p=n.return)&&p.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},Tr);function Tr(e,t){var r,n;this.hash={};var i=new hr(e,{});try{for(var o=R(i.readHashes(t)),s=o.next();!s.done;s=o.next()){var a=s.value;this.hash[a.name.content]=a.value}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}var kr=(xr.prototype.render=function(t,r){var n,i,o,s,a,u,c,l,p,h,f,d;return S(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=R(this.args),o=i.next(),e.label=2;case 2:return o.done?[3,7]:function(e){return y(e)}(s=o.value)?(u=(a=n).push,c=[s[0]],[4,Ut(s[1],r)]):[3,4];case 3:return u.apply(a,[c.concat([e.sent()])]),[3,6];case 4:return p=(l=n).push,[4,Ut(s,r)];case 5:p.apply(l,[e.sent()]),e.label=6;case 6:return o=i.next(),[3,2];case 7:return[3,10];case 8:return h=e.sent(),f={error:h},[3,10];case 9:try{o&&!o.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 10:return[2,this.handler.apply({context:r,liquid:this.liquid},w([t],m(n),!1))]}})},xr);function xr(e,t,r,n){this.name=e,this.handler=p(t)?t:p(null==t?void 0:t.handler)?t.handler:F,this.raw=!p(t)&&!!(null==t?void 0:t.raw),this.args=r,this.liquid=n}var Or=(qr.prototype.value=function(t,r){var n,i,o,s,a,u;return S(this,function(e){switch(e.label){case 0:return r=r||t.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(t,r)];case 1:n=e.sent(),e.label=2;case 2:e.trys.push([2,7,8,9]),i=R(this.filters),o=i.next(),e.label=3;case 3:return o.done?[3,6]:[4,o.value.render(n,t)];case 4:n=e.sent(),e.label=5;case 5:return o=i.next(),[3,3];case 6:return[3,9];case 7:return s=e.sent(),a={error:s},[3,9];case 8:try{o&&!o.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},qr.prototype.getFilter=function(e,t){var r=e.filters[t];return oe(r||!e.options.strictFilters,function(){return"undefined filter: ".concat(t)}),r},qr);function qr(e,n){var i=this;this.filters=[];var t=new hr(e,n.options.operators);this.initial=t.readExpression(),this.filters=t.readFilters().map(function(e){var t=e.name,r=e.args;return new kr(t,i.getFilter(n,t),r,n)})}var _r,Sr=(r(Rr,_r=gr),Rr.prototype.render=function(t,r){var n;return S(this,function(e){switch(e.label){case 0:return[4,this.value.value(t,!1)];case 1:return n=e.sent(),r.write(n),[2]}})},Rr);function Rr(e,t){var r,n=_r.call(this,e)||this;n.value=new Or(e.content,t);var i=n.value.filters,o=t.options.outputEscape;return!(null===(r=i[i.length-1])||void 0===r?void 0:r.raw)&&o&&i.push(new kr(toString.call(o),o,[],t)),n}var Er,Fr,Lr,Dr=(r(Mr,Er=gr),Mr.prototype.render=function(e,t){return S(this,function(e){return t.write(this.str),[2]})},Mr);function Mr(e){var t=Er.call(this,e)||this;return t.str=e.getContent(),t}(Lr=Fr=Fr||{}).Partials="partials",Lr.Layouts="layouts",Lr.Root="root";var Pr=(jr.prototype.lookup=function(t,r,n,i){var o,s,a,u,c,l,p,h,f;return S(this,function(e){switch(e.label){case 0:o=this.options.fs,s=this.options[r],e.label=1;case 1:e.trys.push([1,8,9,10]),a=R(this.candidates(t,s,i,r!==Fr.Root)),u=a.next(),e.label=2;case 2:return u.done?[3,7]:(c=u.value,n?(l=o.existsSync(c),[3,5]):[3,3]);case 3:return[4,o.exists(c)];case 4:l=e.sent(),e.label=5;case 5:if(l)return[2,c];e.label=6;case 6:return u=a.next(),[3,2];case 7:return[3,10];case 8:return p=e.sent(),h={error:p},[3,10];case 9:try{u&&!u.done&&(f=a.return)&&f.call(a)}finally{if(h)throw h.error}return[7];case 10:throw this.lookupError(t,s)}})},jr.prototype.candidates=function(t,r,n,i){var o,s,a,u,c,l,p,h,f,d,v,g,y,m,w,b;return S(this,function(e){switch(e.label){case 0:if(o=this.options,s=o.fs,a=o.extname,!this.shouldLoadRelative(t)||!n)return[3,8];d=s.resolve(this.dirname(n),t,a),e.label=1;case 1:e.trys.push([1,6,7,8]),u=R(r),c=u.next(),e.label=2;case 2:return c.done?[3,5]:(f=c.value,i&&!this.contains(f,d)?[3,4]:[4,d]);case 3:return e.sent(),[3,5];case 4:return c=u.next(),[3,2];case 5:return[3,8];case 6:return l=e.sent(),y={error:l},[3,8];case 7:try{c&&!c.done&&(m=u.return)&&m.call(u)}finally{if(y)throw y.error}return[7];case 8:e.trys.push([8,13,14,15]),p=R(r),h=p.next(),e.label=9;case 9:return h.done?[3,12]:(f=h.value,d=s.resolve(f,t,a),i&&!this.contains(f,d)?[3,11]:[4,d]);case 10:e.sent(),e.label=11;case 11:return h=p.next(),[3,9];case 12:return[3,15];case 13:return v=e.sent(),w={error:v},[3,15];case 14:try{h&&!h.done&&(b=p.return)&&b.call(p)}finally{if(w)throw w.error}return[7];case 15:return void 0===s.fallback?[3,17]:void 0===(g=s.fallback(t))?[3,17]:[4,g];case 16:e.sent(),e.label=17;case 17:return[2]}})},jr.prototype.dirname=function(e){var t=this.options.fs;return oe(t.dirname,"`fs.dirname` is required for relative reference"),t.dirname(e)},jr.prototype.lookupError=function(e,t){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'.concat(e,'" in "').concat(t,'"'),r.code="ENOENT",r},jr);function jr(e){if((this.options=e).relativeReference){var t=e.fs.sep;oe(t,"`fs.sep` is required for relative reference");var r=new RegExp(["."+t,".."+t,"./","../"].map(function(e){return function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}(e)}).join("|"));this.shouldLoadRelative=function(e){return r.test(e)}}else this.shouldLoadRelative=function(e){return!1};this.contains=this.options.fs.contains||function(){return!0}}var Nr=(Ir.prototype.parse=function(e,t){var r=new hr(e,this.liquid.options.operators,t).readTopLevelTokens(this.liquid.options);return this.parseTokens(r)},Ir.prototype.parseTokens=function(e){for(var t,r=[];t=e.shift();)r.push(this.parseToken(t,e));return r},Ir.prototype.parseToken=function(t,e){try{if(Wr(t)){var r=this.liquid.tags[t.name];return oe(r,'tag "'.concat(t.name,'" not found')),new r(t,e,this.liquid)}return $r(t)?new Sr(t,this.liquid):new Dr(t)}catch(e){throw new B(e,t)}},Ir.prototype.parseStream=function(e){var r=this;return new dr(e,function(e,t){return r.parseToken(e,t)})},Ir.prototype._parseFileCached=function(t,r,n,i){var o,s,a,u,c,l,p;return void 0===n&&(n=Fr.Root),S(this,function(e){switch(e.label){case 0:return o=this.cache,s=this.loader.shouldLoadRelative(t)?i+","+t:n+":"+t,[4,o.read(s)];case 1:return(a=e.sent())?[2,a]:(u=this._parseFile(t,r,n,i),r?[4,u]:[3,3]);case 2:return l=e.sent(),[3,4];case 3:l=qe(u),e.label=4;case 4:c=l,o.write(s,c),e.label=5;case 5:return e.trys.push([5,7,,8]),[4,c];case 6:return[2,e.sent()];case 7:throw p=e.sent(),o.remove(s),p;case 8:return[2]}})},Ir.prototype._parseFile=function(t,r,n,i){var o,s,a,u;return void 0===n&&(n=Fr.Root),S(this,function(e){switch(e.label){case 0:return[4,this.loader.lookup(t,n,r,i)];case 1:return o=e.sent(),a=(s=this.liquid).parse,r?(u=this.fs.readFileSync(o),[3,4]):[3,2];case 2:return[4,this.fs.readFile(o)];case 3:u=e.sent(),e.label=4;case 4:return[2,a.apply(s,[u,o])]}})},Ir);function Ir(e){this.liquid=e,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Pr(this.liquid.options)}var Ar,zr=/[\da-fA-F]/,Cr=/[0-7]/,Br={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Vr(e){var t=e.charCodeAt(0);return 97<=t?t-87:65<=t?t-55:t-48}function Hr(e){for(var t="",r=1;r<e.length-1;r++)if("\\"===e[r])if(void 0!==Br[e[r+1]])t+=Br[e[++r]];else if("u"===e[r+1]){for(var n=0,i=r+2;i<=r+5&&zr.test(e[i]);)n=16*n+Vr(e[i++]);r=i-1,t+=String.fromCharCode(n)}else if(Cr.test(e[r+1])){for(i=r+1,n=0;i<=r+3&&Cr.test(e[i]);)n=8*n+Vr(e[i++]);r=i-1,t+=String.fromCharCode(n)}else t+=e[++r];else t+=e[r];return t}function Kr(e){return!!(tn(e)&h.TokenKind.Delimited)}function Ur(e){return tn(e)===h.TokenKind.Operator}function Qr(e){return tn(e)===h.TokenKind.HTML}function $r(e){return tn(e)===h.TokenKind.Output}function Wr(e){return tn(e)===h.TokenKind.Tag}function Yr(e){return tn(e)===h.TokenKind.Quoted}function Jr(e){return tn(e)===h.TokenKind.Literal}function Gr(e){return tn(e)===h.TokenKind.Number}function Zr(e){return tn(e)===h.TokenKind.PropertyAccess}function Xr(e){return tn(e)===h.TokenKind.Word}function en(e){return tn(e)===h.TokenKind.Range}function tn(e){return e?e.kind:-1}h.TokenKind=void 0,(Ar=h.TokenKind||(h.TokenKind={}))[Ar.Number=1]="Number",Ar[Ar.Literal=2]="Literal",Ar[Ar.Tag=4]="Tag",Ar[Ar.Output=8]="Output",Ar[Ar.HTML=16]="HTML",Ar[Ar.Filter=32]="Filter",Ar[Ar.Hash=64]="Hash",Ar[Ar.PropertyAccess=128]="PropertyAccess",Ar[Ar.Word=256]="Word",Ar[Ar.Range=512]="Range",Ar[Ar.Quoted=1024]="Quoted",Ar[Ar.Operator=2048]="Operator",Ar[Ar.Delimited=12]="Delimited";var rn,nn,on=Object.freeze({__proto__:null,isDelimitedToken:Kr,isOperatorToken:Ur,isHTMLToken:Qr,isOutputToken:$r,isTagToken:Wr,isQuotedToken:Yr,isLiteralToken:Jr,isNumberToken:Gr,isPropertyAccessToken:Zr,isWordToken:Xr,isRangeToken:en}),sn=(an.prototype.getRegister=function(e){return this.registers[e]=this.registers[e]||{}},an.prototype.setRegister=function(e,t){return this.registers[e]=t},an.prototype.saveRegister=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.map(function(e){return[e,t.getRegister(e)]})},an.prototype.restoreRegister=function(e){var i=this;return e.forEach(function(e){var t=m(e,2),r=t[0],n=t[1];return i.setRegister(r,n)})},an.prototype.getAll=function(){return w([this.globals,this.environments],m(this.scopes),!1).reduce(function(e,t){return _(e,t)},{})},an.prototype.get=function(e){return _e(this._get(e))},an.prototype._get=function(t){var r;return S(this,function(e){switch(e.label){case 0:return r=this.findScope(t[0]),[4,this._getFromScope(r,t)];case 1:return[2,e.sent()]}})},an.prototype.getFromScope=function(e,t){return _e(this._getFromScope(e,t))},an.prototype._getFromScope=function(t,r){var n;return S(this,function(e){switch(e.label){case 0:l(r)&&(r=r.split(".")),n=0,e.label=1;case 1:return n<r.length?[4,function(e,t,r){if(g(e=function e(t){return t&&p(t.toLiquid)?e(t.toLiquid()):t}(e)))return e;if(y(e)&&t<0)return e[e.length+ +t];var n=function(e,t,r){return!r||Object.hasOwnProperty.call(e,t)||e instanceof i?e[t]:void 0}(e,t,r);return void 0===n&&e instanceof i?e.liquidMethodMissing(t):p(n)?n.call(e):"size"===t?function(e){return e.hasOwnProperty("size")||void 0!==e.size?e.size:y(e)||l(e)?e.length:"object"==typeof e?Object.keys(e).length:void 0}(e):"first"===t?function(e){return y(e)?e[0]:e.first}(e):"last"===t?function(e){return y(e)?e[e.length-1]:e.last}(e):n}(t,r[n],this.ownPropertyOnly)]:[3,4];case 2:if(g(t=e.sent())&&this.strictVariables)throw new J(r.slice(0,n+1).join("."));e.label=3;case 3:return n++,[3,1];case 4:return[2,t]}})},an.prototype.push=function(e){return this.scopes.push(e)},an.prototype.pop=function(){return this.scopes.pop()},an.prototype.bottom=function(){return this.scopes[0]},an.prototype.findScope=function(e){for(var t=this.scopes.length-1;0<=t;t--){var r=this.scopes[t];if(e in r)return r}return e in this.environments?this.environments:this.globals},an);function an(e,t,r){var n,i,o;void 0===e&&(e={}),void 0===t&&(t=ar),void 0===r&&(r={}),this.scopes=[{}],this.registers={},this.sync=!!r.sync,this.opts=t,this.globals=null!==(n=r.globals)&&void 0!==n?n:t.globals,this.environments=e,this.strictVariables=null!==(i=r.strictVariables)&&void 0!==i?i:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=r.ownPropertyOnly)&&void 0!==o?o:t.ownPropertyOnly}(nn=rn=rn||{})[nn.OUTPUT=0]="OUTPUT",nn[nn.STORE=1]="STORE";var un=D(Math.abs),cn=D(Math.max),ln=D(Math.min),pn=D(Math.ceil),hn=D(function(e,t,r){return void 0===r&&(r=!1),r?Math.floor(e/t):e/t}),fn=D(Math.floor),dn=D(function(e,t){return e-t}),vn=D(function(e,t){return e%t}),gn=D(function(e,t){return e*t});var yn=Object.freeze({__proto__:null,abs:un,at_least:cn,at_most:ln,ceil:pn,divided_by:hn,floor:fn,minus:dn,modulo:vn,times:gn,round:function(e,t){void 0===t&&(t=0),e=b(e),t=b(t);var r=Math.pow(10,t);return Math.round(e*r)/r},plus:function(e,t){return e=b(e),t=b(t),Number(e)+Number(t)}}),mn=Object.freeze({__proto__:null,url_decode:function(e){return d(e).split("+").map(decodeURIComponent).join(" ")},url_encode:function(e){return d(e).split(" ").map(encodeURIComponent).join("+")}}),wn=D(function(e,t){return Re(e).join(void 0===t?" ":t)}),bn=D(function(e){return y(e)?k(e):""}),Tn=D(function(e){return y(e)?e[0]:""}),kn=D(function(e){return w([],m(Re(e)),!1).reverse()});var xn=Object.freeze({__proto__:null,join:wn,last:bn,first:Tn,reverse:kn,sort:function(t,r){var n,i,o,s,a,u,c,l,p,h,f;return S(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=R(Re(b(t))),o=i.next(),e.label=2;case 2:return o.done?[3,7]:(s=o.value,u=(a=n).push,c=[s],r?[4,this.context._getFromScope(s,d(r).split("."))]:[3,4]);case 3:return l=e.sent(),[3,5];case 4:l=s,e.label=5;case 5:u.apply(a,[c.concat([l])]),e.label=6;case 6:return o=i.next(),[3,2];case 7:return[3,10];case 8:return p=e.sent(),h={error:p},[3,10];case 9:try{o&&!o.done&&(f=i.return)&&f.call(i)}finally{if(h)throw h.error}return[7];case 10:return[2,n.sort(function(e,t){var r=e[1],n=t[1];return r<n?-1:n<r?1:0}).map(function(e){return e[0]})]}})},sort_natural:function(e,t){e=b(e);var r=d(t),n=void 0===t?L:function(e,t){return L(e[r],t[r])};return w([],m(Re(e)),!1).sort(n)},size:function(e){return e&&e.length||0},map:function(t,r){var n,i,o,s,a,u,c,l,p;return S(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,6,7,8]),i=R(Re(b(t))),o=i.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,u=(a=n).push,[4,this.context._getFromScope(s,d(r).split("."))]);case 3:u.apply(a,[e.sent()]),e.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),l={error:c},[3,8];case 7:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 8:return[2,n]}})},compact:function(e){return Re(e=b(e)).filter(function(e){return!g(b(e))})},concat:function(e,t){return void 0===t&&(t=[]),e=b(e),t=Re(t).map(function(e){return b(e)}),Re(e).concat(t)},slice:function(e,t,r){return void 0===r&&(r=1),g(e=b(e))?[]:(y(e)||(e=d(e)),t=t<0?e.length+t:t,e.slice(t,t+r))},where:function(t,r,n){var i,o,s,a,u,c,l,p,h,f=this;return S(this,function(e){switch(e.label){case 0:i=[],t=Re(b(t)),e.label=1;case 1:e.trys.push([1,6,7,8]),o=R(t),s=o.next(),e.label=2;case 2:return s.done?[3,5]:(a=s.value,c=(u=i).push,[4,this.context._getFromScope(a,d(r).split(