@mintlify/cli 4.1.72 → 4.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{$ as r,A as i,F as a,G as o,H as s,J as c,K as l,L as u,P as d,R as f,V as p,W as m,X as h,Y as g,Z as _,_ as v,d as y,f as b,g as x,l as S,m as C,n as w,q as T,r as E,t as D,u as O,v as k,w as A,x as ee}from"./dist-BpdR9SbK.js";import{$ as j,$n as te,An as ne,Bt as re,C as ie,Cn as ae,Dn as oe,E as se,En as ce,Fn as le,Ft as ue,In as de,It as fe,Jt as pe,Kn as me,Kt as he,Ln as ge,Lt as _e,Mn as ve,Nn as ye,Nt as be,On as xe,Pt as Se,Qt as Ce,Rn as we,Sn as Te,U as Ee,Wn as De,Wt as Oe,X as ke,Xn as Ae,Y as je,Yn as Me,Z as Ne,Zn as Pe,_t as Fe,a as Ie,at as Le,bt as Re,et as ze,ht as Be,ir as Ve,jn as He,k as Ue,m as We,mn as Ge,mt as Ke,o as qe,ot as Je,pn as Ye,qt as Xe,rt as Ze,s as Qe,tr as $e,tt as et,vn as tt,vt as nt,w as rt,wn as it,xt as at,yn as ot,yt as st}from"./dist-DGS-P0UG.js";import{g as ct,h as M,m as lt}from"./build-Nkr-5oHQ.js";import{a as ut,i as dt,n as ft}from"./multi-repo-command-CfGPBp8I.js";import{c as pt,l as mt,n as ht,t as gt,u as _t}from"./agent-Da2kI1tZ.js";import{A as vt,C as yt,D as bt,E as xt,F as St,I as Ct,L as N,M as wt,N as Tt,O as Et,P as Dt,R as Ot,S as kt,T as At,_ as jt,a as Mt,b as Nt,c as Pt,d as Ft,f as It,g as Lt,h as Rt,i as zt,j as Bt,k as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,u as Xt,v as Zt,w as Qt,x as $t,y as en,z as tn}from"./config-DzDLoppg.js";import{n as nn,t as rn}from"./client-DXQ6Tgw0.js";import{_ as an,a as on,b as sn,c as cn,d as ln,f as un,g as dn,h as fn,i as pn,l as mn,m as hn,n as gn,o as _n,p as vn,r as yn,s as bn,t as xn,u as Sn,v as Cn}from"./esm-BtDK7B-d.js";import{B as wn,M as Tn,P as En,Q as Dn,X as On,Z as kn,_ as An,b as jn,c as Mn,d as Nn,dt as Pn,r as Fn,s as In,st as Ln,t as Rn,tt as zn,u as Bn,w as Vn,x as Hn,y as Un}from"./utils-D-zUiakl.js";import{a as Wn,c as Gn,i as Kn,n as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./remark-utils-CLJr2toS.js";import{_ as Qn,a as $n,c as er,d as tr,f as nr,l as rr,m as ir,o as ar,p as or,s as sr,u as cr,v as lr}from"./schemas-CVKidklE.js";import{t as ur}from"./currencyMath-BHNabTeO.js";import{createRequire as dr}from"node:module";import fr,{basename as pr,dirname as mr,join as hr,normalize as gr,parse as _r,resolve as vr}from"path";import yr,{existsSync as br,readFileSync as xr,readdirSync as Sr}from"node:fs";import Cr,{existsSync as wr,promises as Tr}from"fs";import Er from"os";import Dr from"crypto";import Or from"node:process";import kr from"node:os";import{createRequire as Ar}from"module";import jr,{mkdir as Mr,mkdtemp as Nr,readFile as Pr,writeFile as Fr}from"node:fs/promises";import Ir from"node:path";import{execFile as Lr,spawn as Rr}from"node:child_process";import{fileURLToPath as zr}from"node:url";import{createHash as Br,randomUUID as Vr}from"node:crypto";import{format as Hr,stripVTControlCharacters as Ur}from"node:util";import{sep as Wr}from"path/win32";import{setTimeout as Gr}from"node:timers/promises";var P=r();const Kr=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},qr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},Jr=e=>{try{let t=qr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},Yr=e=>`${e.r} ${e.g} ${e.b}`,Xr=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,Zr=(e,t,n)=>{if(t)return n?t:Jr(t);let r=Qr(`#09090b`,1,e,.02);return n?Xr(r):Yr(r)},Qr=(e,t,n,r)=>{let i=qr(e),a=qr(n);return Kr({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},$r=`#4ADE80`,ei=(e=$r)=>({light:`#ffffff`,dark:Zr(e,void 0,!0)});function ti(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??$r;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||Xr(Qr(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||Xr(Qr(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:Jr(r),dark:Zr(n,e?.background?.color?.dark),lightHex:r,darkHex:Zr(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ni=/([A-Z])/g,ri=e=>e.replace(ni,`-$1`).toLowerCase(),ii={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},ai=/[&><"']/g,oi=e=>String(e).replace(ai,e=>ii[e]),si=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?si(e.body[0]):e:e.type===`font`?si(e.body):e,ci=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),li=e=>ci.has(si(e).type),ui=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},di={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function fi(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function pi(e){return e.default===void 0?fi(Array.isArray(e.type)?e.type[0]:e.type):e.default}function mi(e,t,n,r){var i=n[t];e[t]=i===void 0?pi(r):r.processor?r.processor(i):i}var hi=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(di)){var n=di[t];n&&mi(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=ui(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},gi=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Ti[Ei[this.id]]}sub(){return Ti[Di[this.id]]}fracNum(){return Ti[Oi[this.id]]}fracDen(){return Ti[ki[this.id]]}cramp(){return Ti[Ai[this.id]]}text(){return Ti[ji[this.id]]}isTight(){return this.size>=2}},_i=0,vi=1,yi=2,bi=3,xi=4,Si=5,Ci=6,wi=7,Ti=[new gi(_i,0,!1),new gi(vi,0,!0),new gi(yi,1,!1),new gi(bi,1,!0),new gi(xi,2,!1),new gi(Si,2,!0),new gi(Ci,3,!1),new gi(wi,3,!0)],Ei=[xi,Si,xi,Si,Ci,wi,Ci,wi],Di=[Si,Si,Si,Si,wi,wi,wi,wi],Oi=[yi,bi,xi,Si,Ci,wi,Ci,wi],ki=[bi,bi,Si,Si,wi,wi,wi,wi],Ai=[vi,vi,bi,bi,Si,Si,wi,wi],ji=[_i,vi,yi,bi,yi,bi,yi,bi],Mi={DISPLAY:Ti[_i],TEXT:Ti[yi],SCRIPT:Ti[xi],SCRIPTSCRIPT:Ti[Ci]},Ni=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Pi(e){for(var t=0;t<Ni.length;t++)for(var n=Ni[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Fi=[];Ni.forEach(e=>e.blocks.forEach(e=>Fi.push(...e)));function Ii(e){for(var t=0;t<Fi.length;t+=2)if(e>=Fi[t]&&e<=Fi[t+1])return!0;return!1}var Li=e=>e+` `+e,Ri=80,zi=function(e,t){return`M95,`+(622+e+t)+`
7
+ import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{$ as r,A as i,F as a,G as o,H as s,J as c,K as l,L as u,P as d,R as f,V as p,W as m,X as h,Y as g,Z as _,_ as v,d as y,f as b,g as x,l as S,m as C,n as w,q as T,r as E,t as D,u as O,v as k,w as A,x as ee}from"./dist-DgyavKdR.js";import{$ as j,$n as te,An as ne,Bt as re,C as ie,Cn as ae,Dn as oe,E as se,En as ce,Fn as le,Ft as ue,In as de,It as fe,Jt as pe,Kn as me,Kt as he,Ln as ge,Lt as _e,Mn as ve,Nn as ye,Nt as be,On as xe,Pt as Se,Qt as Ce,Rn as we,Sn as Te,U as Ee,Wn as De,Wt as Oe,X as ke,Xn as Ae,Y as je,Yn as Me,Z as Ne,Zn as Pe,_t as Fe,a as Ie,at as Le,bt as Re,et as ze,ht as Be,ir as Ve,jn as He,k as Ue,m as We,mn as Ge,mt as Ke,o as qe,ot as Je,pn as Ye,qt as Xe,rt as Ze,s as Qe,tr as $e,tt as et,vn as tt,vt as nt,w as rt,wn as it,xt as at,yn as ot,yt as st}from"./dist-BA3H54nL.js";import{g as ct,h as M,m as lt}from"./build-Nkr-5oHQ.js";import{a as ut,i as dt,n as ft}from"./multi-repo-command-DvqhX76Z.js";import{c as pt,l as mt,n as ht,t as gt,u as _t}from"./agent-Da2kI1tZ.js";import{A as vt,C as yt,D as bt,E as xt,F as St,I as Ct,L as N,M as wt,N as Tt,O as Et,P as Dt,R as Ot,S as kt,T as At,_ as jt,a as Mt,b as Nt,c as Pt,d as Ft,f as It,g as Lt,h as Rt,i as zt,j as Bt,k as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,u as Xt,v as Zt,w as Qt,x as $t,y as en,z as tn}from"./config-B9UTDqKX.js";import{n as nn,t as rn}from"./client-DXQ6Tgw0.js";import{_ as an,a as on,b as sn,c as cn,d as ln,f as un,g as dn,h as fn,i as pn,l as mn,m as hn,n as gn,o as _n,p as vn,r as yn,s as bn,t as xn,u as Sn,v as Cn}from"./esm-BtDK7B-d.js";import{B as wn,M as Tn,P as En,Q as Dn,X as On,Z as kn,_ as An,b as jn,c as Mn,d as Nn,dt as Pn,r as Fn,s as In,st as Ln,t as Rn,tt as zn,u as Bn,w as Vn,x as Hn,y as Un}from"./utils-B7dNmFFf.js";import{a as Wn,c as Gn,i as Kn,n as qn,o as Jn,r as Yn,s as Xn,t as Zn}from"./remark-utils-heM5aat5.js";import{_ as Qn,a as $n,c as er,d as tr,f as nr,l as rr,m as ir,o as ar,p as or,s as sr,u as cr,v as lr}from"./schemas-CVKidklE.js";import{t as ur}from"./currencyMath-DcWm_B16.js";import{createRequire as dr}from"node:module";import fr,{basename as pr,dirname as mr,join as hr,normalize as gr,parse as _r,resolve as vr}from"path";import yr,{existsSync as br,readFileSync as xr,readdirSync as Sr}from"node:fs";import Cr,{existsSync as wr,promises as Tr}from"fs";import Er from"os";import Dr from"crypto";import Or from"node:process";import kr from"node:os";import{createRequire as Ar}from"module";import jr,{mkdir as Mr,mkdtemp as Nr,readFile as Pr,writeFile as Fr}from"node:fs/promises";import Ir from"node:path";import{execFile as Lr,spawn as Rr}from"node:child_process";import{fileURLToPath as zr}from"node:url";import{createHash as Br,randomUUID as Vr}from"node:crypto";import{format as Hr,stripVTControlCharacters as Ur}from"node:util";import{sep as Wr}from"path/win32";import{setTimeout as Gr}from"node:timers/promises";var P=r();const Kr=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},qr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},Jr=e=>{try{let t=qr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},Yr=e=>`${e.r} ${e.g} ${e.b}`,Xr=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,Zr=(e,t,n)=>{if(t)return n?t:Jr(t);let r=Qr(`#09090b`,1,e,.02);return n?Xr(r):Yr(r)},Qr=(e,t,n,r)=>{let i=qr(e),a=qr(n);return Kr({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},$r=`#4ADE80`,ei=(e=$r)=>({light:`#ffffff`,dark:Zr(e,void 0,!0)});function ti(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??$r;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||Xr(Qr(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||Xr(Qr(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:Jr(r),dark:Zr(n,e?.background?.color?.dark),lightHex:r,darkHex:Zr(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ni=/([A-Z])/g,ri=e=>e.replace(ni,`-$1`).toLowerCase(),ii={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},ai=/[&><"']/g,oi=e=>String(e).replace(ai,e=>ii[e]),si=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?si(e.body[0]):e:e.type===`font`?si(e.body):e,ci=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),li=e=>ci.has(si(e).type),ui=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},di={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function fi(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function pi(e){return e.default===void 0?fi(Array.isArray(e.type)?e.type[0]:e.type):e.default}function mi(e,t,n,r){var i=n[t];e[t]=i===void 0?pi(r):r.processor?r.processor(i):i}var hi=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(di)){var n=di[t];n&&mi(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=ui(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},gi=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Ti[Ei[this.id]]}sub(){return Ti[Di[this.id]]}fracNum(){return Ti[Oi[this.id]]}fracDen(){return Ti[ki[this.id]]}cramp(){return Ti[Ai[this.id]]}text(){return Ti[ji[this.id]]}isTight(){return this.size>=2}},_i=0,vi=1,yi=2,bi=3,xi=4,Si=5,Ci=6,wi=7,Ti=[new gi(_i,0,!1),new gi(vi,0,!0),new gi(yi,1,!1),new gi(bi,1,!0),new gi(xi,2,!1),new gi(Si,2,!0),new gi(Ci,3,!1),new gi(wi,3,!0)],Ei=[xi,Si,xi,Si,Ci,wi,Ci,wi],Di=[Si,Si,Si,Si,wi,wi,wi,wi],Oi=[yi,bi,xi,Si,Ci,wi,Ci,wi],ki=[bi,bi,Si,Si,wi,wi,wi,wi],Ai=[vi,vi,bi,bi,Si,Si,wi,wi],ji=[_i,vi,yi,bi,yi,bi,yi,bi],Mi={DISPLAY:Ti[_i],TEXT:Ti[yi],SCRIPT:Ti[xi],SCRIPTSCRIPT:Ti[Ci]},Ni=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Pi(e){for(var t=0;t<Ni.length;t++)for(var n=Ni[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Fi=[];Ni.forEach(e=>e.blocks.forEach(e=>Fi.push(...e)));function Ii(e){for(var t=0;t<Fi.length;t+=2)if(e>=Fi[t]&&e<=Fi[t+1])return!0;return!1}var Li=e=>e+` `+e,Ri=80,zi=function(e,t){return`M95,`+(622+e+t)+`
8
8
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
9
9
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
10
10
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -260,7 +260,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
260
260
  |[ \r ]+
261
261
  ?)[ \r ]*`,Vl=`[̀-ͯ]`,Hl=RegExp(Vl+`+$`),Ul=`(`+Il+`+)|`+(Bl+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(Vl+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(Vl+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+zl)+(`|`+Rl+`)`),Wl=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Ul,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Gc(`EOF`,new Wc(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new F(`Unexpected character: '`+e[t]+`'`,new Gc(e[t],new Wc(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
262
262
  `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new Gc(r,new Wc(this,t,this.tokenRegex.lastIndex))}},Gl=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new F(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},Kl=Uc;J(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),J(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),J(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),J(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),J(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),J(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),J(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ql={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};J(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new F("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=ql[t.text],r==null||r>=n)throw new F(`Invalid base-`+n+` digit `+t.text);for(var i;(i=ql[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Jl=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new F(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new F(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new F(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new F(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};J(`\\newcommand`,e=>Jl(e,!1,!0,!1)),J(`\\renewcommand`,e=>Jl(e,!0,!1,!1)),J(`\\providecommand`,e=>Jl(e,!0,!0,!0)),J(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),J(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),J(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Fl[n],Ea.math[n],Ea.text[n]),``}),J(`\\bgroup`,`{`),J(`\\egroup`,`}`),J(`~`,`\\nobreakspace`),J(`\\lq`,"`"),J(`\\rq`,`'`),J(`\\aa`,`\\r a`),J(`\\AA`,`\\r A`),J(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),J(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),J(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),J(`ℬ`,`\\mathscr{B}`),J(`ℰ`,`\\mathscr{E}`),J(`ℱ`,`\\mathscr{F}`),J(`ℋ`,`\\mathscr{H}`),J(`ℐ`,`\\mathscr{I}`),J(`ℒ`,`\\mathscr{L}`),J(`ℳ`,`\\mathscr{M}`),J(`ℛ`,`\\mathscr{R}`),J(`ℭ`,`\\mathfrak{C}`),J(`ℌ`,`\\mathfrak{H}`),J(`ℨ`,`\\mathfrak{Z}`),J(`\\Bbbk`,`\\Bbb{k}`),J(`\\llap`,`\\mathllap{\\textrm{#1}}`),J(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),J(`\\clap`,`\\mathclap{\\textrm{#1}}`),J(`\\mathstrut`,`\\vphantom{(}`),J(`\\underbar`,`\\underline{\\text{#1}}`),J(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),J(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),J(`\\ne`,`\\neq`),J(`≠`,`\\neq`),J(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),J(`∉`,`\\notin`),J(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),J(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),J(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),J(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),J(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),J(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),J(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),J(`⟂`,`\\perp`),J(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),J(`∌`,`\\notni`),J(`⌜`,`\\ulcorner`),J(`⌝`,`\\urcorner`),J(`⌞`,`\\llcorner`),J(`⌟`,`\\lrcorner`),J(`©`,`\\copyright`),J(`®`,`\\textregistered`),J(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),J(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),J(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),J(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),J(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),J(`⋮`,`\\vdots`),J(`\\varGamma`,`\\mathit{\\Gamma}`),J(`\\varDelta`,`\\mathit{\\Delta}`),J(`\\varTheta`,`\\mathit{\\Theta}`),J(`\\varLambda`,`\\mathit{\\Lambda}`),J(`\\varXi`,`\\mathit{\\Xi}`),J(`\\varPi`,`\\mathit{\\Pi}`),J(`\\varSigma`,`\\mathit{\\Sigma}`),J(`\\varUpsilon`,`\\mathit{\\Upsilon}`),J(`\\varPhi`,`\\mathit{\\Phi}`),J(`\\varPsi`,`\\mathit{\\Psi}`),J(`\\varOmega`,`\\mathit{\\Omega}`),J(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),J(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),J(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),J(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),J(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),J(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),J(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),J(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var Yl={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},Xl=/* @__PURE__ */ new Set([`bin`,`rel`]);J(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in Yl?t=Yl[n]:(n.slice(0,4)===`\\not`||n in Ea.math&&Xl.has(Ea.math[n].group))&&(t=`\\dotsb`),t});var Zl={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};J(`\\dotso`,function(e){return e.future().text in Zl?`\\ldots\\,`:`\\ldots`}),J(`\\dotsc`,function(e){var t=e.future().text;return t in Zl&&t!==`,`?`\\ldots\\,`:`\\ldots`}),J(`\\cdots`,function(e){return e.future().text in Zl?`\\@cdots\\,`:`\\@cdots`}),J(`\\dotsb`,`\\cdots`),J(`\\dotsm`,`\\cdots`),J(`\\dotsi`,`\\!\\cdots`),J(`\\dotsx`,`\\ldots\\,`),J(`\\DOTSI`,`\\relax`),J(`\\DOTSB`,`\\relax`),J(`\\DOTSX`,`\\relax`),J(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),J(`\\,`,`\\tmspace+{3mu}{.1667em}`),J(`\\thinspace`,`\\,`),J(`\\>`,`\\mskip{4mu}`),J(`\\:`,`\\tmspace+{4mu}{.2222em}`),J(`\\medspace`,`\\:`),J(`\\;`,`\\tmspace+{5mu}{.2777em}`),J(`\\thickspace`,`\\;`),J(`\\!`,`\\tmspace-{3mu}{.1667em}`),J(`\\negthinspace`,`\\!`),J(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),J(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),J(`\\enspace`,`\\kern.5em `),J(`\\enskip`,`\\hskip.5em\\relax`),J(`\\quad`,`\\hskip1em\\relax`),J(`\\qquad`,`\\hskip2em\\relax`),J(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),J(`\\tag@paren`,`\\tag@literal{({#1})}`),J(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new F(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),J(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),J(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),J(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),J(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),J(`\\newline`,`\\\\\\relax`),J(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var Ql=I(ya[`Main-Regular`][84][1]-.7*ya[`Main-Regular`][65][1]);J(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+Ql+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),J(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+Ql+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),J(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),J(`\\@hspace`,`\\hskip #1\\relax`),J(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),J(`\\ordinarycolon`,`:`),J(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),J(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),J(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),J(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),J(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),J(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),J(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),J(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),J(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),J(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),J(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),J(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),J(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),J(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),J(`∷`,`\\dblcolon`),J(`∹`,`\\eqcolon`),J(`≔`,`\\coloneqq`),J(`≕`,`\\eqqcolon`),J(`⩴`,`\\Coloneqq`),J(`\\ratio`,`\\vcentcolon`),J(`\\coloncolon`,`\\dblcolon`),J(`\\colonequals`,`\\coloneqq`),J(`\\coloncolonequals`,`\\Coloneqq`),J(`\\equalscolon`,`\\eqqcolon`),J(`\\equalscoloncolon`,`\\Eqqcolon`),J(`\\colonminus`,`\\coloneq`),J(`\\coloncolonminus`,`\\Coloneq`),J(`\\minuscolon`,`\\eqcolon`),J(`\\minuscoloncolon`,`\\Eqcolon`),J(`\\coloncolonapprox`,`\\Colonapprox`),J(`\\coloncolonsim`,`\\Colonsim`),J(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),J(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),J(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),J(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),J(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),J(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),J(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),J(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),J(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),J(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),J(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),J(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),J(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),J(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),J(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),J(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),J(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),J(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),J(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),J(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),J(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),J(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),J(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),J(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),J(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),J(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),J(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),J(`\\imath`,`\\html@mathml{\\@imath}{ı}`),J(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),J(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),J(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),J(`⟦`,`\\llbracket`),J(`⟧`,`\\rrbracket`),J(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),J(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),J(`⦃`,`\\lBrace`),J(`⦄`,`\\rBrace`),J(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),J(`⦵`,`\\minuso`),J(`\\darr`,`\\downarrow`),J(`\\dArr`,`\\Downarrow`),J(`\\Darr`,`\\Downarrow`),J(`\\lang`,`\\langle`),J(`\\rang`,`\\rangle`),J(`\\uarr`,`\\uparrow`),J(`\\uArr`,`\\Uparrow`),J(`\\Uarr`,`\\Uparrow`),J(`\\N`,`\\mathbb{N}`),J(`\\R`,`\\mathbb{R}`),J(`\\Z`,`\\mathbb{Z}`),J(`\\alef`,`\\aleph`),J(`\\alefsym`,`\\aleph`),J(`\\Alpha`,`\\mathrm{A}`),J(`\\Beta`,`\\mathrm{B}`),J(`\\bull`,`\\bullet`),J(`\\Chi`,`\\mathrm{X}`),J(`\\clubs`,`\\clubsuit`),J(`\\cnums`,`\\mathbb{C}`),J(`\\Complex`,`\\mathbb{C}`),J(`\\Dagger`,`\\ddagger`),J(`\\diamonds`,`\\diamondsuit`),J(`\\empty`,`\\emptyset`),J(`\\Epsilon`,`\\mathrm{E}`),J(`\\Eta`,`\\mathrm{H}`),J(`\\exist`,`\\exists`),J(`\\harr`,`\\leftrightarrow`),J(`\\hArr`,`\\Leftrightarrow`),J(`\\Harr`,`\\Leftrightarrow`),J(`\\hearts`,`\\heartsuit`),J(`\\image`,`\\Im`),J(`\\infin`,`\\infty`),J(`\\Iota`,`\\mathrm{I}`),J(`\\isin`,`\\in`),J(`\\Kappa`,`\\mathrm{K}`),J(`\\larr`,`\\leftarrow`),J(`\\lArr`,`\\Leftarrow`),J(`\\Larr`,`\\Leftarrow`),J(`\\lrarr`,`\\leftrightarrow`),J(`\\lrArr`,`\\Leftrightarrow`),J(`\\Lrarr`,`\\Leftrightarrow`),J(`\\Mu`,`\\mathrm{M}`),J(`\\natnums`,`\\mathbb{N}`),J(`\\Nu`,`\\mathrm{N}`),J(`\\Omicron`,`\\mathrm{O}`),J(`\\plusmn`,`\\pm`),J(`\\rarr`,`\\rightarrow`),J(`\\rArr`,`\\Rightarrow`),J(`\\Rarr`,`\\Rightarrow`),J(`\\real`,`\\Re`),J(`\\reals`,`\\mathbb{R}`),J(`\\Reals`,`\\mathbb{R}`),J(`\\Rho`,`\\mathrm{P}`),J(`\\sdot`,`\\cdot`),J(`\\sect`,`\\S`),J(`\\spades`,`\\spadesuit`),J(`\\sub`,`\\subset`),J(`\\sube`,`\\subseteq`),J(`\\supe`,`\\supseteq`),J(`\\Tau`,`\\mathrm{T}`),J(`\\thetasym`,`\\vartheta`),J(`\\weierp`,`\\wp`),J(`\\Zeta`,`\\mathrm{Z}`),J(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),J(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),J(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),J(`\\bra`,`\\mathinner{\\langle{#1}|}`),J(`\\ket`,`\\mathinner{|{#1}\\rangle}`),J(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),J(`\\Bra`,`\\left\\langle#1\\right|`),J(`\\Ket`,`\\left|#1\\right\\rangle`);var $l=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};J(`\\bra@ket`,$l(!1)),J(`\\bra@set`,$l(!0)),J(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),J(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),J(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),J(`\\angln`,`{\\angl n}`),J(`\\blue`,`\\textcolor{##6495ed}{#1}`),J(`\\orange`,`\\textcolor{##ffa500}{#1}`),J(`\\pink`,`\\textcolor{##ff00af}{#1}`),J(`\\red`,`\\textcolor{##df0030}{#1}`),J(`\\green`,`\\textcolor{##28ae7b}{#1}`),J(`\\gray`,`\\textcolor{gray}{#1}`),J(`\\purple`,`\\textcolor{##9d38bd}{#1}`),J(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),J(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),J(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),J(`\\blueD`,`\\textcolor{##11accd}{#1}`),J(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),J(`\\tealA`,`\\textcolor{##94fff5}{#1}`),J(`\\tealB`,`\\textcolor{##26edd5}{#1}`),J(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),J(`\\tealD`,`\\textcolor{##01a995}{#1}`),J(`\\tealE`,`\\textcolor{##208170}{#1}`),J(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),J(`\\greenB`,`\\textcolor{##8af281}{#1}`),J(`\\greenC`,`\\textcolor{##74cf70}{#1}`),J(`\\greenD`,`\\textcolor{##1fab54}{#1}`),J(`\\greenE`,`\\textcolor{##0d923f}{#1}`),J(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),J(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),J(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),J(`\\goldD`,`\\textcolor{##e07d10}{#1}`),J(`\\goldE`,`\\textcolor{##a75a05}{#1}`),J(`\\redA`,`\\textcolor{##fca9a9}{#1}`),J(`\\redB`,`\\textcolor{##ff8482}{#1}`),J(`\\redC`,`\\textcolor{##f9685d}{#1}`),J(`\\redD`,`\\textcolor{##e84d39}{#1}`),J(`\\redE`,`\\textcolor{##bc2612}{#1}`),J(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),J(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),J(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),J(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),J(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),J(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),J(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),J(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),J(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),J(`\\purpleE`,`\\textcolor{##543b78}{#1}`),J(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),J(`\\mintB`,`\\textcolor{##edf2df}{#1}`),J(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),J(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),J(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),J(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),J(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),J(`\\grayE`,`\\textcolor{##babec2}{#1}`),J(`\\grayF`,`\\textcolor{##888d93}{#1}`),J(`\\grayG`,`\\textcolor{##626569}{#1}`),J(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),J(`\\grayI`,`\\textcolor{##21242c}{#1}`),J(`\\kaBlue`,`\\textcolor{##314453}{#1}`),J(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var eu={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},tu=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Gl(Kl,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Wl(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Gc(`EOF`,n.loc)),this.pushTokens(r),new Gc(``,Wc.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new F(`Extra }`,i)}else if(i.text===`EOF`)throw new F(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new F(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new F(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new F(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new F(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new F(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new F(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Gc(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new Wl(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Fl.hasOwnProperty(e)||Ea.math.hasOwnProperty(e)||Ea.text.hasOwnProperty(e)||eu.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?Fl.hasOwnProperty(e)&&!Fl[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},nu=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ru=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),iu={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},au={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},ou=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new tu(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new F(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Gc(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&Fl[i.text]&&Fl[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new F(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new F(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new F(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new F(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new F(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new F(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(ru[i.text]){var s=nu.test(i.text),c=[];for(c.push(new Gc(ru[i.text])),this.consume();;){var l=this.fetch().text;if(!ru[l]||nu.test(l)!==s)break;c.unshift(new Gc(ru[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Fl[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new F(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new F(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new F(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Fl[e];if(o&&o.handler)return o.handler(a,t,n);throw new F(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new F(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new F(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new F(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new F(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new F(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new F(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new F(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!ea(i))throw new F(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:Wc.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!eu.hasOwnProperty(r)){if(this.settings.throwOnError)throw new F(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:Wc.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:Wc.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:Wc.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new F(`\\verb assertion failed --
263
- please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}au.hasOwnProperty(t[0])&&!Ea[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=au[t[0]]+t.slice(1));var i=Hl.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Ea[this.mode][t]){this.settings.strict&&this.mode===`math`&&Xa.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Ea[this.mode][t].group,s=Wc.range(e);a=Fs(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Ii(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:Wc.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!iu[l])throw new F(`Unknown accent ' `+l+`'`,e);var u=iu[l][this.mode]||iu[l].text;if(!u)throw new F(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Wc.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};ou.endOfExpression=/* @__PURE__ */ new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var su=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new ou(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new F(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new Gc(`\\df@tag`)])}]}return r},cu=function(e,t,n){t.textContent=``;var r=fu(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),cu=function(){throw new F(`KaTeX doesn't work in quirks mode.`)});var lu=function(e,t){return fu(e,t).toMarkup()},uu=function(e,t){return su(e,new hi(t))},du=function(e,t,n){if(n.throwOnError||!(e instanceof F))throw e;var r=G([`katex-error`],[new fa(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},fu=function(e,t){var n=new hi(t);try{return Ts(su(e,n),e,n)}catch(t){return du(t,e,n)}},pu={version:`0.16.47`,render:cu,renderToString:lu,ParseError:F,SETTINGS_SCHEMA:di,__parse:uu,__renderToDomTree:fu,__renderToHTMLTree:function(e,t){var n=new hi(t);try{return Es(su(e,n),e,n)}catch(t){return du(t,e,n)}},__setFontMetrics:Sa,__defineSymbol:L,__defineFunction:K,__defineMacro:J,__domTree:{Span:ca,Anchor:la,SymbolNode:fa,SvgNode:pa,PathNode:ma,LineNode:ha}};const mu=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];function hu(e,t){let n=t>0?`_${t}`:``;return Oe(`param-${e}${n}`,{decamelize:!0,separator:`-`})}function gu(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Variation`}function _u(e){let t=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`is`);if(!t)return{kind:`missing`};if(typeof t.value==`string`){let e=t.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(!t.value)return{kind:`invalid`};let n=t.value.data?.estree,r=n?.body[0],i=r?.type===`ExpressionStatement`?r.expression:void 0;if(i?.type===`Literal`&&typeof i.value==`string`){let e=i.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`TemplateLiteral`&&i.expressions.length===0){let e=(i.quasis[0]?.value.cooked)?.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`ArrayExpression`){let e=[];for(let t of i.elements){if(t?.type!==`Literal`||typeof t.value!=`string`)return{kind:`invalid`};let n=t.value.trim();if(!n)return{kind:`invalid`};e.push(n)}return e.length>0?{kind:`valid`,ids:[...new Set(e)]}:{kind:`invalid`}}if(n)return{kind:`invalid`};let a=t.value.value.trim().match(/^(["'`])([\s\S]*)\1$/);return(a?.[2])?.trim()?{kind:`valid`,ids:[a[2].trim()]}:{kind:`invalid`}}const vu=[`h1`,`h2`,`h3`,`h4`],yu=[`Accordion`,`AccordionGroup`,`Expandable`,`Update`,`Prompt`];function bu(e,t){let n=e.find(e=>`name`in e&&e.name===t);if(n&&`value`in n&&typeof n.value==`string`)return n.value}const xu=e=>e&&[...e].sort(),Su=e=>{if(typeof e==`string`)return e;let t=Ln(Gn(e.groups));return JSON.stringify([xu(t?.includes),xu(t?.excludes)])},Cu=(e,t)=>{if(t===void 0)return!0;let n=new Set(e?.map(Su));return t.every(e=>n.has(Su(e)))},wu=(e,t)=>{let n=g();return r=>{let i=[],a=!1,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Set,p=l.includes(t?.mode??``);zn(r,e=>{if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`)for(let t of e.data?.islandHeadings??[])n.reserve(t.slug);e.type===`mdxJsxFlowElement`&&e.name&&yu.includes(e.name)&&zn(e,t=>{t!==e&&f.add(t)});let t=e;if(Wn(t)){let n=Jn(t),r=Xn(n);Kn(n)?zn(e,t=>{t!==e&&f.add(t)}):r&&zn(e,t=>{t!==e&&u.set(t,[...u.get(t)??[],r])})}if(e.type===`mdxJsxFlowElement`&&e.name===`Steps`){let t=bu(e.attributes,`titleSize`);if(t){let n=e=>{for(let r of e)r.type===`mdxJsxFlowElement`&&(r.name===`Step`?d.set(r,t):Nn(r)&&n(r.children))};n(e.children)}}if(e.type===`mdxJsxFlowElement`&&e.name===`Tab`){let t=bu(e.attributes,`id`),n=bu(e.attributes,`title`),r=t??(n?pe(Yn(e,n)):void 0);r&&zn(e,e=>{o.set(e,r)})}if(e.type===`mdxJsxFlowElement`&&e.name===`View`){let t=bu(e.attributes,`title`);t&&zn(e,e=>{s.set(e,t)})}let r=e;if(gu(r)){let t=_u(r),n=t.kind===`valid`?t.ids:[];zn(e,e=>{let t=c.get(e);c.set(e,t?t.filter(e=>n.includes(e)):n)})}});let m=(e,t)=>{if(!e.title.trim())return;if(t!==void 0&&Number(t)<=2){a=!0,i.push(e);return}let n=i;if(a){let t=i.at(-1);t&&!(t.depth>2&&t.depth>=e.depth)&&(t.tabId===void 0||t.tabId===e.tabId)&&(t.viewId===void 0||t.viewId===e.viewId)&&(t.variationIds===void 0||e.variationIds!==void 0&&e.variationIds.every(e=>t.variationIds?.includes(e)))&&Cu(e.authRules,t.authRules)&&(n=t.children)}n.push(e)};zn(r,e=>{if(f.has(e))return;let t=o.get(e),r=s.get(e),i=c.get(e),a=u.get(e);if(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`){let o=e.data?.tableOfContents;if(!o?.length)return;let s=e=>{for(let t of e)n.reserve(t.slug),s(t.children)};s(o);for(let e of o)m(Object.assign(Object.assign({},e),{tabId:t,viewId:r,variationIds:i,authRules:a||e.authRules?[...a??[],...e.authRules??[]]:void 0}),e.depth);return}if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`){if(p)return;for(let{title:n,slug:o,depth:s}of e.data?.islandHeadings??[])m({title:n,slug:o,depth:s,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},s);return}let l=e.type===`heading`&&T.includes(e.depth),h=e.type===`mdxJsxFlowElement`&&vu.includes(e.name??``),g=e.type===`mdxJsxFlowElement`&&e.name===`Heading`,_=e.type===`mdxJsxFlowElement`&&e.name===`Update`&&e.attributes.some(e=>`name`in e&&e.name===`label`),v=e.type===`mdxJsxFlowElement`&&e.name===`Step`?bu(e.attributes,`titleSize`)??d.get(e):void 0,y=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`noAnchor`&&(e.value==null||e.value===`true`||typeof e.value==`object`&&e.value.value===`true`)),b=e.type===`mdxJsxFlowElement`&&e.name===`Step`?Yn(e,bu(e.attributes,`title`)??``):void 0,x=e.type===`mdxJsxFlowElement`&&e.name===`Step`&&!y&&[`h2`,`h3`].includes(v??``)&&b?.trim()!==``,S=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`id`);if(!l&&!h&&!g&&!_&&!x||p&&(l||h))return;let C;if(`name`in e&&e.name===`Update`)C=1,e.depth=1;else if(`name`in e&&e.name===`Step`)C={h2:2,h3:3,h4:4}[v??``]??3,e.depth=C;else if(`depth`in e)C=e.depth;else if(`name`in e&&e.name===`Heading`){let t=e.attributes.find(e=>`name`in e&&e.name===`level`);t&&`value`in t&&typeof t.value==`number`&&(C=t.value)}else if(`name`in e&&e.name?.[1]){let t=Number(e.name[1]);C=isNaN(t)?void 0:t,C!==void 0&&(e.depth=C)}let w=b??qn(e),E,D=`name`in e&&(e.name===`Heading`||e.name===`Step`||e.name===`Update`)||S?bu(e.attributes,`id`):void 0;E=D?n.claim(Xe(D)||pe(w)):n.claim(pe(w));let O;if(`name`in e&&e.name===`Update`){let t=bu(e.attributes,`id`);O=t?t===E?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):[...e.attributes,Zn(`id`,E)]}else if(`name`in e&&e.name===`Step`){let t=bu(e.attributes,`id`);O=t?t===E?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):[...e.attributes,Zn(`id`,E)]}else if(`name`in e&&e.name===`Heading`)O=D&&E!==D?e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):e.attributes;else if(C!==void 0&&S){let t=D&&E!==D?e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):e.attributes;O=[Zn(`level`,C),...t]}else C!==void 0&&!S&&(O=[Zn(`level`,C),Zn(`id`,E)],h&&e.attributes.length>0&&O.push(...e.attributes));e.attributes=O,e.type=`mdxJsxFlowElement`,e.name=e.name===`Update`?`Update`:e.name===`Step`?`Step`:`Heading`;let k=e.depth;m({title:w,slug:E,depth:k,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},C)}),e&&(e.tableOfContents=i)}},Tu=/* @__PURE__ */ new Set([`codeFenced`,`codeText`,`yaml`,`toml`]),Eu=[Tn([`yaml`,`toml`]),wn(),{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}],Du=e=>{let t=+!!e.startsWith(``),n=kn(Dn({extensions:Eu}).document().write(On()(e.slice(t),void 0,!0))),r=[];for(let[e,i]of n)e===`enter`&&Tu.has(i.type)&&r.push([i.start.offset+t,i.end.offset+t]);return r},Ou=/* @__PURE__ */ new Set(/* @__PURE__ */ `Info.Warning.Note.Tip.Check.Danger.Callout.AccordionGroup.Card.CardGroup.Tabs.CodeGroup.Column.Columns.CustomCode.CustomComponent.DynamicCustomComponent.Expandable.Frame.GitHub.Github.Icon.Latex.Mermaid.Panel.Popup.Prompt.Quote.RequestExample.ResponseExample.SnippetGroup.Steps.Tile.Tooltip.Tree.FileTree.Variation.Visibility.MDX.Badge.Color.ZoomImage`.split(`.`)),ku=/* @__PURE__ */ new Set([`Heading`,`Step`,`Update`]),Au=[`Example`,`Snippet`],ju=e=>Rn.includes(e)||Au.includes(e);function Mu(e){if(e===``)return`index`;if(e===`index`)return e;if(e.endsWith(`/index`)){let t=_(e);return t===``?`index`:t}return e}function Nu(e,t){return e==null||t==null||typeof e!=`string`||typeof t!=`string`?!1:Pu(e)===Pu(t)}function Pu(e){return Mu(oe(ce(e)))}const Fu=e=>e?e.replace(/!\[([^\]]*)\]\([^()]*(?:\([^()]*\)[^()]*)*\)/g,``).replace(/!\[([^\]]*)\]\[[^\]]*\]/g,``).replace(/\[([^\]]*)\]\([^()]*(?:\([^()]*\)[^()]*)*\)/g,`$1`).replace(/\[([^\]]*)\]\[[^\]]*\]/g,`$1`).replace(/\*{3}([^*]+)\*{3}/g,`$1`).replace(/_{3}([^_]+)_{3}/g,`$1`).replace(/\*{2}([^*]+)\*{2}/g,`$1`).replace(/_{2}([^_]+)_{2}/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/(?<!\w)_([^_]+)_(?!\w)/g,`$1`).replace(/`{3}([^`]+)`{3}/g,`$1`).replace(/`{2}([^`]+)`{2}/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/~~([^~]+)~~/g,`$1`).replace(/<\/?[a-zA-Z][^>]*>/g,``).replace(/\s+/g,` `).trim():null,Iu=e=>{let t=e.split(`.`);return t.length<2?e:t.slice(-2).join(`.`)},Lu=(e,t)=>{let n=Iu(t);return e===n?`@`:e.endsWith(`.${n}`)?e.slice(0,-(n.length+1)):e},Ru=[`/_next`,`/_mintlify`,`/_sites`,`/_live-preview`,`/api`,`/login`,`/logout`,`/mcp`,`/feedback`,`/openapi-specs.download`,`/llms.txt`,`/llms-full.txt`,`/sitemap.xml`,`/robots.txt`,`/skill.md`,`/.well-known`],zu=e=>{let t=e.trim();return t===`/`?t:t.replace(/\/+$/,``)},Bu=e=>Ru.some(t=>e===t||e.startsWith(`${t}/`)),Vu=e=>{let t=e.trim(),n=zu(e);if(t.length===0)return`Enter a base path.`;if(!t.startsWith(`/`))return`Base path must start with /.`;if(t===`/`)return`Base path must include a path segment.`;if(t.length>128)return`Base path must be at most 128 characters.`;if(t.startsWith(`//`)||t.includes(`://`))return`Base path cannot be an absolute URL.`;if(t.includes(`//`))return`Base path cannot contain consecutive slashes.`;if(/\s/.test(t))return`Base path cannot contain spaces.`;if(/[?#]/.test(t))return`Base path cannot include a query string or hash.`;if(t.split(`/`).some(e=>e===`.`||e===`..`))return`Base path cannot contain "." or ".." segments.`;if(Bu(n))return`Base path is reserved.`};var Hu=/* @__PURE__ */ n(((e,t)=>{t.exports=function(e){return!e||typeof e==`string`?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!==`String`)}})),Uu=/* @__PURE__ */ n(((e,t)=>{var n=Hu(),r=Array.prototype.concat,i=Array.prototype.slice,a=t.exports=function(e){for(var t=[],a=0,o=e.length;a<o;a++){var s=e[a];n(s)?t=r.call(t,i.call(s)):t.push(s)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}})),Wu=/* @__PURE__ */ n(((e,t)=>{var n=_t(),r=Uu(),i=Object.hasOwnProperty,a=Object.create(null);for(var o in n)i.call(n,o)&&(a[n[o]]=o);var s=t.exports={to:{},get:{}};s.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=s.get.hsl(e),r=`hsl`;break;case`hwb`:n=s.get.hwb(e),r=`hwb`;break;default:n=s.get.rgb(e),r=`rgb`}return n?{model:r,value:n}:null},s.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,l=[0,0,0,1],u,d,f;if(u=e.match(r)){for(f=u[2],u=u[1],d=0;d<3;d++){var p=d*2;l[d]=parseInt(u.slice(p,p+2),16)}f&&(l[3]=parseInt(f,16)/255)}else if(u=e.match(t)){for(u=u[1],f=u[3],d=0;d<3;d++)l[d]=parseInt(u[d]+u[d],16);f&&(l[3]=parseInt(f+f,16)/255)}else if(u=e.match(a)){for(d=0;d<3;d++)l[d]=parseInt(u[d+1],0);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(o)){for(d=0;d<3;d++)l[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(s))return u[1]===`transparent`?[0,0,0,0]:i.call(n,u[1])?(l=n[u[1]],l[3]=1,l):null;else return null;for(d=0;d<3;d++)l[d]=c(l[d],0,255);return l[3]=c(l[3],0,1),l},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var e=r(arguments);return`#`+l(e[0])+l(e[1])+l(e[2])+(e[3]<1?l(Math.round(e[3]*255)):``)},s.to.rgb=function(){var e=r(arguments);return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},s.to.rgb.percent=function(){var e=r(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+i+`%)`:`rgba(`+t+`%, `+n+`%, `+i+`%, `+e[3]+`)`},s.to.hsl=function(){var e=r(arguments);return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},s.to.hwb=function(){var e=r(arguments),t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},s.to.keyword=function(e){return a[e.slice(0,3)]};function c(e,t,n){return Math.min(Math.max(t,e),n)}function l(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}})),Gu=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=Wu(),r=mt(),i=[`keyword`,`gray`,`hex`],a={};for(let e of Object.keys(r))a[[...r[e].labels].sort().join(``)]=e;let o={};function s(e,t){if(!(this instanceof s))return new s(e,t);if(t&&t in i&&(t=null),t&&!(t in r))throw Error(`Unknown model: `+t);let c,l;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof s)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=n.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,l=r[this.model].channels,this.color=t.value.slice(0,l),this.valpha=typeof t.value[l]==`number`?t.value[l]:1}else if(e.length>0){this.model=t||`rgb`,l=r[this.model].channels;let n=Array.prototype.slice.call(e,0,l);this.color=p(n,l),this.valpha=typeof e[l]==`number`?e[l]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let n=t.sort().join(``);if(!(n in a))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=a[n];let{labels:i}=r[this.model],o=[];for(c=0;c<i.length;c++)o.push(e[i[c]]);this.color=p(o)}if(o[this.model])for(l=r[this.model].channels,c=0;c<l;c++){let e=o[this.model][c];e&&(this.color[c]=e(this.color[c]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}s.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in n.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to[t.model](r)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to.rgb.percent(r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=r[this.model],{labels:n}=r[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new s([...this.color.map(l(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new s([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:u(`rgb`,0,d(255)),green:u(`rgb`,1,d(255)),blue:u(`rgb`,2,d(255)),hue:u([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:u(`hsl`,1,d(100)),lightness:u(`hsl`,2,d(100)),saturationv:u(`hsv`,1,d(100)),value:u(`hsv`,2,d(100)),chroma:u(`hcg`,1,d(100)),gray:u(`hcg`,2,d(100)),white:u(`hwb`,1,d(100)),wblack:u(`hwb`,2,d(100)),cyan:u(`cmyk`,0,d(100)),magenta:u(`cmyk`,1,d(100)),yellow:u(`cmyk`,2,d(100)),black:u(`cmyk`,3,d(100)),x:u(`xyz`,0,d(95.047)),y:u(`xyz`,1,d(100)),z:u(`xyz`,2,d(108.833)),l:u(`lab`,0,d(100)),a:u(`lab`,1),b:u(`lab`,2),keyword(e){return e===void 0?r[this.model].keyword(this.color):new s(e)},hex(e){return e===void 0?n.to.hex(this.rgb().round().color):new s(e)},hexa(e){if(e!==void 0)return new s(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r=`0`+r),n.to.hex(t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return s.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),c=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-c;return s.rgb(c*n.red()+l*r.red(),c*n.green()+l*r.green(),c*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(r)){if(i.includes(e))continue;let{channels:t}=r[e];s.prototype[e]=function(...t){return this.model===e?new s(this):t.length>0?new s(t,e):new s([...f(r[this.model][e].raw(this.color)),this.valpha],e)},s[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=p(n,t)),new s(r,e)}}function c(e,t){return Number(e.toFixed(t))}function l(e){return function(t){return c(t,e)}}function u(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(o[r]||(o[r]=[]))[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function f(e){return Array.isArray(e)?e:[e]}function p(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}t.exports=s})))(),1);const Ku={AA_NORMAL:4.5,AA_LARGE:3,AAA_NORMAL:7,AAA_LARGE:4.5};function qu(e,t,n=Ku.AA_NORMAL){try{let r=(0,Gu.default)(e),i=(0,Gu.default)(t),a=r.contrast(i),o=r.level(i),s=o===`AA`||o===`AAA`,c=o===`AAA`,l,u;return n===Ku.AA_NORMAL?c?(l=`pass`,u=`Excellent contrast ratio: ${a.toFixed(2)}:1 (meets WCAG AAA)`):s?(l=`warning`,u=`Good contrast ratio: ${a.toFixed(2)}:1 (meets WCAG AA, consider AAA for better accessibility)`):(l=`fail`,u=`Poor contrast ratio: ${a.toFixed(2)}:1 (fails WCAG AA, minimum required: ${Ku.AA_NORMAL}:1)`):a>=n?(l=`pass`,u=`Contrast ratio: ${a.toFixed(2)}:1 (meets minimum threshold of ${n}:1)`):(l=`fail`,u=`Poor contrast ratio: ${a.toFixed(2)}:1 (fails minimum threshold, required: ${n}:1)`),{ratio:a,meetsAA:s,meetsAAA:c,recommendation:l,message:u}}catch{return null}}function Ju(e,t,n){let r=t.lightHex,i=t.darkHex,a=e.primary?qu(e.primary,r):null,o=e.light?qu(e.light,i):null,s=e.dark?qu(e.dark,i,3):null,c=e.dark?qu(e.dark,r,3):null,l=[];if(n?.global?.anchors){for(let e of n.global.anchors)if(e.color){let t=e.color.light?qu(e.color.light,r):null,n=e.color.dark?qu(e.color.dark,i):null;l.push({name:e.anchor,lightContrast:t,darkContrast:n})}}let u=[a,o,s,c,...l.flatMap(e=>[e.lightContrast,e.darkContrast])].filter(Boolean),d=u.some(e=>e.recommendation===`fail`),f=u.some(e=>e.recommendation===`warning`),p;return p=d?`fail`:f?`warning`:`pass`,{primaryContrast:a,lightContrast:o,darkContrast:s,darkOnLightContrast:c,anchorResults:l,overallScore:p}}var Yu=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Xu=()=>Yu(void 0,void 0,void 0,function*(){try{yield yt();let e=yield et(Nt,`docs`),t=yield et(Nt,`mint`);if(!e&&!t)return v((0,P.jsx)(d,{message:`No configuration file found. Please run this command from a directory with a mint.json or docs.json file.`})),1;let n=yield ze(Nt,e?`docs`:`mint`);if(!n?.colors)return v((0,P.jsx)(m,{message:`No colors section found in configuration file`})),0;let{colors:r,navigation:i}=n,{lightHex:a,darkHex:o}=ti(n),s=Ju(r,{lightHex:a,darkHex:o},i),c=(e,t,n=``)=>{if(!e)return;let{recommendation:r,message:i}=e,a=r===`pass`?`PASS`:r===`warning`?`WARN`:`FAIL`,o=r===`pass`?`green`:r===`warning`?`yellow`:`red`;v((0,P.jsxs)(M,{children:[(0,P.jsxs)(M,{bold:n===``,children:[n,t,`:`,` `]}),(0,P.jsxs)(M,{color:o,children:[a,` `,i]})]}))};v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking color accessibility...`})),v((0,P.jsx)(M,{})),c(s.primaryContrast,`Primary Color (${r.primary}) vs Light Background`),c(s.lightContrast,`Light Color (${r.light}) vs Dark Background`),c(s.darkContrast,`Dark Color (${r.dark}) vs Dark Background`),c(s.darkOnLightContrast,`Dark Color (${r.dark}) vs Light Background`);let l=s.anchorResults.filter(e=>e.lightContrast||e.darkContrast);if(l.length>0){v((0,P.jsx)(M,{})),v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Navigation Anchors:`}));for(let e of l)v((0,P.jsxs)(M,{bold:!0,children:[` `,e.name,`:`]})),c(e.lightContrast,`Light variant vs Light Background`,` `),c(e.darkContrast,`Dark variant vs Dark Background`,` `)}v((0,P.jsx)(M,{}));let u=s.overallScore===`pass`?`PASS`:s.overallScore===`warning`?`WARN`:`FAIL`,f=s.overallScore===`pass`?`green`:s.overallScore===`warning`?`yellow`:`red`,p=s.overallScore===`pass`?`All colors meet accessibility standards!`:s.overallScore===`warning`?`Some colors could be improved for better accessibility`:`Some colors fail accessibility standards and should be updated`;return v((0,P.jsx)(M,{children:(0,P.jsxs)(M,{bold:!0,color:f,children:[`Overall Assessment: `,u,` `,p]})})),+(s.overallScore===`fail`)}catch(e){return v((0,P.jsx)(d,{message:`Accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var Zu=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Qu=`mintlify`,$u=`access_token`,ed=`refresh_token`,td=`user_email`;function nd(){return Zu(this,void 0,void 0,function*(){try{let e=yield import(`keytar`);return e.default??e}catch{throw Error(`keytar is required for credential storage but is not installed. Install it with: npm install keytar`)}})}function rd(e,t,n){return Zu(this,void 0,void 0,function*(){let r=yield nd();yield Promise.all([r.setPassword(Qu,$u,e),r.setPassword(Qu,ed,t)]);try{n===null?yield r.deletePassword(Qu,td):n!==void 0&&(yield r.setPassword(Qu,td,n))}catch{}})}function id(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,$u)})}function ad(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,ed)})}function od(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,td)})}function sd(e){return Zu(this,void 0,void 0,function*(){yield(yield nd()).setPassword(Qu,td,e)})}function cd(){return Zu(this,void 0,void 0,function*(){let e=yield nd();yield Promise.all([e.deletePassword(Qu,$u),e.deletePassword(Qu,ed),e.deletePassword(Qu,td).catch(()=>!1)])})}function ld(e){if(e)try{let t=e.split(`.`)[1];if(!t)return;let n=JSON.parse(Buffer.from(t,`base64url`).toString(`utf8`));return typeof n.email==`string`&&n.email.length>0?n.email:void 0}catch{return}}var ud=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};let dd=null;function fd(){return ud(this,void 0,void 0,function*(){return dd||(dd=pd().finally(()=>{dd=null}),dd)})}function pd(){return ud(this,void 0,void 0,function*(){try{let e=yield ad();if(!e)return null;let t=yield fetch(en,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`refresh_token`,refresh_token:e})});if(!t.ok)return null;let n=yield t.json().catch(()=>null);return!n?.access_token||!n.refresh_token?null:(yield rd(n.access_token,n.refresh_token,ld(n.id_token)),n.access_token)}catch{return null}})}var md=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function hd(){return md(this,void 0,void 0,function*(){try{return yield id()}catch{return null}})}function gd(e,t){return md(this,void 0,void 0,function*(){let n=yield hd(),r=process.env.MINTLIFY_SESSION_TOKEN,i=n??r;if(!i)throw Error("Not authenticated. Run `mint login` to authenticate.");let a=n=>fetch(e,Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t?.headers),{Authorization:`Bearer ${n}`})})),o=yield a(i);if(o.status!==401)return o;if(n){let e=yield fd();if(e)return a(e)}return r&&i!==r?a(r):o})}var _d=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const vd=nr({user:nr({email:ir()}),org:nr({name:ir()}),subdomains:ar(ir()).default([])});function yd(e){return _d(this,void 0,void 0,function*(){try{let t=yield fetch(`${It}/api/cli/status`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)return null;let n=yield t.json().catch(()=>null),r=vd.safeParse(n);return r.success?r.data:null}catch{return null}})}function bd(e){return _d(this,void 0,void 0,function*(){let t;try{t=yield gd(`${It}/api/cli/status`,{signal:e})}catch(e){let t=e instanceof Error?e.message:String(e);return/not authenticated/i.test(t)?{ok:!1,reason:`unauthenticated`}:{ok:!1,reason:`unreachable`,detail:t}}if(t.status===401||t.status===403)return{ok:!1,reason:`unauthenticated`};if(!t.ok)return{ok:!1,reason:`unreachable`,detail:`HTTP ${t.status}`};let n=vd.safeParse(yield t.json().catch(()=>null));return n.success?{ok:!0,status:n.data}:{ok:!1,reason:`invalid`}})}function xd(e){return _d(this,void 0,void 0,function*(){return(yield yd(e))?.subdomains??[]})}function Sd(){return _d(this,void 0,void 0,function*(){if(!((yield id().catch(()=>null))??process.env.MINTLIFY_SESSION_TOKEN))v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));else try{let e=yield gd(`${It}/api/cli/status`);if(!e.ok){v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));return}let t=yield e.json().catch(()=>null),n=vd.safeParse(t);if(!n.success){v((0,P.jsx)(d,{message:`unexpected response from server. please try again.`}));return}let{user:r,org:i,subdomains:a}=n.data,o=vt(),s=qt(`subdomain`),c=(s&&a.includes(s)?s:a[0])??null;c&&c!==s&&(yield Ht(`subdomain`,c).catch(()=>void 0)),v((0,P.jsxs)(ct,{flexDirection:`column`,paddingY:1,children:[o&&(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Version`})}),(0,P.jsx)(M,{children:o})]}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Email`})}),(0,P.jsx)(M,{children:r.email})]}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Organization`})}),(0,P.jsx)(M,{children:i.name})]}),c&&(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Subdomain`})}),(0,P.jsx)(M,{children:c})]})]}))}catch{v((0,P.jsx)(d,{message:`unexpected response from server. please try again.`}))}})}var Cd=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const wd=5e3,Td=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;function Ed(e,t){return Cd(this,void 0,void 0,function*(){if(!Td.test(e)){v((0,P.jsx)(d,{message:`invalid domain "${e}". Expected a bare hostname, e.g. docs.example.com`}));return}let n=o(t?.trim());if(n){let e=Vu(n);if(e){v((0,P.jsx)(d,{message:`invalid base path "${t}": ${e}`}));return}}let r=yield id();if(!r){v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));return}let i=yield xd(r),a=qt(`subdomain`),c=a&&i.includes(a)?a:i[0];if(!c){v((0,P.jsx)(d,{message:"no subdomain found. Run `mint status` to check your account."}));return}try{let t=yield gd(`${It}/api/cli/deployment/custom-domain/${c}/${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({basePath:n?`/docs`:``})});if(!t.ok){let e=yield t.json().catch(()=>({}));v((0,P.jsx)(d,{message:`could not add domain: ${e.error??`unknown error`}`}));return}}catch{v((0,P.jsx)(d,{message:`could not reach the server`}));return}let l=!1,u=!1;if(n){v((0,P.jsx)(p,{message:`setting base path to ${n}...`}));try{let e=yield gd(`${It}/api/cli/deployment/base-path/${c}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({basePath:n})});if(A(),e.ok){let t=yield e.json().catch(()=>({}));l=!0,u=!!t.pendingBasePathUpdate}else{let t=yield e.json().catch(()=>({})),n=t.issues?.[0]?.message??t.error??`unknown error`;v((0,P.jsx)(d,{message:`domain added, but base path was not saved: ${n}`}))}}catch{A(),v((0,P.jsx)(d,{message:`domain added, but base path was not saved: could not reach the server`}))}}v((0,P.jsx)(p,{message:`waiting for DNS records to generate (up to ${2*wd/1e3}s)...`}));let f=[],m=!1;try{for(let t=0;t<3;t++){let n=yield gd(`${It}/api/cli/deployment/custom-domain/${c}/${e}`);if(n.ok){f=(yield n.json()).cloudflare?.dnsRecords??[];let e=f.some(e=>e.value===`loading`);if(f.length>0&&!e){m=!0;break}}t<2&&(yield new Promise(e=>setTimeout(e,wd)))}}catch{A(),v((0,P.jsx)(d,{message:`domain added, but could not fetch DNS records`}));return}A();let h=f.filter(e=>e.type===`TXT`&&e.value!==`loading`),g=u?`domain ${e} added; base path ${n} queued for the next deploy`:l?`domain ${e} added (serving at ${n})`:`domain ${e} added`;v((0,P.jsx)(s,{message:g})),v((0,P.jsxs)(ct,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsx)(M,{bold:!0,children:`Add these DNS records with your domain provider:`}),(0,P.jsxs)(ct,{flexDirection:`column`,paddingLeft:3,children:[h.map(t=>(0,P.jsxs)(M,{children:[`TXT `,Lu(t.domain,e),` → `,t.value]},t.domain)),(0,P.jsxs)(M,{children:[`CNAME `,Lu(e,e),` → `,Rt]})]}),(0,P.jsx)(M,{dimColor:!0,children:`Add the TXT records first; add the CNAME once they're validated.`}),u&&(0,P.jsx)(M,{dimColor:!0,children:`The base path takes effect when that deploy finishes; the current path stays up until then.`}),l&&(0,P.jsxs)(M,{dimColor:!0,children:[`The CNAME sends all paths on `,e,` to Mintlify. Only add it if this domain hosts nothing else. Otherwise, set up a reverse proxy for `,n,`: https://www.mintlify.com/docs/deploy/docs-subpath`]}),!m&&(0,P.jsx)(M,{dimColor:!0,children:`Some TXT records are still being generated. Check the dashboard in a moment for the rest.`})]}))})}var Dd=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Od=nr({code:ir().optional(),error:ir().optional()});var kd=class extends Error{constructor(e,t){super(`Agent request failed (HTTP ${e}).${t?` Code: ${t}.`:``}`),this.status=e,this.code=t}};function Ad(e,t){return Dd(this,void 0,void 0,function*(){try{let n=AbortSignal.timeout(3e4),r=t?.signal?AbortSignal.any([t.signal,n]):n;return yield fetch(e,Object.assign(Object.assign({},t),{redirect:`error`,signal:r}))}catch{throw Error(`Could not reach the agent service. Retry the same command.`)}})}function jd(e,t){return Dd(this,void 0,void 0,function*(){let n=yield e.json().catch(()=>null);if(!e.ok){let t=Od.safeParse(n),r=t.success?t.data.code??t.data.error:void 0;throw new kd(e.status,r?.match(/^[a-z_]{1,80}$/)?.[0])}let r=t.safeParse(n);if(!r.success)throw Error(`The agent service returned an unexpected response.`);return r.data})}var Md=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Nd=nr({authorization_servers:ar(Qn()).min(1)}),Pd=nr({issuer:Qn(),token_endpoint:Qn(),agent_auth:nr({identity_endpoint:Qn(),claim_endpoint:Qn(),identity_types_supported:ar(ir())})}),Fd=nr({assertion:ir().min(1)}),Id=nr({id:ir().min(1),identity:Fd,claim:nr({token:ir().min(1)})}),Ld=nr({access_token:ir().min(1),expires_in:tr().positive(),token_type:ir().regex(/^bearer$/i)}),Rd=er(`identityType`,[nr({registrationId:ir(),identityType:cr(`anonymous`)}),nr({registrationId:ir(),identityType:cr(`user_bound`),userId:ir(),orgId:ir()})]);function zd(e){return Md(this,void 0,void 0,function*(){let t=(yield jd(yield Ad(`${e}/api/agent/.well-known/oauth-protected-resource`),Nd)).authorization_servers[0];if(!t||new URL(t).protocol!==`https:`)throw Error(`Agent authentication requires an HTTPS issuer.`);let n=yield jd(yield Ad(`${t.replace(/\/$/,``)}/.well-known/oauth-authorization-server`),Pd),r=new URL(t).origin;if([n.issuer,n.token_endpoint,n.agent_auth.identity_endpoint,n.agent_auth.claim_endpoint].some(e=>new URL(e).origin!==r))throw Error(`Agent authentication endpoints do not match the configured issuer.`);return n})}function Bd(e){return Md(this,void 0,void 0,function*(){if(!e.agent_auth.identity_types_supported.includes(`anonymous`))throw Error(`Anonymous registration is not enabled for this environment.`);let t=yield jd(yield Ad(e.agent_auth.identity_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`anonymous`})}),Id);return{registrationId:t.id,issuer:e.issuer,assertion:t.identity.assertion,claimToken:t.claim.token}})}function Vd(e,t){return Md(this,void 0,void 0,function*(){if(new URL(t.issuer).origin!==new URL(e.issuer).origin)throw Error(`Saved agent credentials belong to another issuer.`);if(t.accessToken&&(t.accessTokenExpiresAt??0)>Date.now()+3e4)return Object.assign(Object.assign({},t),{accessToken:t.accessToken});let n=yield jd(yield Ad(e.token_endpoint,{method:`POST`,body:new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:jwt-bearer`,assertion:t.assertion})}),Ld);return Object.assign(Object.assign({},t),{accessToken:n.access_token,accessTokenExpiresAt:Date.now()+n.expires_in*1e3})})}function Hd(e,t){return Md(this,void 0,void 0,function*(){return jd(yield Ad(`${e}/api/agent/identity`,{headers:{Authorization:`Bearer ${t}`}}),Rd)})}var Ud=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Wd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Gd=`mintlify-agent`,Kd=()=>Ir.join(Ut,`agent-credentials.json`),qd=nr({registrationId:ir().min(1),issuer:Qn(),assertion:ir().min(1),claimToken:ir().min(1),claimVerified:sr().optional(),accessToken:ir().min(1).optional(),accessTokenExpiresAt:tr().optional()});function Jd(e,t){return`project:${Br(`sha256`).update(JSON.stringify([new URL(e).origin,Ir.resolve(t)])).digest(`hex`)}`}function Yd(e,t){return`${new URL(e).origin}:${t}`}function Xd(){return Ud(this,void 0,void 0,function*(){try{return or(ir(),ir()).parse(JSON.parse(yield jr.readFile(Kd(),`utf-8`)))}catch{return{}}})}function Zd(e){return Ud(this,void 0,void 0,function*(){yield jr.mkdir(Ut,{recursive:!0});let t=`${Kd()}.${process.pid}.tmp`;yield jr.writeFile(t,JSON.stringify(e,null,2),{mode:384}),yield jr.chmod(t,384),yield jr.rename(t,Kd())})}function Qd(e){return Ud(this,void 0,void 0,function*(){let t;try{let t=yield(yield nd()).getPassword(Gd,e);if(t)return t}catch(e){t=e}let n=(yield Xd())[e];if(n)return n;if(t)throw t;return null})}function $d(e,t){return Ud(this,void 0,void 0,function*(){try{yield(yield nd()).setPassword(Gd,e,t)}catch{yield Zd(Object.assign(Object.assign({},yield Xd()),{[e]:t})),yield nd().then(t=>t.deletePassword(Gd,e)).catch(()=>{});return}let n=yield Xd(),r=e,i=n[r],a=Wd(n,[typeof r==`symbol`?r:r+``]);i&&(yield Zd(a).catch(()=>{}))})}function ef(e,t){return Ud(this,void 0,void 0,function*(){let n=yield Qd(Jd(e,t));if(!n)return null;let r=yield Qd(Yd(e,n));if(!r)throw Error(`Saved agent credentials are missing. Use --new to create another site.`);let i=qd.parse(JSON.parse(r));if(i.registrationId!==n)throw Error(`Saved agent credentials do not match this project.`);return i})}function tf(e,t,n){return Ud(this,void 0,void 0,function*(){let r=qd.parse(n);yield $d(Yd(e,r.registrationId),JSON.stringify(r)),yield $d(Jd(e,t),r.registrationId)})}const nf=fr.join(Ut,`anonymous-id`),rf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function af(){try{let e=Cr.readFileSync(nf,`utf-8`).trim();if(rf.test(e))return e}catch{}return null}function of(){let e=Dr.createHash(`sha256`);e.update(Er.hostname()),e.update(`\0`),e.update(Er.homedir()),e.update(`\0`),e.update(process.env.USER??process.env.USERNAME??``);let t=e.digest(`hex`).slice(0,32);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function sf(e){Cr.mkdirSync(fr.dirname(nf),{recursive:!0}),Cr.writeFileSync(nf,e,{flag:`wx`})}let cf=!1;function lf(){return uf(),cf}function uf(){let e=af();if(e)return e;let t=Dr.randomUUID();try{return sf(t),cf=!0,af()??t}catch(e){if(e.code===`EEXIST`){let e=af();if(e)return e;try{Cr.writeFileSync(nf,t)}catch{}return af()??t}}let n=of();try{Cr.mkdirSync(fr.dirname(nf),{recursive:!0}),Cr.writeFileSync(nf,n)}catch{}return af()??n}const df=fr.join(Ut,`telemetry-session.json`);let ff;function pf(e){let t=Dr.randomBytes(16);t.writeUIntBE(e,0,6),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=t.toString(`hex`);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function mf(){try{let{id:e,lastSeenAt:t}=JSON.parse(Cr.readFileSync(df,`utf-8`));return typeof e==`string`&&typeof t==`number`?{id:e,lastSeenAt:t}:null}catch{return null}}function hf(e=Date.now()){if(!ff){let t=mf();ff=t&&e-t.lastSeenAt<18e5?t.id:pf(e)}try{Cr.mkdirSync(Ut,{recursive:!0}),Cr.writeFileSync(df,JSON.stringify({id:ff,lastSeenAt:e}))}catch{}return ff}var gf=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function _f(){let e=gt();return{os:Er.platform(),arch:Er.arch(),node_version:process.version,is_ai_agent:e!==void 0,ai_agent:e,is_ci:ht(),is_tty:!!process.stdin.isTTY,is_first_run:lf(),$session_id:hf()}}function vf(e,t){return gf(this,void 0,void 0,function*(){yield Promise.race([nn().captureImmediate({distinctId:uf(),event:e,properties:t}).catch(()=>{}),new Promise(e=>{setTimeout(e,jt).unref()})])})}function yf(){return gf(this,void 0,void 0,function*(){try{let[e,t]=yield Promise.all([id(),od().catch(()=>null)]);if(!e)return{loggedIn:!1,email:null};if(t)return{loggedIn:!0,email:t};let n=yield bd(AbortSignal.timeout(Zt));if(!n.ok)return{loggedIn:!0,email:null};let r=n.status.user.email;return yield sd(r).catch(()=>{}),{loggedIn:!0,email:r}}catch{return{loggedIn:!1,email:null}}})}function bf(){return gf(this,void 0,void 0,function*(){let{loggedIn:e,email:t}=yield yf();return Object.assign({is_logged_in:e},t?{email:t,$set:{email:t}}:{})})}function xf(e){return gf(this,arguments,void 0,function*({command:e,cliVersion:t,subdomain:n}){if(!Gt())return;let r=gf(this,void 0,void 0,function*(){try{yield vf(`cli.command.executed`,Object.assign(Object.assign(Object.assign({command:e,cli_version:t},_f()),yield bf()),{subdomain:n}))}catch{}});rn(r),yield r})}function Sf(e,t){return gf(this,void 0,void 0,function*(){if(!Gt())return;let n=gf(this,void 0,void 0,function*(){try{let{cli:n}=Tt();yield vf(e,Object.assign(Object.assign(Object.assign(Object.assign({},t),{cli_version:n}),_f()),yield bf()))}catch{}});rn(n),yield n})}function Cf(){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.attempted`)})}function wf(){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.succeeded`)})}function Tf(e){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.failed`,{reason:e})})}function Ef(e,t){return gf(this,void 0,void 0,function*(){if(!Gt())return;let n=gf(this,void 0,void 0,function*(){try{let{cli:n}=Tt();yield vf(e,Object.assign(Object.assign(Object.assign(Object.assign({},t),{cli_version:n}),_f()),yield bf()))}catch{}});rn(n),yield n})}function Df(e){return gf(this,void 0,void 0,function*(){if(process.env.CLI_TEST_MODE!==`true`)try{let{cli:t}=Tt();yield vf(`cli.telemetry.preference_changed`,Object.assign({enabled:e.enabled,cli_version:t},_f()))}catch{}})}var Of=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const kf=nr({url:Qn()});function Af(e,t,n){return Of(this,void 0,void 0,function*(){let r=n===void 0?void 0:rr().parse(n),{accessToken:i}=yield Vd(yield zd(e),t),{url:a}=yield jd(yield Ad(`${e}/api/agent/claim-link`,{method:`POST`,headers:{Authorization:`Bearer ${i}`,"Content-Type":`application/json`},body:JSON.stringify({claimToken:t.claimToken})}),kf),o=new URL(a);return r&&o.searchParams.set(`email`,r),Ef(`agent_signup.claim_started`,{registration_id:t.registrationId}),o.toString()})}const jf=nr({identity:Fd}),Mf=nr({orgId:ir().min(1),claimed:cr(!0)});function Nf(e){return Of(this,arguments,void 0,function*(e,t=()=>{}){let{apiUrl:n,directory:r}=e,i=e.code?.trim(),a=e.email?.trim();if(i&&a)throw Error(`Pass --code to finish the claim, or leave it out to get a claim link.`);let o=yield ef(n,r);if(!o)throw Error(`No saved agent registration. Run from the directory used for mint deploy, or pass --directory.`);if(!i&&!o.claimVerified)return t(`Creating the claim link...`),`Claim link for the user: ${yield Af(n,o,a||void 0)}\nAsk the user to open it, sign in with any account, and click Confirm. The site then moves into their account; there is no code to relay and nothing more to run.`;let s=yield zd(n);if(new URL(s.issuer).origin!==new URL(o.issuer).origin)throw Error(`Saved agent credentials belong to another issuer.`);let c=e=>tf(n,r,e);if(!o.claimVerified){t(`Completing the WorkOS claim...`);let e=yield jd(yield Ad(`${s.agent_auth.claim_endpoint.replace(/\/$/,``)}/complete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({claim_token:o.claimToken,user_code:i})}),jf);Ef(`agent_signup.claim_completed`,{registration_id:o.registrationId}),o=Object.assign(Object.assign({},o),{assertion:e.identity.assertion,claimVerified:!0,accessToken:void 0,accessTokenExpiresAt:void 0}),yield c(o)}t(`Finishing the site claim...`);let l=yield Vd(s,o);return yield jd(yield Ad(`${n}/api/agent/signup`,{method:`POST`,headers:{Authorization:`Bearer ${l.accessToken}`}}),Mf),yield c(l),`Site claimed successfully. The user can now manage it in the Mintlify dashboard.`})}function Pf(){return Or.platform===`win32`?!!Or.env.WT_SESSION||!!Or.env.TERMINUS_SUBLIME||Or.env.ConEmuTask===`{cmd::Cmder}`||Or.env.TERM_PROGRAM===`Terminus-Sublime`||Or.env.TERM_PROGRAM===`vscode`||Or.env.TERM===`xterm-256color`||Or.env.TERM===`alacritty`||Or.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:Or.env.TERM!==`linux`}const Ff={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},If={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Lf={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Rf={...Ff,...If},zf={...Ff,...Lf},Bf=Pf()?Rf:zf;Object.entries(If);var Vf=/* @__PURE__ */ t(pt(),1);const Hf={icon:{checked:Vf.default.green(Bf.circleFilled),unchecked:Bf.circle,cursor:Bf.pointer},style:{disabledChoice:e=>Vf.default.dim(`- ${e}`),renderSelectedChoices:e=>e.map(e=>e.short).join(`, `),description:e=>Vf.default.cyan(e),keysHelpTip:e=>e.map(([e,t])=>`${Vf.default.bold(e)} ${Vf.default.dim(t)}`).join(Vf.default.dim(` • `))},helpMode:`always`,keybindings:[]};function Uf(e){return!yn.isSeparator(e)&&!e.disabled}function Wf(e){return Uf(e)&&e.checked}function Gf(e){return Uf(e)?{...e,checked:!e.checked}:e}function Kf(e){return function(t){return Uf(t)?{...t,checked:e}:t}}function qf(e){return e.map(e=>{if(yn.isSeparator(e))return e;if(typeof e==`string`)return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var Jf=pn((e,t)=>{let{instructions:n,pageSize:r=7,loop:i=!0,required:a,validate:o=()=>!0}=e,s={all:`a`,invert:`i`,...e.shortcuts},c=Sn(Hf,e.theme),{keybindings:l}=c,[u,d]=un(`idle`),f=mn({status:u,theme:c}),[p,m]=un(qf(e.choices)),h=cn(()=>{let e=p.findIndex(Uf),t=p.findLastIndex(Uf);if(e===-1)throw new vn(`[checkbox prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[p]),[g,_]=un(h.first),[v,y]=un();_n(async e=>{if(dn(e)){let e=p.filter(Wf),n=await o([...e]);a&&!p.some(Wf)?y(`At least one choice must be selected`):n===!0?(d(`done`),t(e.map(e=>e.value))):y(n||`You must select a valid value`)}else if(sn(e,l)||fn(e,l)){if(i||sn(e,l)&&g!==h.first||fn(e,l)&&g!==h.last){let t=sn(e,l)?-1:1,n=g;do n=(n+t+p.length)%p.length;while(!Uf(p[n]));_(n)}}else if(Cn(e))y(void 0),m(p.map((e,t)=>t===g?Gf(e):e));else if(e.name===s.all){let e=p.some(e=>Uf(e)&&!e.checked);m(p.map(Kf(e)))}else if(e.name===s.invert)m(p.map(Gf));else if(an(e)){let t=Number(e.name)-1,n=-1,r=p.findIndex(e=>!yn.isSeparator(e)&&(n++,n===t)),i=p[r];i&&Uf(i)&&(_(r),m(p.map((e,t)=>t===r?Gf(e):e)))}});let b=c.style.message(e.message,u),x,S=on({items:p,active:g,renderItem({item:e,isActive:t}){if(yn.isSeparator(e))return` ${e.separator}`;if(e.disabled){let t=typeof e.disabled==`string`?e.disabled:`(disabled)`;return c.style.disabledChoice(`${e.name} ${t}`)}t&&(x=e.description);let n=e.checked?c.icon.checked:c.icon.unchecked,r=e.checked?e.checkedName:e.name;return(t?c.style.highlight:e=>e)(`${t?c.icon.cursor:` `}${n} ${r}`)},pageSize:r,loop:i});if(u===`done`){let e=p.filter(Wf);return[f,b,c.style.answer(c.style.renderSelectedChoices(e,p))].filter(Boolean).join(` `)}let C;if(c.helpMode!==`never`&&n!==!1){if(typeof n==`string`)C=n;else{let e=[[`↑↓`,`navigate`],[`space`,`select`]];s.all&&e.push([s.all,`all`]),s.invert&&e.push([s.invert,`invert`]),e.push([`⏎`,`submit`]),C=c.style.keysHelpTip(e)}}return`${[[f,b].filter(Boolean).join(` `),S,` `,x?c.style.description(x):``,v?c.style.error(v):``,C].filter(Boolean).join(`
263
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}au.hasOwnProperty(t[0])&&!Ea[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=au[t[0]]+t.slice(1));var i=Hl.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Ea[this.mode][t]){this.settings.strict&&this.mode===`math`&&Xa.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Ea[this.mode][t].group,s=Wc.range(e);a=Fs(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Ii(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:Wc.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!iu[l])throw new F(`Unknown accent ' `+l+`'`,e);var u=iu[l][this.mode]||iu[l].text;if(!u)throw new F(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Wc.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};ou.endOfExpression=/* @__PURE__ */ new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var su=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new ou(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new F(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new Gc(`\\df@tag`)])}]}return r},cu=function(e,t,n){t.textContent=``;var r=fu(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),cu=function(){throw new F(`KaTeX doesn't work in quirks mode.`)});var lu=function(e,t){return fu(e,t).toMarkup()},uu=function(e,t){return su(e,new hi(t))},du=function(e,t,n){if(n.throwOnError||!(e instanceof F))throw e;var r=G([`katex-error`],[new fa(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},fu=function(e,t){var n=new hi(t);try{return Ts(su(e,n),e,n)}catch(t){return du(t,e,n)}},pu={version:`0.16.47`,render:cu,renderToString:lu,ParseError:F,SETTINGS_SCHEMA:di,__parse:uu,__renderToDomTree:fu,__renderToHTMLTree:function(e,t){var n=new hi(t);try{return Es(su(e,n),e,n)}catch(t){return du(t,e,n)}},__setFontMetrics:Sa,__defineSymbol:L,__defineFunction:K,__defineMacro:J,__domTree:{Span:ca,Anchor:la,SymbolNode:fa,SvgNode:pa,PathNode:ma,LineNode:ha}};const mu=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];function hu(e,t){let n=t>0?`_${t}`:``;return Oe(`param-${e}${n}`,{decamelize:!0,separator:`-`})}function gu(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Variation`}function _u(e){let t=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`is`);if(!t)return{kind:`missing`};if(typeof t.value==`string`){let e=t.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(!t.value)return{kind:`invalid`};let n=t.value.data?.estree,r=n?.body[0],i=r?.type===`ExpressionStatement`?r.expression:void 0;if(i?.type===`Literal`&&typeof i.value==`string`){let e=i.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`TemplateLiteral`&&i.expressions.length===0){let e=(i.quasis[0]?.value.cooked)?.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`ArrayExpression`){let e=[];for(let t of i.elements){if(t?.type!==`Literal`||typeof t.value!=`string`)return{kind:`invalid`};let n=t.value.trim();if(!n)return{kind:`invalid`};e.push(n)}return e.length>0?{kind:`valid`,ids:[...new Set(e)]}:{kind:`invalid`}}if(n)return{kind:`invalid`};let a=t.value.value.trim().match(/^(["'`])([\s\S]*)\1$/);return(a?.[2])?.trim()?{kind:`valid`,ids:[a[2].trim()]}:{kind:`invalid`}}const vu=[`h1`,`h2`,`h3`,`h4`],yu=[`Accordion`,`AccordionGroup`,`Expandable`,`Update`,`Prompt`];function bu(e,t){let n=e.find(e=>`name`in e&&e.name===t);if(n&&`value`in n&&typeof n.value==`string`)return n.value}const xu=e=>e&&[...e].sort(),Su=e=>{if(typeof e==`string`)return e;let t=Ln(Gn(e.groups));return JSON.stringify([xu(t?.includes),xu(t?.excludes)])},Cu=(e,t)=>{if(t===void 0)return!0;let n=new Set(e?.map(Su));return t.every(e=>n.has(Su(e)))},wu=(e,t)=>{let n=g();return r=>{let i=[],a=!1,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Set,p=l.includes(t?.mode??``);zn(r,e=>{if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`)for(let t of e.data?.islandHeadings??[])n.reserve(t.slug);e.type===`mdxJsxFlowElement`&&e.name&&yu.includes(e.name)&&zn(e,t=>{t!==e&&f.add(t)});let t=e;if(Wn(t)){let n=Jn(t),r=Xn(n);Kn(n)?zn(e,t=>{t!==e&&f.add(t)}):r&&zn(e,t=>{t!==e&&u.set(t,[...u.get(t)??[],r])})}if(e.type===`mdxJsxFlowElement`&&e.name===`Steps`){let t=bu(e.attributes,`titleSize`);if(t){let n=e=>{for(let r of e)r.type===`mdxJsxFlowElement`&&(r.name===`Step`?d.set(r,t):Nn(r)&&n(r.children))};n(e.children)}}if(e.type===`mdxJsxFlowElement`&&e.name===`Tab`){let t=bu(e.attributes,`id`),n=bu(e.attributes,`title`),r=t??(n?pe(Yn(e,n)):void 0);r&&zn(e,e=>{o.set(e,r)})}if(e.type===`mdxJsxFlowElement`&&e.name===`View`){let t=bu(e.attributes,`title`);t&&zn(e,e=>{s.set(e,t)})}let r=e;if(gu(r)){let t=_u(r),n=t.kind===`valid`?t.ids:[];zn(e,e=>{let t=c.get(e);c.set(e,t?t.filter(e=>n.includes(e)):n)})}});let m=(e,t)=>{if(!e.title.trim())return;if(t!==void 0&&Number(t)<=2){a=!0,i.push(e);return}let n=i;if(a){let t=i.at(-1);t&&!(t.depth>2&&t.depth>=e.depth)&&(t.tabId===void 0||t.tabId===e.tabId)&&(t.viewId===void 0||t.viewId===e.viewId)&&(t.variationIds===void 0||e.variationIds!==void 0&&e.variationIds.every(e=>t.variationIds?.includes(e)))&&Cu(e.authRules,t.authRules)&&(n=t.children)}n.push(e)};zn(r,e=>{if(f.has(e))return;let t=o.get(e),r=s.get(e),i=c.get(e),a=u.get(e);if(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`){let o=e.data?.tableOfContents;if(!o?.length)return;let s=e=>{for(let t of e)n.reserve(t.slug),s(t.children)};s(o);for(let e of o)m(Object.assign(Object.assign({},e),{tabId:t,viewId:r,variationIds:i,authRules:a||e.authRules?[...a??[],...e.authRules??[]]:void 0}),e.depth);return}if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`){if(p)return;for(let{title:n,slug:o,depth:s}of e.data?.islandHeadings??[])m({title:n,slug:o,depth:s,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},s);return}let l=e.type===`heading`&&T.includes(e.depth),h=e.type===`mdxJsxFlowElement`&&vu.includes(e.name??``),g=e.type===`mdxJsxFlowElement`&&e.name===`Heading`,_=e.type===`mdxJsxFlowElement`&&e.name===`Update`&&e.attributes.some(e=>`name`in e&&e.name===`label`),v=e.type===`mdxJsxFlowElement`&&e.name===`Step`?bu(e.attributes,`titleSize`)??d.get(e):void 0,y=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`noAnchor`&&(e.value==null||e.value===`true`||typeof e.value==`object`&&e.value.value===`true`)),b=e.type===`mdxJsxFlowElement`&&e.name===`Step`?Yn(e,bu(e.attributes,`title`)??``):void 0,x=e.type===`mdxJsxFlowElement`&&e.name===`Step`&&!y&&[`h2`,`h3`].includes(v??``)&&b?.trim()!==``,S=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`id`);if(!l&&!h&&!g&&!_&&!x||p&&(l||h))return;let C;if(`name`in e&&e.name===`Update`)C=1,e.depth=1;else if(`name`in e&&e.name===`Step`)C={h2:2,h3:3,h4:4}[v??``]??3,e.depth=C;else if(`depth`in e)C=e.depth;else if(`name`in e&&e.name===`Heading`){let t=e.attributes.find(e=>`name`in e&&e.name===`level`);t&&`value`in t&&typeof t.value==`number`&&(C=t.value)}else if(`name`in e&&e.name?.[1]){let t=Number(e.name[1]);C=isNaN(t)?void 0:t,C!==void 0&&(e.depth=C)}let w=b??qn(e),E,D=`name`in e&&(e.name===`Heading`||e.name===`Step`||e.name===`Update`)||S?bu(e.attributes,`id`):void 0;E=D?n.claim(Xe(D)||pe(w)):n.claim(pe(w));let O;if(`name`in e&&e.name===`Update`){let t=bu(e.attributes,`id`);O=t?t===E?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):[...e.attributes,Zn(`id`,E)]}else if(`name`in e&&e.name===`Step`){let t=bu(e.attributes,`id`);O=t?t===E?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):[...e.attributes,Zn(`id`,E)]}else if(`name`in e&&e.name===`Heading`)O=D&&E!==D?e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):e.attributes;else if(C!==void 0&&S){let t=D&&E!==D?e.attributes.map(e=>`name`in e&&e.name===`id`?Zn(`id`,E):e):e.attributes;O=[Zn(`level`,C),...t]}else C!==void 0&&!S&&(O=[Zn(`level`,C),Zn(`id`,E)],h&&e.attributes.length>0&&O.push(...e.attributes));e.attributes=O,e.type=`mdxJsxFlowElement`,e.name=e.name===`Update`?`Update`:e.name===`Step`?`Step`:`Heading`;let k=e.depth;m({title:w,slug:E,depth:k,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},C)}),e&&(e.tableOfContents=i)}},Tu=/* @__PURE__ */ new Set([`codeFenced`,`codeText`,`yaml`,`toml`]),Eu=[Tn([`yaml`,`toml`]),wn(),{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}],Du=e=>{let t=+!!e.startsWith(``),n=kn(Dn({extensions:Eu}).document().write(On()(e.slice(t),void 0,!0))),r=[];for(let[e,i]of n)e===`enter`&&Tu.has(i.type)&&r.push([i.start.offset+t,i.end.offset+t]);return r},Ou=/* @__PURE__ */ new Set(/* @__PURE__ */ `Info.Warning.Note.Tip.Check.Danger.Callout.AccordionGroup.Card.CardGroup.Tabs.CodeGroup.Column.Columns.CustomCode.CustomComponent.DynamicCustomComponent.Expandable.Frame.GitHub.Github.Icon.Latex.Mermaid.Panel.Popup.Prompt.List.Quote.RequestExample.ResponseExample.SnippetGroup.Steps.Tile.Tooltip.Tree.FileTree.Variation.Visibility.MDX.Badge.Color.ZoomImage`.split(`.`)),ku=/* @__PURE__ */ new Set([`Heading`,`Step`,`Update`]),Au=[`Example`,`Snippet`],ju=e=>Rn.includes(e)||Au.includes(e);function Mu(e){if(e===``)return`index`;if(e===`index`)return e;if(e.endsWith(`/index`)){let t=_(e);return t===``?`index`:t}return e}function Nu(e,t){return e==null||t==null||typeof e!=`string`||typeof t!=`string`?!1:Pu(e)===Pu(t)}function Pu(e){return Mu(oe(ce(e)))}const Fu=e=>e?e.replace(/!\[([^\]]*)\]\([^()]*(?:\([^()]*\)[^()]*)*\)/g,``).replace(/!\[([^\]]*)\]\[[^\]]*\]/g,``).replace(/\[([^\]]*)\]\([^()]*(?:\([^()]*\)[^()]*)*\)/g,`$1`).replace(/\[([^\]]*)\]\[[^\]]*\]/g,`$1`).replace(/\*{3}([^*]+)\*{3}/g,`$1`).replace(/_{3}([^_]+)_{3}/g,`$1`).replace(/\*{2}([^*]+)\*{2}/g,`$1`).replace(/_{2}([^_]+)_{2}/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/(?<!\w)_([^_]+)_(?!\w)/g,`$1`).replace(/`{3}([^`]+)`{3}/g,`$1`).replace(/`{2}([^`]+)`{2}/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/~~([^~]+)~~/g,`$1`).replace(/<\/?[a-zA-Z][^>]*>/g,``).replace(/\s+/g,` `).trim():null,Iu=e=>{let t=e.split(`.`);return t.length<2?e:t.slice(-2).join(`.`)},Lu=(e,t)=>{let n=Iu(t);return e===n?`@`:e.endsWith(`.${n}`)?e.slice(0,-(n.length+1)):e},Ru=[`/_next`,`/_mintlify`,`/_sites`,`/_live-preview`,`/api`,`/login`,`/logout`,`/mcp`,`/feedback`,`/openapi-specs.download`,`/llms.txt`,`/llms-full.txt`,`/sitemap.xml`,`/robots.txt`,`/skill.md`,`/.well-known`],zu=e=>{let t=e.trim();return t===`/`?t:t.replace(/\/+$/,``)},Bu=e=>Ru.some(t=>e===t||e.startsWith(`${t}/`)),Vu=e=>{let t=e.trim(),n=zu(e);if(t.length===0)return`Enter a base path.`;if(!t.startsWith(`/`))return`Base path must start with /.`;if(t===`/`)return`Base path must include a path segment.`;if(t.length>128)return`Base path must be at most 128 characters.`;if(t.startsWith(`//`)||t.includes(`://`))return`Base path cannot be an absolute URL.`;if(t.includes(`//`))return`Base path cannot contain consecutive slashes.`;if(/\s/.test(t))return`Base path cannot contain spaces.`;if(/[?#]/.test(t))return`Base path cannot include a query string or hash.`;if(t.split(`/`).some(e=>e===`.`||e===`..`))return`Base path cannot contain "." or ".." segments.`;if(Bu(n))return`Base path is reserved.`};var Hu=/* @__PURE__ */ n(((e,t)=>{t.exports=function(e){return!e||typeof e==`string`?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!==`String`)}})),Uu=/* @__PURE__ */ n(((e,t)=>{var n=Hu(),r=Array.prototype.concat,i=Array.prototype.slice,a=t.exports=function(e){for(var t=[],a=0,o=e.length;a<o;a++){var s=e[a];n(s)?t=r.call(t,i.call(s)):t.push(s)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}})),Wu=/* @__PURE__ */ n(((e,t)=>{var n=_t(),r=Uu(),i=Object.hasOwnProperty,a=Object.create(null);for(var o in n)i.call(n,o)&&(a[n[o]]=o);var s=t.exports={to:{},get:{}};s.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=s.get.hsl(e),r=`hsl`;break;case`hwb`:n=s.get.hwb(e),r=`hwb`;break;default:n=s.get.rgb(e),r=`rgb`}return n?{model:r,value:n}:null},s.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,l=[0,0,0,1],u,d,f;if(u=e.match(r)){for(f=u[2],u=u[1],d=0;d<3;d++){var p=d*2;l[d]=parseInt(u.slice(p,p+2),16)}f&&(l[3]=parseInt(f,16)/255)}else if(u=e.match(t)){for(u=u[1],f=u[3],d=0;d<3;d++)l[d]=parseInt(u[d]+u[d],16);f&&(l[3]=parseInt(f+f,16)/255)}else if(u=e.match(a)){for(d=0;d<3;d++)l[d]=parseInt(u[d+1],0);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(o)){for(d=0;d<3;d++)l[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(s))return u[1]===`transparent`?[0,0,0,0]:i.call(n,u[1])?(l=n[u[1]],l[3]=1,l):null;else return null;for(d=0;d<3;d++)l[d]=c(l[d],0,255);return l[3]=c(l[3],0,1),l},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var e=r(arguments);return`#`+l(e[0])+l(e[1])+l(e[2])+(e[3]<1?l(Math.round(e[3]*255)):``)},s.to.rgb=function(){var e=r(arguments);return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},s.to.rgb.percent=function(){var e=r(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+i+`%)`:`rgba(`+t+`%, `+n+`%, `+i+`%, `+e[3]+`)`},s.to.hsl=function(){var e=r(arguments);return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},s.to.hwb=function(){var e=r(arguments),t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},s.to.keyword=function(e){return a[e.slice(0,3)]};function c(e,t,n){return Math.min(Math.max(t,e),n)}function l(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}})),Gu=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=Wu(),r=mt(),i=[`keyword`,`gray`,`hex`],a={};for(let e of Object.keys(r))a[[...r[e].labels].sort().join(``)]=e;let o={};function s(e,t){if(!(this instanceof s))return new s(e,t);if(t&&t in i&&(t=null),t&&!(t in r))throw Error(`Unknown model: `+t);let c,l;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof s)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=n.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,l=r[this.model].channels,this.color=t.value.slice(0,l),this.valpha=typeof t.value[l]==`number`?t.value[l]:1}else if(e.length>0){this.model=t||`rgb`,l=r[this.model].channels;let n=Array.prototype.slice.call(e,0,l);this.color=p(n,l),this.valpha=typeof e[l]==`number`?e[l]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let n=t.sort().join(``);if(!(n in a))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=a[n];let{labels:i}=r[this.model],o=[];for(c=0;c<i.length;c++)o.push(e[i[c]]);this.color=p(o)}if(o[this.model])for(l=r[this.model].channels,c=0;c<l;c++){let e=o[this.model][c];e&&(this.color[c]=e(this.color[c]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}s.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in n.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to[t.model](r)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to.rgb.percent(r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=r[this.model],{labels:n}=r[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new s([...this.color.map(l(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new s([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:u(`rgb`,0,d(255)),green:u(`rgb`,1,d(255)),blue:u(`rgb`,2,d(255)),hue:u([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:u(`hsl`,1,d(100)),lightness:u(`hsl`,2,d(100)),saturationv:u(`hsv`,1,d(100)),value:u(`hsv`,2,d(100)),chroma:u(`hcg`,1,d(100)),gray:u(`hcg`,2,d(100)),white:u(`hwb`,1,d(100)),wblack:u(`hwb`,2,d(100)),cyan:u(`cmyk`,0,d(100)),magenta:u(`cmyk`,1,d(100)),yellow:u(`cmyk`,2,d(100)),black:u(`cmyk`,3,d(100)),x:u(`xyz`,0,d(95.047)),y:u(`xyz`,1,d(100)),z:u(`xyz`,2,d(108.833)),l:u(`lab`,0,d(100)),a:u(`lab`,1),b:u(`lab`,2),keyword(e){return e===void 0?r[this.model].keyword(this.color):new s(e)},hex(e){return e===void 0?n.to.hex(this.rgb().round().color):new s(e)},hexa(e){if(e!==void 0)return new s(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r=`0`+r),n.to.hex(t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return s.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),c=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-c;return s.rgb(c*n.red()+l*r.red(),c*n.green()+l*r.green(),c*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(r)){if(i.includes(e))continue;let{channels:t}=r[e];s.prototype[e]=function(...t){return this.model===e?new s(this):t.length>0?new s(t,e):new s([...f(r[this.model][e].raw(this.color)),this.valpha],e)},s[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=p(n,t)),new s(r,e)}}function c(e,t){return Number(e.toFixed(t))}function l(e){return function(t){return c(t,e)}}function u(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(o[r]||(o[r]=[]))[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function f(e){return Array.isArray(e)?e:[e]}function p(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}t.exports=s})))(),1);const Ku={AA_NORMAL:4.5,AA_LARGE:3,AAA_NORMAL:7,AAA_LARGE:4.5};function qu(e,t,n=Ku.AA_NORMAL){try{let r=(0,Gu.default)(e),i=(0,Gu.default)(t),a=r.contrast(i),o=r.level(i),s=o===`AA`||o===`AAA`,c=o===`AAA`,l,u;return n===Ku.AA_NORMAL?c?(l=`pass`,u=`Excellent contrast ratio: ${a.toFixed(2)}:1 (meets WCAG AAA)`):s?(l=`warning`,u=`Good contrast ratio: ${a.toFixed(2)}:1 (meets WCAG AA, consider AAA for better accessibility)`):(l=`fail`,u=`Poor contrast ratio: ${a.toFixed(2)}:1 (fails WCAG AA, minimum required: ${Ku.AA_NORMAL}:1)`):a>=n?(l=`pass`,u=`Contrast ratio: ${a.toFixed(2)}:1 (meets minimum threshold of ${n}:1)`):(l=`fail`,u=`Poor contrast ratio: ${a.toFixed(2)}:1 (fails minimum threshold, required: ${n}:1)`),{ratio:a,meetsAA:s,meetsAAA:c,recommendation:l,message:u}}catch{return null}}function Ju(e,t,n){let r=t.lightHex,i=t.darkHex,a=e.primary?qu(e.primary,r):null,o=e.light?qu(e.light,i):null,s=e.dark?qu(e.dark,i,3):null,c=e.dark?qu(e.dark,r,3):null,l=[];if(n?.global?.anchors){for(let e of n.global.anchors)if(e.color){let t=e.color.light?qu(e.color.light,r):null,n=e.color.dark?qu(e.color.dark,i):null;l.push({name:e.anchor,lightContrast:t,darkContrast:n})}}let u=[a,o,s,c,...l.flatMap(e=>[e.lightContrast,e.darkContrast])].filter(Boolean),d=u.some(e=>e.recommendation===`fail`),f=u.some(e=>e.recommendation===`warning`),p;return p=d?`fail`:f?`warning`:`pass`,{primaryContrast:a,lightContrast:o,darkContrast:s,darkOnLightContrast:c,anchorResults:l,overallScore:p}}var Yu=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Xu=()=>Yu(void 0,void 0,void 0,function*(){try{yield yt();let e=yield et(Nt,`docs`),t=yield et(Nt,`mint`);if(!e&&!t)return v((0,P.jsx)(d,{message:`No configuration file found. Please run this command from a directory with a mint.json or docs.json file.`})),1;let n=yield ze(Nt,e?`docs`:`mint`);if(!n?.colors)return v((0,P.jsx)(m,{message:`No colors section found in configuration file`})),0;let{colors:r,navigation:i}=n,{lightHex:a,darkHex:o}=ti(n),s=Ju(r,{lightHex:a,darkHex:o},i),c=(e,t,n=``)=>{if(!e)return;let{recommendation:r,message:i}=e,a=r===`pass`?`PASS`:r===`warning`?`WARN`:`FAIL`,o=r===`pass`?`green`:r===`warning`?`yellow`:`red`;v((0,P.jsxs)(M,{children:[(0,P.jsxs)(M,{bold:n===``,children:[n,t,`:`,` `]}),(0,P.jsxs)(M,{color:o,children:[a,` `,i]})]}))};v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking color accessibility...`})),v((0,P.jsx)(M,{})),c(s.primaryContrast,`Primary Color (${r.primary}) vs Light Background`),c(s.lightContrast,`Light Color (${r.light}) vs Dark Background`),c(s.darkContrast,`Dark Color (${r.dark}) vs Dark Background`),c(s.darkOnLightContrast,`Dark Color (${r.dark}) vs Light Background`);let l=s.anchorResults.filter(e=>e.lightContrast||e.darkContrast);if(l.length>0){v((0,P.jsx)(M,{})),v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Navigation Anchors:`}));for(let e of l)v((0,P.jsxs)(M,{bold:!0,children:[` `,e.name,`:`]})),c(e.lightContrast,`Light variant vs Light Background`,` `),c(e.darkContrast,`Dark variant vs Dark Background`,` `)}v((0,P.jsx)(M,{}));let u=s.overallScore===`pass`?`PASS`:s.overallScore===`warning`?`WARN`:`FAIL`,f=s.overallScore===`pass`?`green`:s.overallScore===`warning`?`yellow`:`red`,p=s.overallScore===`pass`?`All colors meet accessibility standards!`:s.overallScore===`warning`?`Some colors could be improved for better accessibility`:`Some colors fail accessibility standards and should be updated`;return v((0,P.jsx)(M,{children:(0,P.jsxs)(M,{bold:!0,color:f,children:[`Overall Assessment: `,u,` `,p]})})),+(s.overallScore===`fail`)}catch(e){return v((0,P.jsx)(d,{message:`Accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var Zu=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Qu=`mintlify`,$u=`access_token`,ed=`refresh_token`,td=`user_email`;function nd(){return Zu(this,void 0,void 0,function*(){try{let e=yield import(`keytar`);return e.default??e}catch{throw Error(`keytar is required for credential storage but is not installed. Install it with: npm install keytar`)}})}function rd(e,t,n){return Zu(this,void 0,void 0,function*(){let r=yield nd();yield Promise.all([r.setPassword(Qu,$u,e),r.setPassword(Qu,ed,t)]);try{n===null?yield r.deletePassword(Qu,td):n!==void 0&&(yield r.setPassword(Qu,td,n))}catch{}})}function id(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,$u)})}function ad(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,ed)})}function od(){return Zu(this,void 0,void 0,function*(){return(yield nd()).getPassword(Qu,td)})}function sd(e){return Zu(this,void 0,void 0,function*(){yield(yield nd()).setPassword(Qu,td,e)})}function cd(){return Zu(this,void 0,void 0,function*(){let e=yield nd();yield Promise.all([e.deletePassword(Qu,$u),e.deletePassword(Qu,ed),e.deletePassword(Qu,td).catch(()=>!1)])})}function ld(e){if(e)try{let t=e.split(`.`)[1];if(!t)return;let n=JSON.parse(Buffer.from(t,`base64url`).toString(`utf8`));return typeof n.email==`string`&&n.email.length>0?n.email:void 0}catch{return}}var ud=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};let dd=null;function fd(){return ud(this,void 0,void 0,function*(){return dd||(dd=pd().finally(()=>{dd=null}),dd)})}function pd(){return ud(this,void 0,void 0,function*(){try{let e=yield ad();if(!e)return null;let t=yield fetch(en,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`refresh_token`,refresh_token:e})});if(!t.ok)return null;let n=yield t.json().catch(()=>null);return!n?.access_token||!n.refresh_token?null:(yield rd(n.access_token,n.refresh_token,ld(n.id_token)),n.access_token)}catch{return null}})}var md=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function hd(){return md(this,void 0,void 0,function*(){try{return yield id()}catch{return null}})}function gd(e,t){return md(this,void 0,void 0,function*(){let n=yield hd(),r=process.env.MINTLIFY_SESSION_TOKEN,i=n??r;if(!i)throw Error("Not authenticated. Run `mint login` to authenticate.");let a=n=>fetch(e,Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t?.headers),{Authorization:`Bearer ${n}`})})),o=yield a(i);if(o.status!==401)return o;if(n){let e=yield fd();if(e)return a(e)}return r&&i!==r?a(r):o})}var _d=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const vd=nr({user:nr({email:ir()}),org:nr({name:ir()}),subdomains:ar(ir()).default([])});function yd(e){return _d(this,void 0,void 0,function*(){try{let t=yield fetch(`${It}/api/cli/status`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)return null;let n=yield t.json().catch(()=>null),r=vd.safeParse(n);return r.success?r.data:null}catch{return null}})}function bd(e){return _d(this,void 0,void 0,function*(){let t;try{t=yield gd(`${It}/api/cli/status`,{signal:e})}catch(e){let t=e instanceof Error?e.message:String(e);return/not authenticated/i.test(t)?{ok:!1,reason:`unauthenticated`}:{ok:!1,reason:`unreachable`,detail:t}}if(t.status===401||t.status===403)return{ok:!1,reason:`unauthenticated`};if(!t.ok)return{ok:!1,reason:`unreachable`,detail:`HTTP ${t.status}`};let n=vd.safeParse(yield t.json().catch(()=>null));return n.success?{ok:!0,status:n.data}:{ok:!1,reason:`invalid`}})}function xd(e){return _d(this,void 0,void 0,function*(){return(yield yd(e))?.subdomains??[]})}function Sd(){return _d(this,void 0,void 0,function*(){if(!((yield id().catch(()=>null))??process.env.MINTLIFY_SESSION_TOKEN))v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));else try{let e=yield gd(`${It}/api/cli/status`);if(!e.ok){v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));return}let t=yield e.json().catch(()=>null),n=vd.safeParse(t);if(!n.success){v((0,P.jsx)(d,{message:`unexpected response from server. please try again.`}));return}let{user:r,org:i,subdomains:a}=n.data,o=vt(),s=qt(`subdomain`),c=(s&&a.includes(s)?s:a[0])??null;c&&c!==s&&(yield Ht(`subdomain`,c).catch(()=>void 0)),v((0,P.jsxs)(ct,{flexDirection:`column`,paddingY:1,children:[o&&(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Version`})}),(0,P.jsx)(M,{children:o})]}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Email`})}),(0,P.jsx)(M,{children:r.email})]}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Organization`})}),(0,P.jsx)(M,{children:i.name})]}),c&&(0,P.jsxs)(ct,{children:[(0,P.jsx)(ct,{minWidth:16,children:(0,P.jsx)(M,{dimColor:!0,children:`Subdomain`})}),(0,P.jsx)(M,{children:c})]})]}))}catch{v((0,P.jsx)(d,{message:`unexpected response from server. please try again.`}))}})}var Cd=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const wd=5e3,Td=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;function Ed(e,t){return Cd(this,void 0,void 0,function*(){if(!Td.test(e)){v((0,P.jsx)(d,{message:`invalid domain "${e}". Expected a bare hostname, e.g. docs.example.com`}));return}let n=o(t?.trim());if(n){let e=Vu(n);if(e){v((0,P.jsx)(d,{message:`invalid base path "${t}": ${e}`}));return}}let r=yield id();if(!r){v((0,P.jsx)(d,{message:"not logged in. Run `mint login` to authenticate."}));return}let i=yield xd(r),a=qt(`subdomain`),c=a&&i.includes(a)?a:i[0];if(!c){v((0,P.jsx)(d,{message:"no subdomain found. Run `mint status` to check your account."}));return}try{let t=yield gd(`${It}/api/cli/deployment/custom-domain/${c}/${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({basePath:n?`/docs`:``})});if(!t.ok){let e=yield t.json().catch(()=>({}));v((0,P.jsx)(d,{message:`could not add domain: ${e.error??`unknown error`}`}));return}}catch{v((0,P.jsx)(d,{message:`could not reach the server`}));return}let l=!1,u=!1;if(n){v((0,P.jsx)(p,{message:`setting base path to ${n}...`}));try{let e=yield gd(`${It}/api/cli/deployment/base-path/${c}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({basePath:n})});if(A(),e.ok){let t=yield e.json().catch(()=>({}));l=!0,u=!!t.pendingBasePathUpdate}else{let t=yield e.json().catch(()=>({})),n=t.issues?.[0]?.message??t.error??`unknown error`;v((0,P.jsx)(d,{message:`domain added, but base path was not saved: ${n}`}))}}catch{A(),v((0,P.jsx)(d,{message:`domain added, but base path was not saved: could not reach the server`}))}}v((0,P.jsx)(p,{message:`waiting for DNS records to generate (up to ${2*wd/1e3}s)...`}));let f=[],m=!1;try{for(let t=0;t<3;t++){let n=yield gd(`${It}/api/cli/deployment/custom-domain/${c}/${e}`);if(n.ok){f=(yield n.json()).cloudflare?.dnsRecords??[];let e=f.some(e=>e.value===`loading`);if(f.length>0&&!e){m=!0;break}}t<2&&(yield new Promise(e=>setTimeout(e,wd)))}}catch{A(),v((0,P.jsx)(d,{message:`domain added, but could not fetch DNS records`}));return}A();let h=f.filter(e=>e.type===`TXT`&&e.value!==`loading`),g=u?`domain ${e} added; base path ${n} queued for the next deploy`:l?`domain ${e} added (serving at ${n})`:`domain ${e} added`;v((0,P.jsx)(s,{message:g})),v((0,P.jsxs)(ct,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsx)(M,{bold:!0,children:`Add these DNS records with your domain provider:`}),(0,P.jsxs)(ct,{flexDirection:`column`,paddingLeft:3,children:[h.map(t=>(0,P.jsxs)(M,{children:[`TXT `,Lu(t.domain,e),` → `,t.value]},t.domain)),(0,P.jsxs)(M,{children:[`CNAME `,Lu(e,e),` → `,Rt]})]}),(0,P.jsx)(M,{dimColor:!0,children:`Add the TXT records first; add the CNAME once they're validated.`}),u&&(0,P.jsx)(M,{dimColor:!0,children:`The base path takes effect when that deploy finishes; the current path stays up until then.`}),l&&(0,P.jsxs)(M,{dimColor:!0,children:[`The CNAME sends all paths on `,e,` to Mintlify. Only add it if this domain hosts nothing else. Otherwise, set up a reverse proxy for `,n,`: https://www.mintlify.com/docs/deploy/docs-subpath`]}),!m&&(0,P.jsx)(M,{dimColor:!0,children:`Some TXT records are still being generated. Check the dashboard in a moment for the rest.`})]}))})}var Dd=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Od=nr({code:ir().optional(),error:ir().optional()});var kd=class extends Error{constructor(e,t){super(`Agent request failed (HTTP ${e}).${t?` Code: ${t}.`:``}`),this.status=e,this.code=t}};function Ad(e,t){return Dd(this,void 0,void 0,function*(){try{let n=AbortSignal.timeout(3e4),r=t?.signal?AbortSignal.any([t.signal,n]):n;return yield fetch(e,Object.assign(Object.assign({},t),{redirect:`error`,signal:r}))}catch{throw Error(`Could not reach the agent service. Retry the same command.`)}})}function jd(e,t){return Dd(this,void 0,void 0,function*(){let n=yield e.json().catch(()=>null);if(!e.ok){let t=Od.safeParse(n),r=t.success?t.data.code??t.data.error:void 0;throw new kd(e.status,r?.match(/^[a-z_]{1,80}$/)?.[0])}let r=t.safeParse(n);if(!r.success)throw Error(`The agent service returned an unexpected response.`);return r.data})}var Md=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Nd=nr({authorization_servers:ar(Qn()).min(1)}),Pd=nr({issuer:Qn(),token_endpoint:Qn(),agent_auth:nr({identity_endpoint:Qn(),claim_endpoint:Qn(),identity_types_supported:ar(ir())})}),Fd=nr({assertion:ir().min(1)}),Id=nr({id:ir().min(1),identity:Fd,claim:nr({token:ir().min(1)})}),Ld=nr({access_token:ir().min(1),expires_in:tr().positive(),token_type:ir().regex(/^bearer$/i)}),Rd=er(`identityType`,[nr({registrationId:ir(),identityType:cr(`anonymous`)}),nr({registrationId:ir(),identityType:cr(`user_bound`),userId:ir(),orgId:ir()})]);function zd(e){return Md(this,void 0,void 0,function*(){let t=(yield jd(yield Ad(`${e}/api/agent/.well-known/oauth-protected-resource`),Nd)).authorization_servers[0];if(!t||new URL(t).protocol!==`https:`)throw Error(`Agent authentication requires an HTTPS issuer.`);let n=yield jd(yield Ad(`${t.replace(/\/$/,``)}/.well-known/oauth-authorization-server`),Pd),r=new URL(t).origin;if([n.issuer,n.token_endpoint,n.agent_auth.identity_endpoint,n.agent_auth.claim_endpoint].some(e=>new URL(e).origin!==r))throw Error(`Agent authentication endpoints do not match the configured issuer.`);return n})}function Bd(e){return Md(this,void 0,void 0,function*(){if(!e.agent_auth.identity_types_supported.includes(`anonymous`))throw Error(`Anonymous registration is not enabled for this environment.`);let t=yield jd(yield Ad(e.agent_auth.identity_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`anonymous`})}),Id);return{registrationId:t.id,issuer:e.issuer,assertion:t.identity.assertion,claimToken:t.claim.token}})}function Vd(e,t){return Md(this,void 0,void 0,function*(){if(new URL(t.issuer).origin!==new URL(e.issuer).origin)throw Error(`Saved agent credentials belong to another issuer.`);if(t.accessToken&&(t.accessTokenExpiresAt??0)>Date.now()+3e4)return Object.assign(Object.assign({},t),{accessToken:t.accessToken});let n=yield jd(yield Ad(e.token_endpoint,{method:`POST`,body:new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:jwt-bearer`,assertion:t.assertion})}),Ld);return Object.assign(Object.assign({},t),{accessToken:n.access_token,accessTokenExpiresAt:Date.now()+n.expires_in*1e3})})}function Hd(e,t){return Md(this,void 0,void 0,function*(){return jd(yield Ad(`${e}/api/agent/identity`,{headers:{Authorization:`Bearer ${t}`}}),Rd)})}var Ud=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Wd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Gd=`mintlify-agent`,Kd=()=>Ir.join(Ut,`agent-credentials.json`),qd=nr({registrationId:ir().min(1),issuer:Qn(),assertion:ir().min(1),claimToken:ir().min(1),claimVerified:sr().optional(),accessToken:ir().min(1).optional(),accessTokenExpiresAt:tr().optional()});function Jd(e,t){return`project:${Br(`sha256`).update(JSON.stringify([new URL(e).origin,Ir.resolve(t)])).digest(`hex`)}`}function Yd(e,t){return`${new URL(e).origin}:${t}`}function Xd(){return Ud(this,void 0,void 0,function*(){try{return or(ir(),ir()).parse(JSON.parse(yield jr.readFile(Kd(),`utf-8`)))}catch{return{}}})}function Zd(e){return Ud(this,void 0,void 0,function*(){yield jr.mkdir(Ut,{recursive:!0});let t=`${Kd()}.${process.pid}.tmp`;yield jr.writeFile(t,JSON.stringify(e,null,2),{mode:384}),yield jr.chmod(t,384),yield jr.rename(t,Kd())})}function Qd(e){return Ud(this,void 0,void 0,function*(){let t;try{let t=yield(yield nd()).getPassword(Gd,e);if(t)return t}catch(e){t=e}let n=(yield Xd())[e];if(n)return n;if(t)throw t;return null})}function $d(e,t){return Ud(this,void 0,void 0,function*(){try{yield(yield nd()).setPassword(Gd,e,t)}catch{yield Zd(Object.assign(Object.assign({},yield Xd()),{[e]:t})),yield nd().then(t=>t.deletePassword(Gd,e)).catch(()=>{});return}let n=yield Xd(),r=e,i=n[r],a=Wd(n,[typeof r==`symbol`?r:r+``]);i&&(yield Zd(a).catch(()=>{}))})}function ef(e,t){return Ud(this,void 0,void 0,function*(){let n=yield Qd(Jd(e,t));if(!n)return null;let r=yield Qd(Yd(e,n));if(!r)throw Error(`Saved agent credentials are missing. Use --new to create another site.`);let i=qd.parse(JSON.parse(r));if(i.registrationId!==n)throw Error(`Saved agent credentials do not match this project.`);return i})}function tf(e,t,n){return Ud(this,void 0,void 0,function*(){let r=qd.parse(n);yield $d(Yd(e,r.registrationId),JSON.stringify(r)),yield $d(Jd(e,t),r.registrationId)})}const nf=fr.join(Ut,`anonymous-id`),rf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function af(){try{let e=Cr.readFileSync(nf,`utf-8`).trim();if(rf.test(e))return e}catch{}return null}function of(){let e=Dr.createHash(`sha256`);e.update(Er.hostname()),e.update(`\0`),e.update(Er.homedir()),e.update(`\0`),e.update(process.env.USER??process.env.USERNAME??``);let t=e.digest(`hex`).slice(0,32);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function sf(e){Cr.mkdirSync(fr.dirname(nf),{recursive:!0}),Cr.writeFileSync(nf,e,{flag:`wx`})}let cf=!1;function lf(){return uf(),cf}function uf(){let e=af();if(e)return e;let t=Dr.randomUUID();try{return sf(t),cf=!0,af()??t}catch(e){if(e.code===`EEXIST`){let e=af();if(e)return e;try{Cr.writeFileSync(nf,t)}catch{}return af()??t}}let n=of();try{Cr.mkdirSync(fr.dirname(nf),{recursive:!0}),Cr.writeFileSync(nf,n)}catch{}return af()??n}const df=fr.join(Ut,`telemetry-session.json`);let ff;function pf(e){let t=Dr.randomBytes(16);t.writeUIntBE(e,0,6),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=t.toString(`hex`);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function mf(){try{let{id:e,lastSeenAt:t}=JSON.parse(Cr.readFileSync(df,`utf-8`));return typeof e==`string`&&typeof t==`number`?{id:e,lastSeenAt:t}:null}catch{return null}}function hf(e=Date.now()){if(!ff){let t=mf();ff=t&&e-t.lastSeenAt<18e5?t.id:pf(e)}try{Cr.mkdirSync(Ut,{recursive:!0}),Cr.writeFileSync(df,JSON.stringify({id:ff,lastSeenAt:e}))}catch{}return ff}var gf=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function _f(){let e=gt();return{os:Er.platform(),arch:Er.arch(),node_version:process.version,is_ai_agent:e!==void 0,ai_agent:e,is_ci:ht(),is_tty:!!process.stdin.isTTY,is_first_run:lf(),$session_id:hf()}}function vf(e,t){return gf(this,void 0,void 0,function*(){yield Promise.race([nn().captureImmediate({distinctId:uf(),event:e,properties:t}).catch(()=>{}),new Promise(e=>{setTimeout(e,jt).unref()})])})}function yf(){return gf(this,void 0,void 0,function*(){try{let[e,t]=yield Promise.all([id(),od().catch(()=>null)]);if(!e)return{loggedIn:!1,email:null};if(t)return{loggedIn:!0,email:t};let n=yield bd(AbortSignal.timeout(Zt));if(!n.ok)return{loggedIn:!0,email:null};let r=n.status.user.email;return yield sd(r).catch(()=>{}),{loggedIn:!0,email:r}}catch{return{loggedIn:!1,email:null}}})}function bf(){return gf(this,void 0,void 0,function*(){let{loggedIn:e,email:t}=yield yf();return Object.assign({is_logged_in:e},t?{email:t,$set:{email:t}}:{})})}function xf(e){return gf(this,arguments,void 0,function*({command:e,cliVersion:t,subdomain:n}){if(!Gt())return;let r=gf(this,void 0,void 0,function*(){try{yield vf(`cli.command.executed`,Object.assign(Object.assign(Object.assign({command:e,cli_version:t},_f()),yield bf()),{subdomain:n}))}catch{}});rn(r),yield r})}function Sf(e,t){return gf(this,void 0,void 0,function*(){if(!Gt())return;let n=gf(this,void 0,void 0,function*(){try{let{cli:n}=Tt();yield vf(e,Object.assign(Object.assign(Object.assign(Object.assign({},t),{cli_version:n}),_f()),yield bf()))}catch{}});rn(n),yield n})}function Cf(){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.attempted`)})}function wf(){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.succeeded`)})}function Tf(e){return gf(this,void 0,void 0,function*(){return Sf(`cli.login.failed`,{reason:e})})}function Ef(e,t){return gf(this,void 0,void 0,function*(){if(!Gt())return;let n=gf(this,void 0,void 0,function*(){try{let{cli:n}=Tt();yield vf(e,Object.assign(Object.assign(Object.assign(Object.assign({},t),{cli_version:n}),_f()),yield bf()))}catch{}});rn(n),yield n})}function Df(e){return gf(this,void 0,void 0,function*(){if(process.env.CLI_TEST_MODE!==`true`)try{let{cli:t}=Tt();yield vf(`cli.telemetry.preference_changed`,Object.assign({enabled:e.enabled,cli_version:t},_f()))}catch{}})}var Of=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const kf=nr({url:Qn()});function Af(e,t,n){return Of(this,void 0,void 0,function*(){let r=n===void 0?void 0:rr().parse(n),{accessToken:i}=yield Vd(yield zd(e),t),{url:a}=yield jd(yield Ad(`${e}/api/agent/claim-link`,{method:`POST`,headers:{Authorization:`Bearer ${i}`,"Content-Type":`application/json`},body:JSON.stringify({claimToken:t.claimToken})}),kf),o=new URL(a);return r&&o.searchParams.set(`email`,r),Ef(`agent_signup.claim_started`,{registration_id:t.registrationId}),o.toString()})}const jf=nr({identity:Fd}),Mf=nr({orgId:ir().min(1),claimed:cr(!0)});function Nf(e){return Of(this,arguments,void 0,function*(e,t=()=>{}){let{apiUrl:n,directory:r}=e,i=e.code?.trim(),a=e.email?.trim();if(i&&a)throw Error(`Pass --code to finish the claim, or leave it out to get a claim link.`);let o=yield ef(n,r);if(!o)throw Error(`No saved agent registration. Run from the directory used for mint deploy, or pass --directory.`);if(!i&&!o.claimVerified)return t(`Creating the claim link...`),`Claim link for the user: ${yield Af(n,o,a||void 0)}\nAsk the user to open it, sign in with any account, and click Confirm. The site then moves into their account; there is no code to relay and nothing more to run.`;let s=yield zd(n);if(new URL(s.issuer).origin!==new URL(o.issuer).origin)throw Error(`Saved agent credentials belong to another issuer.`);let c=e=>tf(n,r,e);if(!o.claimVerified){t(`Completing the WorkOS claim...`);let e=yield jd(yield Ad(`${s.agent_auth.claim_endpoint.replace(/\/$/,``)}/complete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({claim_token:o.claimToken,user_code:i})}),jf);Ef(`agent_signup.claim_completed`,{registration_id:o.registrationId}),o=Object.assign(Object.assign({},o),{assertion:e.identity.assertion,claimVerified:!0,accessToken:void 0,accessTokenExpiresAt:void 0}),yield c(o)}t(`Finishing the site claim...`);let l=yield Vd(s,o);return yield jd(yield Ad(`${n}/api/agent/signup`,{method:`POST`,headers:{Authorization:`Bearer ${l.accessToken}`}}),Mf),yield c(l),`Site claimed successfully. The user can now manage it in the Mintlify dashboard.`})}function Pf(){return Or.platform===`win32`?!!Or.env.WT_SESSION||!!Or.env.TERMINUS_SUBLIME||Or.env.ConEmuTask===`{cmd::Cmder}`||Or.env.TERM_PROGRAM===`Terminus-Sublime`||Or.env.TERM_PROGRAM===`vscode`||Or.env.TERM===`xterm-256color`||Or.env.TERM===`alacritty`||Or.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:Or.env.TERM!==`linux`}const Ff={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},If={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Lf={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Rf={...Ff,...If},zf={...Ff,...Lf},Bf=Pf()?Rf:zf;Object.entries(If);var Vf=/* @__PURE__ */ t(pt(),1);const Hf={icon:{checked:Vf.default.green(Bf.circleFilled),unchecked:Bf.circle,cursor:Bf.pointer},style:{disabledChoice:e=>Vf.default.dim(`- ${e}`),renderSelectedChoices:e=>e.map(e=>e.short).join(`, `),description:e=>Vf.default.cyan(e),keysHelpTip:e=>e.map(([e,t])=>`${Vf.default.bold(e)} ${Vf.default.dim(t)}`).join(Vf.default.dim(` • `))},helpMode:`always`,keybindings:[]};function Uf(e){return!yn.isSeparator(e)&&!e.disabled}function Wf(e){return Uf(e)&&e.checked}function Gf(e){return Uf(e)?{...e,checked:!e.checked}:e}function Kf(e){return function(t){return Uf(t)?{...t,checked:e}:t}}function qf(e){return e.map(e=>{if(yn.isSeparator(e))return e;if(typeof e==`string`)return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var Jf=pn((e,t)=>{let{instructions:n,pageSize:r=7,loop:i=!0,required:a,validate:o=()=>!0}=e,s={all:`a`,invert:`i`,...e.shortcuts},c=Sn(Hf,e.theme),{keybindings:l}=c,[u,d]=un(`idle`),f=mn({status:u,theme:c}),[p,m]=un(qf(e.choices)),h=cn(()=>{let e=p.findIndex(Uf),t=p.findLastIndex(Uf);if(e===-1)throw new vn(`[checkbox prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[p]),[g,_]=un(h.first),[v,y]=un();_n(async e=>{if(dn(e)){let e=p.filter(Wf),n=await o([...e]);a&&!p.some(Wf)?y(`At least one choice must be selected`):n===!0?(d(`done`),t(e.map(e=>e.value))):y(n||`You must select a valid value`)}else if(sn(e,l)||fn(e,l)){if(i||sn(e,l)&&g!==h.first||fn(e,l)&&g!==h.last){let t=sn(e,l)?-1:1,n=g;do n=(n+t+p.length)%p.length;while(!Uf(p[n]));_(n)}}else if(Cn(e))y(void 0),m(p.map((e,t)=>t===g?Gf(e):e));else if(e.name===s.all){let e=p.some(e=>Uf(e)&&!e.checked);m(p.map(Kf(e)))}else if(e.name===s.invert)m(p.map(Gf));else if(an(e)){let t=Number(e.name)-1,n=-1,r=p.findIndex(e=>!yn.isSeparator(e)&&(n++,n===t)),i=p[r];i&&Uf(i)&&(_(r),m(p.map((e,t)=>t===r?Gf(e):e)))}});let b=c.style.message(e.message,u),x,S=on({items:p,active:g,renderItem({item:e,isActive:t}){if(yn.isSeparator(e))return` ${e.separator}`;if(e.disabled){let t=typeof e.disabled==`string`?e.disabled:`(disabled)`;return c.style.disabledChoice(`${e.name} ${t}`)}t&&(x=e.description);let n=e.checked?c.icon.checked:c.icon.unchecked,r=e.checked?e.checkedName:e.name;return(t?c.style.highlight:e=>e)(`${t?c.icon.cursor:` `}${n} ${r}`)},pageSize:r,loop:i});if(u===`done`){let e=p.filter(Wf);return[f,b,c.style.answer(c.style.renderSelectedChoices(e,p))].filter(Boolean).join(` `)}let C;if(c.helpMode!==`never`&&n!==!1){if(typeof n==`string`)C=n;else{let e=[[`↑↓`,`navigate`],[`space`,`select`]];s.all&&e.push([s.all,`all`]),s.invert&&e.push([s.invert,`invert`]),e.push([`⏎`,`submit`]),C=c.style.keysHelpTip(e)}}return`${[[f,b].filter(Boolean).join(` `),S,` `,x?c.style.description(x):``,v?c.style.error(v):``,C].filter(Boolean).join(`
264
264
  `).trimEnd()}[?25l`});function Yf(){return Or.platform===`win32`?!!Or.env.WT_SESSION||!!Or.env.TERMINUS_SUBLIME||Or.env.ConEmuTask===`{cmd::Cmder}`||Or.env.TERM_PROGRAM===`Terminus-Sublime`||Or.env.TERM_PROGRAM===`vscode`||Or.env.TERM===`xterm-256color`||Or.env.TERM===`alacritty`||Or.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:Or.env.TERM!==`linux`}const Xf={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},Zf={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Qf={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},$f={...Xf,...Zf},ep={...Xf,...Qf},tp=Yf()?$f:ep;Object.entries(Zf);const np={icon:{cursor:tp.pointer},style:{disabled:e=>Vf.default.dim(`- ${e}`),description:e=>Vf.default.cyan(e),keysHelpTip:e=>e.map(([e,t])=>`${Vf.default.bold(e)} ${Vf.default.dim(t)}`).join(Vf.default.dim(` • `))},helpMode:`always`,indexMode:`hidden`,keybindings:[]};function rp(e){return!yn.isSeparator(e)&&!e.disabled}function ip(e){return e.map(e=>{if(yn.isSeparator(e))return e;if(typeof e==`string`)return{value:e,name:e,short:e,disabled:!1};let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var ap=pn((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,i=Sn(np,e.theme),{keybindings:a}=i,[o,s]=un(`idle`),c=mn({status:o,theme:i}),l=bn(),u=!a.includes(`vim`),d=cn(()=>ip(e.choices),[e.choices]),f=cn(()=>{let e=d.findIndex(rp),t=d.findLastIndex(rp);if(e===-1)throw new vn(`[select prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[d]),p=cn(()=>`default`in e?d.findIndex(t=>rp(t)&&t.value===e.default):-1,[e.default,d]),[m,h]=un(p===-1?f.first:p),g=d[m];_n((e,r)=>{if(clearTimeout(l.current),dn(e))s(`done`),t(g.value);else if(sn(e,a)||fn(e,a)){if(r.clearLine(0),n||sn(e,a)&&m!==f.first||fn(e,a)&&m!==f.last){let t=sn(e,a)?-1:1,n=m;do n=(n+t+d.length)%d.length;while(!rp(d[n]));h(n)}}else if(an(e)&&!Number.isNaN(Number(r.line))){let e=Number(r.line)-1,t=-1,n=d.findIndex(n=>!yn.isSeparator(n)&&(t++,t===e)),i=d[n];i!=null&&rp(i)&&h(n),l.current=setTimeout(()=>{r.clearLine(0)},700)}else if(hn(e))r.clearLine(0);else if(u){let e=r.line.toLowerCase(),t=d.findIndex(t=>yn.isSeparator(t)||!rp(t)?!1:t.name.toLowerCase().startsWith(e));t!==-1&&h(t),l.current=setTimeout(()=>{r.clearLine(0)},700)}}),ln(()=>()=>{clearTimeout(l.current)},[]);let _=i.style.message(e.message,o),v;if(i.helpMode!==`never`){if(e.instructions){let{pager:t,navigation:n}=e.instructions;v=i.style.help(d.length>r?t:n)}else v=i.style.keysHelpTip([[`↑↓`,`navigate`],[`⏎`,`select`]])}let y=0,b=on({items:d,active:m,renderItem({item:e,isActive:t,index:n}){if(yn.isSeparator(e))return y++,` ${e.separator}`;let r=i.indexMode===`number`?`${n+1-y}. `:``;if(e.disabled){let t=typeof e.disabled==`string`?e.disabled:`(disabled)`;return i.style.disabled(`${r}${e.name} ${t}`)}return(t?i.style.highlight:e=>e)(`${t?i.icon.cursor:` `} ${r}${e.name}`)},pageSize:r,loop:n});if(o===`done`)return[c,_,i.style.answer(g.short)].filter(Boolean).join(` `);let{description:x}=g;return`${[[c,_].filter(Boolean).join(` `),b,` `,x?i.style.description(x):``,v].filter(Boolean).join(`
265
265
  `).trimEnd()}[?25l`});function op(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&lp(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,r<e.length&&lp(e.charCodeAt(r)))for(r++;r<e.length&&lp(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r)}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&lp(e.charCodeAt(r))){for(r++;r<e.length&&lp(e.charCodeAt(r));)r++;n=r}else d=3}return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
266
266
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r}else{if(a>=0&&a<=31){if(cp(a)){t+=e.substring(i,r),d=2;break}d=6}r++}}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(sp(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(sp(t));return o=15}if(cp(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
@@ -554,7 +554,7 @@ Next steps:`,`1. Clone the knowledge base into ./${i}:`,` git -c http.${r.remo
554
554
  Next steps:`,`1. Clone the hosted repository into a separate directory. Do not replace the user’s existing Git remote.`,`2. Copy the selected documentation into its root, including docs.json, .md/.mdx pages, images, and other required assets. Exclude credentials, .env files, node_modules, and .git.`,`3. Commit the documentation. For subsequent updates, fetch the hosted main branch and commit on top of it. Do not force-push.`,`4. Push to main. Supply the write token as an HTTP Authorization: Bearer header for this Git operation only; never embed it in the remote URL or persist it in Git config.`,`5. If the write token expires, run mint deploy again from the same documentation directory to obtain a fresh token.`,`A successful push starts the normal build. Provisioning and Git success do not confirm build success.`,``,`Git examples (POSIX shell): set REPOSITORY_URL and WRITE_TOKEN from the output above. Set CHECKOUT_DIR to a new directory outside the source documentation directory. Keep the token private and do not enable shell tracing.`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git clone "$REPOSITORY_URL" "$CHECKOUT_DIR"',`After copying and committing the documentation:`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git -C "$CHECKOUT_DIR" push origin HEAD:main',`These settings apply only to that Git process. Use the same authentication settings for later fetches.`,``,...t?[`Claim link for the user: ${t}`,`Show this link to the user. They open it, sign in, and click Confirm; the site moves into their account. Do not sign in on their behalf. There is no code to relay.`]:Ov].join(`
555
555
  `):``}var Mv=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Nv=nr({id:tr().int().positive(),full_name:ir().regex(/^[\w.-]+\/[\w.-]+$/),default_branch:ir().min(1)}),Pv=Ir.join(`.github`,`workflows`,`mintlify.yml`);function Fv(e,t,n){return new Promise((r,i)=>{Lr(e,t,{cwd:n},(e,t)=>e?i(e):r(String(t).trim()))})}function Iv(e){let t=e.trim().match(/^(?:https:\/\/(?:[^@/]+@)?github\.com\/|ssh:\/\/git@github\.com(?::\d+)?\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return t?.[1]&&t[2]?{owner:t[1],repo:t[2]}:null}function Lv(e,t,n=``){let r=/^[\w./-]+$/.test(n)?n:JSON.stringify(n);return[`name: Deploy to Mintlify`,`on:`,` push:`,` branches: [${JSON.stringify(e)}]`,...n?[` paths: [${JSON.stringify(`${n}/**`)}, ".github/workflows/mintlify.yml"]`]:[],`permissions:`,` id-token: write`,` contents: read`,`concurrency:`,` group: mintlify-deploy`,` cancel-in-progress: true`,`jobs:`,` deploy:`,` runs-on: ubuntu-latest`,` steps:`,` - uses: actions/checkout@v4`,` - run: npx mint@latest deploy --subdomain ${t}${n?` --directory ${r}`:``}`,``].join(`
556
556
  `)}function Rv(e){return Mv(this,void 0,void 0,function*(){return jr.readFile(e,`utf8`).catch(e=>{if(e.code!==`ENOENT`)throw e})})}function zv(e,t){return Mv(this,arguments,void 0,function*(e,t,n=!1){let r=Ir.join(e,Pv),i=yield Rv(r);if(i===t)return`unchanged`;if(i!==void 0&&!n)throw Error(`${Pv} already exists with different contents. Pass --force to overwrite it.`);return yield jr.mkdir(Ir.dirname(r),{recursive:!0}),yield jr.writeFile(r,t),i===void 0?`created`:`updated`})}function Bv(e){return Mv(this,void 0,void 0,function*(){try{return yield Fv(`git`,[`rev-parse`,`--show-toplevel`],e)}catch{throw Error(`--github requires a Git repository. Run it inside your docs repository.`)}})}function Vv(e){return Mv(this,void 0,void 0,function*(){let t=yield Fv(`git`,[`remote`,`get-url`,`origin`],e).catch(()=>{throw Error(`This repository has no origin remote. Add a github.com origin and retry.`)}),n=Iv(t);if(!n)throw Error(`The origin remote (${t}) is not a github.com repository.`);let r=yield Fv(`gh`,[`api`,`repos/${n.owner}/${n.repo}`,`--jq`,`{id: .id, full_name: .full_name, default_branch: .default_branch}`],e).catch(e=>{throw e.code===`ENOENT`?Error("The GitHub CLI (gh) is required. Install it and run `gh auth login`."):Error(`Could not read ${n.owner}/${n.repo} with gh. Run \`gh auth login\` with access to the repository and retry.`)});try{return Nv.parse(JSON.parse(r))}catch{throw Error(`gh returned an unexpected repository response.`)}})}function Hv(e,t){return Mv(this,arguments,void 0,function*(e,t,n=()=>{}){let r=Ir.resolve(e.directory),i=yield Bv(r),[a,o]=yield Promise.all([jr.realpath(i),jr.realpath(r)]),s=Ir.relative(a,o).split(Ir.sep).join(`/`);if(!(yield Rv(Ir.join(r,`docs.json`))))throw Error(`No docs.json in ${r}. Pass the docs folder with --directory.`);n(`Resolving the GitHub repository...`);let c=yield Vv(i),l=yield mv(e,t,n);if(l.status===`claimed`)throw Error(`This site has been claimed. Setting up GitHub deploys for claimed sites is not supported yet; connect the repository from the Mintlify dashboard.`);let u=l.credentials.accessToken;if(!u)throw Error(`Agent authentication did not return an access token.`);n(`Trusting ${c.full_name}@${c.default_branch} to deploy...`),yield fv(e.apiUrl,u,{repositoryId:String(c.id),repository:c.full_name,branch:c.default_branch});let d=yield zv(i,Lv(c.default_branch,l.site.subdomain,s),e.force);return{siteUrl:hv(e.apiUrl,l.site.subdomain),subdomain:l.site.subdomain,repository:c.full_name,branch:c.default_branch,workflowPath:Pv,workflow:d}})}function Uv(e){return[`Site: ${e.siteUrl}`,`Trusted repository: ${e.repository} (branch ${e.branch})`,`Workflow: ${e.workflowPath} (${e.workflow})`,``,`Next steps:`,`1. Commit and push ${e.workflowPath} to ${e.branch}.`,`2. Every push to ${e.branch} then deploys ${e.subdomain} through GitHub Actions. No secrets are stored in the repository.`,``,...Ov].join(`
557
- `)}var Wv=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Gv=[`bug`,`docs`,`idea`];function Kv(e){return Wv(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${It}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function qv(e){return Wv(this,void 0,void 0,function*(){let t=yield Kv(e);return v(t?(0,P.jsx)(d,{message:t}):(0,P.jsx)(s,{message:`feedback sent`})),!t})}var Jv=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Yv=function(e){return this instanceof Yv?(this.v=e,this):new Yv(e)},Xv=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Zv=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Yv(e[r](t)),done:!1}:i?i(t):t}:i}},Qv=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Yv?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function $v(){return Jv(this,void 0,void 0,function*(){try{let e=yield jr.readFile(Ir.join(Nt,`.gitignore`),`utf-8`);return Re(e)}catch{return[]}})}function ey(e,t){return Qv(this,arguments,function*(){let n=yield Yv(jr.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Ir.join(e,r.name),i=Ir.relative(Nt,n).split(Ir.sep).join(`/`);st(i,t,r.isDirectory())||(r.isDirectory()?yield Yv(yield*Zv(Xv(ey(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield Yv(n)))}})}const ty=()=>Jv(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-js78Fb8_.js`),c=[...yield $v(),...yield Ze(Nt)],l=Fe(c),u=0,f=0,p=0;try{for(var m=!0,h=Xv(ey(Nt,l)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;u++;let t=Ir.relative(Nt,e);try{let t=yield jr.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield jr.writeFile(e,n),f++)}catch(e){p++,v((0,P.jsx)(d,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}v((0,P.jsx)(s,{message:`formatted ${f} of ${u} mdx file${u===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var ny=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),ry=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),iy=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=ny(),o=ry(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),ay=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),oy=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),sy=/* @__PURE__ */ n(((e,t)=>{t.exports=iy(),t.exports.Constants=ny(),t.exports.Errors=ry(),t.exports.FileAttr=ay(),t.exports.decoder=oy()})),cy=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ly=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),uy=/* @__PURE__ */ n((e=>{e.EntryHeader=cy(),e.MainHeader=ly()})),dy=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),fy=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),py=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=ry(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),my=/* @__PURE__ */ n((e=>{e.Deflater=dy(),e.Inflater=fy(),e.ZipCrypto=py()})),hy=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=uy(),i=n.Constants,a=my();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),gy=/* @__PURE__ */ n(((e,t)=>{let n=hy(),r=uy(),i=sy();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),_y=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=sy(),i=e(`path`),a=hy(),o=gy(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),vy=/* @__PURE__ */ t(tn(),1),yy=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const by=`mintlify`,xy=`templates`,Sy=`main`;function Cy(){return yy(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${by}/${xy}/contents/?ref=${Sy}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function wy(e){return yy(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${by}/${xy}/contents/${encodeURIComponent(e)}?ref=${Sy}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield Cy().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${by}/${xy}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Ty(){return yy(this,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`fetching available templates...`}));let e;try{e=yield Cy()}catch{throw A(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(A(),e.length===0)throw Error(`No templates are currently available.`);return ap({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Ey(e,t,n,r){return yy(this,void 0,void 0,function*(){let i=fr.join(e,`__template__.zip`),a=fr.join(e,`__template_extract__`);try{v((0,P.jsx)(p,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${by}/${xy}/archive/refs/heads/${Sy}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield vy.default.writeFile(i,Buffer.from(t))}finally{A()}v((0,P.jsx)(p,{message:`extracting template...`}));try{new _y.default(i).extractAllTo(a,!0)}finally{A()}let n=fr.join(a,`${xy}-${Sy}`),r=fr.join(n,t);if(!(yield vy.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield vy.default.copy(r,e,{overwrite:!0})}finally{yield vy.default.remove(i).catch(()=>{}),yield vy.default.remove(a).catch(()=>{})}let o=fr.join(e,`docs.json`);if(yield vy.default.pathExists(o)){let e=yield vy.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield vy.default.writeJson(o,e,{spaces:2})}})}var Dy=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Oy=e=>{k((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Dt()&&v((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},ky=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;k((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
557
+ `)}var Wv=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Gv=[`bug`,`docs`,`idea`];function Kv(e){return Wv(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${It}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function qv(e){return Wv(this,void 0,void 0,function*(){let t=yield Kv(e);return v(t?(0,P.jsx)(d,{message:t}):(0,P.jsx)(s,{message:`feedback sent`})),!t})}var Jv=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Yv=function(e){return this instanceof Yv?(this.v=e,this):new Yv(e)},Xv=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Zv=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Yv(e[r](t)),done:!1}:i?i(t):t}:i}},Qv=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Yv?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function $v(){return Jv(this,void 0,void 0,function*(){try{let e=yield jr.readFile(Ir.join(Nt,`.gitignore`),`utf-8`);return Re(e)}catch{return[]}})}function ey(e,t){return Qv(this,arguments,function*(){let n=yield Yv(jr.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Ir.join(e,r.name),i=Ir.relative(Nt,n).split(Ir.sep).join(`/`);st(i,t,r.isDirectory())||(r.isDirectory()?yield Yv(yield*Zv(Xv(ey(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield Yv(n)))}})}const ty=()=>Jv(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-3_OvM8TS.js`),c=[...yield $v(),...yield Ze(Nt)],l=Fe(c),u=0,f=0,p=0;try{for(var m=!0,h=Xv(ey(Nt,l)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;u++;let t=Ir.relative(Nt,e);try{let t=yield jr.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield jr.writeFile(e,n),f++)}catch(e){p++,v((0,P.jsx)(d,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}v((0,P.jsx)(s,{message:`formatted ${f} of ${u} mdx file${u===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var ny=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),ry=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),iy=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=ny(),o=ry(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),ay=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),oy=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),sy=/* @__PURE__ */ n(((e,t)=>{t.exports=iy(),t.exports.Constants=ny(),t.exports.Errors=ry(),t.exports.FileAttr=ay(),t.exports.decoder=oy()})),cy=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ly=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),uy=/* @__PURE__ */ n((e=>{e.EntryHeader=cy(),e.MainHeader=ly()})),dy=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),fy=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),py=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=ry(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),my=/* @__PURE__ */ n((e=>{e.Deflater=dy(),e.Inflater=fy(),e.ZipCrypto=py()})),hy=/* @__PURE__ */ n(((e,t)=>{var n=sy(),r=uy(),i=n.Constants,a=my();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),gy=/* @__PURE__ */ n(((e,t)=>{let n=hy(),r=uy(),i=sy();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),_y=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=sy(),i=e(`path`),a=hy(),o=gy(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),vy=/* @__PURE__ */ t(tn(),1),yy=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const by=`mintlify`,xy=`templates`,Sy=`main`;function Cy(){return yy(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${by}/${xy}/contents/?ref=${Sy}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function wy(e){return yy(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${by}/${xy}/contents/${encodeURIComponent(e)}?ref=${Sy}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield Cy().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${by}/${xy}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Ty(){return yy(this,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`fetching available templates...`}));let e;try{e=yield Cy()}catch{throw A(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(A(),e.length===0)throw Error(`No templates are currently available.`);return ap({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Ey(e,t,n,r){return yy(this,void 0,void 0,function*(){let i=fr.join(e,`__template__.zip`),a=fr.join(e,`__template_extract__`);try{v((0,P.jsx)(p,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${by}/${xy}/archive/refs/heads/${Sy}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield vy.default.writeFile(i,Buffer.from(t))}finally{A()}v((0,P.jsx)(p,{message:`extracting template...`}));try{new _y.default(i).extractAllTo(a,!0)}finally{A()}let n=fr.join(a,`${xy}-${Sy}`),r=fr.join(n,t);if(!(yield vy.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield vy.default.copy(r,e,{overwrite:!0})}finally{yield vy.default.remove(i).catch(()=>{}),yield vy.default.remove(a).catch(()=>{})}let o=fr.join(e,`docs.json`);if(yield vy.default.pathExists(o)){let e=yield vy.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield vy.default.writeJson(o,e,{spaces:2})}})}var Dy=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Oy=e=>{k((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(ct,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Dt()&&v((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},ky=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;k((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
558
558
  `)}),(0,P.jsx)(M,{children:"Command: `mint new [dir] --theme [theme] --name [name]` or `mint new [dir] --template [template] --name [name]`. --theme optionally overrides a template default. --force overwrites non-empty dirs. Use AskQuestion to present choices."}),(0,P.jsx)(M,{children:`</system-message>`}))};function Ay(e,t,n){return Dy(this,void 0,void 0,function*(){let r=yield Cy().catch(()=>void 0);ky(e,t,n,r)})}function jy(e,t,n){return Dy(this,void 0,void 0,function*(){if(!n)return e;if(Dt())return t?e:void 0;let r=yield ap({message:`Directory ${e} is not empty. What would you like to do?`,choices:[{name:`Create in a subdirectory`,value:`subdir`},{name:`Overwrite current directory (may lose contents)`,value:`overwrite`},{name:`Cancel`,value:`cancel`}]});if(r!==`cancel`){if(r===`subdir`){let t=yield gn({message:`Subdirectory name:`,default:`docs`});if(!t||t.trim()===``)throw Error(`Subdirectory name cannot be empty`);let n=e===`.`?t:`${e}/${t}`;return De(n,process.cwd()),n}return e}})}function My(e,t){return Dy(this,void 0,void 0,function*(){return t||gn({message:`Project Name`,default:e===`.`?`Mintlify`:e})})}function Ny(){return Dy(this,void 0,void 0,function*(){if((yield ap({message:`How would you like to set up your docs?`,choices:[{name:`Pick a theme`,value:`theme`},{name:`Clone a template`,value:`template`}]}))===`template`)return Ty()})}function Py(e,t,n,r,i){return Dy(this,void 0,void 0,function*(){De(e);let a=te.options.map(e=>e.shape.theme._def.value),o=(yield vy.default.readdir(e).catch(()=>[])).length>0;if(Dt()&&(!r||!i&&!n)||Dt()&&o&&!t){yield Ay(e,o,a);return}let s=i?yield wy(i).then(()=>i):!Dt()&&!n?yield Ny():void 0;if(s){let i=yield jy(e,t,o);if(i===void 0){Dt()&&(yield Ay(e,o,a));return}let c=yield My(i,r);yield vy.default.ensureDir(i),yield Ey(i,s,c,n),Oy(i);return}let c=yield jy(e,t,o);if(c===void 0){Dt()&&(yield Ay(e,o,a));return}let l=r,u=n;Dt()||u&&l||(l=yield My(c,l),u||=yield ap({message:`Theme`,choices:a.map(e=>({name:e,value:e}))})),l===void 0||u===void 0?yield Ay(c,o,a):(yield vy.default.ensureDir(c),yield Fy(c,l,u),Oy(c))})}const Fy=(e,t,n)=>Dy(void 0,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`downloading starter template...`}));let r=yield(yield fetch(`https://github.com/mintlify/starter/archive/refs/heads/main.zip`)).arrayBuffer();yield vy.default.writeFile(e+`/starter.zip`,Buffer.from(r)),A(),v((0,P.jsx)(p,{message:`extracting...`})),new _y.default(e+`/starter.zip`).extractAllTo(e,!0),A(),yield vy.default.copy(e+`/starter-main`,e,{overwrite:!0,filter:e=>!e.includes(`starter-main/starter-main`)}),yield vy.default.remove(e+`/starter.zip`),yield vy.default.remove(e+`/starter-main`);let i=e+`/docs.json`,a=yield vy.default.readJson(i);a.theme=n,a.name=t,yield vy.default.writeJson(i,a,{spaces:2})});var Iy=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Ly=[{name:`overview`,when:`Start here: how Mintlify works and facts agents most often get wrong`},{name:`new-site`,when:`New docs site, first publish, no account, claim a site, login, no docs.json yet`},{name:`write`,when:`Before creating a page or writing more than a sentence or two; changelogs`},{name:`write components`,when:`Adding or changing components: callouts, cards, steps, tabs, accordions, fields`},{name:`configure`,when:`Changing docs.json: theme, colors, logo, favicon, required fields`},{name:`configure navigation`,when:`Changing navigation: groups, tabs, anchors, dropdowns, products, versions, languages`},{name:`configure settings`,when:`navbar, footer, banner, SEO, search, integrations, contextual menu, redirects, 404`},{name:`configure customization`,when:`Themes, fonts, CSS, JavaScript, or React snippets`},{name:`api-docs`,when:`API documentation: OpenAPI, AsyncAPI, GraphQL, playground`},{name:`api-docs sdk`,when:`SDK reference pages, x-codeSamples, oneOf/anyOf, multiple responses, hiding endpoints`},{name:`publish`,when:`Deploying, "is it live", previews, rollbacks, MCP, llms.txt, skill.md, Markdown export`},{name:`publish domain`,when:`Custom domain (mint add-domain), /docs subpath, reverse proxy, CSP`},{name:`publish repo`,when:`Monorepo, multi-repo, GitHub/GitLab/Bitbucket, offline export, self-host`},{name:`publish analytics`,when:`mint analytics, feedback, search data, analytics integrations`},{name:`publish assistant`,when:`AI assistant, widget, Assistant.md, skills, narration, own model`},{name:`access`,when:`Private docs, reader login, user groups, personalization`},{name:`access team`,when:`Team members, roles, SSO, SCIM, audit logs, session security`},{name:`automate`,when:`Keep docs in sync with code: agent, Autopilot, automations, Slack, CI`},{name:`migrate`,when:`Moving docs from Docusaurus, GitBook, ReadMe, Fern, Document360, Confluence, Markdown`},{name:`troubleshoot`,when:`An error, a failed build or deploy, or the site looks wrong`}],Ry=()=>{let e=Math.max(...Ly.map(({name:e})=>e.length))+2;return[`Usage: mint instructions <topic> [subtopic]`,``,...Ly.map(({name:t,when:n})=>` ${t.padEnd(e)}${n}`),``].join(`
559
559
  `)},zy=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,By=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function Vy(e){return Iy(this,void 0,void 0,function*(){let t=zy(e),n=yield fetch(t);if(n.status===404)throw Error(`no instructions for "${e.join(` `)}". Run \`mint instructions\` to list topics.`);if(!n.ok)throw Error(`failed to fetch ${t}: ${n.status} ${n.statusText}`);return By(yield n.text())})}var Hy=/* @__PURE__ */ t(E(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const Uy=`ERR_INVALID_ARG_VALUE`;function Wy(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const Gy=Symbol(),Ky=Symbol(),qy=Symbol(),Jy=new TextEncoder,Yy=new TextDecoder;function Xy(e){return typeof e==`string`?Jy.encode(e):Yy.decode(e)}let Zy;if(Uint8Array.prototype.toBase64)Zy=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;Zy=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}let Qy;Qy=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw Wy(`The input to be decoded is not correctly encoded.`,Uy,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw Wy(`The input to be decoded is not correctly encoded.`,Uy,e)}};function $y(e){return typeof e==`string`?Qy(e):Zy(e)}var eb=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function tb(e,t,n){return new eb(e,{code:t,cause:n})}function nb(e,t,n,r){try{if(typeof e!=`string`)throw Wy(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw Wy(`${t} must not be empty`,Uy,r)}catch(e){throw n?tb(e.message,n,r):e}}function rb(){return $y(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function ib(){return rb()}function ab(){return rb()}function ob(){return rb()}async function sb(e){return nb(e,`codeVerifier`),$y(await crypto.subtle.digest(`SHA-256`,Xy(e)))}function cb(e){return nb(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function lb(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const ub=Symbol();typeof navigator<`u`&&navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const db=e=>fb.get(e);let fb,pb;function mb(e){return e===void 0?(pb||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=pb.get(t))||(hb(t.client_secret,`"metadata.client_secret"`),i=cb(t.client_secret),pb.set(t,i)),i(e,t,n,r)}):cb(e)}function hb(e,t){if(typeof e!=`string`)throw bb(`${t} must be a string`,yb);if(e.length===0)throw bb(`${t} must not be empty`,vb)}function gb(){return lb()}const _b=qy,vb=`ERR_INVALID_ARG_VALUE`,yb=`ERR_INVALID_ARG_TYPE`;function bb(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function xb(e){return sb(e)}function Sb(){return ib()}function Cb(){return ob()}function wb(){return ab()}new TextDecoder;function Tb(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function Eb(e){Object.defineProperties(e,Tb(e))}const Db=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw bb(`"clientId" must be a non-empty string`,yb);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw bb(`"clientId" and "metadata.client_id" must be the same`,vb);let i={...structuredClone(n),client_id:t};i[Gy]=n?.[Gy]??0,i[Ky]=n?.[Ky]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?mb(i.client_secret):gb());let o=Object.freeze(i),s=structuredClone(e);Db in e&&(s[ub]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);fb||=/* @__PURE__ */ new WeakMap,fb.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(db(this).as);return Eb(e),e}clientMetadata(){return structuredClone(db(this).c)}get timeout(){return db(this).timeout}set timeout(e){db(this).timeout=e}get[_b](){return db(this).fetch}set[_b](e){db(this).fetch=e}}.prototype);var Ob=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function kb(){return Ob(this,void 0,void 0,function*(){let{default:e}=yield import(`http`),t,n,r=!1,i=new Promise((e,r)=>{t=e,n=r}),a=e.createServer((e,n)=>{if(n.setHeader(`Access-Control-Allow-Origin`,Lt),n.setHeader(`Access-Control-Allow-Methods`,`POST, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type`),e.method===`OPTIONS`)n.writeHead(204),n.end();else if(e.method===`POST`){let i=``;e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let{code:e}=JSON.parse(i);n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0})),r=!0,a.close(),t(e)}catch{n.writeHead(400),n.end(JSON.stringify({error:`invalid body`}))}})}else n.writeHead(405),n.end()});return a.listen(Kt,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var Ab=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function jb(){return Ab(this,void 0,void 0,function*(){let e=Sb(),t=yield xb(e),n=Cb(),r=wb(),i=Buffer.from(JSON.stringify({nonce:n,clientState:r})).toString(`base64url`),a=new URL(`/api/cli/oauth/authorize`,Lt);a.searchParams.set(`state`,i),a.searchParams.set(`code_challenge`,t);let o=a.toString();Cf();let{codePromise:c,close:l}=yield kb();v((0,P.jsxs)(ct,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsxs)(M,{bold:!0,children:[(0,P.jsx)(M,{color:`green`,children:`◆ `}),`A browser window will open for Mintlify authentication`]}),(0,P.jsxs)(ct,{flexDirection:`column`,paddingLeft:3,gap:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL:`}),(0,P.jsx)(M,{dimColor:!0,children:o})]})]})),(0,Hy.default)(o).catch(()=>{}),v((0,P.jsxs)(ct,{flexDirection:`column`,paddingLeft:1,marginTop:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`╭─ Paste the authorization code from your browser`}),(0,P.jsx)(M,{dimColor:!0,children:`│`})]})),yield new Promise(e=>setTimeout(e,50));let u=gn({message:`█`,theme:{prefix:w.dim(` │`),style:{answer:e=>w.cyan(e)}}}),f;try{f=yield Promise.race([c,u])}catch{l(),u.cancel(),v((0,P.jsx)(d,{message:`login cancelled`}));return}l(),u.cancel();let p=yield fetch(en,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:f,code_verifier:e})}),m=yield p.json().catch(()=>({}));if(!p.ok){let e=m.error_message??m.error??`unknown error`;Tf(e),v((0,P.jsx)(d,{message:`login failed: ${e}`}));return}let h=m;yield rd(h.access_token,h.refresh_token,ld(h.id_token)??null),wf(),v((0,P.jsx)(s,{message:`logged in successfully`})),yield Nb(h.access_token)})}function Mb(e){return e instanceof Error&&e.name===`ExitPromptError`}function Nb(e){return Ab(this,void 0,void 0,function*(){let t=yield xd(e);if(t.length===0)return;if(t.length===1){yield Ht(`subdomain`,t[0]),v((0,P.jsx)(a,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield xn({message:`Select a default project`,source:e=>(e?t.filter(t=>t.toLowerCase().includes(e.toLowerCase())):t).map(e=>({name:e,value:e}))})}catch(e){if(Mb(e)){v((0,P.jsx)(a,{message:`No project set. To set a default project, run ${w.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield Ht(`subdomain`,n),v((0,P.jsx)(a,{message:`default project set to ${n}`}))})}var Pb=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Fb(){return Pb(this,void 0,void 0,function*(){yield cd(),v((0,P.jsx)(s,{message:`logged out successfully`}))})}var Ib=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Lb=(e,t)=>{let n=[],r=()=>t=>(zn(t,t=>{if(t.type===`image`){t.alt&&t.alt.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`img`,tagName:`image (markdown)`});return}let r=t;if(r.name===`img`||r.name===`video`){let i=r.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`alt`),a=r.attributes[i];a&&typeof a.value==`string`&&a.value.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:r.name,tagName:r.name})}else if(r.name===`a`){let i=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:`children`in e&&Array.isArray(e.children)?i(e.children):!1);i(r.children)||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`a`,tagName:`<a>`})}}),t);try{let e=t.replace(/^( {0,3}#{1,6}\s+.+?)\s*\{#[^}]+\}\s*$/gm,`$1`);tt().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},Rb=(...e)=>Ib(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield Ze(e),{contentFilenames:n}=yield je(e,t),r=[];for(let t of n)r.push(fr.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Cr.readFileSync(e,`utf-8`),n=Lb(e,t);n.length>0&&(i.push(...n),a.add(e))}catch(t){console.warn(`Warning: Could not read file ${e}: ${t}`)}return{missingAltAttributes:i,totalFiles:r.length,filesWithIssues:a.size}});var zb=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Bb=()=>zb(void 0,void 0,void 0,function*(){try{v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield Rb();if(e.missingAltAttributes.length===0)return v((0,P.jsx)(s,{message:`no accessibility issues found`})),v((0,P.jsxs)(M,{children:[`Checked `,e.totalFiles,` MDX files - all images and videos have alt attributes.`]})),0;let t={};e.missingAltAttributes.forEach(e=>{var n;t[e.filePath]||(t[e.filePath]=[]),(n=t[e.filePath])==null||n.push(e)}),v((0,P.jsxs)(M,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),v((0,P.jsx)(M,{}));for(let[e,n]of Object.entries(t)){let t=fr.relative(process.cwd(),e);v((0,P.jsxs)(M,{bold:!0,children:[t,`:`]}));for(let e of n){let t=e.line&&e.column?` (line ${e.line}, col ${e.column})`:``;e.element===`a`?v((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing text attribute `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]})):v((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing alt attribute on `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]}))}v((0,P.jsx)(M,{}))}return v((0,P.jsxs)(M,{color:`yellow`,children:[(0,P.jsx)(M,{bold:!0,children:`Recommendation:`}),` Add alt attributes to all images and videos for better accessibility.`]})),1}catch(e){return v((0,P.jsx)(d,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var Vb=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Hb=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),Ub=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),Wb=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),Gb=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),Kb=/* @__PURE__ */ new Set([`list`,`view`]);function qb(e){let t=e.filter(e=>typeof e==`string`);if(t.length===0)return``;let n=t[0],r=t[1],i=t[2];if(n===`scrape`&&r!==void 0&&Hb.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&Wb.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&Ub.has(r)){if(r===`conversation`&&i!==void 0&&Gb.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&Kb.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function Jb(){let e=!1;return function(t){return Vb(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=qb(t._),{cli:r}=Tt();xf({command:n,cliVersion:r,subdomain:qt(`subdomain`)})}})}}const Yb=zr(new URL(`../migrate`,import.meta.url)),Xb=(...e)=>xr(Ir.join(Yb,...e),`utf8`),Zb=e=>Sr(Ir.join(Yb,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),Qb=()=>[Xb(`index.md`).trimEnd(),`Topics: ${Zb(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${Zb(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
560
560