UNPKG

discord-user-card

Version:

Display Discord users' profile cards just like in Discord.

18 lines (14 loc) 1.74 MB
"use strict";var tl=Object.defineProperty;var sl=(t,e,s)=>e in t?tl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var B=(t,e,s)=>sl(t,typeof e!="symbol"?e+"":e,s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("@discord-user-card/core");function nl(t){return Object.entries(t).filter(([,e])=>e).map(([e])=>e).join(" ")}function ol(t){return Object.entries(t).filter(([,e])=>e!==void 0).map(([e,s])=>`${e}: ${s};`).join(" ")}function D(t,e){const s=t.getAttribute("class")||"",n=nl(e);s!==n&&t.setAttribute("class",n)}function Ae(t,e){const s=t.getAttribute("style")||"",n=ol(e);s!==n&&t.setAttribute("style",n)}function O(t,e){for(const s of Array.from(t.attributes))e.includes(s.name)||t.removeAttribute(s.name)}function v(t,e){!t||!e||t.contains(e)||t.appendChild(e)}function V(t,e){!t||!e||t.contains(e)&&t.removeChild(e)}async function je(t,e){for(const s of Object.values(t))s&&"render"in s&&await s.render(e)}function Ue(t,e){for(const s of Object.values(t))s&&"renderSkeleton"in s&&s.renderSkeleton(e)}function ke(t){if(t)for(const e of Object.values(t))e&&"destroy"in e&&e.destroy()}function z_(t){return t.avatar?ct(t.avatar)?t.avatar:q.imageToUrl({image:q.mapDiscordImageHash(t.avatar),scope:"avatars",relatedId:t.id,animation:document.hasFocus()&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}):q.discrimToAvatar(t.id,t.discriminator)}function zr(t){if(t.banner)return ct(t.banner)?t.banner:q.imageToUrl({image:q.mapDiscordImageHash(t.banner),scope:"banners",relatedId:t.id,animation:document.hasFocus()&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches})}async function rl(t){if(!t.bannerColor)return al(t);const[e,s,n]=q.ColorUtils.intToRgb(t.bannerColor);return`rgb(${e}, ${s}, ${n})`}async function al(t){const[e]=await q.getColorFromImage(z_(t));return`rgb(${e[0]}, ${e[1]}, ${e[2]})`}function il(t){const{status:e}=t;return e===q.PresenceUpdateStatus.Online?{status:e,color:"#23a55a"}:e===q.PresenceUpdateStatus.Idle?{status:e,color:"#f0b232"}:e===q.PresenceUpdateStatus.DoNotDisturb?{status:e,color:"#f23f43"}:{status:q.PresenceUpdateStatus.Offline,color:"#80848e"}}function cl(t){const e=q.mapDiscordImageHash(t.avatarDecoration);if(e)return q.imageToUrl({image:e,scope:"avatar-decoration-presets",relatedId:t.id,animation:document.hasFocus()&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches})}function ct(t){try{return new URL(t),!0}catch{return!1}}const qe="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",st=(t,e=0,s=1)=>Ir(Ar(e,t),s),Or=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=st(t[e],0,255)):e===3&&(t[e]=st(t[e],0,1));return t},V_={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])V_[`[object ${t}]`]=t.toLowerCase();function ce(t){return V_[Object.prototype.toString.call(t)]||"object"}const _e=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):ce(t[0])=="object"&&e?e.split("").filter(s=>t[0][s]!==void 0).map(s=>t[0][s]):t[0],Ct=t=>{if(t.length<2)return null;const e=t.length-1;return ce(t[e])=="string"?t[e].toLowerCase():null},{PI:wt,min:Ir,max:Ar}=Math,He=wt*2,It=wt/3,_l=wt/180,dl=180/wt,re={format:{},autodetect:[]};class j{constructor(...e){const s=this;if(ce(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=Ct(e),o=!1;if(!n){o=!0,re.sorted||(re.autodetect=re.autodetect.sort((r,a)=>a.p-r.p),re.sorted=!0);for(let r of re.autodetect)if(n=r.test(...e),n)break}if(re.format[n]){const r=re.format[n].apply(null,o?e:e.slice(0,-1));s._rgb=Or(r)}else throw new Error("unknown format: "+e);s._rgb.length===3&&s._rgb.push(1)}toString(){return ce(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const ll="2.6.0",Z=(...t)=>new Z.Color(...t);Z.Color=j;Z.version=ll;const gl=(...t)=>{t=_e(t,"cmyk");const[e,s,n,o]=t,r=t.length>4?t[4]:1;return o===1?[0,0,0,r]:[e>=1?0:255*(1-e)*(1-o),s>=1?0:255*(1-s)*(1-o),n>=1?0:255*(1-n)*(1-o),r]},{max:Vr}=Math,ml=(...t)=>{let[e,s,n]=_e(t,"rgb");e=e/255,s=s/255,n=n/255;const o=1-Vr(e,Vr(s,n)),r=o<1?1/(1-o):0,a=(1-e-o)*r,i=(1-s-o)*r,c=(1-n-o)*r;return[a,i,c,o]};j.prototype.cmyk=function(){return ml(this._rgb)};Z.cmyk=(...t)=>new j(...t,"cmyk");re.format.cmyk=gl;re.autodetect.push({p:2,test:(...t)=>{if(t=_e(t,"cmyk"),ce(t)==="array"&&t.length===4)return"cmyk"}});const At=t=>Math.round(t*100)/100,pl=(...t)=>{const e=_e(t,"hsla");let s=Ct(t)||"lsa";return e[0]=At(e[0]||0),e[1]=At(e[1]*100)+"%",e[2]=At(e[2]*100)+"%",s==="hsla"||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,s="hsla"):e.length=3,`${s}(${e.join(",")})`},W_=(...t)=>{t=_e(t,"rgba");let[e,s,n]=t;e/=255,s/=255,n/=255;const o=Ir(e,s,n),r=Ar(e,s,n),a=(r+o)/2;let i,c;return r===o?(i=0,c=Number.NaN):i=a<.5?(r-o)/(r+o):(r-o)/(2-r-o),e==r?c=(s-n)/(r-o):s==r?c=2+(n-e)/(r-o):n==r&&(c=4+(e-s)/(r-o)),c*=60,c<0&&(c+=360),t.length>3&&t[3]!==void 0?[c,i,a,t[3]]:[c,i,a]},{round:kt}=Math,ul=(...t)=>{const e=_e(t,"rgba");let s=Ct(t)||"rgb";return s.substr(0,3)=="hsl"?pl(W_(e),s):(e[0]=kt(e[0]),e[1]=kt(e[1]),e[2]=kt(e[2]),(s==="rgba"||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,s="rgba"),`${s}(${e.slice(0,s==="rgb"?3:4).join(",")})`)},{round:Mt}=Math,Rr=(...t)=>{t=_e(t,"hsl");const[e,s,n]=t;let o,r,a;if(s===0)o=r=a=n*255;else{const i=[0,0,0],c=[0,0,0],_=n<.5?n*(1+s):n+s-n*s,d=2*n-_,l=e/360;i[0]=l+1/3,i[1]=l,i[2]=l-1/3;for(let g=0;g<3;g++)i[g]<0&&(i[g]+=1),i[g]>1&&(i[g]-=1),6*i[g]<1?c[g]=d+(_-d)*6*i[g]:2*i[g]<1?c[g]=_:3*i[g]<2?c[g]=d+(_-d)*(2/3-i[g])*6:c[g]=d;[o,r,a]=[Mt(c[0]*255),Mt(c[1]*255),Mt(c[2]*255)]}return t.length>3?[o,r,a,t[3]]:[o,r,a,1]},$_=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,K_=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,Q_=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,X_=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Z_=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,J_=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:Wr}=Math,kr=t=>{t=t.toLowerCase().trim();let e;if(re.format.named)try{return re.format.named(t)}catch{}if(e=t.match($_)){const s=e.slice(1,4);for(let n=0;n<3;n++)s[n]=+s[n];return s[3]=1,s}if(e=t.match(K_)){const s=e.slice(1,5);for(let n=0;n<4;n++)s[n]=+s[n];return s}if(e=t.match(Q_)){const s=e.slice(1,4);for(let n=0;n<3;n++)s[n]=Wr(s[n]*2.55);return s[3]=1,s}if(e=t.match(X_)){const s=e.slice(1,5);for(let n=0;n<3;n++)s[n]=Wr(s[n]*2.55);return s[3]=+s[3],s}if(e=t.match(Z_)){const s=e.slice(1,4);s[1]*=.01,s[2]*=.01;const n=Rr(s);return n[3]=1,n}if(e=t.match(J_)){const s=e.slice(1,4);s[1]*=.01,s[2]*=.01;const n=Rr(s);return n[3]=+e[4],n}};kr.test=t=>$_.test(t)||K_.test(t)||Q_.test(t)||X_.test(t)||Z_.test(t)||J_.test(t);j.prototype.css=function(t){return ul(this._rgb,t)};Z.css=(...t)=>new j(...t,"css");re.format.css=kr;re.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&ce(t)==="string"&&kr.test(t))return"css"}});re.format.gl=(...t)=>{const e=_e(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};Z.gl=(...t)=>new j(...t,"gl");j.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};const{floor:hl}=Math,El=(...t)=>{t=_e(t,"hcg");let[e,s,n]=t,o,r,a;n=n*255;const i=s*255;if(s===0)o=r=a=n;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const c=hl(e),_=e-c,d=n*(1-s),l=d+i*(1-_),g=d+i*_,m=d+i;switch(c){case 0:[o,r,a]=[m,g,d];break;case 1:[o,r,a]=[l,m,d];break;case 2:[o,r,a]=[d,m,g];break;case 3:[o,r,a]=[d,l,m];break;case 4:[o,r,a]=[g,d,m];break;case 5:[o,r,a]=[m,d,l];break}}return[o,r,a,t.length>3?t[3]:1]},fl=(...t)=>{const[e,s,n]=_e(t,"rgb"),o=Ir(e,s,n),r=Ar(e,s,n),a=r-o,i=a*100/255,c=o/(255-a)*100;let _;return a===0?_=Number.NaN:(e===r&&(_=(s-n)/a),s===r&&(_=2+(n-e)/a),n===r&&(_=4+(e-s)/a),_*=60,_<0&&(_+=360)),[_,i,c]};j.prototype.hcg=function(){return fl(this._rgb)};Z.hcg=(...t)=>new j(...t,"hcg");re.format.hcg=El;re.autodetect.push({p:1,test:(...t)=>{if(t=_e(t,"hcg"),ce(t)==="array"&&t.length===3)return"hcg"}});const bl=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Sl=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ed=t=>{if(t.match(bl)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),s=e>>16,n=e>>8&255,o=e&255;return[s,n,o,1]}if(t.match(Sl)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),s=e>>24&255,n=e>>16&255,o=e>>8&255,r=Math.round((e&255)/255*100)/100;return[s,n,o,r]}throw new Error(`unknown hex color: ${t}`)},{round:pt}=Math,td=(...t)=>{let[e,s,n,o]=_e(t,"rgba"),r=Ct(t)||"auto";o===void 0&&(o=1),r==="auto"&&(r=o<1?"rgba":"rgb"),e=pt(e),s=pt(s),n=pt(n);let i="000000"+(e<<16|s<<8|n).toString(16);i=i.substr(i.length-6);let c="0"+pt(o*255).toString(16);switch(c=c.substr(c.length-2),r.toLowerCase()){case"rgba":return`#${i}${c}`;case"argb":return`#${c}${i}`;default:return`#${i}`}};j.prototype.hex=function(t){return td(this._rgb,t)};Z.hex=(...t)=>new j(...t,"hex");re.format.hex=ed;re.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&ce(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{cos:Je}=Math,yl=(...t)=>{t=_e(t,"hsi");let[e,s,n]=t,o,r,a;return isNaN(e)&&(e=0),isNaN(s)&&(s=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(a=(1-s)/3,o=(1+s*Je(He*e)/Je(It-He*e))/3,r=1-(a+o)):e<2/3?(e-=1/3,o=(1-s)/3,r=(1+s*Je(He*e)/Je(It-He*e))/3,a=1-(o+r)):(e-=2/3,r=(1-s)/3,a=(1+s*Je(He*e)/Je(It-He*e))/3,o=1-(r+a)),o=st(n*o*3),r=st(n*r*3),a=st(n*a*3),[o*255,r*255,a*255,t.length>3?t[3]:1]},{min:vl,sqrt:Tl,acos:Cl}=Math,wl=(...t)=>{let[e,s,n]=_e(t,"rgb");e/=255,s/=255,n/=255;let o;const r=vl(e,s,n),a=(e+s+n)/3,i=a>0?1-r/a:0;return i===0?o=NaN:(o=(e-s+(e-n))/2,o/=Tl((e-s)*(e-s)+(e-n)*(s-n)),o=Cl(o),n>s&&(o=He-o),o/=He),[o*360,i,a]};j.prototype.hsi=function(){return wl(this._rgb)};Z.hsi=(...t)=>new j(...t,"hsi");re.format.hsi=yl;re.autodetect.push({p:2,test:(...t)=>{if(t=_e(t,"hsi"),ce(t)==="array"&&t.length===3)return"hsi"}});j.prototype.hsl=function(){return W_(this._rgb)};Z.hsl=(...t)=>new j(...t,"hsl");re.format.hsl=Rr;re.autodetect.push({p:2,test:(...t)=>{if(t=_e(t,"hsl"),ce(t)==="array"&&t.length===3)return"hsl"}});const{floor:Rl}=Math,Dl=(...t)=>{t=_e(t,"hsv");let[e,s,n]=t,o,r,a;if(n*=255,s===0)o=r=a=n;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const i=Rl(e),c=e-i,_=n*(1-s),d=n*(1-s*c),l=n*(1-s*(1-c));switch(i){case 0:[o,r,a]=[n,l,_];break;case 1:[o,r,a]=[d,n,_];break;case 2:[o,r,a]=[_,n,l];break;case 3:[o,r,a]=[_,d,n];break;case 4:[o,r,a]=[l,_,n];break;case 5:[o,r,a]=[n,_,d];break}}return[o,r,a,t.length>3?t[3]:1]},{min:Nl,max:Ol}=Math,Il=(...t)=>{t=_e(t,"rgb");let[e,s,n]=t;const o=Nl(e,s,n),r=Ol(e,s,n),a=r-o;let i,c,_;return _=r/255,r===0?(i=Number.NaN,c=0):(c=a/r,e===r&&(i=(s-n)/a),s===r&&(i=2+(n-e)/a),n===r&&(i=4+(e-s)/a),i*=60,i<0&&(i+=360)),[i,c,_]};j.prototype.hsv=function(){return Il(this._rgb)};Z.hsv=(...t)=>new j(...t,"hsv");re.format.hsv=Dl;re.autodetect.push({p:2,test:(...t)=>{if(t=_e(t,"hsv"),ce(t)==="array"&&t.length===3)return"hsv"}});const xe={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},{pow:Al}=Math,sd=(...t)=>{t=_e(t,"lab");const[e,s,n]=t;let o,r,a,i,c,_;return r=(e+16)/116,o=isNaN(s)?r:r+s/500,a=isNaN(n)?r:r-n/200,r=xe.Yn*Lt(r),o=xe.Xn*Lt(o),a=xe.Zn*Lt(a),i=xt(3.2404542*o-1.5371385*r-.4985314*a),c=xt(-.969266*o+1.8760108*r+.041556*a),_=xt(.0556434*o-.2040259*r+1.0572252*a),[i,c,_,t.length>3?t[3]:1]},xt=t=>255*(t<=.00304?12.92*t:1.055*Al(t,1/2.4)-.055),Lt=t=>t>xe.t1?t*t*t:xe.t2*(t-xe.t0),{pow:nd}=Math,od=(...t)=>{const[e,s,n]=_e(t,"rgb"),[o,r,a]=kl(e,s,n),i=116*r-16;return[i<0?0:i,500*(o-r),200*(r-a)]},Pt=t=>(t/=255)<=.04045?t/12.92:nd((t+.055)/1.055,2.4),Ft=t=>t>xe.t3?nd(t,1/3):t/xe.t2+xe.t0,kl=(t,e,s)=>{t=Pt(t),e=Pt(e),s=Pt(s);const n=Ft((.4124564*t+.3575761*e+.1804375*s)/xe.Xn),o=Ft((.2126729*t+.7151522*e+.072175*s)/xe.Yn),r=Ft((.0193339*t+.119192*e+.9503041*s)/xe.Zn);return[n,o,r]};j.prototype.lab=function(){return od(this._rgb)};Z.lab=(...t)=>new j(...t,"lab");re.format.lab=sd;re.autodetect.push({p:2,test:(...t)=>{if(t=_e(t,"lab"),ce(t)==="array"&&t.length===3)return"lab"}});const{sin:Ml,cos:xl}=Math,rd=(...t)=>{let[e,s,n]=_e(t,"lch");return isNaN(n)&&(n=0),n=n*_l,[e,xl(n)*s,Ml(n)*s]},ad=(...t)=>{t=_e(t,"lch");const[e,s,n]=t,[o,r,a]=rd(e,s,n),[i,c,_]=sd(o,r,a);return[i,c,_,t.length>3?t[3]:1]},Ll=(...t)=>{const e=_e(t,"hcl").reverse();return ad(...e)},{sqrt:Pl,atan2:Fl,round:jl}=Math,id=(...t)=>{const[e,s,n]=_e(t,"lab"),o=Pl(s*s+n*n);let r=(Fl(n,s)*dl+360)%360;return jl(o*1e4)===0&&(r=Number.NaN),[e,o,r]},cd=(...t)=>{const[e,s,n]=_e(t,"rgb"),[o,r,a]=od(e,s,n);return id(o,r,a)};j.prototype.lch=function(){return cd(this._rgb)};j.prototype.hcl=function(){return cd(this._rgb).reverse()};Z.lch=(...t)=>new j(...t,"lch");Z.hcl=(...t)=>new j(...t,"hcl");re.format.lch=ad;re.format.hcl=Ll;["lch","hcl"].forEach(t=>re.autodetect.push({p:2,test:(...e)=>{if(e=_e(e,t),ce(e)==="array"&&e.length===3)return t}}));const ot={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};j.prototype.name=function(){const t=td(this._rgb,"rgb");for(let e of Object.keys(ot))if(ot[e]===t)return e.toLowerCase();return t};re.format.named=t=>{if(t=t.toLowerCase(),ot[t])return ed(ot[t]);throw new Error("unknown color name: "+t)};re.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&ce(t)==="string"&&ot[t.toLowerCase()])return"named"}});const Ul=t=>{if(ce(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,s=t>>8&255,n=t&255;return[e,s,n,1]}throw new Error("unknown num color: "+t)},Bl=(...t)=>{const[e,s,n]=_e(t,"rgb");return(e<<16)+(s<<8)+n};j.prototype.num=function(){return Bl(this._rgb)};Z.num=(...t)=>new j(...t,"num");re.format.num=Ul;re.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&ce(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const{round:_d}=Math;j.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(_d)};j.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,s)=>s<3?t===!1?e:_d(e):e)};Z.rgb=(...t)=>new j(...t,"rgb");re.format.rgb=(...t)=>{const e=_e(t,"rgba");return e[3]===void 0&&(e[3]=1),e};re.autodetect.push({p:3,test:(...t)=>{if(t=_e(t,"rgba"),ce(t)==="array"&&(t.length===3||t.length===4&&ce(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const{log:ut}=Math,dd=t=>{const e=t/100;let s,n,o;return e<66?(s=255,n=e<6?0:-155.25485562709179-.44596950469579133*(n=e-2)+104.49216199393888*ut(n),o=e<20?0:-254.76935184120902+.8274096064007395*(o=e-10)+115.67994401066147*ut(o)):(s=351.97690566805693+.114206453784165*(s=e-55)-40.25366309332127*ut(s),n=325.4494125711974+.07943456536662342*(n=e-50)-28.0852963507957*ut(n),o=255),[s,n,o,1]},{round:Gl}=Math,Yl=(...t)=>{const e=_e(t,"rgb"),s=e[0],n=e[2];let o=1e3,r=4e4;const a=.4;let i;for(;r-o>a;){i=(r+o)*.5;const c=dd(i);c[2]/c[0]>=n/s?r=i:o=i}return Gl(i)};j.prototype.temp=j.prototype.kelvin=j.prototype.temperature=function(){return Yl(this._rgb)};Z.temp=Z.kelvin=Z.temperature=(...t)=>new j(...t,"temp");re.format.temp=re.format.kelvin=re.format.temperature=dd;const{pow:ft,sign:ql}=Math,ld=(...t)=>{t=_e(t,"lab");const[e,s,n]=t,o=ft(e+.3963377774*s+.2158037573*n,3),r=ft(e-.1055613458*s-.0638541728*n,3),a=ft(e-.0894841775*s-1.291485548*n,3);return[255*jt(4.0767416621*o-3.3077115913*r+.2309699292*a),255*jt(-1.2684380046*o+2.6097574011*r-.3413193965*a),255*jt(-.0041960863*o-.7034186147*r+1.707614701*a),t.length>3?t[3]:1]};function jt(t){const e=Math.abs(t);return e>.0031308?(ql(t)||1)*(1.055*ft(e,1/2.4)-.055):t*12.92}const{cbrt:Ut,pow:Hl,sign:zl}=Math,gd=(...t)=>{const[e,s,n]=_e(t,"rgb"),[o,r,a]=[Bt(e/255),Bt(s/255),Bt(n/255)],i=Ut(.4122214708*o+.5363325363*r+.0514459929*a),c=Ut(.2119034982*o+.6806995451*r+.1073969566*a),_=Ut(.0883024619*o+.2817188376*r+.6299787005*a);return[.2104542553*i+.793617785*c-.0040720468*_,1.9779984951*i-2.428592205*c+.4505937099*_,.0259040371*i+.7827717662*c-.808675766*_]};function Bt(t){const e=Math.abs(t);return e<.04045?t/12.92:(zl(t)||1)*Hl((e+.055)/1.055,2.4)}j.prototype.oklab=function(){return gd(this._rgb)};Z.oklab=(...t)=>new j(...t,"oklab");re.format.oklab=ld;re.autodetect.push({p:3,test:(...t)=>{if(t=_e(t,"oklab"),ce(t)==="array"&&t.length===3)return"oklab"}});const Vl=(...t)=>{t=_e(t,"lch");const[e,s,n]=t,[o,r,a]=rd(e,s,n),[i,c,_]=ld(o,r,a);return[i,c,_,t.length>3?t[3]:1]},Wl=(...t)=>{const[e,s,n]=_e(t,"rgb"),[o,r,a]=gd(e,s,n);return id(o,r,a)};j.prototype.oklch=function(){return Wl(this._rgb)};Z.oklch=(...t)=>new j(...t,"oklch");re.format.oklch=Vl;re.autodetect.push({p:3,test:(...t)=>{if(t=_e(t,"oklch"),ce(t)==="array"&&t.length===3)return"oklch"}});j.prototype.alpha=function(t,e=!1){return t!==void 0&&ce(t)==="number"?e?(this._rgb[3]=t,this):new j([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};j.prototype.clipped=function(){return this._rgb._clipped||!1};j.prototype.darken=function(t=1){const e=this,s=e.lab();return s[0]-=xe.Kn*t,new j(s,"lab").alpha(e.alpha(),!0)};j.prototype.brighten=function(t=1){return this.darken(-t)};j.prototype.darker=j.prototype.darken;j.prototype.brighter=j.prototype.brighten;j.prototype.get=function(t){const[e,s]=t.split("."),n=this[e]();if(s){const o=e.indexOf(s)-(e.substr(0,2)==="ok"?2:0);if(o>-1)return n[o];throw new Error(`unknown channel ${s} in mode ${e}`)}else return n};const{pow:$l}=Math,Kl=1e-7,Ql=20;j.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&ce(t)==="number"){if(t===0)return new j([0,0,0,this._rgb[3]],"rgb");if(t===1)return new j([255,255,255,this._rgb[3]],"rgb");let s=this.luminance(),n=Ql;const o=(a,i)=>{const c=a.interpolate(i,.5,e),_=c.luminance();return Math.abs(t-_)<Kl||!n--?c:_>t?o(a,c):o(c,i)},r=(s>t?o(new j([0,0,0]),this):o(this,new j([255,255,255]))).rgb();return new j([...r,this._rgb[3]])}return Xl(...this._rgb.slice(0,3))};const Xl=(t,e,s)=>(t=Gt(t),e=Gt(e),s=Gt(s),.2126*t+.7152*e+.0722*s),Gt=t=>(t/=255,t<=.03928?t/12.92:$l((t+.055)/1.055,2.4)),Oe={},_t=(t,e,s=.5,...n)=>{let o=n[0]||"lrgb";if(!Oe[o]&&!n.length&&(o=Object.keys(Oe)[0]),!Oe[o])throw new Error(`interpolation mode ${o} is not defined`);return ce(t)!=="object"&&(t=new j(t)),ce(e)!=="object"&&(e=new j(e)),Oe[o](t,e,s).alpha(t.alpha()+s*(e.alpha()-t.alpha()))};j.prototype.mix=j.prototype.interpolate=function(t,e=.5,...s){return _t(this,t,e,...s)};j.prototype.premultiply=function(t=!1){const e=this._rgb,s=e[3];return t?(this._rgb=[e[0]*s,e[1]*s,e[2]*s,s],this):new j([e[0]*s,e[1]*s,e[2]*s,s],"rgb")};j.prototype.saturate=function(t=1){const e=this,s=e.lch();return s[1]+=xe.Kn*t,s[1]<0&&(s[1]=0),new j(s,"lch").alpha(e.alpha(),!0)};j.prototype.desaturate=function(t=1){return this.saturate(-t)};j.prototype.set=function(t,e,s=!1){const[n,o]=t.split("."),r=this[n]();if(o){const a=n.indexOf(o)-(n.substr(0,2)==="ok"?2:0);if(a>-1){if(ce(e)=="string")switch(e.charAt(0)){case"+":r[a]+=+e;break;case"-":r[a]+=+e;break;case"*":r[a]*=+e.substr(1);break;case"/":r[a]/=+e.substr(1);break;default:r[a]=+e}else if(ce(e)==="number")r[a]=e;else throw new Error("unsupported value for Color.set");const i=new j(r,n);return s?(this._rgb=i._rgb,this):i}throw new Error(`unknown channel ${o} in mode ${n}`)}else return r};j.prototype.tint=function(t=.5,...e){return _t(this,"white",t,...e)};j.prototype.shade=function(t=.5,...e){return _t(this,"black",t,...e)};const Zl=(t,e,s)=>{const n=t._rgb,o=e._rgb;return new j(n[0]+s*(o[0]-n[0]),n[1]+s*(o[1]-n[1]),n[2]+s*(o[2]-n[2]),"rgb")};Oe.rgb=Zl;const{sqrt:Yt,pow:et}=Math,Jl=(t,e,s)=>{const[n,o,r]=t._rgb,[a,i,c]=e._rgb;return new j(Yt(et(n,2)*(1-s)+et(a,2)*s),Yt(et(o,2)*(1-s)+et(i,2)*s),Yt(et(r,2)*(1-s)+et(c,2)*s),"rgb")};Oe.lrgb=Jl;const eg=(t,e,s)=>{const n=t.lab(),o=e.lab();return new j(n[0]+s*(o[0]-n[0]),n[1]+s*(o[1]-n[1]),n[2]+s*(o[2]-n[2]),"lab")};Oe.lab=eg;const it=(t,e,s,n)=>{let o,r;n==="hsl"?(o=t.hsl(),r=e.hsl()):n==="hsv"?(o=t.hsv(),r=e.hsv()):n==="hcg"?(o=t.hcg(),r=e.hcg()):n==="hsi"?(o=t.hsi(),r=e.hsi()):n==="lch"||n==="hcl"?(n="hcl",o=t.hcl(),r=e.hcl()):n==="oklch"&&(o=t.oklch().reverse(),r=e.oklch().reverse());let a,i,c,_,d,l;(n.substr(0,1)==="h"||n==="oklch")&&([a,c,d]=o,[i,_,l]=r);let g,m,h,S;return!isNaN(a)&&!isNaN(i)?(i>a&&i-a>180?S=i-(a+360):i<a&&a-i>180?S=i+360-a:S=i-a,m=a+s*S):isNaN(a)?isNaN(i)?m=Number.NaN:(m=i,(d==1||d==0)&&n!="hsv"&&(g=_)):(m=a,(l==1||l==0)&&n!="hsv"&&(g=c)),g===void 0&&(g=c+s*(_-c)),h=d+s*(l-d),n==="oklch"?new j([h,g,m],n):new j([m,g,h],n)},md=(t,e,s)=>it(t,e,s,"lch");Oe.lch=md;Oe.hcl=md;const tg=(t,e,s)=>{const n=t.num(),o=e.num();return new j(n+s*(o-n),"num")};Oe.num=tg;const sg=(t,e,s)=>it(t,e,s,"hcg");Oe.hcg=sg;const ng=(t,e,s)=>it(t,e,s,"hsi");Oe.hsi=ng;const og=(t,e,s)=>it(t,e,s,"hsl");Oe.hsl=og;const rg=(t,e,s)=>it(t,e,s,"hsv");Oe.hsv=rg;const ag=(t,e,s)=>{const n=t.oklab(),o=e.oklab();return new j(n[0]+s*(o[0]-n[0]),n[1]+s*(o[1]-n[1]),n[2]+s*(o[2]-n[2]),"oklab")};Oe.oklab=ag;const ig=(t,e,s)=>it(t,e,s,"oklch");Oe.oklch=ig;const{pow:qt,sqrt:Ht,PI:zt,cos:$r,sin:Kr,atan2:cg}=Math,_g=(t,e="lrgb",s=null)=>{const n=t.length;s||(s=Array.from(new Array(n)).map(()=>1));const o=n/s.reduce(function(l,g){return l+g});if(s.forEach((l,g)=>{s[g]*=o}),t=t.map(l=>new j(l)),e==="lrgb")return dg(t,s);const r=t.shift(),a=r.get(e),i=[];let c=0,_=0;for(let l=0;l<a.length;l++)if(a[l]=(a[l]||0)*s[0],i.push(isNaN(a[l])?0:s[0]),e.charAt(l)==="h"&&!isNaN(a[l])){const g=a[l]/180*zt;c+=$r(g)*s[0],_+=Kr(g)*s[0]}let d=r.alpha()*s[0];t.forEach((l,g)=>{const m=l.get(e);d+=l.alpha()*s[g+1];for(let h=0;h<a.length;h++)if(!isNaN(m[h]))if(i[h]+=s[g+1],e.charAt(h)==="h"){const S=m[h]/180*zt;c+=$r(S)*s[g+1],_+=Kr(S)*s[g+1]}else a[h]+=m[h]*s[g+1]});for(let l=0;l<a.length;l++)if(e.charAt(l)==="h"){let g=cg(_/i[l],c/i[l])/zt*180;for(;g<0;)g+=360;for(;g>=360;)g-=360;a[l]=g}else a[l]=a[l]/i[l];return d/=n,new j(a,e).alpha(d>.99999?1:d,!0)},dg=(t,e)=>{const s=t.length,n=[0,0,0,0];for(let o=0;o<t.length;o++){const r=t[o],a=e[o]/s,i=r._rgb;n[0]+=qt(i[0],2)*a,n[1]+=qt(i[1],2)*a,n[2]+=qt(i[2],2)*a,n[3]+=i[3]*a}return n[0]=Ht(n[0]),n[1]=Ht(n[1]),n[2]=Ht(n[2]),n[3]>.9999999&&(n[3]=1),new j(Or(n))},{pow:lg}=Math;function St(t){let e="rgb",s=Z("#ccc"),n=0,o=[0,1],r=[],a=[0,0],i=!1,c=[],_=!1,d=0,l=1,g=!1,m={},h=!0,S=1;const b=function(T){if(T=T||["#fff","#000"],T&&ce(T)==="string"&&Z.brewer&&Z.brewer[T.toLowerCase()]&&(T=Z.brewer[T.toLowerCase()]),ce(T)==="array"){T.length===1&&(T=[T[0],T[0]]),T=T.slice(0);for(let w=0;w<T.length;w++)T[w]=Z(T[w]);r.length=0;for(let w=0;w<T.length;w++)r.push(w/(T.length-1))}return P(),c=T},y=function(T){if(i!=null){const w=i.length-1;let x=0;for(;x<w&&T>=i[x];)x++;return x-1}return 0};let N=T=>T,k=T=>T;const M=function(T,w){let x,U;if(w==null&&(w=!1),isNaN(T)||T===null)return s;w?U=T:i&&i.length>2?U=y(T)/(i.length-2):l!==d?U=(T-d)/(l-d):U=1,U=k(U),w||(U=N(U)),S!==1&&(U=lg(U,S)),U=a[0]+U*(1-a[0]-a[1]),U=st(U,0,1);const L=Math.floor(U*1e4);if(h&&m[L])x=m[L];else{if(ce(c)==="array")for(let $=0;$<r.length;$++){const J=r[$];if(U<=J){x=c[$];break}if(U>=J&&$===r.length-1){x=c[$];break}if(U>J&&U<r[$+1]){U=(U-J)/(r[$+1]-J),x=Z.interpolate(c[$],c[$+1],U,e);break}}else ce(c)==="function"&&(x=c(U));h&&(m[L]=x)}return x};var P=()=>m={};b(t);const R=function(T){const w=Z(M(T));return _&&w[_]?w[_]():w};return R.classes=function(T){if(T!=null){if(ce(T)==="array")i=T,o=[T[0],T[T.length-1]];else{const w=Z.analyze(o);T===0?i=[w.min,w.max]:i=Z.limits(w,"e",T)}return R}return i},R.domain=function(T){if(!arguments.length)return o;d=T[0],l=T[T.length-1],r=[];const w=c.length;if(T.length===w&&d!==l)for(let x of Array.from(T))r.push((x-d)/(l-d));else{for(let x=0;x<w;x++)r.push(x/(w-1));if(T.length>2){const x=T.map((L,$)=>$/(T.length-1)),U=T.map(L=>(L-d)/(l-d));U.every((L,$)=>x[$]===L)||(k=L=>{if(L<=0||L>=1)return L;let $=0;for(;L>=U[$+1];)$++;const J=(L-U[$])/(U[$+1]-U[$]);return x[$]+J*(x[$+1]-x[$])})}}return o=[d,l],R},R.mode=function(T){return arguments.length?(e=T,P(),R):e},R.range=function(T,w){return b(T),R},R.out=function(T){return _=T,R},R.spread=function(T){return arguments.length?(n=T,R):n},R.correctLightness=function(T){return T==null&&(T=!0),g=T,P(),g?N=function(w){const x=M(0,!0).lab()[0],U=M(1,!0).lab()[0],L=x>U;let $=M(w,!0).lab()[0];const J=x+(U-x)*w;let le=$-J,se=0,pe=1,I=20;for(;Math.abs(le)>.01&&I-- >0;)(function(){return L&&(le*=-1),le<0?(se=w,w+=(pe-w)*.5):(pe=w,w+=(se-w)*.5),$=M(w,!0).lab()[0],le=$-J})();return w}:N=w=>w,R},R.padding=function(T){return T!=null?(ce(T)==="number"&&(T=[T,T]),a=T,R):a},R.colors=function(T,w){arguments.length<2&&(w="hex");let x=[];if(arguments.length===0)x=c.slice(0);else if(T===1)x=[R(.5)];else if(T>1){const U=o[0],L=o[1]-U;x=gg(0,T).map($=>R(U+$/(T-1)*L))}else{t=[];let U=[];if(i&&i.length>2)for(let L=1,$=i.length,J=1<=$;J?L<$:L>$;J?L++:L--)U.push((i[L-1]+i[L])*.5);else U=o;x=U.map(L=>R(L))}return Z[w]&&(x=x.map(U=>U[w]())),x},R.cache=function(T){return T!=null?(h=T,R):h},R.gamma=function(T){return T!=null?(S=T,R):S},R.nodata=function(T){return T!=null?(s=Z(T),R):s},R}function gg(t,e,s){let n=[],o=t<e,r=e;for(let a=t;o?a<r:a>r;o?a++:a--)n.push(a);return n}const mg=function(t){let e=[1,1];for(let s=1;s<t;s++){let n=[1];for(let o=1;o<=e.length;o++)n[o]=(e[o]||0)+e[o-1];e=n}return e},pg=function(t){let e,s,n,o;if(t=t.map(r=>new j(r)),t.length===2)[s,n]=t.map(r=>r.lab()),e=function(r){const a=[0,1,2].map(i=>s[i]+r*(n[i]-s[i]));return new j(a,"lab")};else if(t.length===3)[s,n,o]=t.map(r=>r.lab()),e=function(r){const a=[0,1,2].map(i=>(1-r)*(1-r)*s[i]+2*(1-r)*r*n[i]+r*r*o[i]);return new j(a,"lab")};else if(t.length===4){let r;[s,n,o,r]=t.map(a=>a.lab()),e=function(a){const i=[0,1,2].map(c=>(1-a)*(1-a)*(1-a)*s[c]+3*(1-a)*(1-a)*a*n[c]+3*(1-a)*a*a*o[c]+a*a*a*r[c]);return new j(i,"lab")}}else if(t.length>=5){let r,a,i;r=t.map(c=>c.lab()),i=t.length-1,a=mg(i),e=function(c){const _=1-c,d=[0,1,2].map(l=>r.reduce((g,m,h)=>g+a[h]*_**(i-h)*c**h*m[l],0));return new j(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},ug=t=>{const e=pg(t);return e.scale=()=>St(e),e},Fe=(t,e,s)=>{if(!Fe[s])throw new Error("unknown blend mode "+s);return Fe[s](t,e)},$e=t=>(e,s)=>{const n=Z(s).rgb(),o=Z(e).rgb();return Z.rgb(t(n,o))},Ke=t=>(e,s)=>{const n=[];return n[0]=t(e[0],s[0]),n[1]=t(e[1],s[1]),n[2]=t(e[2],s[2]),n},hg=t=>t,Eg=(t,e)=>t*e/255,fg=(t,e)=>t>e?e:t,bg=(t,e)=>t>e?t:e,Sg=(t,e)=>255*(1-(1-t/255)*(1-e/255)),yg=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),vg=(t,e)=>255*(1-(1-e/255)/(t/255)),Tg=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);Fe.normal=$e(Ke(hg));Fe.multiply=$e(Ke(Eg));Fe.screen=$e(Ke(Sg));Fe.overlay=$e(Ke(yg));Fe.darken=$e(Ke(fg));Fe.lighten=$e(Ke(bg));Fe.dodge=$e(Ke(Tg));Fe.burn=$e(Ke(vg));const{pow:Cg,sin:wg,cos:Rg}=Math;function Dg(t=300,e=-1.5,s=1,n=1,o=[0,1]){let r=0,a;ce(o)==="array"?a=o[1]-o[0]:(a=0,o=[o,o]);const i=function(c){const _=He*((t+120)/360+e*c),d=Cg(o[0]+a*c,n),g=(r!==0?s[0]+c*r:s)*d*(1-d)/2,m=Rg(_),h=wg(_),S=d+g*(-.14861*m+1.78277*h),b=d+g*(-.29227*m-.90649*h),y=d+g*(1.97294*m);return Z(Or([S*255,b*255,y*255,1]))};return i.start=function(c){return c==null?t:(t=c,i)},i.rotations=function(c){return c==null?e:(e=c,i)},i.gamma=function(c){return c==null?n:(n=c,i)},i.hue=function(c){return c==null?s:(s=c,ce(s)==="array"?(r=s[1]-s[0],r===0&&(s=s[1])):r=0,i)},i.lightness=function(c){return c==null?o:(ce(c)==="array"?(o=c,a=c[1]-c[0]):(o=[c,c],a=0),i)},i.scale=()=>Z.scale(i),i.hue(s),i}const Ng="0123456789abcdef",{floor:Og,random:Ig}=Math,Ag=()=>{let t="#";for(let e=0;e<6;e++)t+=Ng.charAt(Og(Ig()*16));return new j(t,"hex")},{log:Qr,pow:kg,floor:Mg,abs:xg}=Math;function pd(t,e=null){const s={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return ce(t)==="object"&&(t=Object.values(t)),t.forEach(n=>{e&&ce(n)==="object"&&(n=n[e]),n!=null&&!isNaN(n)&&(s.values.push(n),s.sum+=n,n<s.min&&(s.min=n),n>s.max&&(s.max=n),s.count+=1)}),s.domain=[s.min,s.max],s.limits=(n,o)=>ud(s,n,o),s}function ud(t,e="equal",s=7){ce(t)=="array"&&(t=pd(t));const{min:n,max:o}=t,r=t.values.sort((i,c)=>i-c);if(s===1)return[n,o];const a=[];if(e.substr(0,1)==="c"&&(a.push(n),a.push(o)),e.substr(0,1)==="e"){a.push(n);for(let i=1;i<s;i++)a.push(n+i/s*(o-n));a.push(o)}else if(e.substr(0,1)==="l"){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");const i=Math.LOG10E*Qr(n),c=Math.LOG10E*Qr(o);a.push(n);for(let _=1;_<s;_++)a.push(kg(10,i+_/s*(c-i)));a.push(o)}else if(e.substr(0,1)==="q"){a.push(n);for(let i=1;i<s;i++){const c=(r.length-1)*i/s,_=Mg(c);if(_===c)a.push(r[_]);else{const d=c-_;a.push(r[_]*(1-d)+r[_+1]*d)}}a.push(o)}else if(e.substr(0,1)==="k"){let i;const c=r.length,_=new Array(c),d=new Array(s);let l=!0,g=0,m=null;m=[],m.push(n);for(let b=1;b<s;b++)m.push(n+b/s*(o-n));for(m.push(o);l;){for(let y=0;y<s;y++)d[y]=0;for(let y=0;y<c;y++){const N=r[y];let k=Number.MAX_VALUE,M;for(let P=0;P<s;P++){const R=xg(m[P]-N);R<k&&(k=R,M=P),d[M]++,_[y]=M}}const b=new Array(s);for(let y=0;y<s;y++)b[y]=null;for(let y=0;y<c;y++)i=_[y],b[i]===null?b[i]=r[y]:b[i]+=r[y];for(let y=0;y<s;y++)b[y]*=1/d[y];l=!1;for(let y=0;y<s;y++)if(b[y]!==m[y]){l=!0;break}m=b,g++,g>200&&(l=!1)}const h={};for(let b=0;b<s;b++)h[b]=[];for(let b=0;b<c;b++)i=_[b],h[i].push(r[b]);let S=[];for(let b=0;b<s;b++)S.push(h[b][0]),S.push(h[b][h[b].length-1]);S=S.sort((b,y)=>b-y),a.push(S[0]);for(let b=1;b<S.length;b+=2){const y=S[b];!isNaN(y)&&a.indexOf(y)===-1&&a.push(y)}}return a}const Lg=(t,e)=>{t=new j(t),e=new j(e);const s=t.luminance(),n=e.luminance();return s>n?(s+.05)/(n+.05):(n+.05)/(s+.05)},{sqrt:Ye,pow:we,min:Pg,max:Fg,atan2:Xr,abs:Zr,cos:ht,sin:Jr,exp:jg,PI:ea}=Math;function Ug(t,e,s=1,n=1,o=1){var r=function(fe){return 360*fe/(2*ea)},a=function(fe){return 2*ea*fe/360};t=new j(t),e=new j(e);const[i,c,_]=Array.from(t.lab()),[d,l,g]=Array.from(e.lab()),m=(i+d)/2,h=Ye(we(c,2)+we(_,2)),S=Ye(we(l,2)+we(g,2)),b=(h+S)/2,y=.5*(1-Ye(we(b,7)/(we(b,7)+we(25,7)))),N=c*(1+y),k=l*(1+y),M=Ye(we(N,2)+we(_,2)),P=Ye(we(k,2)+we(g,2)),R=(M+P)/2,T=r(Xr(_,N)),w=r(Xr(g,k)),x=T>=0?T:T+360,U=w>=0?w:w+360,L=Zr(x-U)>180?(x+U+360)/2:(x+U)/2,$=1-.17*ht(a(L-30))+.24*ht(a(2*L))+.32*ht(a(3*L+6))-.2*ht(a(4*L-63));let J=U-x;J=Zr(J)<=180?J:U<=x?J+360:J-360,J=2*Ye(M*P)*Jr(a(J)/2);const le=d-i,se=P-M,pe=1+.015*we(m-50,2)/Ye(20+we(m-50,2)),I=1+.045*R,Y=1+.015*R*$,X=30*jg(-we((L-275)/25,2)),de=-(2*Ye(we(R,7)/(we(R,7)+we(25,7))))*Jr(2*a(X)),be=Ye(we(le/(s*pe),2)+we(se/(n*I),2)+we(J/(o*Y),2)+de*(se/(n*I))*(J/(o*Y)));return Fg(0,Pg(100,be))}function Bg(t,e,s="lab"){t=new j(t),e=new j(e);const n=t.get(s),o=e.get(s);let r=0;for(let a in n){const i=(n[a]||0)-(o[a]||0);r+=i*i}return Math.sqrt(r)}const Gg=(...t)=>{try{return new j(...t),!0}catch{return!1}},Yg={cool(){return St([Z.hsl(180,1,.9),Z.hsl(250,.7,.4)])},hot(){return St(["#000","#f00","#ff0","#fff"]).mode("rgb")}},bt={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let t of Object.keys(bt))bt[t.toLowerCase()]=bt[t];Object.assign(Z,{average:_g,bezier:ug,blend:Fe,cubehelix:Dg,mix:_t,interpolate:_t,random:Ag,scale:St,analyze:pd,contrast:Lg,deltaE:Ug,distance:Bg,limits:ud,valid:Gg,scales:Yg,input:re,colors:ot,brewer:bt});function nt(t){if(!t.themeColors)return{primaryColor:"var(--background-secondary-alt)",secondaryColor:"var(--background-secondary-alt)",overlayColor:"rgba(0, 0, 0, 0)",buttonColor:"var(--button-secondary-background)",backgroundColor:"var(--background-floating)",dividerColor:"var(--background-modifier-accent)",roleBackgroundColor:"var(--background-secondary-alt)",roleBorderColor:"var(--interactive-normal)"};function e(a,i=1){return`hsla(${a[0].toFixed(0)}, ${(a[1]*100).toFixed(1)}%, ${(a[2]*100).toFixed(1)}%, ${i})`}const s=q.ColorUtils.getDarkness(t.themeColors.primary)>.5?"dark":"light",n=qg(t.themeColors.primary,"#FFFFFF"),o=s==="dark"?.24:.12,r=s==="dark"?[0,0,100]:n;return{primaryColor:e(Z(q.ColorUtils.intToHex(t.themeColors.primary)).hsl()),secondaryColor:e(Z(t.themeColors.secondary).hsl()),overlayColor:s==="dark"?"hsla(0,0%,0%,0.6)":"hsla(0,0%,100%,0.6)",backgroundColor:s==="dark"?"hsla(0,0%,0%,0.45)":"hsla(0,0%,100%,0.45)",buttonColor:e(n),dividerColor:e(r,o),themeOverwrite:s,roleBackgroundColor:s==="dark"?"hsl(var(--primary-660-hsl) / .5)":"hsl(var(--white-500-hsl) / .5)",roleBorderColor:s==="dark"?"hsl(var(--white-500-hsl) / .2)":"hsl(var(--primary-660-hsl) / .2)",...Hg({primaryColor:t.themeColors.primary,secondaryColor:t.themeColors.secondary,isDarkTheme:s==="dark"})}}function qg(t,e){const o=Z(e).luminance();let r=Z(t),a=Z.contrast(Z(e),r);for(let i=0;i<100;i++){const c=a<7,_=a>10;if(!c&&!_)break;const d=r.luminance()>o;_&&d||c&&!d?r=r.darken():r=r.brighten(),a=Z.contrast(Z(e),r)}return r.hsl()}function Hg(t){const{primaryColor:e,secondaryColor:s,isDarkTheme:n}=t,o=Z(e),r=Z(s),[a,i]=o.luminance()>r.luminance()?[o,r]:[r,o],c=n?a.set("lch.l",98).set("lch.c",15):i.set("lch.l",10),_=n?i.set("hsl.s",1).set("hsl.l",.05):a.set("hsl.s",1).set("hsl.l",.94),[d,l,g]=_.hsl();return{themeMixBaseHsl:`${Number.isNaN(d)?0:d} ${100*l}% ${100*g}%`,themeMixBase:_.css(),themeMixText:c.css(),themeMixAmountBase:"30%",themeMixAmountText:"70%"}}var zg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hd={exports:{}};(function(t,e){(function(s,n){t.exports=n()})(zg,function(){var s=/\r\n?/g,n=/\t/g,o=/\f/g,r=function(p){return p.replace(s,` `).replace(o,"").replace(n," ")},a=function(p,E){var u=p||{};if(E!=null)for(var A in E)Object.prototype.hasOwnProperty.call(E,A)&&(u[A]=E[A]);return u},i=function(p,E){var u=Object.keys(p).filter(function(K){var C=p[K];if(C==null||C.match==null)return!1;var F=C.order;return(typeof F!="number"||!isFinite(F))&&typeof console<"u"&&console.warn("simple-markdown: Invalid order for rule `"+K+"`: "+String(F)),!0});u.sort(function(K,C){var F=p[K],H=p[C],z=F.order,oe=H.order;if(z!==oe)return z-oe;var me=F.quality?0:1,ve=H.quality?0:1;return me!==ve?me-ve:K<C?-1:K>C?1:0});var A,W=function(K,C){var F=[];for(C=C||A,A=C;K;){var H=null,z=null,oe=null,me=NaN,ve=0,Ce=u[0],Te=p[Ce];do{var Le=Te.order,Me=C.prevCapture==null?"":C.prevCapture[0],ie=Te.match(K,C,Me);if(ie){var Be=Te.quality?Te.quality(ie,C,Me):0;Be<=me||(H=Ce,z=Te,oe=ie,me=Be)}ve++,Ce=u[ve],Te=p[Ce]}while(Te&&(!oe||Te.order===Le&&Te.quality));if(z==null||oe==null)throw new Error("Could not find a matching rule for the below content. The rule with highest `order` should always match content provided to it. Check the definition of `match` for '"+u[u.length-1]+`'. It seems to not match the following source: `+K);if(oe.index)throw new Error("`match` must return a capture starting at index 0 (the current parse index). Did you forget a ^ at the start of the RegExp?");var Ne=z.parse(oe,W,C);Array.isArray(Ne)?Array.prototype.push.apply(F,Ne):(Ne.type==null&&(Ne.type=H),F.push(Ne)),C.prevCapture=oe,K=K.substring(C.prevCapture[0].length)}return F},Q=function(K,C){return A=a(C,E),!A.inline&&!A.disableAutoBlockNewlines&&(K=K+` `),A.prevCapture=null,W(r(K),A)};return Q},c=function(p){var E=function(u,A){return A.inline?p.exec(u):null};return E.regex=p,E},_=function(p){var E=function(u,A){return A.inline?null:p.exec(u)};return E.regex=p,E},d=function(p){var E=function(u,A){return p.exec(u)};return E.regex=p,E},l=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103,g=function(p,E,u){var A={$$typeof:l,type:p,key:E??void 0,ref:null,props:u,_owner:null};return A},m=function(p,E,u,A){u=u||{},A=typeof A<"u"?A:!0;var W="";for(var Q in u){var K=u[Q];Object.prototype.hasOwnProperty.call(u,Q)&&K&&(W+=" "+N(Q)+'="'+N(K)+'"')}var C="<"+p+W+">";return A?C+E+"</"+p+">":C},h={},S=function(p){if(p==null)return null;try{var E=decodeURIComponent(p).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}catch{return null}return p},b=/[<>&"']/g,y={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#96;"},N=function(p){return String(p).replace(b,function(E){return y[E]})},k=/\\([^0-9A-Za-z\s])/g,M=function(p){return p.replace(k,"$1")},P=function(p,E,u){var A=u.inline||!1;u.inline=!0;var W=p(E,u);return u.inline=A,W},R=function(p,E,u){var A=u.inline||!1;u.inline=!1;var W=p(E+` `,u);return u.inline=A,W},T=function(p,E,u){return{content:P(E,p[1],u)}},w=function(){return{}},x="(?:[*+-]|\\d+\\.)",U="( *)("+x+") +",L=new RegExp("^"+U),$=new RegExp(U+"[^\\n]*(?:\\n(?!\\1"+x+` )[^\\n]*)*( |$)`,"gm"),J=/\n{2,}$/,le=/^ (?= *`)|(` *) $/g,se=J,pe=/ *\n+$/,I=new RegExp("^( *)("+x+`) [\\s\\S]+?(?: {2,}(?! )(?!\\1`+x+` )\\n*|\\s* *$)`),Y=/(?:^|\n)( *)$/,X=function(){var p=/^ *\| *| *\| *$/g,E=/ *$/,u=/^ *-+: *$/,A=/^ *:-+: *$/,W=/^ *:-+ *$/,Q=function(z){return u.test(z)?"right":A.test(z)?"center":W.test(z)?"left":null},K=function(z,oe,me,ve){ve&&(z=z.replace(p,""));var Ce=z.trim().split("|");return Ce.map(Q)},C=function(z,oe,me,ve){var Ce=me.inTable;me.inTable=!0;var Te=oe(z.trim(),me);me.inTable=Ce;var Le=[[]];return Te.forEach(function(Me,ie){Me.type==="tableSeparator"?(!ve||ie!==0&&ie!==Te.length-1)&&Le.push([]):(Me.type==="text"&&(Te[ie+1]==null||Te[ie+1].type==="tableSeparator")&&(Me.content=Me.content.replace(E,"")),Le[Le.length-1].push(Me))}),Le},F=function(z,oe,me,ve){var Ce=z.trim().split(` `);return Ce.map(function(Te){return C(Te,oe,me,ve)})},H=function(z){return function(oe,me,ve){ve.inline=!0;var Ce=C(oe[1],me,ve,z),Te=K(oe[2],me,ve,z),Le=F(oe[3],me,ve,z);return ve.inline=!1,{type:"table",header:Ce,align:Te,cells:Le}}};return{parseTable:H(!0),parseNpTable:H(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}}(),ne="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",de=`\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*`,be=/mailto:/i,fe=function(p,E,u){var A=(p[2]||p[1]).replace(/\s+/g," ").toLowerCase();if(E._defs&&E._defs[A]){var W=E._defs[A];u.target=W.target,u.title=W.title}return E._refs=E._refs||{},E._refs[A]=E._refs[A]||[],E._refs[A].push(u),u},ee=0,ae={Array:{react:function(p,E,u){for(var A=u.key,W=[],Q=0,K=0;Q<p.length;Q++,K++){u.key=""+Q;var C=p[Q];if(C.type==="text")for(C={type:"text",content:C.content};Q+1<p.length&&p[Q+1].type==="text";Q++)C.content+=p[Q+1].content;W.push(E(C,u))}return u.key=A,W},html:function(p,E,u){for(var A="",W=0;W<p.length;W++){var Q=p[W];if(Q.type==="text")for(Q={type:"text",content:Q.content};W+1<p.length&&p[W+1].type==="text";W++)Q.content+=p[W+1].content;A+=E(Q,u)}return A}},heading:{order:ee++,match:_(/^ *(#{1,6})([^\n]+?)#* *(?:\n *)+\n/),parse:function(p,E,u){return{level:p[1].length,content:P(E,p[2].trim(),u)}},react:function(p,E,u){return g("h"+p.level,u.key,{children:E(p.content,u)})},html:function(p,E,u){return m("h"+p.level,E(p.content,u))}},nptable:{order:ee++,match:_(X.NPTABLE_REGEX),parse:X.parseNpTable,react:null,html:null},lheading:{order:ee++,match:_(/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/),parse:function(p,E,u){return{type:"heading",level:p[2]==="="?1:2,content:P(E,p[1],u)}},react:null,html:null},hr:{order:ee++,match:_(/^( *[-*_]){3,} *(?:\n *)+\n/),parse:w,react:function(p,E,u){return g("hr",u.key,h)},html:function(p,E,u){return"<hr>"}},codeBlock:{order:ee++,match:_(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(p,E,u){var A=p[0].replace(/^ /gm,"").replace(/\n+$/,"");return{lang:void 0,content:A}},react:function(p,E,u){var A=p.lang?"markdown-code-"+p.lang:void 0;return g("pre",u.key,{children:g("code",null,{className:A,children:p.content})})},html:function(p,E,u){var A=p.lang?"markdown-code-"+p.lang:void 0,W=m("code",N(p.content),{class:A});return m("pre",W)}},fence:{order:ee++,match:_(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/),parse:function(p,E,u){return{type:"codeBlock",lang:p[2]||void 0,content:p[3]}},react:null,html:null},blockQuote:{order:ee++,match:_(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(p,E,u){var A=p[0].replace(/^ *> ?/gm,"");return{content:E(A,u)}},react:function(p,E,u){return g("blockquote",u.key,{children:E(p.content,u)})},html:function(p,E,u){return m("blockquote",E(p.content,u))}},list:{order:ee++,match:function(p,E){var u=E.prevCapture==null?"":E.prevCapture[0],A=Y.exec(u),W=E._list||!E.inline;return A&&W?(p=A[1]+p,I.exec(p)):null},parse:function(p,E,u){var A=p[2],W=A.length>1,Q=W?+A:void 0,K=p[0].replace(se,` `).match($),C=!1,F=K.map(function(H,z){var oe=L.exec(H),me=oe?oe[0].length:0,ve=new RegExp("^ {1,"+me+"}","gm"),Ce=H.replace(ve,"").replace(L,""),Te=z===K.length-1,Le=Ce.indexOf(` `)!==-1,Me=Le||Te&&C;C=Me;var ie=u.inline,Be=u._list;u._list=!0;var Ne;Me?(u.inline=!1,Ne=Ce.replace(pe,` `)):(u.inline=!0,Ne=Ce.replace(pe,""));var gt=E(Ne,u);return u.inline=ie,u._list=Be,gt});return{ordered:W,start:Q,items:F}},react:function(p,E,u){var A=p.ordered?"ol":"ul";return g(A,u.key,{start:p.start,children:p.items.map(function(W,Q){return g("li",""+Q,{children:E(W,u)})})})},html:function(p,E,u){var A=p.items.map(function(K){return m("li",E(K,u))}).join(""),W=p.ordered?"ol":"ul",Q={start:p.start};return m(W,A,Q)}},def:{order:ee++,match:_(/^ *\[([^\]]+)\]: *<?([^\s>]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(p,E,u){var A=p[1].replace(/\s+/g," ").toLowerCase(),W=p[2],Q=p[3];return u._refs&&u._refs[A]&&u._refs[A].forEach(function(K){K.target=W,K.title=Q}),u._defs=u._defs||{},u._defs[A]={target:W,title:Q},{def:A,target:W,title:Q}},react:function(){return null},html:function(){return""}},table:{order:ee++,match:_(X.TABLE_REGEX),parse:X.parseTable,react:function(p,E,u){var A=function(K){return p.align[K]==null?{}:{textAlign:p.align[K]}},W=p.header.map(function(K,C){return g("th",""+C,{style:A(C),scope:"col",children:E(K,u)})}),Q=p.cells.map(function(K,C){return g("tr",""+C,{children:K.map(function(F,H){return g("td",""+H,{style:A(H),children:E(F,u)})})})});return g("table",u.key,{children:[g("thead","thead",{children:g("tr",null,{children:W})}),g("tbody","tbody",{children:Q})]})},html:function(p,E,u){var A=function(F){return p.align[F]==null?"":"text-align:"+p.align[F]+";"},W=p.header.map(function(F,H){return m("th",E(F,u),{style:A(H),scope:"col"})}).join(""),Q=p.cells.map(function(F){var H=F.map(function(z,oe){return m("td",E(z,u),{style:A(oe)})}).join("");return m("tr",H)}).join(""),K=m("thead",m("tr",W)),C=m("tbody",Q);return m("table",K+C)}},newline:{order:ee++,match:_(/^(?:\n *)*\n/),parse:w,react:function(p,E,u){return` `},html:function(p,E,u){return` `}},paragraph:{order:ee++,match:_(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:T,react:function(p,E,u){return g("div",u.key,{className:"paragraph",children:E(p.content,u)})},html:function(p,E,u){var A={class:"paragraph"};return m("div",E(p.content,u),A)}},escape:{order:ee++,match:c(/^\\([^0-9A-Za-z\s])/),parse:function(p,E,u){return{type:"text",content:p[1]}},react:null,html:null},tableSeparator:{order:ee++,match:function(p,E){return E.inTable?/^ *\| */.exec(p):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" &vert; "}},autol