13 lines
198 KiB
JavaScript
13 lines
198 KiB
JavaScript
|
|
var Us=Object.create;var cr=Object.defineProperty;var Hs=Object.getOwnPropertyDescriptor;var Gs=Object.getOwnPropertyNames;var Ys=Object.getPrototypeOf,Ks=Object.prototype.hasOwnProperty;var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{for(var r in t)cr(e,r,{get:t[r],enumerable:!0})},Vs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gs(t))!Ks.call(e,i)&&i!==r&&cr(e,i,{get:()=>t[i],enumerable:!(n=Hs(t,i))||n.enumerable});return e};var Qs=(e,t,r)=>(r=e!=null?Us(Ys(e)):{},Vs(t||!e||!e.__esModule?cr(r,"default",{value:e,enumerable:!0}):r,e));var Po=Be(xr=>{var zo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");xr.encode=function(e){if(0<=e&&e<zo.length)return zo[e];throw new TypeError("Must be between 0 and 63: "+e)};xr.decode=function(e){var t=65,r=90,n=97,i=122,o=48,a=57,c=43,u=47,s=26,l=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+s:o<=e&&e<=a?e-o+l:e==c?62:e==u?63:-1}});var Fo=Be(wr=>{var Io=Po(),kr=5,No=1<<kr,Do=No-1,Oo=No;function ll(e){return e<0?(-e<<1)+1:(e<<1)+0}function cl(e){var t=(e&1)===1,r=e>>1;return t?-r:r}wr.encode=function(t){var r="",n,i=ll(t);do n=i&Do,i>>>=kr,i>0&&(n|=Oo),r+=Io.encode(n);while(i>0);return r};wr.decode=function(t,r,n){var i=t.length,o=0,a=0,c,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Io.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&Oo),u&=Do,o=o+(u<<a),a+=kr}while(c);n.value=cl(o),n.rest=r}});var Mt=Be(W=>{function ul(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}W.getArg=ul;var Ro=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,pl=/^data:.+\,.+$/;function pt(e){var t=e.match(Ro);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}W.urlParse=pt;function Ke(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}W.urlGenerate=Ke;var hl=32;function ml(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var i=t[0];return t[0]=t[n],t[n]=i,t[0].result}var o=e(r);return t.unshift({input:r,result:o}),t.length>hl&&t.pop(),o}}var vr=ml(function(t){var r=t,n=pt(t);if(n){if(!n.path)return t;r=n.path}for(var i=W.isAbsolute(r),o=[],a=0,c=0;;)if(a=c,c=r.indexOf("/",a),c===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,c));c<r.length&&r[c]==="/";)c++;for(var u,s=0,c=o.length-1;c>=0;c--)u=o[c],u==="."?o.splice(c,1):u===".."?s++:s>0&&(u===""?(o.splice(c+1,s),s=0):(o.splice(c,2),s--));return r=o.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,Ke(n)):r});W.normalize=vr;function Mo(e,t){e===""&&(e="."),t===""&&(t=".");var r=pt(t),n=pt(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Ke(r);if(r||t.match(pl))return t;if(n&&!n.host&&!n.path)return n.host=t,Ke(n);var i=t.charAt(0)==="/"?t:vr(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=i,Ke(n)):i}W.join=Mo;W.isAbsolute=function(e){return e.charAt(0)==="/"||Ro.test(e)};function dl(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}W.relative=dl;var Bo=(function(){var e=Object.create(null);return!("__proto__"in e)})();function _o(e){return e}function fl(e){return Wo(e)?"$"+e:e}W.toSetString=Bo?_o:fl;function gl(e){return Wo(e)?e.slice(1):e}W.fromSetString=Bo?_o:gl;function Wo(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function bl(e,t,r){var n=ke(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.g
|
||
|
|
`)}})}var fr=100,vo=60,So=" ";function Co({source:e,line:t,column:r,baseLine:n,baseColumn:i},o){function a(b,j){return s.slice(b,j).map((J,v)=>String(b+v+1).padStart(h)+" |"+J).join(`
|
||
|
|
`)}let c=`
|
||
|
|
`.repeat(Math.max(n-1,0)),u=" ".repeat(Math.max(i-1,0)),s=(c+u+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-o)-1,p=Math.min(t+o,s.length+1),h=Math.max(4,String(p).length)+1,d=0;r+=(So.length-1)*(s[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>fr&&(d=r-vo+3,r=vo-2);for(let b=l;b<=p;b++)b>=0&&b<s.length&&(s[b]=s[b].replace(/\t/g,So),s[b]=(d>0&&s[b].length>d?"\u2026":"")+s[b].substr(d,fr-2)+(s[b].length>d+fr-1?"\u2026":""));return[a(l,t),new Array(r+h+2).join("-")+"^",a(t,p)].filter(Boolean).join(`
|
||
|
|
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function gr(e,t,r,n,i,o=1,a=1){return Object.assign(De("SyntaxError",e),{source:t,offset:r,line:n,column:i,sourceFragment(u){return Co({source:t,line:n,column:i,baseLine:o,baseColumn:a},isNaN(u)?0:u)},get formattedMessage(){return`Parse error: ${e}
|
||
|
|
`+Co({source:t,line:n,column:i,baseLine:o,baseColumn:a},2)}})}function To(e){let t=this.createList(),r=!1,n={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let i=e.getNode.call(this,n);if(i===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,i,t,n),r=!1),t.push(i)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var Ye=()=>{},rl=33,nl=35,br=59,Lo=123,Ao=0,il={createList(){return[]},createSingleNodeList(e){return[e]},getFirstListNode(e){return e&&e[0]||null},getLastListNode(e){return e&&e.length>0?e[e.length-1]:null}},ol={createList(){return new Q},createSingleNodeList(e){return new Q().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}};function al(e){return function(){return this[e]()}}function yr(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],i=n.parse||n;i&&(t[r]=i)}return t}function sl(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:yr(e.atrule),pseudo:yr(e.pseudo),node:yr(e.node)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=al(n);break}return{config:t,...t,...t.node}}function Eo(e){let t="",r="<unknown>",n=!1,i=Ye,o=!1,a=new lt,c=Object.assign(new ct,sl(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:To,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===Lo?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===Lo||l===br?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===rl||l===br?1:0},consumeUntilSemicolonIncluded(l){return l===br?2:0},createList:Ye,createSingleNodeList:Ye,getFirstListNode:Ye,getLastListNode:Ye,parseWithFallback(l,p){let h=this.tokenIndex;try{return l.call(this)}catch(d){if(o)throw d;this.skip(h-this.tokenIndex);let b=p.call(this);return o=!0,i(d,b),o=!1,b}},lookupNonWSType(l){let p;do if(p=this.lookupType(l++),p!==13&&p!==25)return p;while(p!==Ao);return Ao},charCodeAt(l){return l>=0&&l<t.length?t.charCodeAt(l):0},substring(l,p){return t.substring(l,p)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,p){return ye(t,l,p)},cmpStr(l,p,h){return xe(t,l,p,h)},consume(l){let p=this.tokenStart;return this.eat(l),this.substrToCursor(p)},consumeFunctionName(){let l=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),l},consumeNumber(l){let p=t.substring(this.tokenStart,Ie(t,this.tokenStart));return this.eat(l),p},eat(l){if(this.tokenType!==l){let p=Ne[l].slice(0,-6).replace(/-/g," ").replace(/^./,b=>b.toUpperCase()),h=`${/[[\](){}]/.test(p)?`"${p}"`:p} is expected`,d=this.tokenStart;switch(l){case 1:this.tokenType===2||this.tokenType===7?(d=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(nl)&&(this.next(),d++,h="Name is expected");break;case 11:this.tokenType===10&&(d=this.tokenEnd,h="Percent sign is expected");break}this.error(h,d)}this.next()},eatIdent(l){(this.tokenType!==1||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,p){return n?a.getLocationRange(l,p,r):null},getLocationFromList(l){if(n){let p=this.getFirstListNode(l),h=this.getLastListNode(l);return a.getLocationRange(p!==null?p.loc.start.offset-a.startOffset:this.tokenStart,h!==null?h.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(l,p){let h=typeof p<"u"&&p<t.length?a.getLocation(p):this.eof?a.getLocation(bo(t,t.length-1)):a.getLocation(this.tokenStart);throw new gr(l||"Unexpected input",t,h.offset,h.line,h.column,a.startLine,a.startColumn)}}),u=()=>({filename:r,source:t,tokenCount:c.tokenCount,getTokenType:l=>c.getTokenType(l),getTokenTypeName:l=>Ne[c.getTokenType(l)],getTokenStart:l=>c.getTokenStart(l),getTokenEnd:l=>c.getTokenEnd(l),getTokenValue:l=>c
|
||
|
|
`,13,!0)},emit(u){i+=u},result(){return i}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=Xo(a)),n.mode in Wt&&(a.tokenBefore=Wt[n.mode]));let c={node:u=>a.node(u),children:Il,token:(u,s)=>a.token(u,s),tokenize:u=>Le(u,(s,l,p)=>{a.token(s,u.slice(l,p),l!==0)})};return a.node(r),a.result()}}function ea(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof Q)&&(r.children=new Q().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof Q&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:Ar}=Object.prototype,mt=function(){};function ta(e){return typeof e=="function"?e:mt}function ra(e,t){return function(r,n,i){r.type===t&&e.call(this,r,n,i)}}function Nl(e,t){let r=t.structure,n=[];for(let i in r){if(Ar.call(r,i)===!1)continue;let o=r[i],a={name:i,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(let c of o)c===null?a.nullable=!0:typeof c=="string"?a.type="node":Array.isArray(c)&&(a.type="list");a.type&&n.push(a)}return n.length?{context:t.walkContext,fields:n}:null}function Dl(e){let t={};for(let r in e.node)if(Ar.call(e.node,r)){let n=e.node[r];if(!n.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=Nl(r,n)}return t}function na(e,t){let r=e.fields.slice(),n=e.context,i=typeof n=="string";return t&&r.reverse(),function(o,a,c,u){let s;i&&(s=a[n],a[n]=o);for(let l of r){let p=o[l.name];if(!l.nullable||p){if(l.type==="list"){if(t?p.reduceRight(u,!1):p.reduce(u,!1))return!0}else if(c(p))return!0}}i&&(a[n]=s)}}function ia({StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:i}}}function oa(e){let t=Dl(e),r={},n={},i=Symbol("break-walk"),o=Symbol("skip-node");for(let s in t)Ar.call(t,s)&&t[s]!==null&&(r[s]=na(t[s],!1),n[s]=na(t[s],!0));let a=ia(r),c=ia(n),u=function(s,l){function p(v,E,U){let z=h.call(J,v,E,U);return z===i?!0:z===o?!1:!!(b.hasOwnProperty(v.type)&&b[v.type](v,J,p,j)||d.call(J,v,E,U)===i)}let h=mt,d=mt,b=r,j=(v,E,U,z)=>v||p(E,U,z),J={break:i,skip:o,root:s,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof l=="function")h=l;else if(l&&(h=ta(l.enter),d=ta(l.leave),l.reverse&&(b=n),l.visit)){if(a.hasOwnProperty(l.visit))b=l.reverse?c[l.visit]:a[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=ra(h,l.visit),d=ra(d,l.visit)}if(h===mt&&d===mt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(s)};return u.break=i,u.skip=o,u.find=function(s,l){let p=null;return u(s,function(h,d,b){if(l.call(this,h,d,b))return p=h,i}),p},u.findLast=function(s,l){let p=null;return u(s,{reverse:!0,enter(h,d,b){if(l.call(this,h,d,b))return p=h,i}}),p},u.findAll=function(s,l){let p=[];return u(s,function(h,d,b){l.call(this,h,d,b)&&p.push(h)}),p},u}function Ol(e){return e}function Fl(e){let{min:t,max:r,comma:n}=e;return t===0&&r===0?n?"#?":"*":t===0&&r===1?"?":t===1&&r===0?n?"#":"+":t===1&&r===1?"":(n?"#":"")+(t===r?"{"+t+"}":"{"+t+","+(r!==0?r:"")+"}")}function Rl(e){if(e.type==="Range")return" ["+(e.min===null?"-\u221E":e.min)+","+(e.max===null?"\u221E":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function Ml(e,t,r,n){let i=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",o=e.terms.map(a=>qt(a,t,r,n)).join(i);return e.explicit||r?(n||o[0]===","?"[":"[ ")+o+(n?"]":" ]"):o}function qt(e,t,r,n){let i;switch(e.type){case"Group":i=Ml(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return qt(e.term,t,r,n)+t(Fl(e),e);case"Boolean":i="<boolean-expr["+qt(e.term,t,r,n)+"]>";break;case"Type":i="<"+e.name+(e.opts?t(Rl(e.opts),e.opts):"")+">";break;case"Property":i="<'"+e.name+"'>";break;case"Keyword":i=e.name;break;case"AtKeyword":i="@"+e.name;break;case"Function":i=e.name+"(";break
|
||
|
|
syntax: `+i.syntax+`
|
||
|
|
value: `+(o||"<empty string>")+`
|
||
|
|
--------`+new Array(i.mismatchOffset+1).join("-")+"^",Object.assign(i,u),i.loc={source:r&&r.loc&&r.loc.source||"<unknown>",start:u,end:s},i};var Ut=new Map,Qe=new Map,Ht=45,Gt=_l,Er=Wl,uf=zr;function Yt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Ht&&e.charCodeAt(t+1)===Ht}function zr(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Ht&&e.charCodeAt(t+1)!==Ht){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function _l(e){if(Ut.has(e))return Ut.get(e);let t=e.toLowerCase(),r=Ut.get(t);if(r===void 0){let n=Yt(t,0),i=n?"":zr(t,0);r=Object.freeze({basename:t.substr(i.length),name:t,prefix:i,vendor:i,custom:n})}return Ut.set(e,r),r}function Wl(e){if(Qe.has(e))return Qe.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=Yt(t,r.length);if(!n&&(t=t.toLowerCase(),Qe.has(t))){let c=Qe.get(t);return Qe.set(e,c),c}let i=n?"":zr(t,r.length),o=t.substr(0,r.length+i.length),a=Object.freeze({basename:t.substr(o.length),name:t.substr(r.length),hack:r,vendor:i,prefix:o,custom:n});return Qe.set(e,a),a}var Xe=["initial","inherit","unset","revert","revert-layer"];var gt=43,de=45,Pr=110,$e=!0,jl=!1;function Nr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function ft(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Ae(e,t,r,n){if(!e)return 0;let i=e.value.charCodeAt(t);if(i===gt||i===de){if(r)return 0;t++}for(;t<e.value.length;t++)if(!O(e.value.charCodeAt(t)))return 0;return n+1}function Ir(e,t,r){let n=!1,i=ft(e,t,r);if(e=r(i),e===null)return t;if(e.type!==10)if(Nr(e,gt)||Nr(e,de)){if(n=!0,i=ft(r(++i),i,r),e=r(i),e===null||e.type!==10)return 0}else return t;if(!n){let o=e.value.charCodeAt(0);if(o!==gt&&o!==de)return 0}return Ae(e,n?0:1,n,i)}function Dr(e,t){let r=0;if(!e)return 0;if(e.type===10)return Ae(e,0,jl,r);if(e.type===1&&e.value.charCodeAt(0)===de){if(!ye(e.value,1,Pr))return 0;switch(e.value.length){case 2:return Ir(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==de?0:(r=ft(t(++r),r,t),e=t(r),Ae(e,0,$e,r));default:return e.value.charCodeAt(2)!==de?0:Ae(e,3,$e,r)}}else if(e.type===1||Nr(e,gt)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!ye(e.value,0,Pr))return 0;switch(e.value.length){case 1:return Ir(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==de?0:(r=ft(t(++r),r,t),e=t(r),Ae(e,0,$e,r));default:return e.value.charCodeAt(1)!==de?0:Ae(e,2,$e,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),i=n===gt||n===de?1:0,o=i;for(;o<e.value.length&&O(e.value.charCodeAt(o));o++);return o===i||!ye(e.value,o,Pr)?0:o+1===e.value.length?Ir(t(++r),r,t):e.value.charCodeAt(o+1)!==de?0:o+2===e.value.length?(r=ft(t(++r),r,t),e=t(r),Ae(e,0,$e,r)):Ae(e,o+2,$e,r)}return 0}var Ul=43,la=45,ca=63,Hl=117;function Or(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Gl(e,t){return e.value.charCodeAt(0)===t}function bt(e,t,r){let n=0;for(let i=t;i<e.value.length;i++){let o=e.value.charCodeAt(i);if(o===la&&r&&n!==0)return bt(e,t+n+1,!1),6;if(!te(o)||++n>6)return 0}return n}function Kt(e,t,r){if(!e)return 0;for(;Or(r(t),ca);){if(++e>6)return 0;t++}return t}function Fr(e,t){let r=0;if(e===null||e.type!==1||!ye(e.value,0,Hl)||(e=t(++r),e===null))return 0;if(Or(e,Ul))return e=t(++r),e===null?0:e.type===1?Kt(bt(e,0,!0),++r,t):Or(e,ca)?Kt(1,++r,t):0;if(e.type===10){let n=bt(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!Gl(e,la)||!bt(e,1,!1)?0:r+1:Kt(n,r,t))}return e.type===12?Kt(bt(e,1,!0),++r,t):0}var Rr=["calc(","-moz-calc(","-webkit-calc("],Mr=["min(","max(","clamp("],Br=["round(","mod(","rem("],Yl=["sin(","cos(","tan("],Kl=["asin(","acos(","atan(","atan2("],Vl=["pow(","sqrt(","log(","exp(","sign("],_r=["hypot("],Wr=["abs("],ua=[...Rr,...Mr,...Br,...Yl,...Vl,..._r,...Wr],Ql=[...Rr,...Mr,...Br,..._r,...Wr],ve=[...Rr,...Mr,...Br,...Kl,..._r,...Wr],qr=new Map([[2,22],[21,22],[19,20],[23,24]]);function pe(e,t){return t<e.length?e.charCodeAt(t):0}function pa(e,t){return xe(e,0,e.length,t)}function ha(e,t){for(let r=0;r<t.length;r++)if(pa(e,t[r]))return!0;return!1}functi
|
||
|
|
`+t+`
|
||
|
|
--`+new Array((r||t.length)+1).join("-")+"^"})}var xc=9,kc=10,wc=12,vc=13,Sc=32,ba=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),$t=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(t=this.charCode()){return t<128&&ba[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==vc&&r!==kc&&r!==wc&&r!==Sc&&r!==xc)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new Xt(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r>=128||ba[r]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r<48||r>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}};var Cc=9,Tc=10,Lc=12,Ac=13,Ec=32,Ca=33,Gr=35,ya=38,Zt=39,Ta=40,La=41,Aa=42,Yr=43,Kr=44,xa=45,Vr=60,Ur=62,Jt=63,zc=64,yt=91,Ze=93,er=123,ka=124,Hr=125,wa=8734,va={" ":1,"&&":2,"||":3,"|":4};function Sa(e){let t=null,r=null;return e.eat(er),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Kr?(e.pos++,e.skipWs(),e.charCode()!==Hr&&(r=e.scanNumber(e),e.skipWs())):r=t,e.eat(Hr),{min:Number(t),max:r?Number(r):0}}function Pc(e){let t=null,r=!1;switch(e.charCode()){case Aa:e.pos++,t={min:0,max:0};break;case Yr:e.pos++,t={min:1,max:0};break;case Jt:e.pos++,t={min:0,max:1};break;case Gr:e.pos++,r=!0,e.charCode()===er?t=Sa(e):e.charCode()===Jt?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case er:t=Sa(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Ce(e,t){let r=Pc(e);return r!==null?(r.term=t,e.charCode()===Gr&&e.charCodeAt(e.pos-1)===Yr||e.charCode()===Jt&&e.charCodeAt(e.pos-1)===Hr?Ce(e,r):r):t}function jr(e){let t=e.peek();return t===""?null:Ce(e,{type:"Token",value:t})}function Ic(e){let t;return e.eat(Vr),e.eat(Zt),t=e.scanWord(),e.eat(Zt),e.eat(Ur),Ce(e,{type:"Property",name:t})}function Nc(e){let t=null,r=null,n=1;return e.eat(yt),e.charCode()===xa&&(e.peek(),n=-1),n==-1&&e.charCode()===wa?e.peek():(t=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Kr),e.skipWs(),e.charCode()===wa?e.peek():(n=1,e.charCode()===xa&&(e.peek(),n=-1),r=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(r+=e.scanWord())),e.eat(Ze),{type:"Range",min:t,max:r}}function Dc(e){let t,r=null;if(e.eat(Vr),t=e.scanWord(),t==="boolean-expr"){e.eat(yt);let n=tr(e,Ze);return e.eat(Ze),e.eat(Ur),Ce(e,{type:"Boolean",term:n.terms.length===1?n.terms[0]:n})}return e.charCode()===Ta&&e.nextCharCode()===La&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===yt&&(e.skipWs(),r=Nc(e)),e.eat(Ur),Ce(e,{type:"Type",name:t,opts:r})}function Oc(e){let t=e.scanWord();return e.charCode()===Ta?(e.pos++,{type:"Function",name:t}):Ce(e,{type:"Keyword",name:t})}function Fc(e,t){function r(i,o){return{type:"Group",terms:i,combinator:o,disallowEmpty:!1,explicit:!1}}let n;for(t=Object.keys(t).sort((i,o)=>va[i]-va[o]);t.length>0;){n=t.shift();let i=0,o=0;for(;i<e.length;i++){let a=e[i];a.type==="Combinator"&&(a.value===n?(o===-1&&(o=i-1),e.splice(i,1),i--):(o!==-1&&i-o>1&&(e.splice(o,i-o,r(e.slice(o,i),n)),i=o+1),o=-1))}o!==-1&&t.length&&e.splice(o,i-o,r(e.slice(o,i),n))}return n}function tr(e,t=-1){let r=Object.create(null),n=[],i=null,o=e.pos,a=!1;for(;e.charCode()!==t;){let c=a?tr(e,La):Mc(e);if(!c)break;if
|