@divkitframework/divkit
Version:
DivKit for the web
11 lines • 462 kB
JavaScript
"use strict";var Xd=Object.defineProperty;var Zd=(e,r,t)=>r in e?Xd(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Cr=(e,r,t)=>Zd(e,typeof r!="symbol"?r+"":r,t);/*!
DivKit v32.61.0
https://github.com/divkit/divkit
@licence Apache-2.0
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Rl(e){return BigInt(e)}const Lo=Rl("9223372036854775807"),Ro=Rl("-9223372036854775808");function un(e){const r=Rl(e);if(r>Lo||r<Ro)throw new Error("Integer overflow.");return r}const $i=un(0);function Of(e){let r=e;return r<0&&(r=-r),r}function Lf(e){let r=0;return e>0?r=1:e<0&&(r=-1),un(r)}function Qd(e,r){return r&&r[3]&&r[7]?{type:"ConditionalExpression",test:e,consequent:r[3],alternate:r[7]}:e}function xd(e,r){return r&&r[3]?{type:"TryExpression",test:e,alternate:r[3]}:e}function Yo(e,r){return r.length?r.reduce((t,n)=>({type:"BinaryExpression",operator:n[1],left:t,right:n[3]}),e):e}function fa(e,r){return r.length?r.reduce((t,n)=>({type:"LogicalExpression",operator:n[1],left:t,right:n[3]}),e):e}function $d(e,r){return r.length?r.reduce((t,n)=>{if(!n[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:n[3],arguments:n[5][2]}},e):e}function eh(e){return e==="true"||e==="false"?{type:"BooleanLiteral",value:e==="true"}:{type:"Variable",id:{type:"Identifier",name:e}}}function da(e){if(e.every(t=>typeof t=="string"))return{type:"StringLiteral",value:e.join("")};let r=e.reduce((t,n)=>(typeof n=="string"&&typeof t[t.length-1]=="string"?t[t.length-1]+=n:t.push(n),t),[]).reduce((t,n)=>(typeof n=="string"?t.quasis.push({type:"StringLiteral",value:n}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(n)),t),{type:"TemplateLiteral",quasis:[],expressions:[]});return r.quasis.length===r.expressions.length&&r.quasis.push({type:"StringLiteral",value:""}),r}function th(e){try{return un(e)}catch{throw new Error(`Value ${e} can't be converted to Integer type.`)}}function ha(e){if(e==="'"||e==="\\")return e;throw new Error("Incorrect string escape")}function rh(e,r){function t(){this.constructor=e}t.prototype=r.prototype,e.prototype=new t}function bo(e,r,t,n){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,bo.prototype),i.expected=r,i.found=t,i.location=n,i.name="SyntaxError",i}rh(bo,Error);function xs(e,r,t){return t=t||" ",e.length>r?e:(r-=e.length,t+=t.repeat(r),e+t.slice(0,r))}bo.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){t=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(i):i,s=this.location.source+":"+o.line+":"+o.column;if(t){var a=this.location.end,l=xs("",o.line.toString().length," "),u=t[i.line-1],c=i.line===a.line?a.column:u.length+1,d=c-i.column||1;r+=`
--> `+s+`
`+l+` |
`+o.line+" | "+u+`
`+l+" | "+xs("",i.column-1," ")+xs("",d,"^")}else r+=`
at `+s}return r};bo.buildMessage=function(e,r){var t={literal:function(u){return'"'+i(u.text)+'"'},class:function(u){var c=u.parts.map(function(d){return Array.isArray(d)?o(d[0])+"-"+o(d[1]):o(d)});return"["+(u.inverted?"^":"")+c.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(u){return u.description}};function n(u){return u.charCodeAt(0).toString(16).toUpperCase()}function i(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(c){return"\\x0"+n(c)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(c){return"\\x"+n(c)})}function o(u){return u.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(c){return"\\x0"+n(c)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(c){return"\\x"+n(c)})}function s(u){return t[u.type](u)}function a(u){var c=u.map(s),d,_;if(c.sort(),c.length>0){for(d=1,_=1;d<c.length;d++)c[d-1]!==c[d]&&(c[_]=c[d],_++);c.length=_}switch(c.length){case 1:return c[0];case 2:return c[0]+" or "+c[1];default:return c.slice(0,-1).join(", ")+", or "+c[c.length-1]}}function l(u){return u?'"'+i(u)+'"':"end of input"}return"Expected "+a(e)+" but "+l(r)+" found."};function Ps(e,r){r=r!==void 0?r:{};var t={},n=r.grammarSource,i={start:on,JsonStringContents:b},o=on,s="@{",a="}",l="@{}",u="\\",c="?",d=":",_="||",g="&&",m="==",h="!=",v=">=",E=">",K="<=",Q="<",X="!:",he="+",se="-",H="/",Z="*",le="%",R="!",N=".",T="(",L=")",Ee=",",$e="'",He="e",We="E",we=/^[^}]/,Ce=/^[^'}]/,Le=/^[0-9]/,ht=/^[a-zA-Z_]/,Qe=/^[a-zA-Z_0-9]/,ve=/^[ \t\r\n]/,Ke=ue("@{",!1),Mt=ue("}",!1),fe=ue("@{}",!1),Me=ue("\\",!1),be=St(),re=nt(["}"],!0,!1),Ue=ue("?",!1),lt=ue(":",!1),Se=ue("||",!1),Et=ue("&&",!1),it=ue("==",!1),G=ue("!=",!1),ut=ue(">=",!1),Ut=ue(">",!1),Je=ue("<=",!1),Ve=ue("<",!1),zt=ue("!:",!1),tt=ue("+",!1),ct=ue("-",!1),jr=ue("/",!1),Dt=ue("*",!1),Gt=ue("%",!1),Fe=ue("!",!1),oe=ue(".",!1),je=ue("(",!1),Bt=ue(")",!1),ot=ue(",",!1),De=or("string"),ar=ue("'",!1),Pe=nt(["'","}"],!0,!1),O=or("integer"),Re=nt([["0","9"]],!1,!1),Ct=or("number"),_e=ue("e",!1),bt=ue("E",!1),dt=nt([["a","z"],["A","Z"],"_"],!1,!1),kt=nt([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),ft=or("whitespace"),ke=nt([" "," ","\r",`
`],!1,!1),It=function(p){return p},wt=function(p){return da(p)},Tt=function(p){return p},jt=function(){return""},Xt=function(){return me()},V=function(){throw new Error("Error tokenizing '"+e+"'.")},Ot=function(){throw new Error("Error tokenizing '"+e+"'.")},Te=function(p){return p},A=function(p){return ha(p)},Yt=function(){throw new Error("Error tokenizing '"+e+"'.")},ur=function(p,S){return Qd(p,S)},_r=function(p,S){return fa(p,S)},Er=function(p,S){return fa(p,S)},br=function(p,S){return Yo(p,S)},ir=function(p,S){return Yo(p,S)},Ir=function(p,S){return xd(p,S)},Pt=function(p,S){return Yo(p,S)},st=function(p,S){return Yo(p,S)},Rt=function(p){return p},Ht=function(p){return p},Nt=function(p,S){return{type:"UnaryExpression",operator:p,argument:S}},Xe=function(){throw new Error("Incorrect unary operator")},yr=function(p,S){return $d(p,S)},rr=function(p,S){return{type:"CallExpression",callee:p,arguments:S}},Fr=function(p,S){return[p,...S]},Wt=function(p){return p},Vr=function(p){return p},wr=function(p){return da(p)},Or=function(p){return p},qr=function(){return""},Jt=function(){return me()},xr=function(){throw new Error("Error tokenizing '"+e+"'.")},cn=function(){throw new Error("Error tokenizing '"+e+"'.")},P=function(p){return p},Ze=function(p){return ha(p)},qt=function(){throw new Error("Error tokenizing '"+e+"'.")},gt=function(){return{type:"IntegerLiteral",value:th(me())}},Lt=function(){return{type:"NumberLiteral",value:parseFloat(me())}},ge=function(){return{type:"NumberLiteral",value:parseFloat(me())}},Ge=function(){const p=me();if(/\.\./.test(p)||/\.$/.test(p))throw new Error("Unexpected token: .");return eh(p)},q=function(){return{type:"Identifier",name:me()}},f=0,j=0,Ae=[{line:1,column:1}],Ye=0,_t=[],w=0,de;if("startRule"in r){if(!(r.startRule in i))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');o=i[r.startRule]}function me(){return e.substring(j,f)}function ue(p,S){return{type:"literal",text:p,ignoreCase:S}}function nt(p,S,z){return{type:"class",parts:p,inverted:S,ignoreCase:z}}function St(){return{type:"any"}}function Ar(){return{type:"end"}}function or(p){return{type:"other",description:p}}function Jr(p){var S=Ae[p],z;if(S)return S;for(z=p-1;!Ae[z];)z--;for(S=Ae[z],S={line:S.line,column:S.column};z<p;)e.charCodeAt(z)===10?(S.line++,S.column=1):S.column++,z++;return Ae[p]=S,S}function jn(p,S,z){var D=Jr(p),ie=Jr(S),te={source:n,start:{offset:p,line:D.line,column:D.column},end:{offset:S,line:ie.line,column:ie.column}};return te}function ae(p){f<Ye||(f>Ye&&(Ye=f,_t=[]),_t.push(p))}function Sr(p,S,z){return new bo(bo.buildMessage(p,S),p,S,z)}function on(){var p,S;return p=f,vt(),S=C(),S!==t?(vt(),j=p,p=It(S)):(f=p,p=t),p}function b(){var p,S,z;for(p=f,S=[],z=k();z!==t;)S.push(z),z=k();return j=p,S=wt(S),p=S,p}function k(){var p,S,z,D,ie;if(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t?(z=vt(),D=C(),D!==t?(vt(),e.charCodeAt(f)===125?(ie=a,f++):(ie=t,w===0&&ae(Mt)),ie!==t?(j=p,p=Tt(D)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.substr(f,3)===l?(S=l,f+=3):(S=t,w===0&&ae(fe)),S!==t&&(j=p,S=jt()),p=S,p===t&&(p=f,S=f,w++,e.charCodeAt(f)===92?(z=u,f++):(z=t,w===0&&ae(Me)),z===t&&(e.substr(f,2)===s?(z=s,f+=2):(z=t,w===0&&ae(Ke))),w--,z===t?S=void 0:(f=S,S=t),S!==t?(e.length>f?(z=e.charAt(f),f++):(z=t,w===0&&ae(be)),z!==t?(j=p,p=Xt()):(f=p,p=t)):(f=p,p=t),p===t))){if(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t){if(z=[],we.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(re)),D!==t)for(;D!==t;)z.push(D),we.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(re));else z=t;z!==t?(e.charCodeAt(f)===125?(D=a,f++):(D=t,w===0&&ae(Mt)),D!==t?(j=p,p=V()):(f=p,p=t)):(f=p,p=t)}else f=p,p=t;p===t&&(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t&&(j=p,S=Ot()),p=S,p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t?(e.substr(f,2)===s?(z=s,f+=2):(z=t,w===0&&ae(Ke)),z!==t?(j=p,p=Te(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t?(e.length>f?(z=e.charAt(f),f++):(z=t,w===0&&ae(be)),z!==t?(j=p,p=A(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t&&(j=p,S=Yt()),p=S))))}return p}function C(){var p,S,z,D,ie,te,mt,yt,cr,Tr,Mr;return p=f,S=W(),S!==t?(z=f,D=vt(),e.charCodeAt(f)===63?(ie=c,f++):(ie=t,w===0&&ae(Ue)),ie!==t?(te=vt(),mt=C(),mt!==t?(yt=vt(),e.charCodeAt(f)===58?(cr=d,f++):(cr=t,w===0&&ae(lt)),cr!==t?(Tr=vt(),Mr=C(),Mr!==t?(D=[D,ie,te,mt,yt,cr,Tr,Mr],z=D):(f=z,z=t)):(f=z,z=t)):(f=z,z=t)):(f=z,z=t),z===t&&(z=null),j=p,p=ur(S,z)):(f=p,p=t),p}function W(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=I(),S!==t){for(z=[],D=f,ie=vt(),e.substr(f,2)===_?(te=_,f+=2):(te=t,w===0&&ae(Se)),te!==t?(mt=vt(),yt=I(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.substr(f,2)===_?(te=_,f+=2):(te=t,w===0&&ae(Se)),te!==t?(mt=vt(),yt=I(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=_r(S,z)}else f=p,p=t;return p}function I(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=x(),S!==t){for(z=[],D=f,ie=vt(),e.substr(f,2)===g?(te=g,f+=2):(te=t,w===0&&ae(Et)),te!==t?(mt=vt(),yt=x(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.substr(f,2)===g?(te=g,f+=2):(te=t,w===0&&ae(Et)),te!==t?(mt=vt(),yt=x(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=Er(S,z)}else f=p,p=t;return p}function x(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=pe(),S!==t){for(z=[],D=f,ie=vt(),e.substr(f,2)===m?(te=m,f+=2):(te=t,w===0&&ae(it)),te===t&&(e.substr(f,2)===h?(te=h,f+=2):(te=t,w===0&&ae(G))),te!==t?(mt=vt(),yt=pe(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.substr(f,2)===m?(te=m,f+=2):(te=t,w===0&&ae(it)),te===t&&(e.substr(f,2)===h?(te=h,f+=2):(te=t,w===0&&ae(G))),te!==t?(mt=vt(),yt=pe(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=br(S,z)}else f=p,p=t;return p}function pe(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=xe(),S!==t){for(z=[],D=f,ie=vt(),e.substr(f,2)===v?(te=v,f+=2):(te=t,w===0&&ae(ut)),te===t&&(e.charCodeAt(f)===62?(te=E,f++):(te=t,w===0&&ae(Ut)),te===t&&(e.substr(f,2)===K?(te=K,f+=2):(te=t,w===0&&ae(Je)),te===t&&(e.charCodeAt(f)===60?(te=Q,f++):(te=t,w===0&&ae(Ve))))),te!==t?(mt=vt(),yt=xe(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.substr(f,2)===v?(te=v,f+=2):(te=t,w===0&&ae(ut)),te===t&&(e.charCodeAt(f)===62?(te=E,f++):(te=t,w===0&&ae(Ut)),te===t&&(e.substr(f,2)===K?(te=K,f+=2):(te=t,w===0&&ae(Je)),te===t&&(e.charCodeAt(f)===60?(te=Q,f++):(te=t,w===0&&ae(Ve))))),te!==t?(mt=vt(),yt=xe(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=ir(S,z)}else f=p,p=t;return p}function xe(){var p,S,z,D,ie,te,mt;return p=f,S=et(),S!==t?(z=f,D=vt(),e.substr(f,2)===X?(ie=X,f+=2):(ie=t,w===0&&ae(zt)),ie!==t?(te=vt(),mt=et(),mt!==t?(D=[D,ie,te,mt],z=D):(f=z,z=t)):(f=z,z=t),z===t&&(z=null),j=p,p=Ir(S,z)):(f=p,p=t),p}function et(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=at(),S!==t){for(z=[],D=f,ie=vt(),e.charCodeAt(f)===43?(te=he,f++):(te=t,w===0&&ae(tt)),te===t&&(e.charCodeAt(f)===45?(te=se,f++):(te=t,w===0&&ae(ct))),te!==t?(mt=vt(),yt=at(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.charCodeAt(f)===43?(te=he,f++):(te=t,w===0&&ae(tt)),te===t&&(e.charCodeAt(f)===45?(te=se,f++):(te=t,w===0&&ae(ct))),te!==t?(mt=vt(),yt=at(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=Pt(S,z)}else f=p,p=t;return p}function at(){var p,S,z,D,ie,te,mt,yt;if(p=f,S=pt(),S!==t){for(z=[],D=f,ie=vt(),e.charCodeAt(f)===47?(te=H,f++):(te=t,w===0&&ae(jr)),te===t&&(e.charCodeAt(f)===42?(te=Z,f++):(te=t,w===0&&ae(Dt)),te===t&&(e.charCodeAt(f)===37?(te=le,f++):(te=t,w===0&&ae(Gt)))),te!==t?(mt=vt(),yt=pt(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.charCodeAt(f)===47?(te=H,f++):(te=t,w===0&&ae(jr)),te===t&&(e.charCodeAt(f)===42?(te=Z,f++):(te=t,w===0&&ae(Dt)),te===t&&(e.charCodeAt(f)===37?(te=le,f++):(te=t,w===0&&ae(Gt)))),te!==t?(mt=vt(),yt=pt(),yt!==t?(ie=[ie,te,mt,yt],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=st(S,z)}else f=p,p=t;return p}function pt(){var p,S,z,D;return p=f,S=f,w++,e.charCodeAt(f)===45?(z=se,f++):(z=t,w===0&&ae(ct)),w--,z!==t?(f=S,S=void 0):S=t,S!==t?(z=gr(),z!==t?(j=p,p=Rt(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,S=f,w++,e.charCodeAt(f)===45?(z=se,f++):(z=t,w===0&&ae(ct)),w--,z!==t?(f=S,S=void 0):S=t,S!==t?(z=Zt(),z!==t?(j=p,p=Ht(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===33?(S=R,f++):(S=t,w===0&&ae(Fe)),S===t&&(e.charCodeAt(f)===43?(S=he,f++):(S=t,w===0&&ae(tt)),S===t&&(e.charCodeAt(f)===45?(S=se,f++):(S=t,w===0&&ae(ct)))),S!==t?(z=vt(),D=rt(),D===t&&(D=sr()),D!==t?(j=p,p=Nt(S,D)):(f=p,p=t)):(f=p,p=t),p===t&&(p=sr()))),p}function rt(){var p,S;return p=f,e.charCodeAt(f)===43?(S=he,f++):(S=t,w===0&&ae(tt)),S===t&&(e.charCodeAt(f)===45?(S=se,f++):(S=t,w===0&&ae(ct))),S!==t&&(j=p,S=Xe()),p=S,p}function sr(){var p,S,z,D,ie,te,mt,yt,cr,Tr,Mr,Mn,bn,Ni,ni;if(p=f,S=lr(),S!==t){for(z=[],D=f,ie=vt(),e.charCodeAt(f)===46?(te=N,f++):(te=t,w===0&&ae(oe)),te!==t?(mt=vt(),yt=sn(),yt!==t?(cr=vt(),Tr=f,e.charCodeAt(f)===40?(Mr=T,f++):(Mr=t,w===0&&ae(je)),Mr!==t?(Mn=vt(),bn=Dr(),bn!==t?(Ni=vt(),e.charCodeAt(f)===41?(ni=L,f++):(ni=t,w===0&&ae(Bt)),ni!==t?(Mr=[Mr,Mn,bn,Ni,ni],Tr=Mr):(f=Tr,Tr=t)):(f=Tr,Tr=t)):(f=Tr,Tr=t),Tr===t&&(Tr=null),ie=[ie,te,mt,yt,cr,Tr],D=ie):(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,ie=vt(),e.charCodeAt(f)===46?(te=N,f++):(te=t,w===0&&ae(oe)),te!==t?(mt=vt(),yt=sn(),yt!==t?(cr=vt(),Tr=f,e.charCodeAt(f)===40?(Mr=T,f++):(Mr=t,w===0&&ae(je)),Mr!==t?(Mn=vt(),bn=Dr(),bn!==t?(Ni=vt(),e.charCodeAt(f)===41?(ni=L,f++):(ni=t,w===0&&ae(Bt)),ni!==t?(Mr=[Mr,Mn,bn,Ni,ni],Tr=Mr):(f=Tr,Tr=t)):(f=Tr,Tr=t)):(f=Tr,Tr=t),Tr===t&&(Tr=null),ie=[ie,te,mt,yt,cr,Tr],D=ie):(f=D,D=t)):(f=D,D=t);j=p,p=yr(S,z)}else f=p,p=t;return p}function lr(){var p,S,z,D,ie;return p=f,S=sn(),S!==t?(vt(),e.charCodeAt(f)===40?(z=T,f++):(z=t,w===0&&ae(je)),z!==t?(vt(),D=Dr(),D!==t?(vt(),e.charCodeAt(f)===41?(ie=L,f++):(ie=t,w===0&&ae(Bt)),ie!==t?(j=p,p=rr(S,D)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=zr()),p}function Dr(){var p,S,z,D,ie,te;if(p=f,S=C(),S!==t){for(z=[],D=f,vt(),e.charCodeAt(f)===44?(ie=Ee,f++):(ie=t,w===0&&ae(ot)),ie!==t?(vt(),te=C(),te!==t?D=te:(f=D,D=t)):(f=D,D=t);D!==t;)z.push(D),D=f,vt(),e.charCodeAt(f)===44?(ie=Ee,f++):(ie=t,w===0&&ae(ot)),ie!==t?(vt(),te=C(),te!==t?D=te:(f=D,D=t)):(f=D,D=t);j=p,p=Fr(S,z)}else f=p,p=t;return p===t&&(p=vt()),p}function zr(){var p,S,z,D;return p=Qt(),p===t&&(p=$r(),p===t&&(p=gr(),p===t&&(p=Zt(),p===t&&(p=f,e.charCodeAt(f)===40?(S=T,f++):(S=t,w===0&&ae(je)),S!==t?(vt(),z=C(),z!==t?(vt(),e.charCodeAt(f)===41?(D=L,f++):(D=t,w===0&&ae(Bt)),D!==t?(j=p,p=Wt(z)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t))))),p}function $r(){var p,S,z,D;return w++,p=f,e.charCodeAt(f)===39?(S=$e,f++):(S=t,w===0&&ae(ar)),S!==t?(z=an(),e.charCodeAt(f)===39?(D=$e,f++):(D=t,w===0&&ae(ar)),D!==t?(j=p,p=Vr(z)):(f=p,p=t)):(f=p,p=t),w--,p===t&&(S=t,w===0&&ae(De)),p}function an(){var p,S,z;for(p=f,S=[],z=pn();z!==t;)S.push(z),z=pn();return j=p,S=wr(S),p=S,p}function pn(){var p,S,z,D,ie;if(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t?(z=vt(),D=C(),D!==t?(vt(),e.charCodeAt(f)===125?(ie=a,f++):(ie=t,w===0&&ae(Mt)),ie!==t?(j=p,p=Or(D)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.substr(f,3)===l?(S=l,f+=3):(S=t,w===0&&ae(fe)),S!==t&&(j=p,S=qr()),p=S,p===t&&(p=f,S=f,w++,e.charCodeAt(f)===92?(z=u,f++):(z=t,w===0&&ae(Me)),z===t&&(e.charCodeAt(f)===39?(z=$e,f++):(z=t,w===0&&ae(ar)),z===t&&(e.substr(f,2)===s?(z=s,f+=2):(z=t,w===0&&ae(Ke)))),w--,z===t?S=void 0:(f=S,S=t),S!==t?(e.length>f?(z=e.charAt(f),f++):(z=t,w===0&&ae(be)),z!==t?(j=p,p=Jt()):(f=p,p=t)):(f=p,p=t),p===t))){if(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t){if(z=[],Ce.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(Pe)),D!==t)for(;D!==t;)z.push(D),Ce.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(Pe));else z=t;z!==t?(e.charCodeAt(f)===125?(D=a,f++):(D=t,w===0&&ae(Mt)),D!==t?(j=p,p=xr()):(f=p,p=t)):(f=p,p=t)}else f=p,p=t;p===t&&(p=f,e.substr(f,2)===s?(S=s,f+=2):(S=t,w===0&&ae(Ke)),S!==t&&(j=p,S=cn()),p=S,p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t?(e.substr(f,2)===s?(z=s,f+=2):(z=t,w===0&&ae(Ke)),z!==t?(j=p,p=P(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t?(e.length>f?(z=e.charAt(f),f++):(z=t,w===0&&ae(be)),z!==t?(j=p,p=Ze(z)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(S=u,f++):(S=t,w===0&&ae(Me)),S!==t&&(j=p,S=qt()),p=S))))}return p}function Zt(){var p,S,z;if(w++,p=f,e.charCodeAt(f)===45?f++:w===0&&ae(ct),S=[],Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re)),z!==t)for(;z!==t;)S.push(z),Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re));else S=t;return S!==t?(j=p,p=gt()):(f=p,p=t),w--,p===t&&w===0&&ae(O),p}function gr(){var p,S,z,D,ie,te,mt,yt,cr;for(w++,p=f,e.charCodeAt(f)===45?f++:w===0&&ae(ct),S=[],Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re));z!==t;)S.push(z),Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re));if(e.charCodeAt(f)===46?(z=N,f++):(z=t,w===0&&ae(oe)),z!==t){if(D=[],Le.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(Re)),ie!==t)for(;ie!==t;)D.push(ie),Le.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(Re));else D=t;if(D!==t){if(ie=f,e.charCodeAt(f)===101?(te=He,f++):(te=t,w===0&&ae(_e)),te===t&&(e.charCodeAt(f)===69?(te=We,f++):(te=t,w===0&&ae(bt))),te!==t){if(e.charCodeAt(f)===43?(mt=he,f++):(mt=t,w===0&&ae(tt)),mt===t&&(e.charCodeAt(f)===45?(mt=se,f++):(mt=t,w===0&&ae(ct))),mt===t&&(mt=null),yt=[],Le.test(e.charAt(f))?(cr=e.charAt(f),f++):(cr=t,w===0&&ae(Re)),cr!==t)for(;cr!==t;)yt.push(cr),Le.test(e.charAt(f))?(cr=e.charAt(f),f++):(cr=t,w===0&&ae(Re));else yt=t;yt!==t?(te=[te,mt,yt],ie=te):(f=ie,ie=t)}else f=ie,ie=t;ie===t&&(ie=null),j=p,p=Lt()}else f=p,p=t}else f=p,p=t;if(p===t){if(p=f,e.charCodeAt(f)===45?f++:w===0&&ae(ct),S=[],Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re)),z!==t)for(;z!==t;)S.push(z),Le.test(e.charAt(f))?(z=e.charAt(f),f++):(z=t,w===0&&ae(Re));else S=t;if(S!==t)if(e.charCodeAt(f)===101?(z=He,f++):(z=t,w===0&&ae(_e)),z===t&&(e.charCodeAt(f)===69?(z=We,f++):(z=t,w===0&&ae(bt))),z!==t){if(e.charCodeAt(f)===43?(D=he,f++):(D=t,w===0&&ae(tt)),D===t&&(e.charCodeAt(f)===45?(D=se,f++):(D=t,w===0&&ae(ct))),D===t&&(D=null),ie=[],Le.test(e.charAt(f))?(te=e.charAt(f),f++):(te=t,w===0&&ae(Re)),te!==t)for(;te!==t;)ie.push(te),Le.test(e.charAt(f))?(te=e.charAt(f),f++):(te=t,w===0&&ae(Re));else ie=t;ie!==t?(j=p,p=ge()):(f=p,p=t)}else f=p,p=t;else f=p,p=t}return w--,p===t&&w===0&&ae(Ct),p}function Qt(){var p,S,z,D,ie,te,mt,yt,cr,Tr,Mr;if(p=f,ht.test(e.charAt(f))?(S=e.charAt(f),f++):(S=t,w===0&&ae(dt)),S!==t){if(z=[],D=[],Qe.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(kt)),ie!==t)for(;ie!==t;)D.push(ie),Qe.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(kt));else D=t;for(D===t&&(D=f,e.charCodeAt(f)===46?(ie=N,f++):(ie=t,w===0&&ae(oe)),ie!==t?(te=f,w++,mt=f,yt=vt(),cr=sn(),cr!==t?(Tr=vt(),e.charCodeAt(f)===40?(Mr=T,f++):(Mr=t,w===0&&ae(je)),Mr!==t?(yt=[yt,cr,Tr,Mr],mt=yt):(f=mt,mt=t)):(f=mt,mt=t),w--,mt===t?te=void 0:(f=te,te=t),te!==t?(ie=[ie,te],D=ie):(f=D,D=t)):(f=D,D=t));D!==t;){if(z.push(D),D=[],Qe.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(kt)),ie!==t)for(;ie!==t;)D.push(ie),Qe.test(e.charAt(f))?(ie=e.charAt(f),f++):(ie=t,w===0&&ae(kt));else D=t;D===t&&(D=f,e.charCodeAt(f)===46?(ie=N,f++):(ie=t,w===0&&ae(oe)),ie!==t?(te=f,w++,mt=f,yt=vt(),cr=sn(),cr!==t?(Tr=vt(),e.charCodeAt(f)===40?(Mr=T,f++):(Mr=t,w===0&&ae(je)),Mr!==t?(yt=[yt,cr,Tr,Mr],mt=yt):(f=mt,mt=t)):(f=mt,mt=t),w--,mt===t?te=void 0:(f=te,te=t),te!==t?(ie=[ie,te],D=ie):(f=D,D=t)):(f=D,D=t))}j=p,p=Ge()}else f=p,p=t;return p}function sn(){var p,S,z,D;if(p=f,ht.test(e.charAt(f))?(S=e.charAt(f),f++):(S=t,w===0&&ae(dt)),S!==t){for(z=[],Qe.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(kt));D!==t;)z.push(D),Qe.test(e.charAt(f))?(D=e.charAt(f),f++):(D=t,w===0&&ae(kt));j=p,p=q()}else f=p,p=t;return p}function vt(){var p,S;for(w++,p=[],ve.test(e.charAt(f))?(S=e.charAt(f),f++):(S=t,w===0&&ae(ke));S!==t;)p.push(S),ve.test(e.charAt(f))?(S=e.charAt(f),f++):(S=t,w===0&&ae(ke));return w--,S=t,w===0&&ae(ft),p}if(de=o(),de!==t&&f===e.length)return de;throw de!==t&&f<e.length&&ae(Ar()),Sr(_t,Ye<e.length?e.charAt(Ye):null,Ye<e.length?jn(Ye,Ye+1):jn(Ye,Ye))}const nh=Number.MAX_VALUE,ih=Number.MIN_VALUE,ce="string",ye="integer",qe="number",Lr="boolean",Kr="color",Rn="url",Nr="datetime",xt="dict",$t="array",oh="function";function $n(e,r){var t;switch((t=r[e.type])==null||t.call(r,e),e.type){case"TemplateLiteral":e.expressions.forEach(n=>{$n(n,r)});break;case"BinaryExpression":case"LogicalExpression":$n(e.left,r),$n(e.right,r);break;case"UnaryExpression":$n(e.argument,r);break;case"ConditionalExpression":$n(e.test,r),$n(e.consequent,r),$n(e.alternate,r);break;case"TryExpression":$n(e.test,r),$n(e.alternate,r);break;case"CallExpression":e.arguments.forEach(n=>{$n(n,r)});break;case"MethodExpression":$n(e.object,r),e.arguments.forEach(n=>{$n(n,r)});break}}function Rf(e,r){for(;e.length<r;)e="0"+e;return e}function Br(e,r=1,t="transparent"){if(e=(typeof e=="string"&&e||"").toLowerCase(),e.charAt(0)!=="#")return t;const n=ai(e);return n?(n.a*=r,Bl(n)):t}function sh(e,r,t="transparent"){if(e=(typeof e=="string"&&e||"").toLowerCase(),e.charAt(0)!=="#")return t;const n=ai(e);return n?(n.a=r,Bl(n)):t}function Bl(e){return e.a===255?`#${[e.r,e.g,e.b].map(r=>Rf(Math.round(r).toString(16),2)).join("")}`:`rgba(${e.r},${e.g},${e.b},${(e.a/255).toFixed(2)})`}function ai(e){const r=e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||e.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||e.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(r){if(r.length===5){const[u,c,d,_,g]=r,m=d.length===2?d:d+d,h=_.length===2?_:_+_,v=g.length===2?g:g+g,E=c.length===2?c:c+c;return{a:parseInt(E,16),r:parseInt(m,16),g:parseInt(h,16),b:parseInt(v,16)}}const[t,n,i,o]=r,s=n.length===2?n:n+n,a=i.length===2?i:i+i,l=o.length===2?o:o+o;return{a:255,r:parseInt(s,16),g:parseInt(a,16),b:parseInt(l,16)}}return null}class Hl extends Error{}function ws(e){return e.type==="url"||e.type==="color"?{type:"string",value:e.value}:e}function Bf(e){return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")+" "+[String(e.getHours()).padStart(2,"0"),String(e.getMinutes()).padStart(2,"0"),String(e.getSeconds()).padStart(2,"0")].join(":")}function lh(e,r){return r&&r instanceof Object&&!Array.isArray(r)?Object.keys(r).sort().reduce((t,n)=>(t[n]=r[n],t),{}):r}function Ri(e,r){if(e.type==="string")return e.value;if(e.type==="integer")return String(e.value);if(e.type==="number"){let t=String(e.value);return t.includes(".")||(t.includes("e")?t=t.replace("e",".0e"):t+=".0"),t=t.replace(/e\+?/i,"E"),t}else{if(e.type==="boolean")return e.value?"true":"false";if(e.type==="datetime")return Bf(e.value);if(e.type==="color")return Bi(yo(e.value));if(e.type==="url")return e.value;if((e.type==="dict"||e.type==="array")&&r)return JSON.stringify(e.value,lh);if(e.type==="dict")return"<dict>";if(e.type==="array")return"<array>";if(e.type==="function")return e.value[0].name||"Function"}throw new Error(`Unexpected type ${e.type}`)}function gn(e){let r=Ri(e,!1);return e.type==="string"&&(r="'"+r.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),r}function Kn(e){return e==="datetime"?"DateTime":e.charAt(0).toUpperCase()+e.substring(1)}function oo(e,r){return un(r)}function zn(e,r){if(r<Ro||r>Lo)throw new Error("Integer overflow.")}function ui(e){if(typeof e!="string")throw new Error("Incorrect url value.");try{new URL(e)}catch{throw new Error("Incorrect url value.")}}function ah(e){try{return ui(e),!0}catch{return!1}}function uh(e){const r=new Set;return $n(e,{Variable(t){r.add(t.id.name)}}),[...r]}function Tn(e,r){throw new Hl(`Failed to evaluate [${e}]. ${r}`)}function ch(e,r){throw new Error(r)}function yo(e){const r=ai(e);if(r)return r;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Bi(e){return`#${[e.a,e.r,e.g,e.b].map(r=>{if(r<0||r>255)throw new Error("Value out of range 0..1.");return Rf(Math.round(r).toString(16),2)}).join("").toUpperCase()}`}function Hi(e){return Bi(yo(e))}function dl(e){return{type:qe,value:Number(e.value)}}const fh={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object",datetime:"never"};function Ns(e,r,t){if(t==="function")throw new Error("Cannot convert function");const n=fh[t];let i=typeof r;if(n==="array"&&!Array.isArray(r)||n!=="array"&&i!==n||i==="object"&&r===null)throw i==="object"&&(Array.isArray(r)?i="array":r===null?i="null":i="dict"),new Error(`Incorrect value type: expected ${Kn(t)}, got ${Kn(i)}.`);if(n==="number"&&t==="integer"){e&&zn(e,r);try{r=un(r)}catch{throw new Error("Cannot convert value to integer.")}}return n==="string"&&t==="color"&&(r=Hi(r)),n==="string"&&t==="url"&&ui(r),n==="boolean"&&t===Lr&&(r=r?1:0),{type:t,value:r}}function dh(e){return e.type==="number"||e.type==="integer"?Number(e.value):e.type==="boolean"?!!e.value:e.value}function zs(e){return dh(Ns(void 0,e.value,e.type))}function vs(e){return e.map(gn).join(", ")}function Hf(e,r,t,n=!1){const i=r.map(a=>Kn(a.type)).join(", "),o=`${e}(${vs(r)})`,s=n?ch:Tn;if(t.type==="few"&&r.length===0&&t.hasOverloads)s(o,"Function requires non empty argument list.");else if(t.type==="many"||t.type==="few"||t.type==="mismatch")if(t.hasOverloads)s(o,`Function has no matching overload for given argument types: ${i}.`);else if(t.type==="many"||t.type==="few")t.def.args.some(a=>typeof a=="object"&&a.isVararg)?s(o,`At least ${t.def.args.length} argument(s) expected.`):s(o,`Exactly ${t.def.args.length} argument(s) expected.`);else{const a=t.def.args.map(l=>Kn(typeof l=="string"?l:l.type)).join(", ");s(o,`Invalid argument type: expected ${a}, got ${i}.`)}else s(o,`Unknown function name: ${e}.`)}const No=new Map,hl=new Map,ns=new Map,_l=new Map;function F(e,r,t){const n={args:r,cb:t},i=No.get(e)||[];No.has(e)||No.set(e,i),i.push(n);const o=e+":"+r.map(s=>typeof s=="object"?s.type:s).join("#");hl.set(o,n)}function Rr(e,r,t){const n={args:r,cb:t},i=ns.get(e)||[];ns.has(e)||ns.set(e,i),i.push(n);const o=e+":"+r.map(s=>typeof s=="object"?s.type:s).join("#");_l.set(o,n)}function hh(e,r,t){const n=e.args.length;let i=e.args.length,o=0;const s=e.args[e.args.length-1];if(typeof s=="object"&&s.isVararg&&(i=1/0),r.length<n)return{type:"few",expected:n,found:r.length,def:e,hasOverloads:t};if(r.length>i)return{type:"many",expected:i,found:r.length,def:e,hasOverloads:t};for(let a=0;a<r.length;++a){let l=a>=e.args.length?e.args[e.args.length-1]:e.args[a];if(typeof l!="object"&&(l={type:l}),l.type===qe&&r[a].type===ye){++o;continue}if(l.type!==r[a].type)return{type:"mismatch",expected:l.type,found:r[a].type,def:e,hasOverloads:t}}return{type:"match",conversions:o}}function Wf(e,r){if(!e)return{type:"missing"};let t=null,n=null;for(let i=0;i<e.length;++i){const o=hh(e[i],r,e.length>1);if(o.type==="match"){(!n||n.conversions>o.conversions)&&(n={func:e[i],conversions:o.conversions});continue}t||(t=o)}if(!n){if(t)return t;throw new Error("Missing function")}return n}function gl(e,r,t){return Wf(e.get(r),t)}function Uf(e,r){return r.map((t,n)=>{let i=n>=e.args.length?e.args[e.args.length-1]:e.args[n];return typeof i!="object"&&(i={type:i}),i.type===qe&&t.type===ye?dl(t):t})}function _a(e,r){return e+":"+r.args.map(t=>typeof t=="string"?t:t.type).join("#")}function Hn(e,r){return{type:ce,value:Ri(r,!0)}}function ga(e,r){const t=Number(r.value);if(Number.isNaN(t)||!Number.isFinite(t))throw new Error("Unable to convert value to Number.");if(r.value==="")throw new Error("Unable to convert value to Number.");return{type:qe,value:t}}function _h(e,r){if(r.value>Lo||r.value<Ro)throw new Error("Unable to convert value to Integer.");const t=r.value-r.value%1;return{type:ye,value:un(t)}}function gh(e,r){let t;try{t=un(r.value)}catch{throw new Error("Unable to convert value to Integer.")}return{type:ye,value:t}}function ph(e,r){return{type:ye,value:un(r.value?1:0)}}function mh(e,r){const t=Number(r.value);if(t!==1&&t!==0)throw new Error("Unable to convert value to Boolean.");return{type:Lr,value:t}}function bh(e,r){if(r.value!=="true"&&r.value!=="false")throw new Error("Unable to convert value to Boolean.");return{type:Lr,value:r.value==="true"?1:0}}function yh(e,r){return{type:Kr,value:Hi(r.value)}}function wh(e,r){return ui(r.value),{type:Rn,value:r.value}}function vh(e,r){try{return{type:ce,value:encodeURIComponent(r.value)}}catch{throw new Error("Unable to encodeUri string.")}}function kh(e,r){try{return{type:ce,value:decodeURIComponent(r.value)}}catch{throw new Error("Unable to decodeUri string.")}}function Wl(e,r,t,n){const i=e.variables.get(r.value);let o;return i&&i.getType()===n?(o=i.getValue(),e.storeUsedVars||(e.storeUsedVars=new Set),e.storeUsedVars.add(i)):o=t.value,n==="color"?o=Hi(o):n==="url"&&ui(o),{type:n,value:o}}function Jo(e,r,t){return Wl(e,r,t,t.type)}function pa(e,r,t){return Wl(e,r,t,"color")}function ma(e,r,t){return Wl(e,r,t,"url")}function Gf(e,r){for(let t=0;t<r.length;++t){const n=e.charAt(t),i=r.charAt(t);if(n!==i&&i)return i}return""}const ks=1234567890;function ba(e){const r=new Intl.NumberFormat(e,{maximumFractionDigits:0}),t=new Intl.NumberFormat(e,{minimumFractionDigits:1}),n=r.format(ks),i=t.format(ks);return Gf(n,i)}function Eh(e){const r=new Intl.NumberFormat(e,{useGrouping:!1}),t=new Intl.NumberFormat(e,{useGrouping:!0}),n=r.format(ks),i=t.format(ks);return Gf(n,i)}function zi(e,r,t,n){const i=t.value,o=i.replace(/,/g,"");if(!/^((#+)|(#*0+))(\.0*#*)?$/.test(o)&&!/^#*0*\.((0*#*)|(#+))$/.test(o)||/,.*,/.test(i)||i.indexOf(",")>i.indexOf(".")&&i.indexOf(".")>-1)throw new Error("Incorrect format pattern.");const s=i.split("."),a=s[0],l=s[1]||"",u=i.replace(/[^#0.]/g,"").split("."),c=u[0],d=u[1]||"",_=a.indexOf(","),g=_>-1?a.length-_-1:-1;if(_>-1&&g<1||l.indexOf(",")>-1)throw new Error("Incorrect format pattern.");try{let m=0;for(;c[c.length-1-m]==="0";)++m;let h=0;for(;d[h]==="0";)++h;let v=h;for(;d[v]==="#";)++v;let K=new Intl.NumberFormat((n==null?void 0:n.value)||void 0,{useGrouping:!1,minimumIntegerDigits:Math.min(Math.max(m,1),21),minimumFractionDigits:Math.min(Math.max(h,0),100),maximumFractionDigits:Math.min(Math.max(v,h,0),100),roundingMode:"halfEven"}).format(r.value);if(_>-1&&g>0){const Q=Eh(n==null?void 0:n.value),X=ba(n==null?void 0:n.value);if(Q&&X){const he=K.split(X),se=he[0];let H="";for(let Z=se.length-1;Z>=0;--Z)H=se[Z]+H,Z>0&&(se.length-Z)%g===0&&(H=Q+H);K=H+(he.length>1?X+he[1]:"")}}if(h===0&&v===0&&i.endsWith(".")){const Q=ba(n==null?void 0:n.value);Q&&(K+=Q)}return{type:ce,value:K}}catch(m){throw new Error("Incorrect or unsupported number format."+m+" "+(n==null?void 0:n.value)||void 0)}}function Ah(){F("toString",[ye],Hn),F("toString",[qe],Hn),F("toString",[Lr],Hn),F("toString",[Kr],Hn),F("toString",[Rn],Hn),F("toString",[ce],Hn),F("toString",[$t],Hn),F("toString",[xt],Hn),F("toNumber",[ye],ga),F("toNumber",[ce],ga),F("toInteger",[qe],_h),F("toInteger",[ce],gh),F("toInteger",[Lr],ph),F("toBoolean",[ye],mh),F("toBoolean",[ce],bh),F("toColor",[ce],yh),F("toUrl",[ce],wh),F("encodeUri",[ce],vh),F("decodeUri",[ce],kh),F("getIntegerValue",[ce,ye],Jo),F("getNumberValue",[ce,qe],Jo),F("getBooleanValue",[ce,Lr],Jo),F("getStringValue",[ce,ce],Jo),F("getColorValue",[ce,Kr],pa),F("getColorValue",[ce,ce],pa),F("getUrlValue",[ce,Rn],ma),F("getUrlValue",[ce,ce],ma),Rr("toString",[ye],Hn),Rr("toString",[qe],Hn),Rr("toString",[Lr],Hn),Rr("toString",[Kr],Hn),Rr("toString",[Rn],Hn),Rr("toString",[ce],Hn),Rr("toString",[$t],Hn),Rr("toString",[xt],Hn),F("decimalFormat",[ye,ce],zi),F("decimalFormat",[qe,ce],zi),F("decimalFormat",[ye,ce,ce],zi),F("decimalFormat",[qe,ce,ce],zi),Rr("decimalFormat",[ye,ce],zi),Rr("decimalFormat",[qe,ce],zi),Rr("decimalFormat",[ye,ce,ce],zi),Rr("decimalFormat",[qe,ce,ce],zi)}function Wn(e,r){return!e||!r?e:e.padStart(r,"0")}const pl={G(e,r){let t;return e<4?t="short":e===5?t="narrow":t="long",r({era:t},"era")},d(e,r){return Wn(r({day:"numeric"},"day"),e>1?e:0)},D(e,r){return Wn(r({},"dayofyear"),e>1?e:0)},F(e,r){return Wn(r({},"dayofweekinmonth"),e>1?e:0)},M(e,r){let t;return e===1?t="numeric":e===2?t="2-digit":e===3?t="short":e===5?t="narrow":t="long",r({month:t,day:"numeric"},"month")},y(e,r){return Wn(r({year:e===2?"2-digit":"numeric"},"year"),e>2?e:void 0)},Y(e,r){return Wn(r({year:e===2?"2-digit":"numeric"},"weekyear"),e>2?e:void 0)},u(e,r){return Wn(r({year:"numeric"},"extendedyear"),e>1?e:void 0)},E(e,r){let t;return e<=3?t="short":e===5?t="narrow":t="long",r({weekday:t},"weekday")},e(e,r){return e>2?pl.E(e,r):Wn(r({},"weekdaynumeric"),e>1?e:void 0)},w(e,r){return Wn(r({},"week"),e>1?e:void 0)},W(e,r){return Wn(r({},"weekofmonth"),e>1?e:void 0)},H(e,r){const t=r({hour:"numeric",hour12:!1,hourCycle:"h23"},"hour");if(!t)return;const n=String(Number(t)%24);return Wn(n,e>1?e:void 0)},h(e,r){return Wn(r({hour:"numeric",hour12:!0,hourCycle:"h12"},"hour"),e>1?e:void 0)},K(e,r){const t=r({hour:"numeric",hour12:!0,hourCycle:"h11"},"hour");if(!t)return;const n=String(Number(t)%12);return Wn(n,e>1?e:void 0)},k(e,r){return Wn(r({hour:"numeric",hour12:!1,hourCycle:"h24"},"hour"),e>2?e:void 0)},a(e,r){return r({hour:"numeric",hour12:!0,hourCycle:"h11",dayPeriod:void 0},"dayPeriod")},m(e,r){return Wn(r({minute:"numeric"},"minute"),e>1?e:void 0)},s(e,r){return Wn(r({second:"numeric"},"second"),e>1?e:void 0)},S(e,r){const t=r({fractionalSecondDigits:Math.min(3,e)},"fractionalSecond");return t&&e>3?t.padEnd(e,"0"):t},z(e,r){return r({timeZoneName:e===4?"long":"short"},"timeZoneName")},Z(e,r){const t=-Number(r({},"timezoneoffset")),n=Math.abs(t/60),i=Math.floor(n)*100+(n-Math.floor(n))*60;return(t>=0?"+":"-")+Wn(String(i),4)}},Ch=/(\w)\1*|''|'(''|[^'])+('|$)|./g,jh=/^'([^]*?)'?$/,Sh=/''/g,Vh=/[a-zA-Z]/,Ul=1e3*60*60*24;function Ih(e){const r=e.match(jh);return r?r[1].replace(Sh,"'"):e}function ml(e,r,t){const n=e[r?"getUTCDay":"getDay"](),i=n<t?t-n-7:t-n;return new Date(e.getTime()+Ul*i)}function ya(e,r,t){const n=new Date(e);return n[r?"setUTCDate":"setDate"](1),n[r?"setUTCMonth":"setMonth"](0),ml(n,r,t)}function wa(e,r){return Math.round((e.getTime()-r.getTime())/Ul)}function va(e,r,t){let n=0;const i=ya(e,r||!1,t),o=new Date(e);o[r?"setUTCFullYear":"setFullYear"](e[r?"getUTCFullYear":"getFullYear"]()+1);const s=ya(o,r||!1,t),a=e.getTime()<i.getTime(),l=e.getTime()>=s.getTime();let u=e[r?"getUTCFullYear":"getFullYear"]();if(a){--u,i[r?"setUTCFullYear":"setFullYear"](i[r?"getUTCFullYear":"getFullYear"]()-1);const c=wa(ml(e,r,t),i);n=Math.round(c/7)+1}else if(l)++u,n=1;else{const c=wa(ml(e,r,t),i);n=Math.round(c/7)+1}return{week:n,year:u}}function Dh(e,r,{locale:t,isUTC:n,weekStartDay:i=0}={}){const o=(s,a)=>{if(a==="week"){const{week:c}=va(e,n||!1,i);return String(c)}if(a==="weekofmonth"){const c=e[n?"getUTCDay":"getDay"](),d=new Date(e);d[n?"setUTCDate":"setDate"](1);const _=d[n?"getUTCDay":"getDay"](),g=e[n?"getUTCDate":"getDate"]();return String(Math.ceil(g/7)+(c<_?1:0))}if(a==="dayofweekinmonth"){const c=e[n?"getUTCDate":"getDate"]();return String(Math.ceil(c/7))}if(a==="weekdaynumeric"){let c=e[n?"getUTCDay":"getDay"]();return c<i&&(c+=7),String(c-i+1)}if(a==="dayofyear"){const c=new Date(e);c[n?"setUTCMonth":"setMonth"](0),c[n?"setUTCDate":"setDate"](1),c[n?"setUTCHours":"setHours"](1),c[n?"setUTCMinutes":"setMinutes"](1),c[n?"setUTCSeconds":"setSeconds"](1);const d=Math.ceil((e.getTime()-c.getTime())/Ul);return String(d)}if(a==="weekyear"){let{year:c}=va(e,n||!1,i);return c<1&&(c=1-c),s.year==="2-digit"?String(c%100):String(c)}if(a==="extendedyear"){const c=e[n?"getUTCFullYear":"getFullYear"]();return s.year==="2-digit"?String(c%100):String(c)}if(a==="timezoneoffset")return n?"0":String(e.getTimezoneOffset());n&&(s.timeZone="UTC");const u=new Intl.DateTimeFormat(t,s).formatToParts(e);for(let c=0;c<u.length;++c)if(u[c].type===a)return u[c].value};return(r.match(Ch)||[]).map(s=>{if(s==="''")return"'";const a=s[0];if(a==="'")return Ih(s);if(pl[a])return pl[a](s.length,o);if(a.match(Vh))throw new Error(`Format string contains an unescaped latin alphabet character "${a}"`);return s}).join("")}function Th(e){const r=new Date(e);return r.setUTCMonth(r.getUTCMonth()+1),r.setUTCDate(0),r.getUTCDate()}function Fh(e,r){return{type:Nr,value:new Date(Number(r.value)*1e3)}}function Mh(e,r){const t=new Date(Number(r.value)*1e3),n=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()-n),{type:Nr,value:t}}function Ph(){return{type:Nr,value:new Date}}function Nh(e,r,t){return{type:Nr,value:new Date(r.value.getTime()+Number(t.value))}}function zh(e,r,t){const n=new Date(r.value);return n.setUTCFullYear(Number(t.value)),{type:Nr,value:n}}function Oh(e,r,t){const n=Number(t.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMonth(n-1),{type:Nr,value:i}}function Lh(e,r,t){const n=new Date(r.value),i=Number(t.value);if(i<=0&&i!==-1||i>Th(n))throw new Error(`Unable to set day ${i} for date ${Ri(r,!1)}.`);return n.setUTCDate(i===-1?0:i),{type:Nr,value:n}}function Rh(e,r,t){const n=Number(t.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(r.value);return i.setUTCHours(n),{type:Nr,value:i}}function Bh(e,r,t){const n=Number(t.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMinutes(n),{type:Nr,value:i}}function Hh(e,r,t){const n=Number(t.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(r.value);return i.setUTCSeconds(n),{type:Nr,value:i}}function Wh(e,r,t){const n=Number(t.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMilliseconds(n),{type:Nr,value:i}}const Wi=e=>(r,t)=>{let i=new Date(t.value.getTime())[e]();return e==="getUTCMonth"?++i:e==="getUTCDay"&&i===0&&(i=7),{type:ye,value:un(i)}};function Yf(e){return(r,t,n,i)=>({type:ce,value:Dh(t.value,n.value,{locale:i==null?void 0:i.value,isUTC:e,weekStartDay:r.weekStartDay})})}const Uh=Wi("getUTCFullYear"),Gh=Wi("getUTCMonth"),Yh=Wi("getUTCDate"),Jh=Wi("getUTCDay"),qh=Wi("getUTCHours"),Kh=Wi("getUTCMinutes"),Xh=Wi("getUTCSeconds"),Zh=Wi("getUTCMilliseconds"),ka=Yf(!1),Ea=Yf(!0);function Qh(e,r){return{type:ye,value:un(r.value.getTime())}}function xh(){F("parseUnixTime",[ye],Fh),F("parseUnixTimeAsLocal",[ye],Mh),F("nowLocal",[],Ph),F("addMillis",[Nr,ye],Nh),F("setYear",[Nr,ye],zh),F("setMonth",[Nr,ye],Oh),F("setDay",[Nr,ye],Lh),F("setHours",[Nr,ye],Rh),F("setMinutes",[Nr,ye],Bh),F("setSeconds",[Nr,ye],Hh),F("setMillis",[Nr,ye],Wh),F("getYear",[Nr],Uh),F("getMonth",[Nr],Gh),F("getDay",[Nr],Yh),F("getDayOfWeek",[Nr],Jh),F("getHours",[Nr],qh),F("getMinutes",[Nr],Kh),F("getSeconds",[Nr],Xh),F("getMillis",[Nr],Zh),F("formatDateAsLocal",[Nr,ce],ka),F("formatDateAsUTC",[Nr,ce],Ea),F("formatDateAsLocalWithLocale",[Nr,ce,ce],ka),F("formatDateAsUTCWithLocale",[Nr,ce,ce],Ea),F("getTimestamp",[Nr],Qh)}function $h(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function B(e,r={}){const t=e;return t.level=r.level||"error",r.additional&&(t.additional=r.additional),t}function e_(e,r){return{type:ye,value:un(r.value.length)}}function t_(e,r,t){return{type:Lr,value:r.value.includes(t.value)?1:0}}function r_(e,r,t,n){if(n.value<t.value)throw new Error("Indexes should be in ascending order.");if(t.value<0||t.value>r.value.length||n.value<0||n.value>r.value.length)throw new Error("Indexes are out of bounds.");return{type:ce,value:r.value.substring(Number(t.value),Number(n.value))}}function n_(e,r,t,n){let i;return t.value?i=r.value.replace(new RegExp($h(t.value),"g"),n.value):i=r.value,{type:ce,value:i}}function i_(e,r,t){return{type:ye,value:un(r.value.indexOf(t.value))}}function o_(e,r,t){return{type:ye,value:un(r.value.lastIndexOf(t.value))}}function s_(e,r){return{type:ce,value:r.value.trim()}}function l_(e,r){return{type:ce,value:r.value.replace(/^\s+/,"")}}function a_(e,r){return{type:ce,value:r.value.replace(/\s+$/,"")}}function u_(e,r){return{type:ce,value:r.value.toUpperCase()}}function c_(e,r){return{type:ce,value:r.value.toLowerCase()}}function Jf(e,r,t,n){if(!n.value.length)return e.warnings.push(B(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=r.type===ce?r.value:Ri(r,!1);for(;i.length+o.length<t.value;)i+=n.value;return i.length>0&&i.length+o.length>t.value&&(i=i.substring(0,Number(t.value)-Number(o.length))),i}function Aa(e,r,t,n){const i=Jf(e,r,t,n);return{type:ce,value:i+Ri(r,!1)}}function Ca(e,r,t,n){const i=Jf(e,r,t,n);return{type:ce,value:Ri(r,!1)+i}}function f_(e,r,t){let n;try{n=new RegExp(t.value)}catch{throw new Error("Invalid regular expression.")}return{type:Lr,value:n.test(r.value)?1:0}}function d_(e,r){return{type:ce,value:r.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}function h_(){F("len",[ce],e_),F("contains",[ce,ce],t_),F("substring",[ce,ye,ye],r_),F("replaceAll",[ce,ce,ce],n_),F("index",[ce,ce],i_),F("lastIndex",[ce,ce],o_),F("trim",[ce],s_),F("trimLeft",[ce],l_),F("trimRight",[ce],a_),F("toUpperCase",[ce],u_),F("toLowerCase",[ce],c_),F("padStart",[ce,ye,ce],Aa),F("padStart",[ye,ye,ce],Aa),F("padEnd",[ce,ye,ce],Ca),F("padEnd",[ye,ye,ce],Ca),F("testRegex",[ce,ce],f_),F("encodeRegex",[ce],d_)}function __(e,r,t){if(t.value===$i)throw new Error("Division by zero is not supported.");let n=r.value/t.value;return n=oo(e,n),zn(e,n),{type:ye,value:n}}function g_(e,r,t){if(t.value===0)throw new Error("Division by zero is not supported.");const n=r.value/t.value;return{type:qe,value:n}}function p_(e,r,t){if(t.value===$i)throw new Error("Division by zero is not supported.");let n=r.value%t.value;return n=oo(e,n),zn(e,n),{type:ye,value:n}}function m_(e,r,t){if(t.value===0)throw new Error("Division by zero is not supported.");const n=r.value%t.value;return{type:qe,value:n}}function b_(e,...r){let t=r.length?r[0].value:$i;for(let n=1;n<r.length;++n)t*=r[n].value,t=oo(e,t),zn(e,t);return{type:ye,value:t}}function y_(e,...r){let t=r.length?r[0].value:0;for(let n=1;n<r.length;++n)t*=r[n].value;return{type:qe,value:t}}function w_(e,...r){let t=r.length?r[0].value:$i;for(let n=1;n<r.length;++n)t-=r[n].value,t=oo(e,t),zn(e,t);return{type:ye,value:t}}function v_(e,...r){let t=r.length?r[0].value:0;for(let n=1;n<r.length;++n)t-=r[n].value;return{type:qe,value:t}}function k_(e,...r){let t=$i;for(let n=0;n<r.length;++n)t+=r[n].value,t=oo(e,t),zn(e,t);return{type:ye,value:t}}function E_(e,...r){let t=0;for(let n=0;n<r.length;++n)t+=r[n].value;return{type:qe,value:t}}function A_(e,r){const t=Of(r.value);return zn(e,t),{type:r.type,value:t}}function C_(e,r){const t=Math.abs(r.value);return{type:qe,value:t}}function j_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");let t=r[0].value;for(let n=1;n<r.length;++n)r[n].value>t&&(t=r[n].value);return{type:ye,value:t}}function S_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");return{type:qe,value:Math.max(...r.map(t=>t.value))}}function V_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");let t=r[0].value;for(let n=1;n<r.length;++n)r[n].value<t&&(t=r[n].value);return{type:ye,value:t}}function I_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");return{type:qe,value:Math.min(...r.map(t=>t.value))}}function D_(){return{type:qe,value:nh}}function T_(){return{type:qe,value:ih}}function F_(e){return zn(e,Lo),{type:ye,value:Lo}}function M_(e){return zn(e,Ro),{type:ye,value:Ro}}function P_(e,r){const t=Math.sign(r.value);return{type:qe,value:t*Math.round(Math.abs(r.value))}}function N_(e,r){return{type:qe,value:Math.floor(r.value)}}function z_(e,r){return{type:qe,value:Math.ceil(r.value)}}function O_(e,r){return{type:ye,value:Lf(r.value)}}function L_(e,r){return{type:qe,value:Math.sign(r.value)}}function R_(e,r,t){let n;if(t.value===$i)n=r.value;else if(r.value===$i)n=un(0);else{const i=Lf(t.value);n=Of(r.value)*i}return zn(e,n),{type:ye,value:n}}function B_(e,r,t){let n=Math.sign(t.value);n===0&&(n=Object.is(n,0)?1:-1);const i=Math.abs(r.value)*n;return{type:qe,value:i}}function H_(){F("div",[ye,ye],__),F("div",[qe,qe],g_),F("mod",[ye,ye],p_),F("mod",[qe,qe],m_),F("mul",[{type:ye,isVararg:!0}],b_),F("mul",[{type:qe,isVararg:!0}],y_),F("sub",[{type:ye,isVararg:!0}],w_),F("sub",[{type:qe,isVararg:!0}],v_),F("sum",[{type:ye,isVararg:!0}],k_),F("sum",[{type:qe,isVararg:!0}],E_),F("abs",[ye],A_),F("abs",[qe],C_),F("max",[{type:ye,isVararg:!0}],j_),F("max",[{type:qe,isVararg:!0}],S_),F("min",[{type:ye,isVararg:!0}],V_),F("min",[{type:qe,isVararg:!0}],I_),F("maxNumber",[],D_),F("minNumber",[],T_),F("maxInteger",[],F_),F("minInteger",[],M_),F("round",[qe],P_),F("floor",[qe],N_),F("ceil",[qe],z_),F("signum",[ye],O_),F("signum",[qe],L_),F("copySign",[ye,ye],R_),F("copySign",[qe,qe],B_)}function Os(e){return(r,t)=>{const n=yo(t.value);return{type:qe,value:n[e]/255}}}function Ls(e){return(r,t,n)=>{const i=yo(t.value);return i[e]=n.value*255,{type:Kr,value:Bi(i)}}}const ja=Os("a"),Sa=Os("r"),Va=Os("g"),Ia=Os("b"),Da=Ls("a"),Ta=Ls("r"),Fa=Ls("g"),Ma=Ls("b");function W_(e,r,t,n){const i={a:255,r:r.value*255,g:t.value*255,b:n.value*255};return{type:Kr,value:Bi(i)}}function U_(e,r,t,n,i){const o={a:r.value*255,r:t.value*255,g:n.value*255,b:i.value*255};return{type:Kr,value:Bi(o)}}function G_(e,r){return 255-((255-e)*(255-r)/255|0)}function $s(e,r,t,n,i){return i===0?0:(255*t*n+e*r*(255-n)|0)/(i*255)|0}function Y_(e,r,t){const n=yo(r.value),i=yo(t.value),o=G_(n.a,i.a);return{type:Kr,value:Bi({a:o,r:$s(n.r,n.a,i.r,i.a,o),g:$s(n.g,n.a,i.g,i.a,o),b:$s(n.b,n.a,i.b,i.a,o)})}}function J_(){F("getColorAlpha",[ce],ja),F("getColorAlpha",[Kr],ja),F("getColorRed",[ce],Sa),F("getColorRed",[Kr],Sa),F("getColorGreen",[ce],Va),F("getColorGreen",[Kr],Va),F("getColorBlue",[ce],Ia),F("getColorBlue",[Kr],Ia),F("setColorAlpha",[ce,qe],Da),F("setColorAlpha",[Kr,qe],Da),F("setColorRed",[ce,qe],Ta),F("setColorRed",[Kr,qe],Ta),F("setColorGreen",[ce,qe],Fa),F("setColorGreen",[Kr,qe],Fa),F("setColorBlue",[ce,qe],Ma),F("setColorBlue",[Kr,qe],Ma),F("rgb",[qe,qe,qe],W_),F("argb",[qe,qe,qe,qe],U_),F("alphaBlend",[Kr,Kr],Y_)}function Ui(e,r,t,n){if(r.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=un(r.value)/un(t);return zn(e,i),n&&(i=un(i)%un(n)),{type:ye,value:i}}const qf=1e3,q_=60,Kf=1e3*60,K_=60,Xf=1e3*60*60,X_=24,Z_=1e3*60*60*24,Q_=1e3*60*60*24*7;function x_(e,r){return Ui(e,r,qf,q_)}function $_(e,r){return Ui(e,r,qf)}function eg(e,r){return Ui(e,r,Kf,K_)}function tg(e,r){return Ui(e,r,Kf)}function rg(e,r){return Ui(e,r,Xf,X_)}function ng(e,r){return Ui(e,r,Xf)}function ig(e,r){return Ui(e,r,Z_)}function og(e,r){return Ui(e,r,Q_)}function sg(){F("getIntervalSeconds",[ye],x_),F("getIntervalTotalSeconds",[ye],$_),F("getIntervalMinutes",[ye],eg),F("getIntervalTotalMinutes",[ye],tg),F("getIntervalHours",[ye],rg),F("getIntervalTotalHours",[ye],ng),F("getIntervalTotalDays",[ye],ig),F("getIntervalTotalWeeks",[ye],og)}function lg(e,r){let t=e;for(let n=0;n<r.length;++n){if(!t)throw new Error(`Missing property "${r[n]}" in the dict.`);const i=t[r[n]];if(i===void 0)throw new Error(`Missing property "${r[n]}" in the dict.`);t=i}return t}function Gi(e){return(r,t,...n)=>{if(n.length===0)throw new Error("Non empty argument list is required.");const i=lg(t.value,n.map(o=>o.value));return Ns(r,i,e)}}function Ao(e,r){return(t,n,i,...o)=>{try{return e(t,i,...o)}catch{let a=n.value;return r==="color"?a=Hi(a):r==="url"&&ui(a),{type:r,value:a}}}}const is=Gi(ce),os=Gi(qe),ss=Gi(ye),ls=Gi(Lr),as=Gi(Kr),us=Gi(Rn),bl=Gi($t),yl=Gi(xt),Pa=Ao(is,ce),Na=Ao(os,qe),za=Ao(ss,ye),Oa=Ao(ls,Lr),qo=Ao(as,Kr),Ko=Ao(us,Rn);function ag(e,r,...t){try{return bl(e,r,...t)}catch{return{type:$t,value:[]}}}function ug(e,r,...t){try{return yl(e,r,...t)}catch{return{type:xt,value:{}}}}function cg(e,r,t){return{type:Lr,value:t.value in r.value?1:0}}function fg(e,r){return{type:Lr,value:Object.keys(r.value).length?0:1}}function dg(e,r){return{type:ye,value:un(Object.keys(r.value).length)}}function La(e,r){return{type:$t,value:Object