liquidjs
Version:
A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.
1 lines • 112 kB
JavaScript
!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 q=function(e,t){return(q=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}q(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;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 a(e,o,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function i(e){try{s(u.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}s((u=u.apply(e,o||[])).next())})}function G(n,i){var s,o,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(s)throw new TypeError("Generator is already executing.");for(;u=c&&t[c=0]?0:u;)try{if(s=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,o=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))u.label=t[1];else if(6===t[0]&&u.label<a[1])u.label=a[1],a=t;else{if(!(a&&u.label<a[2])){a[2]&&u.ops.pop(),u.trys.pop();continue}u.label=a[2],u.ops.push(t)}}t=i.call(n,u)}catch(e){t=[6,e],o=0}finally{s=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function X(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{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ee(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<t--)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function d(e,t,r){if(r||2===arguments.length)for(var n,i=0,s=t.length;i<s;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))}E.prototype.getText=function(){return this.input.slice(this.begin,this.end)},E.prototype.getPosition=function(){for(var e=ee([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]},E.prototype.size=function(){return this.end-this.begin};var e=E;function E(e,t,r,n,i){this.kind=e,this.input=t,this.begin=r,this.end=n,this.file=i}N.prototype.liquidMethodMissing=function(e){};var A=N;function N(){}var M=Object.prototype.toString,D=String.prototype.toLowerCase,V=Object.hasOwnProperty;function te(e){return"string"==typeof e}function u(e){return"function"==typeof e}function P(e){return e&&u(e.next)&&u(e.throw)&&u(e.return)}function y(e){return te(e=g(e))?e:o(e)?"":c(e)?e.map(y).join(""):String(e)}function C(t){var e;return c(t=g(t))?t:te(t)&&0<t.length?[t]:W(e=t)&&Symbol.iterator in e?Array.from(t):W(t)?Object.keys(t).map(function(e){return[e,t[e]]}):[]}function v(e){return o(e=g(e))?[]:c(e)?e:[e]}function g(e){return e instanceof A&&u(e.valueOf)?e.valueOf():e}function I(e){return e=Number(e),isNaN(e)?0:e}function B(e){return"number"==typeof e}function o(e){return null==e}function c(e){return"[object Array]"===M.call(e)}function H(e){return e&&B(e.length)}function U(e,t){for(var r in e=e||{})if(V.call(e,r)&&!1===t(e[r],r,e))break}function K(e){return e[e.length-1]}function W(e){var t=typeof e;return null!==e&&("object"==t||"function"==t)}function Y(e,t,r){void 0===r&&(r=1);for(var n=[],i=e;i<t;i+=r)n.push(i);return n}function $(e,t,r){return Z(e,t,r=void 0===r?" ":r,function(e,t){return t+e})}function Z(e,t,r,n){for(var i=t-(e=String(e)).length;0<i--;)e=n(e,r);return e}function J(e){return e}function Q(e,t){return null==e&&null==t?0:null==e?1:null==t||(e=D.call(e))<(t=D.call(t))?-1:t<e?1:0}function t(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.call.apply(r,d([this],ee(e.map(g)),!1))}}function re(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ne(t){var r,n,i,s,o,a,u;return G(this,function(e){switch(e.label){case 0:r=new Set,e.label=1;case 1:e.trys.push([1,6,7,8]),n=X(t),i=n.next(),e.label=2;case 2:return i.done?[3,5]:(s=i.value,o=JSON.stringify(s),r.has(o)?[3,4]:(r.add(o),[4,s]));case 3:e.sent(),e.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return o=e.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})}var ie,se="__liquidClass__",oe=(s(ae,ie=Error),ae.prototype.update=function(){var n,i,s,o,e,t,r;Object.defineProperty(this,"context",{value:(e=this.token,t=ee(e.getPosition(),2),n=t[0],i=t[1],s=e.input.split("\n"),t=Math.max(n-2,1),o=Math.min(n+3,s.length),Y(t,o+1).map(function(e){var t=e===n?">> ":" ",r=$(String(e),String(o).length),t="".concat(t).concat(r,"| "),r=e===n?"\n"+$("^",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=ee(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)},ae.is=function(e){return"LiquidError"===(null==e?void 0:e[se])},ae);function ae(e,t){var r=ie.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,se,{value:"LiquidError",enumerable:!1}),r}s(le,ue=oe);var ue,ce=le;function le(e,t){e=ue.call(this,e,t)||this;return e.name="TokenizationError",ue.prototype.update.call(e),e}s(fe,he=oe);var he,pe=fe;function fe(e,t){t=he.call(this,e,t)||this;return t.name="ParseError",t.message=e.message,he.prototype.update.call(t),t}s(ve,de=oe),ve.is=function(e){return"RenderError"===e.name};var de,ye=ve;function ve(e,t){t=de.call(this,e,t.token)||this;return t.name="RenderError",t.message=e.message,de.prototype.update.call(t),t}s(be,ge=oe),be.is=function(e){return"LiquidErrors"===e.name};var ge,me=be;function be(e){var t=ge.call(this,e[0],e[0].token)||this,r=(t.errors=e,t.name="LiquidErrors",1<e.length?"s":"");return t.message="".concat(e.length," error").concat(r," found"),ge.prototype.update.call(t),t}s(Te,we=oe);var we,ke=Te;function Te(e,t){t=we.call(this,e,t)||this;return t.name="UndefinedVariableError",t.message=e.message,we.prototype.update.call(t),t}s(Le,xe=Error);var xe,Se=Le;function Le(e){var t=xe.call(this,"undefined variable: ".concat(e))||this;return t.name="InternalUndefinedVariableError",t.variableName=e,t}s(_e,Fe=Error);var Fe,Oe=_e;function _e(e){var t=Fe.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],ze=1,Re=4,je=16;function qe(e){e=e.charCodeAt(0);return 128<=e?!h[e]:h[e]&ze}function x(e,t){if(!e)throw t="function"==typeof t?t():t||"expect ".concat(e," to be true"),new Oe(t)}function Ee(e,t){x(!e,t=void 0===t?"unexpected ".concat(JSON.stringify(e)):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]=Re,h[8220]=h[8221]=128;s(Ne,Ae=A),Ne.prototype.equals=function(e){return o(g(e))},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 null};var Ae,r=Ne;function Ne(){return null!==Ae&&Ae.apply(this,arguments)||this}s(n,Me=A),n.prototype.equals=function(e){return!(e instanceof n||(te(e=g(e))||c(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""},n.is=function(e){return e instanceof n};var Me,De=n;function n(){return null!==Me&&Me.apply(this,arguments)||this}s(Ce,Ve=De),Ce.prototype.equals=function(e){return!1===e||!!o(g(e))||(te(e)?/^\s*$/.test(e):Ve.prototype.equals.call(this,e))},Ce.is=function(e){return e instanceof Ce};var Ve,Pe=Ce;function Ce(){return null!==Ve&&Ve.apply(this,arguments)||this}s(i,Ie=A),i.prototype.next=function(){this.i++},i.prototype.index0=function(){return this.i},i.prototype.index=function(){return this.i+1},i.prototype.first=function(){return 0===this.i},i.prototype.last=function(){return this.i===this.length-1},i.prototype.rindex=function(){return this.length-this.i},i.prototype.rindex0=function(){return this.length-this.i-1},i.prototype.valueOf=function(){return JSON.stringify(this)};var Ie,Be=i;function i(e,t,r){var n=Ie.call(this)||this;return n.i=0,n.length=e,n.name="".concat(r,"-").concat(t),n}Ue.prototype.write=function(e){this.buffer+=y(e)};var He=Ue;function Ue(){this.buffer=""}var Ke=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")},We=(Ye.prototype.write=function(e){"string"!=typeof(e=g(e))&&""===this.buffer?this.buffer=e:this.buffer=y(this.buffer)+y(e)},Ye);function Ye(){this.buffer=""}s(Je,$e=A),Je.prototype.super=function(){var t;return G(this,function(e){switch(e.label){case 0:return t=new He,[4,this.superBlockRender(t)];case 1:return e.sent(),[2,t.buffer]}})};var $e,Ze=Je;function Je(e){void 0===e&&(e=function(){return""});var t=$e.call(this)||this;return t.superBlockRender=e,t}function p(e){return e&&u(e.equals)&&u(e.gt)&&u(e.geq)&&u(e.lt)&&u(e.leq)}var r=new r,Qe={true:!0,false:!1,nil:r,null:r,empty:new De,blank:new Pe};function Ge(e){var t,r,n={};try{for(var i=X(Object.entries(e)),s=i.next();!s.done;s=i.next()){for(var o=ee(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&&qe(a[l])&&(c[h].needBoundary=!0),c=c[h]}c.data=u,c.end=!0}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}function f(o){return a(this,void 0,void 0,function(){var r,n,i,s;return G(this,function(e){switch(e.label){case 0:if(!P(o))return[2,o];n=!1,i="next",e.label=1;case 1:s=o[i](r),n=s.done,r=s.value,i="next",e.label=2;case 2:return(e.trys.push([2,5,,6]),P(r)&&(r=f(r)),(t=r)&&u(t.then))?[4,r]:[3,4];case 3:r=e.sent(),e.label=4;case 4:return[3,6];case 5:return s=e.sent(),i="throw",r=s,[3,6];case 6:if(!n)return[3,1];e.label=7;case 7:return[2,r]}var t})})}function m(e){if(!P(e))return e;var t="next";do{var r,n=e[t](r),i=n.done,t="next";if(P(r=n.value))try{r=m(r)}catch(e){t="throw",r=e}}while(!i);return r}var Xe=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function et(e){return[31,function(e){e=e.getFullYear();return 0==(3&e)&&(e%100||e%400==0&&e)}(e)?29:28,31,30,31,30,31,31,30,31,30,31]}function tt(e){for(var t=0,r=0;r<e.getMonth();++r)t+=et(e)[r];return t+e.getDate()}function rt(e,t){var r=tt(e)+(t-e.getDay()),e=7-new Date(e.getFullYear(),0,1).getDay()+t;return String(Math.floor((r-e)/7)+1)}var nt={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},it=new Set("aAbBceklpP");function st(e,t){var r=Math.abs(e.getTimezoneOffset()),n=Math.floor(r/60),r=r%60;return(0<e.getTimezoneOffset()?"-":"+")+$(n,2,"0")+(t.flags[":"]?":":"")+$(r,2,"0")}var ot={a:function(e){return e.getShortWeekdayName()},A:function(e){return e.getLongWeekdayName()},b:function(e){return e.getShortMonthName()},B:function(e){return e.getLongMonthName()},c:function(e){return e.toLocaleString()},C:function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)},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:tt,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){t=Number(t.width)||9;return Z(String(e.getMilliseconds()).slice(0,t),t,e=void 0===(e="0")?" ":e,function(e,t){return e+t})},p:function(e){return e.getHours()<12?"AM":"PM"},P:function(e){return e.getHours()<12?"am":"pm"},q:function(e){if(e=e.getDate(),[11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},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 rt(e,0)},w:function(e){return e.getDay()},W:function(e){return rt(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:st,Z:function(e,t){return e.getTimeZoneName()||st(e,t)},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function at(e,t){for(var r,n="",i=t;r=Xe.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=function(e,t){var r,t=ee(t,5),n=t[0],i=t[1],i=void 0===i?"":i,s=t[2],o=t[3],t=t[4],a=ot[t];if(!a)return n;var u={};try{for(var c=X(i),l=c.next();!l.done;l=c.next()){var h=l.value;u[h]=!0}}catch(e){r={error:e}}finally{try{l&&!l.done&&(p=c.return)&&p.call(c)}finally{if(r)throw r.error}}var n=String(a(e,{flags:u,width:s,modifier:o})),i=it.has(t)?" ":"0",p=s||nt[t]||0;u["^"]?n=n.toUpperCase():u["#"]&&(n=function(e){return d([],ee(e),!1).some(function(e){return"a"<=e&&e<="z"})?e.toUpperCase():e.toLowerCase()}(n));u._?i=" ":u[0]&&(i="0");u["-"]&&(p=0);return $(n,p,i)}(e,r);return n+i}function ut(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}ot.h=ot.b;var ct=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,lt=["January","February","March","April","May","June","July","August","September","October","November","December"],ht=lt.map(function(e){return e.slice(0,3)}),pt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ft=pt.map(function(e){return e.slice(0,3)}),dt=(b.prototype.getTime=function(){return this.displayDate.getTime()},b.prototype.getMilliseconds=function(){return this.displayDate.getMilliseconds()},b.prototype.getSeconds=function(){return this.displayDate.getSeconds()},b.prototype.getMinutes=function(){return this.displayDate.getMinutes()},b.prototype.getHours=function(){return this.displayDate.getHours()},b.prototype.getDay=function(){return this.displayDate.getDay()},b.prototype.getDate=function(){return this.displayDate.getDate()},b.prototype.getMonth=function(){return this.displayDate.getMonth()},b.prototype.getFullYear=function(){return this.displayDate.getFullYear()},b.prototype.toLocaleString=function(e,t){return(null!=t&&t.timeZone?this.date:this.displayDate).toLocaleString(e,t)},b.prototype.toLocaleTimeString=function(e){return this.displayDate.toLocaleTimeString(e)},b.prototype.toLocaleDateString=function(e){return this.displayDate.toLocaleDateString(e)},b.prototype.getTimezoneOffset=function(){return this.timezoneOffset},b.prototype.getTimeZoneName=function(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0},b.prototype.getLongMonthName=function(){var e;return null!=(e=this.format({month:"long"}))?e:lt[this.getMonth()]},b.prototype.getShortMonthName=function(){var e;return null!=(e=this.format({month:"short"}))?e:ht[this.getMonth()]},b.prototype.getLongWeekdayName=function(){var e;return null!=(e=this.format({weekday:"long"}))?e:pt[this.displayDate.getDay()]},b.prototype.getShortWeekdayName=function(){var e;return null!=(e=this.format({weekday:"short"}))?e:ft[this.displayDate.getDay()]},b.prototype.valid=function(){return!isNaN(this.getTime())},b.prototype.format=function(e){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,e).format(this.displayDate)},b.createDateFixedToTimezone=function(e,t){var r,n,i=e.match(ct);return i&&"Z"===i[1]?new b(+new Date(e),t,0):i&&i[2]&&i[3]&&i[4]?(n=(i=ee(i,5))[2],r=i[3],i=i[4],n=("+"===n?-1:1)*(60*parseInt(r,10)+parseInt(i,10)),new b(+new Date(e),t,n)):new b(e,t)},b.getTimezoneOffset=function(e,t){e=t.toLocaleString("en-US",{timeZone:e}),t=t.toLocaleString("en-US",{timeZone:"UTC"}),e=new Date(e);return(+new Date(t)-+e)/6e4},b);function b(e,t,r){this.locale=t,this.DateTimeFormat=ut(),this.date=new Date(e),this.timezoneFixed=void 0!==r,void 0===r&&(r=this.date.getTimezoneOffset()),this.timezoneOffset=te(r)?b.getTimezoneOffset(r,this.date):r,this.timezoneName=te(r)?r:"";t=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),e=this.date.getTime()+t;this.displayDate=new Date(e)}vt.prototype.use=function(e){e=I(e),x(this.base+e<=this.limit,this.message),this.base+=e},vt.prototype.check=function(e){x((e=I(e))<=this.limit,this.message)};var yt=vt;function vt(e,t){this.base=0,this.message="".concat(e," limit exceeded"),this.limit=t}s(mt,gt=e),Object.defineProperty(mt.prototype,"content",{get:function(){return this.input.slice(this.contentRange[0],this.contentRange[1])},enumerable:!1,configurable:!0});var gt,r=mt;function mt(e,t,r,n,i,s,o,a){for(var t=ee(t,2),u=t[0],t=t[1],e=gt.call(this,e,r,n,i,a)||this,n=(e.trimLeft=!1,e.trimRight=!1,"-"===r[u]),i="-"===r[t-1],c=n?u+1:u,l=i?t-1:t;c<l&&h[r.charCodeAt(c)]ℜ)c++;for(;c<l&&h[r.charCodeAt(l-1)]ℜ)l--;return e.contentRange=[c,l],e.trimLeft=n||s,e.trimRight=i||o,e}s(kt,bt=r);var bt,wt=kt;function kt(e,t,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,u=ee([t+u.length,r-c.length],2),c=u[0],u=u[1];return(s=bt.call(this,l.TokenKind.Tag,[c,u],e,t,r,o,a,i)||this).tokenizer=new w(e,n.operators,i,s.contentRange),s.name=s.tokenizer.readTagName(),s.tokenizer.assert(s.name,"illegal tag syntax, tag name expected"),s.tokenizer.skipBlank(),s.args=s.tokenizer.input.slice(s.tokenizer.p,s.contentRange[1]),s}s(St,Tt=r);var Tt,xt=St;function St(e,t,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,n=n.outputDelimiterRight,a=[t+a.length,r-n.length];return Tt.call(this,l.TokenKind.Output,a,e,t,r,s,o,i)||this}s(Ot,Lt=e),Ot.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)};var Lt,Ft=Ot;function Ot(e,t,r,n){var i=Lt.call(this,l.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}s(Rt,_t=e);var _t,zt=Rt;function Rt(e,t,r,n){var i=_t.call(this,l.TokenKind.Number,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.content=Number(i.getText()),i}s(Et,jt=e);var jt,qt=Et;function Et(e,t,r,n){var i=jt.call(this,l.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}s(Mt,At=e);var At,Nt=Mt;function Mt(e,t,r,n){var i=At.call(this,l.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.content=Qe[i.literal],i}var Dt,Vt={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Pt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},Ct=(s(It,Dt=e),It.prototype.getPrecedence=function(){var e=this.getText();return e in Vt?Vt[e]:1},It);function It(e,t,r,n){var i=Dt.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(Ut,Bt=e);var Bt,Ht=Ut;function Ut(e,t,r,n,i,s){r=Bt.call(this,l.TokenKind.PropertyAccess,r,n,i,s)||this;return r.variable=e,r.props=t,r}s(Yt,Kt=e);var Kt,Wt=Yt;function Yt(e,t,r,n,i,s){r=Kt.call(this,l.TokenKind.Filter,r,n,i,s)||this;return r.name=e,r.args=t,r}s(Jt,$t=e);var $t,Zt=Jt;function Jt(e,t,r,n,i,s){var o=$t.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 Qt=/[\da-fA-F]/,Gt=/[0-7]/,Xt={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function er(e){e=e.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}s(nr,tr=e);var tr,rr=nr;function nr(e,t,r,n){var i=tr.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;r<e.length-1;r++)if("\\"!==e[r])t+=e[r];else if(void 0!==Xt[e[r+1]])t+=Xt[e[++r]];else if("u"===e[r+1]){for(var n=0,i=r+2;i<=r+5&&Qt.test(e[i]);)n=16*n+er(e[i++]);r=i-1,t+=String.fromCharCode(n)}else if(Gt.test(e[r+1])){for(i=r+1,n=0;i<=r+3&&Gt.test(e[i]);)n=8*n+er(e[i++]);r=i-1,t+=String.fromCharCode(n)}else t+=e[++r];return t}(i.getText()),i}s(or,ir=e);var ir,sr=or;function or(e,t,r,n,i,s){var o=ir.call(this,l.TokenKind.Range,e,t,r,s)||this;return o.input=e,o.begin=t,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}s(cr,ar=r),Object.defineProperty(cr.prototype,"args",{get:function(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])},enumerable:!1,configurable:!0});var ar,ur=cr;function cr(e,t,r,n,i){t=ar.call(this,l.TokenKind.Tag,[t,r],e,t,r,!1,!1,i)||this;return t.tokenizer=new w(e,n.operators,i,t.contentRange),t.name=t.tokenizer.readTagName(),t.tokenizer.assert(t.name,"illegal liquid tag syntax"),t.tokenizer.skipBlank(),t}s(pr,lr=e);var lr,hr=pr;function pr(e,t,r,n,i,s){var o=lr.call(this,l.TokenKind.FilteredValue,r,n,i,s)||this;return o.initial=e,o.filters=t,o.input=r,o.begin=n,o.end=i,o.file=s,o}var fr={now:function(){return Date.now()}};function dr(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||fr}vr.prototype.renderTemplatesToNodeStream=function(e,t){var r=this,n=new Ke;return Promise.resolve().then(function(){return f(r.renderTemplates(e,t,n))}).then(function(){return n.end()},function(e){return n.error(e)}),n.stream},vr.prototype.renderTemplates=function(t,r,n){var i,s,o,a,u,c,l,h;return G(this,function(e){switch(e.label){case 0:n=n||new(r.opts.keepOutputType?We:He),i=[],e.label=1;case 1:e.trys.push([1,8,9,10]),s=X(t),o=s.next(),e.label=2;case 2:if(o.done)return[3,7];a=o.value,r.renderLimit.check(dr().now()),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,a.render(r,n)];case 4:return(u=e.sent())&&n.write(u),r.breakCalled||r.continueCalled?[3,7]:[3,6];case 5:if(u=e.sent(),c=oe.is(u)?u:new ye(u,a),r.opts.catchAllErrors)return i.push(c),[3,6];throw c;case 6:return o=s.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&&(h=s.return)&&h.call(s)}finally{if(l)throw l.error}return[7];case 10:if(i.length)throw new me(i);return[2,n.buffer]}})};var yr=vr;function vr(){}mr.prototype.evaluate=function(t,r){var n,i,s,o,a,u,c,l,h,p,f;return G(this,function(e){switch(e.label){case 0:x(t,"unable to evaluate: context not defined"),n=[],e.label=1;case 1:e.trys.push([1,11,12,13]),i=X(this.postfix),s=i.next(),e.label=2;case 2:return s.done?[3,10]:Tn(o=s.value)?(a=n.pop(),u=void 0,1!==Pt[o.operator]?[3,4]:[4,t.opts.operators[o.operator](a,t)]):[3,7];case 3:return u=e.sent(),[3,6];case 4:return h=n.pop(),[4,t.opts.operators[o.operator](h,a,t)];case 5:u=e.sent(),e.label=6;case 6:return n.push(u),[3,9];case 7:return l=(c=n).push,[4,S(o,t,r)];case 8:l.apply(c,[e.sent()]),e.label=9;case 9:return s=i.next(),[3,2];case 10:return[3,13];case 11:return h=e.sent(),p={error:h},[3,13];case 12:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 13:return[2,n[0]]}})},mr.prototype.valid=function(){return!!this.postfix.length};var gr=mr;function mr(e){this.postfix=d([],ee(function(t){var r,n,i,s,o,a;return G(this,function(e){switch(e.label){case 0:r=[],e.label=1;case 1:e.trys.push([1,10,11,12]),n=X(t),i=n.next(),e.label=2;case 2:if(i.done)return[3,9];if(!Tn(s=i.value))return[3,6];e.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.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),G(this,function(e){switch(e.label){case 0:return t?"content"in t?[2,t.content]:_n(t)?[4,function(t,r,n){var i,s,o,a,u,c,l,h,p;return G(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),s=X(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 ke(l,t);case 15:return[2]}})}(t,r,n)]:[3,2]:[2];case 1:return[2,e.sent()];case 2:return Rn(t)?[4,function(t,r){var n,i;return G(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(),r.memoryLimit.use(i-n+1),[2,Y(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return[2]}})}function br(e){return e.content}function wr(e,t){return!kr(e,t)}function kr(e,t){return e=g(e),t.opts.jsTruthy?!e:!1===e||null==e}Pe={"==":Tr,"!=":function(e,t){return!Tr(e,t)},">":function(e,t){return p(e)?e.gt(t):p(t)?t.lt(e):g(e)>g(t)},"<":function(e,t){return p(e)?e.lt(t):p(t)?t.gt(e):g(e)<g(t)},">=":function(e,t){return p(e)?e.geq(t):p(t)?t.leq(e):g(e)>=g(t)},"<=":function(e,t){return p(e)?e.leq(t):p(t)?t.geq(e):g(e)<=g(t)},contains:function(e,t){return c(e=g(e))?e.some(function(e){return Tr(e,t)}):!!u(null==e?void 0:e.indexOf)&&-1<e.indexOf(g(t))},not:function(e,t){return kr(g(e),t)},and:function(e,t,r){return wr(g(e),r)&&wr(g(t),r)},or:function(e,t,r){return wr(g(e),r)||wr(g(t),r)}};function Tr(e,t){var r,n;return p(e)?e.equals(t):p(t)?t.equals(e):(e=g(e),t=g(t),c(e)?c(t)&&(n=t,(r=e).length===n.length)&&!r.some(function(e,t){return!Tr(e,n[t])}):e===t)}var xr=function(e,t,r,n){this.key=e,this.value=t,this.next=r,this.prev=n},Sr=(Lr.prototype.write=function(e,t){this.cache[e]?this.cache[e].value=t:(t=new xr(e,t,this.head.next,this.head),this.head.next.prev=t,this.head.next=t,this.cache[e]=t,this.size++,this.ensureLimit())},Lr.prototype.read=function(e){var t;if(this.cache[e])return t=this.cache[e].value,this.remove(e),this.write(e,t),t},Lr.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--},Lr.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},Lr.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},Lr);function Lr(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new xr("HEAD",null,null,null),this.tail=new xr("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function Fr(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}r=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==K(e)&&(e+="/"),Fr(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 G(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 G(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return Fr(e,".")},sep:"/"});function Or(e,t){return void 0===t&&(t=0),JSON.stringify(e,null,t)}var _r={default:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return c(e=g(e))||te(e)?e.length?e:t:(!1!==e||!new Map(r).get("allow_false"))&&(kr(e,this.context)?t:e)},raw:{raw:!0,handler:J},jsonify:Or,to_integer:function(e){return Number(e)},json:Or,inspect:function(e,t){void 0===t&&(t=0);var r=[];return JSON.stringify(e,function(e,t){if("object"==typeof t&&null!==t){for(;0<r.length&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t},t)}},zr={"&":"&","<":"<",">":">",'"':""","'":"'"},Rr={"&":"&","<":"<",">":">",""":'"',"'":"'"};function jr(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,function(e){return zr[e]})}var qr=Object.freeze({__proto__:null,escape:jr,xml_escape:function(e){return jr.call(this,e)},escape_once:function(e){return jr.call(this,function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,function(e){return Rr[e]})}.call(this,e))},newline_to_br:function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}}),Er=(Ar.prototype.exists=function(t){return a(this,void 0,void 0,function(){return G(this,function(e){return[2,this.existsSync(t)]})})},Ar.prototype.existsSync=function(e){return!o(this.mapping[e])},Ar.prototype.readFile=function(t){return a(this,void 0,void 0,function(){return G(this,function(e){return[2,this.readFileSync(t)]})})},Ar.prototype.readFileSync=function(e){var t=this.mapping[e];if(o(t))throw new Error("ENOENT: ".concat(e));return t},Ar.prototype.dirname=function(e){e=e.split(this.sep);return e.pop(),e.join(this.sep)},Ar.prototype.resolve=function(e,t,r){var n,i;if(t+=r,"."===e)return t;var s=e.split(/\/+/);try{for(var o=X(t.split(this.sep)),a=o.next();!a.done;a=o.next()){var u=a.value;"."!==u&&""!==u&&(".."===u?(1<s.length||""!==s[0])&&s.pop():s.push(u))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s.join(this.sep)},Ar);function Ar(e){this.mapping=e,this.sep="/"}var Nr={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:r,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",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:Pe,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function Mr(e){var t,r;return e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")&&(r=void 0,r="number"==typeof e.cache?0<e.cache?new Sr(e.cache):void 0:"object"==typeof e.cache?e.cache:e.cache?new Sr(1024):void 0,e.cache=r),(e=T(T(T({},Nr),e.jekyllInclude?{dynamicPartials:!1}:{}),e)).fs.dirname&&e.fs.sep||!e.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),e.relativeReference=!1),e.root=Dr(e.root),e.partials=Dr(e.partials),e.layouts=Dr(e.layouts),e.outputEscape=e.outputEscape&&("escape"===(r=e.outputEscape)?jr:"json"===r?_r.json:(x(u(r),"`outputEscape` need to be of type string or function"),r)),e.locale||(e.locale=null!=(t=null==(t=ut())?void 0:t().resolvedOptions().locale)?t:"en-US"),e.templates&&(e.fs=new Er(e.templates),e.relativeReference=!0,e.root=e.partials=e.layouts="."),e}function Dr(e){var t=[];return c(e)&&(t=e),t=te(e)?[e]:t}function Vr(e,t){for(var r=!1,n=0;n<e.length;n++){var i=e[n];if(kn(i)){if(!r&&i.trimLeft){a=o=s=void 0;var s=e[n-1],o=t.greedy;if(s&&xn(s))for(var a=o?Re:je;h[s.input.charCodeAt(s.end-1-s.trimRight)]&a;)s.trimRight++}if(Ln(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight){c=o=u=void 0;var u=e[n+1],o=t.greedy;if(u&&xn(u)){for(var c=o?Re:je;h[u.input.charCodeAt(u.begin+u.trimLeft)]&c;)u.trimLeft++;"\n"===u.input.charAt(u.begin+u.trimLeft)&&u.trimLeft++}}}}}k.prototype.readExpression=function(){return new gr(this.readExpressionTokens())},k.prototype.readExpressionTokens=function(){var t;return G(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(t=this.readValue())?[4,t]:[3,4];case 3:return e.sent(),[3,0];case 4:case 5:return[2]}})},k.prototype.readOperator=function(){this.skipBlank();var e=this.matchTrie(this.opTrie);if(-1!==e)return new Ct(this.input,this.p,this.p=e,this.file)},k.prototype.matchTrie=function(e){for(var t,r=e,n=this.p;r[this.input[n]]&&n<this.N;)(r=r[this.input[n++]]).end&&(t=r);return!t||t.needBoundary&&qe(this.peek(n-this.p))?-1:n},k.prototype.readFilteredValue=function(){var e=this.p,t=this.readExpression(),r=(this.assert(t.valid(),"invalid value expression: ".concat(this.snapshot())),this.readFilters());return new hr(t,r,this.input,e,this.p,this.file)},k.prototype.readFilters=function(){for(var e=[];;){var t=this.readFilter();if(!t)return e;e.push(t)}},k.prototype.readFilter=function(){var e=this;if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');var t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;var r=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var n=this.readFilterArg()}while(n&&r.push(n),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),function(){return"unexpected character ".concat(e.snapshot())}),","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new Wt(t.getText(),r,this.input,t.begin,this.p,this.file)},k.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]}},k.prototype.readTopLevelTokens=function(e){void 0===e&&(e=Nr);for(var t=[];this.p<this.N;){var r=this.readTopLevelToken(e);t.push(r)}return Vr(t,e),t},k.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])},k.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 Ft(this.input,r,this.p,this.file)},k.prototype.readTagToken=function(e){var t=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(e.tagDelimiterRight))throw this.error("tag ".concat(this.snapshot(n)," not closed"),n);r=new wt(r,n,this.p,e,t);return"raw"===r.name&&(this.rawBeginAt=n),r},k.prototype.readToDelimiter=function(e,t){for(void 0===t&&(t=!1),this.skipBlank();this.p<this.N;)if(t&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(e))return this.p;return-1},k.prototype.readOutputToken=function(e){void 0===e&&(e=Nr);var t=this.file,r=this.input,n=e.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n,!0))throw this.error("output ".concat(this.snapshot(i)," not closed"),i);return new xt(r,i,this.p,e,t)},k.prototype.readEndrawOrRawContent=function(e){for(var t,r=e.tagDelimiterLeft,n=e.tagDelimiterRight,i=this.p,s=this.readTo(r)-r.length;this.p<this.N;)if("endraw"!==this.readIdentifier().getText())s=this.readTo(r)-r.length;else for(;this.p<=this.N;){if(this.rmatch(n))return t=this.p,i===s?(this.rawBeginAt=-1,new wt(this.input,i,t,e,this.file)):(this.p=s,new Ft(this.input,i,s,this.file));if(this.rmatch(r))break;this.p++}throw this.error("raw ".concat(this.snapshot(this.rawBeginAt)," not closed"),i)},k.prototype.readLiquidTagTokens=function(e){void 0===e&&(e=Nr);for(var t=[];this.p<this.N;){var r=this.readLiquidTagToken(e);r&&t.push(r)}return t},k.prototype.readLiquidTagToken=function(e){var t,r;if(this.skipBlank(),!this.end())return t=this.p,this.readToDelimiter("\n"),r=this.p,new ur(this.input,t,r,e,this.file)},k.prototype.error=function(e,t){return void 0===t&&(t=this.p),new ce(e,new qt(this.input,t,this.N,this.file))},k.prototype.assert=function(e,t,r){if(!e)throw this.error("function"==typeof t?t():t,r)},k.prototype.snapshot=function(e){return void 0===e&&(e=this.p),JSON.stringify((e=this.input.slice(e,this.N),t=32,e.length>t?e.slice(0,t-3)+"...":e));var t},k.prototype.readWord=function(){return this.readIdentifier()},k.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;!this.end()&&qe(this.peek());)++this.p;return new qt(this.input,e,this.p,this.file)},k.prototype.readNonEmptyIdentifier=function(){var e=this.readIdentifier();return e.size()?e:void 0},k.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},k.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},k.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t,r=this.p,n=this.readNonEmptyIdentifier();if(n)return this.skipBlank(),e=te(e)?e:e?"=":":",this.peek()===e&&(++this.p,t=this.readValue()),new Zt(this.input,r,this.p,n,t,this.file)},k.prototype.remaining=function(){return this.input.slice(this.p,this.N)},k.prototype.advance=function(e){this.p+=e=void 0===e?1:e},k.prototype.end=function(){return this.p>=this.N},k.prototype.read=function(){return this.input[this.p++]},k.prototype.readTo=function(e){for(;this.p<this.N;)if(++this.p,this.rmatch(e))return this.p;return-1},k.prototype.readValue=function(){this.skipBlank();var e=this.p,t=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),r=this.readProperties(!t);return r.length?new Ht(t,r,this.input,e,this.p):t},k.prototype.readScopeValue=function(){this.skipBlank();var e=this.p,t=this.readProperties();if(t.length)return new Ht(void 0,t,this.input,e,this.p)},k.prototype.readProperties=function(e){void 0===e&&(e=!0);for(var t=[];;){if("["===this.peek()){this.p++;var r=this.readValue()||new qt(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed")}else{if(e&&!t.length)if(r=this.readNonEmptyIdentifier()){t.push(r);continue}if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(r=this.readNonEmptyIdentifier()))break}t.push(r)}return t},k.prototype.readNumber=function(){this.skipBlank();var e,t=!1,r=!1,n=0;for(64&this.peekType()&&n++;this.p+n<=this.N;){if(32&this.peekType(n))r=!0;else{if("."!==this.peek(n)||"."===this.peek(n+1))break;if(t||!r)return;t=!0}n++}if(r&&!qe(this.peek(n)))return e=new zt(this.input,this.p,this.p+n,this.file),this.advance(n),e},k.prototype.readLiteral=function(){this.skipBlank();var e,t=this.matchTrie(this.literalTrie);if(-1!==t)return e=new Nt(this.input,this.p,t,this.file),this.p=t,e},k.prototype.readRange=function(){this.skipBlank();var e,t,r=this.p;if("("===this.peek())return++this.p,e=this.readValueOrThrow(),this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax"),t=this.readValueOrThrow(),this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new sr(this.input,r,this.p,e,t,this.file)},k.prototype.readValueOrThrow=function(){var e=this,t=this.readValue();return this.assert(t,function(){return"unexpected token ".concat(e.snapshot(),", value expected")}),t},k.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 rr(this.input,e,this.p,this.file)}},k.prototype.readFileNameTemplate=function(t){var r,n,i;return G(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]}})},k.prototype.match=function(e){for(var t=0;t<e.length;t++)if(e[t]!==this.input[this.p+t])return!1;return!0},k.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},k.prototype.peekType=function(e){return this.p+(e=void 0===e?0:e)>=this.N?0:h[this.input.charCodeAt(this.p+e)]},k.prototype.peek=function(e){return this.p+(e=void 0===e?0:e)>=this.N?"":this.input[this.p+e]},k.prototype.skipBlank=function(){for(;this.peekType()ℜ)++this.p};var w=k;function k(e,t,r,n){void 0===t&&(t=Nr.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=Ge(t),this.literalTrie=Ge(Qe)}Cr.prototype.on=function(e,t){return this.handlers[e]=t,this},Cr.prototype.trigger=function(e,t){e=this.handlers[e];return!!e&&(e.call(this,t),!0)},Cr.prototype.start=function(){var e,t;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)this.trigger("token",e)||Ln(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},Cr.prototype.stop=function(){return this.stopRequested=!0,this};var Pr=Cr;function Cr(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function Ir(e){this.token=e}s(Hr,Br=Ir);var Br,L=Hr;function Hr(e,t,r){var n=Br.call(this,e)||this;return n.name=e.name,n.liquid=r,n.tokenizer=e.tokenizer,n}Kr.prototype.render=function(t){var r,n,i,s,o,a,u,c,l;return G(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=X(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 Ur=Kr;function Kr(e,t){this.hash={};var r,n,e=e instanceof w?e:new w(e,{});try{for(var i=X(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}}}function Wr(e){return c(e)}$r.prototype.render=function(t,r){var n,i,s,o,a,u,c,l,h,p,f;return G(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=X(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:Wr(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,token:this.token,liquid:this.liquid},d([t],ee(n),!1))];case 11:return[2,e.sent()]}})};var Yr=$r;function $r(e,t,r){this.token=e,this.name=e.name,this.handler=u(t)?t:u(null==t?void 0:t.handler)?t.handler:J,this.raw=!u(t)&&!(null==t||!t.raw),this.args=e.args,this.liquid=r}Zr.prototype.value=function(t,r){var n,i,s,o,a;return G(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=X(this.filters),s=i.next(),e.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,t)];case 4:n=e.sent(),e.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=e.sent(),o={error:o},[3,9];case 8:try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}return[7];case 9:return[2,n]}})},Zr.prototype.getFilter=function(e,t){var r=e.filters[t];return x(r||!e.options.strictFilters,function(){return"undefined filter: ".concat(t)}),r};var F=Zr;function Zr(e,t){var r=this,e=(this.filters=[],"string"==typeof e?new w(e,t.options.operators).readFilteredValue():e);this.initial=e.initial,this.filters=e.filters.map(function(e){return new Yr(e,r.getFilter(t,e.name),t)})}s(Gr,Jr=Ir),Gr.prototype.render=function(t,r){var n;return G(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]}})},Gr.prototype.arguments=function(){return G(this,function(e){switch(e.label){case 0:return[4,this.value];case 1:return e.sent(),[2]}})};var Jr,Qr=Gr;function Gr(e,t){var r,n=this,n=Jr.call(this,e)||this,e=new w(e.input,t.options.operators,e.file,e.contentRange),e=(n.value=new F(e.readFilteredValue(),t),n.value.filters),i=t.options.outputEscape;return null!=(r=e[e.length-1])&&r.raw||!i||(r=new Wt(toString.call(i),[],"",0,0),e.push(new Yr(r,i,t))),n}s(tn,Xr=Ir),tn.prototype.render=function(e,t){return G(this,function(e){return t.write(this.str),[2]})};var Xr,en=tn;function tn(e){var t=Xr.call(this,e)||this;return t.str=e.getContent(),t}nn.prototype.toString=function(){return vn(this.segments,!0)},nn.prototype.toArray=function(){function a(){for(var t,r,n,i,s,o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];return G(this,function(e){switch(e.label){case 0:e.trys.push([0,7,8,9]),t=X(o),r=t.next(),e.label=1;case 1:return r.done?[3,6]:(n=r.value)instanceof nn?[4,Array.from(a.apply(void 0,d([],ee(n.segments),!1)))]:[3,3];case 2:return e.sent(),[3,5];case 3:return[4,n];case 4:e.sent(),e.label=5;case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return i=e.sent(),i={error:i},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}return[7];case 9:return[2]}})}return Array.from(a.apply(void 0,d([],ee(this.segments),!1)))};var rn=nn;function nn(e,t){this.segments=e,this.location=t}on.prototype.get=function(e){e=vn([e.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)},on.prototype.has=function(e){return this.map.has(vn([e.segments[0]]))},on.prototype.push=function(e){this.get(e).push(e)},on.prototype.asObject=function(){return Object.fromEntries(this.map)};var sn=on;function on(){this.map=new Map}var an={partials:!0};function un(t,U,K){function W(t,r){var n,i,s,o,a,u,c,l,h,p,f,d,y,v,g,m,b,w,k,T,x,S,L,F,O,_,z,R,D,j,V,q,P,E,C,A,I,N,B,M,H;return G(this,function(e){switch(e.label){case 0:if(t.arguments)try{for(n=X(t.arguments()),i=n.next();!i.done;i=n.next()){s=i.value;try{for(j=void 0,o=X(pn(s)),a=o.next();!a.done;a=o.next())!function e(t,r){Y.push(t);var n,i,s,o=r.alias(t);void 0!==o?te(s=o.segments[0])&&!J.has(s)&&$.push(o):te(s=t.segments[0])&&!r.has(s)&&$.push(t);try{for(var a=X(t.segments),u=a.next();!u.done;u=a.next()){var c=u.value;c instanceof rn&&e(c,r)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}(a.value,r)}catch(e){j={error:e}}finally{try{a&&!a.done&&(V=o.return)&&V.call(o)}finally{if(j)throw j.error}}}}catch(e){R={error:e}}finally{try{i&&!i.done&&(D=n.return)&&D.call(n)}finally{if(R)throw R.error}}if(t.localScope)try{for(u=X(t.localScope()),c=u.next();!c.done;c=u.next())l=c.value,r.add(l.content),r.deleteAlias(l.content),h=ee(l.getPosition(),2),p=h[0],f=h[1],Z.push(new rn([l.content],{row:p,col:f,file:l.file}))}catch(e){q={error:e}}finally{try{c&&!c.done&&(P=u.return)&&P.call(u)}finally{if(q)throw q.error}}if(!t.children)return[3,30];if(!t.partialScope)return[3,20];if(void 0!==(d=t.partialScope()))return[3,10];e.label=1;case 1:return e.trys.push([1,7,8,9]),[4,t.children(U,K)];case 2:y=X.apply(void 0,[e.sent()]),v=y.next(),e.label=3;case 3:return v.done?[3,6]:[4,W(v.value,r)];case 4:e.sent(),e.label=5;case 5:return v=y.next(),[3,3];case 6:return[3,9];case 7:return E=e.sent(),E={error:E},[3,9];case 8:try{v&&!v.done&&(C=y.return)&&C.call(y)}finally{if(E)throw E.error}return[7];case 9:return[2];case 10:if(Q.has(d.name))return[2];g=new Set,m=d.isolated?new ln(g):r.push(g);try{for(b=X(d.scope),w=b.next();!w.done;w=b.next())te(k=w.value)?g.add(k):(T=ee(k,2),x=T[0],S=T[1],g.add(x),(L=Array.from(pn(S))).length&&m.setAlias(x,L[0].segments))}catch(e){A={error:e}}finally{try{w&&!w.done&&(I=b.return)&&I.call(b)}finally{if(A)throw A.error}}e.label=11;case 11:return e.trys.push([11,17,18,19]),[4,t.children(U,K)];case 12:F=X.apply(void 0,[e.sent()]),O=F.next(),e.label=13;case 13:return O.done?[3,16]:[4,W(O.value,m)];case 14:e.sent(),Q.add(d.name),e.label=15;case 15:return O=F.next(),[3,13];case 16:return[3,19];