directus-extension-texttoanything 1.3.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +290 -2
- package/dist/app.js +1 -1
- package/dist/test.png +0 -0
- package/package.json +39 -7
- package/readme.md +154 -53
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineOperationApp as e,useStores as t,useApi as n,defineModule as i,defineInterface as s}from"@directus/extensions-sdk";import{resolveComponent as r,openBlock as o,createBlock as a,withCtx as l,createVNode as c,createCommentVNode as u,ref as h,createElementBlock as d,createTextVNode as p,pushScopeId as f,popScopeId as m,createElementVNode as g,defineComponent as v,computed as y,watch as w,nextTick as b,onMounted as x,unref as T,toDisplayString as k,normalizeStyle as _,Fragment as S,resolveDynamicComponent as F,inject as O}from"vue";var L=e({id:"ttabarcode",name:"TTA generate barcode",icon:"barcode",description:"Generate a barcode trough Text to anything!",overview:({barcodeContent:e})=>[{label:"barcode content",text:e}],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((e=>({text:e,value:e})))}}},{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"}}]}),A=e({id:"ttapdf",name:"TTA generate PDF",icon:"picture_as_pdf",description:"Generate a PDF trough Text to anything!",overview:({filename:e})=>[{label:"File name",text:e}],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)}}}]}),j=e({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:e})=>[{label:"File name",text:e}],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"}}}]}),z=e({id:"ttaqrcode",name:"TTA generate QRcode",icon:"qr_code",description:"Generate a QRcode trough Text to anything!",overview:({content:e})=>[{label:"QRCode content",text:e}],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 V=String.raw`[A-Za-z][^/\s>]*`,R=String.raw`\B"(?:\\[^<>\n]|[^\\"<>\n])*"(?!\w)`,q=String.raw`\B'(?:\\[^<>\n]|[^\\'<>\n])*'(?!\w)`,$=String.raw`${R}|${q}`,D=String.raw`"(?<quotedAttrValue>[^"]*)"`,N=String.raw`'(?<singleQuotedAttrValue>[^']*)'`,E=String.raw`(?<unquotedAttrValue>[^\s"'\`=<>]+)`,M=String.raw`[^=\s>/"']+(?=[=>\s]|$)`,P=String.raw`${D}|${N}|${E}`,C=String.raw`(?<attrName>${M})(?:\s*=\s*(?:${P}))?`,I=String.raw`${$}|[^\s>]*[^\s>/]|[^\s>]*/(?!\s*>)`,B=String.raw`(?<attrSpace>\s*)(?:${C}|(?<attrText>${I}))`,U={comment:String.raw`<!--.*?-->`,dtd:String.raw`<![^>]+>`,startTag:String.raw`<(?<startTagName>${V})(?<attrs>(?:${B})*)\s*(?<closingSlash>/?)\s*>`,endTag:String.raw`</(?<endTagName>${V})\s*>`,space:String.raw`\s+`,text:String.raw`[^<\s"']+|${$}|['"]`,wildcard:String.raw`.`},H=Object.entries(U).map((([e,t])=>`(?<${e}>${t})`)).join("|");const Y=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]);function J(e,t=" ",n=80){const i=new RegExp(H,"gys"),s=new RegExp(B,"gy"),r=[];let o=null,a=0,l=0,c="",u=0,h="";const d=()=>{if(h&&"\n"!=h){const e=c.indexOf("\n"),t=-1==e?c.length:e;l+h.length+t>n&&(h="\n")}const e="\n"==h&&c?t.repeat(u):"",i=`${h}${e}${c}`;if(i){const e=i.lastIndexOf("\n");-1==e?l+=i.length:l=i.length-e-1,r.push(i)}c=h=""},p=(...e)=>{for(const t of e)!o&&/^\s+$/.test(t)?(d(),h=t):(c||(u=a),c+=t)};for(const t of function*(e,t){let n,{lastIndex:i}=e;for(;n=e.exec(t);)yield n,({lastIndex:i}=e);if(i!=t.length)throw new Error("Failed to parse string")}(i,e)){if(J.__strict&&t.groups.wildcard)throw new Error("Unexpected wildcard");if(t.groups.endTag){const e=t.groups.endTagName.toLowerCase();e==o&&(o=null),o||(--a,p(`</${e}>`))}if(o)p(t[0]);else if(t.groups.space)p(...t[0].match(/\n/g)?.slice(0,2)??[" "]);else if(t.groups.comment||t.groups.dtd||t.groups.text||t.groups.wildcard)p(t[0]);else if(t.groups.startTag){const e=t.groups.startTagName.toLowerCase();if(p(`<${e}`),++a,t.groups.attrs){let e,n,{lastIndex:i}=s;for(;e=s.exec(t.groups.attrs);){if(({lastIndex:i}=s),J.__strict&&e.groups.attrText)throw new Error("Unexpected attr text");e.groups.attrText?(e.groups.attrSpace&&p(/\n/.test(e.groups.attrSpace)?"\n":" "),p(e.groups.attrText)):(!e.groups.attrSpace&&n?.groups.attrText||p(/\n/.test(e.groups.attrSpace)?"\n":" "),p(`${e.groups.attrName}${e.groups.quotedAttrValue?`="${e.groups.quotedAttrValue}"`:e.groups.singleQuotedAttrValue?`='${e.groups.singleQuotedAttrValue}'`:e.groups.unquotedAttrValue?`=${e.groups.unquotedAttrValue}`:""}`)),n=e}if(i!=t.groups.attrs.length)throw new Error("Failed to parse attributes")}const n=Boolean(t.groups.closingSlash);p(n?" />":">"),n||Y.has(e)?--a:["pre","textarea","script","style"].includes(e)&&(o=e)}}d();let f=!1;for(;/^\s+$/.test(r[r.length-1]);){const e=r.pop();/\n/.test(e)&&(f=!0)}return f&&r.push("\n"),r.join("")}J.default=J;var W=J;class Q{constructor(e,t,n,i,s){this.kind=e,this.input=t,this.begin=n,this.end=i,this.file=s}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[e,t]=[1,1];for(let n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,t=1):t++;return[e,t]}size(){return this.end-this.begin}}class Z{liquidMethodMissing(e){}}const G=Object.prototype.toString,K=String.prototype.toLowerCase,X=Object.hasOwnProperty;function ee(e){return"string"==typeof e}function te(e){return"function"==typeof e}function ne(e){return e&&te(e.then)}function ie(e){return e&&te(e.next)&&te(e.throw)&&te(e.return)}function se(e){return ee(e=ae(e))?e:he(e)?"":de(e)?e.map((e=>se(e))).join(""):String(e)}function re(e){return de(e=ae(e))?e:ee(e)&&e.length>0?[e]:ge(t=e)&&Symbol.iterator in t?Array.from(e):ge(e)?Object.keys(e).map((t=>[t,e[t]])):[];var t}function oe(e){return he(e=ae(e))?[]:de(e)?e:[e]}function ae(e){return e instanceof Z&&te(e.valueOf)?e.valueOf():e}function le(e){return e=Number(e),isNaN(e)?0:e}function ce(e){return"number"==typeof e}function ue(e){return e&&te(e.toLiquid)?ue(e.toLiquid()):e}function he(e){return null==e}function de(e){return"[object Array]"===G.call(e)}function pe(e){return e&&ce(e.length)}function fe(e,t){e=e||{};for(const n in e)if(X.call(e,n)&&!1===t(e[n],n,e))break;return e}function me(e){return e[e.length-1]}function ge(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}function ve(e,t,n=1){const i=[];for(let s=e;s<t;s+=n)i.push(s);return i}function ye(e,t,n=" "){return we(e,t,n,((e,t)=>t+e))}function we(e,t,n,i){let s=t-(e=String(e)).length;for(;s-- >0;)e=i(e,n);return e}function be(e){return e}function xe(e,t){return null==e&&null==t?0:null==e?1:null==t||(e=K.call(e))<(t=K.call(t))?-1:e>t?1:0}function Te(e){return function(...t){return e.call(this,...t.map(ae))}}function ke(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*_e(e){const t=new Set;for(const n of e){const e=JSON.stringify(n);t.has(e)||(t.add(e),yield n)}}const Se="__liquidClass__";class Fe extends Error{constructor(e,t){super("string"==typeof e?e:e.message),this.context="","string"!=typeof e&&Object.defineProperty(this,"originalError",{value:e,enumerable:!1}),Object.defineProperty(this,"token",{value:t,enumerable:!1}),Object.defineProperty(this,Se,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:qe(this.token),enumerable:!1}),this.message=function(e,t){t.file&&(e+=`, file:${t.file}`);const[n,i]=t.getPosition();return e+=`, line:${n}, col:${i}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(e){return"LiquidError"===(null==e?void 0:e[Se])}}class Oe extends Fe{constructor(e,t){super(e,t),this.name="TokenizationError",super.update()}}class Le extends Fe{constructor(e,t){super(e,t),this.name="ParseError",this.message=e.message,super.update()}}class Ae extends Fe{constructor(e,t){super(e,t.token),this.name="RenderError",this.message=e.message,super.update()}static is(e){return"RenderError"===e.name}}class je extends Fe{constructor(e){super(e[0],e[0].token),this.errors=e,this.name="LiquidErrors";const t=e.length>1?"s":"";this.message=`${e.length} error${t} found`,super.update()}static is(e){return"LiquidErrors"===e.name}}class ze extends Fe{constructor(e,t){super(e,t),this.name="UndefinedVariableError",this.message=e.message,super.update()}}class Ve extends Error{constructor(e){super(`undefined variable: ${e}`),this.name="InternalUndefinedVariableError",this.variableName=e}}class Re extends Error{constructor(e){super(e),this.name="AssertionError",this.message=e+""}}function qe(e){const[t,n]=e.getPosition(),i=e.input.split("\n"),s=Math.max(t-2,1),r=Math.min(t+3,i.length);return ve(s,r+1).map((e=>{let s=`${e===t?">> ":" "}${ye(String(e),String(r).length)}| `;const o=e===t?"\n"+ye("^",n+s.length):"";return s+=i[e-1],s+=o,s})).join("\n")}const $e=[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 De(e){const t=e.charCodeAt(0);return t>=128?!$e[t]:!!(1&$e[t])}function Ne(e,t){if(!e){const n="function"==typeof t?t():t||`expect ${e} to be true`;throw new Re(n)}}function Ee(e,t=`unexpected ${JSON.stringify(e)}`){Ne(!e,t)}$e[160]=$e[5760]=$e[6158]=$e[8192]=$e[8193]=$e[8194]=$e[8195]=$e[8196]=$e[8197]=$e[8198]=$e[8199]=$e[8200]=$e[8201]=$e[8202]=$e[8232]=$e[8233]=$e[8239]=$e[8287]=$e[12288]=4,$e[8220]=$e[8221]=128;class Me extends Z{equals(e){return!(e instanceof Me)&&(ee(e=ae(e))||de(e)?0===e.length:!!ge(e)&&0===Object.keys(e).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(e){return e instanceof Me}}class Pe extends Me{equals(e){return!1===e||(!!he(ae(e))||(ee(e)?/^\s*$/.test(e):super.equals(e)))}static is(e){return e instanceof Pe}}class Ce extends Z{constructor(e,t,n){super(),this.i=0,this.length=e,this.name=`${n}-${t}`}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 Ie extends Z{constructor(e=()=>""){super(),this.superBlockRender=e}super(){return this.superBlockRender()}}function Be(e){return e&&te(e.equals)&&te(e.gt)&&te(e.geq)&&te(e.lt)&&te(e.leq)}const Ue=new class extends Z{equals(e){return he(ae(e))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},He={true:!0,false:!1,nil:Ue,null:Ue,empty:new Me,blank:new Pe};function Ye(e){const t={};for(const[n,i]of Object.entries(e)){let e=t;for(let t=0;t<n.length;t++){const i=n[t];e[i]=e[i]||{},t===n.length-1&&De(n[t])&&(e[i].needBoundary=!0),e=e[i]}e.data=i,e.end=!0}return t}var Je=function(){return Je=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Je.apply(this,arguments)};function We(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}function Qe(e){return We(this,void 0,void 0,(function*(){if(!ie(e))return e;let t,n=!1,i="next";do{const s=e[i](t);n=s.done,t=s.value,i="next";try{ie(t)&&(t=Qe(t)),ne(t)&&(t=yield t)}catch(e){i="throw",t=e}}while(!n);return t}))}function Ze(e){if(!ie(e))return e;let t,n=!1,i="next";do{const s=e[i](t);if(n=s.done,t=s.value,i="next",ie(t))try{t=Ze(t)}catch(e){i="throw",t=e}}while(!n);return t}const Ge=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function Ke(e){const t=function(e){const t=e.getFullYear();return!(3&t||!(t%100||t%400==0&&t))}(e)?29:28;return[31,t,31,30,31,30,31,31,30,31,30,31]}function Xe(e){let t=0;for(let n=0;n<e.getMonth();++n)t+=Ke(e)[n];return t+e.getDate()}function et(e,t){const n=Xe(e)+(t-e.getDay()),i=7-new Date(e.getFullYear(),0,1).getDay()+t;return String(Math.floor((n-i)/7)+1)}const tt={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},nt=new Set("aAbBceklpP");function it(e,t){const n=Math.abs(e.getTimezoneOffset()),i=Math.floor(n/60),s=n%60;return(e.getTimezoneOffset()>0?"-":"+")+ye(i,2,"0")+(t.flags[":"]?":":"")+ye(s,2,"0")}const st={a:e=>e.getShortWeekdayName(),A:e=>e.getLongWeekdayName(),b:e=>e.getShortMonthName(),B:e=>e.getLongMonthName(),c:e=>e.toLocaleString(),C:e=>function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}(e),d:e=>e.getDate(),e:e=>e.getDate(),H:e=>e.getHours(),I:e=>String(e.getHours()%12||12),j:e=>Xe(e),k:e=>e.getHours(),l:e=>String(e.getHours()%12||12),L:e=>e.getMilliseconds(),m:e=>e.getMonth()+1,M:e=>e.getMinutes(),N:(e,t)=>{const n=Number(t.width)||9;return function(e,t,n=" "){return we(e,t,n,((e,t)=>e+t))}(String(e.getMilliseconds()).slice(0,n),n,"0")},p:e=>e.getHours()<12?"AM":"PM",P:e=>e.getHours()<12?"am":"pm",q:e=>function(e){const t=e.getDate();if([11,12,13].includes(t))return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(e),s:e=>Math.round(e.getTime()/1e3),S:e=>e.getSeconds(),u:e=>e.getDay()||7,U:e=>et(e,0),w:e=>e.getDay(),W:e=>et(e,1),x:e=>e.toLocaleDateString(),X:e=>e.toLocaleTimeString(),y:e=>e.getFullYear().toString().slice(2,4),Y:e=>e.getFullYear(),z:it,Z:(e,t)=>e.getTimeZoneName()||it(e,t),t:()=>"\t",n:()=>"\n","%":()=>"%"};function rt(e,t){let n,i="",s=t;for(;n=Ge.exec(s);)i+=s.slice(0,n.index),s=s.slice(n.index+n[0].length),i+=ot(e,n);return i+s}function ot(e,t){const[n,i="",s,r,o]=t,a=st[o];if(!a)return n;const l={};for(const e of i)l[e]=!0;let c=String(a(e,{flags:l,width:s,modifier:r})),u=nt.has(o)?" ":"0",h=s||tt[o]||0;var d;return l["^"]?c=c.toUpperCase():l["#"]&&(d=c,c=[...d].some((e=>e>="a"&&e<="z"))?d.toUpperCase():d.toLowerCase()),l._?u=" ":l[0]&&(u="0"),l["-"]&&(h=0),ye(c,h,u)}function at(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}st.h=st.b;const lt=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,ct=["January","February","March","April","May","June","July","August","September","October","November","December"],ut=ct.map((e=>e.slice(0,3))),ht=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dt=ht.map((e=>e.slice(0,3)));class pt{constructor(e,t,n){this.locale=t,this.DateTimeFormat=at(),this.date=new Date(e),this.timezoneFixed=void 0!==n,void 0===n&&(n=this.date.getTimezoneOffset()),this.timezoneOffset=ee(n)?pt.getTimezoneOffset(n,this.date):n,this.timezoneName=ee(n)?n:"";const i=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),s=this.date.getTime()+i;this.displayDate=new Date(s)}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(e,t){return(null==t?void 0:t.timeZone)?this.date.toLocaleString(e,t):this.displayDate.toLocaleString(e,t)}toLocaleTimeString(e){return this.displayDate.toLocaleTimeString(e)}toLocaleDateString(e){return this.displayDate.toLocaleDateString(e)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var e;return null!==(e=this.format({month:"long"}))&&void 0!==e?e:ct[this.getMonth()]}getShortMonthName(){var e;return null!==(e=this.format({month:"short"}))&&void 0!==e?e:ut[this.getMonth()]}getLongWeekdayName(){var e;return null!==(e=this.format({weekday:"long"}))&&void 0!==e?e:ht[this.displayDate.getDay()]}getShortWeekdayName(){var e;return null!==(e=this.format({weekday:"short"}))&&void 0!==e?e:dt[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(e){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,e).format(this.displayDate)}static createDateFixedToTimezone(e,t){const n=e.match(lt);if(n&&"Z"===n[1])return new pt(+new Date(e),t,0);if(n&&n[2]&&n[3]&&n[4]){const[,,i,s,r]=n,o=("+"===i?-1:1)*(60*parseInt(s,10)+parseInt(r,10));return new pt(+new Date(e),t,o)}return new pt(e,t)}static getTimezoneOffset(e,t){const n=t.toLocaleString("en-US",{timeZone:e}),i=t.toLocaleString("en-US",{timeZone:"UTC"}),s=new Date(n);return(+new Date(i)-+s)/6e4}}class ft{constructor(e,t){this.base=0,this.message=`${e} limit exceeded`,this.limit=t}use(e){e=le(e),Ne(this.base+e<=this.limit,this.message),this.base+=e}check(e){Ne((e=le(e))<=this.limit,this.message)}}class mt extends Q{constructor(e,[t,n],i,s,r,o,a,l){super(e,i,s,r,l),this.trimLeft=!1,this.trimRight=!1;const c="-"===i[t],u="-"===i[n-1];let h=c?t+1:t,d=u?n-1:n;for(;h<d&&4&$e[i.charCodeAt(h)];)h++;for(;d>h&&4&$e[i.charCodeAt(d-1)];)d--;this.contentRange=[h,d],this.trimLeft=c||o,this.trimRight=u||a}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class gt extends mt{constructor(e,t,n,i,s){const{trimTagLeft:r,trimTagRight:o,tagDelimiterLeft:a,tagDelimiterRight:l}=i,[c,u]=[t+a.length,n-l.length];super(Dn.Tag,[c,u],e,t,n,r,o,s),this.tokenizer=new pn(e,i.operators,s,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class vt extends mt{constructor(e,t,n,i,s){const{trimOutputLeft:r,trimOutputRight:o,outputDelimiterLeft:a,outputDelimiterRight:l}=i,c=[t+a.length,n-l.length];super(Dn.Output,c,e,t,n,r,o,s)}}class yt extends Q{constructor(e,t,n,i){super(Dn.HTML,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class wt extends Q{constructor(e,t,n,i){super(Dn.Number,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=Number(this.getText())}}class bt extends Q{constructor(e,t,n,i){super(Dn.Word,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=this.getText()}}class xt extends Q{constructor(e,t,n,i){super(Dn.Literal,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.literal=this.getText(),this.content=He[this.literal]}}const Tt={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},kt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class _t extends Q{constructor(e,t,n,i){super(Dn.Operator,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.operator=this.getText()}getPrecedence(){const e=this.getText();return e in Tt?Tt[e]:1}}class St extends Q{constructor(e,t,n,i,s,r){super(Dn.PropertyAccess,n,i,s,r),this.variable=e,this.props=t}}class Ft extends Q{constructor(e,t,n,i,s,r){super(Dn.Filter,n,i,s,r),this.name=e,this.args=t}}class Ot extends Q{constructor(e,t,n,i,s,r){super(Dn.Hash,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.name=i,this.value=s,this.file=r}}const Lt=/[\da-fA-F]/,At=/[0-7]/,jt={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function zt(e){const t=e.charCodeAt(0);return t>=97?t-87:t>=65?t-55:t-48}class Vt extends Q{constructor(e,t,n,i){super(Dn.Quoted,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=function(e){let t="";for(let n=1;n<e.length-1;n++)if("\\"===e[n])if(void 0!==jt[e[n+1]])t+=jt[e[++n]];else if("u"===e[n+1]){let i=0,s=n+2;for(;s<=n+5&&Lt.test(e[s]);)i=16*i+zt(e[s++]);n=s-1,t+=String.fromCharCode(i)}else if(At.test(e[n+1])){let i=n+1,s=0;for(;i<=n+3&&At.test(e[i]);)s=8*s+zt(e[i++]);n=i-1,t+=String.fromCharCode(s)}else t+=e[++n];else t+=e[n];return t}(this.getText())}}class Rt extends Q{constructor(e,t,n,i,s,r){super(Dn.Range,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.lhs=i,this.rhs=s,this.file=r}}class qt extends mt{constructor(e,t,n,i,s){super(Dn.Tag,[t,n],e,t,n,!1,!1,s),this.tokenizer=new pn(e,i.operators,s,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 $t extends Q{constructor(e,t,n,i,s,r){super(Dn.FilteredValue,n,i,s,r),this.initial=e,this.filters=t,this.input=n,this.begin=i,this.end=s,this.file=r}}const Dt={now:()=>Date.now()};function Nt(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||Dt}class Et{constructor(){this.buffer=""}write(e){this.buffer+=se(e)}}class Mt{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Pt{constructor(){this.buffer=""}write(e){"string"!=typeof(e=ae(e))&&""===this.buffer?this.buffer=e:this.buffer=se(this.buffer)+se(e)}}class Ct{renderTemplatesToNodeStream(e,t){const n=new Mt;return Promise.resolve().then((()=>Qe(this.renderTemplates(e,t,n)))).then((()=>n.end()),(e=>n.error(e))),n.stream}*renderTemplates(e,t,n){n||(n=t.opts.keepOutputType?new Pt:new Et);const i=[];for(const s of e){t.renderLimit.check(Nt().now());try{const e=yield s.render(t,n);if(e&&n.write(e),t.breakCalled||t.continueCalled)break}catch(e){const n=Fe.is(e)?e:new Ae(e,s);if(!t.opts.catchAllErrors)throw n;i.push(n)}}if(i.length)throw new je(i);return n.buffer}}class It{constructor(e){this.postfix=[...Ut(e)]}*evaluate(e,t){Ne(e,"unable to evaluate: context not defined");const n=[];for(const i of this.postfix)if(Pn(i)){const t=n.pop();let s;if(1===kt[i.operator])s=yield e.opts.operators[i.operator](t,e);else{const r=n.pop();s=yield e.opts.operators[i.operator](r,t,e)}n.push(s)}else n.push(yield Bt(i,e,t));return n[0]}valid(){return!!this.postfix.length}}function*Bt(e,t,n=!1){if(e)return"content"in e?e.content:Hn(e)?yield function*(e,t,n){const i=[];for(const n of e.props)i.push(yield Bt(n,t,!1));try{if(e.variable){const s=yield Bt(e.variable,t,n);return yield t._getFromScope(s,i)}return yield t._get(i)}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new ze(t,e)}}(e,t,n):Jn(e)?yield function*(e,t){const n=yield Bt(e.lhs,t),i=yield Bt(e.rhs,t);return t.memoryLimit.use(i-n+1),ve(+n,+i+1)}(e,t):void 0}function*Ut(e){const t=[];for(const n of e)if(Pn(n)){for(;t.length&&t[t.length-1].getPrecedence()>n.getPrecedence();)yield t.pop();t.push(n)}else yield n;for(;t.length;)yield t.pop()}function Ht(e,t){return!Yt(e,t)}function Yt(e,t){return e=ae(e),t.opts.jsTruthy?!e:!1===e||null==e}const Jt={"==":Wt,"!=":(e,t)=>!Wt(e,t),">":(e,t)=>Be(e)?e.gt(t):Be(t)?t.lt(e):ae(e)>ae(t),"<":(e,t)=>Be(e)?e.lt(t):Be(t)?t.gt(e):ae(e)<ae(t),">=":(e,t)=>Be(e)?e.geq(t):Be(t)?t.leq(e):ae(e)>=ae(t),"<=":(e,t)=>Be(e)?e.leq(t):Be(t)?t.geq(e):ae(e)<=ae(t),contains:(e,t)=>de(e=ae(e))?e.some((e=>Wt(e,t))):!!te(null==e?void 0:e.indexOf)&&e.indexOf(ae(t))>-1,not:(e,t)=>Yt(ae(e),t),and:(e,t,n)=>Ht(ae(e),n)&&Ht(ae(t),n),or:(e,t,n)=>Ht(ae(e),n)||Ht(ae(t),n)};function Wt(e,t){return Be(e)?e.equals(t):Be(t)?t.equals(e):(e=ae(e),t=ae(t),de(e)?de(t)&&function(e,t){return e.length===t.length&&!e.some(((e,n)=>!Wt(e,t[n])))}(e,t):e===t)}class Qt{constructor(e,t,n,i){this.key=e,this.value=t,this.next=n,this.prev=i}}class Zt{constructor(e,t=0){this.limit=e,this.size=t,this.cache={},this.head=new Qt("HEAD",null,null,null),this.tail=new Qt("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(e,t){if(this.cache[e])this.cache[e].value=t;else{const n=new Qt(e,t,this.head.next,this.head);this.head.next.prev=n,this.head.next=n,this.cache[e]=n,this.size++,this.ensureLimit()}}read(e){if(!this.cache[e])return;const{value:t}=this.cache[e];return this.remove(e),this.write(e,t),t}remove(e){const t=this.cache[e];t.prev.next=t.next,t.next.prev=t.prev,delete this.cache[e],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 Gt(e,t){const n=document.createElement("base");n.href=e;const i=document.getElementsByTagName("head")[0];i.insertBefore(n,i.firstChild);const s=document.createElement("a");s.href=t;const r=s.href;return i.removeChild(n),r}var Kt=Object.freeze({__proto__:null,resolve:function(e,t,n){return e.length&&"/"!==me(e)&&(e+="/"),Gt(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((e,t,i)=>{const s=i.split("/").pop();return/\.\w+$/.test(s)?e:t+i+n}))},readFile:function(e){return We(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=new XMLHttpRequest;i.onload=()=>{i.status>=200&&i.status<300?t(i.responseText):n(new Error(i.statusText))},i.onerror=()=>{n(new Error("An error occurred whilst receiving the response."))},i.open("GET",e),i.send()}))}))},readFileSync:function(e){const t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||t.status>=300)throw new Error(t.statusText);return t.responseText},exists:function(e){return We(this,void 0,void 0,(function*(){return!0}))},existsSync:function(e){return!0},dirname:function(e){return Gt(e,".")},sep:"/"});function Xt(e,t=0){return JSON.stringify(e,null,t)}var en={default:function(e,t,...n){return de(e=ae(e))||ee(e)?e.length?e:t:(!1!==e||!new Map(n).get("allow_false"))&&(Yt(e,this.context)?t:e)},raw:{raw:!0,handler:be},jsonify:Xt,to_integer:function(e){return Number(e)},json:Xt,inspect:function(e,t=0){const n=[];return JSON.stringify(e,(function(e,t){if("object"!=typeof t||null===t)return t;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}),t)}};const tn={"&":"&","<":"<",">":">",'"':""","'":"'"},nn={"&":"&","<":"<",">":">",""":'"',"'":"'"};function sn(e){return e=se(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,(e=>tn[e]))}function rn(e){return e=se(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,(e=>nn[e]))}var on=Object.freeze({__proto__:null,escape:sn,xml_escape:function(e){return sn.call(this,e)},escape_once:function(e){return sn.call(this,rn.call(this,e))},newline_to_br:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,"<br />\n")},strip_html:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),t.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class an{constructor(e){this.mapping=e,this.sep="/"}exists(e){return We(this,void 0,void 0,(function*(){return this.existsSync(e)}))}existsSync(e){return!he(this.mapping[e])}readFile(e){return We(this,void 0,void 0,(function*(){return this.readFileSync(e)}))}readFileSync(e){const t=this.mapping[e];if(he(t))throw new Error(`ENOENT: ${e}`);return t}dirname(e){const t=e.split(this.sep);return t.pop(),t.join(this.sep)}resolve(e,t,n){if(t+=n,"."===e)return t;const i=e.split(/\/+/);for(const e of t.split(this.sep))"."!==e&&""!==e&&(".."===e?(i.length>1||""!==i[0])&&i.pop():i.push(e));return i.join(this.sep)}}const ln={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:Kt,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:Jt,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function cn(e){var t,n,i;if(e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")){let t;t="number"==typeof e.cache?e.cache>0?new Zt(e.cache):void 0:"object"==typeof e.cache?e.cache:e.cache?new Zt(1024):void 0,e.cache=t}return(e=Object.assign(Object.assign(Object.assign({},ln),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=un(e.root),e.partials=un(e.partials),e.layouts=un(e.layouts),e.outputEscape=e.outputEscape&&("escape"===(i=e.outputEscape)?sn:"json"===i?en.json:(Ne(te(i),"`outputEscape` need to be of type string or function"),i)),e.locale||(e.locale=null!==(n=null===(t=at())||void 0===t?void 0:t().resolvedOptions().locale)&&void 0!==n?n:"en-US"),e.templates&&(e.fs=new an(e.templates),e.relativeReference=!0,e.root=e.partials=e.layouts="."),e}function un(e){let t=[];return de(e)&&(t=e),ee(e)&&(t=[e]),t}function hn(e,t){if(!e||!Cn(e))return;const n=t?4:16;for(;$e[e.input.charCodeAt(e.end-1-e.trimRight)]&n;)e.trimRight++}function dn(e,t){if(!e||!Cn(e))return;const n=t?4:16;for(;$e[e.input.charCodeAt(e.begin+e.trimLeft)]&n;)e.trimLeft++;"\n"===e.input.charAt(e.begin+e.trimLeft)&&e.trimLeft++}class pn{constructor(e,t=ln.operators,n,i){this.input=e,this.file=n,this.rawBeginAt=-1,this.p=i?i[0]:0,this.N=i?i[1]:e.length,this.opTrie=Ye(t),this.literalTrie=Ye(He)}readExpression(){return new It(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const e=this.readOperator();if(e){yield e;continue}const t=this.readValue();if(!t)return;yield t}}readOperator(){this.skipBlank();const e=this.matchTrie(this.opTrie);if(-1!==e)return new _t(this.input,this.p,this.p=e,this.file)}matchTrie(e){let t,n=e,i=this.p;for(;n[this.input[i]]&&i<this.N;)n=n[this.input[i++]],n.end&&(t=n);return t?t.needBoundary&&De(this.peek(i-this.p))?-1:i:-1}readFilteredValue(){const e=this.p,t=this.readExpression();this.assert(t.valid(),`invalid value expression: ${this.snapshot()}`);const n=this.readFilters();return new $t(t,n,this.input,e,this.p,this.file)}readFilters(){const e=[];for(;;){const t=this.readFilter();if(!t)return e;e.push(t)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const e=this.readIdentifier();if(!e.size())return this.assert(this.end(),"expected filter name"),null;const t=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const e=this.readFilterArg();e&&t.push(e),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 Ft(e.getText(),t,this.input,e.begin,this.p,this.file)}readFilterArg(){const e=this.readValue();if(!e)return;if(this.skipBlank(),":"!==this.peek())return e;++this.p;const t=this.readValue();return[e.getText(),t]}readTopLevelTokens(e=ln){const t=[];for(;this.p<this.N;){const n=this.readTopLevelToken(e);t.push(n)}return function(e,t){let n=!1;for(let i=0;i<e.length;i++){const s=e[i];Qn(s)&Dn.Delimited&&(!n&&s.trimLeft&&hn(e[i-1],t.greedy),In(s)&&("raw"===s.name?n=!0:"endraw"===s.name&&(n=!1)),!n&&s.trimRight&&dn(e[i+1],t.greedy))}}(t,e),t}readTopLevelToken(e){const{tagDelimiterLeft:t,outputDelimiterLeft:n}=e;return this.rawBeginAt>-1?this.readEndrawOrRawContent(e):this.match(t)?this.readTagToken(e):this.match(n)?this.readOutputToken(e):this.readHTMLToken([t,n])}readHTMLToken(e){const t=this.p;for(;this.p<this.N&&!e.some((e=>this.match(e)));)++this.p;return new yt(this.input,t,this.p,this.file)}readTagToken(e){const{file:t,input:n}=this,i=this.p;if(-1===this.readToDelimiter(e.tagDelimiterRight))throw this.error(`tag ${this.snapshot(i)} not closed`,i);const s=new gt(n,i,this.p,e,t);return"raw"===s.name&&(this.rawBeginAt=i),s}readToDelimiter(e,t=!1){for(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}readOutputToken(e=ln){const{file:t,input:n}=this,{outputDelimiterRight:i}=e,s=this.p;if(-1===this.readToDelimiter(i,!0))throw this.error(`output ${this.snapshot(s)} not closed`,s);return new vt(n,s,this.p,e,t)}readEndrawOrRawContent(e){const{tagDelimiterLeft:t,tagDelimiterRight:n}=e,i=this.p;let s=this.readTo(t)-t.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(n)){const t=this.p;return i===s?(this.rawBeginAt=-1,new gt(this.input,i,t,e,this.file)):(this.p=s,new yt(this.input,i,s,this.file))}if(this.rmatch(t))break;this.p++}else s=this.readTo(t)-t.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,i)}readLiquidTagTokens(e=ln){const t=[];for(;this.p<this.N;){const n=this.readLiquidTagToken(e);n&&t.push(n)}return t}readLiquidTagToken(e){if(this.skipBlank(),this.end())return;const t=this.p;this.readToDelimiter("\n");const n=this.p;return new qt(this.input,t,n,e,this.file)}error(e,t=this.p){return new Oe(e,new bt(this.input,t,this.N,this.file))}assert(e,t,n){if(!e)throw this.error("function"==typeof t?t():t,n)}snapshot(e=this.p){return JSON.stringify((t=this.input.slice(e,this.N),n=32,t.length>n?t.slice(0,n-3)+"...":t));var t,n}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const e=this.p;for(;!this.end()&&De(this.peek());)++this.p;return new bt(this.input,e,this.p,this.file)}readNonEmptyIdentifier(){const e=this.readIdentifier();return e.size()?e:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(e){const t=[];for(;;){const n=this.readHash(e);if(!n)return t;t.push(n)}}readHash(e){this.skipBlank(),","===this.peek()&&++this.p;const t=this.p,n=this.readNonEmptyIdentifier();if(!n)return;let i;this.skipBlank();const s=ee(e)?e:e?"=":":";return this.peek()===s&&(++this.p,i=this.readValue()),new Ot(this.input,t,this.p,n,i,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(e=1){this.p+=e}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(e){for(;this.p<this.N;)if(++this.p,this.rmatch(e))return this.p;return-1}readValue(){this.skipBlank();const e=this.p,t=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),n=this.readProperties(!t);return n.length?new St(t,n,this.input,e,this.p):t}readScopeValue(){this.skipBlank();const e=this.p,t=this.readProperties();if(t.length)return new St(void 0,t,this.input,e,this.p)}readProperties(e=!0){const t=[];for(;;)if("["!==this.peek()){if(e&&!t.length){const e=this.readNonEmptyIdentifier();if(e){t.push(e);continue}}if("."!==this.peek()||"."===this.peek(1))break;{this.p++;const e=this.readNonEmptyIdentifier();if(!e)break;t.push(e)}}else{this.p++;const e=this.readValue()||new bt(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),t.push(e)}return t}readNumber(){this.skipBlank();let e=!1,t=!1,n=0;for(64&this.peekType()&&n++;this.p+n<=this.N;)if(32&this.peekType(n))t=!0,n++;else{if("."!==this.peek(n)||"."===this.peek(n+1))break;if(e||!t)return;e=!0,n++}if(t&&!De(this.peek(n))){const e=new wt(this.input,this.p,this.p+n,this.file);return this.advance(n),e}}readLiteral(){this.skipBlank();const e=this.matchTrie(this.literalTrie);if(-1===e)return;const t=new xt(this.input,this.p,e,this.file);return this.p=e,t}readRange(){this.skipBlank();const e=this.p;if("("!==this.peek())return;++this.p;const t=this.readValueOrThrow();this.p+=2;const n=this.readValueOrThrow();return++this.p,new Rt(this.input,e,this.p,t,n,this.file)}readValueOrThrow(){const e=this.readValue();return this.assert(e,(()=>`unexpected token ${this.snapshot()}, value expected`)),e}readQuoted(){this.skipBlank();const e=this.p;if(!(8&this.peekType()))return;++this.p;let t=!1;for(;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 Vt(this.input,e,this.p,this.file)}*readFileNameTemplate(e){const{outputDelimiterLeft:t}=e,n=[","," ",t],i=new Set(n);for(;this.p<this.N&&!i.has(this.peek());)yield this.match(t)?this.readOutputToken(e):this.readHTMLToken(n)}match(e){for(let t=0;t<e.length;t++)if(e[t]!==this.input[this.p+t])return!1;return!0}rmatch(e){for(let t=0;t<e.length;t++)if(e[e.length-1-t]!==this.input[this.p-1-t])return!1;return!0}peekType(e=0){return this.p+e>=this.N?0:$e[this.input.charCodeAt(this.p+e)]}peek(e=0){return this.p+e>=this.N?"":this.input[this.p+e]}skipBlank(){for(;4&this.peekType();)++this.p}}class fn{constructor(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}on(e,t){return this.handlers[e]=t,this}trigger(e,t){const n=this.handlers[e];return!!n&&(n.call(this,t),!0)}start(){let e;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());){if(this.trigger("token",e))continue;if(In(e)&&this.trigger(`tag:${e.name}`,e))continue;const t=this.parseToken(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class mn{constructor(e){this.token=e}}class gn extends mn{constructor(e,t,n){super(e),this.name=e.name,this.liquid=n,this.tokenizer=e.tokenizer}}class vn{constructor(e,t){this.hash={};const n=e instanceof pn?e:new pn(e,{});for(const e of n.readHashes(t))this.hash[e.name.content]=e.value}*render(e){const t={};for(const n of Object.keys(this.hash))t[n]=void 0===this.hash[n]||(yield Bt(this.hash[n],e));return t}}function yn(e){return de(e)}class wn{constructor(e,t,n){this.token=e,this.name=e.name,this.handler=te(t)?t:te(null==t?void 0:t.handler)?t.handler:be,this.raw=!te(t)&&!!(null==t?void 0:t.raw),this.args=e.args,this.liquid=n}*render(e,t){const n=[];for(const e of this.args)yn(e)?n.push([e[0],yield Bt(e[1],t)]):n.push(yield Bt(e,t));return yield this.handler.apply({context:t,token:this.token,liquid:this.liquid},[e,...n])}}class bn{constructor(e,t){this.filters=[];const n="string"==typeof e?new pn(e,t.options.operators).readFilteredValue():e;this.initial=n.initial,this.filters=n.filters.map((e=>new wn(e,this.getFilter(t,e.name),t)))}*value(e,t){t=t||e.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let n=yield this.initial.evaluate(e,t);for(const t of this.filters)n=yield t.render(n,e);return n}getFilter(e,t){const n=e.filters[t];return Ne(n||!e.options.strictFilters,(()=>`undefined filter: ${t}`)),n}}class xn extends mn{constructor(e,t){var n;super(e);const i=new pn(e.input,t.options.operators,e.file,e.contentRange);this.value=new bn(i.readFilteredValue(),t);const s=this.value.filters,r=t.options.outputEscape;if(!(null===(n=s[s.length-1])||void 0===n?void 0:n.raw)&&r){const e=new Ft(toString.call(r),[],"",0,0);s.push(new wn(e,r,t))}}*render(e,t){const n=yield this.value.value(e,!1);t.write(n)}*arguments(){yield this.value}}class Tn extends mn{constructor(e){super(e),this.str=e.getContent()}*render(e,t){t.write(this.str)}}class kn{constructor(e,t){this.segments=e,this.location=t}toString(){return qn(this.segments,!0)}toArray(){return Array.from(function*e(...t){for(const n of t)n instanceof kn?yield Array.from(e(...n.segments)):yield n}(...this.segments))}}class _n{constructor(){this.map=new Map}get(e){const t=qn([e.segments[0]]);return this.map.has(t)||this.map.set(t,[]),this.map.get(t)}has(e){return this.map.has(qn([e.segments[0]]))}push(e){this.get(e).push(e)}asObject(){return Object.fromEntries(this.map)}}const Sn={partials:!0};function*Fn(e,t,n){const i=new _n,s=new _n,r=new _n,o=new An(new Set),a=new Set;function l(e,t){i.push(e);const n=t.alias(e);if(void 0!==n){const e=n.segments[0];ee(e)&&!o.has(e)&&s.push(n)}else{const n=e.segments[0];ee(n)&&!t.has(n)&&s.push(e)}for(const n of e.segments)n instanceof kn&&l(n,t)}function*c(e,i){if(e.arguments)for(const t of e.arguments())for(const e of jn(t))l(e,i);if(e.localScope)for(const t of e.localScope()){i.add(t.content),i.deleteAlias(t.content);const[e,n]=t.getPosition();r.push(new kn([t.content],{row:e,col:n,file:t.file}))}if(e.children)if(e.partialScope){const s=e.partialScope();if(void 0===s){for(const s of yield e.children(t,n))yield c(s,i);return}if(a.has(s.name))return;const r=new Set,o=s.isolated?new An(r):i.push(r);for(const e of s.scope)if(ee(e))r.add(e);else{const[t,n]=e;r.add(t);const i=Array.from(jn(n));i.length&&o.setAlias(t,i[0].segments)}for(const i of yield e.children(t,n))yield c(i,o),a.add(s.name);o.pop()}else{e.blockScope&&i.push(new Set(e.blockScope()));for(const s of yield e.children(t,n))yield c(s,i);e.blockScope&&i.pop()}}for(const t of e)yield c(t,o);return{variables:i.asObject(),globals:s.asObject(),locals:r.asObject()}}function On(e,t={}){return Qe(Fn(e,Object.assign(Object.assign({},Sn),t).partials,!1))}function Ln(e,t={}){return Ze(Fn(e,Object.assign(Object.assign({},Sn),t).partials,!0))}class An{constructor(e){this.stack=[{names:e,aliases:new Map}]}has(e){for(const t of this.stack)if(t.names.has(e))return!0;return!1}push(e){return this.stack.push({names:e,aliases:new Map}),this}pop(){var e;return null===(e=this.stack.pop())||void 0===e?void 0:e.names}add(e){this.stack[0].names.add(e)}alias(e){const t=e.segments[0];if(!ee(t))return;const n=this.getAlias(t);return void 0!==n?new kn([...n,...e.segments.slice(1)],e.location):void 0}setAlias(e,t){this.stack[this.stack.length-1].aliases.set(e,t)}deleteAlias(e){this.stack[this.stack.length-1].aliases.delete(e)}getAlias(e){for(const t of this.stack){if(t.aliases.has(e))return t.aliases.get(e);if(t.names.has(e))return}}}function*jn(e){Wn(e)?yield*zn(e):e instanceof bn&&(yield*function*(e){for(const t of e.initial.postfix)Wn(t)&&(yield*zn(t));for(const t of e.filters)for(const e of t.args)yn(e)&&e[1]?yield*zn(e[1]):Wn(e)&&(yield*zn(e))}(e))}function*zn(e){Jn(e)?(yield*zn(e.lhs),yield*zn(e.rhs)):Hn(e)&&(yield Vn(e))}function Vn(e){const t=[];let n=e.file;const i=e.props[0];n=n||i.file,Bn(i)||Un(i)||Yn(i)?t.push(i.content):Hn(i)&&t.push(...Vn(i).segments);for(const i of e.props.slice(1))n=n||i.file,Bn(i)||Un(i)||Yn(i)?t.push(i.content):Hn(i)&&t.push(Vn(i));const[s,r]=e.getPosition();return new kn(t,{row:s,col:r,file:n})}const Rn=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function qn(e,t=!1){const n=[],i=e[0];ee(i)&&(!t||i.match(Rn)?n.push(`${i}`):n.push(`['${i}']`));for(const t of e.slice(1))t instanceof kn?n.push(`[${qn(t.segments)}]`):ee(t)?t.match(Rn)?n.push(`.${t}`):n.push(`['${t}']`):n.push(`[${t}]`);return n.join("")}var $n,Dn,Nn;!function(e){e.Partials="partials",e.Layouts="layouts",e.Root="root"}($n||($n={}));class En{constructor(e){if(this.options=e,e.relativeReference){const t=e.fs.sep;Ne(t,"`fs.sep` is required for relative reference");const n=new RegExp(["."+t,".."+t,"./","../"].map((e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"));this.shouldLoadRelative=e=>n.test(e)}else this.shouldLoadRelative=e=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(e,t,n,i){const{fs:s}=this.options,r=this.options[t];for(const o of this.candidates(e,r,i,t!==$n.Root))if(n?s.existsSync(o):yield s.exists(o))return o;throw this.lookupError(e,r)}*candidates(e,t,n,i){const{fs:s,extname:r}=this.options;if(this.shouldLoadRelative(e)&&n){const o=s.resolve(this.dirname(n),e,r);for(const e of t)if(!i||this.contains(e,o)){yield o;break}}for(const n of t){const t=s.resolve(n,e,r);i&&!this.contains(n,t)||(yield t)}if(void 0!==s.fallback){const t=s.fallback(e);void 0!==t&&(yield t)}}dirname(e){const t=this.options.fs;return Ne(t.dirname,"`fs.dirname` is required for relative reference"),t.dirname(e)}lookupError(e,t){const n=new Error("ENOENT");return n.message=`ENOENT: Failed to lookup "${e}" in "${t}"`,n.code="ENOENT",n}}class Mn{constructor(e){this.liquid=e,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new En(this.liquid.options),this.parseLimit=new ft("parse length",e.options.parseLimit)}parse(e,t){e=String(e),this.parseLimit.use(e.length);const n=new pn(e,this.liquid.options.operators,t).readTopLevelTokens(this.liquid.options);return this.parseTokens(n)}parseTokens(e){let t;const n=[],i=[];for(;t=e.shift();)try{n.push(this.parseToken(t,e))}catch(e){if(!this.liquid.options.catchAllErrors)throw e;i.push(e)}if(i.length)throw new je(i);return n}parseToken(e,t){try{if(In(e)){const n=this.liquid.tags[e.name];return Ne(n,`tag "${e.name}" not found`),new n(e,t,this.liquid,this)}return Qn(e)===Dn.Output?new xn(e,this.liquid):new Tn(e)}catch(t){if(Fe.is(t))throw t;throw new Le(t,e)}}parseStream(e){return new fn(e,((e,t)=>this.parseToken(e,t)))}*_parseFileCached(e,t,n=$n.Root,i){const s=this.cache,r=this.loader.shouldLoadRelative(e)?i+","+e:n+":"+e,o=yield s.read(r);if(o)return o;const a=this._parseFile(e,t,n,i),l=t?yield a:Qe(a);s.write(r,l);try{return yield l}catch(e){throw s.remove(r),e}}*_parseFile(e,t,n=$n.Root,i){const s=yield this.loader.lookup(e,n,t,i);return this.parse(t?this.fs.readFileSync(s):yield this.fs.readFile(s),s)}}function Pn(e){return Qn(e)===Dn.Operator}function Cn(e){return Qn(e)===Dn.HTML}function In(e){return Qn(e)===Dn.Tag}function Bn(e){return Qn(e)===Dn.Quoted}function Un(e){return Qn(e)===Dn.Number}function Hn(e){return Qn(e)===Dn.PropertyAccess}function Yn(e){return Qn(e)===Dn.Word}function Jn(e){return Qn(e)===Dn.Range}function Wn(e){return(1667&Qn(e))>0}function Qn(e){return e?e.kind:-1}!function(e){e[e.Number=1]="Number",e[e.Literal=2]="Literal",e[e.Tag=4]="Tag",e[e.Output=8]="Output",e[e.HTML=16]="HTML",e[e.Filter=32]="Filter",e[e.Hash=64]="Hash",e[e.PropertyAccess=128]="PropertyAccess",e[e.Word=256]="Word",e[e.Range=512]="Range",e[e.Quoted=1024]="Quoted",e[e.Operator=2048]="Operator",e[e.FilteredValue=4096]="FilteredValue",e[e.Delimited=12]="Delimited"}(Dn||(Dn={}));class Zn{constructor(e={},t=ln,n={},{memoryLimit:i,renderLimit:s}={}){var r,o,a,l,c;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!n.sync,this.opts=t,this.globals=null!==(r=n.globals)&&void 0!==r?r:t.globals,this.environments=ge(e)?e:Object(e),this.strictVariables=null!==(o=n.strictVariables)&&void 0!==o?o:this.opts.strictVariables,this.ownPropertyOnly=null!==(a=n.ownPropertyOnly)&&void 0!==a?a:t.ownPropertyOnly,this.memoryLimit=null!=i?i:new ft("memory alloc",null!==(l=n.memoryLimit)&&void 0!==l?l:t.memoryLimit),this.renderLimit=null!=s?s:new ft("template render",Nt().now()+(null!==(c=n.renderLimit)&&void 0!==c?c:t.renderLimit))}getRegister(e){return this.registers[e]=this.registers[e]||{}}setRegister(e,t){return this.registers[e]=t}saveRegister(...e){return e.map((e=>[e,this.getRegister(e)]))}restoreRegister(e){return e.forEach((([e,t])=>this.setRegister(e,t)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((e,t)=>Je(e,t)),{})}get(e){return this.getSync(e)}getSync(e){return Ze(this._get(e))}*_get(e){const t=this.findScope(e[0]);return yield this._getFromScope(t,e)}getFromScope(e,t){return Ze(this._getFromScope(e,t))}*_getFromScope(e,t,n=this.strictVariables){ee(t)&&(t=t.split("."));for(let i=0;i<t.length;i++)if(e=yield Gn(e,t[i],this.ownPropertyOnly),n&&void 0===e)throw new Ve(t.slice(0,i+1).join("."));return e}push(e){return this.scopes.push(e)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(e={}){return new Zn(e,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(e){for(let t=this.scopes.length-1;t>=0;t--){const n=this.scopes[t];if(e in n)return n}return e in this.environments?this.environments:this.globals}}function Gn(e,t,n){if(e=ue(e),t=ae(t),he(e))return e;if(de(e)&&t<0)return e[e.length+ +t];const i=function(e,t,n){return!n||X.call(e,t)||e instanceof Z?e[t]:void 0}(e,t,n);return void 0===i&&e instanceof Z?e.liquidMethodMissing(t):te(i)?i.call(e):"size"===t?function(e){if(X.call(e,"size")||void 0!==e.size)return e.size;if(de(e)||ee(e))return e.length;if("object"==typeof e)return Object.keys(e).length}(e):"first"===t?function(e){return de(e)?e[0]:e.first}(e):"last"===t?function(e){return de(e)?e[e.length-1]:e.last}(e):i}!function(e){e[e.OUTPUT=0]="OUTPUT",e[e.STORE=1]="STORE"}(Nn||(Nn={}));const Kn=Te(Math.abs),Xn=Te(Math.max),ei=Te(Math.min),ti=Te(Math.ceil),ni=Te(((e,t,n=!1)=>n?Math.floor(e/t):e/t)),ii=Te(Math.floor),si=Te(((e,t)=>e-t)),ri=Te(((e,t)=>e%t)),oi=Te(((e,t)=>e*t));var ai=Object.freeze({__proto__:null,abs:Kn,at_least:Xn,at_most:ei,ceil:ti,divided_by:ni,floor:ii,minus:si,modulo:ri,times:oi,round:function(e,t=0){e=ae(e),t=ae(t);const n=Math.pow(10,t);return Math.round(e*n)/n},plus:function(e,t){return e=ae(e),t=ae(t),Number(e)+Number(t)}});const li=/[^\p{M}\p{L}\p{Nd}]+/gu,ci={raw:/\s+/g,default:li,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:li,none:null};var ui=Object.freeze({__proto__:null,url_decode:e=>decodeURIComponent(se(e)).replace(/\+/g," "),url_encode:e=>encodeURIComponent(se(e)).replace(/%20/g,"+"),cgi_escape:e=>encodeURIComponent(se(e)).replace(/%20/g,"+").replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())),uri_escape:e=>encodeURI(se(e)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(e,t="default",n=!1){e=se(e);const i=ci[t];return i&&("latin"===t&&(e=function(e){return e.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(e)),e=e.replace(i,"-").replace(/^-|-$/g,"")),n?e:e.toLowerCase()}});const hi=Te((function(e,t){const n=oe(e),i=he(t)?" ":se(t),s=n.length*(1+i.length);return this.context.memoryLimit.use(s),n.join(i)})),di=Te((e=>pe(e)?me(e):"")),pi=Te((e=>pe(e)?e[0]:"")),fi=Te((function(e){const t=oe(e);return this.context.memoryLimit.use(t.length),[...t].reverse()}));function mi(e,t=[]){const n=oe(e),i=oe(t);return this.context.memoryLimit.use(n.length+i.length),n.concat(i)}var gi=Object.freeze({__proto__:null,join:hi,last:di,first:pi,reverse:fi,sort:function*(e,t){const n=[],i=oe(e);this.context.memoryLimit.use(i.length);for(const e of i)n.push([e,t?yield this.context._getFromScope(e,se(t).split("."),!1):e]);return n.sort(((e,t)=>{const n=e[1],i=t[1];return n<i?-1:n>i?1:0})).map((e=>e[0]))},sort_natural:function(e,t){const n=se(t),i=void 0===t?xe:(e,t)=>xe(e[n],t[n]),s=oe(e);return this.context.memoryLimit.use(s.length),[...s].sort(i)},size:e=>e&&e.length||0,map:function*(e,t){const n=[],i=oe(e);this.context.memoryLimit.use(i.length);for(const e of i)n.push(yield this.context._getFromScope(e,se(t),!1));return n},sum:function*(e,t){let n=0;const i=oe(e);for(const e of i){const i=Number(t?yield this.context._getFromScope(e,se(t),!1):e);n+=Number.isNaN(i)?0:i}return n},compact:function(e){const t=oe(e);return this.context.memoryLimit.use(t.length),t.filter((e=>!he(ae(e))))},concat:mi,push:function(e,t){return mi.call(this,e,[t])},unshift:function(e,t){const n=oe(e);this.context.memoryLimit.use(n.length);const i=[...n];return i.unshift(t),i},pop:function(e){const t=[...oe(e)];return t.pop(),t},shift:function(e){const t=oe(e);this.context.memoryLimit.use(t.length);const n=[...t];return n.shift(),n},slice:function(e,t,n=1){return he(e=ae(e))?[]:(de(e)||(e=se(e)),t=t<0?e.length+t:t,this.context.memoryLimit.use(n),e.slice(t,t+n))},where:function*(e,t,n){const i=[];e=oe(e),this.context.memoryLimit.use(e.length);const s=new pn(se(t)).readScopeValue();for(const t of e)i.push(yield Bt(s,this.context.spawn(t)));const r=this.context.opts.jekyllWhere?e=>Me.is(n)?Wt(e,n):de(e)?function(e,t){return e.some((e=>Wt(e,t)))}(e,n):Wt(e,n):e=>Wt(e,n);return e.filter(((e,t)=>void 0===n?Ht(i[t],this.context):r(i[t])))},where_exp:function*(e,t,n){const i=[],s=new bn(se(n),this.liquid),r=oe(e);this.context.memoryLimit.use(r.length);for(const e of r){(yield s.value(this.context.spawn({[t]:e})))&&i.push(e)}return i},group_by:function*(e,t){const n=new Map;e=re(e);const i=new pn(se(t)).readScopeValue();this.context.memoryLimit.use(e.length);for(const t of e){const e=yield Bt(i,this.context.spawn(t));n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.entries()].map((([e,t])=>({name:e,items:t})))},group_by_exp:function*(e,t,n){const i=new Map,s=new bn(se(n),this.liquid);e=re(e),this.context.memoryLimit.use(e.length);for(const n of e){const e=yield s.value(this.context.spawn({[t]:n}));i.has(e)||i.set(e,[]),i.get(e).push(n)}return[...i.entries()].map((([e,t])=>({name:e,items:t})))},find:function*(e,t,n){const i=new pn(se(t)).readScopeValue(),s=oe(e);for(const e of s){if(Wt(yield Bt(i,this.context.spawn(e)),n))return e}},find_exp:function*(e,t,n){const i=new bn(se(n),this.liquid),s=oe(e);for(const e of s){if(yield i.value(this.context.spawn({[t]:e})))return e}},uniq:function(e){return e=oe(e),this.context.memoryLimit.use(e.length),[...new Set(e)]},sample:function(e,t=1){if(he(e=ae(e)))return[];de(e)||(e=se(e)),this.context.memoryLimit.use(t);const n=[...e].sort((()=>Math.random()-.5));return 1===t?n[0]:n.slice(0,t)}});function vi(e,t,n){var i,s,r;const o=(null!==(i=null==e?void 0:e.length)&&void 0!==i?i:0)+(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0);this.context.memoryLimit.use(o);const a=wi(e,this.context.opts,n);return a?rt(a,t=he(t=ae(t))?this.context.opts.dateFormat:se(t)):e}function yi(e,t,n,i){const s=wi(e,this.context.opts);if(!s)return e;if("ordinal"===n){const e=s.getDate();return rt(s,"US"===i?`${t} ${e}%q, %Y`:`${e}%q ${t} %Y`)}return rt(s,`%d ${t} %Y`)}function wi(e,t,n){let i;const s=null!=n?n:t.timezoneOffset,r=t.locale;return i="now"===(e=ae(e))||"today"===e?new pt(Date.now(),r,s):ce(e)?new pt(1e3*e,r,s):ee(e)?/^\d+$/.test(e)?new pt(1e3*+e,r,s):t.preserveTimezones&&void 0===n?pt.createDateFixedToTimezone(e,r):new pt(e,r,s):new pt(e,r,s),i.valid()?i:void 0}var bi=Object.freeze({__proto__:null,date:vi,date_to_xmlschema:function(e){return vi.call(this,e,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(e){return vi.call(this,e,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(e,t,n){return yi.call(this,e,"%b",t,n)},date_to_long_string:function(e,t,n){return yi.call(this,e,"%B",t,n)}});const xi=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,Ti=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var ki=Object.freeze({__proto__:null,append:function(e,t){Ne(2===arguments.length,"append expect 2 arguments");const n=se(e),i=se(t);return this.context.memoryLimit.use(n.length+i.length),n+i},prepend:function(e,t){Ne(2===arguments.length,"prepend expect 2 arguments");const n=se(e),i=se(t);return this.context.memoryLimit.use(n.length+i.length),i+n},lstrip:function(e,t){const n=se(e);return this.context.memoryLimit.use(n.length),t?(t=ke(se(t)),n.replace(new RegExp(`^[${t}]+`,"g"),"")):n.replace(/^\s+/,"")},downcase:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),t.toLowerCase()},upcase:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),se(t).toUpperCase()},remove:function(e,t){const n=se(e);return this.context.memoryLimit.use(n.length),n.split(se(t)).join("")},remove_first:function(e,t){const n=se(e);return this.context.memoryLimit.use(n.length),n.replace(se(t),"")},remove_last:function(e,t){const n=se(e);this.context.memoryLimit.use(n.length);const i=se(t),s=n.lastIndexOf(i);return-1===s?n:n.substring(0,s)+n.substring(s+i.length)},rstrip:function(e,t){return e=se(e),this.context.memoryLimit.use(e.length),t?(t=ke(se(t)),e.replace(new RegExp(`[${t}]+$`,"g"),"")):e.replace(/\s+$/,"")},split:function(e,t){const n=se(e);this.context.memoryLimit.use(n.length);const i=n.split(se(t));for(;i.length&&""===i[i.length-1];)i.pop();return i},strip:function(e,t){const n=se(e);return this.context.memoryLimit.use(n.length),t?(t=ke(se(t)),n.replace(new RegExp(`^[${t}]+`,"g"),"").replace(new RegExp(`[${t}]+$`,"g"),"")):n.trim()},strip_newlines:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,"")},capitalize:function(e){return e=se(e),this.context.memoryLimit.use(e.length),e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},replace:function(e,t,n){const i=se(e);return this.context.memoryLimit.use(i.length),i.split(se(t)).join(n)},replace_first:function(e,t,n){const i=se(e);return this.context.memoryLimit.use(i.length),i.replace(se(t),n)},replace_last:function(e,t,n){const i=se(e);this.context.memoryLimit.use(i.length);const s=se(t),r=i.lastIndexOf(s);if(-1===r)return i;const o=se(n);return i.substring(0,r)+o+i.substring(r+s.length)},truncate:function(e,t=50,n="..."){const i=se(e);return this.context.memoryLimit.use(i.length),i.length<=t?e:i.substring(0,t-n.length)+n},truncatewords:function(e,t=15,n="..."){const i=se(e);this.context.memoryLimit.use(i.length);const s=i.split(/\s+/);t<=0&&(t=1);let r=s.slice(0,t).join(" ");return s.length>=t&&(r+=n),r},normalize_whitespace:function(e){const t=se(e);return this.context.memoryLimit.use(t.length),t.replace(/\s+/g," ")},number_of_words:function(e,t){const n=se(e);if(this.context.memoryLimit.use(n.length),!(e=n.trim()))return 0;switch(t){case"cjk":return(e.match(xi)||[]).length+(e.match(Ti)||[]).length;case"auto":return xi.test(e)?e.match(xi).length+(e.match(Ti)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}},array_to_sentence_string:function(e,t="and"){switch(this.context.memoryLimit.use(e.length),e.length){case 0:return"";case 1:return e[0];case 2:return`${e[0]} ${t} ${e[1]}`;default:return`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}}});const _i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},on),ai),ui),gi),bi),ki),en);const Si=["offset","limit","reversed"];function Fi(e,t,n){if(t.options.dynamicPartials){const t=e.readValue();if(e.assert(t,"illegal file path"),"none"===t.getText())return;if(Bn(t)){return Oi(n.parse(t.content))}return t}const i=[...e.readFileNameTemplate(t.options)],s=Oi(n.parseTokens(i));return"none"===s?void 0:s}function Oi(e){return 1===e.length&&Cn(e[0].token)?e[0].token.getContent():e}function*Li(e,t,n){return"string"==typeof e?e:Array.isArray(e)?n.renderer.renderTemplates(e,t):yield Bt(e,t)}class Ai extends Ce{constructor(e,t,n,i){super(e,n,i),this.length=e,this.cols=t}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const ji={assign:class extends gn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new bn(this.tokenizer.readFilteredValue(),this.liquid)}*render(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends gn{constructor(e,t,n,i){super(e,t,n);const s=this.tokenizer.readIdentifier(),r=this.tokenizer.readIdentifier(),o=this.tokenizer.readValue();if(!s.size()||"in"!==r.content||!o)throw new Error(`illegal tag: ${e.getText()}`);let a;this.variable=s.content,this.collection=o,this.hash=new vn(this.tokenizer,n.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=i.parseStream(t).on("start",(()=>a=this.templates)).on("tag:else",(e=>{Ee(e.args),a=this.elseTemplates})).on("tag:endfor",(e=>{Ee(e.args),l.stop()})).on("template",(e=>a.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){const n=this.liquid.renderer;let i=re(yield Bt(this.collection,e));if(!i.length)return void(yield n.renderTemplates(this.elseTemplates,e,t));const s="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(s)});const r=yield this.hash.render(e);e.pop();i=(this.liquid.options.orderedFilterParameters?Object.keys(r).filter((e=>Si.includes(e))):Si.filter((e=>void 0!==r[e]))).reduce(((e,t)=>{return"offset"===t?(n=e,i=r.offset,n.slice(i)):"limit"===t?function(e,t){return e.slice(0,t)}(e,r.limit):function(e){return[...e].reverse()}(e);var n,i}),i),e.setRegister(s,(r.offset||0)+i.length);const o={forloop:new Ce(i.length,this.collection.getText(),this.variable)};e.push(o);for(const s of i){if(o[this.variable]=s,e.continueCalled=e.breakCalled=!1,yield n.renderTemplates(this.templates,e,t),e.breakCalled)break;o.forloop.next()}e.continueCalled=e.breakCalled=!1,e.pop()}*children(){const e=this.templates.slice();return this.elseTemplates&&e.push(...this.elseTemplates),e}*arguments(){yield this.collection;for(const e of Object.values(this.hash.hash))Wn(e)&&(yield e)}blockScope(){return[this.variable,"forloop"]}},capture:class extends gn{constructor(e,t,n,i){for(super(e,t,n),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;t.length;){const e=t.shift();if(In(e)&&"endcapture"===e.name)return;this.templates.push(i.parseToken(e,t))}throw new Error(`tag ${e.getText()} not closed`)}readVariable(){let e=this.tokenizer.readIdentifier();if(e.content)return e;if(e=this.tokenizer.readQuoted(),e)return e;throw this.tokenizer.error("invalid capture name")}*render(e){const t=this.liquid.renderer,n=yield t.renderTemplates(this.templates,e);e.bottom()[this.variable]=n}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends gn{constructor(e,t,n,i){super(e,t,n),this.branches=[],this.elseTemplates=[],this.value=new bn(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let s=[],r=0;const o=i.parseStream(t).on("tag:when",(e=>{if(r>0)return;s=[];const t=[];for(;!e.tokenizer.end();)t.push(e.tokenizer.readValueOrThrow()),e.tokenizer.skipBlank(),","===e.tokenizer.peek()?e.tokenizer.readTo(","):e.tokenizer.readTo("or");this.branches.push({values:t,templates:s})})).on("tag:else",(()=>{r++,s=this.elseTemplates})).on("tag:endcase",(()=>o.stop())).on("template",(e=>{s===this.elseTemplates&&1!==r||s.push(e)})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));o.start()}*render(e,t){const n=this.liquid.renderer,i=ae(yield this.value.value(e,e.opts.lenientIf));let s=!1;for(const r of this.branches)for(const o of r.values){if(Wt(i,yield Bt(o,e,e.opts.lenientIf))){yield n.renderTemplates(r.templates,e,t),s=!0;break}}s||(yield n.renderTemplates(this.elseTemplates,e,t))}*arguments(){yield this.value,yield*this.branches.flatMap((e=>e.values))}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}},comment:class extends gn{constructor(e,t,n){for(super(e,t,n);t.length;){const e=t.shift();if(In(e)&&"endcomment"===e.name)return}throw new Error(`tag ${e.getText()} not closed`)}render(){}},include:class extends gn{constructor(e,t,n,i){super(e,t,n);const{tokenizer:s}=e;this.file=Fi(s,this.liquid,i),this.currentFile=e.file;const r=s.p;"with"===s.readIdentifier().content?(s.skipBlank(),":"!==s.peek()?this.withVar=s.readValue():s.p=r):s.p=r,this.hash=new vn(s,n.options.jekyllInclude||n.options.keyValueSeparator)}*render(e,t){const{liquid:n,hash:i,withVar:s}=this,{renderer:r}=n,o=yield Li(this.file,e,n);Ne(o,(()=>`illegal file path "${o}"`));const a=e.saveRegister("blocks","blockMode");e.setRegister("blocks",{}),e.setRegister("blockMode",Nn.OUTPUT);const l=yield i.render(e);s&&(l[o]=yield Bt(s,e));const c=yield n._parsePartialFile(o,e.sync,this.currentFile);e.push(e.opts.jekyllInclude?{include:l}:l),yield r.renderTemplates(c,e,t),e.pop(),e.restoreRegister(a)}*children(e,t){return e&&ee(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(ee(this.file)){let e;return this.liquid.options.jekyllInclude?e=["include"]:(e=Object.keys(this.hash.hash),this.withVar&&e.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:e}}}*arguments(){yield*Object.values(this.hash.hash).filter(Wn),Wn(this.file)&&(yield this.file),Wn(this.withVar)&&(yield this.withVar)}},render:class extends gn{constructor(e,t,n,i){super(e,t,n);const s=this.tokenizer;for(this.file=Fi(s,this.liquid,i),this.currentFile=e.file;!s.end();){s.skipBlank();const e=s.p,t=s.readIdentifier();if(("with"===t.content||"for"===t.content)&&(s.skipBlank(),":"!==s.peek())){const e=s.readValue();if(e){const n=s.p;let i;"as"===s.readIdentifier().content?i=s.readIdentifier():s.p=n,this[t.content]={value:e,alias:i&&i.content},s.skipBlank(),","===s.peek()&&s.advance();continue}}s.p=e;break}this.hash=new vn(s,n.options.keyValueSeparator)}*render(e,t){const{liquid:n,hash:i}=this,s=yield Li(this.file,e,n);Ne(s,(()=>`illegal file path "${s}"`));const r=e.spawn(),o=r.bottom();if(Je(o,yield i.render(e)),this.with){const{value:t,alias:n}=this.with;o[n||s]=yield Bt(t,e)}if(this.for){const{value:i,alias:a}=this.for,l=re(yield Bt(i,e));o.forloop=new Ce(l.length,i.getText(),a);for(const e of l){o[a]=e;const i=yield n._parsePartialFile(s,r.sync,this.currentFile);yield n.renderer.renderTemplates(i,r,t),o.forloop.next()}}else{const e=yield n._parsePartialFile(s,r.sync,this.currentFile);yield n.renderer.renderTemplates(e,r,t)}}*children(e,t){return e&&ee(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(ee(this.file)){const e=Object.keys(this.hash.hash);if(this.with){const{value:t,alias:n}=this.with;ee(n)?e.push([n,t]):ee(this.file)&&e.push([this.file,t])}if(this.for){const{value:t,alias:n}=this.for;ee(n)?e.push([n,t]):ee(this.file)&&e.push([this.file,t])}return{name:this.file,isolated:!0,scope:e}}}*arguments(){for(const e of Object.values(this.hash.hash))Wn(e)&&(yield e);if(this.with){const{value:e}=this.with;Wn(e)&&(yield e)}if(this.for){const{value:e}=this.for;Wn(e)&&(yield e)}}},decrement:class extends gn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){const n=e.environments;ce(n[this.variable])||(n[this.variable]=0),t.write(se(--n[this.variable]))}*localScope(){yield this.identifier}},increment:class extends gn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){const n=e.environments;ce(n[this.variable])||(n[this.variable]=0);const i=n[this.variable];n[this.variable]++,t.write(se(i))}*localScope(){yield this.identifier}},cycle:class extends gn{constructor(e,t,n){super(e,t,n),this.candidates=[];const i=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),i&&(":"===this.tokenizer.peek()?(this.group=i,this.tokenizer.advance()):this.candidates.push(i));!this.tokenizer.end();){const e=this.tokenizer.readValue();e&&this.candidates.push(e),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,(()=>`empty candidates: "${e.getText()}"`))}*render(e,t){const n=`cycle:${yield Bt(this.group,e)}:`+this.candidates.join(","),i=e.getRegister("cycle");let s=i[n];void 0===s&&(s=i[n]=0);const r=this.candidates[s];return s=(s+1)%this.candidates.length,i[n]=s,yield Bt(r,e)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends gn{constructor(e,t,n,i){super(e,t,n),this.branches=[];let s=[];i.parseStream(t).on("start",(()=>this.branches.push({value:new bn(e.tokenizer.readFilteredValue(),this.liquid),templates:s=[]}))).on("tag:elsif",(e=>{Ne(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new bn(e.tokenizer.readFilteredValue(),this.liquid),templates:s=[]})})).on("tag:else",(e=>{Ee(e.args),Ne(!this.elseTemplates,"duplicated else"),s=this.elseTemplates=[]})).on("tag:endif",(function(e){Ee(e.args),this.stop()})).on("template",(e=>s.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const n=this.liquid.renderer;for(const{value:i,templates:s}of this.branches){if(Ht(yield i.value(e,e.opts.lenientIf),e))return void(yield n.renderTemplates(s,e,t))}yield n.renderTemplates(this.elseTemplates||[],e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map((e=>e.value))}},layout:class extends gn{constructor(e,t,n,i){super(e,t,n),this.file=Fi(this.tokenizer,this.liquid,i),this.currentFile=e.file,this.args=new vn(this.tokenizer,n.options.keyValueSeparator),this.templates=i.parseTokens(t)}*render(e,t){const{liquid:n,args:i,file:s}=this,{renderer:r}=n;if(void 0===s)return e.setRegister("blockMode",Nn.OUTPUT),void(yield r.renderTemplates(this.templates,e,t));const o=yield Li(this.file,e,n);Ne(o,(()=>`illegal file path "${o}"`));const a=yield n._parseLayoutFile(o,e.sync,this.currentFile);e.setRegister("blockMode",Nn.STORE);const l=yield r.renderTemplates(this.templates,e),c=e.getRegister("blocks");void 0===c[""]&&(c[""]=(e,t)=>t.write(l)),e.setRegister("blockMode",Nn.OUTPUT),e.push(yield i.render(e)),yield r.renderTemplates(a,e,t),e.pop()}*children(e){const t=this.templates.slice();return e&&ee(this.file)&&t.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),t}*arguments(){for(const e of Object.values(this.args.hash))Wn(e)&&(yield e);Wn(this.file)&&(yield this.file)}partialScope(){if(ee(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends gn{constructor(e,t,n,i){super(e,t,n),this.templates=[];const s=/\w+/.exec(e.args);for(this.block=s?s[0]:"";t.length;){const e=t.shift();if(In(e)&&"endblock"===e.name)return;const n=i.parseToken(e,t);this.templates.push(n)}throw new Error(`tag ${e.getText()} not closed`)}*render(e,t){const n=this.getBlockRender(e);e.getRegister("blockMode")===Nn.STORE?e.getRegister("blocks")[this.block]=n:yield n(new Ie,t)}getBlockRender(e){const{liquid:t,templates:n}=this,i=e.getRegister("blocks")[this.block],s=function*(i,s){e.push({block:i}),yield t.renderer.renderTemplates(n,e,s),e.pop()};return i?(e,t)=>i(new Ie((()=>s(e,t))),t):s}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends gn{constructor(e,t,n){for(super(e,t,n),this.tokens=[];t.length;){const e=t.shift();if(In(e)&&"endraw"===e.name)return;this.tokens.push(e)}throw new Error(`tag ${e.getText()} not closed`)}render(){return this.tokens.map((e=>e.getText())).join("")}},tablerow:class extends gn{constructor(e,t,n,i){super(e,t,n);const s=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const r=this.tokenizer.readIdentifier(),o=this.tokenizer.readValue();if("in"!==r.content||!o)throw new Error(`illegal tag: ${e.getText()}`);let a;this.variable=s.content,this.collection=o,this.args=new vn(this.tokenizer,n.options.keyValueSeparator),this.templates=[];const l=i.parseStream(t).on("start",(()=>a=this.templates)).on("tag:endtablerow",(()=>l.stop())).on("template",(e=>a.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){let n=re(yield Bt(this.collection,e));const i=yield this.args.render(e),s=i.offset||0,r=void 0===i.limit?n.length:i.limit;n=n.slice(s,s+r);const o=i.cols||n.length,a=this.liquid.renderer,l=new Ai(n.length,o,this.collection.getText(),this.variable),c={tablerowloop:l};e.push(c);for(let i=0;i<n.length;i++,l.next())c[this.variable]=n[i],0===l.col0()&&(1!==l.row()&&t.write("</tr>"),t.write(`<tr class="row${l.row()}">`)),t.write(`<td class="col${l.col()}">`),yield a.renderTemplates(this.templates,e,t),t.write("</td>");n.length&&t.write("</tr>"),e.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const e of Object.values(this.args.hash))Wn(e)&&(yield e)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends gn{constructor(e,t,n,i){super(e,t,n),this.branches=[],this.elseTemplates=[];let s=[],r=0;i.parseStream(t).on("start",(()=>this.branches.push({value:new bn(e.tokenizer.readFilteredValue(),this.liquid),test:Yt,templates:s=[]}))).on("tag:elsif",(e=>{r>0?s=[]:this.branches.push({value:new bn(e.tokenizer.readFilteredValue(),this.liquid),test:Ht,templates:s=[]})})).on("tag:else",(()=>{r++,s=this.elseTemplates})).on("tag:endunless",(function(){this.stop()})).on("template",(e=>{s===this.elseTemplates&&1!==r||s.push(e)})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const n=this.liquid.renderer;for(const{value:i,test:s,templates:r}of this.branches){if(s(yield i.value(e,e.opts.lenientIf),e))return void(yield n.renderTemplates(r,e,t))}yield n.renderTemplates(this.elseTemplates,e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map((e=>e.value))}},break:class extends gn{render(e,t){e.breakCalled=!0}},continue:class extends gn{render(e,t){e.continueCalled=!0}},echo:class extends gn{constructor(e,t,n){super(e,t,n),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new bn(this.tokenizer.readFilteredValue(),this.liquid))}*render(e,t){if(!this.value)return;const n=yield this.value.value(e,!1);t.write(n)}*arguments(){this.value&&(yield this.value)}},liquid:class extends gn{constructor(e,t,n,i){super(e,t,n);const s=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=i.parseTokens(s)}*render(e,t){yield this.liquid.renderer.renderTemplates(this.templates,e,t)}*children(){return this.templates}},"#":class extends gn{constructor(e,t,n){if(super(e,t,n),-1!==e.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class zi{constructor(e={}){this.renderer=new Ct,this.filters={},this.tags={},this.options=cn(e),this.parser=new Mn(this),fe(ji,((e,t)=>this.registerTag(t,e))),fe(_i,((e,t)=>this.registerFilter(t,e)))}parse(e,t){return new Mn(this).parse(e,t)}_render(e,t,n){const i=t instanceof Zn?t:new Zn(t,this.options,n);return this.renderer.renderTemplates(e,i)}render(e,t,n){return We(this,void 0,void 0,(function*(){return Qe(this._render(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}renderSync(e,t,n){return Ze(this._render(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderToNodeStream(e,t,n={}){const i=new Zn(t,this.options,n);return this.renderer.renderTemplatesToNodeStream(e,i)}_parseAndRender(e,t,n){const i=this.parse(e);return this._render(i,t,n)}parseAndRender(e,t,n){return We(this,void 0,void 0,(function*(){return Qe(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}parseAndRenderSync(e,t,n){return Ze(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!0})))}_parsePartialFile(e,t,n){return new Mn(this).parseFile(e,t,$n.Partials,n)}_parseLayoutFile(e,t,n){return new Mn(this).parseFile(e,t,$n.Layouts,n)}_parseFile(e,t,n,i){return new Mn(this).parseFile(e,t,n,i)}parseFile(e,t){return We(this,void 0,void 0,(function*(){return Qe(new Mn(this).parseFile(e,!1,t))}))}parseFileSync(e,t){return Ze(new Mn(this).parseFile(e,!0,t))}*_renderFile(e,t,n){const i=yield this._parseFile(e,n.sync,n.lookupType);return yield this._render(i,t,n)}renderFile(e,t,n){return We(this,void 0,void 0,(function*(){return Qe(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}renderFileSync(e,t,n){return Ze(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderFileToNodeStream(e,t,n){return We(this,void 0,void 0,(function*(){const i=yield this.parseFile(e);return this.renderToNodeStream(i,t,n)}))}_evalValue(e,t){const n=new bn(e,this),i=t instanceof Zn?t:new Zn(t,this.options);return n.value(i)}evalValue(e,t){return We(this,void 0,void 0,(function*(){return Qe(this._evalValue(e,t))}))}evalValueSync(e,t){return Ze(this._evalValue(e,t))}registerFilter(e,t){this.filters[e]=t}registerTag(e,t){var n;this.tags[e]=te(t)?t:(n=t,class extends gn{constructor(e,t,i){super(e,t,i),te(n.parse)&&n.parse.call(this,e,t)}*render(e,t){const i=yield new vn(this.token.args,e.opts.keyValueSeparator).render(e);return yield n.render.call(this,e,t,i)}})}plugin(e){return e.call(this,zi)}express(){const e=this;let t=!0;return function(n,i,s){if(t){t=!1;const n=un(this.root);e.options.root.unshift(...n),e.options.layouts.unshift(...n),e.options.partials.unshift(...n)}e.renderFile(n,i).then((e=>s(null,e)),s)}}analyze(e,t={}){return We(this,void 0,void 0,(function*(){return On(e,t)}))}analyzeSync(e,t={}){return Ln(e,t)}parseAndAnalyze(e,t,n={}){return We(this,void 0,void 0,(function*(){return On(this.parse(e,t),n)}))}parseAndAnalyzeSync(e,t,n={}){return Ln(this.parse(e,t),n)}variables(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Object.keys(n.variables)}))}variablesSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Object.keys(n.variables)}fullVariables(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap((e=>e.map((e=>String(e)))))))}))}fullVariablesSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap((e=>e.map((e=>String(e)))))))}variableSegments(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Array.from(_e(Object.values(n.variables).flatMap((e=>e.map((e=>e.toArray()))))))}))}variableSegmentsSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Array.from(_e(Object.values(n.variables).flatMap((e=>e.map((e=>e.toArray()))))))}globalVariables(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Object.keys(n.globals)}))}globalVariablesSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Object.keys(n.globals)}globalFullVariables(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap((e=>e.map((e=>String(e)))))))}))}globalFullVariablesSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap((e=>e.map((e=>String(e)))))))}globalVariableSegments(e,t={}){return We(this,void 0,void 0,(function*(){const n=yield On(ee(e)?this.parse(e):e,t);return Array.from(_e(Object.values(n.globals).flatMap((e=>e.map((e=>e.toArray()))))))}))}globalVariableSegmentsSync(e,t={}){const n=Ln(ee(e)?this.parse(e):e,t);return Array.from(_e(Object.values(n.globals).flatMap((e=>e.map((e=>e.toArray()))))))}}const Vi={render:function(e,t){const n=r("v-icon"),i=r("v-list-item-icon"),s=r("v-text-overflow"),h=r("v-list-item-content"),d=r("v-list-item"),p=r("v-list");return o(),a(p,{nav:""},{default:l((()=>[c(d,{to:"/tta_settings/templates"},{default:l((()=>[c(i,null,{default:l((()=>[c(n,{name:"code"})])),_:1}),c(h,null,{default:l((()=>[c(s,{text:"Templates"})])),_:1})])),_:1}),c(d,{to:"/tta_settings/settings"},{default:l((()=>[c(i,null,{default:l((()=>[c(n,{name:"settings"})])),_:1}),c(h,null,{default:l((()=>[c(s,{text:"Settings"})])),_:1})])),_:1}),u(' <v-list-item to="/tta_settings/usage">\n <v-list-item-icon><v-icon name="bar_chart" /></v-list-item-icon>\n <v-list-item-content>\n <v-text-overflow text="Usage" />\n </v-list-item-content>\n </v-list-item> ')])),_:1})},__file:"settingsmodule/src/TTAnav.vue"},Ri=e=>(f("data-v-a21ba87e"),e=e(),m(),e),qi={key:0,class:"popover"},$i=Ri((()=>g("br",null,null,-1))),Di=Ri((()=>g("ul",null,[g("li",null,"HTML - preview as webpage"),g("li",null,"PDF (Preview) - watermarked, free"),g("li",null,"PDF - final version, without watermark"),g("li",null,"Code - preview without test input")],-1)));var Ni={__name:"explainPreviewMode",props:{text:{type:String,required:!0}},setup(e){const t=h(!1);return(e,n)=>{const i=r("v-icon");return o(),d("div",{class:"info-popover",onMouseenter:n[0]||(n[0]=e=>t.value=!0),onMouseleave:n[1]||(n[1]=e=>t.value=!1)},[c(i,{name:"question_mark",class:"info-icon"}),t.value?(o(),d("div",qi,[p(" The preview mode has 4 modes: "),$i,Di])):u("v-if",!0)],32)}}},Ei=[],Mi=[];function Pi(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",s=!0===t.singleTag,r="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(s){var o=Ei.indexOf(r);-1===o&&(o=Ei.push(r)-1,Mi[o]={}),n=Mi[o]&&Mi[o][i]?Mi[o][i]:Mi[o][i]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),s=0;s<n.length;s++)e.setAttribute(n[s],t.attributes[n[s]]);var o="prepend"===i?"afterbegin":"beforeend";return r.insertAdjacentElement(o,e),e}}Pi("\n.info-popover[data-v-a21ba87e] {\n position: relative;\n display: flex;\n color: var(--theme--foreground-subdued);\n}\n.info-icon[data-v-a21ba87e] {\n margin: auto;\n}\n.popover[data-v-a21ba87e] {\n position: absolute;\n top: 175%;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--theme--background);\n color: var(--theme--foreground);\n border: 1px solid var(--theme--border);\n padding: 0.5rem;\n border-radius: 4px;\n white-space: nowrap;\n z-index: 1000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n}\n",{}),Ni.__scopeId="data-v-a21ba87e",Ni.__file="settingsmodule/src/explainPreviewMode.vue";const Ci=g("div",{class:"field half"},[g("div",{class:"type-label"},"Template name")],-1),Ii=g("div",{class:"field half"},[g("div",{class:"type-label"},"Description")],-1),Bi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Format")],-1),Ui=g("div",{class:"field half"},[g("div",{class:"type-label"},"Orientation")],-1),Hi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Collection")],-1),Yi={key:0,class:"TTA-popup"},Ji={class:"TTA-toolbar"},Wi={class:"right-side"},Qi={class:"setwidth"},Zi={class:"TTA-action"},Gi={class:"TTA-wapper"},Ki={class:"devFields"},Xi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Type input")],-1),es={id:"partSelect"},ts=["src","srcDoc"];var ns=v({__name:"templates",setup(e){const{useCollectionsStore:i,useFlowsStore:s}=t(),f=s(),m=y((()=>f.flows.filter((e=>"webhook"===e.trigger&&"POST"==e.options.method)).map((e=>({text:e.name,value:e.id}))))),v=h([]),O=h(!1),L=h(!1),A=h("Development"),j=h("html"),z=h(""),V=h(50),R=y((()=>100-V.value)),q=y((()=>100-R.value)),$=h("");function D(e){"Header"==A.value?P.value.header=e:"Body"==A.value?P.value.template=e:P.value.footer=e}function N(e){"Fixed"==P.value.input_type?P.value.input_fixed=e:P.value.input_flow_body=e}w((()=>A.value),(e=>{"Development"==e&&($.value=""),"Header"==e&&($.value=P.value.header),"Body"==e&&($.value=P.value.template),"Footer"==e&&($.value=P.value.footer)}),{immediate:!0});const E=n(),M={template:"<h1>Hello {{name}}!</h1>",id:-1,name:"",description:"",collection:"",format:"A4",orientation:"portrait",header:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; \n -webkit-print-color-adjust: exact;\n }\n</style>\n<div style='width:100%'>\n <span class='date'></span>\n <span class='title' style='float:right'></span>\n</div>",footer:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; -webkit-print-color-adjust: exact;\n }\n</style>\n<div\n style=‘width:100%’>\n <div style=‘float:right’><span\n class='pageNumber'></span> / <span class='totalPages'></span>\n </div>\n</div>",input_type:"Fixed",input_fixed:'{"name": "World!"}',input_flow:"",input_flow_body:"{}"},P=h(structuredClone(M)),C=i(),I=y((()=>C.collections.filter((e=>"TTA_htmltemplates"!=e.collection)).map((e=>({text:e.name,value:e.collection}))))),B=new zi;async function U(e=0){z.value="rendering";let t={};try{if("Flow"==P.value.input_type){const e=await E.post("/flows/trigger/"+P.value.input_flow,JSON.parse(P.value.input_flow_body));if("object"!=typeof e.data)throw new Error("Output of flow should be an object, not an "+typeof e.data);if("name"in e.data&&"code"in e.data&&"status"in e.data)throw new Error(JSON.stringify(e.data));t=e.data}else null==P.value.input_fixed&&(P.value.input_fixed="{}"),t=JSON.parse(P.value.input_fixed);if(console.log({mode:e}),"html"==e||"code"==e){const n=(P.value.header||"")+(P.value.template||"")+(P.value.footer||""),i=new Blob(['<style>\n .date:before{content: "Date here";font-style: italic; }\n .title:before{content: "Title here";font-style: italic; }\n .pageNumber:before{content: "Pagenumber";font-style: italic; }\n .totalPages:before{content: "Total pages";font-style: italic; }\n </style>'+("code"==e?n:await B.render(B.parse(n),t))],{type:"text/html"});z.value=URL.createObjectURL(i)}else{const e=B.parse(P.value.header||""),n=B.parse(P.value.template),i=B.parse(P.value.footer||""),s=await B.render(e,t),r=await B.render(n,t),o=await B.render(i,t),a=await E.get("/settings"),l=await fetch("https://text-to-anything.p.rapidapi.com/generatePDF/"+("pdf-preview"==j.value?"preview":""),{body:JSON.stringify({...P.value,input_fixed:void 0,input_flow:void 0,input_flow_body:void 0,input_type:void 0,id:void 0,header:s,html:r,footer:o,landscape:"portrait"!=P.value.orientation}),method:"POST",headers:{"X-RapidAPI-Key":a.data.data.TTA_KEY,"Content-Type":"application/json"}}).then((e=>e.blob())).then((e=>URL.createObjectURL(e))).catch(console.error);console.log({download:l}),z.value=l}}catch(e){console.error(e),z.value="Error occurred: "+((null==e?void 0:e.message)||e)}}async function H(){const e=await E.get("/items/TTA_htmltemplates",{params:{limit:-1}});v.value=e.data.data}async function Y(){-1==P.value.id?await E.post("/items/TTA_htmltemplates",{...P.value,id:void 0}):await E.patch("/items/TTA_htmltemplates/"+P.value.id,{...P.value,id:void 0}),O.value=!1,H()}function J({item:e}){P.value=e,L.value=!0}function Q(){P.value=structuredClone(M),L.value=!1}function Z(){P.value.template=W(P.value.template),P.value.footer=W(P.value.footer),P.value.header=W(P.value.header)}return w((()=>P.value.id),((e,t)=>{e!=t&&(A.value="",b((()=>{A.value="Body"})))})),w((()=>[P.value.header,P.value.template,P.value.footer,P.value.input_type,P.value.input_flow,P.value.input_fixed,j.value]),(()=>{["html","code"].includes(j.value)&&U(j.value)}),{deep:!0,immediate:!0}),x((async()=>{V.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),H()})),w((()=>V.value),(e=>localStorage.setItem("TTA-widthPartition",e+""))),(e,t)=>{const n=r("v-icon"),i=r("v-button"),s=r("v-card-title"),h=r("v-input"),f=r("v-list-item-content"),y=r("v-list-item"),w=r("v-select"),b=r("v-list"),x=r("v-card-text"),E=r("v-card-actions"),M=r("v-card"),C=r("v-dialog"),B=r("VSelect"),H=r("v-slider"),W=r("VButton"),G=r("v-table"),K=r("private-view");return o(),a(K,{title:"Templates"},{navigation:l((()=>[c(Vi)])),actions:l((()=>[c(i,{rounded:"",icon:"",onClick:t[0]||(t[0]=e=>O.value=!0)},{default:l((()=>[c(n,{name:"add"})])),_:1}),c(C,{modelValue:O.value,"onUpdate:modelValue":t[7]||(t[7]=e=>O.value=e),persistent:!0},{default:l((()=>[c(M,null,{default:l((()=>[c(s,null,{default:l((()=>[p("Create a new HTML template")])),_:1}),c(x,null,{default:l((()=>[c(b,null,{default:l((()=>[c(y,null,{default:l((()=>[c(f,null,{default:l((()=>[Ci,c(h,{modelValue:P.value.name,"onUpdate:modelValue":t[1]||(t[1]=e=>P.value.name=e),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),c(y,null,{default:l((()=>[c(f,null,{default:l((()=>[Ii,c(h,{modelValue:P.value.description,"onUpdate:modelValue":t[2]||(t[2]=e=>P.value.description=e),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),c(y,null,{default:l((()=>[c(f,null,{default:l((()=>[Bi,c(w,{modelValue:P.value.format,"onUpdate:modelValue":t[3]||(t[3]=e=>P.value.format=e),placeholder:"Size",items:["A1","A2","A3","A4","A5","A6","Letter","Legal","Tabloid","Ledger"].map((e=>({text:e,value:e})))},null,8,["modelValue","items"])])),_:1})])),_:1}),c(y,null,{default:l((()=>[c(f,null,{default:l((()=>[Ui,c(w,{modelValue:P.value.orientation,"onUpdate:modelValue":t[4]||(t[4]=e=>P.value.orientation=e),placeholder:"Orientation",items:["portrait","landscape"].map((e=>({text:e,value:e})))},null,8,["modelValue","items"])])),_:1})])),_:1}),c(y,null,{default:l((()=>[c(f,null,{default:l((()=>[Hi,c(w,{modelValue:P.value.collection,"onUpdate:modelValue":t[5]||(t[5]=e=>P.value.collection=e),items:T(I),placeholder:"Collection"},null,8,["modelValue","items"])])),_:1})])),_:1})])),_:1})])),_:1}),c(E,null,{default:l((()=>[c(i,{secondary:"",onClick:t[6]||(t[6]=e=>O.value=!1)},{default:l((()=>[p(" Cancel ")])),_:1}),c(i,{disabled:!P.value.collection||!P.value.name||!P.value.format,onClick:Y},{default:l((()=>[p(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:l((()=>[L.value?(o(),d("div",Yi,[g("div",Ji,[g("div",{onClick:t[8]||(t[8]=e=>O.value=!0),class:"TTA-template-title"},[p(k(P.value.name)+" ",1),c(n,{name:"edit"})]),g("div",Wi,[c(B,{modelValue:j.value,"onUpdate:modelValue":t[9]||(t[9]=e=>j.value=e),items:[{text:"HTML",value:"html"},{text:"PDF (Preview)",value:"pdf-preview"},{text:"PDF",value:"pdf"},{text:"Code",value:"code"}],style:{width:"170px"}},null,8,["modelValue","items"]),c(Ni,{text:"This is helpful info."}),g("div",{class:"TTA-action",onClick:Z},[c(n,{name:"vertical_align_center"})]),g("div",{class:"TTA-action",onClick:Y},[c(n,{name:"save"})]),g("div",Qi,[c(H,{modelValue:V.value,"onUpdate:modelValue":t[10]||(t[10]=e=>V.value=e),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),g("div",Zi,[c(n,{name:"close",onClick:Q})])])]),g("div",Gi,[g("div",{style:_("width: "+T(q)+"%"),class:"TTA-editor-wrapper"},["Development"==A.value?(o(),d(S,{key:0},[g("div",Ki,[Xi,c(w,{modelValue:P.value.input_type,"onUpdate:modelValue":t[11]||(t[11]=e=>P.value.input_type=e),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==P.value.input_type?(o(),a(w,{key:0,modelValue:P.value.input_flow,"onUpdate:modelValue":t[12]||(t[12]=e=>P.value.input_flow=e),class:"max-w-input",items:T(m)},null,8,["modelValue","items"])):u("v-if",!0)]),"Fixed"==P.value.input_type?(o(),a(F("interface-input-code"),{key:0,class:"TTA-editor",value:P.value.input_fixed,language:"json",onInput:N},null,40,["value"])):u("v-if",!0),"Flow"==P.value.input_type?(o(),a(F("interface-input-code"),{key:1,class:"TTA-editor",value:P.value.input_flow_body,language:"json",onInput:N},null,40,["value"])):u("v-if",!0)],64)):u("v-if",!0),"Development"!=A.value?(o(),a(F("interface-input-code"),{key:1,class:"TTA-editor",value:$.value,language:"htmlmixed",onInput:D},null,40,["value"])):u("v-if",!0),g("div",es,[c(w,{modelValue:A.value,"onUpdate:modelValue":t[13]||(t[13]=e=>A.value=e),items:[{value:"Header",text:"Header"},{value:"Body",text:"Body"},{value:"Footer",text:"Footer"},{value:"Development",text:"Test input"}]},null,8,["modelValue"])])],4),g("iframe",{class:"TTA-preview",src:"rendering"==z.value?void 0:z.value,srcDoc:"rendering"==z.value?T('\n <html>\n <head>\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n font-family: sans-serif;\n background: #f9f9f9;\n }\n .spinner {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .loader {\n border: 6px solid #f3f3f3;\n border-top: 6px solid #3498db;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n margin-bottom: 10px;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n </head>\n <body>\n <div class="spinner">\n <div class="loader"></div>\n <div>Loading...</div>\n </div>\n </body>\n </html>'):void 0,style:_("width: "+T(R)+"%")},null,12,ts),j.value.startsWith("pdf")?(o(),a(W,{key:0,onClick:t[14]||(t[14]=e=>{U("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:l((()=>[c(n,{name:"refresh"})])),_:1})):u("v-if",!0)])])):u("v-if",!0),c(G,{headers:[{text:"Name",value:"name"},{text:"Description",value:"description"},{text:"Collection",value:"collection"},{text:"Format",value:"format"}],"onClick:row":J,items:v.value},null,8,["items"])])),_:1})}}});Pi("\n.TTA-popup {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n flex-direction: column;\n background-color: var(--background-subdued);\n}\n.TTA-toolbar {\n background-color: var(--background-subdued);\n display: flex;\n justify-content: space-between;\n}\n.TTA-toolbar .right-side {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.TTA-toolbar .TTA-slider {\n padding-top: 5px;\n}\n.TTA-toolbar .TTA-action {\n padding: 5px;\n cursor: pointer;\n}\n.TTA-toolbar .setwidth {\n display: flex;\n gap: 10px;\n padding-top: 6px;\n}\n.TTA-toolbar .TTA-template-title {\n margin: auto 0;\n font-size: 18px;\n cursor: pointer;\n padding-right: 5px;\n padding-left: 20px;\n border-bottom: 1px solid var(--v-list-item-border-color);\n}\n.TTA-toolbar .TTA-template-title i {\n padding-left: 5px;\n}\n.TTA-wapper {\n display: flex;\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n}\n.TTA-preview {\n flex-grow: 1;\n background-color: white;\n border: 0;\n}\n.TTA-editor {\n flex-grow: 1;\n height: 100%;\n width: 100%;\n max-height: calc(100vh - 130px);\n}\n.TTA-wapper .TTA-editor-wrapper {\n position: relative;\n}\n.TTA-editor > div {\n height: 100% !important;\n border-radius: 0 !important;\n}\n.TTA-editor .CodeMirror {\n height: 100%;\n}\n.TTA-wapper #partSelect {\n position: absolute;\n right: 0;\n top: 0;\n width: 200px;\n}\n.devFields {\n border-top: var(--theme--border-width) solid\n var(--theme--form--field--input--border-color);\n margin-left: 25px;\n margin-bottom: 10px;\n}\n.max-w-input {\n max-width: 250px;\n padding: 10px 0;\n}\n.max-w-input .v-input {\n max-width: 250px;\n margin-bottom: 5px;\n}\n#generatePDF {\n position: fixed;\n top: 69px;\n right: 10px;\n}\n",{}),ns.__file="settingsmodule/src/templates.vue";const is=e=>(f("data-v-014dce90"),e=e(),m(),e),ss={class:"px-5"},rs=is((()=>g("span",{class:"field-name"},"RapidAPI token",-1)));var os=v({__name:"settings",setup(e){const t=h(""),i=h(!1),s=n(),u=h([]);async function f(){i.value=!0,await s.patch("/settings",{TTA_KEY:t.value}),setTimeout((()=>{i.value=!1}),500)}return x((async()=>{const e=await s.get("/settings");t.value=e.data.data.TTA_KEY;const n=await s.get("/folders");u.value=n.data.data.map((e=>({text:e.name,value:e.id})))})),(e,n)=>{const s=r("v-card-title"),u=r("v-input"),h=r("v-card-text"),m=r("v-icon"),v=r("v-button"),y=r("v-progress-circular"),w=r("v-card-actions"),b=r("v-card"),x=r("private-view");return o(),a(x,{title:"Settings"},{navigation:l((()=>[c(Vi)])),default:l((()=>[g("div",ss,[c(b,{class:"w-full"},{default:l((()=>[c(s,null,{default:l((()=>[p("API settings")])),_:1}),c(h,{class:"fields-spacing"},{default:l((()=>[g("div",null,[rs,c(u,{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=e=>t.value=e)},null,8,["modelValue"])])])),_:1}),c(w,null,{default:l((()=>[c(v,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank"},{default:l((()=>[c(m,{name:"open_in_new"}),p(" Get RapidAPI token ")])),_:1}),c(v,{onClick:f,disabled:i.value},{default:l((()=>[i.value?(o(),a(y,{key:1,small:!0,indeterminate:""})):(o(),d(S,{key:0},[p(" Save ")],64))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});Pi("\n.w-full[data-v-014dce90] {\n width: 100%;\n}\n.px-5[data-v-014dce90] {\n padding: 0 2.5rem;\n}\n.fields-spacing[data-v-014dce90] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n",{}),os.__scopeId="data-v-014dce90",os.__file="settingsmodule/src/settings.vue";var as=v({__name:"usage",setup:e=>(e,t)=>{const n=r("private-view");return o(),a(n,{title:"Usage"},{navigation:l((()=>[c(Vi)])),default:l((()=>[p(" Comming soon! ")])),_:1})}});as.__file="settingsmodule/src/usage.vue";var ls=i({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:ns},{path:"settings",component:os},{path:"usage",component:as}]}),cs=v({__name:"interface",props:["value"],emits:["input"],setup(e,{emit:t}){const n=e,i=O("api"),s=h(""),l=h([]);return x((async()=>{s.value=n.value,w((()=>s.value),((e,n)=>{e!=n&&t("input",e)}));const e=await i.get("/items/TTA_htmltemplates");l.value=e.data.data.map((e=>({text:e.name,value:e.id})))})),(e,t)=>{const n=r("v-select");return o(),a(n,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=e=>s.value=e),items:l.value},null,8,["modelValue","items"])}}});cs.__file="PDFTemplateSelector/src/interface.vue";var us=s({id:"TTA-pdf-template-selector",name:"PDF template selector",icon:"picture_as_pdf",description:"Selector for a PDF template for Text To Anything",component:cs,options:null,types:["string"]}),hs=v({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0}},setup(e){const t=e,i=n(),s=h(!1);async function c(){s.value=!0;try{const e=await i.post("/flows/trigger/"+t.flow,{id:t.primaryKey});window.open("/assets/"+e.data,"_blank")}catch(e){}s.value=!1}return(e,n)=>{const i=r("v-button");return o(),a(i,{onClick:c,loading:s.value,disabled:s.value},{default:l((()=>[p(k(t.label),1)])),_:1},8,["loading","disabled"])}}});hs.__file="GeneratePDFFromTemplateInterface/src/interface.vue";const ds=[us,s({id:"tta-download-interface",name:"Download interface",icon:"sim_card_download",description:"Download files based on a flow. (Text to anything)",hideLabel:!0,hideLoader:!0,component:hs,options:()=>{const{useFlowsStore:e}=t(),n=e();return[{field:"label",type:"string",name:"$t:label",meta:{width:"full",interface:"system-input-translated-string",options:{placeholder:"$t:label"}}},{field:"flow",name:"$t:operations.trigger.flow",type:"string",meta:{width:"full",interface:"select-dropdown",options:{choices:y((()=>n.flows.filter((e=>"webhook"===e.trigger&&"POST"==e.options.method)).map((e=>({text:e.name,value:e.id}))))),iconRight:"bolt",placeholder:"$t:a_flow_uuid"}}}]},types:["string"]})],ps=[],fs=[],ms=[ls],gs=[],vs=[L,A,j,z];export{ps as displays,ds as interfaces,fs as layouts,ms as modules,vs as operations,gs as panels};
|
|
1
|
+
import{defineOperationApp as e,useStores as t,useApi as n,defineModule as i,defineInterface as r}from"@directus/extensions-sdk";import{resolveComponent as s,openBlock as a,createBlock as o,withCtx as l,createVNode as u,createCommentVNode as c,ref as h,createElementBlock as d,createTextVNode as p,pushScopeId as f,popScopeId as m,createElementVNode as g,defineComponent as v,computed as x,watch as y,nextTick as b,onMounted as w,unref as k,toDisplayString as T,normalizeStyle as _,Fragment as S,resolveDynamicComponent as F,inject as O,onBeforeUnmount as L,withModifiers as A,renderList as z,reactive as j,onUnmounted as R,Teleport as V,renderSlot as C}from"vue";var E=e({id:"ttabarcode",name:"TTA generate barcode",icon:"barcode",description:"Generate a barcode trough Text to anything!",overview:({barcodeContent:e})=>[{label:"barcode content",text:e}],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((e=>({text:e,value:e})))}}},{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"}}]}),q=e({id:"ttapdf",name:"TTA generate PDF",icon:"picture_as_pdf",description:"Generate a PDF trough Text to anything!",overview:({filename:e})=>[{label:"File name",text:e}],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)}}}]}),D=e({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:e})=>[{label:"File name",text:e}],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"}}}]}),M=e({id:"ttaqrcode",name:"TTA generate QRcode",icon:"qr_code",description:"Generate a QRcode trough Text to anything!",overview:({content:e})=>[{label:"QRCode content",text:e}],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 $=String.raw`[A-Za-z][^/\s>]*`,N=String.raw`\B"(?:\\[^<>\n]|[^\\"<>\n])*"(?!\w)`,P=String.raw`\B'(?:\\[^<>\n]|[^\\'<>\n])*'(?!\w)`,I=String.raw`${N}|${P}`,B=String.raw`"(?<quotedAttrValue>[^"]*)"`,U=String.raw`'(?<singleQuotedAttrValue>[^']*)'`,H=String.raw`(?<unquotedAttrValue>[^\s"'\`=<>]+)`,G=String.raw`[^=\s>/"']+(?=[=>\s]|$)`,Y=String.raw`${B}|${U}|${H}`,J=String.raw`(?<attrName>${G})(?:\s*=\s*(?:${Y}))?`,K=String.raw`${I}|[^\s>]*[^\s>/]|[^\s>]*/(?!\s*>)`,W=String.raw`(?<attrSpace>\s*)(?:${J}|(?<attrText>${K}))`,Q={comment:String.raw`<!--.*?-->`,dtd:String.raw`<![^>]+>`,startTag:String.raw`<(?<startTagName>${$})(?<attrs>(?:${W})*)\s*(?<closingSlash>/?)\s*>`,endTag:String.raw`</(?<endTagName>${$})\s*>`,space:String.raw`\s+`,text:String.raw`[^<\s"']+|${I}|['"]`,wildcard:String.raw`.`},Z=Object.entries(Q).map((([e,t])=>`(?<${e}>${t})`)).join("|");const X=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]);function ee(e,t=" ",n=80){const i=new RegExp(Z,"gys"),r=new RegExp(W,"gy"),s=[];let a=null,o=0,l=0,u="",c=0,h="";const d=()=>{if(h&&"\n"!=h){const e=u.indexOf("\n"),t=-1==e?u.length:e;l+h.length+t>n&&(h="\n")}const e="\n"==h&&u?t.repeat(c):"",i=`${h}${e}${u}`;if(i){const e=i.lastIndexOf("\n");-1==e?l+=i.length:l=i.length-e-1,s.push(i)}u=h=""},p=(...e)=>{for(const t of e)!a&&/^\s+$/.test(t)?(d(),h=t):(u||(c=o),u+=t)};for(const t of function*(e,t){let n,{lastIndex:i}=e;for(;n=e.exec(t);)yield n,({lastIndex:i}=e);if(i!=t.length)throw new Error("Failed to parse string")}(i,e)){if(ee.__strict&&t.groups.wildcard)throw new Error("Unexpected wildcard");if(t.groups.endTag){const e=t.groups.endTagName.toLowerCase();e==a&&(a=null),a||(--o,p(`</${e}>`))}if(a)p(t[0]);else if(t.groups.space)p(...t[0].match(/\n/g)?.slice(0,2)??[" "]);else if(t.groups.comment||t.groups.dtd||t.groups.text||t.groups.wildcard)p(t[0]);else if(t.groups.startTag){const e=t.groups.startTagName.toLowerCase();if(p(`<${e}`),++o,t.groups.attrs){let e,n,{lastIndex:i}=r;for(;e=r.exec(t.groups.attrs);){if(({lastIndex:i}=r),ee.__strict&&e.groups.attrText)throw new Error("Unexpected attr text");e.groups.attrText?(e.groups.attrSpace&&p(/\n/.test(e.groups.attrSpace)?"\n":" "),p(e.groups.attrText)):(!e.groups.attrSpace&&n?.groups.attrText||p(/\n/.test(e.groups.attrSpace)?"\n":" "),p(`${e.groups.attrName}${e.groups.quotedAttrValue?`="${e.groups.quotedAttrValue}"`:e.groups.singleQuotedAttrValue?`='${e.groups.singleQuotedAttrValue}'`:e.groups.unquotedAttrValue?`=${e.groups.unquotedAttrValue}`:""}`)),n=e}if(i!=t.groups.attrs.length)throw new Error("Failed to parse attributes")}const n=Boolean(t.groups.closingSlash);p(n?" />":">"),n||X.has(e)?--o:["pre","textarea","script","style"].includes(e)&&(a=e)}}d();let f=!1;for(;/^\s+$/.test(s[s.length-1]);){const e=s.pop();/\n/.test(e)&&(f=!0)}return f&&s.push("\n"),s.join("")}ee.default=ee;var te=ee;class ne{constructor(e,t,n,i,r){this.kind=e,this.input=t,this.begin=n,this.end=i,this.file=r}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[e,t]=[1,1];for(let n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,t=1):t++;return[e,t]}size(){return this.end-this.begin}}class ie{liquidMethodMissing(e){}}const re=Object.prototype.toString,se=String.prototype.toLowerCase,ae=Object.hasOwnProperty;function oe(e){return"string"==typeof e}function le(e){return"function"==typeof e}function ue(e){return e&&le(e.then)}function ce(e){return e&&le(e.next)&&le(e.throw)&&le(e.return)}function he(e){return oe(e=fe(e))?e:xe(e)?"":ye(e)?e.map((e=>he(e))).join(""):String(e)}function de(e){return ye(e=fe(e))?e:oe(e)&&e.length>0?[e]:Te(t=e)&&Symbol.iterator in t?Array.from(e):Te(e)?Object.keys(e).map((t=>[t,e[t]])):[];var t}function pe(e){return xe(e=fe(e))?[]:ye(e)?e:[e]}function fe(e){return e instanceof ie&&le(e.valueOf)?e.valueOf():e}function me(e){return e=Number(e),isNaN(e)?0:e}function ge(e){return"number"==typeof e}function ve(e){return e&&le(e.toLiquid)?ve(e.toLiquid()):e}function xe(e){return null==e}function ye(e){return"[object Array]"===re.call(e)}function be(e){return e&&ge(e.length)}function we(e,t){e=e||{};for(const n in e)if(ae.call(e,n)&&!1===t(e[n],n,e))break;return e}function ke(e){return e[e.length-1]}function Te(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}function _e(e,t,n=1){const i=[];for(let r=e;r<t;r+=n)i.push(r);return i}function Se(e,t,n=" "){return Fe(e,t,n,((e,t)=>t+e))}function Fe(e,t,n,i){let r=t-(e=String(e)).length;for(;r-- >0;)e=i(e,n);return e}function Oe(e){return e}function Le(e,t){return null==e&&null==t?0:null==e?1:null==t||(e=se.call(e))<(t=se.call(t))?-1:e>t?1:0}function Ae(e){return function(...t){return e.call(this,...t.map(fe))}}function ze(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*je(e){const t=new Set;for(const n of e){const e=JSON.stringify(n);t.has(e)||(t.add(e),yield n)}}const Re="__liquidClass__";class Ve extends Error{constructor(e,t){super("string"==typeof e?e:e.message),this.context="","string"!=typeof e&&Object.defineProperty(this,"originalError",{value:e,enumerable:!1}),Object.defineProperty(this,"token",{value:t,enumerable:!1}),Object.defineProperty(this,Re,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:Pe(this.token),enumerable:!1}),this.message=function(e,t){t.file&&(e+=`, file:${t.file}`);const[n,i]=t.getPosition();return e+=`, line:${n}, col:${i}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(e){return"LiquidError"===(null==e?void 0:e[Re])}}class Ce extends Ve{constructor(e,t){super(e,t),this.name="TokenizationError",super.update()}}class Ee extends Ve{constructor(e,t){super(e,t),this.name="ParseError",this.message=e.message,super.update()}}class qe extends Ve{constructor(e,t){super(e,t.token),this.name="RenderError",this.message=e.message,super.update()}static is(e){return"RenderError"===e.name}}class De extends Ve{constructor(e){super(e[0],e[0].token),this.errors=e,this.name="LiquidErrors";const t=e.length>1?"s":"";this.message=`${e.length} error${t} found`,super.update()}static is(e){return"LiquidErrors"===e.name}}class Me extends Ve{constructor(e,t){super(e,t),this.name="UndefinedVariableError",this.message=e.message,super.update()}}class $e extends Error{constructor(e){super(`undefined variable: ${e}`),this.name="InternalUndefinedVariableError",this.variableName=e}}class Ne extends Error{constructor(e){super(e),this.name="AssertionError",this.message=e+""}}function Pe(e){const[t,n]=e.getPosition(),i=e.input.split("\n"),r=Math.max(t-2,1),s=Math.min(t+3,i.length);return _e(r,s+1).map((e=>{let r=`${e===t?">> ":" "}${Se(String(e),String(s).length)}| `;const a=e===t?"\n"+Se("^",n+r.length):"";return r+=i[e-1],r+=a,r})).join("\n")}const Ie=[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 Be(e){const t=e.charCodeAt(0);return t>=128?!Ie[t]:!!(1&Ie[t])}function Ue(e,t){if(!e){const n="function"==typeof t?t():t||`expect ${e} to be true`;throw new Ne(n)}}function He(e,t=`unexpected ${JSON.stringify(e)}`){Ue(!e,t)}Ie[160]=Ie[5760]=Ie[6158]=Ie[8192]=Ie[8193]=Ie[8194]=Ie[8195]=Ie[8196]=Ie[8197]=Ie[8198]=Ie[8199]=Ie[8200]=Ie[8201]=Ie[8202]=Ie[8232]=Ie[8233]=Ie[8239]=Ie[8287]=Ie[12288]=4,Ie[8220]=Ie[8221]=128;class Ge extends ie{equals(e){return!(e instanceof Ge)&&(oe(e=fe(e))||ye(e)?0===e.length:!!Te(e)&&0===Object.keys(e).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(e){return e instanceof Ge}}class Ye extends Ge{equals(e){return!1===e||(!!xe(fe(e))||(oe(e)?/^\s*$/.test(e):super.equals(e)))}static is(e){return e instanceof Ye}}class Je extends ie{constructor(e,t,n){super(),this.i=0,this.length=e,this.name=`${n}-${t}`}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 Ke extends ie{constructor(e=()=>""){super(),this.superBlockRender=e}super(){return this.superBlockRender()}}function We(e){return e&&le(e.equals)&&le(e.gt)&&le(e.geq)&&le(e.lt)&&le(e.leq)}const Qe=new class extends ie{equals(e){return xe(fe(e))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},Ze={true:!0,false:!1,nil:Qe,null:Qe,empty:new Ge,blank:new Ye};function Xe(e){const t={};for(const[n,i]of Object.entries(e)){let e=t;for(let t=0;t<n.length;t++){const i=n[t];e[i]=e[i]||{},t===n.length-1&&Be(n[t])&&(e[i].needBoundary=!0),e=e[i]}e.data=i,e.end=!0}return t}var et=function(){return et=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},et.apply(this,arguments)};function tt(e,t,n,i){return new(n||(n=Promise))((function(r,s){function a(e){try{l(i.next(e))}catch(e){s(e)}}function o(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((i=i.apply(e,t||[])).next())}))}function nt(e){return tt(this,void 0,void 0,(function*(){if(!ce(e))return e;let t,n=!1,i="next";do{const r=e[i](t);n=r.done,t=r.value,i="next";try{ce(t)&&(t=nt(t)),ue(t)&&(t=yield t)}catch(e){i="throw",t=e}}while(!n);return t}))}function it(e){if(!ce(e))return e;let t,n=!1,i="next";do{const r=e[i](t);if(n=r.done,t=r.value,i="next",ce(t))try{t=it(t)}catch(e){i="throw",t=e}}while(!n);return t}const rt=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function st(e){const t=function(e){const t=e.getFullYear();return!(3&t||!(t%100||t%400==0&&t))}(e)?29:28;return[31,t,31,30,31,30,31,31,30,31,30,31]}function at(e){let t=0;for(let n=0;n<e.getMonth();++n)t+=st(e)[n];return t+e.getDate()}function ot(e,t){const n=at(e)+(t-e.getDay()),i=7-new Date(e.getFullYear(),0,1).getDay()+t;return String(Math.floor((n-i)/7)+1)}const lt={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},ut=new Set("aAbBceklpP");function ct(e,t){const n=Math.abs(e.getTimezoneOffset()),i=Math.floor(n/60),r=n%60;return(e.getTimezoneOffset()>0?"-":"+")+Se(i,2,"0")+(t.flags[":"]?":":"")+Se(r,2,"0")}const ht={a:e=>e.getShortWeekdayName(),A:e=>e.getLongWeekdayName(),b:e=>e.getShortMonthName(),B:e=>e.getLongMonthName(),c:e=>e.toLocaleString(),C:e=>function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}(e),d:e=>e.getDate(),e:e=>e.getDate(),H:e=>e.getHours(),I:e=>String(e.getHours()%12||12),j:e=>at(e),k:e=>e.getHours(),l:e=>String(e.getHours()%12||12),L:e=>e.getMilliseconds(),m:e=>e.getMonth()+1,M:e=>e.getMinutes(),N:(e,t)=>{const n=Number(t.width)||9;return function(e,t,n=" "){return Fe(e,t,n,((e,t)=>e+t))}(String(e.getMilliseconds()).slice(0,n),n,"0")},p:e=>e.getHours()<12?"AM":"PM",P:e=>e.getHours()<12?"am":"pm",q:e=>function(e){const t=e.getDate();if([11,12,13].includes(t))return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(e),s:e=>Math.round(e.getTime()/1e3),S:e=>e.getSeconds(),u:e=>e.getDay()||7,U:e=>ot(e,0),w:e=>e.getDay(),W:e=>ot(e,1),x:e=>e.toLocaleDateString(),X:e=>e.toLocaleTimeString(),y:e=>e.getFullYear().toString().slice(2,4),Y:e=>e.getFullYear(),z:ct,Z:(e,t)=>e.getTimeZoneName()||ct(e,t),t:()=>"\t",n:()=>"\n","%":()=>"%"};function dt(e,t){let n,i="",r=t;for(;n=rt.exec(r);)i+=r.slice(0,n.index),r=r.slice(n.index+n[0].length),i+=pt(e,n);return i+r}function pt(e,t){const[n,i="",r,s,a]=t,o=ht[a];if(!o)return n;const l={};for(const e of i)l[e]=!0;let u=String(o(e,{flags:l,width:r,modifier:s})),c=ut.has(a)?" ":"0",h=r||lt[a]||0;var d;return l["^"]?u=u.toUpperCase():l["#"]&&(d=u,u=[...d].some((e=>e>="a"&&e<="z"))?d.toUpperCase():d.toLowerCase()),l._?c=" ":l[0]&&(c="0"),l["-"]&&(h=0),Se(u,h,c)}function ft(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}ht.h=ht.b;const mt=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,gt=["January","February","March","April","May","June","July","August","September","October","November","December"],vt=gt.map((e=>e.slice(0,3))),xt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],yt=xt.map((e=>e.slice(0,3)));class bt{constructor(e,t,n){this.locale=t,this.DateTimeFormat=ft(),this.date=new Date(e),this.timezoneFixed=void 0!==n,void 0===n&&(n=this.date.getTimezoneOffset()),this.timezoneOffset=oe(n)?bt.getTimezoneOffset(n,this.date):n,this.timezoneName=oe(n)?n:"";const i=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),r=this.date.getTime()+i;this.displayDate=new Date(r)}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(e,t){return(null==t?void 0:t.timeZone)?this.date.toLocaleString(e,t):this.displayDate.toLocaleString(e,t)}toLocaleTimeString(e){return this.displayDate.toLocaleTimeString(e)}toLocaleDateString(e){return this.displayDate.toLocaleDateString(e)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var e;return null!==(e=this.format({month:"long"}))&&void 0!==e?e:gt[this.getMonth()]}getShortMonthName(){var e;return null!==(e=this.format({month:"short"}))&&void 0!==e?e:vt[this.getMonth()]}getLongWeekdayName(){var e;return null!==(e=this.format({weekday:"long"}))&&void 0!==e?e:xt[this.displayDate.getDay()]}getShortWeekdayName(){var e;return null!==(e=this.format({weekday:"short"}))&&void 0!==e?e:yt[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(e){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,e).format(this.displayDate)}static createDateFixedToTimezone(e,t){const n=e.match(mt);if(n&&"Z"===n[1])return new bt(+new Date(e),t,0);if(n&&n[2]&&n[3]&&n[4]){const[,,i,r,s]=n,a=("+"===i?-1:1)*(60*parseInt(r,10)+parseInt(s,10));return new bt(+new Date(e),t,a)}return new bt(e,t)}static getTimezoneOffset(e,t){const n=t.toLocaleString("en-US",{timeZone:e}),i=t.toLocaleString("en-US",{timeZone:"UTC"}),r=new Date(n);return(+new Date(i)-+r)/6e4}}class wt{constructor(e,t){this.base=0,this.message=`${e} limit exceeded`,this.limit=t}use(e){e=me(e),Ue(this.base+e<=this.limit,this.message),this.base+=e}check(e){Ue((e=me(e))<=this.limit,this.message)}}class kt extends ne{constructor(e,[t,n],i,r,s,a,o,l){super(e,i,r,s,l),this.trimLeft=!1,this.trimRight=!1;const u="-"===i[t],c="-"===i[n-1];let h=u?t+1:t,d=c?n-1:n;for(;h<d&&4&Ie[i.charCodeAt(h)];)h++;for(;d>h&&4&Ie[i.charCodeAt(d-1)];)d--;this.contentRange=[h,d],this.trimLeft=u||a,this.trimRight=c||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class Tt extends kt{constructor(e,t,n,i,r){const{trimTagLeft:s,trimTagRight:a,tagDelimiterLeft:o,tagDelimiterRight:l}=i,[u,c]=[t+o.length,n-l.length];super(Bn.Tag,[u,c],e,t,n,s,a,r),this.tokenizer=new bn(e,i.operators,r,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class _t extends kt{constructor(e,t,n,i,r){const{trimOutputLeft:s,trimOutputRight:a,outputDelimiterLeft:o,outputDelimiterRight:l}=i,u=[t+o.length,n-l.length];super(Bn.Output,u,e,t,n,s,a,r)}}class St extends ne{constructor(e,t,n,i){super(Bn.HTML,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class Ft extends ne{constructor(e,t,n,i){super(Bn.Number,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=Number(this.getText())}}class Ot extends ne{constructor(e,t,n,i){super(Bn.Word,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=this.getText()}}class Lt extends ne{constructor(e,t,n,i){super(Bn.Literal,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.literal=this.getText(),this.content=Ze[this.literal]}}const At={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},zt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class jt extends ne{constructor(e,t,n,i){super(Bn.Operator,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.operator=this.getText()}getPrecedence(){const e=this.getText();return e in At?At[e]:1}}class Rt extends ne{constructor(e,t,n,i,r,s){super(Bn.PropertyAccess,n,i,r,s),this.variable=e,this.props=t}}class Vt extends ne{constructor(e,t,n,i,r,s){super(Bn.Filter,n,i,r,s),this.name=e,this.args=t}}class Ct extends ne{constructor(e,t,n,i,r,s){super(Bn.Hash,e,t,n,s),this.input=e,this.begin=t,this.end=n,this.name=i,this.value=r,this.file=s}}const Et=/[\da-fA-F]/,qt=/[0-7]/,Dt={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Mt(e){const t=e.charCodeAt(0);return t>=97?t-87:t>=65?t-55:t-48}class $t extends ne{constructor(e,t,n,i){super(Bn.Quoted,e,t,n,i),this.input=e,this.begin=t,this.end=n,this.file=i,this.content=function(e){let t="";for(let n=1;n<e.length-1;n++)if("\\"===e[n])if(void 0!==Dt[e[n+1]])t+=Dt[e[++n]];else if("u"===e[n+1]){let i=0,r=n+2;for(;r<=n+5&&Et.test(e[r]);)i=16*i+Mt(e[r++]);n=r-1,t+=String.fromCharCode(i)}else if(qt.test(e[n+1])){let i=n+1,r=0;for(;i<=n+3&&qt.test(e[i]);)r=8*r+Mt(e[i++]);n=i-1,t+=String.fromCharCode(r)}else t+=e[++n];else t+=e[n];return t}(this.getText())}}class Nt extends ne{constructor(e,t,n,i,r,s){super(Bn.Range,e,t,n,s),this.input=e,this.begin=t,this.end=n,this.lhs=i,this.rhs=r,this.file=s}}class Pt extends kt{constructor(e,t,n,i,r){super(Bn.Tag,[t,n],e,t,n,!1,!1,r),this.tokenizer=new bn(e,i.operators,r,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 It extends ne{constructor(e,t,n,i,r,s){super(Bn.FilteredValue,n,i,r,s),this.initial=e,this.filters=t,this.input=n,this.begin=i,this.end=r,this.file=s}}const Bt={now:()=>Date.now()};function Ut(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||Bt}class Ht{constructor(){this.buffer=""}write(e){this.buffer+=he(e)}}class Gt{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Yt{constructor(){this.buffer=""}write(e){"string"!=typeof(e=fe(e))&&""===this.buffer?this.buffer=e:this.buffer=he(this.buffer)+he(e)}}class Jt{renderTemplatesToNodeStream(e,t){const n=new Gt;return Promise.resolve().then((()=>nt(this.renderTemplates(e,t,n)))).then((()=>n.end()),(e=>n.error(e))),n.stream}*renderTemplates(e,t,n){n||(n=t.opts.keepOutputType?new Yt:new Ht);const i=[];for(const r of e){t.renderLimit.check(Ut().now());try{const e=yield r.render(t,n);if(e&&n.write(e),t.breakCalled||t.continueCalled)break}catch(e){const n=Ve.is(e)?e:new qe(e,r);if(!t.opts.catchAllErrors)throw n;i.push(n)}}if(i.length)throw new De(i);return n.buffer}}class Kt{constructor(e){this.postfix=[...Qt(e)]}*evaluate(e,t){Ue(e,"unable to evaluate: context not defined");const n=[];for(const i of this.postfix)if(Yn(i)){const t=n.pop();let r;if(1===zt[i.operator])r=yield e.opts.operators[i.operator](t,e);else{const s=n.pop();r=yield e.opts.operators[i.operator](s,t,e)}n.push(r)}else n.push(yield Wt(i,e,t));return n[0]}valid(){return!!this.postfix.length}}function*Wt(e,t,n=!1){if(e)return"content"in e?e.content:Zn(e)?yield function*(e,t,n){const i=[];for(const n of e.props)i.push(yield Wt(n,t,!1));try{if(e.variable){const r=yield Wt(e.variable,t,n);return yield t._getFromScope(r,i)}return yield t._get(i)}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new Me(t,e)}}(e,t,n):ei(e)?yield function*(e,t){const n=yield Wt(e.lhs,t),i=yield Wt(e.rhs,t);return t.memoryLimit.use(i-n+1),_e(+n,+i+1)}(e,t):void 0}function*Qt(e){const t=[];for(const n of e)if(Yn(n)){for(;t.length&&t[t.length-1].getPrecedence()>n.getPrecedence();)yield t.pop();t.push(n)}else yield n;for(;t.length;)yield t.pop()}function Zt(e,t){return!Xt(e,t)}function Xt(e,t){return e=fe(e),t.opts.jsTruthy?!e:!1===e||null==e}const en={"==":tn,"!=":(e,t)=>!tn(e,t),">":(e,t)=>We(e)?e.gt(t):We(t)?t.lt(e):fe(e)>fe(t),"<":(e,t)=>We(e)?e.lt(t):We(t)?t.gt(e):fe(e)<fe(t),">=":(e,t)=>We(e)?e.geq(t):We(t)?t.leq(e):fe(e)>=fe(t),"<=":(e,t)=>We(e)?e.leq(t):We(t)?t.geq(e):fe(e)<=fe(t),contains:(e,t)=>ye(e=fe(e))?e.some((e=>tn(e,t))):!!le(null==e?void 0:e.indexOf)&&e.indexOf(fe(t))>-1,not:(e,t)=>Xt(fe(e),t),and:(e,t,n)=>Zt(fe(e),n)&&Zt(fe(t),n),or:(e,t,n)=>Zt(fe(e),n)||Zt(fe(t),n)};function tn(e,t){return We(e)?e.equals(t):We(t)?t.equals(e):(e=fe(e),t=fe(t),ye(e)?ye(t)&&function(e,t){return e.length===t.length&&!e.some(((e,n)=>!tn(e,t[n])))}(e,t):e===t)}class nn{constructor(e,t,n,i){this.key=e,this.value=t,this.next=n,this.prev=i}}class rn{constructor(e,t=0){this.limit=e,this.size=t,this.cache={},this.head=new nn("HEAD",null,null,null),this.tail=new nn("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(e,t){if(this.cache[e])this.cache[e].value=t;else{const n=new nn(e,t,this.head.next,this.head);this.head.next.prev=n,this.head.next=n,this.cache[e]=n,this.size++,this.ensureLimit()}}read(e){if(!this.cache[e])return;const{value:t}=this.cache[e];return this.remove(e),this.write(e,t),t}remove(e){const t=this.cache[e];t.prev.next=t.next,t.next.prev=t.prev,delete this.cache[e],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 sn(e,t){const n=document.createElement("base");n.href=e;const i=document.getElementsByTagName("head")[0];i.insertBefore(n,i.firstChild);const r=document.createElement("a");r.href=t;const s=r.href;return i.removeChild(n),s}var an=Object.freeze({__proto__:null,resolve:function(e,t,n){return e.length&&"/"!==ke(e)&&(e+="/"),sn(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((e,t,i)=>{const r=i.split("/").pop();return/\.\w+$/.test(r)?e:t+i+n}))},readFile:function(e){return tt(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=new XMLHttpRequest;i.onload=()=>{i.status>=200&&i.status<300?t(i.responseText):n(new Error(i.statusText))},i.onerror=()=>{n(new Error("An error occurred whilst receiving the response."))},i.open("GET",e),i.send()}))}))},readFileSync:function(e){const t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||t.status>=300)throw new Error(t.statusText);return t.responseText},exists:function(e){return tt(this,void 0,void 0,(function*(){return!0}))},existsSync:function(e){return!0},dirname:function(e){return sn(e,".")},sep:"/"});function on(e,t=0){return JSON.stringify(e,null,t)}var ln={default:function(e,t,...n){return ye(e=fe(e))||oe(e)?e.length?e:t:(!1!==e||!new Map(n).get("allow_false"))&&(Xt(e,this.context)?t:e)},raw:{raw:!0,handler:Oe},jsonify:on,to_integer:function(e){return Number(e)},json:on,inspect:function(e,t=0){const n=[];return JSON.stringify(e,(function(e,t){if("object"!=typeof t||null===t)return t;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}),t)}};const un={"&":"&","<":"<",">":">",'"':""","'":"'"},cn={"&":"&","<":"<",">":">",""":'"',"'":"'"};function hn(e){return e=he(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,(e=>un[e]))}function dn(e){return e=he(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,(e=>cn[e]))}var pn=Object.freeze({__proto__:null,escape:hn,xml_escape:function(e){return hn.call(this,e)},escape_once:function(e){return hn.call(this,dn.call(this,e))},newline_to_br:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,"<br />\n")},strip_html:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),t.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class fn{constructor(e){this.mapping=e,this.sep="/"}exists(e){return tt(this,void 0,void 0,(function*(){return this.existsSync(e)}))}existsSync(e){return!xe(this.mapping[e])}readFile(e){return tt(this,void 0,void 0,(function*(){return this.readFileSync(e)}))}readFileSync(e){const t=this.mapping[e];if(xe(t))throw new Error(`ENOENT: ${e}`);return t}dirname(e){const t=e.split(this.sep);return t.pop(),t.join(this.sep)}resolve(e,t,n){if(t+=n,"."===e)return t;const i=e.split(/\/+/);for(const e of t.split(this.sep))"."!==e&&""!==e&&(".."===e?(i.length>1||""!==i[0])&&i.pop():i.push(e));return i.join(this.sep)}}const mn={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:an,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:en,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function gn(e){var t,n,i;if(e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")){let t;t="number"==typeof e.cache?e.cache>0?new rn(e.cache):void 0:"object"==typeof e.cache?e.cache:e.cache?new rn(1024):void 0,e.cache=t}return(e=Object.assign(Object.assign(Object.assign({},mn),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=vn(e.root),e.partials=vn(e.partials),e.layouts=vn(e.layouts),e.outputEscape=e.outputEscape&&("escape"===(i=e.outputEscape)?hn:"json"===i?ln.json:(Ue(le(i),"`outputEscape` need to be of type string or function"),i)),e.locale||(e.locale=null!==(n=null===(t=ft())||void 0===t?void 0:t().resolvedOptions().locale)&&void 0!==n?n:"en-US"),e.templates&&(e.fs=new fn(e.templates),e.relativeReference=!0,e.root=e.partials=e.layouts="."),e}function vn(e){let t=[];return ye(e)&&(t=e),oe(e)&&(t=[e]),t}function xn(e,t){if(!e||!Jn(e))return;const n=t?4:16;for(;Ie[e.input.charCodeAt(e.end-1-e.trimRight)]&n;)e.trimRight++}function yn(e,t){if(!e||!Jn(e))return;const n=t?4:16;for(;Ie[e.input.charCodeAt(e.begin+e.trimLeft)]&n;)e.trimLeft++;"\n"===e.input.charAt(e.begin+e.trimLeft)&&e.trimLeft++}class bn{constructor(e,t=mn.operators,n,i){this.input=e,this.file=n,this.rawBeginAt=-1,this.p=i?i[0]:0,this.N=i?i[1]:e.length,this.opTrie=Xe(t),this.literalTrie=Xe(Ze)}readExpression(){return new Kt(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const e=this.readOperator();if(e){yield e;continue}const t=this.readValue();if(!t)return;yield t}}readOperator(){this.skipBlank();const e=this.matchTrie(this.opTrie);if(-1!==e)return new jt(this.input,this.p,this.p=e,this.file)}matchTrie(e){let t,n=e,i=this.p;for(;n[this.input[i]]&&i<this.N;)n=n[this.input[i++]],n.end&&(t=n);return t?t.needBoundary&&Be(this.peek(i-this.p))?-1:i:-1}readFilteredValue(){const e=this.p,t=this.readExpression();this.assert(t.valid(),`invalid value expression: ${this.snapshot()}`);const n=this.readFilters();return new It(t,n,this.input,e,this.p,this.file)}readFilters(){const e=[];for(;;){const t=this.readFilter();if(!t)return e;e.push(t)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const e=this.readIdentifier();if(!e.size())return this.assert(this.end(),"expected filter name"),null;const t=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const e=this.readFilterArg();e&&t.push(e),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 Vt(e.getText(),t,this.input,e.begin,this.p,this.file)}readFilterArg(){const e=this.readValue();if(!e)return;if(this.skipBlank(),":"!==this.peek())return e;++this.p;const t=this.readValue();return[e.getText(),t]}readTopLevelTokens(e=mn){const t=[];for(;this.p<this.N;){const n=this.readTopLevelToken(e);t.push(n)}return function(e,t){let n=!1;for(let i=0;i<e.length;i++){const r=e[i];ni(r)&Bn.Delimited&&(!n&&r.trimLeft&&xn(e[i-1],t.greedy),Kn(r)&&("raw"===r.name?n=!0:"endraw"===r.name&&(n=!1)),!n&&r.trimRight&&yn(e[i+1],t.greedy))}}(t,e),t}readTopLevelToken(e){const{tagDelimiterLeft:t,outputDelimiterLeft:n}=e;return this.rawBeginAt>-1?this.readEndrawOrRawContent(e):this.match(t)?this.readTagToken(e):this.match(n)?this.readOutputToken(e):this.readHTMLToken([t,n])}readHTMLToken(e){const t=this.p;for(;this.p<this.N&&!e.some((e=>this.match(e)));)++this.p;return new St(this.input,t,this.p,this.file)}readTagToken(e){const{file:t,input:n}=this,i=this.p;if(-1===this.readToDelimiter(e.tagDelimiterRight))throw this.error(`tag ${this.snapshot(i)} not closed`,i);const r=new Tt(n,i,this.p,e,t);return"raw"===r.name&&(this.rawBeginAt=i),r}readToDelimiter(e,t=!1){for(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}readOutputToken(e=mn){const{file:t,input:n}=this,{outputDelimiterRight:i}=e,r=this.p;if(-1===this.readToDelimiter(i,!0))throw this.error(`output ${this.snapshot(r)} not closed`,r);return new _t(n,r,this.p,e,t)}readEndrawOrRawContent(e){const{tagDelimiterLeft:t,tagDelimiterRight:n}=e,i=this.p;let r=this.readTo(t)-t.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(n)){const t=this.p;return i===r?(this.rawBeginAt=-1,new Tt(this.input,i,t,e,this.file)):(this.p=r,new St(this.input,i,r,this.file))}if(this.rmatch(t))break;this.p++}else r=this.readTo(t)-t.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,i)}readLiquidTagTokens(e=mn){const t=[];for(;this.p<this.N;){const n=this.readLiquidTagToken(e);n&&t.push(n)}return t}readLiquidTagToken(e){if(this.skipBlank(),this.end())return;const t=this.p;this.readToDelimiter("\n");const n=this.p;return new Pt(this.input,t,n,e,this.file)}error(e,t=this.p){return new Ce(e,new Ot(this.input,t,this.N,this.file))}assert(e,t,n){if(!e)throw this.error("function"==typeof t?t():t,n)}snapshot(e=this.p){return JSON.stringify((t=this.input.slice(e,this.N),n=32,t.length>n?t.slice(0,n-3)+"...":t));var t,n}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const e=this.p;for(;!this.end()&&Be(this.peek());)++this.p;return new Ot(this.input,e,this.p,this.file)}readNonEmptyIdentifier(){const e=this.readIdentifier();return e.size()?e:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(e){const t=[];for(;;){const n=this.readHash(e);if(!n)return t;t.push(n)}}readHash(e){this.skipBlank(),","===this.peek()&&++this.p;const t=this.p,n=this.readNonEmptyIdentifier();if(!n)return;let i;this.skipBlank();const r=oe(e)?e:e?"=":":";return this.peek()===r&&(++this.p,i=this.readValue()),new Ct(this.input,t,this.p,n,i,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(e=1){this.p+=e}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(e){for(;this.p<this.N;)if(++this.p,this.rmatch(e))return this.p;return-1}readValue(){this.skipBlank();const e=this.p,t=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),n=this.readProperties(!t);return n.length?new Rt(t,n,this.input,e,this.p):t}readScopeValue(){this.skipBlank();const e=this.p,t=this.readProperties();if(t.length)return new Rt(void 0,t,this.input,e,this.p)}readProperties(e=!0){const t=[];for(;;)if("["!==this.peek()){if(e&&!t.length){const e=this.readNonEmptyIdentifier();if(e){t.push(e);continue}}if("."!==this.peek()||"."===this.peek(1))break;{this.p++;const e=this.readNonEmptyIdentifier();if(!e)break;t.push(e)}}else{this.p++;const e=this.readValue()||new Ot(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),t.push(e)}return t}readNumber(){this.skipBlank();let e=!1,t=!1,n=0;for(64&this.peekType()&&n++;this.p+n<=this.N;)if(32&this.peekType(n))t=!0,n++;else{if("."!==this.peek(n)||"."===this.peek(n+1))break;if(e||!t)return;e=!0,n++}if(t&&!Be(this.peek(n))){const e=new Ft(this.input,this.p,this.p+n,this.file);return this.advance(n),e}}readLiteral(){this.skipBlank();const e=this.matchTrie(this.literalTrie);if(-1===e)return;const t=new Lt(this.input,this.p,e,this.file);return this.p=e,t}readRange(){this.skipBlank();const e=this.p;if("("!==this.peek())return;++this.p;const t=this.readValueOrThrow();this.p+=2;const n=this.readValueOrThrow();return++this.p,new Nt(this.input,e,this.p,t,n,this.file)}readValueOrThrow(){const e=this.readValue();return this.assert(e,(()=>`unexpected token ${this.snapshot()}, value expected`)),e}readQuoted(){this.skipBlank();const e=this.p;if(!(8&this.peekType()))return;++this.p;let t=!1;for(;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 $t(this.input,e,this.p,this.file)}*readFileNameTemplate(e){const{outputDelimiterLeft:t}=e,n=[","," ",t],i=new Set(n);for(;this.p<this.N&&!i.has(this.peek());)yield this.match(t)?this.readOutputToken(e):this.readHTMLToken(n)}match(e){for(let t=0;t<e.length;t++)if(e[t]!==this.input[this.p+t])return!1;return!0}rmatch(e){for(let t=0;t<e.length;t++)if(e[e.length-1-t]!==this.input[this.p-1-t])return!1;return!0}peekType(e=0){return this.p+e>=this.N?0:Ie[this.input.charCodeAt(this.p+e)]}peek(e=0){return this.p+e>=this.N?"":this.input[this.p+e]}skipBlank(){for(;4&this.peekType();)++this.p}}class wn{constructor(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}on(e,t){return this.handlers[e]=t,this}trigger(e,t){const n=this.handlers[e];return!!n&&(n.call(this,t),!0)}start(){let e;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());){if(this.trigger("token",e))continue;if(Kn(e)&&this.trigger(`tag:${e.name}`,e))continue;const t=this.parseToken(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class kn{constructor(e){this.token=e}}class Tn extends kn{constructor(e,t,n){super(e),this.name=e.name,this.liquid=n,this.tokenizer=e.tokenizer}}class _n{constructor(e,t){this.hash={};const n=e instanceof bn?e:new bn(e,{});for(const e of n.readHashes(t))this.hash[e.name.content]=e.value}*render(e){const t={};for(const n of Object.keys(this.hash))t[n]=void 0===this.hash[n]||(yield Wt(this.hash[n],e));return t}}function Sn(e){return ye(e)}class Fn{constructor(e,t,n){this.token=e,this.name=e.name,this.handler=le(t)?t:le(null==t?void 0:t.handler)?t.handler:Oe,this.raw=!le(t)&&!!(null==t?void 0:t.raw),this.args=e.args,this.liquid=n}*render(e,t){const n=[];for(const e of this.args)Sn(e)?n.push([e[0],yield Wt(e[1],t)]):n.push(yield Wt(e,t));return yield this.handler.apply({context:t,token:this.token,liquid:this.liquid},[e,...n])}}class On{constructor(e,t){this.filters=[];const n="string"==typeof e?new bn(e,t.options.operators).readFilteredValue():e;this.initial=n.initial,this.filters=n.filters.map((e=>new Fn(e,this.getFilter(t,e.name),t)))}*value(e,t){t=t||e.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let n=yield this.initial.evaluate(e,t);for(const t of this.filters)n=yield t.render(n,e);return n}getFilter(e,t){const n=e.filters[t];return Ue(n||!e.options.strictFilters,(()=>`undefined filter: ${t}`)),n}}class Ln extends kn{constructor(e,t){var n;super(e);const i=new bn(e.input,t.options.operators,e.file,e.contentRange);this.value=new On(i.readFilteredValue(),t);const r=this.value.filters,s=t.options.outputEscape;if(!(null===(n=r[r.length-1])||void 0===n?void 0:n.raw)&&s){const e=new Vt(toString.call(s),[],"",0,0);r.push(new Fn(e,s,t))}}*render(e,t){const n=yield this.value.value(e,!1);t.write(n)}*arguments(){yield this.value}}class An extends kn{constructor(e){super(e),this.str=e.getContent()}*render(e,t){t.write(this.str)}}class zn{constructor(e,t){this.segments=e,this.location=t}toString(){return Pn(this.segments,!0)}toArray(){return Array.from(function*e(...t){for(const n of t)n instanceof zn?yield Array.from(e(...n.segments)):yield n}(...this.segments))}}class jn{constructor(){this.map=new Map}get(e){const t=Pn([e.segments[0]]);return this.map.has(t)||this.map.set(t,[]),this.map.get(t)}has(e){return this.map.has(Pn([e.segments[0]]))}push(e){this.get(e).push(e)}asObject(){return Object.fromEntries(this.map)}}const Rn={partials:!0};function*Vn(e,t,n){const i=new jn,r=new jn,s=new jn,a=new qn(new Set),o=new Set;function l(e,t){i.push(e);const n=t.alias(e);if(void 0!==n){const e=n.segments[0];oe(e)&&!a.has(e)&&r.push(n)}else{const n=e.segments[0];oe(n)&&!t.has(n)&&r.push(e)}for(const n of e.segments)n instanceof zn&&l(n,t)}function*u(e,i){if(e.arguments)for(const t of e.arguments())for(const e of Dn(t))l(e,i);if(e.localScope)for(const t of e.localScope()){i.add(t.content),i.deleteAlias(t.content);const[e,n]=t.getPosition();s.push(new zn([t.content],{row:e,col:n,file:t.file}))}if(e.children)if(e.partialScope){const r=e.partialScope();if(void 0===r){for(const r of yield e.children(t,n))yield u(r,i);return}if(o.has(r.name))return;const s=new Set,a=r.isolated?new qn(s):i.push(s);for(const e of r.scope)if(oe(e))s.add(e);else{const[t,n]=e;s.add(t);const i=Array.from(Dn(n));i.length&&a.setAlias(t,i[0].segments)}for(const i of yield e.children(t,n))yield u(i,a),o.add(r.name);a.pop()}else{e.blockScope&&i.push(new Set(e.blockScope()));for(const r of yield e.children(t,n))yield u(r,i);e.blockScope&&i.pop()}}for(const t of e)yield u(t,a);return{variables:i.asObject(),globals:r.asObject(),locals:s.asObject()}}function Cn(e,t={}){return nt(Vn(e,Object.assign(Object.assign({},Rn),t).partials,!1))}function En(e,t={}){return it(Vn(e,Object.assign(Object.assign({},Rn),t).partials,!0))}class qn{constructor(e){this.stack=[{names:e,aliases:new Map}]}has(e){for(const t of this.stack)if(t.names.has(e))return!0;return!1}push(e){return this.stack.push({names:e,aliases:new Map}),this}pop(){var e;return null===(e=this.stack.pop())||void 0===e?void 0:e.names}add(e){this.stack[0].names.add(e)}alias(e){const t=e.segments[0];if(!oe(t))return;const n=this.getAlias(t);return void 0!==n?new zn([...n,...e.segments.slice(1)],e.location):void 0}setAlias(e,t){this.stack[this.stack.length-1].aliases.set(e,t)}deleteAlias(e){this.stack[this.stack.length-1].aliases.delete(e)}getAlias(e){for(const t of this.stack){if(t.aliases.has(e))return t.aliases.get(e);if(t.names.has(e))return}}}function*Dn(e){ti(e)?yield*Mn(e):e instanceof On&&(yield*function*(e){for(const t of e.initial.postfix)ti(t)&&(yield*Mn(t));for(const t of e.filters)for(const e of t.args)Sn(e)&&e[1]?yield*Mn(e[1]):ti(e)&&(yield*Mn(e))}(e))}function*Mn(e){ei(e)?(yield*Mn(e.lhs),yield*Mn(e.rhs)):Zn(e)&&(yield $n(e))}function $n(e){const t=[];let n=e.file;const i=e.props[0];n=n||i.file,Wn(i)||Qn(i)||Xn(i)?t.push(i.content):Zn(i)&&t.push(...$n(i).segments);for(const i of e.props.slice(1))n=n||i.file,Wn(i)||Qn(i)||Xn(i)?t.push(i.content):Zn(i)&&t.push($n(i));const[r,s]=e.getPosition();return new zn(t,{row:r,col:s,file:n})}const Nn=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Pn(e,t=!1){const n=[],i=e[0];oe(i)&&(!t||i.match(Nn)?n.push(`${i}`):n.push(`['${i}']`));for(const t of e.slice(1))t instanceof zn?n.push(`[${Pn(t.segments)}]`):oe(t)?t.match(Nn)?n.push(`.${t}`):n.push(`['${t}']`):n.push(`[${t}]`);return n.join("")}var In,Bn,Un;!function(e){e.Partials="partials",e.Layouts="layouts",e.Root="root"}(In||(In={}));class Hn{constructor(e){if(this.options=e,e.relativeReference){const t=e.fs.sep;Ue(t,"`fs.sep` is required for relative reference");const n=new RegExp(["."+t,".."+t,"./","../"].map((e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"));this.shouldLoadRelative=e=>n.test(e)}else this.shouldLoadRelative=e=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(e,t,n,i){const{fs:r}=this.options,s=this.options[t];for(const a of this.candidates(e,s,i,t!==In.Root))if(n?r.existsSync(a):yield r.exists(a))return a;throw this.lookupError(e,s)}*candidates(e,t,n,i){const{fs:r,extname:s}=this.options;if(this.shouldLoadRelative(e)&&n){const a=r.resolve(this.dirname(n),e,s);for(const e of t)if(!i||this.contains(e,a)){yield a;break}}for(const n of t){const t=r.resolve(n,e,s);i&&!this.contains(n,t)||(yield t)}if(void 0!==r.fallback){const t=r.fallback(e);void 0!==t&&(yield t)}}dirname(e){const t=this.options.fs;return Ue(t.dirname,"`fs.dirname` is required for relative reference"),t.dirname(e)}lookupError(e,t){const n=new Error("ENOENT");return n.message=`ENOENT: Failed to lookup "${e}" in "${t}"`,n.code="ENOENT",n}}class Gn{constructor(e){this.liquid=e,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Hn(this.liquid.options),this.parseLimit=new wt("parse length",e.options.parseLimit)}parse(e,t){e=String(e),this.parseLimit.use(e.length);const n=new bn(e,this.liquid.options.operators,t).readTopLevelTokens(this.liquid.options);return this.parseTokens(n)}parseTokens(e){let t;const n=[],i=[];for(;t=e.shift();)try{n.push(this.parseToken(t,e))}catch(e){if(!this.liquid.options.catchAllErrors)throw e;i.push(e)}if(i.length)throw new De(i);return n}parseToken(e,t){try{if(Kn(e)){const n=this.liquid.tags[e.name];return Ue(n,`tag "${e.name}" not found`),new n(e,t,this.liquid,this)}return ni(e)===Bn.Output?new Ln(e,this.liquid):new An(e)}catch(t){if(Ve.is(t))throw t;throw new Ee(t,e)}}parseStream(e){return new wn(e,((e,t)=>this.parseToken(e,t)))}*_parseFileCached(e,t,n=In.Root,i){const r=this.cache,s=this.loader.shouldLoadRelative(e)?i+","+e:n+":"+e,a=yield r.read(s);if(a)return a;const o=this._parseFile(e,t,n,i),l=t?yield o:nt(o);r.write(s,l);try{return yield l}catch(e){throw r.remove(s),e}}*_parseFile(e,t,n=In.Root,i){const r=yield this.loader.lookup(e,n,t,i);return this.parse(t?this.fs.readFileSync(r):yield this.fs.readFile(r),r)}}function Yn(e){return ni(e)===Bn.Operator}function Jn(e){return ni(e)===Bn.HTML}function Kn(e){return ni(e)===Bn.Tag}function Wn(e){return ni(e)===Bn.Quoted}function Qn(e){return ni(e)===Bn.Number}function Zn(e){return ni(e)===Bn.PropertyAccess}function Xn(e){return ni(e)===Bn.Word}function ei(e){return ni(e)===Bn.Range}function ti(e){return(1667&ni(e))>0}function ni(e){return e?e.kind:-1}!function(e){e[e.Number=1]="Number",e[e.Literal=2]="Literal",e[e.Tag=4]="Tag",e[e.Output=8]="Output",e[e.HTML=16]="HTML",e[e.Filter=32]="Filter",e[e.Hash=64]="Hash",e[e.PropertyAccess=128]="PropertyAccess",e[e.Word=256]="Word",e[e.Range=512]="Range",e[e.Quoted=1024]="Quoted",e[e.Operator=2048]="Operator",e[e.FilteredValue=4096]="FilteredValue",e[e.Delimited=12]="Delimited"}(Bn||(Bn={}));class ii{constructor(e={},t=mn,n={},{memoryLimit:i,renderLimit:r}={}){var s,a,o,l,u;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!n.sync,this.opts=t,this.globals=null!==(s=n.globals)&&void 0!==s?s:t.globals,this.environments=Te(e)?e:Object(e),this.strictVariables=null!==(a=n.strictVariables)&&void 0!==a?a:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=n.ownPropertyOnly)&&void 0!==o?o:t.ownPropertyOnly,this.memoryLimit=null!=i?i:new wt("memory alloc",null!==(l=n.memoryLimit)&&void 0!==l?l:t.memoryLimit),this.renderLimit=null!=r?r:new wt("template render",Ut().now()+(null!==(u=n.renderLimit)&&void 0!==u?u:t.renderLimit))}getRegister(e){return this.registers[e]=this.registers[e]||{}}setRegister(e,t){return this.registers[e]=t}saveRegister(...e){return e.map((e=>[e,this.getRegister(e)]))}restoreRegister(e){return e.forEach((([e,t])=>this.setRegister(e,t)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((e,t)=>et(e,t)),{})}get(e){return this.getSync(e)}getSync(e){return it(this._get(e))}*_get(e){const t=this.findScope(e[0]);return yield this._getFromScope(t,e)}getFromScope(e,t){return it(this._getFromScope(e,t))}*_getFromScope(e,t,n=this.strictVariables){oe(t)&&(t=t.split("."));for(let i=0;i<t.length;i++)if(e=yield ri(e,t[i],this.ownPropertyOnly),n&&void 0===e)throw new $e(t.slice(0,i+1).join("."));return e}push(e){return this.scopes.push(e)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(e={}){return new ii(e,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(e){for(let t=this.scopes.length-1;t>=0;t--){const n=this.scopes[t];if(e in n)return n}return e in this.environments?this.environments:this.globals}}function ri(e,t,n){if(e=ve(e),t=fe(t),xe(e))return e;if(ye(e)&&t<0)return e[e.length+ +t];const i=function(e,t,n){return!n||ae.call(e,t)||e instanceof ie?e[t]:void 0}(e,t,n);return void 0===i&&e instanceof ie?e.liquidMethodMissing(t):le(i)?i.call(e):"size"===t?function(e){if(ae.call(e,"size")||void 0!==e.size)return e.size;if(ye(e)||oe(e))return e.length;if("object"==typeof e)return Object.keys(e).length}(e):"first"===t?function(e){return ye(e)?e[0]:e.first}(e):"last"===t?function(e){return ye(e)?e[e.length-1]:e.last}(e):i}!function(e){e[e.OUTPUT=0]="OUTPUT",e[e.STORE=1]="STORE"}(Un||(Un={}));const si=Ae(Math.abs),ai=Ae(Math.max),oi=Ae(Math.min),li=Ae(Math.ceil),ui=Ae(((e,t,n=!1)=>n?Math.floor(e/t):e/t)),ci=Ae(Math.floor),hi=Ae(((e,t)=>e-t)),di=Ae(((e,t)=>e%t)),pi=Ae(((e,t)=>e*t));var fi=Object.freeze({__proto__:null,abs:si,at_least:ai,at_most:oi,ceil:li,divided_by:ui,floor:ci,minus:hi,modulo:di,times:pi,round:function(e,t=0){e=fe(e),t=fe(t);const n=Math.pow(10,t);return Math.round(e*n)/n},plus:function(e,t){return e=fe(e),t=fe(t),Number(e)+Number(t)}});const mi=/[^\p{M}\p{L}\p{Nd}]+/gu,gi={raw:/\s+/g,default:mi,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:mi,none:null};var vi=Object.freeze({__proto__:null,url_decode:e=>decodeURIComponent(he(e)).replace(/\+/g," "),url_encode:e=>encodeURIComponent(he(e)).replace(/%20/g,"+"),cgi_escape:e=>encodeURIComponent(he(e)).replace(/%20/g,"+").replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())),uri_escape:e=>encodeURI(he(e)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(e,t="default",n=!1){e=he(e);const i=gi[t];return i&&("latin"===t&&(e=function(e){return e.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(e)),e=e.replace(i,"-").replace(/^-|-$/g,"")),n?e:e.toLowerCase()}});const xi=Ae((function(e,t){const n=pe(e),i=xe(t)?" ":he(t),r=n.length*(1+i.length);return this.context.memoryLimit.use(r),n.join(i)})),yi=Ae((e=>be(e)?ke(e):"")),bi=Ae((e=>be(e)?e[0]:"")),wi=Ae((function(e){const t=pe(e);return this.context.memoryLimit.use(t.length),[...t].reverse()}));function ki(e,t=[]){const n=pe(e),i=pe(t);return this.context.memoryLimit.use(n.length+i.length),n.concat(i)}var Ti=Object.freeze({__proto__:null,join:xi,last:yi,first:bi,reverse:wi,sort:function*(e,t){const n=[],i=pe(e);this.context.memoryLimit.use(i.length);for(const e of i)n.push([e,t?yield this.context._getFromScope(e,he(t).split("."),!1):e]);return n.sort(((e,t)=>{const n=e[1],i=t[1];return n<i?-1:n>i?1:0})).map((e=>e[0]))},sort_natural:function(e,t){const n=he(t),i=void 0===t?Le:(e,t)=>Le(e[n],t[n]),r=pe(e);return this.context.memoryLimit.use(r.length),[...r].sort(i)},size:e=>e&&e.length||0,map:function*(e,t){const n=[],i=pe(e);this.context.memoryLimit.use(i.length);for(const e of i)n.push(yield this.context._getFromScope(e,he(t),!1));return n},sum:function*(e,t){let n=0;const i=pe(e);for(const e of i){const i=Number(t?yield this.context._getFromScope(e,he(t),!1):e);n+=Number.isNaN(i)?0:i}return n},compact:function(e){const t=pe(e);return this.context.memoryLimit.use(t.length),t.filter((e=>!xe(fe(e))))},concat:ki,push:function(e,t){return ki.call(this,e,[t])},unshift:function(e,t){const n=pe(e);this.context.memoryLimit.use(n.length);const i=[...n];return i.unshift(t),i},pop:function(e){const t=[...pe(e)];return t.pop(),t},shift:function(e){const t=pe(e);this.context.memoryLimit.use(t.length);const n=[...t];return n.shift(),n},slice:function(e,t,n=1){return xe(e=fe(e))?[]:(ye(e)||(e=he(e)),t=t<0?e.length+t:t,this.context.memoryLimit.use(n),e.slice(t,t+n))},where:function*(e,t,n){const i=[];e=pe(e),this.context.memoryLimit.use(e.length);const r=new bn(he(t)).readScopeValue();for(const t of e)i.push(yield Wt(r,this.context.spawn(t)));const s=this.context.opts.jekyllWhere?e=>Ge.is(n)?tn(e,n):ye(e)?function(e,t){return e.some((e=>tn(e,t)))}(e,n):tn(e,n):e=>tn(e,n);return e.filter(((e,t)=>void 0===n?Zt(i[t],this.context):s(i[t])))},where_exp:function*(e,t,n){const i=[],r=new On(he(n),this.liquid),s=pe(e);this.context.memoryLimit.use(s.length);for(const e of s){(yield r.value(this.context.spawn({[t]:e})))&&i.push(e)}return i},group_by:function*(e,t){const n=new Map;e=de(e);const i=new bn(he(t)).readScopeValue();this.context.memoryLimit.use(e.length);for(const t of e){const e=yield Wt(i,this.context.spawn(t));n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.entries()].map((([e,t])=>({name:e,items:t})))},group_by_exp:function*(e,t,n){const i=new Map,r=new On(he(n),this.liquid);e=de(e),this.context.memoryLimit.use(e.length);for(const n of e){const e=yield r.value(this.context.spawn({[t]:n}));i.has(e)||i.set(e,[]),i.get(e).push(n)}return[...i.entries()].map((([e,t])=>({name:e,items:t})))},find:function*(e,t,n){const i=new bn(he(t)).readScopeValue(),r=pe(e);for(const e of r){if(tn(yield Wt(i,this.context.spawn(e)),n))return e}},find_exp:function*(e,t,n){const i=new On(he(n),this.liquid),r=pe(e);for(const e of r){if(yield i.value(this.context.spawn({[t]:e})))return e}},uniq:function(e){return e=pe(e),this.context.memoryLimit.use(e.length),[...new Set(e)]},sample:function(e,t=1){if(xe(e=fe(e)))return[];ye(e)||(e=he(e)),this.context.memoryLimit.use(t);const n=[...e].sort((()=>Math.random()-.5));return 1===t?n[0]:n.slice(0,t)}});function _i(e,t,n){var i,r,s;const a=(null!==(i=null==e?void 0:e.length)&&void 0!==i?i:0)+(null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0)+(null!==(s=null==n?void 0:n.length)&&void 0!==s?s:0);this.context.memoryLimit.use(a);const o=Fi(e,this.context.opts,n);return o?dt(o,t=xe(t=fe(t))?this.context.opts.dateFormat:he(t)):e}function Si(e,t,n,i){const r=Fi(e,this.context.opts);if(!r)return e;if("ordinal"===n){const e=r.getDate();return dt(r,"US"===i?`${t} ${e}%q, %Y`:`${e}%q ${t} %Y`)}return dt(r,`%d ${t} %Y`)}function Fi(e,t,n){let i;const r=null!=n?n:t.timezoneOffset,s=t.locale;return i="now"===(e=fe(e))||"today"===e?new bt(Date.now(),s,r):ge(e)?new bt(1e3*e,s,r):oe(e)?/^\d+$/.test(e)?new bt(1e3*+e,s,r):t.preserveTimezones&&void 0===n?bt.createDateFixedToTimezone(e,s):new bt(e,s,r):new bt(e,s,r),i.valid()?i:void 0}var Oi=Object.freeze({__proto__:null,date:_i,date_to_xmlschema:function(e){return _i.call(this,e,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(e){return _i.call(this,e,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(e,t,n){return Si.call(this,e,"%b",t,n)},date_to_long_string:function(e,t,n){return Si.call(this,e,"%B",t,n)}});const Li=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,Ai=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var zi=Object.freeze({__proto__:null,append:function(e,t){Ue(2===arguments.length,"append expect 2 arguments");const n=he(e),i=he(t);return this.context.memoryLimit.use(n.length+i.length),n+i},prepend:function(e,t){Ue(2===arguments.length,"prepend expect 2 arguments");const n=he(e),i=he(t);return this.context.memoryLimit.use(n.length+i.length),i+n},lstrip:function(e,t){const n=he(e);return this.context.memoryLimit.use(n.length),t?(t=ze(he(t)),n.replace(new RegExp(`^[${t}]+`,"g"),"")):n.replace(/^\s+/,"")},downcase:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),t.toLowerCase()},upcase:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),he(t).toUpperCase()},remove:function(e,t){const n=he(e);return this.context.memoryLimit.use(n.length),n.split(he(t)).join("")},remove_first:function(e,t){const n=he(e);return this.context.memoryLimit.use(n.length),n.replace(he(t),"")},remove_last:function(e,t){const n=he(e);this.context.memoryLimit.use(n.length);const i=he(t),r=n.lastIndexOf(i);return-1===r?n:n.substring(0,r)+n.substring(r+i.length)},rstrip:function(e,t){return e=he(e),this.context.memoryLimit.use(e.length),t?(t=ze(he(t)),e.replace(new RegExp(`[${t}]+$`,"g"),"")):e.replace(/\s+$/,"")},split:function(e,t){const n=he(e);this.context.memoryLimit.use(n.length);const i=n.split(he(t));for(;i.length&&""===i[i.length-1];)i.pop();return i},strip:function(e,t){const n=he(e);return this.context.memoryLimit.use(n.length),t?(t=ze(he(t)),n.replace(new RegExp(`^[${t}]+`,"g"),"").replace(new RegExp(`[${t}]+$`,"g"),"")):n.trim()},strip_newlines:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,"")},capitalize:function(e){return e=he(e),this.context.memoryLimit.use(e.length),e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},replace:function(e,t,n){const i=he(e);return this.context.memoryLimit.use(i.length),i.split(he(t)).join(n)},replace_first:function(e,t,n){const i=he(e);return this.context.memoryLimit.use(i.length),i.replace(he(t),n)},replace_last:function(e,t,n){const i=he(e);this.context.memoryLimit.use(i.length);const r=he(t),s=i.lastIndexOf(r);if(-1===s)return i;const a=he(n);return i.substring(0,s)+a+i.substring(s+r.length)},truncate:function(e,t=50,n="..."){const i=he(e);return this.context.memoryLimit.use(i.length),i.length<=t?e:i.substring(0,t-n.length)+n},truncatewords:function(e,t=15,n="..."){const i=he(e);this.context.memoryLimit.use(i.length);const r=i.split(/\s+/);t<=0&&(t=1);let s=r.slice(0,t).join(" ");return r.length>=t&&(s+=n),s},normalize_whitespace:function(e){const t=he(e);return this.context.memoryLimit.use(t.length),t.replace(/\s+/g," ")},number_of_words:function(e,t){const n=he(e);if(this.context.memoryLimit.use(n.length),!(e=n.trim()))return 0;switch(t){case"cjk":return(e.match(Li)||[]).length+(e.match(Ai)||[]).length;case"auto":return Li.test(e)?e.match(Li).length+(e.match(Ai)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}},array_to_sentence_string:function(e,t="and"){switch(this.context.memoryLimit.use(e.length),e.length){case 0:return"";case 1:return e[0];case 2:return`${e[0]} ${t} ${e[1]}`;default:return`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}}});const ji=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},pn),fi),vi),Ti),Oi),zi),ln);const Ri=["offset","limit","reversed"];function Vi(e,t,n){if(t.options.dynamicPartials){const t=e.readValue();if(e.assert(t,"illegal file path"),"none"===t.getText())return;if(Wn(t)){return Ci(n.parse(t.content))}return t}const i=[...e.readFileNameTemplate(t.options)],r=Ci(n.parseTokens(i));return"none"===r?void 0:r}function Ci(e){return 1===e.length&&Jn(e[0].token)?e[0].token.getContent():e}function*Ei(e,t,n){return"string"==typeof e?e:Array.isArray(e)?n.renderer.renderTemplates(e,t):yield Wt(e,t)}class qi extends Je{constructor(e,t,n,i){super(e,n,i),this.length=e,this.cols=t}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const Di={assign:class extends Tn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new On(this.tokenizer.readFilteredValue(),this.liquid)}*render(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Tn{constructor(e,t,n,i){super(e,t,n);const r=this.tokenizer.readIdentifier(),s=this.tokenizer.readIdentifier(),a=this.tokenizer.readValue();if(!r.size()||"in"!==s.content||!a)throw new Error(`illegal tag: ${e.getText()}`);let o;this.variable=r.content,this.collection=a,this.hash=new _n(this.tokenizer,n.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=i.parseStream(t).on("start",(()=>o=this.templates)).on("tag:else",(e=>{He(e.args),o=this.elseTemplates})).on("tag:endfor",(e=>{He(e.args),l.stop()})).on("template",(e=>o.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){const n=this.liquid.renderer;let i=de(yield Wt(this.collection,e));if(!i.length)return void(yield n.renderTemplates(this.elseTemplates,e,t));const r="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(r)});const s=yield this.hash.render(e);e.pop();i=(this.liquid.options.orderedFilterParameters?Object.keys(s).filter((e=>Ri.includes(e))):Ri.filter((e=>void 0!==s[e]))).reduce(((e,t)=>{return"offset"===t?(n=e,i=s.offset,n.slice(i)):"limit"===t?function(e,t){return e.slice(0,t)}(e,s.limit):function(e){return[...e].reverse()}(e);var n,i}),i),e.setRegister(r,(s.offset||0)+i.length);const a={forloop:new Je(i.length,this.collection.getText(),this.variable)};e.push(a);for(const r of i){if(a[this.variable]=r,e.continueCalled=e.breakCalled=!1,yield n.renderTemplates(this.templates,e,t),e.breakCalled)break;a.forloop.next()}e.continueCalled=e.breakCalled=!1,e.pop()}*children(){const e=this.templates.slice();return this.elseTemplates&&e.push(...this.elseTemplates),e}*arguments(){yield this.collection;for(const e of Object.values(this.hash.hash))ti(e)&&(yield e)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Tn{constructor(e,t,n,i){for(super(e,t,n),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;t.length;){const e=t.shift();if(Kn(e)&&"endcapture"===e.name)return;this.templates.push(i.parseToken(e,t))}throw new Error(`tag ${e.getText()} not closed`)}readVariable(){let e=this.tokenizer.readIdentifier();if(e.content)return e;if(e=this.tokenizer.readQuoted(),e)return e;throw this.tokenizer.error("invalid capture name")}*render(e){const t=this.liquid.renderer,n=yield t.renderTemplates(this.templates,e);e.bottom()[this.variable]=n}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Tn{constructor(e,t,n,i){super(e,t,n),this.branches=[],this.elseTemplates=[],this.value=new On(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let r=[],s=0;const a=i.parseStream(t).on("tag:when",(e=>{if(s>0)return;r=[];const t=[];for(;!e.tokenizer.end();)t.push(e.tokenizer.readValueOrThrow()),e.tokenizer.skipBlank(),","===e.tokenizer.peek()?e.tokenizer.readTo(","):e.tokenizer.readTo("or");this.branches.push({values:t,templates:r})})).on("tag:else",(()=>{s++,r=this.elseTemplates})).on("tag:endcase",(()=>a.stop())).on("template",(e=>{r===this.elseTemplates&&1!==s||r.push(e)})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));a.start()}*render(e,t){const n=this.liquid.renderer,i=fe(yield this.value.value(e,e.opts.lenientIf));let r=!1;for(const s of this.branches)for(const a of s.values){if(tn(i,yield Wt(a,e,e.opts.lenientIf))){yield n.renderTemplates(s.templates,e,t),r=!0;break}}r||(yield n.renderTemplates(this.elseTemplates,e,t))}*arguments(){yield this.value,yield*this.branches.flatMap((e=>e.values))}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}},comment:class extends Tn{constructor(e,t,n){for(super(e,t,n);t.length;){const e=t.shift();if(Kn(e)&&"endcomment"===e.name)return}throw new Error(`tag ${e.getText()} not closed`)}render(){}},include:class extends Tn{constructor(e,t,n,i){super(e,t,n);const{tokenizer:r}=e;this.file=Vi(r,this.liquid,i),this.currentFile=e.file;const s=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=s):r.p=s,this.hash=new _n(r,n.options.jekyllInclude||n.options.keyValueSeparator)}*render(e,t){const{liquid:n,hash:i,withVar:r}=this,{renderer:s}=n,a=yield Ei(this.file,e,n);Ue(a,(()=>`illegal file path "${a}"`));const o=e.saveRegister("blocks","blockMode");e.setRegister("blocks",{}),e.setRegister("blockMode",Un.OUTPUT);const l=yield i.render(e);r&&(l[a]=yield Wt(r,e));const u=yield n._parsePartialFile(a,e.sync,this.currentFile);e.push(e.opts.jekyllInclude?{include:l}:l),yield s.renderTemplates(u,e,t),e.pop(),e.restoreRegister(o)}*children(e,t){return e&&oe(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(oe(this.file)){let e;return this.liquid.options.jekyllInclude?e=["include"]:(e=Object.keys(this.hash.hash),this.withVar&&e.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:e}}}*arguments(){yield*Object.values(this.hash.hash).filter(ti),ti(this.file)&&(yield this.file),ti(this.withVar)&&(yield this.withVar)}},render:class extends Tn{constructor(e,t,n,i){super(e,t,n);const r=this.tokenizer;for(this.file=Vi(r,this.liquid,i),this.currentFile=e.file;!r.end();){r.skipBlank();const e=r.p,t=r.readIdentifier();if(("with"===t.content||"for"===t.content)&&(r.skipBlank(),":"!==r.peek())){const e=r.readValue();if(e){const n=r.p;let i;"as"===r.readIdentifier().content?i=r.readIdentifier():r.p=n,this[t.content]={value:e,alias:i&&i.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=e;break}this.hash=new _n(r,n.options.keyValueSeparator)}*render(e,t){const{liquid:n,hash:i}=this,r=yield Ei(this.file,e,n);Ue(r,(()=>`illegal file path "${r}"`));const s=e.spawn(),a=s.bottom();if(et(a,yield i.render(e)),this.with){const{value:t,alias:n}=this.with;a[n||r]=yield Wt(t,e)}if(this.for){const{value:i,alias:o}=this.for,l=de(yield Wt(i,e));a.forloop=new Je(l.length,i.getText(),o);for(const e of l){a[o]=e;const i=yield n._parsePartialFile(r,s.sync,this.currentFile);yield n.renderer.renderTemplates(i,s,t),a.forloop.next()}}else{const e=yield n._parsePartialFile(r,s.sync,this.currentFile);yield n.renderer.renderTemplates(e,s,t)}}*children(e,t){return e&&oe(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(oe(this.file)){const e=Object.keys(this.hash.hash);if(this.with){const{value:t,alias:n}=this.with;oe(n)?e.push([n,t]):oe(this.file)&&e.push([this.file,t])}if(this.for){const{value:t,alias:n}=this.for;oe(n)?e.push([n,t]):oe(this.file)&&e.push([this.file,t])}return{name:this.file,isolated:!0,scope:e}}}*arguments(){for(const e of Object.values(this.hash.hash))ti(e)&&(yield e);if(this.with){const{value:e}=this.with;ti(e)&&(yield e)}if(this.for){const{value:e}=this.for;ti(e)&&(yield e)}}},decrement:class extends Tn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){const n=e.environments;ge(n[this.variable])||(n[this.variable]=0),t.write(he(--n[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Tn{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){const n=e.environments;ge(n[this.variable])||(n[this.variable]=0);const i=n[this.variable];n[this.variable]++,t.write(he(i))}*localScope(){yield this.identifier}},cycle:class extends Tn{constructor(e,t,n){super(e,t,n),this.candidates=[];const i=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),i&&(":"===this.tokenizer.peek()?(this.group=i,this.tokenizer.advance()):this.candidates.push(i));!this.tokenizer.end();){const e=this.tokenizer.readValue();e&&this.candidates.push(e),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,(()=>`empty candidates: "${e.getText()}"`))}*render(e,t){const n=`cycle:${yield Wt(this.group,e)}:`+this.candidates.join(","),i=e.getRegister("cycle");let r=i[n];void 0===r&&(r=i[n]=0);const s=this.candidates[r];return r=(r+1)%this.candidates.length,i[n]=r,yield Wt(s,e)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Tn{constructor(e,t,n,i){super(e,t,n),this.branches=[];let r=[];i.parseStream(t).on("start",(()=>this.branches.push({value:new On(e.tokenizer.readFilteredValue(),this.liquid),templates:r=[]}))).on("tag:elsif",(e=>{Ue(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new On(e.tokenizer.readFilteredValue(),this.liquid),templates:r=[]})})).on("tag:else",(e=>{He(e.args),Ue(!this.elseTemplates,"duplicated else"),r=this.elseTemplates=[]})).on("tag:endif",(function(e){He(e.args),this.stop()})).on("template",(e=>r.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const n=this.liquid.renderer;for(const{value:i,templates:r}of this.branches){if(Zt(yield i.value(e,e.opts.lenientIf),e))return void(yield n.renderTemplates(r,e,t))}yield n.renderTemplates(this.elseTemplates||[],e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map((e=>e.value))}},layout:class extends Tn{constructor(e,t,n,i){super(e,t,n),this.file=Vi(this.tokenizer,this.liquid,i),this.currentFile=e.file,this.args=new _n(this.tokenizer,n.options.keyValueSeparator),this.templates=i.parseTokens(t)}*render(e,t){const{liquid:n,args:i,file:r}=this,{renderer:s}=n;if(void 0===r)return e.setRegister("blockMode",Un.OUTPUT),void(yield s.renderTemplates(this.templates,e,t));const a=yield Ei(this.file,e,n);Ue(a,(()=>`illegal file path "${a}"`));const o=yield n._parseLayoutFile(a,e.sync,this.currentFile);e.setRegister("blockMode",Un.STORE);const l=yield s.renderTemplates(this.templates,e),u=e.getRegister("blocks");void 0===u[""]&&(u[""]=(e,t)=>t.write(l)),e.setRegister("blockMode",Un.OUTPUT),e.push(yield i.render(e)),yield s.renderTemplates(o,e,t),e.pop()}*children(e){const t=this.templates.slice();return e&&oe(this.file)&&t.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),t}*arguments(){for(const e of Object.values(this.args.hash))ti(e)&&(yield e);ti(this.file)&&(yield this.file)}partialScope(){if(oe(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Tn{constructor(e,t,n,i){super(e,t,n),this.templates=[];const r=/\w+/.exec(e.args);for(this.block=r?r[0]:"";t.length;){const e=t.shift();if(Kn(e)&&"endblock"===e.name)return;const n=i.parseToken(e,t);this.templates.push(n)}throw new Error(`tag ${e.getText()} not closed`)}*render(e,t){const n=this.getBlockRender(e);e.getRegister("blockMode")===Un.STORE?e.getRegister("blocks")[this.block]=n:yield n(new Ke,t)}getBlockRender(e){const{liquid:t,templates:n}=this,i=e.getRegister("blocks")[this.block],r=function*(i,r){e.push({block:i}),yield t.renderer.renderTemplates(n,e,r),e.pop()};return i?(e,t)=>i(new Ke((()=>r(e,t))),t):r}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Tn{constructor(e,t,n){for(super(e,t,n),this.tokens=[];t.length;){const e=t.shift();if(Kn(e)&&"endraw"===e.name)return;this.tokens.push(e)}throw new Error(`tag ${e.getText()} not closed`)}render(){return this.tokens.map((e=>e.getText())).join("")}},tablerow:class extends Tn{constructor(e,t,n,i){super(e,t,n);const r=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const s=this.tokenizer.readIdentifier(),a=this.tokenizer.readValue();if("in"!==s.content||!a)throw new Error(`illegal tag: ${e.getText()}`);let o;this.variable=r.content,this.collection=a,this.args=new _n(this.tokenizer,n.options.keyValueSeparator),this.templates=[];const l=i.parseStream(t).on("start",(()=>o=this.templates)).on("tag:endtablerow",(()=>l.stop())).on("template",(e=>o.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){let n=de(yield Wt(this.collection,e));const i=yield this.args.render(e),r=i.offset||0,s=void 0===i.limit?n.length:i.limit;n=n.slice(r,r+s);const a=i.cols||n.length,o=this.liquid.renderer,l=new qi(n.length,a,this.collection.getText(),this.variable),u={tablerowloop:l};e.push(u);for(let i=0;i<n.length;i++,l.next())u[this.variable]=n[i],0===l.col0()&&(1!==l.row()&&t.write("</tr>"),t.write(`<tr class="row${l.row()}">`)),t.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,e,t),t.write("</td>");n.length&&t.write("</tr>"),e.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const e of Object.values(this.args.hash))ti(e)&&(yield e)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Tn{constructor(e,t,n,i){super(e,t,n),this.branches=[],this.elseTemplates=[];let r=[],s=0;i.parseStream(t).on("start",(()=>this.branches.push({value:new On(e.tokenizer.readFilteredValue(),this.liquid),test:Xt,templates:r=[]}))).on("tag:elsif",(e=>{s>0?r=[]:this.branches.push({value:new On(e.tokenizer.readFilteredValue(),this.liquid),test:Zt,templates:r=[]})})).on("tag:else",(()=>{s++,r=this.elseTemplates})).on("tag:endunless",(function(){this.stop()})).on("template",(e=>{r===this.elseTemplates&&1!==s||r.push(e)})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const n=this.liquid.renderer;for(const{value:i,test:r,templates:s}of this.branches){if(r(yield i.value(e,e.opts.lenientIf),e))return void(yield n.renderTemplates(s,e,t))}yield n.renderTemplates(this.elseTemplates,e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map((e=>e.value))}},break:class extends Tn{render(e,t){e.breakCalled=!0}},continue:class extends Tn{render(e,t){e.continueCalled=!0}},echo:class extends Tn{constructor(e,t,n){super(e,t,n),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new On(this.tokenizer.readFilteredValue(),this.liquid))}*render(e,t){if(!this.value)return;const n=yield this.value.value(e,!1);t.write(n)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Tn{constructor(e,t,n,i){super(e,t,n);const r=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=i.parseTokens(r)}*render(e,t){yield this.liquid.renderer.renderTemplates(this.templates,e,t)}*children(){return this.templates}},"#":class extends Tn{constructor(e,t,n){if(super(e,t,n),-1!==e.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class Mi{constructor(e={}){this.renderer=new Jt,this.filters={},this.tags={},this.options=gn(e),this.parser=new Gn(this),we(Di,((e,t)=>this.registerTag(t,e))),we(ji,((e,t)=>this.registerFilter(t,e)))}parse(e,t){return new Gn(this).parse(e,t)}_render(e,t,n){const i=t instanceof ii?t:new ii(t,this.options,n);return this.renderer.renderTemplates(e,i)}render(e,t,n){return tt(this,void 0,void 0,(function*(){return nt(this._render(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}renderSync(e,t,n){return it(this._render(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderToNodeStream(e,t,n={}){const i=new ii(t,this.options,n);return this.renderer.renderTemplatesToNodeStream(e,i)}_parseAndRender(e,t,n){const i=this.parse(e);return this._render(i,t,n)}parseAndRender(e,t,n){return tt(this,void 0,void 0,(function*(){return nt(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}parseAndRenderSync(e,t,n){return it(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!0})))}_parsePartialFile(e,t,n){return new Gn(this).parseFile(e,t,In.Partials,n)}_parseLayoutFile(e,t,n){return new Gn(this).parseFile(e,t,In.Layouts,n)}_parseFile(e,t,n,i){return new Gn(this).parseFile(e,t,n,i)}parseFile(e,t){return tt(this,void 0,void 0,(function*(){return nt(new Gn(this).parseFile(e,!1,t))}))}parseFileSync(e,t){return it(new Gn(this).parseFile(e,!0,t))}*_renderFile(e,t,n){const i=yield this._parseFile(e,n.sync,n.lookupType);return yield this._render(i,t,n)}renderFile(e,t,n){return tt(this,void 0,void 0,(function*(){return nt(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!1})))}))}renderFileSync(e,t,n){return it(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderFileToNodeStream(e,t,n){return tt(this,void 0,void 0,(function*(){const i=yield this.parseFile(e);return this.renderToNodeStream(i,t,n)}))}_evalValue(e,t){const n=new On(e,this),i=t instanceof ii?t:new ii(t,this.options);return n.value(i)}evalValue(e,t){return tt(this,void 0,void 0,(function*(){return nt(this._evalValue(e,t))}))}evalValueSync(e,t){return it(this._evalValue(e,t))}registerFilter(e,t){this.filters[e]=t}registerTag(e,t){var n;this.tags[e]=le(t)?t:(n=t,class extends Tn{constructor(e,t,i){super(e,t,i),le(n.parse)&&n.parse.call(this,e,t)}*render(e,t){const i=yield new _n(this.token.args,e.opts.keyValueSeparator).render(e);return yield n.render.call(this,e,t,i)}})}plugin(e){return e.call(this,Mi)}express(){const e=this;let t=!0;return function(n,i,r){if(t){t=!1;const n=vn(this.root);e.options.root.unshift(...n),e.options.layouts.unshift(...n),e.options.partials.unshift(...n)}e.renderFile(n,i).then((e=>r(null,e)),r)}}analyze(e,t={}){return tt(this,void 0,void 0,(function*(){return Cn(e,t)}))}analyzeSync(e,t={}){return En(e,t)}parseAndAnalyze(e,t,n={}){return tt(this,void 0,void 0,(function*(){return Cn(this.parse(e,t),n)}))}parseAndAnalyzeSync(e,t,n={}){return En(this.parse(e,t),n)}variables(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Object.keys(n.variables)}))}variablesSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Object.keys(n.variables)}fullVariables(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap((e=>e.map((e=>String(e)))))))}))}fullVariablesSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap((e=>e.map((e=>String(e)))))))}variableSegments(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Array.from(je(Object.values(n.variables).flatMap((e=>e.map((e=>e.toArray()))))))}))}variableSegmentsSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Array.from(je(Object.values(n.variables).flatMap((e=>e.map((e=>e.toArray()))))))}globalVariables(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Object.keys(n.globals)}))}globalVariablesSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Object.keys(n.globals)}globalFullVariables(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap((e=>e.map((e=>String(e)))))))}))}globalFullVariablesSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap((e=>e.map((e=>String(e)))))))}globalVariableSegments(e,t={}){return tt(this,void 0,void 0,(function*(){const n=yield Cn(oe(e)?this.parse(e):e,t);return Array.from(je(Object.values(n.globals).flatMap((e=>e.map((e=>e.toArray()))))))}))}globalVariableSegmentsSync(e,t={}){const n=En(oe(e)?this.parse(e):e,t);return Array.from(je(Object.values(n.globals).flatMap((e=>e.map((e=>e.toArray()))))))}}const $i={render:function(e,t){const n=s("v-icon"),i=s("v-list-item-icon"),r=s("v-text-overflow"),h=s("v-list-item-content"),d=s("v-list-item"),p=s("v-list");return a(),o(p,{nav:""},{default:l((()=>[u(d,{to:"/tta_settings/templates"},{default:l((()=>[u(i,null,{default:l((()=>[u(n,{name:"code"})])),_:1}),u(h,null,{default:l((()=>[u(r,{text:"Templates"})])),_:1})])),_:1}),u(d,{to:"/tta_settings/settings"},{default:l((()=>[u(i,null,{default:l((()=>[u(n,{name:"settings"})])),_:1}),u(h,null,{default:l((()=>[u(r,{text:"Settings"})])),_:1})])),_:1}),c(' <v-list-item to="/tta_settings/usage">\n <v-list-item-icon><v-icon name="bar_chart" /></v-list-item-icon>\n <v-list-item-content>\n <v-text-overflow text="Usage" />\n </v-list-item-content>\n </v-list-item> ')])),_:1})},__file:"settingsmodule/src/TTAnav.vue"},Ni=e=>(f("data-v-a21ba87e"),e=e(),m(),e),Pi={key:0,class:"popover"},Ii=Ni((()=>g("br",null,null,-1))),Bi=Ni((()=>g("ul",null,[g("li",null,"HTML - preview as webpage"),g("li",null,"PDF (Preview) - watermarked, free"),g("li",null,"PDF - final version, without watermark"),g("li",null,"Code - preview without test input")],-1)));var Ui={__name:"explainPreviewMode",props:{text:{type:String,required:!0}},setup(e){const t=h(!1);return(e,n)=>{const i=s("v-icon");return a(),d("div",{class:"info-popover",onMouseenter:n[0]||(n[0]=e=>t.value=!0),onMouseleave:n[1]||(n[1]=e=>t.value=!1)},[u(i,{name:"question_mark",class:"info-icon"}),t.value?(a(),d("div",Pi,[p(" The preview mode has 4 modes: "),Ii,Bi])):c("v-if",!0)],32)}}},Hi=[],Gi=[];function Yi(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,s="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var a=Hi.indexOf(s);-1===a&&(a=Hi.push(s)-1,Gi[a]={}),n=Gi[a]&&Gi[a][i]?Gi[a][i]:Gi[a][i]=o()}else n=o();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function o(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var a="prepend"===i?"afterbegin":"beforeend";return s.insertAdjacentElement(a,e),e}}Yi("\n.info-popover[data-v-a21ba87e] {\n position: relative;\n display: flex;\n color: var(--theme--foreground-subdued);\n}\n.info-icon[data-v-a21ba87e] {\n margin: auto;\n}\n.popover[data-v-a21ba87e] {\n position: absolute;\n top: 175%;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--theme--background);\n color: var(--theme--foreground);\n border: 1px solid var(--theme--border);\n padding: 0.5rem;\n border-radius: 4px;\n white-space: nowrap;\n z-index: 1000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n}\n",{}),Ui.__scopeId="data-v-a21ba87e",Ui.__file="settingsmodule/src/explainPreviewMode.vue";const Ji=g("div",{class:"field half"},[g("div",{class:"type-label"},"Template name")],-1),Ki=g("div",{class:"field half"},[g("div",{class:"type-label"},"Description")],-1),Wi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Format")],-1),Qi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Orientation")],-1),Zi=g("div",{class:"field half"},[g("div",{class:"type-label"},"Collection")],-1),Xi={key:0,class:"TTA-popup"},er={class:"TTA-toolbar"},tr={class:"right-side"},nr={class:"setwidth"},ir={class:"TTA-action"},rr={class:"TTA-wapper"},sr={class:"devFields"},ar=g("div",{class:"field half"},[g("div",{class:"type-label"},"Type input")],-1),or={id:"partSelect"},lr=["src","srcDoc"];var ur=v({__name:"templates",setup(e){const{useCollectionsStore:i,useFlowsStore:r}=t(),f=r(),m=x((()=>f.flows.filter((e=>"webhook"===e.trigger&&"POST"==e.options.method)).map((e=>({text:e.name,value:e.id}))))),v=h([]),O=h(!1),L=h(!1),A=h("Development"),z=h("html"),j=h(""),R=h(50),V=x((()=>100-R.value)),C=x((()=>100-V.value)),E=h("");function q(e){"Header"==A.value?N.value.header=e:"Body"==A.value?N.value.template=e:N.value.footer=e}function D(e){"Fixed"==N.value.input_type?N.value.input_fixed=e:N.value.input_flow_body=e}y((()=>A.value),(e=>{"Development"==e&&(E.value=""),"Header"==e&&(E.value=N.value.header),"Body"==e&&(E.value=N.value.template),"Footer"==e&&(E.value=N.value.footer)}),{immediate:!0});const M=n(),$={template:"<h1>Hello {{name}}!</h1>",id:-1,name:"",description:"",collection:"",format:"A4",orientation:"portrait",header:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; \n -webkit-print-color-adjust: exact;\n }\n</style>\n<div style='width:100%'>\n <span class='date'></span>\n <span class='title' style='float:right'></span>\n</div>",footer:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; -webkit-print-color-adjust: exact;\n }\n</style>\n<div\n style=‘width:100%’>\n <div style=‘float:right’><span\n class='pageNumber'></span> / <span class='totalPages'></span>\n </div>\n</div>",input_type:"Fixed",input_fixed:'{"name": "World!"}',input_flow:"",input_flow_body:"{}"},N=h(structuredClone($)),P=i(),I=x((()=>P.collections.filter((e=>"TTA_htmltemplates"!=e.collection)).map((e=>({text:e.name,value:e.collection}))))),B=new Mi;async function U(e=0){j.value="rendering";let t={};try{if("Flow"==N.value.input_type){const e=await M.post("/flows/trigger/"+N.value.input_flow,JSON.parse(N.value.input_flow_body));if("object"!=typeof e.data)throw new Error("Output of flow should be an object, not an "+typeof e.data);if("name"in e.data&&"code"in e.data&&"status"in e.data)throw new Error(JSON.stringify(e.data));t=e.data}else null==N.value.input_fixed&&(N.value.input_fixed="{}"),t=JSON.parse(N.value.input_fixed);if("html"==e||"code"==e){const n=(N.value.header||"")+(N.value.template||"")+(N.value.footer||""),i=new Blob(['<style>\n .date:before{content: "Date here";font-style: italic; }\n .title:before{content: "Title here";font-style: italic; }\n .pageNumber:before{content: "Pagenumber";font-style: italic; }\n .totalPages:before{content: "Total pages";font-style: italic; }\n </style>'+("code"==e?n:await B.render(B.parse(n),t))],{type:"text/html"});j.value=URL.createObjectURL(i)}else{const e=B.parse(N.value.header||""),n=B.parse(N.value.template),i=B.parse(N.value.footer||""),r=await B.render(e,t),s=await B.render(n,t),a=await B.render(i,t),o=await fetch("/tta/pdf?preview="+("pdf-preview"==z.value?"preview":""),{body:JSON.stringify({...N.value,input_fixed:void 0,input_flow:void 0,input_flow_body:void 0,input_type:void 0,id:void 0,header:r,html:s,footer:a,landscape:"portrait"!=N.value.orientation}),method:"POST",headers:{"Content-Type":"application/json"}}).then((e=>e.blob())).then((e=>URL.createObjectURL(e)));j.value=o}}catch(e){console.error(e),notificationStore.add({title:"Error while generating PDF",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),j.value="Error occurred: "+((null==e?void 0:e.message)||e)}}async function H(){const e=await M.get("/items/TTA_htmltemplates",{params:{limit:-1}});v.value=e.data.data}async function G(){-1==N.value.id?await M.post("/items/TTA_htmltemplates",{...N.value,id:void 0}):await M.patch("/items/TTA_htmltemplates/"+N.value.id,{...N.value,id:void 0}),O.value=!1,H()}function Y({item:e}){N.value=e,L.value=!0}function J(){N.value=structuredClone($),L.value=!1}function K(){N.value.template=te(N.value.template),N.value.footer=te(N.value.footer),N.value.header=te(N.value.header)}return y((()=>N.value.id),((e,t)=>{e!=t&&(A.value="",b((()=>{A.value="Body"})))})),y((()=>[N.value.header,N.value.template,N.value.footer,N.value.input_type,N.value.input_flow,N.value.input_fixed,z.value]),(()=>{["html","code"].includes(z.value)&&U(z.value)}),{deep:!0,immediate:!0}),w((async()=>{R.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),H()})),y((()=>R.value),(e=>localStorage.setItem("TTA-widthPartition",e+""))),(e,t)=>{const n=s("v-icon"),i=s("v-button"),r=s("v-card-title"),h=s("v-input"),f=s("v-list-item-content"),x=s("v-list-item"),y=s("v-select"),b=s("v-list"),w=s("v-card-text"),M=s("v-card-actions"),$=s("v-card"),P=s("v-dialog"),B=s("VSelect"),H=s("v-slider"),W=s("VButton"),Q=s("v-table"),Z=s("private-view");return a(),o(Z,{title:"Templates"},{navigation:l((()=>[u($i)])),actions:l((()=>[u(i,{rounded:"",icon:"",onClick:t[0]||(t[0]=e=>O.value=!0)},{default:l((()=>[u(n,{name:"add"})])),_:1}),u(P,{modelValue:O.value,"onUpdate:modelValue":t[7]||(t[7]=e=>O.value=e),persistent:!0},{default:l((()=>[u($,null,{default:l((()=>[u(r,null,{default:l((()=>[p("Create a new HTML template")])),_:1}),u(w,null,{default:l((()=>[u(b,null,{default:l((()=>[u(x,null,{default:l((()=>[u(f,null,{default:l((()=>[Ji,u(h,{modelValue:N.value.name,"onUpdate:modelValue":t[1]||(t[1]=e=>N.value.name=e),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),u(x,null,{default:l((()=>[u(f,null,{default:l((()=>[Ki,u(h,{modelValue:N.value.description,"onUpdate:modelValue":t[2]||(t[2]=e=>N.value.description=e),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),u(x,null,{default:l((()=>[u(f,null,{default:l((()=>[Wi,u(y,{modelValue:N.value.format,"onUpdate:modelValue":t[3]||(t[3]=e=>N.value.format=e),placeholder:"Size",items:["A1","A2","A3","A4","A5","A6","Letter","Legal","Tabloid","Ledger"].map((e=>({text:e,value:e})))},null,8,["modelValue","items"])])),_:1})])),_:1}),u(x,null,{default:l((()=>[u(f,null,{default:l((()=>[Qi,u(y,{modelValue:N.value.orientation,"onUpdate:modelValue":t[4]||(t[4]=e=>N.value.orientation=e),placeholder:"Orientation",items:["portrait","landscape"].map((e=>({text:e,value:e})))},null,8,["modelValue","items"])])),_:1})])),_:1}),u(x,null,{default:l((()=>[u(f,null,{default:l((()=>[Zi,u(y,{modelValue:N.value.collection,"onUpdate:modelValue":t[5]||(t[5]=e=>N.value.collection=e),items:k(I),placeholder:"Collection"},null,8,["modelValue","items"])])),_:1})])),_:1})])),_:1})])),_:1}),u(M,null,{default:l((()=>[u(i,{secondary:"",onClick:t[6]||(t[6]=e=>O.value=!1)},{default:l((()=>[p(" Cancel ")])),_:1}),u(i,{disabled:!N.value.collection||!N.value.name||!N.value.format,onClick:G},{default:l((()=>[p(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:l((()=>[L.value?(a(),d("div",Xi,[g("div",er,[g("div",{onClick:t[8]||(t[8]=e=>O.value=!0),class:"TTA-template-title"},[p(T(N.value.name)+" ",1),u(n,{name:"edit"})]),g("div",tr,[u(B,{modelValue:z.value,"onUpdate:modelValue":t[9]||(t[9]=e=>z.value=e),items:[{text:"HTML",value:"html"},{text:"PDF (Preview)",value:"pdf-preview"},{text:"PDF",value:"pdf"},{text:"Code",value:"code"}],style:{width:"170px"}},null,8,["modelValue","items"]),u(Ui,{text:"This is helpful info."}),g("div",{class:"TTA-action",onClick:K},[u(n,{name:"vertical_align_center"})]),g("div",{class:"TTA-action",onClick:G},[u(n,{name:"save"})]),g("div",nr,[u(H,{modelValue:R.value,"onUpdate:modelValue":t[10]||(t[10]=e=>R.value=e),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),g("div",ir,[u(n,{name:"close",onClick:J})])])]),g("div",rr,[g("div",{style:_("width: "+k(C)+"%"),class:"TTA-editor-wrapper"},["Development"==A.value?(a(),d(S,{key:0},[g("div",sr,[ar,u(y,{modelValue:N.value.input_type,"onUpdate:modelValue":t[11]||(t[11]=e=>N.value.input_type=e),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==N.value.input_type?(a(),o(y,{key:0,modelValue:N.value.input_flow,"onUpdate:modelValue":t[12]||(t[12]=e=>N.value.input_flow=e),class:"max-w-input",items:k(m)},null,8,["modelValue","items"])):c("v-if",!0)]),"Fixed"==N.value.input_type?(a(),o(F("interface-input-code"),{key:0,class:"TTA-editor",value:N.value.input_fixed,language:"json",onInput:D},null,40,["value"])):c("v-if",!0),"Flow"==N.value.input_type?(a(),o(F("interface-input-code"),{key:1,class:"TTA-editor",value:N.value.input_flow_body,language:"json",onInput:D},null,40,["value"])):c("v-if",!0)],64)):c("v-if",!0),"Development"!=A.value?(a(),o(F("interface-input-code"),{key:1,class:"TTA-editor",value:E.value,language:"htmlmixed",onInput:q},null,40,["value"])):c("v-if",!0),g("div",or,[u(y,{modelValue:A.value,"onUpdate:modelValue":t[13]||(t[13]=e=>A.value=e),items:[{value:"Header",text:"Header"},{value:"Body",text:"Body"},{value:"Footer",text:"Footer"},{value:"Development",text:"Test input"}]},null,8,["modelValue"])])],4),g("iframe",{class:"TTA-preview",src:"rendering"==j.value?void 0:j.value,srcDoc:"rendering"==j.value?k('\n <html>\n <head>\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n font-family: sans-serif;\n background: #f9f9f9;\n }\n .spinner {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .loader {\n border: 6px solid #f3f3f3;\n border-top: 6px solid #3498db;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n margin-bottom: 10px;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n </head>\n <body>\n <div class="spinner">\n <div class="loader"></div>\n <div>Loading...</div>\n </div>\n </body>\n </html>'):void 0,style:_("width: "+k(V)+"%")},null,12,lr),z.value.startsWith("pdf")?(a(),o(W,{key:0,onClick:t[14]||(t[14]=e=>{U("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:l((()=>[u(n,{name:"refresh"})])),_:1})):c("v-if",!0)])])):c("v-if",!0),u(Q,{headers:[{text:"Name",value:"name"},{text:"Description",value:"description"},{text:"Collection",value:"collection"},{text:"Format",value:"format"}],"onClick:row":Y,items:v.value},null,8,["items"])])),_:1})}}});Yi("\n.TTA-popup {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n flex-direction: column;\n background-color: var(--background-subdued);\n}\n.TTA-toolbar {\n background-color: var(--background-subdued);\n display: flex;\n justify-content: space-between;\n}\n.TTA-toolbar .right-side {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.TTA-toolbar .TTA-slider {\n padding-top: 5px;\n}\n.TTA-toolbar .TTA-action {\n padding: 5px;\n cursor: pointer;\n}\n.TTA-toolbar .setwidth {\n display: flex;\n gap: 10px;\n padding-top: 6px;\n}\n.TTA-toolbar .TTA-template-title {\n margin: auto 0;\n font-size: 18px;\n cursor: pointer;\n padding-right: 5px;\n padding-left: 20px;\n border-bottom: 1px solid var(--v-list-item-border-color);\n}\n.TTA-toolbar .TTA-template-title i {\n padding-left: 5px;\n}\n.TTA-wapper {\n display: flex;\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n}\n.TTA-preview {\n flex-grow: 1;\n background-color: white;\n border: 0;\n}\n.TTA-editor {\n flex-grow: 1;\n height: 100%;\n width: 100%;\n max-height: calc(100vh - 130px);\n}\n.TTA-wapper .TTA-editor-wrapper {\n position: relative;\n}\n.TTA-editor > div {\n height: 100% !important;\n border-radius: 0 !important;\n}\n.TTA-editor .CodeMirror {\n height: 100%;\n}\n.TTA-wapper #partSelect {\n position: absolute;\n right: 0;\n top: 0;\n width: 200px;\n}\n.devFields {\n border-top: var(--theme--border-width) solid\n var(--theme--form--field--input--border-color);\n margin-left: 25px;\n margin-bottom: 10px;\n}\n.max-w-input {\n max-width: 250px;\n padding: 10px 0;\n}\n.max-w-input .v-input {\n max-width: 250px;\n margin-bottom: 5px;\n}\n#generatePDF {\n position: fixed;\n top: 69px;\n right: 10px;\n}\n",{}),ur.__file="settingsmodule/src/templates.vue";const cr=e=>(f("data-v-014dce90"),e=e(),m(),e),hr={class:"px-5"},dr=cr((()=>g("span",{class:"field-name"},"RapidAPI token",-1)));var pr=v({__name:"settings",setup(e){const t=h(""),i=h(!1),r=n(),c=h([]);async function f(){i.value=!0,await r.patch("/settings",{TTA_KEY:t.value}),setTimeout((()=>{i.value=!1}),500)}return w((async()=>{const e=await r.get("/settings");t.value=e.data.data.TTA_KEY;const n=await r.get("/folders");c.value=n.data.data.map((e=>({text:e.name,value:e.id})))})),(e,n)=>{const r=s("v-card-title"),c=s("v-input"),h=s("v-card-text"),m=s("v-icon"),v=s("v-button"),x=s("v-progress-circular"),y=s("v-card-actions"),b=s("v-card"),w=s("private-view");return a(),o(w,{title:"Settings"},{navigation:l((()=>[u($i)])),default:l((()=>[g("div",hr,[u(b,{class:"w-full"},{default:l((()=>[u(r,null,{default:l((()=>[p("API settings")])),_:1}),u(h,{class:"fields-spacing"},{default:l((()=>[g("div",null,[dr,u(c,{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=e=>t.value=e)},null,8,["modelValue"])])])),_:1}),u(y,null,{default:l((()=>[u(v,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank"},{default:l((()=>[u(m,{name:"open_in_new"}),p(" Get RapidAPI token ")])),_:1}),u(v,{onClick:f,disabled:i.value},{default:l((()=>[i.value?(a(),o(x,{key:1,small:!0,indeterminate:""})):(a(),d(S,{key:0},[p(" Save ")],64))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});Yi("\n.w-full[data-v-014dce90] {\n width: 100%;\n}\n.px-5[data-v-014dce90] {\n padding: 0 2.5rem;\n}\n.fields-spacing[data-v-014dce90] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n",{}),pr.__scopeId="data-v-014dce90",pr.__file="settingsmodule/src/settings.vue";var fr=v({__name:"usage",setup:e=>(e,t)=>{const n=s("private-view");return a(),o(n,{title:"Usage"},{navigation:l((()=>[u($i)])),default:l((()=>[p(" Comming soon! ")])),_:1})}});fr.__file="settingsmodule/src/usage.vue";var mr=i({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:ur},{path:"settings",component:pr},{path:"usage",component:fr}]}),gr=v({__name:"interface",props:["value"],emits:["input"],setup(e,{emit:t}){const n=e,i=O("api"),r=h(""),l=h([]);return w((async()=>{r.value=n.value,y((()=>r.value),((e,n)=>{e!=n&&t("input",e)}));const e=await i.get("/items/TTA_htmltemplates");l.value=e.data.data.map((e=>({text:e.name,value:e.id})))})),(e,t)=>{const n=s("v-select");return a(),o(n,{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=e=>r.value=e),items:l.value},null,8,["modelValue","items"])}}});gr.__file="PDFTemplateSelector/src/interface.vue";var vr=r({id:"TTA-pdf-template-selector",name:"PDF template selector",icon:"picture_as_pdf",description:"Selector for a PDF template for Text To Anything",component:gr,options:null,types:["string"]}),xr=v({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0}},setup(e){const t=e,i=n(),r=h(!1);async function u(){r.value=!0;try{const e=await i.post("/flows/trigger/"+t.flow,{id:t.primaryKey});window.open("/assets/"+e.data,"_blank")}catch(e){}r.value=!1}return(e,n)=>{const i=s("v-button");return a(),o(i,{onClick:u,loading:r.value,disabled:r.value},{default:l((()=>[p(T(t.label),1)])),_:1},8,["loading","disabled"])}}});xr.__file="GeneratePDFFromTemplateInterface/src/interface.vue";var yr=r({id:"tta-download-interface",name:"Download interface",icon:"sim_card_download",description:"Download files based on a flow. (Text to anything)",hideLabel:!0,hideLoader:!0,component:xr,options:()=>{const{useFlowsStore:e}=t(),n=e();return[{field:"label",type:"string",name:"$t:label",meta:{width:"full",interface:"system-input-translated-string",options:{placeholder:"$t:label"}}},{field:"flow",name:"$t:operations.trigger.flow",type:"string",meta:{width:"full",interface:"select-dropdown",options:{choices:x((()=>n.flows.filter((e=>"webhook"===e.trigger&&"POST"==e.options.method)).map((e=>({text:e.name,value:e.id}))))),iconRight:"bolt",placeholder:"$t:a_flow_uuid"}}}]},types:["string"]});const br={key:0,class:"loading-screen"},wr={key:1,class:"image-display-area"},kr={class:"ocr-container",ref:"containerRef"},Tr=["src"],_r=["onClick","onMouseover"];var Sr=v({__name:"renderOCRResponse",props:{image:{type:null,required:!0},language:{type:String,required:!0}},emits:["close","loadingUpdate"],setup(e,{emit:n}){const i=e,{useNotificationsStore:r}=t(),o=r();h("");const l=h(null);h("");const p=h([]),f=h(),m=h(),v=h([]),y=h([]),b=h(!1),T=x((()=>v.value.sort().map((e=>p.value[e].text)).join(" ")));function F(){const e=f.value,t=e.naturalWidth,n=e.naturalHeight,i=e.clientWidth,r=e.clientHeight,s=i/t,a=r/n,o=[];y.value.forEach((e=>{e.paragraphs.forEach((e=>{e.lines.forEach((e=>{e.words.forEach((e=>{const t={x0:e.bbox.x0*s,y0:e.bbox.y0*a,x1:e.bbox.x1*s,y1:e.bbox.y1*a};o.push({text:e.text,confidence:e.confidence,bbox:t})}))}))}))})),p.value=o}function O(){const e=document.activeElement;if(("INPUT"===e.tagName||"TEXTAREA"===e.tagName)&&!e.readOnly&&!e.disabled&&T.value){const t=e.selectionStart,n=e.selectionEnd,i=e.value;e.value=i.slice(0,t)+T.value+i.slice(n),e.selectionStart=e.selectionEnd=t+T.length,v.value=[],e.dispatchEvent(new Event("input",{bubbles:!0}))}}return w((async()=>{const e=await new Promise((e=>{const t=new FileReader;t.onload=t=>{e(t.target.result)},t.readAsDataURL(i.image)}));m.value=e,document.addEventListener("click",O),b.value=!0,n("loadingUpdate",!0);const t=new FormData;t.append("image",i.image);try{const e=await fetch("/tta/ocr?language="+i.language,{method:"POST",body:t});if(!e.ok)throw new Error(`Server error: ${e.status}`);const n=await e.json();y.value=n,F()}catch(e){o.add({title:"Error while using OCR",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),console.error(e)}b.value=!1,n("loadingUpdate",!1)})),L((()=>{document.removeEventListener("click",O)})),(e,t)=>{const n=s("v-progress-circular"),i=s("v-input");return a(),d(S,null,[b.value?(a(),d("div",br,[u(n,{indeterminate:"",class:"c"})])):c("v-if",!0),m.value?(a(),d("div",wr,[g("div",kr,[g("img",{src:m.value,onLoad:F,style:{width:"100%","object-fit":"contain"},ref_key:"imageRef",ref:f,onMousedown:t[0]||(t[0]=A((()=>{}),["stop"]))},null,40,Tr),(a(!0),d(S,null,z(p.value,((e,n)=>(a(),d("div",{key:n,class:"text-overlay",style:_({padding:"2px",position:"absolute",left:`${e.bbox.x0}px`,top:`${e.bbox.y0}px`,width:e.bbox.x1-e.bbox.x0+"px",height:e.bbox.y1-e.bbox.y0+"px",border:v.value.includes(n)?"2px solid green":l.value===n?"2px solid blue":"1px solid transparent",cursor:"pointer",backgroundColor:"rgba(255, 255, 0, 0.3)"}),onClick:e=>function(e){const t=v.value.indexOf(e);-1==t?v.value.push(e):v.value.splice(t,1)}(n),onMouseover:e=>l.value=n,onMouseleave:t[1]||(t[1]=e=>l.value=null)},null,44,_r)))),128))],512),u(i,{modelValue:k(T)},null,8,["modelValue"])])):c("v-if",!0)],64)}}});Yi("\n.image-display-area[data-v-5588864a] {\n position: relative;\n background: white;\n border: 1px solid white;\n color: black;\n border-radius: 8px;\n overflow: hidden;\n margin: auto;\n width: 100%;\n}\n.ocr-container[data-v-5588864a] {\n position: relative;\n height: 100%;\n}\n.text-overlay[data-v-5588864a] {\n position: absolute;\n}\n.loading-screen[data-v-5588864a] {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: rgba(255, 255, 255, 0.4);\n display: flex;\n left: 0;\n top: 0;\n z-index: 1000;\n}\n.loading-screen .c[data-v-5588864a] {\n margin: auto;\n}\n",{}),Sr.__scopeId="data-v-5588864a",Sr.__file="OCR-interface/src/renderOCRResponse.vue";var Fr=v({__name:"ocredrag",props:{initialX:{type:Number,required:!0},initialY:{type:Number,required:!0}},emits:["close"],setup(e,{emit:t}){const n=e,i=h(null),r=h(!1),c=j({x:n.initialX||50,y:n.initialY||50}),d=j({x:0,y:0}),p=e=>{r.value=!0,d.x=e.clientX-c.x,d.y=e.clientY-c.y,document.addEventListener("mousemove",f),document.addEventListener("mouseup",m)},f=e=>{r.value&&(c.x=e.clientX-d.x,c.y=e.clientY-d.y)},m=()=>{r.value=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",m)};return R((()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",m)})),(e,n)=>{const h=s("v-icon"),d=s("VButton");return a(),o(V,{to:"body"},[g("div",{ref_key:"draggableElement",ref:i,style:_({position:"absolute",left:c.x+"px",top:c.y+"px",cursor:r.value?"grabbing":"grab",width:"500px","max-width":"80vw",height:"auto",padding:"20px",backgroundColor:"var(--theme--background)",color:"var(--theme--form--field--label--foreground)",border:"var(--theme--border-color) 2px solid",borderRadius:"4px",userSelect:"none","z-index":100}),onMousedown:p},[C(e.$slots,"default"),u(d,{onClick:n[0]||(n[0]=e=>t("close")),outlined:!1,icon:!0,rounded:!0,class:"close-btn"},{default:l((()=>[u(h,{name:"close"})])),_:1})],36)])}}});Yi("\n.close-btn[data-v-239465d9] {\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1001;\n}\n",{}),Fr.__scopeId="data-v-239465d9",Fr.__file="OCR-interface/src/ocredrag.vue";const Or={class:"ocr-container"};var Lr=v({__name:"interface",props:{language:{type:String,required:!0},collection:{type:String,required:!0}},setup(e){const n=e,{useFieldsStore:i}=t(),r=i(),f=h(!1),m=h(),v=h(!1),x=h(),y=h([]);function k(){m.value.click()}async function T(e){const t=e.target.files[0];t&&(x.value=t)}async function _(e){const t=F(e.target.parentElement);if(t){const e=await fetch(t).then((e=>e.blob())),n=new File([e],"image.png",{type:e.type}),i=m.value,r=new DataTransfer;r.items.add(n),i.files=r.files,i.dispatchEvent(new Event("change",{bubbles:!0}))}}function F(e){let t=0,n="";for(;t<10;){const i=(e=e.parentElement).querySelector("img");if(i){n=i.src;break}t++}return n.split("?")[0]}function O(){x.value=null,m.value.value=""}return w((()=>{const e=r.getFieldsForCollection(n.collection).filter((e=>{var t;return"file-image"==(null==(t=e.meta)?void 0:t.interface)}));b((()=>{setTimeout((()=>{for(const t of e){const e="[data-collection="+n.collection+"][data-field="+t.field+"]",i=document.querySelector(e);i.addEventListener("mouseover",(t=>{const n=i.querySelector(".image-preview img");if(n){!i.querySelector(".ocr_button")&&F(n)&&y.value.push(e+" .actions")}}))}}),500),f.value=!0}))})),(t,n)=>{const i=s("v-icon"),r=s("VButton"),h=s("v-button");return a(),d(S,null,[(a(!0),d(S,null,z(y.value,(e=>(a(),o(V,{to:e},[u(r,{onClick:_,outlined:!1,icon:!0,rounded:!0,class:"ocr_button"},{default:l((()=>[u(i,{name:"camera_video"})])),_:1})],8,["to"])))),256)),f.value?(a(),o(V,{key:0,to:"#sidebar .v-item-group"},[g("div",Or,[u(h,{class:"ocr-btn",onClick:k,loading:v.value},{default:l((()=>[p(" Import data with OCR ")])),_:1},8,["loading"]),g("input",{type:"file",onChange:T,class:"ocr-input",ref_key:"inputRef",ref:m,accept:"image/*"},null,544),null!=x.value?(a(),o(Fr,{key:0,onClose:O},{default:l((()=>[u(Sr,{image:x.value,onClose:O,language:e.language,onLoadingUpdate:n[0]||(n[0]=e=>v.value=e)},null,8,["image","language"])])),_:1})):c("v-if",!0)])])):c("v-if",!0)],64)}}});Yi("\n.ocr-container {\n display: flex;\n}\n.ocr-container .ocr-btn {\n margin: 10px auto;\n}\n.ocr-container .ocr-input {\n display: none;\n}\n",{}),Lr.__file="OCR-interface/src/interface.vue";const Ar=[vr,yr,r({id:"tta-ocr-interface",name:"OCR interface",icon:"camera_video",description:"Use OCR to fill fields. (Text to anything)",hideLabel:!0,hideLoader:!0,component:Lr,types:["alias"],localTypes:["presentation"],options:[{field:"language",name:"Language",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"eng",text:"English"},{value:"por",text:"Portuguese"},{value:"fra",text:"French"},{value:"osd",text:"Orientation and Script Detection"},{value:"chi_sim",text:"Chinese (Simplified)"},{value:"spa",text:"Spanish"},{value:"deu",text:"German"},{value:"chi_tra",text:"Chinese (Traditional)"},{value:"heb",text:"Hebrew"},{value:"kor",text:"Korean"},{value:"jpn",text:"Japanese"},{value:"rus",text:"Russian"},{value:"nld",text:"Dutch"},{value:"hin",text:"Hindi"},{value:"ita",text:"Italian"},{value:"jpn_vert",text:"Japanese (Vertical)"},{value:"pol",text:"Polish"},{value:"ron",text:"Romanian"},{value:"mar",text:"Marathi"},{value:"ukr",text:"Ukrainian"},{value:"mal",text:"Malayalam"},{value:"tam",text:"Tamil"},{value:"guj",text:"Gujarati"},{value:"tha",text:"Thai"},{value:"kan",text:"Kannada"},{value:"vie",text:"Vietnamese"},{value:"tel",text:"Telugu"},{value:"swe",text:"Swedish"},{value:"tur",text:"Turkish"},{value:"nor",text:"Norwegian"},{value:"ces",text:"Czech"},{value:"ben",text:"Bengali"},{value:"pan",text:"Punjabi"},{value:"equ",text:"Math / Equation Detection"},{value:"ell",text:"Greek"},{value:"bul",text:"Bulgarian"},{value:"lat",text:"Latin"},{value:"kur",text:"Kurdish"},{value:"ori",text:"Odia"},{value:"kat",text:"Georgian"},{value:"amh",text:"Amharic"},{value:"kaz",text:"Kazakh"},{value:"cat",text:"Catalan"},{value:"nep",text:"Nepali"},{value:"urd",text:"Urdu"},{value:"khm",text:"Khmer"},{value:"dan",text:"Danish"},{value:"chi_sim_vert",text:"Chinese (Simplified, Vertical)"},{value:"uzb",text:"Uzbek (Latin)"},{value:"slv",text:"Slovenian"},{value:"mkd",text:"Macedonian"},{value:"tgl",text:"Tagalog"},{value:"srp",text:"Serbian (Cyrillic)"},{value:"hrv",text:"Croatian"},{value:"tir",text:"Tigrinya"},{value:"syr",text:"Syriac"},{value:"lao",text:"Lao"},{value:"fin",text:"Finnish"},{value:"est",text:"Estonian"},{value:"bos",text:"Bosnian"},{value:"uig",text:"Uyghur"},{value:"sin",text:"Sinhala"},{value:"hye",text:"Armenian"},{value:"eus",text:"Basque"},{value:"sqi",text:"Albanian"},{value:"isl",text:"Icelandic"},{value:"bel",text:"Belarusian"},{value:"aze",text:"Azerbaijani (Latin)"},{value:"pus",text:"Pashto"},{value:"oci",text:"Occitan"},{value:"lit",text:"Lithuanian"},{value:"jav",text:"Javanese"},{value:"hun",text:"Hungarian"},{value:"grc",text:"Ancient Greek"},{value:"gle",text:"Irish"},{value:"frm",text:"Middle French"},{value:"afr",text:"Afrikaans"},{value:"uzb_cyrl",text:"Uzbek (Cyrillic)"},{value:"spa_old",text:"Old Spanish"},{value:"snd",text:"Sindhi"},{value:"mya",text:"Burmese"},{value:"iku",text:"Inuktitut"},{value:"fil",text:"Filipino"},{value:"fas",text:"Persian"},{value:"fao",text:"Faroese"},{value:"dzo",text:"Dzongkha"},{value:"cym",text:"Welsh"},{value:"aze_cyrl",text:"Azerbaijani (Cyrillic)"},{value:"ind",text:"Indonesian"},{value:"ara",text:"Arabic"},{value:"yid",text:"Yiddish"},{value:"ton",text:"Tongan"},{value:"tgk",text:"Tajik"},{value:"srp_latn",text:"Serbian (Latin)"},{value:"slk_frak",text:"Slovak (Fraktur)"},{value:"slk",text:"Slovak"},{value:"san",text:"Sanskrit"},{value:"msa",text:"Malay"},{value:"mri",text:"Maori"},{value:"mlt",text:"Maltese"},{value:"lav",text:"Latvian"},{value:"kur_ara",text:"Kurdish (Arabic)"},{value:"kor_vert",text:"Korean (Vertical)"},{value:"kmr",text:"Kurmanji"},{value:"kir",text:"Kyrgyz"},{value:"hat",text:"Haitian Creole"},{value:"glg",text:"Galician"},{value:"fry",text:"Frisian"},{value:"epo",text:"Esperanto"},{value:"div",text:"Divehi"},{value:"chr",text:"Cherokee"},{value:"bod",text:"Tibetan"},{value:"asm",text:"Assamese"},{value:"yor",text:"Yoruba"},{value:"tat",text:"Tatar"},{value:"sun",text:"Sundanese"},{value:"occ",text:"Occitan (alternative)"},{value:"mon",text:"Mongolian"},{value:"ita_old",text:"Old Italian"},{value:"gla",text:"Scottish Gaelic"},{value:"frk",text:"Frankish"},{value:"enm",text:"Middle English"},{value:"deu_frak",text:"German (Fraktur)"},{value:"dan_frak",text:"Danish (Fraktur)"},{value:"chi_tra_vert",text:"Chinese (Traditional, Vertical)"},{value:"ceb",text:"Cebuano"},{value:"bre",text:"Breton"},{value:"swa",text:"Swahili"},{value:"que",text:"Quechua"},{value:"ltz",text:"Luxembourgish"},{value:"kat_old",text:"Old Georgian"},{value:"cos",text:"Corsican"}]}}}]})],zr=[],jr=[],Rr=[mr],Vr=[],Cr=[E,q,D,M,e({id:"ttaocr",name:"TTA OCR",icon:"camera_video",description:"TTA scan image with OCR",overview:({fileID:e,mode:t,language:n})=>[{label:"Mode",text:t},{label:"Language",text:n},{label:"File ID",text:e}],options:[{field:"fileID",name:"File ID",type:"string",meta:{width:"full",interface:"input"}},{field:"mode",name:"Mode",type:"string",meta:{interface:"select-dropdown",options:{choices:[{text:"Text",value:"text"},{text:"Horc",value:"horc"},{text:"Blocks",value:"blocks"}]}}},{field:"language",name:"Language",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"eng",text:"English"},{value:"por",text:"Portuguese"},{value:"fra",text:"French"},{value:"osd",text:"Orientation and Script Detection"},{value:"chi_sim",text:"Chinese (Simplified)"},{value:"spa",text:"Spanish"},{value:"deu",text:"German"},{value:"chi_tra",text:"Chinese (Traditional)"},{value:"heb",text:"Hebrew"},{value:"kor",text:"Korean"},{value:"jpn",text:"Japanese"},{value:"rus",text:"Russian"},{value:"nld",text:"Dutch"},{value:"hin",text:"Hindi"},{value:"ita",text:"Italian"},{value:"jpn_vert",text:"Japanese (Vertical)"},{value:"pol",text:"Polish"},{value:"ron",text:"Romanian"},{value:"mar",text:"Marathi"},{value:"ukr",text:"Ukrainian"},{value:"mal",text:"Malayalam"},{value:"tam",text:"Tamil"},{value:"guj",text:"Gujarati"},{value:"tha",text:"Thai"},{value:"kan",text:"Kannada"},{value:"vie",text:"Vietnamese"},{value:"tel",text:"Telugu"},{value:"swe",text:"Swedish"},{value:"tur",text:"Turkish"},{value:"nor",text:"Norwegian"},{value:"ces",text:"Czech"},{value:"ben",text:"Bengali"},{value:"pan",text:"Punjabi"},{value:"equ",text:"Math / Equation Detection"},{value:"ell",text:"Greek"},{value:"bul",text:"Bulgarian"},{value:"lat",text:"Latin"},{value:"kur",text:"Kurdish"},{value:"ori",text:"Odia"},{value:"kat",text:"Georgian"},{value:"amh",text:"Amharic"},{value:"kaz",text:"Kazakh"},{value:"cat",text:"Catalan"},{value:"nep",text:"Nepali"},{value:"urd",text:"Urdu"},{value:"khm",text:"Khmer"},{value:"dan",text:"Danish"},{value:"chi_sim_vert",text:"Chinese (Simplified, Vertical)"},{value:"uzb",text:"Uzbek (Latin)"},{value:"slv",text:"Slovenian"},{value:"mkd",text:"Macedonian"},{value:"tgl",text:"Tagalog"},{value:"srp",text:"Serbian (Cyrillic)"},{value:"hrv",text:"Croatian"},{value:"tir",text:"Tigrinya"},{value:"syr",text:"Syriac"},{value:"lao",text:"Lao"},{value:"fin",text:"Finnish"},{value:"est",text:"Estonian"},{value:"bos",text:"Bosnian"},{value:"uig",text:"Uyghur"},{value:"sin",text:"Sinhala"},{value:"hye",text:"Armenian"},{value:"eus",text:"Basque"},{value:"sqi",text:"Albanian"},{value:"isl",text:"Icelandic"},{value:"bel",text:"Belarusian"},{value:"aze",text:"Azerbaijani (Latin)"},{value:"pus",text:"Pashto"},{value:"oci",text:"Occitan"},{value:"lit",text:"Lithuanian"},{value:"jav",text:"Javanese"},{value:"hun",text:"Hungarian"},{value:"grc",text:"Ancient Greek"},{value:"gle",text:"Irish"},{value:"frm",text:"Middle French"},{value:"afr",text:"Afrikaans"},{value:"uzb_cyrl",text:"Uzbek (Cyrillic)"},{value:"spa_old",text:"Old Spanish"},{value:"snd",text:"Sindhi"},{value:"mya",text:"Burmese"},{value:"iku",text:"Inuktitut"},{value:"fil",text:"Filipino"},{value:"fas",text:"Persian"},{value:"fao",text:"Faroese"},{value:"dzo",text:"Dzongkha"},{value:"cym",text:"Welsh"},{value:"aze_cyrl",text:"Azerbaijani (Cyrillic)"},{value:"ind",text:"Indonesian"},{value:"ara",text:"Arabic"},{value:"yid",text:"Yiddish"},{value:"ton",text:"Tongan"},{value:"tgk",text:"Tajik"},{value:"srp_latn",text:"Serbian (Latin)"},{value:"slk_frak",text:"Slovak (Fraktur)"},{value:"slk",text:"Slovak"},{value:"san",text:"Sanskrit"},{value:"msa",text:"Malay"},{value:"mri",text:"Maori"},{value:"mlt",text:"Maltese"},{value:"lav",text:"Latvian"},{value:"kur_ara",text:"Kurdish (Arabic)"},{value:"kor_vert",text:"Korean (Vertical)"},{value:"kmr",text:"Kurmanji"},{value:"kir",text:"Kyrgyz"},{value:"hat",text:"Haitian Creole"},{value:"glg",text:"Galician"},{value:"fry",text:"Frisian"},{value:"epo",text:"Esperanto"},{value:"div",text:"Divehi"},{value:"chr",text:"Cherokee"},{value:"bod",text:"Tibetan"},{value:"asm",text:"Assamese"},{value:"yor",text:"Yoruba"},{value:"tat",text:"Tatar"},{value:"sun",text:"Sundanese"},{value:"occ",text:"Occitan (alternative)"},{value:"mon",text:"Mongolian"},{value:"ita_old",text:"Old Italian"},{value:"gla",text:"Scottish Gaelic"},{value:"frk",text:"Frankish"},{value:"enm",text:"Middle English"},{value:"deu_frak",text:"German (Fraktur)"},{value:"dan_frak",text:"Danish (Fraktur)"},{value:"chi_tra_vert",text:"Chinese (Traditional, Vertical)"},{value:"ceb",text:"Cebuano"},{value:"bre",text:"Breton"},{value:"swa",text:"Swahili"},{value:"que",text:"Quechua"},{value:"ltz",text:"Luxembourgish"},{value:"kat_old",text:"Old Georgian"},{value:"cos",text:"Corsican"}]}}}]})];export{zr as displays,Ar as interfaces,jr as layouts,Rr as modules,Cr as operations,Vr as panels};
|