(function(){"use strict";function _(){["close","fetch","XMLHttpRequest","importScripts"].forEach(t=>{self[t]&&Object.defineProperty(self,t,{value:()=>{throw new Error("Security Error: worker api is disabled.")},configurable:!1,writable:!1})})}function C(t){return Object.assign(Object.create(null),t)}const N=["self","globalThis","Worker","SharedWorker","postMessage","onmessage","indexedDB","location","navigator","origin","console","setTimeout","setInterval"];function U(t,e,r){if(e.includes("Function(")||e.includes("eval(")||e.includes(".constructor"))throw new Error("Function or eval or constructor is not allowed");const n=[],s=[];return t=C(t||{}),Object.keys(t).forEach(a=>{typeof t[a]!="function"&&(n.push(a),s.push(t[a]))}),N.forEach(a=>{t[a]===void 0&&(n.push(a),s.push(null))}),new Function(...n,'"use strict"; return ('+e+");")(...s)}var B=Object.prototype.toString,R=Array.isArray||function(e){return B.call(e)==="[object Array]"};function m(t){return typeof t=="function"}function D(t){return R(t)?"array":typeof t}function q(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function F(t,e){return t!=null&&typeof t=="object"&&e in t}function H(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var $=RegExp.prototype.test;function K(t,e){return $.call(t,e)}var L=/\S/;function V(t){return!K(L,t)}var X={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function z(t){return String(t).replace(/[&<>"'`=\/]/g,function(r){return X[r]})}var G=/\s*/,J=/\s+/,M=/\s*=/,Q=/\s*\}/,Y=/#|\^|\/|>|\{|&|=|!/;function Z(t,e){if(!t)return[];var r=!1,n=[],s=[],a=[],i=!1,o=!1,u="",l=0;function f(){if(i&&!o)for(;a.length;)delete s[a.pop()];else a=[];i=!1,o=!1}var d,h,w;function E(b){if(typeof b=="string"&&(b=b.split(J,2)),!R(b)||b.length!==2)throw new Error("Invalid tags: "+b);d=new RegExp(q(b[0])+"\\s*"),h=new RegExp("\\s*"+q(b[1])),w=new RegExp("\\s*"+q("}"+b[1]))}E(e||g.tags);for(var c=new T(t),k,v,y,P,j,S;!c.eos();){if(k=c.pos,y=c.scanUntil(d),y)for(var W=0,ne=y.length;W<ne;++W)P=y.charAt(W),V(P)?(a.push(s.length),u+=P):(o=!0,r=!0,u+=" "),s.push(["text",P,k,k+1]),k+=1,P===`
`&&(f(),u="",l=0,r=!1);if(!c.scan(d))break;if(i=!0,v=c.scan(Y)||"name",c.scan(G),v==="="?(y=c.scanUntil(M),c.scan(M),c.scanUntil(h)):v==="{"?(y=c.scanUntil(w),c.scan(Q),c.scanUntil(h),v="&"):y=c.scanUntil(h),!c.scan(h))throw new Error("Unclosed tag at "+c.pos);if(v==">"?j=[v,y,k,c.pos,u,l,r]:j=[v,y,k,c.pos],l++,s.push(j),v==="#"||v==="^")n.push(j);else if(v==="/"){if(S=n.pop(),!S)throw new Error('Unopened section "'+y+'" at '+k);if(S[1]!==y)throw new Error('Unclosed section "'+S[1]+'" at '+k)}else v==="name"||v==="{"||v==="&"?o=!0:v==="="&&E(y)}if(f(),S=n.pop(),S)throw new Error('Unclosed section "'+S[1]+'" at '+c.pos);return te(ee(s))}function ee(t){for(var e=[],r,n,s=0,a=t.length;s<a;++s)r=t[s],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(e.push(r),n=r));return e}function te(t){for(var e=[],r=e,n=[],s,a,i=0,o=t.length;i<o;++i)switch(s=t[i],s[0]){case"#":case"^":r.push(s),n.push(s),r=s[4]=[];break;case"/":a=n.pop(),a[5]=s[2],r=n.length>0?n[n.length-1][4]:e;break;default:r.push(s)}return e}function T(t){this.string=t,this.tail=t,this.pos=0}T.prototype.eos=function(){return this.tail===""},T.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var n=r[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},T.prototype.scanUntil=function(e){var r=this.tail.search(e),n;switch(r){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=n.length,n};function I(t,e){this.view=t,this.cache={".":this.view},this.parent=e}I.prototype.push=function(e){return new I(e,this)},I.prototype.lookup=function(e){var r=this.cache,n;if(r.hasOwnProperty(e))n=r[e];else{for(var s=this,a,i,o,u=!1;s;){if(e.indexOf(".")>0)for(a=s.view,i=e.split("."),o=0;a!=null&&o<i.length;)o===i.length-1&&(u=F(a,i[o])||H(a,i[o])),a=a[i[o++]];else a=s.view[e],u=F(s.view,e);if(u){n=a;break}s=s.parent}r[e]=n}return m(n)&&(n=n.call(this.view)),n};function p(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}p.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()},p.prototype.parse=function(e,r){var n=this.templateCache,s=e+":"+(r||g.tags).join(":"),a=typeof n!="undefined",i=a?n.get(s):void 0;return i==null&&(i=Z(e,r),a&&n.set(s,i)),i},p.prototype.render=function(e,r,n,s){var a=this.getConfigTags(s),i=this.parse(e,a),o=r instanceof I?r:new I(r,void 0);return this.renderTokens(i,o,n,e,s)},p.prototype.renderTokens=function(e,r,n,s,a){for(var i="",o,u,l,f=0,d=e.length;f<d;++f)l=void 0,o=e[f],u=o[0],u==="#"?l=this.renderSection(o,r,n,s,a):u==="^"?l=this.renderInverted(o,r,n,s,a):u===">"?l=this.renderPartial(o,r,n,a):u==="&"?l=this.unescapedValue(o,r):u==="name"?l=this.escapedValue(o,r,a):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(i+=l);return i},p.prototype.renderSection=function(e,r,n,s,a){var i=this,o="",u=r.lookup(e[1]);function l(h){return i.render(h,r,n,a)}if(u){if(R(u))for(var f=0,d=u.length;f<d;++f)o+=this.renderTokens(e[4],r.push(u[f]),n,s,a);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],r.push(u),n,s,a);else if(m(u)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(r.view,s.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],r,n,s,a);return o}},p.prototype.renderInverted=function(e,r,n,s,a){var i=r.lookup(e[1]);if(!i||R(i)&&i.length===0)return this.renderTokens(e[4],r,n,s,a)},p.prototype.indentPartial=function(e,r,n){for(var s=r.replace(/[^ \t]/g,""),a=e.split(`
`),i=0;i<a.length;i++)a[i].length&&(i>0||!n)&&(a[i]=s+a[i]);return a.join(`
`)},p.prototype.renderPartial=function(e,r,n,s){if(n){var a=this.getConfigTags(s),i=m(n)?n(e[1]):n[e[1]];if(i!=null){var o=e[6],u=e[5],l=e[4],f=i;u==0&&l&&(f=this.indentPartial(i,l,o));var d=this.parse(f,a);return this.renderTokens(d,r,n,f,s)}}},p.prototype.unescapedValue=function(e,r){var n=r.lookup(e[1]);if(n!=null)return n},p.prototype.escapedValue=function(e,r,n){var s=this.getConfigEscape(n)||g.escape,a=r.lookup(e[1]);if(a!=null)return typeof a=="number"&&s===g.escape?String(a):s(a)},p.prototype.rawValue=function(e){return e[1]},p.prototype.getConfigTags=function(e){return R(e)?e:e&&typeof e=="object"?e.tags:void 0},p.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!R(e))return e.escape};var g={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){O.templateCache=t},get templateCache(){return O.templateCache}},O=new p;g.clearCache=function(){return O.clearCache()},g.parse=function(e,r){return O.parse(e,r)},g.render=function(e,r,n,s){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+D(e)+'" was given as the first argument for mustache#render(template, view, partials)');return O.render(e,r,n,s)},g.escape=z,g.Scanner=T,g.Context=I,g.Writer=p;const x=self.postMessage;_();function A(t,e){const r=t.indexOf("="),n=t.substring(0,r).trim(),s=U(e,t.substring(r+1).trim());return e[n]=s,n}function re(t,e){e=e||C({}),t.if=()=>function(r,n){const s=r.indexOf("]"),a=r.substring(0,s).trim().substring(1);return U(t,a)?n(r.substring(s+1).trim()):""},t.var=()=>function(r){A(r,t)},t.I18n=()=>function(r,n){const s=n(r).trim(),a=e[s]||{};return a[t._lang]||a.en||a.ca||s},t.each=()=>function(r){const n=r.indexOf("]"),s=r.substring(0,n).trim().substring(1).split(","),a=s.length,i=new Array(a),o=new Array(a);let u=1;const l=105;s.forEach((d,h)=>{const w=d.split("=");w.length===1&&w.unshift(String.fromCharCode(l+h));const E=w[0].trim();o[h]=E;const c=U(t,w[1]);u=u*c,i[h]=c,t[E]=1});const f=[];for(let d=0;d<u;d++){f.push(g.render(r.substring(n+1),t));let h=a-1,w;do{const E=t[o[h]]-1,c=(E+1)%i[h]+1;t[o[h]]=c,w=c<E,h--}while(h>=0&&w)}return f.join("")},t.for=()=>function(r){const n=r.indexOf("]"),s=r.substring(0,n).trim().substring(1).split(";"),a=A(s[0],t);let i="",o=0;for(;U(t,s[1])&&o<1e3;)i+=self.Mustache.render(r.substring(n+1),t),s.length===3&&s[2].trim()?A(a+"="+s[2],t):t[a]=t[a]+1,o++;return i}}self.onmessage=function(t){const e=t.data,r=e.payload||C({}),n=C(r.ctx);re(n,r.translations);try{const s=g.render(r.template,n);x(C({requestId:e.requestId,result:s}))}catch(s){console.error("Failed to render template: "+s),x(C({requestId:e.requestId,error:"Failed to render template: "+s}))}},x(C({type:"worker_ready"}))})();
