UNPKG

directus-extension-texttoanything

Version:

Generate PDF`s/QRcodes/Barcodes or use OCR within Directus!

1 lines 497 kB
import{defineOperationApp as t,useStores as e,useApi as i,defineModule as s,defineInterface as n}from"@directus/extensions-sdk";import*as a from"vue";import{resolveComponent as r,openBlock as o,createBlock as l,withCtx as h,createVNode as c,createCommentVNode as d,ref as u,createElementBlock as p,createTextVNode as g,pushScopeId as f,popScopeId as m,createElementVNode as v,defineComponent as b,computed as y,watch as w,nextTick as x,onMounted as A,unref as _,toDisplayString as S,normalizeStyle as T,Fragment as k,resolveDynamicComponent as C,createSlots as E,resolveDirective as M,renderList as P,normalizeClass as D,withDirectives as I,inject as R,onBeforeUnmount as L,withModifiers as F,reactive as N,onUnmounted as O,Teleport as B,renderSlot as z}from"vue";var j=t({id:"ttabarcode",name:"TTA generate barcode",icon:"barcode",description:"Generate a barcode trough Text to anything!",overview:({barcodeContent:t})=>[{label:"barcode content",text:t}],options:[{field:"barcodeContent",name:"content",type:"string",meta:{width:"full",interface:"input"}},{field:"barcodeType",name:"type",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:["auspost","azteccode","azteccodecompact","aztecrune","bc412","channelcode","codablockf","code11","code128","code16k","code2of5","code32","code39","code39ext","code49","code93","code93ext","codeone","coop2of5","daft","databarexpanded","databarexpandedcomposite","databarexpandedstacked","databarexpandedstackedcomposite","databarlimited","databarlimitedcomposite","databaromni","databaromnicomposite","databarstacked","databarstackedcomposite","databarstackedomni","databarstackedomnicomposite","databartruncated","databartruncatedcomposite","datalogic2of5","datamatrix","datamatrixrectangular","datamatrixrectangularextension","dotcode","ean13","ean13composite","ean14","ean2","ean5","ean8","ean8composite","flattermarken","gs1-128","gs1-128composite","gs1-cc","gs1datamatrix","gs1datamatrixrectangular","gs1dldatamatrix","gs1dlqrcode","gs1dotcode","gs1northamericancoupon","gs1qrcode","hanxin","hibcazteccode","hibccodablockf","hibccode128","hibccode39","hibcdatamatrix","hibcdatamatrixrectangular","hibcmicropdf417","hibcpdf417","hibcqrcode","iata2of5","identcode","industrial2of5","interleaved2of5","isbn","ismn","issn","itf14","japanpost","kix","leitcode","mailmark","mands","matrix2of5","maxicode","micropdf417","microqrcode","msi","onecode","pdf417","pdf417compact","pharmacode","pharmacode2","planet","plessey","posicode","postnet","pzn","qrcode","rationalizedCodabar","raw","rectangularmicroqrcode","royalmail","sscc18","swissqrcode","symbol","telepen","telepennumeric","ultracode","upca","upcacomposite","upce","upcecomposite"].map((t=>({text:t,value:t})))}}},{field:"scale",name:"scale",type:"number",meta:{width:"full",interface:"input"}},{field:"height",name:"height",type:"number",meta:{width:"full",interface:"input"}},{field:"includetext",name:"include text",type:"boolean",meta:{width:"full",interface:"boolean"}}]}),V=t({id:"ttapdf",name:"TTA generate PDF",icon:"picture_as_pdf",description:"Generate a PDF trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"pdfoptions",name:"Options",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json",placeholder:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2),template:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2)}}}]}),H=t({id:"ttapdftemplate",name:"TTA generate PDF from template",icon:"picture_as_pdf",description:"Generate a PDF based on a template trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"template",name:"Template",type:"string",meta:{interface:"TTA-pdf-template-selector",options:{}}},{field:"templatevariables",name:"Template variables",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json"}}}]}),$=t({id:"ttaqrcode",name:"TTA generate QRcode",icon:"qr_code",description:"Generate a QRcode trough Text to anything!",overview:({content:t})=>[{label:"QRCode content",text:t}],options:[{field:"content",name:"QRCode content",type:"string",meta:{width:"full",interface:"input"}},{field:"lightColor",name:"Light color",type:"string",meta:{width:"full",interface:"input"}},{field:"darkColor",name:"Dark color",type:"string",meta:{width:"full",interface:"input"}},{field:"margin",name:"Margin",type:"integer",meta:{width:"half",interface:"input"}},{field:"width",name:"Width",type:"integer",meta:{width:"half",interface:"input"}}]});const U=String.raw`[A-Za-z][^/\s>]*`,G=String.raw`\B"(?:\\[^<>\n]|[^\\"<>\n])*"(?!\w)`,q=String.raw`\B'(?:\\[^<>\n]|[^\\'<>\n])*'(?!\w)`,W=String.raw`${G}|${q}`,K=String.raw`"(?<quotedAttrValue>[^"]*)"`,X=String.raw`'(?<singleQuotedAttrValue>[^']*)'`,Y=String.raw`(?<unquotedAttrValue>[^\s"'\`=<>]+)`,Q=String.raw`[^=\s>/"']+(?=[=>\s]|$)`,J=String.raw`${K}|${X}|${Y}`,Z=String.raw`(?<attrName>${Q})(?:\s*=\s*(?:${J}))?`,tt=String.raw`${W}|[^\s>]*[^\s>/]|[^\s>]*/(?!\s*>)`,et=String.raw`(?<attrSpace>\s*)(?:${Z}|(?<attrText>${tt}))`,it={comment:String.raw`<!--.*?-->`,dtd:String.raw`<![^>]+>`,startTag:String.raw`<(?<startTagName>${U})(?<attrs>(?:${et})*)\s*(?<closingSlash>/?)\s*>`,endTag:String.raw`</(?<endTagName>${U})\s*>`,space:String.raw`\s+`,text:String.raw`[^<\s"']+|${W}|['"]`,wildcard:String.raw`.`},st=Object.entries(it).map((([t,e])=>`(?<${t}>${e})`)).join("|");const nt=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]);function at(t,e=" ",i=80){const s=new RegExp(st,"gys"),n=new RegExp(et,"gy"),a=[];let r=null,o=0,l=0,h="",c=0,d="";const u=()=>{if(d&&"\n"!=d){const t=h.indexOf("\n"),e=-1==t?h.length:t;l+d.length+e>i&&(d="\n")}const t="\n"==d&&h?e.repeat(c):"",s=`${d}${t}${h}`;if(s){const t=s.lastIndexOf("\n");-1==t?l+=s.length:l=s.length-t-1,a.push(s)}h=d=""},p=(...t)=>{for(const e of t)!r&&/^\s+$/.test(e)?(u(),d=e):(h||(c=o),h+=e)};for(const e of function*(t,e){let i,{lastIndex:s}=t;for(;i=t.exec(e);)yield i,({lastIndex:s}=t);if(s!=e.length)throw new Error("Failed to parse string")}(s,t)){if(at.__strict&&e.groups.wildcard)throw new Error("Unexpected wildcard");if(e.groups.endTag){const t=e.groups.endTagName.toLowerCase();t==r&&(r=null),r||(--o,p(`</${t}>`))}if(r)p(e[0]);else if(e.groups.space)p(...e[0].match(/\n/g)?.slice(0,2)??[" "]);else if(e.groups.comment||e.groups.dtd||e.groups.text||e.groups.wildcard)p(e[0]);else if(e.groups.startTag){const t=e.groups.startTagName.toLowerCase();if(p(`<${t}`),++o,e.groups.attrs){let t,i,{lastIndex:s}=n;for(;t=n.exec(e.groups.attrs);){if(({lastIndex:s}=n),at.__strict&&t.groups.attrText)throw new Error("Unexpected attr text");t.groups.attrText?(t.groups.attrSpace&&p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(t.groups.attrText)):(!t.groups.attrSpace&&i?.groups.attrText||p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(`${t.groups.attrName}${t.groups.quotedAttrValue?`="${t.groups.quotedAttrValue}"`:t.groups.singleQuotedAttrValue?`='${t.groups.singleQuotedAttrValue}'`:t.groups.unquotedAttrValue?`=${t.groups.unquotedAttrValue}`:""}`)),i=t}if(s!=e.groups.attrs.length)throw new Error("Failed to parse attributes")}const i=Boolean(e.groups.closingSlash);p(i?" />":">"),i||nt.has(t)?--o:["pre","textarea","script","style"].includes(t)&&(r=t)}}u();let g=!1;for(;/^\s+$/.test(a[a.length-1]);){const t=a.pop();/\n/.test(t)&&(g=!0)}return g&&a.push("\n"),a.join("")}at.default=at;var rt=at;class ot{constructor(t,e,i,s,n){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=n}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class lt{liquidMethodMissing(t){}}const ht=Object.prototype.toString,ct=String.prototype.toLowerCase,dt=Object.hasOwnProperty;function ut(t){return"string"==typeof t}function pt(t){return"function"==typeof t}function gt(t){return t&&pt(t.then)}function ft(t){return t&&pt(t.next)&&pt(t.throw)&&pt(t.return)}function mt(t){return ut(t=yt(t))?t:_t(t)?"":St(t)?t.map((t=>mt(t))).join(""):String(t)}function vt(t){return St(t=yt(t))?t:ut(t)&&t.length>0?[t]:Et(e=t)&&Symbol.iterator in e?Array.from(t):Et(t)?Object.keys(t).map((e=>[e,t[e]])):[];var e}function bt(t){return _t(t=yt(t))?[]:St(t)?t:[t]}function yt(t){return t instanceof lt&&pt(t.valueOf)?t.valueOf():t}function wt(t){return t=Number(t),isNaN(t)?0:t}function xt(t){return"number"==typeof t}function At(t){return t&&pt(t.toLiquid)?At(t.toLiquid()):t}function _t(t){return null==t}function St(t){return"[object Array]"===ht.call(t)}function Tt(t){return t&&xt(t.length)}function kt(t,e){t=t||{};for(const i in t)if(dt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Ct(t){return t[t.length-1]}function Et(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Mt(t,e,i=1){const s=[];for(let n=t;n<e;n+=i)s.push(n);return s}function Pt(t,e,i=" "){return Dt(t,e,i,((t,e)=>e+t))}function Dt(t,e,i,s){let n=e-(t=String(t)).length;for(;n-- >0;)t=s(t,i);return t}function It(t){return t}function Rt(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=ct.call(t))<(e=ct.call(e))?-1:t>e?1:0}function Lt(t){return function(...e){return t.call(this,...e.map(yt))}}function Ft(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*Nt(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const Ot="__liquidClass__";class Bt extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,Ot,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:qt(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[Ot])}}class zt extends Bt{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class jt extends Bt{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Vt extends Bt{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class Ht extends Bt{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class $t extends Bt{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class Ut extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class Gt extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function qt(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),n=Math.max(e-2,1),a=Math.min(e+3,s.length);return Mt(n,a+1).map((t=>{let n=`${t===e?">> ":" "}${Pt(String(t),String(a).length)}| `;const r=t===e?"\n"+Pt("^",i+n.length):"";return n+=s[t-1],n+=r,n})).join("\n")}const Wt=[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];function Kt(t){const e=t.charCodeAt(0);return e>=128?!Wt[e]:!!(1&Wt[e])}function Xt(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new Gt(i)}}function Yt(t,e=`unexpected ${JSON.stringify(t)}`){Xt(!t,e)}Wt[160]=Wt[5760]=Wt[6158]=Wt[8192]=Wt[8193]=Wt[8194]=Wt[8195]=Wt[8196]=Wt[8197]=Wt[8198]=Wt[8199]=Wt[8200]=Wt[8201]=Wt[8202]=Wt[8232]=Wt[8233]=Wt[8239]=Wt[8287]=Wt[12288]=4,Wt[8220]=Wt[8221]=128;class Qt extends lt{equals(t){return!(t instanceof Qt)&&(ut(t=yt(t))||St(t)?0===t.length:!!Et(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof Qt}}class Jt extends Qt{equals(t){return!1===t||(!!_t(yt(t))||(ut(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof Jt}}class Zt extends lt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class te{constructor(){this.buffer=""}write(t){this.buffer+=mt(t)}}class ee{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class ie{constructor(){this.buffer=""}write(t){"string"!=typeof(t=yt(t))&&""===this.buffer?this.buffer=t:this.buffer=mt(this.buffer)+mt(t)}}class se extends lt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new te;return yield this.superBlockRender(t),t.buffer}}function ne(t){return t&&pt(t.equals)&&pt(t.gt)&&pt(t.geq)&&pt(t.lt)&&pt(t.leq)}const ae=new class extends lt{equals(t){return _t(yt(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},re={true:!0,false:!1,nil:ae,null:ae,empty:new Qt,blank:new Jt};function oe(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&Kt(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var le=function(){return le=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},le.apply(this,arguments)};function he(t,e,i,s){return new(i||(i=Promise))((function(n,a){function r(t){try{l(s.next(t))}catch(t){a(t)}}function o(t){try{l(s.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((s=s.apply(t,e||[])).next())}))}function ce(t){return he(this,void 0,void 0,(function*(){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);i=n.done,e=n.value,s="next";try{ft(e)&&(e=ce(e)),gt(e)&&(e=yield e)}catch(t){s="throw",e=t}}while(!i);return e}))}function de(t){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);if(i=n.done,e=n.value,s="next",ft(e))try{e=de(e)}catch(t){s="throw",e=t}}while(!i);return e}const ue=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function pe(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function ge(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=pe(t)[i];return e+t.getDate()}function fe(t,e){const i=ge(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const me={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},ve=new Set("aAbBceklpP");function be(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),n=i%60;return(t.getTimezoneOffset()>0?"-":"+")+Pt(s,2,"0")+(e.flags[":"]?":":"")+Pt(n,2,"0")}const ye={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>ge(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return Dt(t,e,i,((t,e)=>t+e))}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([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"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>fe(t,0),w:t=>t.getDay(),W:t=>fe(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:be,Z:(t,e)=>t.getTimeZoneName()||be(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function we(t,e){let i,s="",n=e;for(;i=ue.exec(n);)s+=n.slice(0,i.index),n=n.slice(i.index+i[0].length),s+=xe(t,i);return s+n}function xe(t,e){const[i,s="",n,a,r]=e,o=ye[r];if(!o)return i;const l={};for(const t of s)l[t]=!0;let h=String(o(t,{flags:l,width:n,modifier:a})),c=ve.has(r)?" ":"0",d=n||me[r]||0;var u;return l["^"]?h=h.toUpperCase():l["#"]&&(u=h,h=[...u].some((t=>t>="a"&&t<="z"))?u.toUpperCase():u.toLowerCase()),l._?c=" ":l[0]&&(c="0"),l["-"]&&(d=0),Pt(h,d,c)}function Ae(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}ye.h=ye.b;const _e=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,Se=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=Se.map((t=>t.slice(0,3))),ke=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ce=ke.map((t=>t.slice(0,3)));class Ee{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Ae(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=ut(i)?Ee.getTimezoneOffset(i,this.date):i,this.timezoneName=ut(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),n=this.date.getTime()+s;this.displayDate=new Date(n)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:Se[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Te[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:ke[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ce[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(_e);if(i&&"Z"===i[1])return new Ee(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,n,a]=i,r=("+"===s?-1:1)*(60*parseInt(n,10)+parseInt(a,10));return new Ee(+new Date(t),e,r)}return new Ee(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),n=new Date(i);return(+new Date(s)-+n)/6e4}}class Me{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=wt(t),Xt(this.base+t<=this.limit,this.message),this.base+=t}check(t){Xt((t=wt(t))<=this.limit,this.message)}}class Pe extends ot{constructor(t,[e,i],s,n,a,r,o,l){super(t,s,n,a,l),this.trimLeft=!1,this.trimRight=!1;const h="-"===s[e],c="-"===s[i-1];let d=h?e+1:e,u=c?i-1:i;for(;d<u&&4&Wt[s.charCodeAt(d)];)d++;for(;u>d&&4&Wt[s.charCodeAt(u-1)];)u--;this.contentRange=[d,u],this.trimLeft=h||r,this.trimRight=c||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class De extends Pe{constructor(t,e,i,s,n){const{trimTagLeft:a,trimTagRight:r,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[h,c]=[e+o.length,i-l.length];super(Wi.Tag,[h,c],t,e,i,a,r,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ie extends Pe{constructor(t,e,i,s,n){const{trimOutputLeft:a,trimOutputRight:r,outputDelimiterLeft:o,outputDelimiterRight:l}=s,h=[e+o.length,i-l.length];super(Wi.Output,h,t,e,i,a,r,n)}}class Re extends ot{constructor(t,e,i,s){super(Wi.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class Le extends ot{constructor(t,e,i,s){super(Wi.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class Fe extends ot{constructor(t,e,i,s){super(Wi.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class Ne extends ot{constructor(t,e,i,s){super(Wi.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=re[this.literal]}}const Oe={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Be={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class ze extends ot{constructor(t,e,i,s){super(Wi.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in Oe?Oe[t]:1}}class je extends ot{constructor(t,e,i,s,n,a){super(Wi.PropertyAccess,i,s,n,a),this.variable=t,this.props=e}}class Ve extends ot{constructor(t,e,i,s,n,a){super(Wi.Filter,i,s,n,a),this.name=t,this.args=e}}class He extends ot{constructor(t,e,i,s,n,a){super(Wi.Hash,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=n,this.file=a}}const $e=/[\da-fA-F]/,Ue=/[0-7]/,Ge={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function qe(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class We extends ot{constructor(t,e,i,s){super(Wi.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==Ge[t[i+1]])e+=Ge[t[++i]];else if("u"===t[i+1]){let s=0,n=i+2;for(;n<=i+5&&$e.test(t[n]);)s=16*s+qe(t[n++]);i=n-1,e+=String.fromCharCode(s)}else if(Ue.test(t[i+1])){let s=i+1,n=0;for(;s<=i+3&&Ue.test(t[s]);)n=8*n+qe(t[s++]);i=s-1,e+=String.fromCharCode(n)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class Ke extends ot{constructor(t,e,i,s,n,a){super(Wi.Range,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=n,this.file=a}}class Xe extends Pe{constructor(t,e,i,s,n){super(Wi.Tag,[e,i],t,e,i,!1,!1,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ye extends ot{constructor(t,e,i,s,n,a){super(Wi.FilteredValue,i,s,n,a),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=n,this.file=a}}const Qe={now:()=>Date.now()};function Je(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||Qe}class Ze{renderTemplatesToNodeStream(t,e){const i=new ee;return Promise.resolve().then((()=>ce(this.renderTemplates(t,e,i)))).then((()=>i.end()),(t=>i.error(t))),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new ie:new te);const s=[];for(const n of t){e.renderLimit.check(Je().now());try{const t=yield n.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(t){const i=Bt.is(t)?t:new Vt(t,n);if(!e.opts.catchAllErrors)throw i;s.push(i)}}if(s.length)throw new Ht(s);return i.buffer}}class ti{constructor(t){this.postfix=[...ii(t)]}*evaluate(t,e){Xt(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Qi(s)){const e=i.pop();let n;if(1===Be[s.operator])n=yield t.opts.operators[s.operator](e,t);else{const a=i.pop();n=yield t.opts.operators[s.operator](a,e,t)}i.push(n)}else i.push(yield ei(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*ei(t,e,i=!1){if(t)return"content"in t?t.content:is(t)?yield function*(t,e,i){const s=[];for(const i of t.props)s.push(yield ei(i,e,!1));try{if(t.variable){const n=yield ei(t.variable,e,i);return yield e._getFromScope(n,s)}return yield e._get(s)}catch(e){if(i&&"InternalUndefinedVariableError"===e.name)return null;throw new $t(e,t)}}(t,e,i):ns(t)?yield function*(t,e){const i=yield ei(t.lhs,e),s=yield ei(t.rhs,e);return e.memoryLimit.use(s-i+1),Mt(+i,+s+1)}(t,e):void 0}function*ii(t){const e=[];for(const i of t)if(Qi(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function si(t,e){return!ni(t,e)}function ni(t,e){return t=yt(t),e.opts.jsTruthy?!t:!1===t||null==t}const ai={"==":ri,"!=":(t,e)=>!ri(t,e),">":(t,e)=>ne(t)?t.gt(e):ne(e)?e.lt(t):yt(t)>yt(e),"<":(t,e)=>ne(t)?t.lt(e):ne(e)?e.gt(t):yt(t)<yt(e),">=":(t,e)=>ne(t)?t.geq(e):ne(e)?e.leq(t):yt(t)>=yt(e),"<=":(t,e)=>ne(t)?t.leq(e):ne(e)?e.geq(t):yt(t)<=yt(e),contains:(t,e)=>St(t=yt(t))?t.some((t=>ri(t,e))):!!pt(null==t?void 0:t.indexOf)&&t.indexOf(yt(e))>-1,not:(t,e)=>ni(yt(t),e),and:(t,e,i)=>si(yt(t),i)&&si(yt(e),i),or:(t,e,i)=>si(yt(t),i)||si(yt(e),i)};function ri(t,e){return ne(t)?t.equals(e):ne(e)?e.equals(t):(t=yt(t),e=yt(e),St(t)?St(e)&&function(t,e){return t.length===e.length&&!t.some(((t,i)=>!ri(t,e[i])))}(t,e):t===e)}let oi=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class li{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new oi("HEAD",null,null,null),this.tail=new oi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new oi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function hi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const n=document.createElement("a");n.href=e;const a=n.href;return s.removeChild(i),a}var ci=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Ct(t)&&(t+="/"),hi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((t,e,s)=>{const n=s.split("/").pop();return/\.\w+$/.test(n)?t:e+s+i}))},readFile:function(t){return he(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()}))}))},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return he(this,void 0,void 0,(function*(){return!0}))},existsSync:function(t){return!0},dirname:function(t){return hi(t,".")},sep:"/"});function di(t,e=0){return JSON.stringify(t,null,e)}var ui={default:function(t,e,...i){return St(t=yt(t))||ut(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(ni(t,this.context)?e:t)},raw:{raw:!0,handler:It},jsonify:di,to_integer:function(t){return Number(t)},json:di,inspect:function(t,e=0){const i=[];return JSON.stringify(t,(function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)}),e)}};const pi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},gi={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function fi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,(t=>pi[t]))}function mi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,(t=>gi[t]))}var vi=Object.freeze({__proto__:null,escape:fi,xml_escape:function(t){return fi.call(this,t)},escape_once:function(t){return fi.call(this,mi.call(this,t))},newline_to_br:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class bi{constructor(t){this.mapping=t,this.sep="/"}exists(t){return he(this,void 0,void 0,(function*(){return this.existsSync(t)}))}existsSync(t){return!_t(this.mapping[t])}readFile(t){return he(this,void 0,void 0,(function*(){return this.readFileSync(t)}))}readFileSync(t){const e=this.mapping[t];if(_t(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const t of e.split(this.sep))"."!==t&&""!==t&&(".."===t?(s.length>1||""!==s[0])&&s.pop():s.push(t));return s.join(this.sep)}}const yi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:ci,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:ai,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function wi(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new li(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new li(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},yi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=xi(t.root),t.partials=xi(t.partials),t.layouts=xi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?fi:"json"===s?ui.json:(Xt(pt(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Ae())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new bi(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function xi(t){let e=[];return St(t)&&(e=t),ut(t)&&(e=[t]),e}function Ai(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function _i(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Si{constructor(t,e=yi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=oe(e),this.literalTrie=oe(re)}readExpression(){return new ti(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new ze(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&Kt(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new Ye(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),(()=>`unexpected character ${this.snapshot()}`))}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new Ve(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const n=t[s];rs(n)&Wi.Delimited&&(!i&&n.trimLeft&&Ai(t[s-1],e.greedy),Zi(n)&&("raw"===n.name?i=!0:"endraw"===n.name&&(i=!1)),!i&&n.trimRight&&_i(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some((t=>this.match(t)));)++this.p;return new Re(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const n=new De(i,s,this.p,t,e);return"raw"===n.name&&(this.rawBeginAt=s),n}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=yi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,n=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(n)} not closed`,n);return new Ie(i,n,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let n=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===n?(this.rawBeginAt=-1,new De(this.input,s,e,t,this.file)):(this.p=n,new Re(this.input,s,n,this.file))}if(this.rmatch(e))break;this.p++}else n=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new Xe(this.input,e,i,t,this.file)}error(t,e=this.p){return new zt(t,new Fe(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify(function(t,e){return t.length>e?t.slice(0,e-3)+"...":t}(this.input.slice(t,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&Kt(this.peek());)++this.p;return new Fe(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const n=ut(t)?t:t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new He(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new je(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new je(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;)if("["!==this.peek()){if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."!==this.peek()||"."===this.peek(1))break;{this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t)}}else{this.p++;const t=this.readValue()||new Fe(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t)}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!Kt(this.peek(i))){const t=new Le(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new Ne(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new Ke(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,(()=>`unexpected token ${this.snapshot()}, value expected`)),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new We(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:Wt[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Ti{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(Zi(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class ki{constructor(t){this.token=t}}class Ci extends ki{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class Ei{constructor(t,e){this.hash={};const i=t instanceof Si?t:new Si(t,{});for(const t of i.readHashes(e))this.hash[t.name.content]=t.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield ei(this.hash[i],t));return e}}function Mi(t){return St(t)}class Pi{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=pt(e)?e:pt(null==e?void 0:e.handler)?e.handler:It,this.raw=!pt(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const t of this.args)Mi(t)?i.push([t[0],yield ei(t[1],e)]):i.push(yield ei(t,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class Di{constructor(t,e){this.filters=[];const i="string"==typeof t?new Si(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map((t=>new Pi(t,this.getFilter(e,t.name),e)))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const e of this.filters)i=yield e.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return Xt(i||!t.options.strictFilters,(()=>`undefined filter: ${e}`)),i}}class Ii extends ki{constructor(t,e){var i;super(t);const s=new Si(t.input,e.options.operators,t.file,t.contentRange);this.value=new Di(s.readFilteredValue(),e);const n=this.value.filters,a=e.options.outputEscape;if(!(null===(i=n[n.length-1])||void 0===i?void 0:i.raw)&&a){const t=new Ve(toString.call(a),[],"",0,0);n.push(new Pi(t,a,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class Ri extends ki{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Li{constructor(t,e){this.segments=t,this.location=e}toString(){return Gi(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof Li?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class Fi{constructor(){this.map=new Map}get(t){const e=Gi([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(Gi([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const Ni={partials:!0};function*Oi(t,e,i){const s=new Fi,n=new Fi,a=new Fi,r=new ji(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];ut(t)&&!r.has(t)&&n.push(i)}else{const i=t.segments[0];ut(i)&&!e.has(i)&&n.push(t)}for(const i of t.segments)i instanceof Li&&l(i,e)}function*h(t,s){if(t.arguments)for(const e of t.arguments())for(const t of Vi(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();a.push(new Li([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const n=t.partialScope();if(void 0===n){for(const n of yield t.children(e,i))yield h(n,s);return}if(o.has(n.name))return;const a=new Set,r=n.isolated?new ji(a):s.push(a);for(const t of n.scope)if(ut(t))a.add(t);else{const[e,i]=t;a.add(e);const s=Array.from(Vi(i));s.length&&r.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield h(s,r),o.add(n.name);r.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const n of yield t.children(e,i))yield h(n,s);t.blockScope&&s.pop()}}for(const e of t)yield h(e,r);return{variables:s.asObject(),globals:n.asObject(),locals:a.asObject()}}function Bi(t,e={}){return ce(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!1))}function zi(t,e={}){return de(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!0))}class ji{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!ut(e))return;const i=this.getAlias(e);return void 0!==i?new Li([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*Vi(t){as(t)?yield*Hi(t):t instanceof Di&&(yield*function*(t){for(const e of t.initial.postfix)as(e)&&(yield*Hi(e));for(const e of t.filters)for(const t of e.args)Mi(t)&&t[1]?yield*Hi(t[1]):as(t)&&(yield*Hi(t))}(t))}function*Hi(t){ns(t)?(yield*Hi(t.lhs),yield*Hi(t.rhs)):is(t)&&(yield $i(t))}function $i(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push(...$i(s).segments);for(const s of t.props.slice(1))i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push($i(s));const[n,a]=t.getPosition();return new Li(e,{row:n,col:a,file:i})}const Ui=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Gi(t,e=!1){const i=[],s=t[0];ut(s)&&(!e||s.match(Ui)?i.push(`${s}`):i.push(`['${s}']`));for(const e of t.slice(1))e instanceof Li?i.push(`[${Gi(e.segments)}]`):ut(e)?e.match(Ui)?i.push(`.${e}`):i.push(`['${e}']`):i.push(`[${e}]`);return i.join("")}var qi,Wi,Ki;!function(t){t.Partials="partials",t.Layouts="layouts",t.Root="root"}(qi||(qi={}));class Xi{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;Xt(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map((t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:n}=this.options,a=this.options[e];for(const r of this.candidates(t,a,s,e!==qi.Root))if(i?n.existsSync(r):yield n.exists(r))return r;throw this.lookupError(t,a)}*candidates(t,e,i,s){const{fs:n,extname:a}=this.options;if(this.shouldLoadRelative(t)&&i){const r=n.resolve(this.dirname(i),t,a);for(const t of e)if(!s||this.contains(t,r)){yield r;break}}for(const i of e){const e=n.resolve(i,t,a);s&&!this.contains(i,e)||(yield e)}if(void 0!==n.fallback){const e=n.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return Xt(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class Yi{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Xi(this.liquid.options),this.parseLimit=new Me("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Si(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(t){if(!this.liquid.options.catchAllErrors)throw t;s.push(t)}if(s.length)throw new Ht(s);return i}parseToken(t,e){try{if(Zi(t)){const i=this.liquid.tags[t.name];return Xt(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return rs(t)===Wi.Output?new Ii(t,this.liquid):new Ri(t)}catch(e){if(Bt.is(e))throw e;throw new jt(e,t)}}parseStream(t){return new Ti(t,((t,e)=>this.parseToken(t,e)))}*_parseFileCached(t,e,i=qi.Root,s){const n=this.cache,a=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,r=yield n.read(a);if(r)return r;const o=this._parseFile(t,e,i,s),l=e?yield o:ce(o);n.write(a,l);try{return yield l}catch(t){throw n.remove(a),t}}*_parseFile(t,e,i=qi.Root,s){const n=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(n):yield this.fs.readFile(n),n)}}function Qi(t){return rs(t)===Wi.Operator}function Ji(t){return rs(t)===Wi.HTML}function Zi(t){return rs(t)===Wi.Tag}function ts(t){return rs(t)===Wi.Quoted}function es(t){return rs(t)===Wi.Number}function is(t){return rs(t)===Wi.PropertyAccess}function ss(t){return rs(t)===Wi.Word}function ns(t){return rs(t)===Wi.Range}function as(t){return(1667&rs(t))>0}function rs(t){return t?t.kind:-1}!function(t){t[t.Number=1]="Number",t[t.Literal=2]="Literal",t[t.Tag=4]="Tag",t[t.Output=8]="Output",t[t.HTML=16]="HTML",t[t.Filter=32]="Filter",t[t.Hash=64]="Hash",t[t.PropertyAccess=128]="PropertyAccess",t[t.Word=256]="Word",t[t.Range=512]="Range",t[t.Quoted=1024]="Quoted",t[t.Operator=2048]="Operator",t[t.FilteredValue=4096]="FilteredValue",t[t.Delimited=12]="Delimited"}(Wi||(Wi={}));class os{constructor(t={},e=yi,i={},{memoryLimit:s,renderLimit:n}={}){var a,r,o,l,h;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(a=i.globals)&&void 0!==a?a:e.globals,this.environments=Et(t)?t:Object(t),this.strictVariables=null!==(r=i.strictVariables)&&void 0!==r?r:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new Me("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=n?n:new Me("template render",Je().now()+(null!==(h=i.renderLimit)&&void 0!==h?h:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map((t=>[t,this.getRegister(t)]))}restoreRegister(t){return t.forEach((([t,e])=>this.setRegister(t,e)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((t,e)=>le(t,e)),{})}get(t){return this.getSync(t)}getSync(t){return de(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFrom