| line no. | first char | length | text | ",t+="
|---|---|---|---|
| ${e.lineNo}`,t+=` | ${e.beginChar}`,t+=` | ${e.length}`,t+=` | ${f(i.chars,e.beginChar,e.length)}`,t+=" | ",t+="
f&&(f=e.max);break;default:throw new Error("generateSource: unrecognized opcode")}}))})),m.sort(),i.length>0&&(i.forEach((e=>{y.push(e.lower)})),y.sort()),u+="// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved display mode: ${r} legend: \n`,e+="†original ABNF operators: ${new Date}
\n",u+="// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
\n",u+="//\n",u+="// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)\n",s?s.funcName?u+=`const ${s.funcName} = function grammar(){\n`:u+=l?"export function grammar(){\n":d?"export default function grammar(){\n":"module.exports = function grammar(){\n":u+="module.exports = function grammar(){\n",u+=" // ```\n",u+=" // SUMMARY\n",u+=` // rules = ${r.length}\n`,u+=` // udts = ${i.length}\n`,u+=` // opcodes = ${h}\n`,u+=" // --- ABNF original opcodes\n",u+=` // ALT = ${b}\n`,u+=` // CAT = ${v}\n`,u+=` // REP = ${E}\n`,u+=` // RNM = ${w}\n`,u+=` // TLS = ${_}\n`,u+=` // TBS = ${T}\n`,u+=` // TRG = ${k}\n`,u+=" // --- SABNF superset opcodes\n",u+=` // UDT = ${x}\n`,u+=` // AND = ${S}\n`,u+=` // NOT = ${A}\n`,d||(u+=` // BKA = ${P}\n`,u+=` // BKN = ${O}\n`,u+=` // BKR = ${C}\n`,u+=` // ABG = ${I}\n`,u+=` // AEN = ${M}\n`),u+=" // characters = [",u+=_+T+k===0?" none defined ]":`${p} - ${f}]`,x>0&&(u+=" + user defined"),u+="\n",u+=" // ```\n",u+=" /* OBJECT IDENTIFIER (for internal parser use) */\n",u+=" this.grammarObject = 'grammarObject';\n",u+="\n",u+=" /* RULES */\n",u+=" this.rules = [];\n",r.forEach(((e,t)=>{let n=" this.rules[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* UDTS */\n",u+=" this.udts = [];\n",i.length>0&&i.forEach(((e,t)=>{let n=" this.udts[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", empty: ",n+=e.empty,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* OPCODES */\n",r.forEach(((e,t)=>{t>0&&(u+="\n"),u+=` /* ${e.name} */\n`,u+=` this.rules[${t}].opcodes = [];\n`,e.opcodes.forEach(((e,s)=>{let o;switch(e.type){case n.ALT:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, children: [${e.children.toString()}] };// ALT\n`;break;case n.CAT:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, children: [${e.children.toString()}] };// CAT\n`;break;case n.RNM:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, index: ${e.index} };// RNM(${r[e.index].name})\n`;break;case n.BKR:e.index>=r.length?(a=i[e.index-r.length].name,c=i[e.index-r.length].lower):(a=r[e.index].name,c=r[e.index].lower),o="%i",e.bkrCase===n.BKR_MODE_CS&&(o="%s"),e.bkrMode===n.BKR_MODE_UM?o+="%u":o+="%p",a=o+a,u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, index: ${e.index}, lower: '${c}', bkrCase: ${e.bkrCase}, bkrMode: ${e.bkrMode} };// BKR(\\${a})\n`;break;case n.UDT:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, empty: ${e.empty}, index: ${e.index} };// UDT(${i[e.index].name})\n`;break;case n.REP:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// REP\n`;break;case n.AND:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// AND\n`;break;case n.NOT:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// NOT\n`;break;case n.ABG:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// ABG(%^)\n`;break;case n.AEN:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// AEN(%$)\n`;break;case n.BKA:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// BKA\n`;break;case n.BKN:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type} };// BKN\n`;break;case n.TLS:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, string: [${e.string.toString()}] };// TLS\n`;break;case n.TBS:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, string: [${e.string.toString()}] };// TBS\n`;break;case n.TRG:u+=` this.rules[${t}].opcodes[${s}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// TRG\n`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}}))})),u+="\n",u+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",u+=" this.toString = function toString(){\n",u+=' let str = "";\n',t.forEach((t=>{const n=t.beginChar+t.length;g="",u+=' str += "';for(let r=t.beginChar;r",n+=` \n",n},y=function(){let e="";return e+=m("ALT",o[t.ALT]),e+=m("CAT",o[t.CAT]),e+=m("REP",o[t.REP]),e+=m("RNM",o[t.RNM]),e+=m("TRG",o[t.TRG]),e+=m("TBS",o[t.TBS]),e+=m("TLS",o[t.TLS]),e+=m("UDT",o[t.UDT]),e+=m("AND",o[t.AND]),e+=m("NOT",o[t.NOT]),e+=m("BKR",o[t.BKR]),e+=m("BKA",o[t.BKA]),e+=m("BKN",o[t.BKN]),e+=m("ABG",o[t.ABG]),e+=m("AEN",o[t.AEN]),e+=m("totals",a),e},g=function(){let e="";e+="${e} `,n+=`${t.empty} `,n+=`${t.match} `,n+=`${t.nomatch} `,n+=`${t.total} `,n+=" \n",e+=" \n";for(let t=0;trules ",e+=` \n");if(s.length>0){e+="${c[t].name} `,e+=`${c[t].empty} `,e+=`${c[t].match} `,e+=`${c[t].nomatch} `,e+=`${c[t].total} `,e+=" \n",e+=" \n";for(let t=0;tudts ",e+=` \n")}return e};this.validate=function(e){let t=!1;return"string"==typeof e&&"stats"===e&&(t=!0),t},this.init=function(e,n){i=e,s=n,function(){o.length=0,a=new p,o[t.ALT]=new p,o[t.CAT]=new p,o[t.REP]=new p,o[t.RNM]=new p,o[t.TRG]=new p,o[t.TBS]=new p,o[t.TLS]=new p,o[t.UDT]=new p,o[t.AND]=new p,o[t.NOT]=new p,o[t.BKR]=new p,o[t.BKA]=new p,o[t.BKN]=new p,o[t.ABG]=new p,o[t.AEN]=new p,c.length=0;for(let e=0;e${u[t].name} `,e+=`${u[t].empty} `,e+=`${u[t].match} `,e+=`${u[t].nomatch} `,e+=`${u[t].total} `,e+=" \n`;for(;;){if(void 0===e){n+=y();break}if(null===e){n+=y();break}if("ops"===e){n+=y();break}if("index"===e){c.sort(h),u.length>0&&u.sort(h),n+=y(),n+=g();break}if("hits"===e){c.sort(d),u.length>0&&u.sort(h),n+=y(),n+=g();break}if("alpha"===e){c.sort(l),u.length>0&&u.sort(l),n+=y(),n+=g();break}break}return n+="\n",n},this.toHtmlPage=function(e,t,r){return n.htmlToPage(this.toHtml(e,t),r)}}},{"./identifiers":374,"./style":378,"./utilities":380}],378:[function(e,t,n){t.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}},{}],379:[function(e,t,n){t.exports=function(){const t=e("./utilities"),n=e("./style"),r=new(e("./circular-buffer")),i=e("./identifiers"),s="trace.js: ",o=this,a=16,c=80,u=[];let l=5e3,d=-1,h=0,p=0;const f=[];let m=null,y=null,g=null;const b=[],v=[],w=`•`,x=`…`,E=`𝜺`;this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(e,t){d=-1,"number"==typeof e&&e>0?(l=Math.ceil(e),"number"==typeof t&&(d=Math.floor(t),d<0&&(d=-1))):l=0},this.getMaxRecords=function(){return l},this.getLastRecord=function(){return d},this.init=function(e,t,n){u.length=0,f.length=0,h=0,p=0,m=n,y=e,g=t,function(){const e=function(e){b[i.ALT]=e,b[i.CAT]=e,b[i.REP]=e,b[i.TLS]=e,b[i.TBS]=e,b[i.TRG]=e,b[i.AND]=e,b[i.NOT]=e,b[i.BKR]=e,b[i.BKA]=e,b[i.BKN]=e,b[i.ABG]=e,b[i.AEN]=e};let t=0;for(const e in o.filter.operators)t+=1;if(0!==t){for(const t in o.filter.operators){const n=t.toUpperCase();if("ops \n`,n+=`EMPTY \n`,n+=`MATCH \n`,n+=`NOMATCH \n`,n+=`totals \n",r.forEach((r=>{const v=u[r];switch(s=v.thisLine,l=void 0!==v.thatLine?v.thatLine:"--",d=!1,h=!1,p=!1,v.lookAround===i.LOOKAROUND_AHEAD&&(d=!0,p=!0,f=v.lookAnchor),v.opcode.type!==i.AND&&v.opcode.type!==i.NOT||(d=!0,p=!0,f=v.phraseIndex),v.lookAround===i.LOOKAROUND_BEHIND&&(h=!0,p=!0,f=v.lookAnchor),v.opcode.type!==i.BKA&&v.opcode.type!==i.BKN||(h=!0,p=!0,f=v.phraseIndex),b+="(a) (b) (c) (d) (e) (f) ",b+="operator phrase ",b+=` \n"})),b+="${s} ${l} `,b+=`${v.phraseIndex} `,b+=`${v.phraseLength} `,b+=`${v.depth} `,b+="",v.state){case i.ACTIVE:b+=`↓ `;break;case i.MATCH:b+=`↑M`;break;case i.NOMATCH:b+=`↑N`;break;case i.EMPTY:b+=`↑E`;break;default:b+=`--`}if(b+=" ",b+="",b+=o.indent(v.depth),d?b+=``:h&&(b+=``),b+=t.opcodeToString(v.opcode.type),v.opcode.type===i.RNM&&(b+=`(${y[v.opcode.index].name}) `),v.opcode.type===i.BKR){const e=v.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",t=v.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";b+=`(\\${e}${t}${y[v.opcode.index].name}) `}v.opcode.type===i.UDT&&(b+=`(${g[v.opcode.index].name}) `),v.opcode.type===i.TRG&&(b+=`(${function(e,t){let n="";if(t.type===i.TRG)if(e===a||32===e){let r=t.min.toString(16).toUpperCase();r.length%2!=0&&(r=`0${r}`),n+=e===a?"%x":"U+",n+=r,r=t.max.toString(16).toUpperCase(),r.length%2!=0&&(r=`0${r}`),n+=`–${r}`}else n=`%d${t.min.toString(10)}–${t.max.toString(10)}`;return n}(e,v.opcode)}) `),v.opcode.type===i.TBS&&(b+=`(${function(e,t){let n="";if(t.type===i.TBS){const r=Math.min(t.string.length,10);if(e===a||32===e){n+=e===a?"%x":"U+";for(let e=0;e ",b+="",b+=h?function(e,t,r,s,o,a){let u,l,d,h,p="",f=w;const m=``,y=``,g="";let b=!1;switch(r){case i.EMPTY:p+=E;case i.NOMATCH:case i.MATCH:case i.ACTIVE:u=s-o,l=a-u,d=a,h=t.length-d;break;default:throw new Error("unrecognized state")}return f=w,l>c?(l=c,f=x,h=0):l+h>c&&(f=x,h=c-l),l>0&&(p+=m,p+=_(e,t,u,l,b),p+=g,b=!0),h>0&&(p+=y,p+=_(e,t,d,h,b),p+=g),p+f}(e,m,v.state,v.phraseIndex,v.phraseLength,f):d?function(e,t,r,i,s){const o=``;return T(e,t,r,i,s,o)}(e,m,v.state,v.phraseIndex,v.phraseLength):function(e,t,r,i,s){const o=``;return T(e,t,r,i,s,o)}(e,m,v.state,v.phraseIndex,v.phraseLength),b+=" \n",b+="\n",b};this.toHtml=function(e,t){let r=8;if("string"==typeof e&&e.length>=3){const t=e.toLowerCase().slice(0,3);"hex"===t?r=a:"dec"===t?r=10:"uni"===t&&(r=32)}let i="";return i+=function(e,t){let r;switch(e){case a:r="hexadecimal";break;case 10:r="decimal";break;case 8:r="ASCII";break;case 32:r="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${e}`)}let i="";return i+=`(a) (b) (c) (d) (e) (f) ",b+="operator phrase \n`,"string"==typeof t&&(i+=`
\n",e+=`
\n`,e+="(a) - line number
\n",e+="(b) - matching line number
\n",e+="(c) - phrase offset
\n",e+="(d) - phrase length
\n",e+="(e) - tree depth
\n",e+="(f) - operator state
\n",e+=` - ↓ phrase opened
\n`,e+=` - ↑M phrase matched
\n`,e+=` - ↑E empty phrase matched
\n`,e+=` - ↑N phrase not matched
\n`,e+="operator - ALT, CAT, REP, RNM, TRG, TLS, TBS†, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN‡
\n",e+="phrase - up to 80 characters of the phrase being matched
\n",e+=` - matched characters
\n`,e+=` - matched characters in look ahead mode
\n`,e+=` - matched characters in look behind mode
\n`,e+=` - remainder characters(not yet examined by parser)
\n`,e+=` - control characters, TAB, LF, CR, etc. (ASCII mode only)
\n`,e+=` - ${E} empty string
\n`,e+=` - ${w} end of input string
\n`,e+=` - ${x} input string display truncated
\n`,e+="
\n",e+="ALT - alternation
\n",e+="CAT - concatenation
\n",e+="REP - repetition
\n",e+="RNM - rule name
\n",e+="TRG - terminal range
\n",e+="TLS - terminal literal string (case insensitive)
\n",e+="TBS - terminal binary string (case sensitive)
\n",e+="
\n",e+="‡super set SABNF operators:
\n",e+="UDT - user-defined terminal
\n",e+="AND - positive look ahead
\n",e+="NOT - negative look ahead
\n",e+="BKA - positive look behind
\n",e+="BKN - negative look behind
\n",e+="BKR - back reference
\n",e+="ABG - anchor - begin of input string
\n",e+="AEN - anchor - end of input string
\n",e+="\n`,s&&(a+=`
\n",a},n.charsToString=function(e,t,n){let r,s;if("number"==typeof t){if(t>=e.length)return"";r=t<0?0:t}else r=0;if("number"==typeof n){if(n<=0)return"";s=n>e.length-r?e.length:r+n}else s=e.length;return r \n",a+=`state item value description \n",a+=`parser success ${n} \n`,a+=`true if the parse succeeded,\n`,a+=` false otherwise`,a+="
NOTE: for success, entire string must be matched \n`,a+=`parser state ${i} \n`,a+=`EMPTY, `,a+=`MATCH or \n`,a+=`NOMATCH \n`,a+=`string length ${e.length} length of the input (sub)string \n`,a+=`matched length ${e.matched} number of input string characters matched \n`,a+=`max matched ${e.maxMatched} maximum number of input string characters matched \n`,a+=`max tree depth ${e.maxTreeDepth} maximum depth of the parse tree reached \n`,a+=`node hits ${e.nodeHits} number of parse tree node hits (opcode function calls) \n`,a+=`input length ${e.inputLength} length of full input string \n`,a+=`sub-string begin ${e.subBegin} sub-string first character index \n`,a+=`sub-string end ${e.subEnd} sub-string end-of-string index \n`,a+="sub-string length ${e.subLength} sub-string length i.beg){r+=e[i.beg];for(let t=i.beg+1;t=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(r=(e.length-t)%2==0?t+1:t;r>>=1)i++;return 1<>>=13,n[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,n+=s/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;no)for(this.length-=o,u=0;ue.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,s){return t=+t,n>>>=0,s||j(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,s){return t=+t,n>>>=0,s||j(e,0,n,8),i.write(e,t,n,r,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t=55296&&t<=56319&&i65535&&(t+=A((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=A(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function I(e,t,n){var r=0;for(e=n?S(e/f):e>>1,e+=S(e/t);e>E*h>>1;r+=l)e=S(e/E);return S(r+(E+1)*e/(e+p))}function M(e){var t,n,r,i,s,o,a,c,p,f,b,v=[],w=e.length,x=0,E=y,A=m;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},s.rgb.lab=function(e){const t=s.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},s.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,s,o;if(0===n)return o=255*r,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;const a=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)s=t+1/3*-(e-1),s<0&&s++,s>1&&s--,o=6*s<1?a+6*(i-a)*s:2*s<1?i:3*s<2?a+(i-a)*(2/3-s)*6:a,c[e]=255*o;return c},s.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;return[t,100*(0===r?2*i/(s+i):2*n/(r+n)),100*((r+n)/2)]},s.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),c=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,c,o];case 1:return[a,r,o];case 2:return[o,r,c];case 3:return[o,a,r];case 4:return[c,o,r];case 5:return[r,o,a]}},s.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let s,o;o=(2-n)*r;const a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,100*s,100*o]},s.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let s;i>1&&(n/=i,r/=i);const o=Math.floor(6*t),a=1-r;s=6*t-o,1&o&&(s=1-s);const c=n+s*(a-n);let u,l,d;switch(o){default:case 6:case 0:u=a,l=c,d=n;break;case 1:u=c,l=a,d=n;break;case 2:u=n,l=a,d=c;break;case 3:u=n,l=c,d=a;break;case 4:u=c,l=n,d=a;break;case 5:u=a,l=n,d=c}return[255*u,255*l,255*d]},s.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},s.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,s,o;return i=3.2406*t+-1.5372*n+-.4986*r,s=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[255*i,255*s,255*o]},s.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},s.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,s=t**3,o=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},s.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},s.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},s.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?s.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])},s.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},s.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},s.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},s.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},s.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},s.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),o=i-s;let a,c;return a=o<1?s/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[360*c,100*o,100*a]},s.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},s.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},s.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],s=t%1*6,o=s%1,a=1-o;let c=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return c=(1-n)*r,[255*(n*i[0]+c),255*(n*i[1]+c),255*(n*i[2]+c)]},s.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},s.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},s.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},s.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},s.gray.hsl=function(e){return[0,0,e[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(e){return[0,100,e[0]]},s.gray.cmyk=function(e){return[0,0,0,e[0]]},s.gray.lab=function(e){return[e[0],0,0]},s.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},s.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},{"color-name":421}],419:[function(e,t,n){const r=e("./conversions"),i=e("./route"),s={};Object.keys(r).forEach((e=>{s[e]={},Object.defineProperty(s[e],"channels",{value:r[e].channels}),Object.defineProperty(s[e],"labels",{value:r[e].labels});const t=i(e);Object.keys(t).forEach((n=>{const r=t[n];s[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t0){if(a.match(/^#/))continue;if(o=a.match(/^(.*)=(.*)$/))n.variables[o[1]]=o[2];else{var c=null;try{c=i._parseEntry("0 "+a),n.expressions.push(c.interval)}catch(e){n.errors[a]=e}}}}return n},i.parseFile=function(t,n){e("fs").readFile(t,(function(e,t){if(!e)return n(null,i.parseString(t.toString()));n(e)}))},t.exports=i},{"./expression":423,fs:384}],427:[function(e,t,n){var r=1e3,i=60*r,s=60*i,o=24*s,a=7*o,c=365.25*o;function u(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"weeks":case"week":case"w":return n*a;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=s)return u(e,t,s,"hour");if(t>=i)return u(e,t,i,"minute");if(t>=r)return u(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=s)return Math.round(e/s)+"h";if(t>=i)return Math.round(e/i)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],428:[function(e,t,n){(function(r){(function(){n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),e.splice(i,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":429,_process:510}],429:[function(e,t,n){t.exports=function(t){function n(e){let t,i,s,o=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),s=i-(t||i);r.diff=s,r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,i)=>{if("%%"===t)return"%";o++;const s=n.formatters[i];if("function"==typeof s){const n=e[o];t=s.call(r,n),e.splice(o,1),o--}return t})),n.formatArgs.call(r,e);(r.log||n.log).apply(r,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=r,a.destroy=n.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==n.namespaces&&(i=n.namespaces,s=n.enabled(e)),s),set:e=>{o=e}}),"function"==typeof n.init&&n.init(a),a}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(t=0;t{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n>i&s),a=Number(n&s),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,a,r)}(n,s-8,BigInt(8*this.length),o),this.process(n,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e