@pretextbook/import 0.14.0 → 0.14.1
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.
- package/dist/convert-worker.cjs +1 -1
- package/dist/convert-worker.js +1 -1
- package/dist/{engine-routing-B03PZ4P-.cjs → engine-routing-DXWabWIt.cjs} +1 -1
- package/dist/{engine-routing-vjkGBbmx.js → engine-routing-S5C2oiB0.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/layout/xml-scan.d.ts +21 -0
- package/dist/lib/pretext-divisions.d.ts +2 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/{upload-w0BmYtpp.js → upload-CjdLu68g.js} +944 -910
- package/dist/{upload-CPMLFrdG.cjs → upload-DYjX5ohJ.cjs} +38 -38
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { formatPretext as
|
|
2
|
-
import { latexToPretext as
|
|
3
|
-
import { markdownToPretext as
|
|
4
|
-
const
|
|
1
|
+
import { formatPretext as ci } from "@pretextbook/format";
|
|
2
|
+
import { latexToPretext as li } from "@pretextbook/latex-pretext";
|
|
3
|
+
import { markdownToPretext as ui } from "@pretextbook/remark-pretext";
|
|
4
|
+
const di = [
|
|
5
5
|
"\\documentclass",
|
|
6
6
|
"\\begin{document}",
|
|
7
7
|
"\\begin{",
|
|
@@ -9,21 +9,21 @@ const li = [
|
|
|
9
9
|
"\\chapter",
|
|
10
10
|
"\\title",
|
|
11
11
|
"\\author"
|
|
12
|
-
],
|
|
13
|
-
function
|
|
12
|
+
], fi = ["# ", "## ", "### ", "#### "];
|
|
13
|
+
function ve(t) {
|
|
14
14
|
const r = t.trim();
|
|
15
|
-
return !r || r.startsWith("<") ? "pretext" :
|
|
15
|
+
return !r || r.startsWith("<") ? "pretext" : di.some((n) => r.includes(n)) ? "latex" : fi.some((n) => r.startsWith(n)) ? "markdown" : "pretext";
|
|
16
16
|
}
|
|
17
|
-
const di = /* @__PURE__ */ JSON.parse('[" ","!","\\"","#","&","\'","*",",",".",":",";","=",">","AA","AE","Alpha","And","Arrowvert","Bbb","Bbbk","Beta","Big","Bigg","Biggl","Biggm","Biggr","Bigl","Bigm","Bigr","Box","Bra","Bumpeq","C","Cap","Chi","Colonapprox","Coloneq","Coloneqq","Colonsim","Complex","Coppa","Cup","Dagger","Darr","DeclareMathOperator","Delta","Diamond","Digamma","Doteq","Downarrow","Epsilon","Eqcolon","Eqqcolon","Eta","Finv","Game","Gamma","H","Harr","Huge","Im","Iota","Join","KaTeX","Kappa","Ket","Koppa","L","LARGE","LaTeX","Lambda","Large","Larr","LeftArrow","Leftarrow","Leftrightarrow","Lleftarrow","Longleftarrow","Longleftrightarrow","Longrightarrow","Lrarr","Lsh","Mu","N","Newextarrow","Nu","O","OE","Omega","Omicron","Overrightarrow","P","Phi","Pi","Pr","Psi","Q","R","Rarr","Re","Reals","Rho","Rightarrow","Rrightarrow","Rsh","Rule","S","Sampi","Sigma","Space","Stigma","Subset","Supset","Tau","TeX","Theta","Tiny","Uarr","Uparrow","Updownarrow","Upsilon","Vdash","Vert","Vvdash","Xi","Z","Zeta","\\\\","^","_","`","aa","above","abovewithdelims","acute","add","ae","alef","alefsym","aleph","allowbreak","alpha","amalg","and","ang","angl","angle","angln","approx","approxcolon","approxcoloncolon","approxeq","arccos","arcctg","arcsin","arctan","arctg","arg","argmax","argmin","array","arraystretch","arrowvert","ast","asymp","atop","atopwithdelims","backepsilon","backprime","backsim","backsimeq","backslash","bar","barwedge","bbox","bcancel","because","begin","begingroup","beta","beth","between","bf","bfseries","big","bigcap","bigcirc","bigcup","bigg","biggl","biggm","biggr","bigl","bigm","bigodot","bigominus","bigoplus","bigoslash","bigotimes","bigr","bigsqcap","bigsqcup","bigstar","bigtriangledown","bigtriangleup","biguplus","bigvee","bigwedge","binom","blacklozenge","blacksquare","blacktriangle","blacktriangledown","blacktriangleleft","blacktriangleright","bm","bmod","bold","boldsymbol","bot","bowtie","boxdot","boxed","boxminus","boxplus","boxtimes","bra","brace","bracevert","brack","braket","breve","buildrel","bull","bullet","bumpeq","cal","cancel","cancelto","cap","cases","cdot","cdotp","cdots","ce","cee","centerdot","cf","cfrac","ch","char","check","checkmark","chi","chk","choose","circ","circeq","circlearrowleft","circlearrowright","circledR","circledS","circledast","circledcirc","circleddash","class","cline","clubs","clubsuit","cnums","colon","colonapprox","coloncolon","coloncolonapprox","coloncolonequals","coloncolonminus","coloncolonsim","coloneq","coloneqq","colonequals","colonminus","colonsim","color","colorbox","complement","cong","coppa","coprod","copyright","cos","cosec","cosh","cot","cotg","coth","cr","csc","cssId","ctg","cth","cup","curlyeqprec","curlyeqsucc","curlyvee","curlywedge","curvearrowleft","curvearrowright","dArr","dag","dagger","daleth","darr","dashleftarrow","dashrightarrow","dashv","dbinom","dblcolon","ddag","ddagger","ddddot","dddot","ddot","ddots","def","definecolor","deg","degree","delta","det","dfrac","diagdown","diagup","diamond","diamonds","diamondsuit","digamma","dim","displaylines","displaystyle","div","divideontimes","dot","doteq","doteqdot","dotplus","dots","dotsb","dotsc","dotsi","dotsm","dotso","doublebarwedge","doublecap","doublecup","downarrow","downdownarrows","downharpoonleft","downharpoonright","edef","ell","else","em","emph","empty","emptyset","enclose","end","endgroup","enspace","epsilon","eqalign","eqalignno","eqcirc","eqcolon","eqqcolon","eqref","eqsim","eqslantgtr","eqslantless","equalscolon","equalscoloncolon","equiv","eta","eth","euro","exist","exists","exp","expandafter","fallingdotseq","fbox","fcolorbox","fi","flat","foo","footnotesize","forall","frac","frak","frown","futurelet","gamma","gcd","gdef","ge","geneuro","geneuronarrow","geneurowide","genfrac","geq","geqq","geqslant","gets","gg","ggg","gggtr","gimel","global","gnapprox","gneq","gneqq","gnsim","grave","greet","gt","gtrapprox","gtrdot","gtreqless","gtreqqless","gtrless","gtrsim","gvertneqq","hArr","hail","harr","hat","hbar","hbox","hdashline","hearts","heartsuit","hfil","hfill","hline","hom","hookleftarrow","hookrightarrow","hphantom","href","hskip","hslash","hspace","htmlClass","htmlData","htmlId","htmlStyle","huge","i","iddots","idotsint","if","iff","ifmode","ifx","iiiint","iiint","iint","image","imageof","imath","impliedby","implies","in","includegraphics","inf","infin","infty","injlim","int","intercal","intop","iota","isin","it","itshape","j","jmath","kappa","ker","kern","ket","koppa","l","lArr","lBrace","lVert","label","lambda","land","lang","langle","large","larr","lbrace","lbrack","lceil","ldotp","ldots","le","leadsto","left","leftarrow","leftarrowtail","leftharpoondown","leftharpoonup","leftleftarrows","leftrightarrow","leftrightarrows","leftrightharpoons","leftrightsquigarrow","leftroot","leftthreetimes","leq","leqalignno","leqq","leqslant","lessapprox","lessdot","lesseqgtr","lesseqqgtr","lessgtr","lesssim","let","lfloor","lg","lgroup","lhd","lim","liminf","limits","limsup","ll","llap","llbracket","llcorner","lll","llless","lmoustache","ln","lnapprox","lneq","lneqq","lnot","lnsim","log","long","longleftarrow","longleftrightarrow","longmapsto","longrightarrow","looparrowleft","looparrowright","lor","lower","lozenge","lparen","lq","lrArr","lrarr","lrcorner","lt","ltimes","lvert","lvertneqq","maltese","mapsto","mathbb","mathbf","mathbin","mathcal","mathchoice","mathclap","mathclose","mathellipsis","mathfrak","mathinner","mathit","mathllap","mathnormal","mathop","mathopen","mathord","mathpunct","mathrel","mathring","mathrlap","mathrm","mathscr","mathsf","mathsterling","mathstrut","mathtip","mathtt","matrix","max","mbox","md","mdseries","measuredangle","medspace","mho","mid","middle","min","minuscolon","minuscoloncolon","minuso","mit","mkern","mmlToken","mod","models","moveleft","moveright","mp","mskip","mspace","mu","multicolumn","multimap","nLeftarrow","nLeftrightarrow","nRightarrow","nVDash","nVdash","nabla","natnums","natural","ncong","ne","nearrow","neg","negmedspace","negthickspace","negthinspace","neq","newcommand","newenvironment","newline","nexists","ngeq","ngeqq","ngeqslant","ngtr","ni","nleftarrow","nleftrightarrow","nleq","nleqq","nleqslant","nless","nmid","nobreak","nobreakspace","noexpand","nolimits","nonumber","normalfont","normalsize","not","notag","notin","notni","nparallel","nprec","npreceq","nrightarrow","nshortmid","nshortparallel","nsim","nsubseteq","nsubseteqq","nsucc","nsucceq","nsupseteq","nsupseteqq","ntriangleleft","ntrianglelefteq","ntriangleright","ntrianglerighteq","nu","nvDash","nvdash","nwarrow","o","odot","oe","officialeuro","oiiint","oiint","oint","oldstyle","omega","omicron","ominus","operatorname","operatornamewithlimits","oplus","or","origof","oslash","otimes","over","overbrace","overbracket","overgroup","overleftarrow","overleftharpoon","overleftrightarrow","overline","overlinesegment","overparen","overrightarrow","overrightharpoon","overset","overwithdelims","owns","pagecolor","parallel","part","partial","perp","phantom","phase","phi","pi","pitchfork","plim","plusmn","pm","pmatrix","pmb","pmod","pod","pounds","prec","precapprox","preccurlyeq","preceq","precnapprox","precneqq","precnsim","precsim","prime","prod","projlim","propto","providecommand","psi","pu","qquad","quad","r","rArr","rBrace","rVert","raise","raisebox","rang","rangle","rarr","ratio","rbrace","rbrack","rceil","real","reals","ref","relax","renewcommand","renewenvironment","require","restriction","rfloor","rgroup","rhd","rho","right","rightarrow","rightarrowtail","rightharpoondown","rightharpoonup","rightleftarrows","rightleftharpoons","rightrightarrows","rightsquigarrow","rightthreetimes","risingdotseq","rlap","rm","rmoustache","root","rotatebox","rparen","rq","rrbracket","rtimes","rule","rvert","sampi","sc","scalebox","scr","scriptscriptstyle","scriptsize","scriptstyle","sdot","searrow","sec","sect","setlength","setminus","sf","sh","sharp","shortmid","shortparallel","shoveleft","shoveright","sideset","sigma","sim","simcolon","simcoloncolon","simeq","sin","sinh","sixptsize","skew","skip","sl","small","smallfrown","smallint","smallsetminus","smallsmile","smash","smile","smiley","sout","space","spades","spadesuit","sphericalangle","sqcap","sqcup","sqrt","sqsubset","sqsubseteq","sqsupset","sqsupseteq","square","ss","stackrel","star","stigma","strut","style","sub","sube","subset","subseteq","subseteqq","subsetneq","subsetneqq","substack","succ","succapprox","succcurlyeq","succeq","succnapprox","succneqq","succnsim","succsim","sum","sup","supe","supset","supseteq","supseteqq","supsetneq","supsetneqq","surd","swarrow","tag","tan","tanh","tau","tbinom","text","textasciicircum","textasciitilde","textbackslash","textbar","textbardbl","textbf","textbraceleft","textbraceright","textcircled","textcolor","textdagger","textdaggerdbl","textdegree","textdollar","textellipsis","textemdash","textendash","textgreater","textit","textless","textmd","textnormal","textquotedblleft","textquotedblright","textquoteleft","textquoteright","textregistered","textrm","textsc","textsf","textsl","textsterling","textstyle","texttip","texttt","textunderscore","textup","textvisiblespace","tfrac","tg","th","therefore","theta","thetasym","thickapprox","thicksim","thickspace","thinspace","tilde","times","tiny","to","toggle","top","triangle","triangledown","triangleleft","trianglelefteq","triangleq","triangleright","trianglerighteq","tt","twoheadleftarrow","twoheadrightarrow","u","uArr","uarr","ulcorner","underbar","underbrace","underbracket","undergroup","underleftarrow","underleftrightarrow","underline","underlinesegment","underparen","underrightarrow","underset","unicode","unlhd","unrhd","up","uparrow","updownarrow","upharpoonleft","upharpoonright","uplus","uproot","upshape","upsilon","upuparrows","urcorner","url","utilde","v","vDash","varDelta","varGamma","varLambda","varOmega","varPhi","varPi","varPsi","varSigma","varTheta","varUpsilon","varXi","varcoppa","varepsilon","varinjlim","varkappa","varliminf","varlimsup","varnothing","varphi","varpi","varprojlim","varpropto","varrho","varsigma","varstigma","varsubsetneq","varsubsetneqq","varsupsetneq","varsupsetneqq","vartheta","vartriangle","vartriangleleft","vartriangleright","vcentcolon","vcenter","vdash","vdots","vec","vee","veebar","vert","vfil","vfill","vline","vphantom","wedge","weierp","widecheck","widehat","wideparen","widetilde","wp","wr","xLeftarrow","xLeftrightarrow","xRightarrow","xcancel","xdef","xhookleftarrow","xhookrightarrow","xi","xleftarrow","xleftharpoondown","xleftharpoonup","xleftrightarrow","xleftrightharpoons","xlongequal","xmapsto","xrightarrow","xrightharpoondown","xrightharpoonup","xrightleftharpoons","xtofrom","xtwoheadleftarrow","xtwoheadrightarrow","yen","zeta","{","|","}","~"]'), fi = ["align", "align*", "alignat", "alignat*", "aligned", "alignedat", "array", "Bmatrix", "bmatrix", "Bmatrix*", "bmatrix*", "cases", "CD", "darray", "dcases", "drcases", "equation", "equation*", "gather", "gathered", "matrix", "matrix*", "pmatrix", "pmatrix*", "rcases", "smallmatrix", "split", "Vmatrix", "vmatrix", "Vmatrix*", "vmatrix*"], wr = {
|
|
18
|
-
KATEX_MACROS:
|
|
19
|
-
KATEX_ENVIRONMENTS:
|
|
17
|
+
const hi = /* @__PURE__ */ JSON.parse('[" ","!","\\"","#","&","\'","*",",",".",":",";","=",">","AA","AE","Alpha","And","Arrowvert","Bbb","Bbbk","Beta","Big","Bigg","Biggl","Biggm","Biggr","Bigl","Bigm","Bigr","Box","Bra","Bumpeq","C","Cap","Chi","Colonapprox","Coloneq","Coloneqq","Colonsim","Complex","Coppa","Cup","Dagger","Darr","DeclareMathOperator","Delta","Diamond","Digamma","Doteq","Downarrow","Epsilon","Eqcolon","Eqqcolon","Eta","Finv","Game","Gamma","H","Harr","Huge","Im","Iota","Join","KaTeX","Kappa","Ket","Koppa","L","LARGE","LaTeX","Lambda","Large","Larr","LeftArrow","Leftarrow","Leftrightarrow","Lleftarrow","Longleftarrow","Longleftrightarrow","Longrightarrow","Lrarr","Lsh","Mu","N","Newextarrow","Nu","O","OE","Omega","Omicron","Overrightarrow","P","Phi","Pi","Pr","Psi","Q","R","Rarr","Re","Reals","Rho","Rightarrow","Rrightarrow","Rsh","Rule","S","Sampi","Sigma","Space","Stigma","Subset","Supset","Tau","TeX","Theta","Tiny","Uarr","Uparrow","Updownarrow","Upsilon","Vdash","Vert","Vvdash","Xi","Z","Zeta","\\\\","^","_","`","aa","above","abovewithdelims","acute","add","ae","alef","alefsym","aleph","allowbreak","alpha","amalg","and","ang","angl","angle","angln","approx","approxcolon","approxcoloncolon","approxeq","arccos","arcctg","arcsin","arctan","arctg","arg","argmax","argmin","array","arraystretch","arrowvert","ast","asymp","atop","atopwithdelims","backepsilon","backprime","backsim","backsimeq","backslash","bar","barwedge","bbox","bcancel","because","begin","begingroup","beta","beth","between","bf","bfseries","big","bigcap","bigcirc","bigcup","bigg","biggl","biggm","biggr","bigl","bigm","bigodot","bigominus","bigoplus","bigoslash","bigotimes","bigr","bigsqcap","bigsqcup","bigstar","bigtriangledown","bigtriangleup","biguplus","bigvee","bigwedge","binom","blacklozenge","blacksquare","blacktriangle","blacktriangledown","blacktriangleleft","blacktriangleright","bm","bmod","bold","boldsymbol","bot","bowtie","boxdot","boxed","boxminus","boxplus","boxtimes","bra","brace","bracevert","brack","braket","breve","buildrel","bull","bullet","bumpeq","cal","cancel","cancelto","cap","cases","cdot","cdotp","cdots","ce","cee","centerdot","cf","cfrac","ch","char","check","checkmark","chi","chk","choose","circ","circeq","circlearrowleft","circlearrowright","circledR","circledS","circledast","circledcirc","circleddash","class","cline","clubs","clubsuit","cnums","colon","colonapprox","coloncolon","coloncolonapprox","coloncolonequals","coloncolonminus","coloncolonsim","coloneq","coloneqq","colonequals","colonminus","colonsim","color","colorbox","complement","cong","coppa","coprod","copyright","cos","cosec","cosh","cot","cotg","coth","cr","csc","cssId","ctg","cth","cup","curlyeqprec","curlyeqsucc","curlyvee","curlywedge","curvearrowleft","curvearrowright","dArr","dag","dagger","daleth","darr","dashleftarrow","dashrightarrow","dashv","dbinom","dblcolon","ddag","ddagger","ddddot","dddot","ddot","ddots","def","definecolor","deg","degree","delta","det","dfrac","diagdown","diagup","diamond","diamonds","diamondsuit","digamma","dim","displaylines","displaystyle","div","divideontimes","dot","doteq","doteqdot","dotplus","dots","dotsb","dotsc","dotsi","dotsm","dotso","doublebarwedge","doublecap","doublecup","downarrow","downdownarrows","downharpoonleft","downharpoonright","edef","ell","else","em","emph","empty","emptyset","enclose","end","endgroup","enspace","epsilon","eqalign","eqalignno","eqcirc","eqcolon","eqqcolon","eqref","eqsim","eqslantgtr","eqslantless","equalscolon","equalscoloncolon","equiv","eta","eth","euro","exist","exists","exp","expandafter","fallingdotseq","fbox","fcolorbox","fi","flat","foo","footnotesize","forall","frac","frak","frown","futurelet","gamma","gcd","gdef","ge","geneuro","geneuronarrow","geneurowide","genfrac","geq","geqq","geqslant","gets","gg","ggg","gggtr","gimel","global","gnapprox","gneq","gneqq","gnsim","grave","greet","gt","gtrapprox","gtrdot","gtreqless","gtreqqless","gtrless","gtrsim","gvertneqq","hArr","hail","harr","hat","hbar","hbox","hdashline","hearts","heartsuit","hfil","hfill","hline","hom","hookleftarrow","hookrightarrow","hphantom","href","hskip","hslash","hspace","htmlClass","htmlData","htmlId","htmlStyle","huge","i","iddots","idotsint","if","iff","ifmode","ifx","iiiint","iiint","iint","image","imageof","imath","impliedby","implies","in","includegraphics","inf","infin","infty","injlim","int","intercal","intop","iota","isin","it","itshape","j","jmath","kappa","ker","kern","ket","koppa","l","lArr","lBrace","lVert","label","lambda","land","lang","langle","large","larr","lbrace","lbrack","lceil","ldotp","ldots","le","leadsto","left","leftarrow","leftarrowtail","leftharpoondown","leftharpoonup","leftleftarrows","leftrightarrow","leftrightarrows","leftrightharpoons","leftrightsquigarrow","leftroot","leftthreetimes","leq","leqalignno","leqq","leqslant","lessapprox","lessdot","lesseqgtr","lesseqqgtr","lessgtr","lesssim","let","lfloor","lg","lgroup","lhd","lim","liminf","limits","limsup","ll","llap","llbracket","llcorner","lll","llless","lmoustache","ln","lnapprox","lneq","lneqq","lnot","lnsim","log","long","longleftarrow","longleftrightarrow","longmapsto","longrightarrow","looparrowleft","looparrowright","lor","lower","lozenge","lparen","lq","lrArr","lrarr","lrcorner","lt","ltimes","lvert","lvertneqq","maltese","mapsto","mathbb","mathbf","mathbin","mathcal","mathchoice","mathclap","mathclose","mathellipsis","mathfrak","mathinner","mathit","mathllap","mathnormal","mathop","mathopen","mathord","mathpunct","mathrel","mathring","mathrlap","mathrm","mathscr","mathsf","mathsterling","mathstrut","mathtip","mathtt","matrix","max","mbox","md","mdseries","measuredangle","medspace","mho","mid","middle","min","minuscolon","minuscoloncolon","minuso","mit","mkern","mmlToken","mod","models","moveleft","moveright","mp","mskip","mspace","mu","multicolumn","multimap","nLeftarrow","nLeftrightarrow","nRightarrow","nVDash","nVdash","nabla","natnums","natural","ncong","ne","nearrow","neg","negmedspace","negthickspace","negthinspace","neq","newcommand","newenvironment","newline","nexists","ngeq","ngeqq","ngeqslant","ngtr","ni","nleftarrow","nleftrightarrow","nleq","nleqq","nleqslant","nless","nmid","nobreak","nobreakspace","noexpand","nolimits","nonumber","normalfont","normalsize","not","notag","notin","notni","nparallel","nprec","npreceq","nrightarrow","nshortmid","nshortparallel","nsim","nsubseteq","nsubseteqq","nsucc","nsucceq","nsupseteq","nsupseteqq","ntriangleleft","ntrianglelefteq","ntriangleright","ntrianglerighteq","nu","nvDash","nvdash","nwarrow","o","odot","oe","officialeuro","oiiint","oiint","oint","oldstyle","omega","omicron","ominus","operatorname","operatornamewithlimits","oplus","or","origof","oslash","otimes","over","overbrace","overbracket","overgroup","overleftarrow","overleftharpoon","overleftrightarrow","overline","overlinesegment","overparen","overrightarrow","overrightharpoon","overset","overwithdelims","owns","pagecolor","parallel","part","partial","perp","phantom","phase","phi","pi","pitchfork","plim","plusmn","pm","pmatrix","pmb","pmod","pod","pounds","prec","precapprox","preccurlyeq","preceq","precnapprox","precneqq","precnsim","precsim","prime","prod","projlim","propto","providecommand","psi","pu","qquad","quad","r","rArr","rBrace","rVert","raise","raisebox","rang","rangle","rarr","ratio","rbrace","rbrack","rceil","real","reals","ref","relax","renewcommand","renewenvironment","require","restriction","rfloor","rgroup","rhd","rho","right","rightarrow","rightarrowtail","rightharpoondown","rightharpoonup","rightleftarrows","rightleftharpoons","rightrightarrows","rightsquigarrow","rightthreetimes","risingdotseq","rlap","rm","rmoustache","root","rotatebox","rparen","rq","rrbracket","rtimes","rule","rvert","sampi","sc","scalebox","scr","scriptscriptstyle","scriptsize","scriptstyle","sdot","searrow","sec","sect","setlength","setminus","sf","sh","sharp","shortmid","shortparallel","shoveleft","shoveright","sideset","sigma","sim","simcolon","simcoloncolon","simeq","sin","sinh","sixptsize","skew","skip","sl","small","smallfrown","smallint","smallsetminus","smallsmile","smash","smile","smiley","sout","space","spades","spadesuit","sphericalangle","sqcap","sqcup","sqrt","sqsubset","sqsubseteq","sqsupset","sqsupseteq","square","ss","stackrel","star","stigma","strut","style","sub","sube","subset","subseteq","subseteqq","subsetneq","subsetneqq","substack","succ","succapprox","succcurlyeq","succeq","succnapprox","succneqq","succnsim","succsim","sum","sup","supe","supset","supseteq","supseteqq","supsetneq","supsetneqq","surd","swarrow","tag","tan","tanh","tau","tbinom","text","textasciicircum","textasciitilde","textbackslash","textbar","textbardbl","textbf","textbraceleft","textbraceright","textcircled","textcolor","textdagger","textdaggerdbl","textdegree","textdollar","textellipsis","textemdash","textendash","textgreater","textit","textless","textmd","textnormal","textquotedblleft","textquotedblright","textquoteleft","textquoteright","textregistered","textrm","textsc","textsf","textsl","textsterling","textstyle","texttip","texttt","textunderscore","textup","textvisiblespace","tfrac","tg","th","therefore","theta","thetasym","thickapprox","thicksim","thickspace","thinspace","tilde","times","tiny","to","toggle","top","triangle","triangledown","triangleleft","trianglelefteq","triangleq","triangleright","trianglerighteq","tt","twoheadleftarrow","twoheadrightarrow","u","uArr","uarr","ulcorner","underbar","underbrace","underbracket","undergroup","underleftarrow","underleftrightarrow","underline","underlinesegment","underparen","underrightarrow","underset","unicode","unlhd","unrhd","up","uparrow","updownarrow","upharpoonleft","upharpoonright","uplus","uproot","upshape","upsilon","upuparrows","urcorner","url","utilde","v","vDash","varDelta","varGamma","varLambda","varOmega","varPhi","varPi","varPsi","varSigma","varTheta","varUpsilon","varXi","varcoppa","varepsilon","varinjlim","varkappa","varliminf","varlimsup","varnothing","varphi","varpi","varprojlim","varpropto","varrho","varsigma","varstigma","varsubsetneq","varsubsetneqq","varsupsetneq","varsupsetneqq","vartheta","vartriangle","vartriangleleft","vartriangleright","vcentcolon","vcenter","vdash","vdots","vec","vee","veebar","vert","vfil","vfill","vline","vphantom","wedge","weierp","widecheck","widehat","wideparen","widetilde","wp","wr","xLeftarrow","xLeftrightarrow","xRightarrow","xcancel","xdef","xhookleftarrow","xhookrightarrow","xi","xleftarrow","xleftharpoondown","xleftharpoonup","xleftrightarrow","xleftrightharpoons","xlongequal","xmapsto","xrightarrow","xrightharpoondown","xrightharpoonup","xrightleftharpoons","xtofrom","xtwoheadleftarrow","xtwoheadrightarrow","yen","zeta","{","|","}","~"]'), pi = ["align", "align*", "alignat", "alignat*", "aligned", "alignedat", "array", "Bmatrix", "bmatrix", "Bmatrix*", "bmatrix*", "cases", "CD", "darray", "dcases", "drcases", "equation", "equation*", "gather", "gathered", "matrix", "matrix*", "pmatrix", "pmatrix*", "rcases", "smallmatrix", "split", "Vmatrix", "vmatrix", "Vmatrix*", "vmatrix*"], yr = {
|
|
18
|
+
KATEX_MACROS: hi,
|
|
19
|
+
KATEX_ENVIRONMENTS: pi
|
|
20
20
|
};
|
|
21
21
|
new Set(
|
|
22
|
-
|
|
22
|
+
yr.KATEX_MACROS
|
|
23
23
|
);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
),
|
|
24
|
+
const mi = new Set(
|
|
25
|
+
yr.KATEX_ENVIRONMENTS
|
|
26
|
+
), gi = [
|
|
27
27
|
{
|
|
28
28
|
name: "enumerate",
|
|
29
29
|
aliases: [],
|
|
@@ -367,7 +367,7 @@ const hi = new Set(
|
|
|
367
367
|
\\subsubpart $0
|
|
368
368
|
`
|
|
369
369
|
}
|
|
370
|
-
],
|
|
370
|
+
], bi = {
|
|
371
371
|
abstract: { requiresStatement: !1, aliases: ["abs", "abstr"] },
|
|
372
372
|
acknowledgement: { requiresStatement: !1, aliases: ["ack"] },
|
|
373
373
|
algorithm: { requiresStatement: !0, aliases: ["algo", "alg"] },
|
|
@@ -438,7 +438,7 @@ const hi = new Set(
|
|
|
438
438
|
},
|
|
439
439
|
solution: { requiresStatement: !1, aliases: ["sol"] },
|
|
440
440
|
warning: { requiresStatement: !1, aliases: ["warn", "wrn"] }
|
|
441
|
-
},
|
|
441
|
+
}, vi = /* @__PURE__ */ new Set([
|
|
442
442
|
"exercise",
|
|
443
443
|
"problem",
|
|
444
444
|
"question",
|
|
@@ -447,9 +447,9 @@ const hi = new Set(
|
|
|
447
447
|
"exploration",
|
|
448
448
|
"investigation"
|
|
449
449
|
]);
|
|
450
|
-
function
|
|
450
|
+
function wi(t, r) {
|
|
451
451
|
let n;
|
|
452
|
-
return
|
|
452
|
+
return vi.has(t) ? n = ["hint", "answer", "solution"] : r.requiresStatement && (n = ["proof"]), {
|
|
453
453
|
name: t,
|
|
454
454
|
aliases: r.aliases,
|
|
455
455
|
requiresStatement: r.requiresStatement,
|
|
@@ -458,15 +458,15 @@ function bi(t, r) {
|
|
|
458
458
|
childEnvironments: n
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
const
|
|
462
|
-
...
|
|
463
|
-
...Object.entries(
|
|
464
|
-
([t, r]) =>
|
|
461
|
+
const _i = [
|
|
462
|
+
...gi,
|
|
463
|
+
...Object.entries(bi).map(
|
|
464
|
+
([t, r]) => wi(t, r)
|
|
465
465
|
)
|
|
466
466
|
];
|
|
467
467
|
(() => {
|
|
468
468
|
const t = /* @__PURE__ */ new Map();
|
|
469
|
-
for (const r of
|
|
469
|
+
for (const r of _i) {
|
|
470
470
|
t.set(r.name, r);
|
|
471
471
|
for (const n of r.aliases)
|
|
472
472
|
t.set(n, r);
|
|
@@ -476,7 +476,7 @@ const vi = [
|
|
|
476
476
|
function vt(t, r) {
|
|
477
477
|
return t.map((n) => ({ name: n, signature: r, mode: "text" }));
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const yi = vt(
|
|
480
480
|
[
|
|
481
481
|
// Generator / symbol macros that emit a fixed element with no arguments.
|
|
482
482
|
"latex",
|
|
@@ -541,7 +541,7 @@ const wi = vt(
|
|
|
541
541
|
"noindent"
|
|
542
542
|
],
|
|
543
543
|
""
|
|
544
|
-
),
|
|
544
|
+
), xi = vt(
|
|
545
545
|
[
|
|
546
546
|
// Text-formatting wrappers.
|
|
547
547
|
"emph",
|
|
@@ -596,7 +596,7 @@ const wi = vt(
|
|
|
596
596
|
"caption"
|
|
597
597
|
],
|
|
598
598
|
"m"
|
|
599
|
-
),
|
|
599
|
+
), xr = [
|
|
600
600
|
{
|
|
601
601
|
name: "href",
|
|
602
602
|
signature: "m m",
|
|
@@ -666,7 +666,7 @@ const wi = vt(
|
|
|
666
666
|
snippet: "plus{${1:chapter}}{${2:ref}}",
|
|
667
667
|
documentation: 'PreTeXt Plus modular include. `\\plus{type}{ref}` → `<plus:type ref="ref"/>`, pulling in the division or asset stored under `ref`. An optional `\\plus[width=50,margin=auto]{image}{ref}` argument becomes attributes on the element.'
|
|
668
668
|
}
|
|
669
|
-
],
|
|
669
|
+
], ki = vt(
|
|
670
670
|
[
|
|
671
671
|
"preface",
|
|
672
672
|
"biography",
|
|
@@ -684,7 +684,7 @@ const wi = vt(
|
|
|
684
684
|
...t,
|
|
685
685
|
snippet: `${t.name}{$1}`,
|
|
686
686
|
documentation: `PreTeXt division. \\${t.name}{title} opens a <${t.name === "readingquestions" ? "reading-questions" : t.name}> that runs to the next division of the same or higher level.`
|
|
687
|
-
})),
|
|
687
|
+
})), Si = vt(
|
|
688
688
|
[
|
|
689
689
|
"book",
|
|
690
690
|
"article",
|
|
@@ -700,7 +700,7 @@ const wi = vt(
|
|
|
700
700
|
"references"
|
|
701
701
|
],
|
|
702
702
|
"m"
|
|
703
|
-
),
|
|
703
|
+
), Ei = [
|
|
704
704
|
...vt(["email", "keywords"], "m"),
|
|
705
705
|
...vt(["subjclass"], "o m"),
|
|
706
706
|
...vt(["title", "author", "date", "input", "include", "subtitle"], "m"),
|
|
@@ -720,7 +720,7 @@ const wi = vt(
|
|
|
720
720
|
],
|
|
721
721
|
""
|
|
722
722
|
)
|
|
723
|
-
],
|
|
723
|
+
], Ai = vt(
|
|
724
724
|
[
|
|
725
725
|
"bfseries",
|
|
726
726
|
"itshape",
|
|
@@ -743,20 +743,20 @@ const wi = vt(
|
|
|
743
743
|
"tiny"
|
|
744
744
|
],
|
|
745
745
|
""
|
|
746
|
-
),
|
|
747
|
-
...
|
|
746
|
+
), Ii = vt(["question", "subpart", "subsubpart"], ""), Ti = new Set(xr.map((t) => t.name)), Ri = [
|
|
747
|
+
...xr,
|
|
748
748
|
...[
|
|
749
|
-
...wi,
|
|
750
|
-
..._i,
|
|
751
749
|
...yi,
|
|
752
750
|
...xi,
|
|
753
751
|
...ki,
|
|
754
752
|
...Si,
|
|
755
|
-
...Ei
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
753
|
+
...Ei,
|
|
754
|
+
...Ai,
|
|
755
|
+
...Ii
|
|
756
|
+
].filter((t) => !Ti.has(t.name)).filter((t, r, n) => n.findIndex((i) => i.name === t.name) === r)
|
|
757
|
+
], Ci = new Map(
|
|
758
|
+
Ri.map((t) => [t.name, t])
|
|
759
|
+
), kr = /* @__PURE__ */ new Set([
|
|
760
760
|
"code",
|
|
761
761
|
"program",
|
|
762
762
|
"console",
|
|
@@ -765,31 +765,31 @@ const wi = vt(
|
|
|
765
765
|
"lstlisting",
|
|
766
766
|
"minted"
|
|
767
767
|
]);
|
|
768
|
-
function
|
|
768
|
+
function we(t) {
|
|
769
769
|
return t >= "a" && t <= "z" || t >= "A" && t <= "Z";
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Oi(t, r, n) {
|
|
772
772
|
return t.startsWith(n, r) ? r + n.length : -1;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function zi(t, r) {
|
|
775
775
|
if (t[r] !== "{") return null;
|
|
776
776
|
const n = t.indexOf("}", r + 1);
|
|
777
777
|
return n === -1 ? null : { content: t.slice(r + 1, n), end: n + 1 };
|
|
778
778
|
}
|
|
779
779
|
function Gt(t, r, n) {
|
|
780
|
-
const i =
|
|
781
|
-
if (i === -1 ||
|
|
780
|
+
const i = Oi(t, r, "\\" + n);
|
|
781
|
+
if (i === -1 || we(t[i] ?? "")) return null;
|
|
782
782
|
let e = i;
|
|
783
783
|
for (; t[e] === " " || t[e] === " "; ) e++;
|
|
784
|
-
const a =
|
|
784
|
+
const a = zi(t, e);
|
|
785
785
|
return a ? { group: a.content, groupStart: e + 1, end: a.end } : null;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function $i(t) {
|
|
788
788
|
const r = [], n = [], i = [], e = [], a = [], s = t.length;
|
|
789
789
|
let o = 0, c = null, l = 0, f = null;
|
|
790
790
|
const p = (g) => ({
|
|
791
|
-
isMath:
|
|
792
|
-
isVerbatim:
|
|
791
|
+
isMath: mi.has(g),
|
|
792
|
+
isVerbatim: kr.has(g)
|
|
793
793
|
});
|
|
794
794
|
for (; o < s; ) {
|
|
795
795
|
if (f !== null) {
|
|
@@ -856,9 +856,9 @@ function Oi(t) {
|
|
|
856
856
|
r.push({ name: h.group, offset: h.groupStart }), o = h.end;
|
|
857
857
|
continue;
|
|
858
858
|
}
|
|
859
|
-
if (
|
|
859
|
+
if (we(t[o + 1] ?? "")) {
|
|
860
860
|
let v = o + 1;
|
|
861
|
-
for (; v < s &&
|
|
861
|
+
for (; v < s && we(t[v]); ) v++;
|
|
862
862
|
a.push({ name: t.slice(o + 1, v), start: o, end: v }), o = v;
|
|
863
863
|
continue;
|
|
864
864
|
}
|
|
@@ -874,7 +874,7 @@ function Oi(t) {
|
|
|
874
874
|
}
|
|
875
875
|
return c !== null && n.push({ start: l, end: s }), { labels: r, mathRegions: n, commentRegions: i, environments: e, macros: a };
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function _e(t, r) {
|
|
878
878
|
const n = Math.max(0, Math.min(r, t.length));
|
|
879
879
|
let i = 0, e = 0;
|
|
880
880
|
for (let a = 0; a < n; a++)
|
|
@@ -884,32 +884,32 @@ function ve(t, r) {
|
|
|
884
884
|
}
|
|
885
885
|
function Qt(t, r, n) {
|
|
886
886
|
return {
|
|
887
|
-
start:
|
|
888
|
-
end:
|
|
887
|
+
start: _e(t, r),
|
|
888
|
+
end: _e(t, n)
|
|
889
889
|
};
|
|
890
890
|
}
|
|
891
|
-
var
|
|
891
|
+
var on;
|
|
892
892
|
(function(t) {
|
|
893
893
|
function r(n) {
|
|
894
894
|
return typeof n == "string";
|
|
895
895
|
}
|
|
896
896
|
t.is = r;
|
|
897
|
-
})(
|
|
898
|
-
var
|
|
897
|
+
})(on || (on = {}));
|
|
898
|
+
var ye;
|
|
899
899
|
(function(t) {
|
|
900
900
|
function r(n) {
|
|
901
901
|
return typeof n == "string";
|
|
902
902
|
}
|
|
903
903
|
t.is = r;
|
|
904
|
-
})(
|
|
905
|
-
var
|
|
904
|
+
})(ye || (ye = {}));
|
|
905
|
+
var cn;
|
|
906
906
|
(function(t) {
|
|
907
907
|
t.MIN_VALUE = -2147483648, t.MAX_VALUE = 2147483647;
|
|
908
908
|
function r(n) {
|
|
909
909
|
return typeof n == "number" && t.MIN_VALUE <= n && n <= t.MAX_VALUE;
|
|
910
910
|
}
|
|
911
911
|
t.is = r;
|
|
912
|
-
})(
|
|
912
|
+
})(cn || (cn = {}));
|
|
913
913
|
var te;
|
|
914
914
|
(function(t) {
|
|
915
915
|
t.MIN_VALUE = 0, t.MAX_VALUE = 2147483647;
|
|
@@ -930,7 +930,7 @@ var wt;
|
|
|
930
930
|
}
|
|
931
931
|
t.is = n;
|
|
932
932
|
})(wt || (wt = {}));
|
|
933
|
-
var
|
|
933
|
+
var dt;
|
|
934
934
|
(function(t) {
|
|
935
935
|
function r(i, e, a, s) {
|
|
936
936
|
if (T.uinteger(i) && T.uinteger(e) && T.uinteger(a) && T.uinteger(s))
|
|
@@ -945,7 +945,7 @@ var ft;
|
|
|
945
945
|
return T.objectLiteral(e) && wt.is(e.start) && wt.is(e.end);
|
|
946
946
|
}
|
|
947
947
|
t.is = n;
|
|
948
|
-
})(
|
|
948
|
+
})(dt || (dt = {}));
|
|
949
949
|
var ee;
|
|
950
950
|
(function(t) {
|
|
951
951
|
function r(i, e) {
|
|
@@ -954,11 +954,11 @@ var ee;
|
|
|
954
954
|
t.create = r;
|
|
955
955
|
function n(i) {
|
|
956
956
|
let e = i;
|
|
957
|
-
return T.objectLiteral(e) &&
|
|
957
|
+
return T.objectLiteral(e) && dt.is(e.range) && (T.string(e.uri) || T.undefined(e.uri));
|
|
958
958
|
}
|
|
959
959
|
t.is = n;
|
|
960
960
|
})(ee || (ee = {}));
|
|
961
|
-
var
|
|
961
|
+
var ln;
|
|
962
962
|
(function(t) {
|
|
963
963
|
function r(i, e, a, s) {
|
|
964
964
|
return { targetUri: i, targetRange: e, targetSelectionRange: a, originSelectionRange: s };
|
|
@@ -966,11 +966,11 @@ var on;
|
|
|
966
966
|
t.create = r;
|
|
967
967
|
function n(i) {
|
|
968
968
|
let e = i;
|
|
969
|
-
return T.objectLiteral(e) &&
|
|
969
|
+
return T.objectLiteral(e) && dt.is(e.targetRange) && T.string(e.targetUri) && dt.is(e.targetSelectionRange) && (dt.is(e.originSelectionRange) || T.undefined(e.originSelectionRange));
|
|
970
970
|
}
|
|
971
971
|
t.is = n;
|
|
972
|
-
})(
|
|
973
|
-
var
|
|
972
|
+
})(ln || (ln = {}));
|
|
973
|
+
var xe;
|
|
974
974
|
(function(t) {
|
|
975
975
|
function r(i, e, a, s) {
|
|
976
976
|
return {
|
|
@@ -986,8 +986,8 @@ var _e;
|
|
|
986
986
|
return T.objectLiteral(e) && T.numberRange(e.red, 0, 1) && T.numberRange(e.green, 0, 1) && T.numberRange(e.blue, 0, 1) && T.numberRange(e.alpha, 0, 1);
|
|
987
987
|
}
|
|
988
988
|
t.is = n;
|
|
989
|
-
})(
|
|
990
|
-
var
|
|
989
|
+
})(xe || (xe = {}));
|
|
990
|
+
var un;
|
|
991
991
|
(function(t) {
|
|
992
992
|
function r(i, e) {
|
|
993
993
|
return {
|
|
@@ -998,11 +998,11 @@ var cn;
|
|
|
998
998
|
t.create = r;
|
|
999
999
|
function n(i) {
|
|
1000
1000
|
const e = i;
|
|
1001
|
-
return T.objectLiteral(e) &&
|
|
1001
|
+
return T.objectLiteral(e) && dt.is(e.range) && xe.is(e.color);
|
|
1002
1002
|
}
|
|
1003
1003
|
t.is = n;
|
|
1004
|
-
})(
|
|
1005
|
-
var
|
|
1004
|
+
})(un || (un = {}));
|
|
1005
|
+
var dn;
|
|
1006
1006
|
(function(t) {
|
|
1007
1007
|
function r(i, e, a) {
|
|
1008
1008
|
return {
|
|
@@ -1017,12 +1017,12 @@ var ln;
|
|
|
1017
1017
|
return T.objectLiteral(e) && T.string(e.label) && (T.undefined(e.textEdit) || Rt.is(e)) && (T.undefined(e.additionalTextEdits) || T.typedArray(e.additionalTextEdits, Rt.is));
|
|
1018
1018
|
}
|
|
1019
1019
|
t.is = n;
|
|
1020
|
-
})(
|
|
1021
|
-
var
|
|
1020
|
+
})(dn || (dn = {}));
|
|
1021
|
+
var fn;
|
|
1022
1022
|
(function(t) {
|
|
1023
1023
|
t.Comment = "comment", t.Imports = "imports", t.Region = "region";
|
|
1024
|
-
})(
|
|
1025
|
-
var
|
|
1024
|
+
})(fn || (fn = {}));
|
|
1025
|
+
var hn;
|
|
1026
1026
|
(function(t) {
|
|
1027
1027
|
function r(i, e, a, s, o, c) {
|
|
1028
1028
|
const l = {
|
|
@@ -1037,8 +1037,8 @@ var dn;
|
|
|
1037
1037
|
return T.objectLiteral(e) && T.uinteger(e.startLine) && T.uinteger(e.startLine) && (T.undefined(e.startCharacter) || T.uinteger(e.startCharacter)) && (T.undefined(e.endCharacter) || T.uinteger(e.endCharacter)) && (T.undefined(e.kind) || T.string(e.kind));
|
|
1038
1038
|
}
|
|
1039
1039
|
t.is = n;
|
|
1040
|
-
})(
|
|
1041
|
-
var
|
|
1040
|
+
})(hn || (hn = {}));
|
|
1041
|
+
var ke;
|
|
1042
1042
|
(function(t) {
|
|
1043
1043
|
function r(i, e) {
|
|
1044
1044
|
return {
|
|
@@ -1052,23 +1052,23 @@ var ye;
|
|
|
1052
1052
|
return T.defined(e) && ee.is(e.location) && T.string(e.message);
|
|
1053
1053
|
}
|
|
1054
1054
|
t.is = n;
|
|
1055
|
-
})(
|
|
1055
|
+
})(ke || (ke = {}));
|
|
1056
1056
|
var jt;
|
|
1057
1057
|
(function(t) {
|
|
1058
1058
|
t.Error = 1, t.Warning = 2, t.Information = 3, t.Hint = 4;
|
|
1059
1059
|
})(jt || (jt = {}));
|
|
1060
|
-
var
|
|
1060
|
+
var pn;
|
|
1061
1061
|
(function(t) {
|
|
1062
1062
|
t.Unnecessary = 1, t.Deprecated = 2;
|
|
1063
|
-
})(
|
|
1064
|
-
var
|
|
1063
|
+
})(pn || (pn = {}));
|
|
1064
|
+
var mn;
|
|
1065
1065
|
(function(t) {
|
|
1066
1066
|
function r(n) {
|
|
1067
1067
|
const i = n;
|
|
1068
1068
|
return T.objectLiteral(i) && T.string(i.href);
|
|
1069
1069
|
}
|
|
1070
1070
|
t.is = r;
|
|
1071
|
-
})(
|
|
1071
|
+
})(mn || (mn = {}));
|
|
1072
1072
|
var ne;
|
|
1073
1073
|
(function(t) {
|
|
1074
1074
|
function r(i, e, a, s, o, c) {
|
|
@@ -1079,7 +1079,7 @@ var ne;
|
|
|
1079
1079
|
function n(i) {
|
|
1080
1080
|
var e;
|
|
1081
1081
|
let a = i;
|
|
1082
|
-
return T.defined(a) &&
|
|
1082
|
+
return T.defined(a) && dt.is(a.range) && T.string(a.message) && (T.number(a.severity) || T.undefined(a.severity)) && (T.integer(a.code) || T.string(a.code) || T.undefined(a.code)) && (T.undefined(a.codeDescription) || T.string((e = a.codeDescription) === null || e === void 0 ? void 0 : e.href)) && (T.string(a.source) || T.undefined(a.source)) && (T.undefined(a.relatedInformation) || T.typedArray(a.relatedInformation, ke.is));
|
|
1083
1083
|
}
|
|
1084
1084
|
t.is = n;
|
|
1085
1085
|
})(ne || (ne = {}));
|
|
@@ -1112,11 +1112,11 @@ var Rt;
|
|
|
1112
1112
|
t.del = i;
|
|
1113
1113
|
function e(a) {
|
|
1114
1114
|
const s = a;
|
|
1115
|
-
return T.objectLiteral(s) && T.string(s.newText) &&
|
|
1115
|
+
return T.objectLiteral(s) && T.string(s.newText) && dt.is(s.range);
|
|
1116
1116
|
}
|
|
1117
1117
|
t.is = e;
|
|
1118
1118
|
})(Rt || (Rt = {}));
|
|
1119
|
-
var
|
|
1119
|
+
var Se;
|
|
1120
1120
|
(function(t) {
|
|
1121
1121
|
function r(i, e, a) {
|
|
1122
1122
|
const s = { label: i };
|
|
@@ -1128,7 +1128,7 @@ var xe;
|
|
|
1128
1128
|
return T.objectLiteral(e) && T.string(e.label) && (T.boolean(e.needsConfirmation) || e.needsConfirmation === void 0) && (T.string(e.description) || e.description === void 0);
|
|
1129
1129
|
}
|
|
1130
1130
|
t.is = n;
|
|
1131
|
-
})(
|
|
1131
|
+
})(Se || (Se = {}));
|
|
1132
1132
|
var Ct;
|
|
1133
1133
|
(function(t) {
|
|
1134
1134
|
function r(n) {
|
|
@@ -1137,7 +1137,7 @@ var Ct;
|
|
|
1137
1137
|
}
|
|
1138
1138
|
t.is = r;
|
|
1139
1139
|
})(Ct || (Ct = {}));
|
|
1140
|
-
var
|
|
1140
|
+
var gn;
|
|
1141
1141
|
(function(t) {
|
|
1142
1142
|
function r(a, s, o) {
|
|
1143
1143
|
return { range: a, newText: s, annotationId: o };
|
|
@@ -1153,11 +1153,11 @@ var pn;
|
|
|
1153
1153
|
t.del = i;
|
|
1154
1154
|
function e(a) {
|
|
1155
1155
|
const s = a;
|
|
1156
|
-
return Rt.is(s) && (
|
|
1156
|
+
return Rt.is(s) && (Se.is(s.annotationId) || Ct.is(s.annotationId));
|
|
1157
1157
|
}
|
|
1158
1158
|
t.is = e;
|
|
1159
|
-
})(
|
|
1160
|
-
var
|
|
1159
|
+
})(gn || (gn = {}));
|
|
1160
|
+
var Ee;
|
|
1161
1161
|
(function(t) {
|
|
1162
1162
|
function r(i, e) {
|
|
1163
1163
|
return { textDocument: i, edits: e };
|
|
@@ -1165,11 +1165,11 @@ var ke;
|
|
|
1165
1165
|
t.create = r;
|
|
1166
1166
|
function n(i) {
|
|
1167
1167
|
let e = i;
|
|
1168
|
-
return T.defined(e) &&
|
|
1168
|
+
return T.defined(e) && Ce.is(e.textDocument) && Array.isArray(e.edits);
|
|
1169
1169
|
}
|
|
1170
1170
|
t.is = n;
|
|
1171
|
-
})(
|
|
1172
|
-
var
|
|
1171
|
+
})(Ee || (Ee = {}));
|
|
1172
|
+
var Ae;
|
|
1173
1173
|
(function(t) {
|
|
1174
1174
|
function r(i, e, a) {
|
|
1175
1175
|
let s = {
|
|
@@ -1184,8 +1184,8 @@ var Se;
|
|
|
1184
1184
|
return e && e.kind === "create" && T.string(e.uri) && (e.options === void 0 || (e.options.overwrite === void 0 || T.boolean(e.options.overwrite)) && (e.options.ignoreIfExists === void 0 || T.boolean(e.options.ignoreIfExists))) && (e.annotationId === void 0 || Ct.is(e.annotationId));
|
|
1185
1185
|
}
|
|
1186
1186
|
t.is = n;
|
|
1187
|
-
})(
|
|
1188
|
-
var
|
|
1187
|
+
})(Ae || (Ae = {}));
|
|
1188
|
+
var Ie;
|
|
1189
1189
|
(function(t) {
|
|
1190
1190
|
function r(i, e, a, s) {
|
|
1191
1191
|
let o = {
|
|
@@ -1201,8 +1201,8 @@ var Ee;
|
|
|
1201
1201
|
return e && e.kind === "rename" && T.string(e.oldUri) && T.string(e.newUri) && (e.options === void 0 || (e.options.overwrite === void 0 || T.boolean(e.options.overwrite)) && (e.options.ignoreIfExists === void 0 || T.boolean(e.options.ignoreIfExists))) && (e.annotationId === void 0 || Ct.is(e.annotationId));
|
|
1202
1202
|
}
|
|
1203
1203
|
t.is = n;
|
|
1204
|
-
})(
|
|
1205
|
-
var
|
|
1204
|
+
})(Ie || (Ie = {}));
|
|
1205
|
+
var Te;
|
|
1206
1206
|
(function(t) {
|
|
1207
1207
|
function r(i, e, a) {
|
|
1208
1208
|
let s = {
|
|
@@ -1217,16 +1217,16 @@ var Ae;
|
|
|
1217
1217
|
return e && e.kind === "delete" && T.string(e.uri) && (e.options === void 0 || (e.options.recursive === void 0 || T.boolean(e.options.recursive)) && (e.options.ignoreIfNotExists === void 0 || T.boolean(e.options.ignoreIfNotExists))) && (e.annotationId === void 0 || Ct.is(e.annotationId));
|
|
1218
1218
|
}
|
|
1219
1219
|
t.is = n;
|
|
1220
|
-
})(
|
|
1221
|
-
var
|
|
1220
|
+
})(Te || (Te = {}));
|
|
1221
|
+
var Re;
|
|
1222
1222
|
(function(t) {
|
|
1223
1223
|
function r(n) {
|
|
1224
1224
|
let i = n;
|
|
1225
|
-
return i && (i.changes !== void 0 || i.documentChanges !== void 0) && (i.documentChanges === void 0 || i.documentChanges.every((e) => T.string(e.kind) ?
|
|
1225
|
+
return i && (i.changes !== void 0 || i.documentChanges !== void 0) && (i.documentChanges === void 0 || i.documentChanges.every((e) => T.string(e.kind) ? Ae.is(e) || Ie.is(e) || Te.is(e) : Ee.is(e)));
|
|
1226
1226
|
}
|
|
1227
1227
|
t.is = r;
|
|
1228
|
-
})(
|
|
1229
|
-
var
|
|
1228
|
+
})(Re || (Re = {}));
|
|
1229
|
+
var bn;
|
|
1230
1230
|
(function(t) {
|
|
1231
1231
|
function r(i) {
|
|
1232
1232
|
return { uri: i };
|
|
@@ -1237,8 +1237,8 @@ var mn;
|
|
|
1237
1237
|
return T.defined(e) && T.string(e.uri);
|
|
1238
1238
|
}
|
|
1239
1239
|
t.is = n;
|
|
1240
|
-
})(
|
|
1241
|
-
var
|
|
1240
|
+
})(bn || (bn = {}));
|
|
1241
|
+
var vn;
|
|
1242
1242
|
(function(t) {
|
|
1243
1243
|
function r(i, e) {
|
|
1244
1244
|
return { uri: i, version: e };
|
|
@@ -1249,8 +1249,8 @@ var gn;
|
|
|
1249
1249
|
return T.defined(e) && T.string(e.uri) && T.integer(e.version);
|
|
1250
1250
|
}
|
|
1251
1251
|
t.is = n;
|
|
1252
|
-
})(
|
|
1253
|
-
var
|
|
1252
|
+
})(vn || (vn = {}));
|
|
1253
|
+
var Ce;
|
|
1254
1254
|
(function(t) {
|
|
1255
1255
|
function r(i, e) {
|
|
1256
1256
|
return { uri: i, version: e };
|
|
@@ -1261,8 +1261,8 @@ var Te;
|
|
|
1261
1261
|
return T.defined(e) && T.string(e.uri) && (e.version === null || T.integer(e.version));
|
|
1262
1262
|
}
|
|
1263
1263
|
t.is = n;
|
|
1264
|
-
})(
|
|
1265
|
-
var
|
|
1264
|
+
})(Ce || (Ce = {}));
|
|
1265
|
+
var wn;
|
|
1266
1266
|
(function(t) {
|
|
1267
1267
|
function r(i, e, a, s) {
|
|
1268
1268
|
return { uri: i, languageId: e, version: a, text: s };
|
|
@@ -1273,8 +1273,8 @@ var bn;
|
|
|
1273
1273
|
return T.defined(e) && T.string(e.uri) && T.string(e.languageId) && T.integer(e.version) && T.string(e.text);
|
|
1274
1274
|
}
|
|
1275
1275
|
t.is = n;
|
|
1276
|
-
})(
|
|
1277
|
-
var
|
|
1276
|
+
})(wn || (wn = {}));
|
|
1277
|
+
var Oe;
|
|
1278
1278
|
(function(t) {
|
|
1279
1279
|
t.PlainText = "plaintext", t.Markdown = "markdown";
|
|
1280
1280
|
function r(n) {
|
|
@@ -1282,28 +1282,28 @@ var Re;
|
|
|
1282
1282
|
return i === t.PlainText || i === t.Markdown;
|
|
1283
1283
|
}
|
|
1284
1284
|
t.is = r;
|
|
1285
|
-
})(
|
|
1285
|
+
})(Oe || (Oe = {}));
|
|
1286
1286
|
var qt;
|
|
1287
1287
|
(function(t) {
|
|
1288
1288
|
function r(n) {
|
|
1289
1289
|
const i = n;
|
|
1290
|
-
return T.objectLiteral(n) &&
|
|
1290
|
+
return T.objectLiteral(n) && Oe.is(i.kind) && T.string(i.value);
|
|
1291
1291
|
}
|
|
1292
1292
|
t.is = r;
|
|
1293
1293
|
})(qt || (qt = {}));
|
|
1294
|
-
var
|
|
1294
|
+
var _n;
|
|
1295
1295
|
(function(t) {
|
|
1296
1296
|
t.Text = 1, t.Method = 2, t.Function = 3, t.Constructor = 4, t.Field = 5, t.Variable = 6, t.Class = 7, t.Interface = 8, t.Module = 9, t.Property = 10, t.Unit = 11, t.Value = 12, t.Enum = 13, t.Keyword = 14, t.Snippet = 15, t.Color = 16, t.File = 17, t.Reference = 18, t.Folder = 19, t.EnumMember = 20, t.Constant = 21, t.Struct = 22, t.Event = 23, t.Operator = 24, t.TypeParameter = 25;
|
|
1297
|
-
})(
|
|
1298
|
-
var
|
|
1297
|
+
})(_n || (_n = {}));
|
|
1298
|
+
var yn;
|
|
1299
1299
|
(function(t) {
|
|
1300
1300
|
t.PlainText = 1, t.Snippet = 2;
|
|
1301
|
-
})(
|
|
1302
|
-
var
|
|
1301
|
+
})(yn || (yn = {}));
|
|
1302
|
+
var xn;
|
|
1303
1303
|
(function(t) {
|
|
1304
1304
|
t.Deprecated = 1;
|
|
1305
|
-
})(
|
|
1306
|
-
var
|
|
1305
|
+
})(xn || (xn = {}));
|
|
1306
|
+
var kn;
|
|
1307
1307
|
(function(t) {
|
|
1308
1308
|
function r(i, e, a) {
|
|
1309
1309
|
return { newText: i, insert: e, replace: a };
|
|
@@ -1311,36 +1311,36 @@ var yn;
|
|
|
1311
1311
|
t.create = r;
|
|
1312
1312
|
function n(i) {
|
|
1313
1313
|
const e = i;
|
|
1314
|
-
return e && T.string(e.newText) &&
|
|
1314
|
+
return e && T.string(e.newText) && dt.is(e.insert) && dt.is(e.replace);
|
|
1315
1315
|
}
|
|
1316
1316
|
t.is = n;
|
|
1317
|
-
})(
|
|
1318
|
-
var
|
|
1317
|
+
})(kn || (kn = {}));
|
|
1318
|
+
var Sn;
|
|
1319
1319
|
(function(t) {
|
|
1320
1320
|
t.asIs = 1, t.adjustIndentation = 2;
|
|
1321
|
-
})(
|
|
1322
|
-
var
|
|
1321
|
+
})(Sn || (Sn = {}));
|
|
1322
|
+
var En;
|
|
1323
1323
|
(function(t) {
|
|
1324
1324
|
function r(n) {
|
|
1325
1325
|
const i = n;
|
|
1326
1326
|
return i && (T.string(i.detail) || i.detail === void 0) && (T.string(i.description) || i.description === void 0);
|
|
1327
1327
|
}
|
|
1328
1328
|
t.is = r;
|
|
1329
|
-
})(
|
|
1330
|
-
var
|
|
1329
|
+
})(En || (En = {}));
|
|
1330
|
+
var An;
|
|
1331
1331
|
(function(t) {
|
|
1332
1332
|
function r(n) {
|
|
1333
1333
|
return { label: n };
|
|
1334
1334
|
}
|
|
1335
1335
|
t.create = r;
|
|
1336
|
-
})(
|
|
1337
|
-
var
|
|
1336
|
+
})(An || (An = {}));
|
|
1337
|
+
var In;
|
|
1338
1338
|
(function(t) {
|
|
1339
1339
|
function r(n, i) {
|
|
1340
1340
|
return { items: n || [], isIncomplete: !!i };
|
|
1341
1341
|
}
|
|
1342
1342
|
t.create = r;
|
|
1343
|
-
})(
|
|
1343
|
+
})(In || (In = {}));
|
|
1344
1344
|
var re;
|
|
1345
1345
|
(function(t) {
|
|
1346
1346
|
function r(i) {
|
|
@@ -1353,50 +1353,50 @@ var re;
|
|
|
1353
1353
|
}
|
|
1354
1354
|
t.is = n;
|
|
1355
1355
|
})(re || (re = {}));
|
|
1356
|
-
var
|
|
1356
|
+
var Tn;
|
|
1357
1357
|
(function(t) {
|
|
1358
1358
|
function r(n) {
|
|
1359
1359
|
let i = n;
|
|
1360
|
-
return !!i && T.objectLiteral(i) && (qt.is(i.contents) || re.is(i.contents) || T.typedArray(i.contents, re.is)) && (n.range === void 0 ||
|
|
1360
|
+
return !!i && T.objectLiteral(i) && (qt.is(i.contents) || re.is(i.contents) || T.typedArray(i.contents, re.is)) && (n.range === void 0 || dt.is(n.range));
|
|
1361
1361
|
}
|
|
1362
1362
|
t.is = r;
|
|
1363
|
-
})(
|
|
1364
|
-
var
|
|
1363
|
+
})(Tn || (Tn = {}));
|
|
1364
|
+
var Rn;
|
|
1365
1365
|
(function(t) {
|
|
1366
1366
|
function r(n, i) {
|
|
1367
1367
|
return i ? { label: n, documentation: i } : { label: n };
|
|
1368
1368
|
}
|
|
1369
1369
|
t.create = r;
|
|
1370
|
-
})(
|
|
1371
|
-
var
|
|
1370
|
+
})(Rn || (Rn = {}));
|
|
1371
|
+
var Cn;
|
|
1372
1372
|
(function(t) {
|
|
1373
1373
|
function r(n, i, ...e) {
|
|
1374
1374
|
let a = { label: n };
|
|
1375
1375
|
return T.defined(i) && (a.documentation = i), T.defined(e) ? a.parameters = e : a.parameters = [], a;
|
|
1376
1376
|
}
|
|
1377
1377
|
t.create = r;
|
|
1378
|
-
})(
|
|
1379
|
-
var
|
|
1378
|
+
})(Cn || (Cn = {}));
|
|
1379
|
+
var On;
|
|
1380
1380
|
(function(t) {
|
|
1381
1381
|
t.Text = 1, t.Read = 2, t.Write = 3;
|
|
1382
|
-
})(
|
|
1383
|
-
var
|
|
1382
|
+
})(On || (On = {}));
|
|
1383
|
+
var zn;
|
|
1384
1384
|
(function(t) {
|
|
1385
1385
|
function r(n, i) {
|
|
1386
1386
|
let e = { range: n };
|
|
1387
1387
|
return T.number(i) && (e.kind = i), e;
|
|
1388
1388
|
}
|
|
1389
1389
|
t.create = r;
|
|
1390
|
-
})(
|
|
1391
|
-
var
|
|
1390
|
+
})(zn || (zn = {}));
|
|
1391
|
+
var $n;
|
|
1392
1392
|
(function(t) {
|
|
1393
1393
|
t.File = 1, t.Module = 2, t.Namespace = 3, t.Package = 4, t.Class = 5, t.Method = 6, t.Property = 7, t.Field = 8, t.Constructor = 9, t.Enum = 10, t.Interface = 11, t.Function = 12, t.Variable = 13, t.Constant = 14, t.String = 15, t.Number = 16, t.Boolean = 17, t.Array = 18, t.Object = 19, t.Key = 20, t.Null = 21, t.EnumMember = 22, t.Struct = 23, t.Event = 24, t.Operator = 25, t.TypeParameter = 26;
|
|
1394
|
-
})(
|
|
1395
|
-
var
|
|
1394
|
+
})($n || ($n = {}));
|
|
1395
|
+
var Ln;
|
|
1396
1396
|
(function(t) {
|
|
1397
1397
|
t.Deprecated = 1;
|
|
1398
|
-
})(
|
|
1399
|
-
var
|
|
1398
|
+
})(Ln || (Ln = {}));
|
|
1399
|
+
var Dn;
|
|
1400
1400
|
(function(t) {
|
|
1401
1401
|
function r(n, i, e, a, s) {
|
|
1402
1402
|
let o = {
|
|
@@ -1407,15 +1407,15 @@ var $n;
|
|
|
1407
1407
|
return s && (o.containerName = s), o;
|
|
1408
1408
|
}
|
|
1409
1409
|
t.create = r;
|
|
1410
|
-
})(
|
|
1411
|
-
var
|
|
1410
|
+
})(Dn || (Dn = {}));
|
|
1411
|
+
var Pn;
|
|
1412
1412
|
(function(t) {
|
|
1413
1413
|
function r(n, i, e, a) {
|
|
1414
1414
|
return a !== void 0 ? { name: n, kind: i, location: { uri: e, range: a } } : { name: n, kind: i, location: { uri: e } };
|
|
1415
1415
|
}
|
|
1416
1416
|
t.create = r;
|
|
1417
|
-
})(
|
|
1418
|
-
var
|
|
1417
|
+
})(Pn || (Pn = {}));
|
|
1418
|
+
var jn;
|
|
1419
1419
|
(function(t) {
|
|
1420
1420
|
function r(i, e, a, s, o, c) {
|
|
1421
1421
|
let l = {
|
|
@@ -1430,10 +1430,10 @@ var Dn;
|
|
|
1430
1430
|
t.create = r;
|
|
1431
1431
|
function n(i) {
|
|
1432
1432
|
let e = i;
|
|
1433
|
-
return e && T.string(e.name) && T.number(e.kind) &&
|
|
1433
|
+
return e && T.string(e.name) && T.number(e.kind) && dt.is(e.range) && dt.is(e.selectionRange) && (e.detail === void 0 || T.string(e.detail)) && (e.deprecated === void 0 || T.boolean(e.deprecated)) && (e.children === void 0 || Array.isArray(e.children)) && (e.tags === void 0 || Array.isArray(e.tags));
|
|
1434
1434
|
}
|
|
1435
1435
|
t.is = n;
|
|
1436
|
-
})(
|
|
1436
|
+
})(jn || (jn = {}));
|
|
1437
1437
|
var Ot;
|
|
1438
1438
|
(function(t) {
|
|
1439
1439
|
t.Empty = "", t.QuickFix = "quickfix", t.Refactor = "refactor", t.RefactorExtract = "refactor.extract", t.RefactorInline = "refactor.inline", t.RefactorRewrite = "refactor.rewrite", t.Source = "source", t.SourceOrganizeImports = "source.organizeImports", t.SourceFixAll = "source.fixAll";
|
|
@@ -1442,7 +1442,7 @@ var ie;
|
|
|
1442
1442
|
(function(t) {
|
|
1443
1443
|
t.Invoked = 1, t.Automatic = 2;
|
|
1444
1444
|
})(ie || (ie = {}));
|
|
1445
|
-
var
|
|
1445
|
+
var Fn;
|
|
1446
1446
|
(function(t) {
|
|
1447
1447
|
function r(i, e, a) {
|
|
1448
1448
|
let s = { diagnostics: i };
|
|
@@ -1454,8 +1454,8 @@ var Pn;
|
|
|
1454
1454
|
return T.defined(e) && T.typedArray(e.diagnostics, ne.is) && (e.only === void 0 || T.typedArray(e.only, T.string)) && (e.triggerKind === void 0 || e.triggerKind === ie.Invoked || e.triggerKind === ie.Automatic);
|
|
1455
1455
|
}
|
|
1456
1456
|
t.is = n;
|
|
1457
|
-
})(
|
|
1458
|
-
var
|
|
1457
|
+
})(Fn || (Fn = {}));
|
|
1458
|
+
var qn;
|
|
1459
1459
|
(function(t) {
|
|
1460
1460
|
function r(i, e, a) {
|
|
1461
1461
|
let s = { title: i }, o = !0;
|
|
@@ -1464,11 +1464,11 @@ var jn;
|
|
|
1464
1464
|
t.create = r;
|
|
1465
1465
|
function n(i) {
|
|
1466
1466
|
let e = i;
|
|
1467
|
-
return e && T.string(e.title) && (e.diagnostics === void 0 || T.typedArray(e.diagnostics, ne.is)) && (e.kind === void 0 || T.string(e.kind)) && (e.edit !== void 0 || e.command !== void 0) && (e.command === void 0 || Tt.is(e.command)) && (e.isPreferred === void 0 || T.boolean(e.isPreferred)) && (e.edit === void 0 ||
|
|
1467
|
+
return e && T.string(e.title) && (e.diagnostics === void 0 || T.typedArray(e.diagnostics, ne.is)) && (e.kind === void 0 || T.string(e.kind)) && (e.edit !== void 0 || e.command !== void 0) && (e.command === void 0 || Tt.is(e.command)) && (e.isPreferred === void 0 || T.boolean(e.isPreferred)) && (e.edit === void 0 || Re.is(e.edit));
|
|
1468
1468
|
}
|
|
1469
1469
|
t.is = n;
|
|
1470
|
-
})(
|
|
1471
|
-
var
|
|
1470
|
+
})(qn || (qn = {}));
|
|
1471
|
+
var Bn;
|
|
1472
1472
|
(function(t) {
|
|
1473
1473
|
function r(i, e) {
|
|
1474
1474
|
let a = { range: i };
|
|
@@ -1477,11 +1477,11 @@ var Fn;
|
|
|
1477
1477
|
t.create = r;
|
|
1478
1478
|
function n(i) {
|
|
1479
1479
|
let e = i;
|
|
1480
|
-
return T.defined(e) &&
|
|
1480
|
+
return T.defined(e) && dt.is(e.range) && (T.undefined(e.command) || Tt.is(e.command));
|
|
1481
1481
|
}
|
|
1482
1482
|
t.is = n;
|
|
1483
|
-
})(
|
|
1484
|
-
var
|
|
1483
|
+
})(Bn || (Bn = {}));
|
|
1484
|
+
var Nn;
|
|
1485
1485
|
(function(t) {
|
|
1486
1486
|
function r(i, e) {
|
|
1487
1487
|
return { tabSize: i, insertSpaces: e };
|
|
@@ -1492,8 +1492,8 @@ var qn;
|
|
|
1492
1492
|
return T.defined(e) && T.uinteger(e.tabSize) && T.boolean(e.insertSpaces);
|
|
1493
1493
|
}
|
|
1494
1494
|
t.is = n;
|
|
1495
|
-
})(
|
|
1496
|
-
var
|
|
1495
|
+
})(Nn || (Nn = {}));
|
|
1496
|
+
var Un;
|
|
1497
1497
|
(function(t) {
|
|
1498
1498
|
function r(i, e, a) {
|
|
1499
1499
|
return { range: i, target: e, data: a };
|
|
@@ -1501,11 +1501,11 @@ var Bn;
|
|
|
1501
1501
|
t.create = r;
|
|
1502
1502
|
function n(i) {
|
|
1503
1503
|
let e = i;
|
|
1504
|
-
return T.defined(e) &&
|
|
1504
|
+
return T.defined(e) && dt.is(e.range) && (T.undefined(e.target) || T.string(e.target));
|
|
1505
1505
|
}
|
|
1506
1506
|
t.is = n;
|
|
1507
|
-
})(
|
|
1508
|
-
var
|
|
1507
|
+
})(Un || (Un = {}));
|
|
1508
|
+
var Mn;
|
|
1509
1509
|
(function(t) {
|
|
1510
1510
|
function r(i, e) {
|
|
1511
1511
|
return { range: i, parent: e };
|
|
@@ -1513,27 +1513,27 @@ var Nn;
|
|
|
1513
1513
|
t.create = r;
|
|
1514
1514
|
function n(i) {
|
|
1515
1515
|
let e = i;
|
|
1516
|
-
return T.objectLiteral(e) &&
|
|
1516
|
+
return T.objectLiteral(e) && dt.is(e.range) && (e.parent === void 0 || t.is(e.parent));
|
|
1517
1517
|
}
|
|
1518
1518
|
t.is = n;
|
|
1519
|
-
})(
|
|
1520
|
-
var
|
|
1519
|
+
})(Mn || (Mn = {}));
|
|
1520
|
+
var Wn;
|
|
1521
1521
|
(function(t) {
|
|
1522
1522
|
t.namespace = "namespace", t.type = "type", t.class = "class", t.enum = "enum", t.interface = "interface", t.struct = "struct", t.typeParameter = "typeParameter", t.parameter = "parameter", t.variable = "variable", t.property = "property", t.enumMember = "enumMember", t.event = "event", t.function = "function", t.method = "method", t.macro = "macro", t.keyword = "keyword", t.modifier = "modifier", t.comment = "comment", t.string = "string", t.number = "number", t.regexp = "regexp", t.operator = "operator", t.decorator = "decorator";
|
|
1523
|
-
})(
|
|
1524
|
-
var
|
|
1523
|
+
})(Wn || (Wn = {}));
|
|
1524
|
+
var Zn;
|
|
1525
1525
|
(function(t) {
|
|
1526
1526
|
t.declaration = "declaration", t.definition = "definition", t.readonly = "readonly", t.static = "static", t.deprecated = "deprecated", t.abstract = "abstract", t.async = "async", t.modification = "modification", t.documentation = "documentation", t.defaultLibrary = "defaultLibrary";
|
|
1527
|
-
})(
|
|
1528
|
-
var
|
|
1527
|
+
})(Zn || (Zn = {}));
|
|
1528
|
+
var Xn;
|
|
1529
1529
|
(function(t) {
|
|
1530
1530
|
function r(n) {
|
|
1531
1531
|
const i = n;
|
|
1532
1532
|
return T.objectLiteral(i) && (i.resultId === void 0 || typeof i.resultId == "string") && Array.isArray(i.data) && (i.data.length === 0 || typeof i.data[0] == "number");
|
|
1533
1533
|
}
|
|
1534
1534
|
t.is = r;
|
|
1535
|
-
})(
|
|
1536
|
-
var
|
|
1535
|
+
})(Xn || (Xn = {}));
|
|
1536
|
+
var Vn;
|
|
1537
1537
|
(function(t) {
|
|
1538
1538
|
function r(i, e) {
|
|
1539
1539
|
return { range: i, text: e };
|
|
@@ -1541,11 +1541,11 @@ var Zn;
|
|
|
1541
1541
|
t.create = r;
|
|
1542
1542
|
function n(i) {
|
|
1543
1543
|
const e = i;
|
|
1544
|
-
return e != null &&
|
|
1544
|
+
return e != null && dt.is(e.range) && T.string(e.text);
|
|
1545
1545
|
}
|
|
1546
1546
|
t.is = n;
|
|
1547
|
-
})(
|
|
1548
|
-
var
|
|
1547
|
+
})(Vn || (Vn = {}));
|
|
1548
|
+
var Gn;
|
|
1549
1549
|
(function(t) {
|
|
1550
1550
|
function r(i, e, a) {
|
|
1551
1551
|
return { range: i, variableName: e, caseSensitiveLookup: a };
|
|
@@ -1553,11 +1553,11 @@ var Xn;
|
|
|
1553
1553
|
t.create = r;
|
|
1554
1554
|
function n(i) {
|
|
1555
1555
|
const e = i;
|
|
1556
|
-
return e != null &&
|
|
1556
|
+
return e != null && dt.is(e.range) && T.boolean(e.caseSensitiveLookup) && (T.string(e.variableName) || e.variableName === void 0);
|
|
1557
1557
|
}
|
|
1558
1558
|
t.is = n;
|
|
1559
|
-
})(
|
|
1560
|
-
var
|
|
1559
|
+
})(Gn || (Gn = {}));
|
|
1560
|
+
var Hn;
|
|
1561
1561
|
(function(t) {
|
|
1562
1562
|
function r(i, e) {
|
|
1563
1563
|
return { range: i, expression: e };
|
|
@@ -1565,11 +1565,11 @@ var Vn;
|
|
|
1565
1565
|
t.create = r;
|
|
1566
1566
|
function n(i) {
|
|
1567
1567
|
const e = i;
|
|
1568
|
-
return e != null &&
|
|
1568
|
+
return e != null && dt.is(e.range) && (T.string(e.expression) || e.expression === void 0);
|
|
1569
1569
|
}
|
|
1570
1570
|
t.is = n;
|
|
1571
|
-
})(
|
|
1572
|
-
var
|
|
1571
|
+
})(Hn || (Hn = {}));
|
|
1572
|
+
var Yn;
|
|
1573
1573
|
(function(t) {
|
|
1574
1574
|
function r(i, e) {
|
|
1575
1575
|
return { frameId: i, stoppedLocation: e };
|
|
@@ -1577,19 +1577,19 @@ var Gn;
|
|
|
1577
1577
|
t.create = r;
|
|
1578
1578
|
function n(i) {
|
|
1579
1579
|
const e = i;
|
|
1580
|
-
return T.defined(e) &&
|
|
1580
|
+
return T.defined(e) && dt.is(i.stoppedLocation);
|
|
1581
1581
|
}
|
|
1582
1582
|
t.is = n;
|
|
1583
|
-
})(
|
|
1584
|
-
var
|
|
1583
|
+
})(Yn || (Yn = {}));
|
|
1584
|
+
var ze;
|
|
1585
1585
|
(function(t) {
|
|
1586
1586
|
t.Type = 1, t.Parameter = 2;
|
|
1587
1587
|
function r(n) {
|
|
1588
1588
|
return n === 1 || n === 2;
|
|
1589
1589
|
}
|
|
1590
1590
|
t.is = r;
|
|
1591
|
-
})(
|
|
1592
|
-
var
|
|
1591
|
+
})(ze || (ze = {}));
|
|
1592
|
+
var $e;
|
|
1593
1593
|
(function(t) {
|
|
1594
1594
|
function r(i) {
|
|
1595
1595
|
return { value: i };
|
|
@@ -1600,8 +1600,8 @@ var Oe;
|
|
|
1600
1600
|
return T.objectLiteral(e) && (e.tooltip === void 0 || T.string(e.tooltip) || qt.is(e.tooltip)) && (e.location === void 0 || ee.is(e.location)) && (e.command === void 0 || Tt.is(e.command));
|
|
1601
1601
|
}
|
|
1602
1602
|
t.is = n;
|
|
1603
|
-
})(
|
|
1604
|
-
var
|
|
1603
|
+
})($e || ($e = {}));
|
|
1604
|
+
var Jn;
|
|
1605
1605
|
(function(t) {
|
|
1606
1606
|
function r(i, e, a) {
|
|
1607
1607
|
const s = { position: i, label: e };
|
|
@@ -1610,61 +1610,61 @@ var Hn;
|
|
|
1610
1610
|
t.create = r;
|
|
1611
1611
|
function n(i) {
|
|
1612
1612
|
const e = i;
|
|
1613
|
-
return T.objectLiteral(e) && wt.is(e.position) && (T.string(e.label) || T.typedArray(e.label,
|
|
1613
|
+
return T.objectLiteral(e) && wt.is(e.position) && (T.string(e.label) || T.typedArray(e.label, $e.is)) && (e.kind === void 0 || ze.is(e.kind)) && e.textEdits === void 0 || T.typedArray(e.textEdits, Rt.is) && (e.tooltip === void 0 || T.string(e.tooltip) || qt.is(e.tooltip)) && (e.paddingLeft === void 0 || T.boolean(e.paddingLeft)) && (e.paddingRight === void 0 || T.boolean(e.paddingRight));
|
|
1614
1614
|
}
|
|
1615
1615
|
t.is = n;
|
|
1616
|
-
})(
|
|
1617
|
-
var
|
|
1616
|
+
})(Jn || (Jn = {}));
|
|
1617
|
+
var Kn;
|
|
1618
1618
|
(function(t) {
|
|
1619
1619
|
function r(n) {
|
|
1620
1620
|
return { kind: "snippet", value: n };
|
|
1621
1621
|
}
|
|
1622
1622
|
t.createSnippet = r;
|
|
1623
|
-
})(
|
|
1624
|
-
var
|
|
1623
|
+
})(Kn || (Kn = {}));
|
|
1624
|
+
var Qn;
|
|
1625
1625
|
(function(t) {
|
|
1626
1626
|
function r(n, i, e, a) {
|
|
1627
1627
|
return { insertText: n, filterText: i, range: e, command: a };
|
|
1628
1628
|
}
|
|
1629
1629
|
t.create = r;
|
|
1630
|
-
})(
|
|
1631
|
-
var
|
|
1630
|
+
})(Qn || (Qn = {}));
|
|
1631
|
+
var tr;
|
|
1632
1632
|
(function(t) {
|
|
1633
1633
|
function r(n) {
|
|
1634
1634
|
return { items: n };
|
|
1635
1635
|
}
|
|
1636
1636
|
t.create = r;
|
|
1637
|
-
})(
|
|
1638
|
-
var
|
|
1637
|
+
})(tr || (tr = {}));
|
|
1638
|
+
var er;
|
|
1639
1639
|
(function(t) {
|
|
1640
1640
|
t.Invoked = 0, t.Automatic = 1;
|
|
1641
|
-
})(
|
|
1642
|
-
var
|
|
1641
|
+
})(er || (er = {}));
|
|
1642
|
+
var nr;
|
|
1643
1643
|
(function(t) {
|
|
1644
1644
|
function r(n, i) {
|
|
1645
1645
|
return { range: n, text: i };
|
|
1646
1646
|
}
|
|
1647
1647
|
t.create = r;
|
|
1648
|
-
})(
|
|
1649
|
-
var
|
|
1648
|
+
})(nr || (nr = {}));
|
|
1649
|
+
var rr;
|
|
1650
1650
|
(function(t) {
|
|
1651
1651
|
function r(n, i) {
|
|
1652
1652
|
return { triggerKind: n, selectedCompletionInfo: i };
|
|
1653
1653
|
}
|
|
1654
1654
|
t.create = r;
|
|
1655
|
-
})(
|
|
1656
|
-
var
|
|
1655
|
+
})(rr || (rr = {}));
|
|
1656
|
+
var ir;
|
|
1657
1657
|
(function(t) {
|
|
1658
1658
|
function r(n) {
|
|
1659
1659
|
const i = n;
|
|
1660
|
-
return T.objectLiteral(i) &&
|
|
1660
|
+
return T.objectLiteral(i) && ye.is(i.uri) && T.string(i.name);
|
|
1661
1661
|
}
|
|
1662
1662
|
t.is = r;
|
|
1663
|
-
})(
|
|
1664
|
-
var
|
|
1663
|
+
})(ir || (ir = {}));
|
|
1664
|
+
var ar;
|
|
1665
1665
|
(function(t) {
|
|
1666
1666
|
function r(a, s, o, c) {
|
|
1667
|
-
return new
|
|
1667
|
+
return new Li(a, s, o, c);
|
|
1668
1668
|
}
|
|
1669
1669
|
t.create = r;
|
|
1670
1670
|
function n(a) {
|
|
@@ -1702,8 +1702,8 @@ var rr;
|
|
|
1702
1702
|
a[g++] = l[p++];
|
|
1703
1703
|
return a;
|
|
1704
1704
|
}
|
|
1705
|
-
})(
|
|
1706
|
-
class
|
|
1705
|
+
})(ar || (ar = {}));
|
|
1706
|
+
class Li {
|
|
1707
1707
|
constructor(r, n, i, e) {
|
|
1708
1708
|
this._uri = r, this._languageId = n, this._version = i, this._content = e, this._lineOffsets = void 0;
|
|
1709
1709
|
}
|
|
@@ -1813,13 +1813,13 @@ var T;
|
|
|
1813
1813
|
}
|
|
1814
1814
|
t.typedArray = g;
|
|
1815
1815
|
})(T || (T = {}));
|
|
1816
|
-
const
|
|
1816
|
+
const Di = {
|
|
1817
1817
|
unused: "LaTeX-specific markup",
|
|
1818
1818
|
presentation: "Presentation does not go into PreTeXt source",
|
|
1819
1819
|
accessibility: "Accessibility issue",
|
|
1820
1820
|
mistake: "This feature should not have been added to LaTeX",
|
|
1821
1821
|
archaic: "plain TeX that should not be in LaTeX source"
|
|
1822
|
-
},
|
|
1822
|
+
}, Pi = {
|
|
1823
1823
|
textbf: [
|
|
1824
1824
|
{ macro: "alert", meaning: "something the reader must not miss" },
|
|
1825
1825
|
{ macro: "term", meaning: "a term being defined" },
|
|
@@ -1866,7 +1866,7 @@ function bt(t, r) {
|
|
|
1866
1866
|
reportMatch: l
|
|
1867
1867
|
}));
|
|
1868
1868
|
}
|
|
1869
|
-
const
|
|
1869
|
+
const ji = [
|
|
1870
1870
|
{
|
|
1871
1871
|
id: "paren-ref",
|
|
1872
1872
|
label: "(\\ref{...})",
|
|
@@ -1936,7 +1936,7 @@ const Di = [
|
|
|
1936
1936
|
replacement: "\\vspace{$1$2}",
|
|
1937
1937
|
severity: "info"
|
|
1938
1938
|
}
|
|
1939
|
-
],
|
|
1939
|
+
], Fi = [
|
|
1940
1940
|
{ from: "rm", to: "textrm" },
|
|
1941
1941
|
{ from: "em", to: "emph" },
|
|
1942
1942
|
{ from: "it", to: "textit" },
|
|
@@ -1947,7 +1947,7 @@ const Di = [
|
|
|
1947
1947
|
// Upstream typos, preserved so behavior matches PreprocessLaTeX.
|
|
1948
1948
|
{ from: "sffamily", to: "textss" },
|
|
1949
1949
|
{ from: "textsl", to: "testsl" }
|
|
1950
|
-
],
|
|
1950
|
+
], qi = Fi.map(
|
|
1951
1951
|
({ from: t, to: r }) => ({
|
|
1952
1952
|
id: `tex-font-${t}`,
|
|
1953
1953
|
label: t,
|
|
@@ -1964,7 +1964,7 @@ const Di = [
|
|
|
1964
1964
|
severity: "info",
|
|
1965
1965
|
message: `{\\${t} …} is a plain-TeX font directive; \\${r}{…} is its LaTeX form.`
|
|
1966
1966
|
})
|
|
1967
|
-
),
|
|
1967
|
+
), Bi = [
|
|
1968
1968
|
// --- badEverywhereMacros: bare control words, deleted wherever they appear.
|
|
1969
1969
|
...bt(["if", "fi", "iffalse", "then", "else", "loop", "repeat"], {
|
|
1970
1970
|
kind: "unused",
|
|
@@ -2120,7 +2120,7 @@ const Di = [
|
|
|
2120
2120
|
severity: "warning"
|
|
2121
2121
|
}).map((t) => ({
|
|
2122
2122
|
...t,
|
|
2123
|
-
alternatives:
|
|
2123
|
+
alternatives: Pi[t.id]
|
|
2124
2124
|
})),
|
|
2125
2125
|
// --- badBodyEnvironments: the wrapper goes, the content stays.
|
|
2126
2126
|
...["center", "minipage"].map(
|
|
@@ -2135,12 +2135,12 @@ const Di = [
|
|
|
2135
2135
|
severity: "info"
|
|
2136
2136
|
})
|
|
2137
2137
|
)
|
|
2138
|
-
],
|
|
2139
|
-
...Di,
|
|
2138
|
+
], Ni = [
|
|
2140
2139
|
...ji,
|
|
2141
|
-
...
|
|
2140
|
+
...qi,
|
|
2141
|
+
...Bi
|
|
2142
2142
|
];
|
|
2143
|
-
function
|
|
2143
|
+
function Sr(t, r = "auto") {
|
|
2144
2144
|
const n = { start: 0, end: 0 };
|
|
2145
2145
|
if (r === "preamble")
|
|
2146
2146
|
return {
|
|
@@ -2158,21 +2158,21 @@ function xr(t, r = "auto") {
|
|
|
2158
2158
|
bibliography: o
|
|
2159
2159
|
};
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const r =
|
|
2161
|
+
function Ui(t) {
|
|
2162
|
+
const r = $i(t), n = [];
|
|
2163
2163
|
let i = null;
|
|
2164
2164
|
for (const e of r.environments)
|
|
2165
|
-
|
|
2165
|
+
kr.has(e.name) && (e.type === "begin" ? i === null && (i = e.start) : i !== null && (n.push({ start: i, end: e.end }), i = null));
|
|
2166
2166
|
return i !== null && n.push({ start: i, end: t.length }), { math: r.mathRegions, comment: r.commentRegions, verbatim: n };
|
|
2167
2167
|
}
|
|
2168
|
-
const
|
|
2169
|
-
function
|
|
2168
|
+
const Mi = ["comment", "verbatim"];
|
|
2169
|
+
function Wi(t, r, n) {
|
|
2170
2170
|
return t.some((i) => r < i.end && n > i.start);
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2172
|
+
function sr(t) {
|
|
2173
2173
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2175
|
+
function Zi(t) {
|
|
2176
2176
|
const { match: r } = t;
|
|
2177
2177
|
if (r.type === "regex")
|
|
2178
2178
|
return new RegExp(
|
|
@@ -2181,10 +2181,10 @@ function Mi(t) {
|
|
|
2181
2181
|
);
|
|
2182
2182
|
if (r.type === "environment")
|
|
2183
2183
|
return new RegExp(
|
|
2184
|
-
`\\\\(?:begin|end)\\{\\s*${
|
|
2184
|
+
`\\\\(?:begin|end)\\{\\s*${sr(r.name)}\\}`,
|
|
2185
2185
|
"g"
|
|
2186
2186
|
);
|
|
2187
|
-
const n =
|
|
2187
|
+
const n = sr(r.name);
|
|
2188
2188
|
if (r.form === "args") {
|
|
2189
2189
|
let i = `\\\\${n}\\b\\*?`;
|
|
2190
2190
|
for (let e = 0; e < (r.arity ?? 1); e += 1) i += "\\{[^{}]*\\}";
|
|
@@ -2192,22 +2192,22 @@ function Mi(t) {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
return r.form === "line" ? new RegExp(`\\\\${n}\\b.*`, "g") : new RegExp(`\\\\${n}\\b`, "g");
|
|
2194
2194
|
}
|
|
2195
|
-
function
|
|
2195
|
+
function Xi(t) {
|
|
2196
2196
|
if (t.label) return t.label;
|
|
2197
2197
|
const { match: r } = t;
|
|
2198
2198
|
return r.type === "macro" || r.type === "environment" ? r.name : t.id;
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2200
|
+
function Vi(t, r) {
|
|
2201
2201
|
return t.replace(
|
|
2202
2202
|
/\$(\d)/g,
|
|
2203
2203
|
(n, i) => r[Number(i)] ?? ""
|
|
2204
2204
|
);
|
|
2205
2205
|
}
|
|
2206
2206
|
function Ft(t, r = {}) {
|
|
2207
|
-
const { scope: n = "auto", disable: i, only: e } = r, a =
|
|
2208
|
-
return
|
|
2207
|
+
const { scope: n = "auto", disable: i, only: e } = r, a = Sr(t, n), s = Ui(t), o = new Set(i ?? []), c = e ? new Set(e) : null, l = [];
|
|
2208
|
+
return Ni.forEach((f, p) => {
|
|
2209
2209
|
if (o.has(f.id) || c && !c.has(f.id)) return;
|
|
2210
|
-
const d = (f.skipIn ??
|
|
2210
|
+
const d = (f.skipIn ?? Mi).flatMap((v) => s[v]), w = Zi(f);
|
|
2211
2211
|
let h;
|
|
2212
2212
|
for (; (h = w.exec(t)) !== null; ) {
|
|
2213
2213
|
const v = h.index, b = v + h[0].length;
|
|
@@ -2215,15 +2215,15 @@ function Ft(t, r = {}) {
|
|
|
2215
2215
|
w.lastIndex += 1;
|
|
2216
2216
|
continue;
|
|
2217
2217
|
}
|
|
2218
|
-
if (!
|
|
2219
|
-
const x = f.action === "flag" ? void 0 : f.action === "delete" ? "" :
|
|
2218
|
+
if (!Gi(f.scope, a, v) || Wi(d, v, b)) continue;
|
|
2219
|
+
const x = f.action === "flag" ? void 0 : f.action === "delete" ? "" : Vi(f.replacement ?? "", h);
|
|
2220
2220
|
x !== h[0] && l.push({
|
|
2221
2221
|
ruleId: f.id,
|
|
2222
2222
|
action: f.action,
|
|
2223
2223
|
severity: f.severity,
|
|
2224
2224
|
kind: f.kind,
|
|
2225
2225
|
category: f.category,
|
|
2226
|
-
macro:
|
|
2226
|
+
macro: Xi(f),
|
|
2227
2227
|
start: v,
|
|
2228
2228
|
end: b,
|
|
2229
2229
|
matched: h[0],
|
|
@@ -2235,16 +2235,16 @@ function Ft(t, r = {}) {
|
|
|
2235
2235
|
priority: p
|
|
2236
2236
|
});
|
|
2237
2237
|
}
|
|
2238
|
-
}),
|
|
2238
|
+
}), Hi(l);
|
|
2239
2239
|
}
|
|
2240
|
-
function
|
|
2240
|
+
function Gi(t, r, n) {
|
|
2241
2241
|
if (r.bibliography && n >= r.bibliography.start)
|
|
2242
2242
|
return !1;
|
|
2243
2243
|
if (t === "anywhere") return !0;
|
|
2244
2244
|
const i = t === "preamble" ? r.preamble : r.body;
|
|
2245
2245
|
return n >= i.start && n < i.end;
|
|
2246
2246
|
}
|
|
2247
|
-
function
|
|
2247
|
+
function Hi(t) {
|
|
2248
2248
|
const r = t.filter((a) => a.replacement !== void 0).sort(
|
|
2249
2249
|
(a, s) => a.start - s.start || s.end - s.start - (a.end - a.start) || a.priority - s.priority
|
|
2250
2250
|
), n = [];
|
|
@@ -2256,10 +2256,10 @@ function Vi(t) {
|
|
|
2256
2256
|
);
|
|
2257
2257
|
return [...n, ...e].sort((a, s) => a.start - s.start || a.priority - s.priority).map(({ priority: a, ...s }) => s);
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function Yi(t) {
|
|
2260
2260
|
return t !== void 0 && (t >= "a" && t <= "z" || t >= "A" && t <= "Z");
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function or(t, r, n, i) {
|
|
2263
2263
|
if (t[r] !== n) return null;
|
|
2264
2264
|
let e = 0;
|
|
2265
2265
|
for (let a = r; a < t.length; a += 1) {
|
|
@@ -2274,12 +2274,12 @@ function ar(t, r, n, i) {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
return null;
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function Ji(t, r) {
|
|
2278
2278
|
if (t[r] !== "\\") return null;
|
|
2279
2279
|
let n = r + 1;
|
|
2280
|
-
for (;
|
|
2280
|
+
for (; Yi(t[n]); ) n += 1;
|
|
2281
2281
|
if (n === r + 1) return null;
|
|
2282
|
-
const i = t.slice(r + 1, n), e = n, a =
|
|
2282
|
+
const i = t.slice(r + 1, n), e = n, a = Ci.get(i)?.signature ?? "m", s = [];
|
|
2283
2283
|
let o = e;
|
|
2284
2284
|
for (const c of a.split(/\s+/).filter(Boolean)) {
|
|
2285
2285
|
let l = o;
|
|
@@ -2289,36 +2289,36 @@ function Hi(t, r) {
|
|
|
2289
2289
|
continue;
|
|
2290
2290
|
}
|
|
2291
2291
|
if (c === "o") {
|
|
2292
|
-
const p =
|
|
2292
|
+
const p = or(t, l, "[", "]");
|
|
2293
2293
|
p !== null && (o = p);
|
|
2294
2294
|
continue;
|
|
2295
2295
|
}
|
|
2296
|
-
const f =
|
|
2296
|
+
const f = or(t, l, "{", "}");
|
|
2297
2297
|
if (f === null) break;
|
|
2298
2298
|
s.push({ start: l + 1, end: f - 1 }), o = f;
|
|
2299
2299
|
}
|
|
2300
2300
|
return { name: i, start: r, nameEnd: e, end: o, mandatoryArguments: s };
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Ki(t, r) {
|
|
2303
2303
|
return r.mandatoryArguments.map((n) => t.slice(n.start, n.end)).join("");
|
|
2304
2304
|
}
|
|
2305
|
-
function
|
|
2305
|
+
function pe(t) {
|
|
2306
2306
|
return t.mandatoryArguments.length === 0;
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function Qi(t, r) {
|
|
2309
2309
|
const n = r.filter((s) => s.replacement !== void 0).sort((s, o) => o.start - s.start), i = [];
|
|
2310
2310
|
let e = t, a = Number.POSITIVE_INFINITY;
|
|
2311
2311
|
for (const s of n)
|
|
2312
2312
|
s.end > a || (e = e.slice(0, s.start) + s.replacement + e.slice(s.end), i.push(s), a = s.start);
|
|
2313
2313
|
return { output: e, applied: i.reverse() };
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function Me(t, r = {}) {
|
|
2316
2316
|
const { maxPasses: n = 5, ...i } = r, e = [];
|
|
2317
2317
|
let a = t, s = 0, o = !1;
|
|
2318
2318
|
for (; s < n; s += 1) {
|
|
2319
2319
|
const l = Ft(a, i).filter((g) => g.replacement !== void 0);
|
|
2320
2320
|
if (l.length === 0) break;
|
|
2321
|
-
const { output: f, applied: p } =
|
|
2321
|
+
const { output: f, applied: p } = Qi(a, l);
|
|
2322
2322
|
if (f === a) break;
|
|
2323
2323
|
e.push(...p), a = f, s === n - 1 && (o = Ft(a, i).some(
|
|
2324
2324
|
(g) => g.replacement !== void 0
|
|
@@ -2330,14 +2330,14 @@ function Ne(t, r = {}) {
|
|
|
2330
2330
|
)
|
|
2331
2331
|
), { output: a, fixes: e, passes: s, truncated: o };
|
|
2332
2332
|
}
|
|
2333
|
-
const
|
|
2333
|
+
const ta = "pretext-latex-clean", ea = {
|
|
2334
2334
|
info: jt.Information,
|
|
2335
2335
|
warning: jt.Warning,
|
|
2336
2336
|
error: jt.Error
|
|
2337
2337
|
};
|
|
2338
|
-
function
|
|
2338
|
+
function na(t) {
|
|
2339
2339
|
if (t.message) return t.message;
|
|
2340
|
-
const r =
|
|
2340
|
+
const r = Di[t.kind], n = t.ruleId.startsWith("env-") ? `The ${t.macro} environment` : `\\${t.macro}`;
|
|
2341
2341
|
if (t.action === "replace")
|
|
2342
2342
|
return `${n} is rewritten on import.`;
|
|
2343
2343
|
if (t.action === "delete")
|
|
@@ -2348,13 +2348,13 @@ function ta(t) {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
return r ? `${n}: ${r}.` : `${n} is presentational.`;
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function We(t, r) {
|
|
2352
2352
|
return r.map((n) => ({
|
|
2353
|
-
severity:
|
|
2353
|
+
severity: ea[n.severity],
|
|
2354
2354
|
range: Qt(t, n.start, n.end),
|
|
2355
|
-
source:
|
|
2355
|
+
source: ta,
|
|
2356
2356
|
code: n.ruleId,
|
|
2357
|
-
message:
|
|
2357
|
+
message: na(n),
|
|
2358
2358
|
data: {
|
|
2359
2359
|
ruleId: n.ruleId,
|
|
2360
2360
|
start: n.start,
|
|
@@ -2363,10 +2363,10 @@ function Ue(t, r) {
|
|
|
2363
2363
|
}
|
|
2364
2364
|
}));
|
|
2365
2365
|
}
|
|
2366
|
-
function
|
|
2367
|
-
return
|
|
2366
|
+
function Eo(t, r) {
|
|
2367
|
+
return We(t, Ft(t, r));
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function cr(t, r, n) {
|
|
2370
2370
|
let i = 0;
|
|
2371
2371
|
for (let e = 0; e < r; e += 1) {
|
|
2372
2372
|
const a = t.indexOf(`
|
|
@@ -2376,31 +2376,31 @@ function sr(t, r, n) {
|
|
|
2376
2376
|
}
|
|
2377
2377
|
return Math.min(i + n, t.length);
|
|
2378
2378
|
}
|
|
2379
|
-
function
|
|
2380
|
-
const i =
|
|
2379
|
+
function ra(t, r, n) {
|
|
2380
|
+
const i = cr(t, n.start.line, n.start.character), e = cr(t, n.end.line, n.end.character);
|
|
2381
2381
|
return i === e ? r.start <= i && i <= r.end : r.start < e && r.end > i;
|
|
2382
2382
|
}
|
|
2383
|
-
function
|
|
2383
|
+
function Ao(t, r, n) {
|
|
2384
2384
|
const { uri: i, includeCleanAll: e = !0, ...a } = n, s = Ft(t, a), o = [];
|
|
2385
2385
|
for (const c of s)
|
|
2386
|
-
if (
|
|
2386
|
+
if (ra(t, c, r)) {
|
|
2387
2387
|
if (c.replacement !== void 0) {
|
|
2388
2388
|
const l = {
|
|
2389
2389
|
range: Qt(t, c.start, c.end),
|
|
2390
2390
|
newText: c.replacement
|
|
2391
2391
|
};
|
|
2392
2392
|
o.push({
|
|
2393
|
-
title:
|
|
2393
|
+
title: aa(c),
|
|
2394
2394
|
kind: Ot.QuickFix,
|
|
2395
|
-
diagnostics:
|
|
2395
|
+
diagnostics: We(t, [c]),
|
|
2396
2396
|
edit: { changes: { [i]: [l] } }
|
|
2397
2397
|
});
|
|
2398
2398
|
continue;
|
|
2399
2399
|
}
|
|
2400
|
-
o.push(...
|
|
2400
|
+
o.push(...ia(t, s, c, i));
|
|
2401
2401
|
}
|
|
2402
2402
|
if (e) {
|
|
2403
|
-
const c =
|
|
2403
|
+
const c = Me(t, a);
|
|
2404
2404
|
if (c.output !== t) {
|
|
2405
2405
|
const l = c.fixes.filter(
|
|
2406
2406
|
(f) => f.replacement !== void 0
|
|
@@ -2416,7 +2416,7 @@ function xo(t, r, n) {
|
|
|
2416
2416
|
{
|
|
2417
2417
|
range: {
|
|
2418
2418
|
start: { line: 0, character: 0 },
|
|
2419
|
-
end:
|
|
2419
|
+
end: _e(t, t.length)
|
|
2420
2420
|
},
|
|
2421
2421
|
newText: c.output
|
|
2422
2422
|
}
|
|
@@ -2428,8 +2428,8 @@ function xo(t, r, n) {
|
|
|
2428
2428
|
}
|
|
2429
2429
|
return o;
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2432
|
-
const e =
|
|
2431
|
+
function ia(t, r, n, i) {
|
|
2432
|
+
const e = We(t, [n]), a = r.filter((f) => f.ruleId === n.ruleId), s = [], o = (f, p, g) => {
|
|
2433
2433
|
const d = g(n);
|
|
2434
2434
|
if (!d || (s.push({
|
|
2435
2435
|
title: f,
|
|
@@ -2471,20 +2471,20 @@ function na(t, r, n, i) {
|
|
|
2471
2471
|
newText: `\\${f.macro}`
|
|
2472
2472
|
})
|
|
2473
2473
|
);
|
|
2474
|
-
const c = (f) =>
|
|
2475
|
-
return l && !
|
|
2474
|
+
const c = (f) => Ji(t, f.start), l = c(n);
|
|
2475
|
+
return l && !pe(l) && o(
|
|
2476
2476
|
`Remove \\${n.macro}, keep its text`,
|
|
2477
2477
|
`Remove all {n} \\${n.macro}, keep their text`,
|
|
2478
2478
|
(f) => {
|
|
2479
2479
|
const p = c(f);
|
|
2480
|
-
return !p ||
|
|
2480
|
+
return !p || pe(p) ? null : {
|
|
2481
2481
|
start: p.start,
|
|
2482
2482
|
end: p.end,
|
|
2483
|
-
newText:
|
|
2483
|
+
newText: Ki(t, p)
|
|
2484
2484
|
};
|
|
2485
2485
|
}
|
|
2486
2486
|
), o(
|
|
2487
|
-
l && !
|
|
2487
|
+
l && !pe(l) ? `Delete \\${n.macro} and its text` : `Delete \\${n.macro}`,
|
|
2488
2488
|
`Delete all {n} \\${n.macro} and their text`,
|
|
2489
2489
|
(f) => {
|
|
2490
2490
|
const p = c(f);
|
|
@@ -2492,11 +2492,11 @@ function na(t, r, n, i) {
|
|
|
2492
2492
|
}
|
|
2493
2493
|
), s;
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function aa(t) {
|
|
2496
2496
|
const r = t.ruleId.startsWith("env-") ? `\\begin{${t.macro}}` : `\\${t.macro}`;
|
|
2497
2497
|
return t.replacement === "" ? `Remove ${r}` : `Replace ${r} with ${t.replacementLabel ?? t.replacement?.trim()}`;
|
|
2498
2498
|
}
|
|
2499
|
-
function
|
|
2499
|
+
function sa(t) {
|
|
2500
2500
|
const { mainSource: r, publication: n, outputBase: i = "output" } = t;
|
|
2501
2501
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2502
2502
|
<project ptx-version="2">
|
|
@@ -2517,7 +2517,7 @@ function ia(t) {
|
|
|
2517
2517
|
</project>
|
|
2518
2518
|
`;
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function Er() {
|
|
2521
2521
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2522
2522
|
<publication>
|
|
2523
2523
|
<source>
|
|
@@ -2529,12 +2529,12 @@ function kr() {
|
|
|
2529
2529
|
</publication>
|
|
2530
2530
|
`;
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function oa() {
|
|
2533
2533
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2534
2534
|
`;
|
|
2535
2535
|
}
|
|
2536
|
-
const
|
|
2537
|
-
function
|
|
2536
|
+
const ca = "http://www.w3.org/2001/XInclude";
|
|
2537
|
+
function Ze(t) {
|
|
2538
2538
|
return t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
|
|
2539
2539
|
}
|
|
2540
2540
|
function ue(t, r) {
|
|
@@ -2548,23 +2548,23 @@ function Wt(t, r) {
|
|
|
2548
2548
|
i += t.slice(e, a.start), i += a.replacement, e = a.end;
|
|
2549
2549
|
return i += t.slice(e), i;
|
|
2550
2550
|
}
|
|
2551
|
-
function
|
|
2551
|
+
function Le(t) {
|
|
2552
2552
|
return t.replace(
|
|
2553
2553
|
/<([a-zA-Z_][\w:.-]*)\b([^>]*)>/,
|
|
2554
|
-
(r, n, i) => /\bxmlns:xi\s*=/.test(i) ? r : `<${n}${i} xmlns:xi="${
|
|
2554
|
+
(r, n, i) => /\bxmlns:xi\s*=/.test(i) ? r : `<${n}${i} xmlns:xi="${ca}">`
|
|
2555
2555
|
);
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2558
|
-
return t.startsWith("<?xml") ? t :
|
|
2557
|
+
function De(t) {
|
|
2558
|
+
return t.startsWith("<?xml") ? t : oa() + t;
|
|
2559
2559
|
}
|
|
2560
|
-
const
|
|
2560
|
+
const Ar = [
|
|
2561
2561
|
"part",
|
|
2562
2562
|
"chapter",
|
|
2563
2563
|
"section",
|
|
2564
2564
|
"subsection",
|
|
2565
2565
|
"subsubsection"
|
|
2566
2566
|
];
|
|
2567
|
-
function
|
|
2567
|
+
function la(t, r) {
|
|
2568
2568
|
let n = r;
|
|
2569
2569
|
for (; n < t.length && /\s/.test(t[n]); ) n++;
|
|
2570
2570
|
if (t[n] !== "{") return null;
|
|
@@ -2582,7 +2582,7 @@ function oa(t, r) {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
return null;
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function ua(t, r) {
|
|
2586
2586
|
let n = r;
|
|
2587
2587
|
for (; n < t.length && /\s/.test(t[n]); ) n++;
|
|
2588
2588
|
if (t[n] !== "[") return r;
|
|
@@ -2599,11 +2599,11 @@ function ca(t, r) {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
return r;
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2602
|
+
function da(t) {
|
|
2603
2603
|
return t.replace(/\\[a-zA-Z]+\{([^{}]*)\}/g, "$1").replace(/\\[a-zA-Z]+/g, "").replace(/[{}]/g, "").replace(/\s+/g, " ").trim();
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2606
|
-
const r = [], n = new Set(
|
|
2605
|
+
function Xe(t) {
|
|
2606
|
+
const r = [], n = new Set(Ar);
|
|
2607
2607
|
let i = 0;
|
|
2608
2608
|
for (let e = 0; e < t.length; e++) {
|
|
2609
2609
|
const a = t[e];
|
|
@@ -2627,7 +2627,7 @@ function We(t) {
|
|
|
2627
2627
|
e = s - 1;
|
|
2628
2628
|
continue;
|
|
2629
2629
|
}
|
|
2630
|
-
const c = t[s] === "*" ? s + 1 : s, l =
|
|
2630
|
+
const c = t[s] === "*" ? s + 1 : s, l = la(t, ua(t, c));
|
|
2631
2631
|
if (!l) {
|
|
2632
2632
|
e = s - 1;
|
|
2633
2633
|
continue;
|
|
@@ -2644,18 +2644,18 @@ function We(t) {
|
|
|
2644
2644
|
}
|
|
2645
2645
|
return r;
|
|
2646
2646
|
}
|
|
2647
|
-
function
|
|
2648
|
-
const r = new Set(
|
|
2649
|
-
return
|
|
2647
|
+
function Ve(t) {
|
|
2648
|
+
const r = new Set(Xe(t).map((n) => n.command));
|
|
2649
|
+
return Ar.filter((n) => r.has(n));
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2652
|
-
const r =
|
|
2651
|
+
function Ir(t) {
|
|
2652
|
+
const r = Ve(t), n = new Map(r.map((s, o) => [s, o + 1])), i = Xe(t), e = [], a = [];
|
|
2653
2653
|
for (const s of i) {
|
|
2654
2654
|
const o = n.get(s.command) ?? 1, c = {
|
|
2655
2655
|
command: s.command,
|
|
2656
2656
|
level: o,
|
|
2657
2657
|
rawTitle: s.rawTitle,
|
|
2658
|
-
title:
|
|
2658
|
+
title: da(s.rawTitle),
|
|
2659
2659
|
labelId: s.labelId,
|
|
2660
2660
|
start: s.start,
|
|
2661
2661
|
contentStart: s.contentStart,
|
|
@@ -2668,48 +2668,48 @@ function Er(t) {
|
|
|
2668
2668
|
}
|
|
2669
2669
|
return e;
|
|
2670
2670
|
}
|
|
2671
|
-
const
|
|
2672
|
-
function
|
|
2673
|
-
return r <= 1 ? t : t.flatMap((n) =>
|
|
2671
|
+
const fa = 8e4, ha = 4e4, pa = 3, ma = 3;
|
|
2672
|
+
function Pe(t, r) {
|
|
2673
|
+
return r <= 1 ? t : t.flatMap((n) => Pe(n.children, r - 1));
|
|
2674
2674
|
}
|
|
2675
|
-
function
|
|
2676
|
-
const n =
|
|
2675
|
+
function ga(t, r) {
|
|
2676
|
+
const n = Ir(t);
|
|
2677
2677
|
if (n.length === 0) return 0;
|
|
2678
2678
|
let i = r === "book" ? 1 : 0;
|
|
2679
|
-
const e = t.length >
|
|
2680
|
-
for (; i <
|
|
2681
|
-
const s = i === 0 ? e :
|
|
2682
|
-
(o) => o.end - o.start >
|
|
2679
|
+
const e = t.length > fa;
|
|
2680
|
+
for (; i < ma && !(Pe(n, i + 1).length < pa); ) {
|
|
2681
|
+
const s = i === 0 ? e : Pe(n, i).some(
|
|
2682
|
+
(o) => o.end - o.start > ha
|
|
2683
2683
|
);
|
|
2684
2684
|
if (!e && !s) break;
|
|
2685
2685
|
i += 1;
|
|
2686
2686
|
}
|
|
2687
2687
|
return i;
|
|
2688
2688
|
}
|
|
2689
|
-
function
|
|
2689
|
+
function ba(t) {
|
|
2690
2690
|
let r = t;
|
|
2691
2691
|
return r = r.replace(/\s+%.*/g, ""), r = r.replace(/([^\\])%.*/g, "$1"), r = r.replace(/^%.*/, ""), r;
|
|
2692
2692
|
}
|
|
2693
|
-
function
|
|
2693
|
+
function va(t) {
|
|
2694
2694
|
return t.replace(/(.*\{)([^{}]+)(\}.*)/, (r, n, i, e) => {
|
|
2695
2695
|
const a = String(i).replace(/\s/g, "_").replace(/[^a-zA-Z0-9_]/g, "-");
|
|
2696
2696
|
return `${n}${a}${e}`;
|
|
2697
2697
|
});
|
|
2698
2698
|
}
|
|
2699
|
-
function
|
|
2699
|
+
function wa(t) {
|
|
2700
2700
|
let r = t;
|
|
2701
2701
|
return r = r.replace(/> */g, "\\gt "), r = r.replace(/< */g, "\\lt "), r = r.replace(
|
|
2702
2702
|
/(\\(ref|eqref|cref|Cref|label)\{([^{}]+)\})/g,
|
|
2703
|
-
|
|
2703
|
+
va
|
|
2704
2704
|
), r;
|
|
2705
2705
|
}
|
|
2706
|
-
function
|
|
2706
|
+
function Tr(t) {
|
|
2707
2707
|
let r = t;
|
|
2708
|
-
return r = r.replace(/\\begin +/g, "\\begin"), r = r.replace(/\\chapter +/g, "\\chapter"), r = r.replace(/\\section +/g, "\\section"), r = r.replace(/\\section\*/g, "\\section"), r =
|
|
2708
|
+
return r = r.replace(/\\begin +/g, "\\begin"), r = r.replace(/\\chapter +/g, "\\chapter"), r = r.replace(/\\section +/g, "\\section"), r = r.replace(/\\section\*/g, "\\section"), r = ba(r), r = wa(r), r = r.replace(/\\end\{document\}.*/s, ""), r = r.replace(/^\s+/, ""), r = r.replace(/\n{3,}/g, `
|
|
2709
2709
|
|
|
2710
2710
|
`), r;
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2712
|
+
function lr(t, r = 0, n = "{", i = "}") {
|
|
2713
2713
|
let e = t.trimStart();
|
|
2714
2714
|
if (!e)
|
|
2715
2715
|
return ["", ""];
|
|
@@ -2723,10 +2723,10 @@ function or(t, r = 0, n = "{", i = "}") {
|
|
|
2723
2723
|
}
|
|
2724
2724
|
return o === 0 ? [s, e] : ["", s.substring(1)];
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
const n =
|
|
2726
|
+
function Io(t, r = {}) {
|
|
2727
|
+
const n = Tr(t).replace(/(\n *){3,}/g, `
|
|
2728
2728
|
|
|
2729
|
-
`), { output: i, fixes: e } =
|
|
2729
|
+
`), { output: i, fixes: e } = Me(n, {
|
|
2730
2730
|
scope: r.scope ?? "auto",
|
|
2731
2731
|
disable: r.disable
|
|
2732
2732
|
});
|
|
@@ -2734,11 +2734,11 @@ function ko(t, r = {}) {
|
|
|
2734
2734
|
output: i.replace(/(\n *){3,}/g, `
|
|
2735
2735
|
|
|
2736
2736
|
`),
|
|
2737
|
-
warnings:
|
|
2737
|
+
warnings: Rr(e),
|
|
2738
2738
|
fixes: e
|
|
2739
2739
|
};
|
|
2740
2740
|
}
|
|
2741
|
-
function
|
|
2741
|
+
function Rr(t) {
|
|
2742
2742
|
const r = /* @__PURE__ */ new Map();
|
|
2743
2743
|
for (const i of t) {
|
|
2744
2744
|
const e = r.get(i.ruleId);
|
|
@@ -2770,10 +2770,10 @@ function Ir(t) {
|
|
|
2770
2770
|
}
|
|
2771
2771
|
return n;
|
|
2772
2772
|
}
|
|
2773
|
-
function
|
|
2774
|
-
const r =
|
|
2773
|
+
function _a(t) {
|
|
2774
|
+
const r = Tr(t).replace(/(\n *){3,}/g, `
|
|
2775
2775
|
|
|
2776
|
-
`), n =
|
|
2776
|
+
`), n = Sr(r, "auto"), i = [], e = r.slice(n.preamble.start, n.preamble.end);
|
|
2777
2777
|
e && i.push(
|
|
2778
2778
|
Jt(
|
|
2779
2779
|
e,
|
|
@@ -2787,18 +2787,18 @@ function va(t) {
|
|
|
2787
2787
|
)
|
|
2788
2788
|
);
|
|
2789
2789
|
const a = r.slice(n.body.start, n.body.end);
|
|
2790
|
-
i.push(...
|
|
2790
|
+
i.push(...ya(a));
|
|
2791
2791
|
const s = n.bibliography ? r.slice(n.bibliography.start, n.bibliography.end) : "", o = r.includes("\\begin{document}"), c = i.filter((g) => g.kind !== "preamble").map((g) => g.after).join(""), l = i.find((g) => g.kind === "preamble")?.after ?? "", f = ((o ? l + "\\begin{document}" : "") + c + s).replace(/(\n *){3,}/g, `
|
|
2792
2792
|
|
|
2793
2793
|
`), p = i.flatMap((g) => g.fixes);
|
|
2794
|
-
return { output: f, chunks: i, warnings:
|
|
2794
|
+
return { output: f, chunks: i, warnings: Rr(p), fixes: p };
|
|
2795
2795
|
}
|
|
2796
2796
|
function Jt(t, r, n) {
|
|
2797
|
-
const { output: i, fixes: e } =
|
|
2797
|
+
const { output: i, fixes: e } = Me(t, { scope: n });
|
|
2798
2798
|
return { ...r, before: t, after: i, fixes: e };
|
|
2799
2799
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const r =
|
|
2800
|
+
function ya(t) {
|
|
2801
|
+
const r = Xe(t), n = Ve(t), i = new Map(n.map((c, l) => [c, l + 1]));
|
|
2802
2802
|
if (r.length === 0)
|
|
2803
2803
|
return t ? [
|
|
2804
2804
|
Jt(
|
|
@@ -2814,7 +2814,7 @@ function wa(t) {
|
|
|
2814
2814
|
) : s = a;
|
|
2815
2815
|
const o = [];
|
|
2816
2816
|
return r.forEach((c, l) => {
|
|
2817
|
-
const f = i.get(c.command) ?? 1, p =
|
|
2817
|
+
const f = i.get(c.command) ?? 1, p = xa(c.rawTitle);
|
|
2818
2818
|
o.length = f - 1, o[f - 1] = p;
|
|
2819
2819
|
const g = r[l + 1]?.start ?? t.length, d = (l === 0 ? s : "") + t.slice(c.start, g);
|
|
2820
2820
|
e.push(
|
|
@@ -2832,10 +2832,10 @@ function wa(t) {
|
|
|
2832
2832
|
);
|
|
2833
2833
|
}), e;
|
|
2834
2834
|
}
|
|
2835
|
-
function
|
|
2835
|
+
function xa(t) {
|
|
2836
2836
|
return t.replace(/\\[a-zA-Z]+\{([^{}]*)\}/g, "$1").replace(/\\[a-zA-Z]+/g, "").replace(/[{}]/g, "").replace(/\s+/g, " ").trim();
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function To(t, r) {
|
|
2839
2839
|
const n = [];
|
|
2840
2840
|
for (const i of t) {
|
|
2841
2841
|
if (i.kind === "preamble") {
|
|
@@ -2868,14 +2868,14 @@ function ae(t, r) {
|
|
|
2868
2868
|
if (!i) return "";
|
|
2869
2869
|
let e = t.slice(i.index + i[0].length).trimStart();
|
|
2870
2870
|
if (e.startsWith("[")) {
|
|
2871
|
-
const [s, o] =
|
|
2871
|
+
const [s, o] = lr(e, 0, "[", "]");
|
|
2872
2872
|
s && (e = o.trimStart());
|
|
2873
2873
|
}
|
|
2874
|
-
const [a] =
|
|
2874
|
+
const [a] = lr(e);
|
|
2875
2875
|
return a ? a.slice(1, -1).trim() : "";
|
|
2876
2876
|
}
|
|
2877
|
-
const
|
|
2878
|
-
function
|
|
2877
|
+
const ka = /^[ \t]*(\\(?:new|renew|provide)command\*?|\\DeclareMathOperator\*?|\\newenvironment\*?|\\def)\b/, Sa = /^[ \t]*\\def\b/;
|
|
2878
|
+
function ur(t) {
|
|
2879
2879
|
let r = 0;
|
|
2880
2880
|
for (let n = 0; n < t.length; n++) {
|
|
2881
2881
|
if (t[n] === "\\") {
|
|
@@ -2886,21 +2886,21 @@ function cr(t) {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
return r;
|
|
2888
2888
|
}
|
|
2889
|
-
function
|
|
2889
|
+
function Cr(t) {
|
|
2890
2890
|
const r = t.split(`
|
|
2891
2891
|
`), n = [], i = [];
|
|
2892
2892
|
let e = 0;
|
|
2893
2893
|
for (; e < r.length; ) {
|
|
2894
|
-
if (!
|
|
2894
|
+
if (!ka.test(r[e])) {
|
|
2895
2895
|
e++;
|
|
2896
2896
|
continue;
|
|
2897
2897
|
}
|
|
2898
|
-
let s = r[e], o =
|
|
2898
|
+
let s = r[e], o = ur(r[e]);
|
|
2899
2899
|
for (e++; o > 0 && e < r.length; )
|
|
2900
2900
|
s += `
|
|
2901
|
-
` + r[e], o +=
|
|
2901
|
+
` + r[e], o += ur(r[e]), e++;
|
|
2902
2902
|
const c = s.trim();
|
|
2903
|
-
n.push(c),
|
|
2903
|
+
n.push(c), Sa.test(c) && i.push(c);
|
|
2904
2904
|
}
|
|
2905
2905
|
const a = i.length > 0 ? [
|
|
2906
2906
|
{
|
|
@@ -2917,24 +2917,24 @@ function Tr(t) {
|
|
|
2917
2917
|
return { macros: n.join(`
|
|
2918
2918
|
`), warnings: a };
|
|
2919
2919
|
}
|
|
2920
|
-
function
|
|
2920
|
+
function Ea(t) {
|
|
2921
2921
|
const r = /\\documentclass(?:\[[^\]]*\])?\{([^}]+)\}/.exec(t);
|
|
2922
2922
|
return r ? r[1].trim() : "article";
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2925
|
-
return
|
|
2924
|
+
function Aa(t) {
|
|
2925
|
+
return Ia.has(t.trim().toLowerCase());
|
|
2926
2926
|
}
|
|
2927
|
-
const
|
|
2927
|
+
const Ia = /* @__PURE__ */ new Set([
|
|
2928
2928
|
"beamer",
|
|
2929
2929
|
"powerdot",
|
|
2930
2930
|
"seminar",
|
|
2931
2931
|
"slides"
|
|
2932
2932
|
]);
|
|
2933
|
-
function
|
|
2934
|
-
const r = t.replace(/(^|[^\\])%[^\n]*/gm, "$1"), { macros: n, warnings: i } =
|
|
2933
|
+
function Ta(t) {
|
|
2934
|
+
const r = t.replace(/(^|[^\\])%[^\n]*/gm, "$1"), { macros: n, warnings: i } = Cr(r);
|
|
2935
2935
|
return {
|
|
2936
2936
|
info: {
|
|
2937
|
-
documentClass:
|
|
2937
|
+
documentClass: Ea(r),
|
|
2938
2938
|
title: ae(r, "title"),
|
|
2939
2939
|
author: ae(r, "author"),
|
|
2940
2940
|
macros: n
|
|
@@ -2942,7 +2942,7 @@ function Aa(t) {
|
|
|
2942
2942
|
warnings: i
|
|
2943
2943
|
};
|
|
2944
2944
|
}
|
|
2945
|
-
function
|
|
2945
|
+
function Ra(t) {
|
|
2946
2946
|
if (typeof t == "string")
|
|
2947
2947
|
return t;
|
|
2948
2948
|
if (typeof t == "object" && t !== null && "value" in t) {
|
|
@@ -2954,16 +2954,16 @@ function Ia(t) {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
return String(t);
|
|
2956
2956
|
}
|
|
2957
|
-
function
|
|
2957
|
+
function je(t) {
|
|
2958
2958
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2959
2959
|
}
|
|
2960
|
-
function
|
|
2960
|
+
function Or(t) {
|
|
2961
2961
|
return t.replace(/\\LaTeX\b/g, "LaTeX").replace(/\\TeX\b/g, "TeX").replace(/\\thanks\{[^{}]*(?:\{[^{}]*\}[^{}]*)?\}/g, "").replace(/\\inst\{[^{}]*\}/g, "").replace(/\\email\{[^{}]*\}/g, "").replace(/\\[a-zA-Z]+\{([^{}]*)\}/g, "$1").replace(/\\\s/g, " ").replace(/~/g, " ").replace(/\s+/g, " ").trim();
|
|
2962
2962
|
}
|
|
2963
|
-
function
|
|
2963
|
+
function Ca(t) {
|
|
2964
2964
|
const r = [];
|
|
2965
2965
|
if (t.macros) {
|
|
2966
|
-
const n =
|
|
2966
|
+
const n = je(t.macros).split(`
|
|
2967
2967
|
`).map((i) => ` ${i}`).join(`
|
|
2968
2968
|
`);
|
|
2969
2969
|
r.push(` <macros>
|
|
@@ -2971,7 +2971,7 @@ ${n}
|
|
|
2971
2971
|
</macros>`);
|
|
2972
2972
|
}
|
|
2973
2973
|
if (t.author) {
|
|
2974
|
-
const n = t.author.split(/\s+\\and\s+/)[0].trim(), i =
|
|
2974
|
+
const n = t.author.split(/\s+\\and\s+/)[0].trim(), i = je(Or(n));
|
|
2975
2975
|
i && r.push(
|
|
2976
2976
|
` <author>
|
|
2977
2977
|
<personname>${i}</personname>
|
|
@@ -2983,13 +2983,13 @@ ${r.join(`
|
|
|
2983
2983
|
`)}
|
|
2984
2984
|
</docinfo>`;
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2987
|
-
return /<slide[\s/>]/.test(t) ||
|
|
2986
|
+
function Oa(t, r) {
|
|
2987
|
+
return /<slide[\s/>]/.test(t) || Aa(r.documentClass) ? "slideshow" : /<chapter[\s>]/.test(t) ? "book" : "article";
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2989
|
+
function za(t, r) {
|
|
2990
2990
|
const n = t.replace(/^\s*<p\s*\/>\s*/g, "").replace(/^\s*<p>\s*<\/p>\s*/g, "").trim();
|
|
2991
2991
|
if (!n) return "";
|
|
2992
|
-
const i =
|
|
2992
|
+
const i = Oa(n, r), e = Ca(r), a = r.title ? ` <title>${je(Or(r.title))}</title>
|
|
2993
2993
|
` : "", s = `<${i}>
|
|
2994
2994
|
${a}${n}
|
|
2995
2995
|
</${i}>`;
|
|
@@ -2998,15 +2998,15 @@ ${[e, s].filter(Boolean).join(`
|
|
|
2998
2998
|
`)}
|
|
2999
2999
|
</pretext>`;
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3001
|
+
function Ge(t) {
|
|
3002
3002
|
const r = t.trim();
|
|
3003
|
-
return r ?
|
|
3003
|
+
return r ? ci(r) : "";
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3005
|
+
function $a(t) {
|
|
3006
3006
|
const r = t.trim();
|
|
3007
3007
|
if (!r)
|
|
3008
3008
|
return { pretext: "", cleanedLatex: "", warnings: [], cleanChunks: [] };
|
|
3009
|
-
const { preamble: n, body: i } = Bt(r), { info: e, warnings: a } =
|
|
3009
|
+
const { preamble: n, body: i } = Bt(r), { info: e, warnings: a } = Ta(n), s = i ? [
|
|
3010
3010
|
`\\documentclass{${e.documentClass}}`,
|
|
3011
3011
|
e.macros,
|
|
3012
3012
|
"\\begin{document}",
|
|
@@ -3017,45 +3017,45 @@ function Oa(t) {
|
|
|
3017
3017
|
output: o,
|
|
3018
3018
|
warnings: c,
|
|
3019
3019
|
chunks: l
|
|
3020
|
-
} =
|
|
3020
|
+
} = _a(s), f = [...a, ...c];
|
|
3021
3021
|
if (!o.trim())
|
|
3022
3022
|
return { pretext: "", cleanedLatex: o, warnings: f, cleanChunks: l };
|
|
3023
3023
|
const p = i ? o + `
|
|
3024
|
-
\\end{document}` : o, g =
|
|
3025
|
-
|
|
3024
|
+
\\end{document}` : o, g = Ra(
|
|
3025
|
+
li(p)
|
|
3026
3026
|
).trim();
|
|
3027
3027
|
if (!g)
|
|
3028
3028
|
return { pretext: "", cleanedLatex: o, warnings: f, cleanChunks: l };
|
|
3029
|
-
const d =
|
|
3030
|
-
return { pretext: d ?
|
|
3029
|
+
const d = za(g, e);
|
|
3030
|
+
return { pretext: d ? Ge(d) : "", cleanedLatex: o, warnings: f, cleanChunks: l };
|
|
3031
3031
|
}
|
|
3032
|
-
function
|
|
3032
|
+
function La(t, r) {
|
|
3033
3033
|
const n = t.trim();
|
|
3034
3034
|
if (!n)
|
|
3035
3035
|
return { pretext: "", cleanedMarkdown: "" };
|
|
3036
3036
|
const i = String(
|
|
3037
|
-
|
|
3037
|
+
ui(
|
|
3038
3038
|
n,
|
|
3039
3039
|
r ? { documentRoot: r } : void 0
|
|
3040
3040
|
)
|
|
3041
3041
|
).trim();
|
|
3042
|
-
return { pretext: i ?
|
|
3042
|
+
return { pretext: i ? Ge(i) : "", cleanedMarkdown: n };
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3044
|
+
function Da(t) {
|
|
3045
3045
|
return t instanceof Error && t.message.trim() ? t.message.trim() : "Could not convert source content to PreTeXt.";
|
|
3046
3046
|
}
|
|
3047
|
-
function
|
|
3048
|
-
const i =
|
|
3047
|
+
function Pa(t, r, n) {
|
|
3048
|
+
const i = ve(t), e = r ?? i;
|
|
3049
3049
|
try {
|
|
3050
3050
|
if (e === "pretext")
|
|
3051
3051
|
return {
|
|
3052
3052
|
sourceFormat: e,
|
|
3053
3053
|
detectedSourceFormat: i,
|
|
3054
|
-
pretextSource:
|
|
3054
|
+
pretextSource: Ge(t),
|
|
3055
3055
|
warnings: []
|
|
3056
3056
|
};
|
|
3057
3057
|
if (e === "markdown") {
|
|
3058
|
-
const { pretext: l, cleanedMarkdown: f } =
|
|
3058
|
+
const { pretext: l, cleanedMarkdown: f } = La(
|
|
3059
3059
|
t,
|
|
3060
3060
|
n
|
|
3061
3061
|
);
|
|
@@ -3067,7 +3067,7 @@ function La(t, r, n) {
|
|
|
3067
3067
|
warnings: []
|
|
3068
3068
|
};
|
|
3069
3069
|
}
|
|
3070
|
-
const { pretext: a, cleanedLatex: s, warnings: o, cleanChunks: c } =
|
|
3070
|
+
const { pretext: a, cleanedLatex: s, warnings: o, cleanChunks: c } = $a(t);
|
|
3071
3071
|
return {
|
|
3072
3072
|
sourceFormat: e,
|
|
3073
3073
|
detectedSourceFormat: i,
|
|
@@ -3080,22 +3080,22 @@ function La(t, r, n) {
|
|
|
3080
3080
|
return {
|
|
3081
3081
|
sourceFormat: e,
|
|
3082
3082
|
detectedSourceFormat: i,
|
|
3083
|
-
pretextError:
|
|
3083
|
+
pretextError: Da(a),
|
|
3084
3084
|
warnings: []
|
|
3085
3085
|
};
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
3088
|
var Ht = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3089
|
-
function
|
|
3089
|
+
function ja(t) {
|
|
3090
3090
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
3091
3091
|
}
|
|
3092
3092
|
function Yt(t) {
|
|
3093
3093
|
throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
3094
3094
|
}
|
|
3095
|
-
var
|
|
3096
|
-
var
|
|
3097
|
-
function
|
|
3098
|
-
return
|
|
3095
|
+
var me = { exports: {} };
|
|
3096
|
+
var dr;
|
|
3097
|
+
function Fa() {
|
|
3098
|
+
return dr || (dr = 1, (function(t, r) {
|
|
3099
3099
|
(function(n) {
|
|
3100
3100
|
t.exports = n();
|
|
3101
3101
|
})(function() {
|
|
@@ -3215,9 +3215,9 @@ function Pa() {
|
|
|
3215
3215
|
var O = 0;
|
|
3216
3216
|
w && (O |= 8), L || !D && !m || (O |= 2048);
|
|
3217
3217
|
var C = 0, K = 0;
|
|
3218
|
-
nt && (C |= 16), b === "UNIX" ? (K = 798, C |= (function(V,
|
|
3218
|
+
nt && (C |= 16), b === "UNIX" ? (K = 798, C |= (function(V, lt) {
|
|
3219
3219
|
var Q = V;
|
|
3220
|
-
return V || (Q =
|
|
3220
|
+
return V || (Q = lt ? 16893 : 33204), (65535 & Q) << 16;
|
|
3221
3221
|
})(A.unixPermissions, nt)) : (K = 20, C |= (function(V) {
|
|
3222
3222
|
return 63 & (V || 0);
|
|
3223
3223
|
})(A.dosPermissions)), S = M.getUTCHours(), S <<= 6, S |= M.getUTCMinutes(), S <<= 5, S |= M.getUTCSeconds() / 2, I = M.getUTCFullYear() - 1980, I <<= 4, I |= M.getUTCMonth() + 1, I <<= 5, I |= M.getUTCDate(), D && (it = a(1, 1) + a(f(B), 4) + $, F += "up" + a(it.length, 2) + it), m && (U = a(1, 1) + a(f(J), 4) + k, F += "uc" + a(U.length, 2) + U);
|
|
@@ -4487,7 +4487,7 @@ function Pa() {
|
|
|
4487
4487
|
while ((j = X[j & H]) > R && --_ != 0);
|
|
4488
4488
|
return q <= u.lookahead ? q : u.lookahead;
|
|
4489
4489
|
}
|
|
4490
|
-
function
|
|
4490
|
+
function lt(u) {
|
|
4491
4491
|
var j, z, y, _, E, q, N, R, Z, H, X = u.w_size;
|
|
4492
4492
|
do {
|
|
4493
4493
|
if (_ = u.window_size - u.lookahead - u.strstart, u.strstart >= X + (X - J)) {
|
|
@@ -4502,7 +4502,7 @@ function Pa() {
|
|
|
4502
4502
|
function Q(u, j) {
|
|
4503
4503
|
for (var z, y; ; ) {
|
|
4504
4504
|
if (u.lookahead < J) {
|
|
4505
|
-
if (
|
|
4505
|
+
if (lt(u), u.lookahead < J && j === p) return m;
|
|
4506
4506
|
if (u.lookahead === 0) break;
|
|
4507
4507
|
}
|
|
4508
4508
|
if (z = 0, u.lookahead >= $ && (u.ins_h = (u.ins_h << u.hash_shift ^ u.window[u.strstart + $ - 1]) & u.hash_mask, z = u.prev[u.strstart & u.w_mask] = u.head[u.ins_h], u.head[u.ins_h] = u.strstart), z !== 0 && u.strstart - z <= u.w_size - J && (u.match_length = V(u, z)), u.match_length >= $) if (y = o._tr_tally(u, u.strstart - u.match_start, u.match_length - $), u.lookahead -= u.match_length, u.match_length <= u.max_lazy_match && u.lookahead >= $) {
|
|
@@ -4517,7 +4517,7 @@ function Pa() {
|
|
|
4517
4517
|
function Y(u, j) {
|
|
4518
4518
|
for (var z, y, _; ; ) {
|
|
4519
4519
|
if (u.lookahead < J) {
|
|
4520
|
-
if (
|
|
4520
|
+
if (lt(u), u.lookahead < J && j === p) return m;
|
|
4521
4521
|
if (u.lookahead === 0) break;
|
|
4522
4522
|
}
|
|
4523
4523
|
if (z = 0, u.lookahead >= $ && (u.ins_h = (u.ins_h << u.hash_shift ^ u.window[u.strstart + $ - 1]) & u.hash_mask, z = u.prev[u.strstart & u.w_mask] = u.head[u.ins_h], u.head[u.ins_h] = u.strstart), u.prev_length = u.match_length, u.prev_match = u.match_start, u.match_length = $ - 1, z !== 0 && u.prev_length < u.max_lazy_match && u.strstart - z <= u.w_size - J && (u.match_length = V(u, z), u.match_length <= 5 && (u.strategy === 1 || u.match_length === $ && 4096 < u.strstart - u.match_start) && (u.match_length = $ - 1)), u.prev_length >= $ && u.match_length <= u.prev_length) {
|
|
@@ -4557,7 +4557,7 @@ function Pa() {
|
|
|
4557
4557
|
var z = 65535;
|
|
4558
4558
|
for (z > u.pending_buf_size - 5 && (z = u.pending_buf_size - 5); ; ) {
|
|
4559
4559
|
if (u.lookahead <= 1) {
|
|
4560
|
-
if (
|
|
4560
|
+
if (lt(u), u.lookahead === 0 && j === p) return m;
|
|
4561
4561
|
if (u.lookahead === 0) break;
|
|
4562
4562
|
}
|
|
4563
4563
|
u.strstart += u.lookahead, u.lookahead = 0;
|
|
@@ -4611,7 +4611,7 @@ function Pa() {
|
|
|
4611
4611
|
if (u.avail_in !== 0 || y.lookahead !== 0 || j !== p && y.status !== 666) {
|
|
4612
4612
|
var N = y.strategy === 2 ? (function(R, Z) {
|
|
4613
4613
|
for (var H; ; ) {
|
|
4614
|
-
if (R.lookahead === 0 && (
|
|
4614
|
+
if (R.lookahead === 0 && (lt(R), R.lookahead === 0)) {
|
|
4615
4615
|
if (Z === p) return m;
|
|
4616
4616
|
break;
|
|
4617
4617
|
}
|
|
@@ -4621,7 +4621,7 @@ function Pa() {
|
|
|
4621
4621
|
})(y, j) : y.strategy === 3 ? (function(R, Z) {
|
|
4622
4622
|
for (var H, X, tt, ot, at = R.window; ; ) {
|
|
4623
4623
|
if (R.lookahead <= W) {
|
|
4624
|
-
if (
|
|
4624
|
+
if (lt(R), R.lookahead <= W && Z === p) return m;
|
|
4625
4625
|
if (R.lookahead === 0) break;
|
|
4626
4626
|
}
|
|
4627
4627
|
if (R.match_length = 0, R.lookahead >= $ && 0 < R.strstart && (X = at[tt = R.strstart - 1]) === at[++tt] && X === at[++tt] && X === at[++tt]) {
|
|
@@ -4645,9 +4645,9 @@ function Pa() {
|
|
|
4645
4645
|
}, e.deflateSetDictionary = function(u, j) {
|
|
4646
4646
|
var z, y, _, E, q, N, R, Z, H = j.length;
|
|
4647
4647
|
if (!u || !u.state || (E = (z = u.state).wrap) === 2 || E === 1 && z.status !== k || z.lookahead) return w;
|
|
4648
|
-
for (E === 1 && (u.adler = c(u.adler, j, H, 0)), z.wrap = 0, H >= z.w_size && (E === 0 && (et(z.head), z.strstart = 0, z.block_start = 0, z.insert = 0), Z = new s.Buf8(z.w_size), s.arraySet(Z, j, H - z.w_size, z.w_size, 0), j = Z, H = z.w_size), q = u.avail_in, N = u.next_in, R = u.input, u.avail_in = H, u.next_in = 0, u.input = j,
|
|
4648
|
+
for (E === 1 && (u.adler = c(u.adler, j, H, 0)), z.wrap = 0, H >= z.w_size && (E === 0 && (et(z.head), z.strstart = 0, z.block_start = 0, z.insert = 0), Z = new s.Buf8(z.w_size), s.arraySet(Z, j, H - z.w_size, z.w_size, 0), j = Z, H = z.w_size), q = u.avail_in, N = u.next_in, R = u.input, u.avail_in = H, u.next_in = 0, u.input = j, lt(z); z.lookahead >= $; ) {
|
|
4649
4649
|
for (y = z.strstart, _ = z.lookahead - ($ - 1); z.ins_h = (z.ins_h << z.hash_shift ^ z.window[y + $ - 1]) & z.hash_mask, z.prev[y & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = y, y++, --_; ) ;
|
|
4650
|
-
z.strstart = y, z.lookahead = $ - 1,
|
|
4650
|
+
z.strstart = y, z.lookahead = $ - 1, lt(z);
|
|
4651
4651
|
}
|
|
4652
4652
|
return z.strstart += z.lookahead, z.block_start = z.strstart, z.insert = z.lookahead, z.lookahead = 0, z.match_length = z.prev_length = $ - 1, z.match_available = 0, u.next_in = N, u.input = R, u.avail_in = q, z.wrap = E, d;
|
|
4653
4653
|
}, e.deflateInfo = "pako deflate (from Nodeca project)";
|
|
@@ -4770,7 +4770,7 @@ function Pa() {
|
|
|
4770
4770
|
e.inflateReset = I, e.inflateReset2 = A, e.inflateResetKeep = S, e.inflateInit = function(k) {
|
|
4771
4771
|
return P(k, 15);
|
|
4772
4772
|
}, e.inflateInit2 = P, e.inflate = function(k, D) {
|
|
4773
|
-
var m, F, it, U, nt, M, et, O, C, K, G, V,
|
|
4773
|
+
var m, F, it, U, nt, M, et, O, C, K, G, V, lt, Q, Y, rt, ct, st, pt, ht, u, j, z, y, _ = 0, E = new a.Buf8(4), q = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
4774
4774
|
if (!k || !k.state || !k.output || !k.input && k.avail_in !== 0) return d;
|
|
4775
4775
|
(m = k.state).mode === 12 && (m.mode = 13), nt = k.next_out, it = k.output, et = k.avail_out, U = k.next_in, F = k.input, M = k.avail_in, O = m.hold, C = m.bits, K = M, G = et, j = g;
|
|
4776
4776
|
t: for (; ; ) switch (m.mode) {
|
|
@@ -5077,9 +5077,9 @@ function Pa() {
|
|
|
5077
5077
|
k.msg = "invalid distance too far back", m.mode = 30;
|
|
5078
5078
|
break;
|
|
5079
5079
|
}
|
|
5080
|
-
|
|
5081
|
-
} else Q = it,
|
|
5082
|
-
for (et < V && (V = et), et -= V, m.length -= V; it[nt++] = Q[
|
|
5080
|
+
lt = V > m.wnext ? (V -= m.wnext, m.wsize - V) : m.wnext - V, V > m.length && (V = m.length), Q = m.window;
|
|
5081
|
+
} else Q = it, lt = nt - m.offset, V = m.length;
|
|
5082
|
+
for (et < V && (V = et), et -= V, m.length -= V; it[nt++] = Q[lt++], --V; ) ;
|
|
5083
5083
|
m.length === 0 && (m.mode = 21);
|
|
5084
5084
|
break;
|
|
5085
5085
|
case 26:
|
|
@@ -5138,7 +5138,7 @@ function Pa() {
|
|
|
5138
5138
|
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(n, i, e) {
|
|
5139
5139
|
var a = n("../utils/common"), s = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], o = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], c = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], l = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
|
|
5140
5140
|
i.exports = function(f, p, g, d, w, h, v, b) {
|
|
5141
|
-
var x, S, I, A, P, L, B, $, W, J = b.bits, k = 0, D = 0, m = 0, F = 0, it = 0, U = 0, nt = 0, M = 0, et = 0, O = 0, C = null, K = 0, G = new a.Buf16(16), V = new a.Buf16(16),
|
|
5141
|
+
var x, S, I, A, P, L, B, $, W, J = b.bits, k = 0, D = 0, m = 0, F = 0, it = 0, U = 0, nt = 0, M = 0, et = 0, O = 0, C = null, K = 0, G = new a.Buf16(16), V = new a.Buf16(16), lt = null, Q = 0;
|
|
5142
5142
|
for (k = 0; k <= 15; k++) G[k] = 0;
|
|
5143
5143
|
for (D = 0; D < d; D++) G[p[g + D]]++;
|
|
5144
5144
|
for (it = J, F = 15; 1 <= F && G[F] === 0; F--) ;
|
|
@@ -5148,9 +5148,9 @@ function Pa() {
|
|
|
5148
5148
|
if (0 < M && (f === 0 || F !== 1)) return -1;
|
|
5149
5149
|
for (V[1] = 0, k = 1; k < 15; k++) V[k + 1] = V[k] + G[k];
|
|
5150
5150
|
for (D = 0; D < d; D++) p[g + D] !== 0 && (v[V[p[g + D]]++] = D);
|
|
5151
|
-
if (L = f === 0 ? (C =
|
|
5151
|
+
if (L = f === 0 ? (C = lt = v, 19) : f === 1 ? (C = s, K -= 257, lt = o, Q -= 257, 256) : (C = c, lt = l, -1), k = m, P = h, nt = D = O = 0, I = -1, A = (et = 1 << (U = it)) - 1, f === 1 && 852 < et || f === 2 && 592 < et) return 1;
|
|
5152
5152
|
for (; ; ) {
|
|
5153
|
-
for (B = k - nt, W = v[D] < L ? ($ = 0, v[D]) : v[D] > L ? ($ =
|
|
5153
|
+
for (B = k - nt, W = v[D] < L ? ($ = 0, v[D]) : v[D] > L ? ($ = lt[Q + v[D]], C[K + v[D]]) : ($ = 96, 0), x = 1 << k - nt, m = S = 1 << U; w[P + (O >> nt) + (S -= x)] = B << 24 | $ << 16 | W | 0, S !== 0; ) ;
|
|
5154
5154
|
for (x = 1 << k - 1; O & x; ) x >>= 1;
|
|
5155
5155
|
if (x !== 0 ? (O &= x - 1, O += x) : O = 0, D++, --G[k] == 0) {
|
|
5156
5156
|
if (k === F) break;
|
|
@@ -5200,7 +5200,7 @@ function Pa() {
|
|
|
5200
5200
|
function V(_, E, q) {
|
|
5201
5201
|
G(_, q[2 * E], q[2 * E + 1]);
|
|
5202
5202
|
}
|
|
5203
|
-
function
|
|
5203
|
+
function lt(_, E) {
|
|
5204
5204
|
for (var q = 0; q |= 1 & _, _ >>>= 1, q <<= 1, 0 < --E; ) ;
|
|
5205
5205
|
return q >>> 1;
|
|
5206
5206
|
}
|
|
@@ -5209,7 +5209,7 @@ function Pa() {
|
|
|
5209
5209
|
for (N = 1; N <= v; N++) Z[N] = H = H + q[N - 1] << 1;
|
|
5210
5210
|
for (R = 0; R <= E; R++) {
|
|
5211
5211
|
var X = _[2 * R + 1];
|
|
5212
|
-
X !== 0 && (_[2 * R] =
|
|
5212
|
+
X !== 0 && (_[2 * R] = lt(Z[X]++, X));
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
5215
|
function Y(_) {
|
|
@@ -5242,15 +5242,15 @@ function Pa() {
|
|
|
5242
5242
|
for (E.max_code = ot, q = _.heap_len >> 1; 1 <= q; q--) st(_, Z, q);
|
|
5243
5243
|
for (R = tt; q = _.heap[1], _.heap[1] = _.heap[_.heap_len--], st(_, Z, 1), N = _.heap[1], _.heap[--_.heap_max] = q, _.heap[--_.heap_max] = N, Z[2 * R] = Z[2 * q] + Z[2 * N], _.depth[R] = (_.depth[q] >= _.depth[N] ? _.depth[q] : _.depth[N]) + 1, Z[2 * q + 1] = Z[2 * N + 1] = R, _.heap[1] = R++, st(_, Z, 1), 2 <= _.heap_len; ) ;
|
|
5244
5244
|
_.heap[--_.heap_max] = _.heap[1], (function(at, gt) {
|
|
5245
|
-
var $t, _t, Lt,
|
|
5246
|
-
for (
|
|
5247
|
-
for (xt[2 * at.heap[at.heap_max] + 1] = 0, $t = at.heap_max + 1; $t < h; $t++) Dt < (
|
|
5245
|
+
var $t, _t, Lt, ut, Xt, he, xt = gt.dyn_tree, an = gt.max_code, ai = gt.stat_desc.static_tree, si = gt.stat_desc.has_stree, oi = gt.stat_desc.extra_bits, sn = gt.stat_desc.extra_base, Dt = gt.stat_desc.max_length, Vt = 0;
|
|
5246
|
+
for (ut = 0; ut <= v; ut++) at.bl_count[ut] = 0;
|
|
5247
|
+
for (xt[2 * at.heap[at.heap_max] + 1] = 0, $t = at.heap_max + 1; $t < h; $t++) Dt < (ut = xt[2 * xt[2 * (_t = at.heap[$t]) + 1] + 1] + 1) && (ut = Dt, Vt++), xt[2 * _t + 1] = ut, an < _t || (at.bl_count[ut]++, Xt = 0, sn <= _t && (Xt = oi[_t - sn]), he = xt[2 * _t], at.opt_len += he * (ut + Xt), si && (at.static_len += he * (ai[2 * _t + 1] + Xt)));
|
|
5248
5248
|
if (Vt !== 0) {
|
|
5249
5249
|
do {
|
|
5250
|
-
for (
|
|
5251
|
-
at.bl_count[
|
|
5250
|
+
for (ut = Dt - 1; at.bl_count[ut] === 0; ) ut--;
|
|
5251
|
+
at.bl_count[ut]--, at.bl_count[ut + 1] += 2, at.bl_count[Dt]--, Vt -= 2;
|
|
5252
5252
|
} while (0 < Vt);
|
|
5253
|
-
for (
|
|
5253
|
+
for (ut = Dt; ut !== 0; ut--) for (_t = at.bl_count[ut]; _t !== 0; ) an < (Lt = at.heap[--$t]) || (xt[2 * Lt + 1] !== ut && (at.opt_len += (ut - xt[2 * Lt + 1]) * xt[2 * Lt], xt[2 * Lt + 1] = ut), _t--);
|
|
5254
5254
|
}
|
|
5255
5255
|
})(_, E), Q(Z, ot, _.bl_count);
|
|
5256
5256
|
}
|
|
@@ -5284,7 +5284,7 @@ function Pa() {
|
|
|
5284
5284
|
for (; E <= 255; ) J[2 * E + 1] = 9, E++, H[9]++;
|
|
5285
5285
|
for (; E <= 279; ) J[2 * E + 1] = 7, E++, H[7]++;
|
|
5286
5286
|
for (; E <= 287; ) J[2 * E + 1] = 8, E++, H[8]++;
|
|
5287
|
-
for (Q(J, g + 1, H), E = 0; E < d; E++) k[2 * E + 1] = 5, k[2 * E] =
|
|
5287
|
+
for (Q(J, g + 1, H), E = 0; E < d; E++) k[2 * E + 1] = 5, k[2 * E] = lt(E, 5);
|
|
5288
5288
|
it = new et(J, L, p + 1, g, v), U = new et(k, B, 0, d, v), nt = new et(new Array(0), $, 0, w, x);
|
|
5289
5289
|
})(), z = !0), _.l_desc = new O(_.dyn_ltree, it), _.d_desc = new O(_.dyn_dtree, U), _.bl_desc = new O(_.bl_tree, nt), _.bi_buf = 0, _.bi_valid = 0, Y(_);
|
|
5290
5290
|
}, e._tr_stored_block = y, e._tr_flush_block = function(_, E, q, N) {
|
|
@@ -5393,18 +5393,92 @@ function Pa() {
|
|
|
5393
5393
|
}).call(this, typeof Ht < "u" ? Ht : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
5394
5394
|
}, {}] }, {}, [10])(10);
|
|
5395
5395
|
});
|
|
5396
|
-
})(
|
|
5396
|
+
})(me)), me.exports;
|
|
5397
5397
|
}
|
|
5398
|
-
var
|
|
5399
|
-
const
|
|
5400
|
-
|
|
5398
|
+
var qa = Fa();
|
|
5399
|
+
const Ba = /* @__PURE__ */ ja(qa), Na = ["book", "article", "slideshow"], Ua = [
|
|
5400
|
+
"frontmatter",
|
|
5401
|
+
"preface",
|
|
5402
|
+
"acknowledgement",
|
|
5403
|
+
"dedication",
|
|
5404
|
+
"biography",
|
|
5405
|
+
"contributors",
|
|
5406
|
+
"part",
|
|
5407
|
+
"introduction",
|
|
5408
|
+
"chapter",
|
|
5409
|
+
"section",
|
|
5410
|
+
"subsection",
|
|
5411
|
+
"subsubsection",
|
|
5412
|
+
"conclusion",
|
|
5413
|
+
"exercises",
|
|
5414
|
+
"worksheet",
|
|
5415
|
+
"handout",
|
|
5416
|
+
"reading-questions",
|
|
5417
|
+
"references",
|
|
5418
|
+
"solutions",
|
|
5419
|
+
"glossary",
|
|
5420
|
+
"backmatter",
|
|
5421
|
+
"appendix",
|
|
5422
|
+
"index",
|
|
5423
|
+
"colophon"
|
|
5424
|
+
];
|
|
5425
|
+
function He(t) {
|
|
5426
|
+
return Na.includes(t) ? t : void 0;
|
|
5427
|
+
}
|
|
5428
|
+
const Ma = new Set(Ua);
|
|
5429
|
+
function zt(t) {
|
|
5430
|
+
return Ma.has(t);
|
|
5431
|
+
}
|
|
5432
|
+
const Wa = {
|
|
5433
|
+
chapter: "ch",
|
|
5434
|
+
section: "sec",
|
|
5435
|
+
subsection: "subsec",
|
|
5436
|
+
subsubsection: "subsubsec",
|
|
5437
|
+
appendix: "app"
|
|
5438
|
+
};
|
|
5439
|
+
function Ye(t) {
|
|
5440
|
+
return Wa[t] ?? t;
|
|
5441
|
+
}
|
|
5442
|
+
const Za = /* @__PURE__ */ new Set([
|
|
5443
|
+
"frontmatter",
|
|
5444
|
+
"backmatter",
|
|
5445
|
+
"preface",
|
|
5446
|
+
"acknowledgement",
|
|
5447
|
+
"dedication",
|
|
5448
|
+
"biography",
|
|
5449
|
+
"contributors",
|
|
5450
|
+
"colophon",
|
|
5451
|
+
"glossary",
|
|
5452
|
+
"index"
|
|
5453
|
+
]);
|
|
5454
|
+
function Xa(t) {
|
|
5455
|
+
return Za.has(t);
|
|
5456
|
+
}
|
|
5457
|
+
const Nt = [
|
|
5458
|
+
"part",
|
|
5459
|
+
"chapter",
|
|
5460
|
+
"section",
|
|
5461
|
+
"subsection",
|
|
5462
|
+
"subsubsection"
|
|
5463
|
+
], zr = "paragraphs";
|
|
5464
|
+
function Ut(t) {
|
|
5465
|
+
return Nt.indexOf(t);
|
|
5466
|
+
}
|
|
5467
|
+
function Va(t, r) {
|
|
5468
|
+
const n = Ut(t);
|
|
5469
|
+
if (n < 0) return t;
|
|
5470
|
+
const i = n + r;
|
|
5471
|
+
return i >= Nt.length ? zr : Nt[Math.max(0, i)];
|
|
5472
|
+
}
|
|
5473
|
+
const fr = /([a-zA-Z_:][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
5474
|
+
function Mt(t) {
|
|
5401
5475
|
const r = {};
|
|
5402
5476
|
let n;
|
|
5403
|
-
for (
|
|
5477
|
+
for (fr.lastIndex = 0; (n = fr.exec(t)) !== null; )
|
|
5404
5478
|
r[n[1]] = n[2] ?? n[3] ?? "";
|
|
5405
5479
|
return r;
|
|
5406
5480
|
}
|
|
5407
|
-
function
|
|
5481
|
+
function de(t) {
|
|
5408
5482
|
const r = [];
|
|
5409
5483
|
let n = 0;
|
|
5410
5484
|
const i = t.length;
|
|
@@ -5461,11 +5535,11 @@ function Ve(t) {
|
|
|
5461
5535
|
}
|
|
5462
5536
|
return r;
|
|
5463
5537
|
}
|
|
5464
|
-
function
|
|
5465
|
-
return
|
|
5538
|
+
function $r(t, r) {
|
|
5539
|
+
return Et(t, (n) => n === r);
|
|
5466
5540
|
}
|
|
5467
|
-
function
|
|
5468
|
-
const n =
|
|
5541
|
+
function Et(t, r) {
|
|
5542
|
+
const n = de(t), i = [];
|
|
5469
5543
|
let e = 0, a = null;
|
|
5470
5544
|
for (const s of n) {
|
|
5471
5545
|
if (s.kind === "selfclose") {
|
|
@@ -5477,7 +5551,7 @@ function At(t, r) {
|
|
|
5477
5551
|
end: s.end,
|
|
5478
5552
|
inner: "",
|
|
5479
5553
|
outer: t.slice(s.pos, s.end),
|
|
5480
|
-
attributes:
|
|
5554
|
+
attributes: Mt(s.attrs)
|
|
5481
5555
|
});
|
|
5482
5556
|
continue;
|
|
5483
5557
|
}
|
|
@@ -5493,16 +5567,44 @@ function At(t, r) {
|
|
|
5493
5567
|
end: s.end,
|
|
5494
5568
|
inner: t.slice(a.end, s.pos),
|
|
5495
5569
|
outer: t.slice(a.pos, s.end),
|
|
5496
|
-
attributes:
|
|
5570
|
+
attributes: Mt(a.attrs)
|
|
5497
5571
|
}), a = null);
|
|
5498
5572
|
}
|
|
5499
5573
|
return i;
|
|
5500
5574
|
}
|
|
5501
|
-
function
|
|
5502
|
-
return
|
|
5575
|
+
function ft(t, r) {
|
|
5576
|
+
return $r(t, r)[0] ?? null;
|
|
5577
|
+
}
|
|
5578
|
+
function Ga(t) {
|
|
5579
|
+
for (const r of de(t)) {
|
|
5580
|
+
if (r.kind === "close") continue;
|
|
5581
|
+
const n = He(r.name);
|
|
5582
|
+
if (n) return n;
|
|
5583
|
+
}
|
|
5584
|
+
return null;
|
|
5585
|
+
}
|
|
5586
|
+
function fe(t) {
|
|
5587
|
+
const r = Et(
|
|
5588
|
+
t,
|
|
5589
|
+
(e) => He(e) !== void 0
|
|
5590
|
+
);
|
|
5591
|
+
if (r.length > 1) {
|
|
5592
|
+
const e = r.map((a) => `<${a.name}>`).join(", ");
|
|
5593
|
+
throw new Error(
|
|
5594
|
+
`A PreTeXt document has one root element, but this source has ${r.length} side by side: ${e}. Keep one and move the rest into their own documents.`
|
|
5595
|
+
);
|
|
5596
|
+
}
|
|
5597
|
+
const n = r[0];
|
|
5598
|
+
if (!n) return null;
|
|
5599
|
+
const i = Ga(n.inner);
|
|
5600
|
+
if (i)
|
|
5601
|
+
throw new Error(
|
|
5602
|
+
`<${i}> is a PreTeXt root element, so it cannot appear inside the document's <${n.name}> root. Split it into its own document, or replace it with a division such as <section>.`
|
|
5603
|
+
);
|
|
5604
|
+
return n;
|
|
5503
5605
|
}
|
|
5504
5606
|
function It(t, r) {
|
|
5505
|
-
const n =
|
|
5607
|
+
const n = de(t);
|
|
5506
5608
|
let i = 0, e = null, a = -1;
|
|
5507
5609
|
for (const s of n) {
|
|
5508
5610
|
if (s.kind === "selfclose") {
|
|
@@ -5515,7 +5617,7 @@ function It(t, r) {
|
|
|
5515
5617
|
end: s.end,
|
|
5516
5618
|
inner: "",
|
|
5517
5619
|
outer: t.slice(s.pos, s.end),
|
|
5518
|
-
attributes:
|
|
5620
|
+
attributes: Mt(s.attrs)
|
|
5519
5621
|
};
|
|
5520
5622
|
continue;
|
|
5521
5623
|
}
|
|
@@ -5533,26 +5635,26 @@ function It(t, r) {
|
|
|
5533
5635
|
end: s.end,
|
|
5534
5636
|
inner: t.slice(e.end, s.pos),
|
|
5535
5637
|
outer: t.slice(e.pos, s.end),
|
|
5536
|
-
attributes:
|
|
5638
|
+
attributes: Mt(o)
|
|
5537
5639
|
};
|
|
5538
5640
|
}
|
|
5539
5641
|
}
|
|
5540
5642
|
return null;
|
|
5541
5643
|
}
|
|
5542
|
-
function
|
|
5543
|
-
return
|
|
5644
|
+
function Lr(t) {
|
|
5645
|
+
return de(t).map((r) => ({
|
|
5544
5646
|
name: r.name,
|
|
5545
5647
|
kind: r.kind,
|
|
5546
5648
|
start: r.pos,
|
|
5547
5649
|
end: r.end,
|
|
5548
|
-
attributes: r.kind === "close" ? {} :
|
|
5650
|
+
attributes: r.kind === "close" ? {} : Mt(r.attrs)
|
|
5549
5651
|
}));
|
|
5550
5652
|
}
|
|
5551
|
-
function
|
|
5552
|
-
const r =
|
|
5653
|
+
function Je(t) {
|
|
5654
|
+
const r = ft(t, "title");
|
|
5553
5655
|
return r ? r.inner.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() : "";
|
|
5554
5656
|
}
|
|
5555
|
-
function
|
|
5657
|
+
function Dr(t) {
|
|
5556
5658
|
return It(t, "slideshow") ? "slideshow" : It(t, "book") ? "book" : It(t, "article") ? "article" : It(t, "chapter") ? "book" : It(t, "slide") ? "slideshow" : "article";
|
|
5557
5659
|
}
|
|
5558
5660
|
function mt(t) {
|
|
@@ -5567,7 +5669,7 @@ function mt(t) {
|
|
|
5567
5669
|
}
|
|
5568
5670
|
return (n ? "/" : "") + i.join("/");
|
|
5569
5671
|
}
|
|
5570
|
-
function
|
|
5672
|
+
function Ke(t) {
|
|
5571
5673
|
const r = t.lastIndexOf("/");
|
|
5572
5674
|
return r >= 0 ? t.slice(0, r) : "";
|
|
5573
5675
|
}
|
|
@@ -5584,15 +5686,15 @@ function se(t) {
|
|
|
5584
5686
|
function kt(...t) {
|
|
5585
5687
|
return mt(t.filter((r) => !!r).join("/"));
|
|
5586
5688
|
}
|
|
5587
|
-
function
|
|
5689
|
+
function Ha(t, r) {
|
|
5588
5690
|
if (!t)
|
|
5589
5691
|
return r;
|
|
5590
5692
|
const n = t.endsWith("/") ? t : `${t}/`;
|
|
5591
5693
|
return r.startsWith(n) ? r.slice(n.length) : r;
|
|
5592
5694
|
}
|
|
5593
|
-
const
|
|
5594
|
-
function
|
|
5595
|
-
const i =
|
|
5695
|
+
const Fe = /(\\(input|include) *\{([^{}]+)\})/g;
|
|
5696
|
+
function Qe(t, r, n) {
|
|
5697
|
+
const i = Ke(r);
|
|
5596
5698
|
return [
|
|
5597
5699
|
t,
|
|
5598
5700
|
`${t}.tex`,
|
|
@@ -5600,14 +5702,14 @@ function Ye(t, r, n) {
|
|
|
5600
5702
|
i ? kt(i, `${t}.tex`) : `${t}.tex`
|
|
5601
5703
|
].map(mt).find((a) => a in n) ?? null;
|
|
5602
5704
|
}
|
|
5603
|
-
function
|
|
5705
|
+
function hr(t, r, n, i = 3) {
|
|
5604
5706
|
let e = 0;
|
|
5605
5707
|
const a = [], s = /* @__PURE__ */ new Set(), o = (l) => {
|
|
5606
5708
|
let f = !1;
|
|
5607
5709
|
return { output: l.replace(
|
|
5608
|
-
|
|
5710
|
+
Fe,
|
|
5609
5711
|
(g, d, w, h) => {
|
|
5610
|
-
const v =
|
|
5712
|
+
const v = Qe(h, r, n);
|
|
5611
5713
|
return v ? s.has(v) ? "" : (f = !0, e += 1, s.add(v), n[v]) : (a.includes(h) || a.push(h), g);
|
|
5612
5714
|
}
|
|
5613
5715
|
), changed: f };
|
|
@@ -5625,21 +5727,21 @@ function dr(t, r, n, i = 3) {
|
|
|
5625
5727
|
consumedPaths: [...s]
|
|
5626
5728
|
};
|
|
5627
5729
|
}
|
|
5628
|
-
function
|
|
5730
|
+
function Ya(t) {
|
|
5629
5731
|
const r = /* @__PURE__ */ new Set();
|
|
5630
5732
|
for (const [n, i] of Object.entries(t)) {
|
|
5631
|
-
|
|
5733
|
+
Fe.lastIndex = 0;
|
|
5632
5734
|
let e;
|
|
5633
|
-
for (; (e =
|
|
5634
|
-
const a =
|
|
5735
|
+
for (; (e = Fe.exec(i)) !== null; ) {
|
|
5736
|
+
const a = Qe(e[3], n, t);
|
|
5635
5737
|
a && a !== n && r.add(a);
|
|
5636
5738
|
}
|
|
5637
5739
|
}
|
|
5638
5740
|
return r;
|
|
5639
5741
|
}
|
|
5640
|
-
const
|
|
5641
|
-
function
|
|
5642
|
-
const i =
|
|
5742
|
+
const Pr = String.raw`<xi:include\b[^>]*\bhref\s*=\s*(?:"([^"]+)"|'([^']+)')[^>]*\/>`, pr = new RegExp(Pr, "g");
|
|
5743
|
+
function jr(t, r, n) {
|
|
5744
|
+
const i = Ke(r), e = [
|
|
5643
5745
|
t,
|
|
5644
5746
|
`${t}.ptx`,
|
|
5645
5747
|
`${t}.xml`,
|
|
@@ -5654,21 +5756,21 @@ function Lr(t, r, n) {
|
|
|
5654
5756
|
}
|
|
5655
5757
|
return null;
|
|
5656
5758
|
}
|
|
5657
|
-
function
|
|
5759
|
+
function Ja(t) {
|
|
5658
5760
|
return t.replace(/^\s*<\?xml[^?]*\?>\s*/, "");
|
|
5659
5761
|
}
|
|
5660
|
-
function
|
|
5762
|
+
function Ka(t, r, n, i = 5) {
|
|
5661
5763
|
let e = 0;
|
|
5662
5764
|
const a = [], s = [r], o = /* @__PURE__ */ new Set(), c = (f, p) => f.replace(
|
|
5663
|
-
new RegExp(
|
|
5765
|
+
new RegExp(Pr, "g"),
|
|
5664
5766
|
(g, d, w) => {
|
|
5665
|
-
const h = d ?? w ?? "", v = s[s.length - 1], b =
|
|
5767
|
+
const h = d ?? w ?? "", v = s[s.length - 1], b = jr(h, v, n);
|
|
5666
5768
|
if (!b)
|
|
5667
5769
|
return a.includes(h) || a.push(h), g;
|
|
5668
5770
|
if (s.includes(b) || p >= i)
|
|
5669
5771
|
return g;
|
|
5670
5772
|
e += 1, o.add(b), s.push(b);
|
|
5671
|
-
const x = c(
|
|
5773
|
+
const x = c(Ja(n[b]), p + 1);
|
|
5672
5774
|
return s.pop(), x;
|
|
5673
5775
|
}
|
|
5674
5776
|
);
|
|
@@ -5679,92 +5781,22 @@ function Ua(t, r, n, i = 5) {
|
|
|
5679
5781
|
consumedPaths: [...o]
|
|
5680
5782
|
};
|
|
5681
5783
|
}
|
|
5682
|
-
function
|
|
5784
|
+
function Qa(t) {
|
|
5683
5785
|
const r = /* @__PURE__ */ new Set();
|
|
5684
5786
|
for (const [n, i] of Object.entries(t)) {
|
|
5685
|
-
|
|
5787
|
+
pr.lastIndex = 0;
|
|
5686
5788
|
let e;
|
|
5687
|
-
for (; (e =
|
|
5688
|
-
const a = e[1] ?? e[2] ?? "", s =
|
|
5789
|
+
for (; (e = pr.exec(i)) !== null; ) {
|
|
5790
|
+
const a = e[1] ?? e[2] ?? "", s = jr(a, n, t);
|
|
5689
5791
|
s && s !== n && r.add(s);
|
|
5690
5792
|
}
|
|
5691
5793
|
}
|
|
5692
5794
|
return r;
|
|
5693
5795
|
}
|
|
5694
|
-
const Eo = ["book", "article", "slideshow"], Wa = [
|
|
5695
|
-
"frontmatter",
|
|
5696
|
-
"preface",
|
|
5697
|
-
"acknowledgement",
|
|
5698
|
-
"dedication",
|
|
5699
|
-
"biography",
|
|
5700
|
-
"contributors",
|
|
5701
|
-
"part",
|
|
5702
|
-
"introduction",
|
|
5703
|
-
"chapter",
|
|
5704
|
-
"section",
|
|
5705
|
-
"subsection",
|
|
5706
|
-
"subsubsection",
|
|
5707
|
-
"conclusion",
|
|
5708
|
-
"exercises",
|
|
5709
|
-
"worksheet",
|
|
5710
|
-
"handout",
|
|
5711
|
-
"reading-questions",
|
|
5712
|
-
"references",
|
|
5713
|
-
"solutions",
|
|
5714
|
-
"glossary",
|
|
5715
|
-
"backmatter",
|
|
5716
|
-
"appendix",
|
|
5717
|
-
"index",
|
|
5718
|
-
"colophon"
|
|
5719
|
-
], Za = new Set(Wa);
|
|
5720
|
-
function zt(t) {
|
|
5721
|
-
return Za.has(t);
|
|
5722
|
-
}
|
|
5723
|
-
const Xa = {
|
|
5724
|
-
chapter: "ch",
|
|
5725
|
-
section: "sec",
|
|
5726
|
-
subsection: "subsec",
|
|
5727
|
-
subsubsection: "subsubsec",
|
|
5728
|
-
appendix: "app"
|
|
5729
|
-
};
|
|
5730
|
-
function Je(t) {
|
|
5731
|
-
return Xa[t] ?? t;
|
|
5732
|
-
}
|
|
5733
|
-
const Va = /* @__PURE__ */ new Set([
|
|
5734
|
-
"frontmatter",
|
|
5735
|
-
"backmatter",
|
|
5736
|
-
"preface",
|
|
5737
|
-
"acknowledgement",
|
|
5738
|
-
"dedication",
|
|
5739
|
-
"biography",
|
|
5740
|
-
"contributors",
|
|
5741
|
-
"colophon",
|
|
5742
|
-
"glossary",
|
|
5743
|
-
"index"
|
|
5744
|
-
]);
|
|
5745
|
-
function Ga(t) {
|
|
5746
|
-
return Va.has(t);
|
|
5747
|
-
}
|
|
5748
|
-
const Ut = [
|
|
5749
|
-
"part",
|
|
5750
|
-
"chapter",
|
|
5751
|
-
"section",
|
|
5752
|
-
"subsection",
|
|
5753
|
-
"subsubsection"
|
|
5754
|
-
], Dr = "paragraphs";
|
|
5755
|
-
function Mt(t) {
|
|
5756
|
-
return Ut.indexOf(t);
|
|
5757
|
-
}
|
|
5758
|
-
function Ha(t, r) {
|
|
5759
|
-
const n = Mt(t);
|
|
5760
|
-
if (n < 0) return t;
|
|
5761
|
-
const i = n + r;
|
|
5762
|
-
return i >= Ut.length ? Dr : Ut[Math.max(0, i)];
|
|
5763
|
-
}
|
|
5764
5796
|
function Zt(t) {
|
|
5765
5797
|
return t.trim().replace(/[^a-zA-Z0-9\-_]+/g, "-").replace(/^[^a-zA-Z_]+/, "").replace(/-+$/, "");
|
|
5766
5798
|
}
|
|
5767
|
-
class
|
|
5799
|
+
class tn {
|
|
5768
5800
|
used;
|
|
5769
5801
|
/**
|
|
5770
5802
|
* `taken` seeds the pool with names it must not hand out. An import into an
|
|
@@ -5786,7 +5818,7 @@ class Ke {
|
|
|
5786
5818
|
return this.used.has(r);
|
|
5787
5819
|
}
|
|
5788
5820
|
}
|
|
5789
|
-
function
|
|
5821
|
+
function qe(t, r, n) {
|
|
5790
5822
|
if (t) {
|
|
5791
5823
|
const i = Zt(t) || n, e = r.claim(i);
|
|
5792
5824
|
return e !== t ? { ref: e, renamedFrom: t, generated: !1 } : { ref: e, generated: !1 };
|
|
@@ -5818,33 +5850,33 @@ function ce(t, r) {
|
|
|
5818
5850
|
return { ref: r.claim(Zt(a) || "asset"), fileName: e, data: i };
|
|
5819
5851
|
});
|
|
5820
5852
|
}
|
|
5821
|
-
function
|
|
5853
|
+
function Fr(t, r) {
|
|
5822
5854
|
return t.splitLevel !== void 0 ? Math.max(0, t.splitLevel) : t.splitChapters === !1 ? 0 : t.splitSections ? r === "book" ? 2 : 1 : r === "book" ? 1 : 0;
|
|
5823
5855
|
}
|
|
5824
|
-
function
|
|
5856
|
+
function qr(t, r, n) {
|
|
5825
5857
|
const i = t.slice(0, r), e = t.slice(r);
|
|
5826
5858
|
return /\bxml:id\s*=\s*(?:"[^"]*"|'[^']*')/.test(i) ? i.replace(
|
|
5827
5859
|
/\bxml:id\s*=\s*(?:"[^"]*"|'[^']*')/,
|
|
5828
5860
|
`xml:id="${n}"`
|
|
5829
5861
|
) + e : i.replace(/^<([a-zA-Z_:][\w:.-]*)/, `<$1 xml:id="${n}"`) + e;
|
|
5830
5862
|
}
|
|
5831
|
-
function
|
|
5832
|
-
return
|
|
5863
|
+
function Br(t, r, n) {
|
|
5864
|
+
return qe(t.attributes["xml:id"], r, n);
|
|
5833
5865
|
}
|
|
5834
|
-
function
|
|
5866
|
+
function Nr(t, r) {
|
|
5835
5867
|
const n = t.outer.slice(0, t.startTagEnd - t.start), i = t.outer.slice(t.contentEnd - t.start);
|
|
5836
5868
|
return n + r + i;
|
|
5837
5869
|
}
|
|
5838
|
-
function
|
|
5870
|
+
function Ur(t, r, n, i) {
|
|
5839
5871
|
if (n > i.maxDepth)
|
|
5840
5872
|
return t;
|
|
5841
|
-
const e =
|
|
5873
|
+
const e = Et(t, zt);
|
|
5842
5874
|
if (e.length === 0)
|
|
5843
5875
|
return t;
|
|
5844
5876
|
const a = e.map((s, o) => {
|
|
5845
|
-
const c = o + 1, f = `${
|
|
5877
|
+
const c = o + 1, f = `${Ye(s.name)}-${ue(c, e.length)}`, p = n === 1 ? f : `${r}-${f}`, g = Br(s, i.refs, p);
|
|
5846
5878
|
oe(i.warnings, g, s.name, c);
|
|
5847
|
-
const d =
|
|
5879
|
+
const d = Ur(
|
|
5848
5880
|
s.inner,
|
|
5849
5881
|
g.ref,
|
|
5850
5882
|
n + 1,
|
|
@@ -5853,10 +5885,10 @@ function Br(t, r, n, i) {
|
|
|
5853
5885
|
return i.divisions.push({
|
|
5854
5886
|
xmlId: g.ref,
|
|
5855
5887
|
type: s.name,
|
|
5856
|
-
title:
|
|
5888
|
+
title: Je(s.inner),
|
|
5857
5889
|
sourceFormat: "pretext",
|
|
5858
|
-
content:
|
|
5859
|
-
|
|
5890
|
+
content: qr(
|
|
5891
|
+
Nr(s, d),
|
|
5860
5892
|
s.startTagEnd - s.start,
|
|
5861
5893
|
g.ref
|
|
5862
5894
|
),
|
|
@@ -5869,12 +5901,12 @@ function Br(t, r, n, i) {
|
|
|
5869
5901
|
});
|
|
5870
5902
|
return Wt(t, a);
|
|
5871
5903
|
}
|
|
5872
|
-
function
|
|
5873
|
-
const n = [], i = r.documentKind ??
|
|
5874
|
-
let l =
|
|
5904
|
+
function Mr(t, r = {}) {
|
|
5905
|
+
const n = [], i = r.documentKind ?? Dr(t), e = Fr(r, i), a = It(t, "pretext"), s = a ? a.inner : t, o = ft(s, "docinfo"), c = o?.outer.trim() ?? "";
|
|
5906
|
+
let l = fe(s);
|
|
5875
5907
|
if (!l) {
|
|
5876
|
-
const b = i
|
|
5877
|
-
l =
|
|
5908
|
+
const b = i, x = (o ? s.slice(0, o.start) + s.slice(o.end) : s).trim();
|
|
5909
|
+
l = ft(
|
|
5878
5910
|
`<${b}>
|
|
5879
5911
|
${x}
|
|
5880
5912
|
</${b}>`,
|
|
@@ -5892,20 +5924,22 @@ ${x}
|
|
|
5892
5924
|
occurrences: 1,
|
|
5893
5925
|
message: "Document was treated as a book but no <book> element found; importing with the existing root."
|
|
5894
5926
|
});
|
|
5895
|
-
const f = new
|
|
5927
|
+
const f = new tn(r.takenIds), p = [], g = Br(l, f, "document");
|
|
5896
5928
|
g.renamedFrom !== void 0 && oe(n, g, l.name, 1);
|
|
5897
|
-
const d =
|
|
5929
|
+
const d = Je(l.inner), w = Ur(l.inner, g.ref, 1, {
|
|
5898
5930
|
refs: f,
|
|
5899
5931
|
divisions: p,
|
|
5900
5932
|
warnings: n,
|
|
5901
5933
|
maxDepth: e
|
|
5902
5934
|
}), h = {
|
|
5903
5935
|
xmlId: g.ref,
|
|
5904
|
-
|
|
5936
|
+
// The root element the document actually has. Collapsing this to a
|
|
5937
|
+
// book/article binary is what used to turn a <slideshow> into an <article>.
|
|
5938
|
+
type: He(l.name) ?? "article",
|
|
5905
5939
|
title: d,
|
|
5906
5940
|
sourceFormat: "pretext",
|
|
5907
|
-
content:
|
|
5908
|
-
|
|
5941
|
+
content: qr(
|
|
5942
|
+
Nr(l, w),
|
|
5909
5943
|
l.startTagEnd - l.start,
|
|
5910
5944
|
g.ref
|
|
5911
5945
|
),
|
|
@@ -5924,35 +5958,35 @@ ${x}
|
|
|
5924
5958
|
warnings: n
|
|
5925
5959
|
};
|
|
5926
5960
|
}
|
|
5927
|
-
function
|
|
5928
|
-
return r === "latex" ?
|
|
5961
|
+
function Wr(t, r, n = {}) {
|
|
5962
|
+
return r === "latex" ? ts(t, n) : es(t, n);
|
|
5929
5963
|
}
|
|
5930
|
-
function
|
|
5931
|
-
return Zt(
|
|
5964
|
+
function mr(t) {
|
|
5965
|
+
return Zt(Ze(t));
|
|
5932
5966
|
}
|
|
5933
|
-
function
|
|
5967
|
+
function en(t, r, n, i, e, a, s) {
|
|
5934
5968
|
if (t) {
|
|
5935
|
-
const l =
|
|
5969
|
+
const l = qe(
|
|
5936
5970
|
t,
|
|
5937
5971
|
n,
|
|
5938
|
-
|
|
5972
|
+
mr(r) || i
|
|
5939
5973
|
);
|
|
5940
5974
|
return oe(s, l, e, a), l.ref;
|
|
5941
5975
|
}
|
|
5942
|
-
const o =
|
|
5976
|
+
const o = mr(r);
|
|
5943
5977
|
if (o)
|
|
5944
5978
|
return n.claim(o);
|
|
5945
|
-
const c =
|
|
5979
|
+
const c = qe(void 0, n, i);
|
|
5946
5980
|
return oe(s, c, e, a), c.ref;
|
|
5947
5981
|
}
|
|
5948
|
-
function
|
|
5949
|
-
const n = [], { body: i } = Bt(t), e = (i || t).trim(), a =
|
|
5982
|
+
function ts(t, r) {
|
|
5983
|
+
const n = [], { body: i } = Bt(t), e = (i || t).trim(), a = Ir(e), s = Ve(e), o = r.documentKind ?? (s.includes("chapter") || s.includes("part") ? "book" : "article"), c = Fr(r, o), l = new tn(), f = l.claim("document"), p = [], g = Zr(e, a, 0, e.length, 1, {
|
|
5950
5984
|
maxDepth: c,
|
|
5951
5985
|
refs: l,
|
|
5952
5986
|
divisions: p,
|
|
5953
5987
|
warnings: n,
|
|
5954
5988
|
parentRef: f
|
|
5955
|
-
}), d = o
|
|
5989
|
+
}), d = o, w = r.title ?? "", h = `\\${d}{${w}}\\label{${f}}`;
|
|
5956
5990
|
return p.unshift({
|
|
5957
5991
|
xmlId: f,
|
|
5958
5992
|
type: d,
|
|
@@ -5972,12 +6006,12 @@ ${g}` : h,
|
|
|
5972
6006
|
warnings: n
|
|
5973
6007
|
};
|
|
5974
6008
|
}
|
|
5975
|
-
function
|
|
6009
|
+
function Zr(t, r, n, i, e, a) {
|
|
5976
6010
|
if (e > a.maxDepth || r.length === 0)
|
|
5977
6011
|
return t.slice(n, i).trim();
|
|
5978
6012
|
const s = [t.slice(n, r[0].start)];
|
|
5979
6013
|
return r.forEach((o, c) => {
|
|
5980
|
-
const f = `${
|
|
6014
|
+
const f = `${Ye(o.command)}-${ue(c + 1, r.length)}`, p = e === 1 ? f : `${a.parentRef}-${f}`, g = en(
|
|
5981
6015
|
o.labelId,
|
|
5982
6016
|
o.title,
|
|
5983
6017
|
a.refs,
|
|
@@ -5985,7 +6019,7 @@ function Mr(t, r, n, i, e, a) {
|
|
|
5985
6019
|
o.command,
|
|
5986
6020
|
c + 1,
|
|
5987
6021
|
a.warnings
|
|
5988
|
-
), d =
|
|
6022
|
+
), d = Zr(
|
|
5989
6023
|
t,
|
|
5990
6024
|
o.children,
|
|
5991
6025
|
o.contentStart,
|
|
@@ -6006,7 +6040,7 @@ ${d}`,
|
|
|
6006
6040
|
|
|
6007
6041
|
`).trim();
|
|
6008
6042
|
}
|
|
6009
|
-
function
|
|
6043
|
+
function Xr(t, r) {
|
|
6010
6044
|
const n = new RegExp(`^#{${r}}\\s+(.*)$`), i = [], e = [];
|
|
6011
6045
|
let a = null, s = !1, o = "";
|
|
6012
6046
|
for (const c of t.split(`
|
|
@@ -6036,12 +6070,12 @@ ${Object.entries(t).map(([n, i]) => `${n}: ${i}`).join(`
|
|
|
6036
6070
|
`)}
|
|
6037
6071
|
---`;
|
|
6038
6072
|
}
|
|
6039
|
-
function
|
|
6040
|
-
const n = [], i = t.trim(), e = r.documentKind ?? "article", a = r.splitChapters ?? e === "book", s = r.splitSections ?? !1, o = new
|
|
6073
|
+
function es(t, r) {
|
|
6074
|
+
const n = [], i = t.trim(), e = r.documentKind ?? "article", a = r.splitChapters ?? e === "book", s = r.splitSections ?? !1, o = new tn(), c = o.claim("document"), l = [];
|
|
6041
6075
|
if (!(a && e === "book"))
|
|
6042
6076
|
return l.push({
|
|
6043
6077
|
xmlId: c,
|
|
6044
|
-
type: e
|
|
6078
|
+
type: e,
|
|
6045
6079
|
title: r.title ?? "",
|
|
6046
6080
|
sourceFormat: "markdown",
|
|
6047
6081
|
content: `${Kt({
|
|
@@ -6062,9 +6096,9 @@ ${i}`.trim(),
|
|
|
6062
6096
|
},
|
|
6063
6097
|
warnings: n
|
|
6064
6098
|
};
|
|
6065
|
-
const { preamble: f, sections: p } =
|
|
6099
|
+
const { preamble: f, sections: p } = Xr(i, 1), g = f ? [f] : [];
|
|
6066
6100
|
return p.forEach((d, w) => {
|
|
6067
|
-
const h =
|
|
6101
|
+
const h = en(
|
|
6068
6102
|
void 0,
|
|
6069
6103
|
d.headingText,
|
|
6070
6104
|
o,
|
|
@@ -6074,7 +6108,7 @@ ${i}`.trim(),
|
|
|
6074
6108
|
n
|
|
6075
6109
|
);
|
|
6076
6110
|
let v = d.body;
|
|
6077
|
-
s && (v =
|
|
6111
|
+
s && (v = ns(
|
|
6078
6112
|
d.body,
|
|
6079
6113
|
h,
|
|
6080
6114
|
o,
|
|
@@ -6122,12 +6156,12 @@ ${g.join(`
|
|
|
6122
6156
|
warnings: n
|
|
6123
6157
|
};
|
|
6124
6158
|
}
|
|
6125
|
-
function
|
|
6126
|
-
const { preamble: a, sections: s } =
|
|
6159
|
+
function ns(t, r, n, i, e) {
|
|
6160
|
+
const { preamble: a, sections: s } = Xr(t, 2);
|
|
6127
6161
|
if (s.length === 0) return t;
|
|
6128
6162
|
const o = a ? [a] : [];
|
|
6129
6163
|
return s.forEach((c, l) => {
|
|
6130
|
-
const f =
|
|
6164
|
+
const f = en(
|
|
6131
6165
|
void 0,
|
|
6132
6166
|
c.headingText,
|
|
6133
6167
|
n,
|
|
@@ -6156,45 +6190,45 @@ ${c.body}`.trim(),
|
|
|
6156
6190
|
|
|
6157
6191
|
`).trim();
|
|
6158
6192
|
}
|
|
6159
|
-
const
|
|
6193
|
+
const Be = /<plus:([a-zA-Z][a-zA-Z-]*)\s+ref="([^"]+)"\s*\/>/g;
|
|
6160
6194
|
function le(t) {
|
|
6161
6195
|
const r = [];
|
|
6162
|
-
|
|
6196
|
+
Be.lastIndex = 0;
|
|
6163
6197
|
let n;
|
|
6164
|
-
for (; (n =
|
|
6198
|
+
for (; (n = Be.exec(t)) !== null; )
|
|
6165
6199
|
r.push(n[2]);
|
|
6166
6200
|
return r;
|
|
6167
6201
|
}
|
|
6168
|
-
function
|
|
6202
|
+
function Ne(t, r) {
|
|
6169
6203
|
return t.replace(
|
|
6170
|
-
|
|
6204
|
+
Be,
|
|
6171
6205
|
(n, i, e) => {
|
|
6172
6206
|
const a = r.get(e);
|
|
6173
6207
|
return a ? `<xi:include href="${a}"/>` : n;
|
|
6174
6208
|
}
|
|
6175
6209
|
);
|
|
6176
6210
|
}
|
|
6177
|
-
function
|
|
6178
|
-
const n =
|
|
6211
|
+
function rs(t, r) {
|
|
6212
|
+
const n = Ze(t) || "division";
|
|
6179
6213
|
return n.startsWith(`${r}-`) ? n : `${r}-${n}`;
|
|
6180
6214
|
}
|
|
6181
|
-
function
|
|
6215
|
+
function is(t, r) {
|
|
6182
6216
|
let n = r, i = 2;
|
|
6183
6217
|
for (; t.has(n); )
|
|
6184
6218
|
n = `${r}-${i}`, i += 1;
|
|
6185
6219
|
return t.add(n), n;
|
|
6186
6220
|
}
|
|
6187
|
-
function
|
|
6221
|
+
function as(t, r) {
|
|
6188
6222
|
const n = `${r}-`;
|
|
6189
6223
|
return t.startsWith(n) ? t.slice(n.length) : t;
|
|
6190
6224
|
}
|
|
6191
|
-
function
|
|
6225
|
+
function Vr(t, r) {
|
|
6192
6226
|
const n = new Map(
|
|
6193
6227
|
t.divisions.map((f) => [f.xmlId, f])
|
|
6194
6228
|
), i = [], e = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
6195
6229
|
function o(f, p) {
|
|
6196
6230
|
let g = s.get(f);
|
|
6197
|
-
return g || (g = /* @__PURE__ */ new Set(), s.set(f, g)),
|
|
6231
|
+
return g || (g = /* @__PURE__ */ new Set(), s.set(f, g)), is(g, p);
|
|
6198
6232
|
}
|
|
6199
6233
|
function c(f, p, g, d) {
|
|
6200
6234
|
if (e.has(f.xmlId))
|
|
@@ -6202,9 +6236,9 @@ function Zr(t, r) {
|
|
|
6202
6236
|
e.add(f.xmlId);
|
|
6203
6237
|
const w = o(
|
|
6204
6238
|
p,
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6239
|
+
Xa(f.type) ? f.type : rs(
|
|
6240
|
+
as(f.xmlId, d),
|
|
6241
|
+
Ye(f.type)
|
|
6208
6242
|
)
|
|
6209
6243
|
);
|
|
6210
6244
|
a.set(f.xmlId, `${g}${w}.ptx`), i.push({ division: f, filePath: `${p}${w}.ptx` });
|
|
@@ -6223,46 +6257,46 @@ function Zr(t, r) {
|
|
|
6223
6257
|
f.isRoot || e.has(f.xmlId) || l.has(f.xmlId) || c(f, r.directory, "", r.parentXmlId);
|
|
6224
6258
|
return { placed: i, hrefByRef: a };
|
|
6225
6259
|
}
|
|
6226
|
-
const
|
|
6260
|
+
const ge = {
|
|
6227
6261
|
mainSourcePath: "source/main.ptx",
|
|
6228
6262
|
publicationPath: "publication/publication.ptx",
|
|
6229
6263
|
projectFilePath: "project.ptx"
|
|
6230
6264
|
};
|
|
6231
|
-
function
|
|
6232
|
-
const n = r.mainSourcePath ??
|
|
6265
|
+
function ss(t, r = {}) {
|
|
6266
|
+
const n = r.mainSourcePath ?? ge.mainSourcePath, i = r.publicationPath ?? ge.publicationPath, e = r.projectFilePath ?? ge.projectFilePath, a = r.includeScaffold ?? !0, s = {}, o = new Map(t.divisions.map((v) => [v.xmlId, v])), c = t.divisions.find((v) => v.isRoot);
|
|
6233
6267
|
if (!c)
|
|
6234
6268
|
throw new Error("Division pool has no root division.");
|
|
6235
|
-
const l = n.includes("/") ? n.slice(0, n.lastIndexOf("/") + 1) : "", { placed: f, hrefByRef: p } =
|
|
6269
|
+
const l = n.includes("/") ? n.slice(0, n.lastIndexOf("/") + 1) : "", { placed: f, hrefByRef: p } = Vr(t, {
|
|
6236
6270
|
entries: le(c.content).map((v) => o.get(v)).filter((v) => v !== void 0),
|
|
6237
6271
|
directory: l,
|
|
6238
6272
|
parentXmlId: c.xmlId
|
|
6239
6273
|
});
|
|
6240
6274
|
for (const { division: v, filePath: b } of f) {
|
|
6241
|
-
const x =
|
|
6242
|
-
s[b] =
|
|
6275
|
+
const x = Ne(v.content, p), S = x === v.content ? x : Le(x);
|
|
6276
|
+
s[b] = De(S);
|
|
6243
6277
|
}
|
|
6244
|
-
const g =
|
|
6278
|
+
const g = Ne(c.content, p), w = `<pretext>
|
|
6245
6279
|
${t.docinfo ? `${t.docinfo}
|
|
6246
6280
|
` : ""}${g}
|
|
6247
6281
|
</pretext>`;
|
|
6248
|
-
s[n] =
|
|
6249
|
-
g === c.content ? w :
|
|
6250
|
-
), a && (s[e] =
|
|
6282
|
+
s[n] = De(
|
|
6283
|
+
g === c.content ? w : Le(w)
|
|
6284
|
+
), a && (s[e] = sa({
|
|
6251
6285
|
mainSource: n,
|
|
6252
6286
|
publication: i
|
|
6253
|
-
}), s[i] =
|
|
6287
|
+
}), s[i] = Er());
|
|
6254
6288
|
const h = { [c.xmlId]: n };
|
|
6255
6289
|
for (const { division: v, filePath: b } of f)
|
|
6256
6290
|
h[v.xmlId] = b;
|
|
6257
6291
|
return { files: s, pathByRef: h };
|
|
6258
6292
|
}
|
|
6259
|
-
function
|
|
6260
|
-
const i =
|
|
6293
|
+
function os(t, r, n) {
|
|
6294
|
+
const i = ft(t, r);
|
|
6261
6295
|
if (!i) return t;
|
|
6262
6296
|
const e = t.slice(i.start, i.startTagEnd).replace(/^<\s*[^\s>/]+/, `<${n}`), a = t.slice(i.contentEnd, i.end).replace(/^<\/\s*[^\s>]+/, `</${n}`);
|
|
6263
6297
|
return t.slice(0, i.start) + e + t.slice(i.startTagEnd, i.contentEnd) + a + t.slice(i.end);
|
|
6264
6298
|
}
|
|
6265
|
-
function
|
|
6299
|
+
function cs(t, r) {
|
|
6266
6300
|
const n = new Map(t.divisions.map((a) => [a.xmlId, a])), i = t.divisions.find((a) => a.isRoot);
|
|
6267
6301
|
if (!i)
|
|
6268
6302
|
throw new Error("Division pool has no root division.");
|
|
@@ -6270,7 +6304,7 @@ function is(t, r) {
|
|
|
6270
6304
|
{
|
|
6271
6305
|
...i,
|
|
6272
6306
|
type: r.targetTag,
|
|
6273
|
-
content:
|
|
6307
|
+
content: os(
|
|
6274
6308
|
i.content,
|
|
6275
6309
|
i.type,
|
|
6276
6310
|
r.targetTag
|
|
@@ -6279,41 +6313,41 @@ function is(t, r) {
|
|
|
6279
6313
|
];
|
|
6280
6314
|
return { root: i, entries: e };
|
|
6281
6315
|
}
|
|
6282
|
-
function
|
|
6283
|
-
const { root: n, entries: i } =
|
|
6316
|
+
function ls(t, r) {
|
|
6317
|
+
const { root: n, entries: i } = cs(t, r), { placed: e, hrefByRef: a } = Vr(t, {
|
|
6284
6318
|
entries: i,
|
|
6285
6319
|
directory: r.hrefBase,
|
|
6286
6320
|
parentXmlId: n.xmlId
|
|
6287
6321
|
}), s = {}, o = {};
|
|
6288
6322
|
for (const { division: l, filePath: f } of e) {
|
|
6289
|
-
const p =
|
|
6290
|
-
s[f] =
|
|
6323
|
+
const p = Ne(l.content, a), g = p === l.content ? p : Le(p);
|
|
6324
|
+
s[f] = De(g), o[l.xmlId] = f;
|
|
6291
6325
|
}
|
|
6292
6326
|
const c = i.map((l) => a.get(l.xmlId)).filter((l) => l !== void 0).map((l) => `<xi:include href="${l}"/>`);
|
|
6293
6327
|
return { files: s, includes: c, pathByRef: o };
|
|
6294
6328
|
}
|
|
6295
|
-
function
|
|
6329
|
+
function Gr(t, r, n = {}) {
|
|
6296
6330
|
if (r.kind === "insert")
|
|
6297
|
-
return
|
|
6331
|
+
return ls(t, {
|
|
6298
6332
|
targetTag: r.targetTag,
|
|
6299
6333
|
hrefBase: r.hrefBase,
|
|
6300
6334
|
unwrapRoot: n.unwrapRoot ?? !1
|
|
6301
6335
|
});
|
|
6302
|
-
const { files: i, pathByRef: e } =
|
|
6336
|
+
const { files: i, pathByRef: e } = ss(t, n.layout);
|
|
6303
6337
|
return { files: i, includes: [], pathByRef: e };
|
|
6304
6338
|
}
|
|
6305
|
-
const
|
|
6306
|
-
function
|
|
6339
|
+
const us = { kind: "project" }, ds = ["ref", "first", "last"];
|
|
6340
|
+
function fs(t) {
|
|
6307
6341
|
let r = t.base, n = 2;
|
|
6308
6342
|
for (; t.isTaken(r) || r === ""; )
|
|
6309
6343
|
r = `${t.base || "id"}-${n}`, n += 1;
|
|
6310
6344
|
return r;
|
|
6311
6345
|
}
|
|
6312
|
-
function
|
|
6346
|
+
function hs(t) {
|
|
6313
6347
|
return t.split(/([\s,]+)/);
|
|
6314
6348
|
}
|
|
6315
|
-
function
|
|
6316
|
-
const n =
|
|
6349
|
+
function ps(t, r) {
|
|
6350
|
+
const n = Lr(t), i = new Set(r.takenIds), e = (c) => i.has(c), a = /* @__PURE__ */ new Map(), s = [];
|
|
6317
6351
|
for (const c of n) {
|
|
6318
6352
|
const l = c.attributes["xml:id"];
|
|
6319
6353
|
if (l === void 0 || a.has(l)) continue;
|
|
@@ -6322,7 +6356,7 @@ function us(t, r) {
|
|
|
6322
6356
|
i.add(l);
|
|
6323
6357
|
continue;
|
|
6324
6358
|
}
|
|
6325
|
-
const p =
|
|
6359
|
+
const p = fs({
|
|
6326
6360
|
original: l,
|
|
6327
6361
|
base: f,
|
|
6328
6362
|
isTaken: e,
|
|
@@ -6340,10 +6374,10 @@ function us(t, r) {
|
|
|
6340
6374
|
/\bxml:id\s*=\s*(["'])[^"']*\1/,
|
|
6341
6375
|
(d, w) => `xml:id=${w}${g}${w}`
|
|
6342
6376
|
));
|
|
6343
|
-
for (const d of
|
|
6377
|
+
for (const d of ds) {
|
|
6344
6378
|
const w = c.attributes[d];
|
|
6345
6379
|
if (w === void 0) continue;
|
|
6346
|
-
const h =
|
|
6380
|
+
const h = hs(w).map((v) => a.get(v) ?? v).join("");
|
|
6347
6381
|
h !== w && (f = f.replace(
|
|
6348
6382
|
new RegExp(`\\b${d}\\s*=\\s*(["'])[^"']*\\1`),
|
|
6349
6383
|
(v, b) => `${d}=${b}${h}${b}`
|
|
@@ -6357,39 +6391,39 @@ function us(t, r) {
|
|
|
6357
6391
|
}
|
|
6358
6392
|
return { source: Wt(t, o), renamed: s };
|
|
6359
6393
|
}
|
|
6360
|
-
function
|
|
6394
|
+
function gr(t) {
|
|
6361
6395
|
const r = t.indexOf(":");
|
|
6362
6396
|
return r < 0 ? { prefix: "", local: t } : {
|
|
6363
6397
|
prefix: t.slice(0, r + 1),
|
|
6364
6398
|
local: t.slice(r + 1)
|
|
6365
6399
|
};
|
|
6366
6400
|
}
|
|
6367
|
-
function
|
|
6368
|
-
return
|
|
6401
|
+
function Ro(t, r) {
|
|
6402
|
+
return Hr(t, Ut(r));
|
|
6369
6403
|
}
|
|
6370
|
-
function
|
|
6371
|
-
const n =
|
|
6404
|
+
function Hr(t, r) {
|
|
6405
|
+
const n = Lr(t);
|
|
6372
6406
|
let i = -1;
|
|
6373
6407
|
for (const l of n) {
|
|
6374
|
-
const f =
|
|
6408
|
+
const f = Ut(gr(l.name).local);
|
|
6375
6409
|
f >= 0 && (i < 0 || f < i) && (i = f);
|
|
6376
6410
|
}
|
|
6377
6411
|
if (i < 0 || r < 0)
|
|
6378
6412
|
return { source: t, delta: 0, overflowed: [] };
|
|
6379
|
-
const e = r - i, a =
|
|
6413
|
+
const e = r - i, a = Nt[i];
|
|
6380
6414
|
if (e === 0)
|
|
6381
6415
|
return { source: t, delta: 0, topTag: a, overflowed: [] };
|
|
6382
6416
|
const s = /* @__PURE__ */ new Set(), o = [];
|
|
6383
6417
|
for (const l of n) {
|
|
6384
|
-
const { prefix: f, local: p } =
|
|
6418
|
+
const { prefix: f, local: p } = gr(l.name), g = Ut(p);
|
|
6385
6419
|
if (g < 0) continue;
|
|
6386
|
-
const d =
|
|
6420
|
+
const d = Va(p, e);
|
|
6387
6421
|
if (d === p) continue;
|
|
6388
|
-
d ===
|
|
6422
|
+
d === zr && s.add(g);
|
|
6389
6423
|
const w = t.slice(l.start, l.end), h = l.kind === "close" ? w.replace(/^<\/\s*[^\s>/]+/, `</${f}${d}`) : w.replace(/^<\s*[^\s>/]+/, `<${f}${d}`);
|
|
6390
6424
|
o.push({ start: l.start, end: l.end, replacement: h });
|
|
6391
6425
|
}
|
|
6392
|
-
const c = [...s].sort((l, f) => l - f).map((l) =>
|
|
6426
|
+
const c = [...s].sort((l, f) => l - f).map((l) => Nt[l]);
|
|
6393
6427
|
return {
|
|
6394
6428
|
source: Wt(t, o),
|
|
6395
6429
|
delta: e,
|
|
@@ -6397,21 +6431,21 @@ function Vr(t, r) {
|
|
|
6397
6431
|
overflowed: c
|
|
6398
6432
|
};
|
|
6399
6433
|
}
|
|
6400
|
-
function
|
|
6401
|
-
if (
|
|
6434
|
+
function ms(t) {
|
|
6435
|
+
if (ft(t, "title"))
|
|
6402
6436
|
return !1;
|
|
6403
|
-
const r =
|
|
6404
|
-
return r.length === 0 || !r.every((n) => zt(n.name)) ? !1 : !
|
|
6437
|
+
const r = Et(t, () => !0);
|
|
6438
|
+
return r.length === 0 || !r.every((n) => zt(n.name)) ? !1 : !Yr(t);
|
|
6405
6439
|
}
|
|
6406
|
-
function
|
|
6407
|
-
const r =
|
|
6440
|
+
function Yr(t) {
|
|
6441
|
+
const r = Et(t, zt);
|
|
6408
6442
|
let n = "", i = 0;
|
|
6409
6443
|
for (const e of r)
|
|
6410
6444
|
n += t.slice(i, e.start), i = e.end;
|
|
6411
6445
|
return n += t.slice(i), n.replace(/<!--[\s\S]*?-->/g, "").trim() !== "";
|
|
6412
6446
|
}
|
|
6413
|
-
function
|
|
6414
|
-
const r =
|
|
6447
|
+
function gs(t) {
|
|
6448
|
+
const r = ft(t, "pretext"), n = r ? r.inner : t, i = r ? r.startTagEnd : 0, e = fe(n);
|
|
6415
6449
|
return e ? {
|
|
6416
6450
|
...e,
|
|
6417
6451
|
start: e.start + i,
|
|
@@ -6420,11 +6454,11 @@ function fs(t) {
|
|
|
6420
6454
|
end: e.end + i
|
|
6421
6455
|
} : null;
|
|
6422
6456
|
}
|
|
6423
|
-
function
|
|
6424
|
-
const r =
|
|
6457
|
+
function bs(t) {
|
|
6458
|
+
const r = ft(t, "title");
|
|
6425
6459
|
return r ? r.inner.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() : "";
|
|
6426
6460
|
}
|
|
6427
|
-
function
|
|
6461
|
+
function vs(t, r, n) {
|
|
6428
6462
|
const i = new Set(n), e = [];
|
|
6429
6463
|
for (const a of r) {
|
|
6430
6464
|
const s = a.attributes["xml:id"];
|
|
@@ -6432,7 +6466,7 @@ function ps(t, r, n) {
|
|
|
6432
6466
|
i.add(s);
|
|
6433
6467
|
continue;
|
|
6434
6468
|
}
|
|
6435
|
-
const o = Zt(
|
|
6469
|
+
const o = Zt(Ze(bs(a.inner))) || "imported";
|
|
6436
6470
|
let c = o, l = 2;
|
|
6437
6471
|
for (; i.has(c); )
|
|
6438
6472
|
c = `${o}-${l}`, l += 1;
|
|
@@ -6444,8 +6478,8 @@ function ps(t, r, n) {
|
|
|
6444
6478
|
}
|
|
6445
6479
|
return e.length === 0 ? t : Wt(t, e);
|
|
6446
6480
|
}
|
|
6447
|
-
function
|
|
6448
|
-
return r ?
|
|
6481
|
+
function ws(t, r) {
|
|
6482
|
+
return r ? Et(t.inner, zt).map(
|
|
6449
6483
|
(n) => ({
|
|
6450
6484
|
...n,
|
|
6451
6485
|
start: n.start + t.startTagEnd,
|
|
@@ -6455,12 +6489,12 @@ function ms(t, r) {
|
|
|
6455
6489
|
})
|
|
6456
6490
|
) : [t];
|
|
6457
6491
|
}
|
|
6458
|
-
function
|
|
6492
|
+
function Jr(t) {
|
|
6459
6493
|
return t ? 1 : 0;
|
|
6460
6494
|
}
|
|
6461
|
-
function
|
|
6462
|
-
const i = [], e =
|
|
6463
|
-
o && !s && a !== null &&
|
|
6495
|
+
function Kr(t, r, n = {}) {
|
|
6496
|
+
const i = [], e = gs(t), a = e?.inner ?? null, s = a !== null && ms(a), o = a !== null && (n.hasSelection || s);
|
|
6497
|
+
o && !s && a !== null && Yr(a) && i.push({
|
|
6464
6498
|
action: "delete",
|
|
6465
6499
|
severity: "warning",
|
|
6466
6500
|
kind: "structure",
|
|
@@ -6469,14 +6503,14 @@ function Yr(t, r, n = {}) {
|
|
|
6469
6503
|
occurrences: 1,
|
|
6470
6504
|
message: "The selected divisions are inserted on their own, so the document's title and any text outside them are not carried across."
|
|
6471
6505
|
});
|
|
6472
|
-
const c = e ?
|
|
6506
|
+
const c = e ? vs(
|
|
6473
6507
|
t,
|
|
6474
|
-
|
|
6508
|
+
ws(e, o),
|
|
6475
6509
|
r.takenIds
|
|
6476
|
-
) : t, l =
|
|
6510
|
+
) : t, l = Ut(r.targetTag), f = Hr(
|
|
6477
6511
|
c,
|
|
6478
6512
|
l < 0 ? -1 : o ? l : l + 1
|
|
6479
|
-
), { source: p, renamed: g } =
|
|
6513
|
+
), { source: p, renamed: g } = ps(f.source, {
|
|
6480
6514
|
takenIds: r.takenIds
|
|
6481
6515
|
});
|
|
6482
6516
|
return f.overflowed.length > 0 && i.push({
|
|
@@ -6495,7 +6529,7 @@ function Yr(t, r, n = {}) {
|
|
|
6495
6529
|
macro: "xml:id",
|
|
6496
6530
|
occurrences: g.length,
|
|
6497
6531
|
message: `${g.length} imported id${g.length === 1 ? "" : "s"} already existed in this project and ${g.length === 1 ? "was" : "were"} renamed: ${g.map((d) => `\`${d.from}\` → \`${d.to}\``).join(", ")}.`
|
|
6498
|
-
}), !o && a !== null && !
|
|
6532
|
+
}), !o && a !== null && !ft(a, "title") && i.push({
|
|
6499
6533
|
action: "anomaly",
|
|
6500
6534
|
severity: "warning",
|
|
6501
6535
|
kind: "structure",
|
|
@@ -6505,15 +6539,15 @@ function Yr(t, r, n = {}) {
|
|
|
6505
6539
|
message: `The imported document has no title, so the <${r.targetTag}> it becomes has none either. PreTeXt divisions need a title; add one before building.`
|
|
6506
6540
|
}), { source: p, unwrapRoot: o, retarget: f, renamed: g, warnings: i };
|
|
6507
6541
|
}
|
|
6508
|
-
const
|
|
6542
|
+
const _s = "source", ys = "publication", br = "main.ptx";
|
|
6509
6543
|
function Pt(t, r) {
|
|
6510
|
-
const n =
|
|
6544
|
+
const n = ft(t.inner, r);
|
|
6511
6545
|
if (!n)
|
|
6512
6546
|
return;
|
|
6513
6547
|
const i = n.inner.trim();
|
|
6514
6548
|
return i.length > 0 ? i : void 0;
|
|
6515
6549
|
}
|
|
6516
|
-
function
|
|
6550
|
+
function be(t, r, n) {
|
|
6517
6551
|
const i = Pt(t, r);
|
|
6518
6552
|
if (i !== void 0)
|
|
6519
6553
|
return mt(i);
|
|
@@ -6521,27 +6555,27 @@ function me(t, r, n) {
|
|
|
6521
6555
|
if (e !== void 0 && e.trim().length > 0)
|
|
6522
6556
|
return kt(n, e.trim());
|
|
6523
6557
|
}
|
|
6524
|
-
function
|
|
6525
|
-
const n =
|
|
6558
|
+
function xs(t, r) {
|
|
6559
|
+
const n = ft(t, "project");
|
|
6526
6560
|
if (!n)
|
|
6527
6561
|
return null;
|
|
6528
|
-
const i =
|
|
6562
|
+
const i = Ke(mt(r)), e = n.attributes.source?.trim() || _s, a = n.attributes.publication?.trim() || ys, s = n.attributes.output?.trim() || "output", o = {
|
|
6529
6563
|
manifestPath: mt(r),
|
|
6530
6564
|
projectRoot: i,
|
|
6531
6565
|
ptxVersion: n.attributes["ptx-version"],
|
|
6532
6566
|
sourceDir: e,
|
|
6533
6567
|
publicationDir: a,
|
|
6534
6568
|
targets: []
|
|
6535
|
-
}, c =
|
|
6569
|
+
}, c = ft(n.inner, "targets"), l = c ? $r(c.inner, "target") : [];
|
|
6536
6570
|
for (const f of l)
|
|
6537
6571
|
o.targets.push({
|
|
6538
6572
|
name: f.attributes.name ?? "",
|
|
6539
6573
|
// v2 manifests carry the format as an attribute; legacy v1 manifests
|
|
6540
6574
|
// use a `<format>` child element.
|
|
6541
6575
|
format: f.attributes.format ?? Pt(f, "format") ?? "",
|
|
6542
|
-
source:
|
|
6543
|
-
publication:
|
|
6544
|
-
outputDir:
|
|
6576
|
+
source: be(f, "source", e) ?? kt(e, br),
|
|
6577
|
+
publication: be(f, "publication", a),
|
|
6578
|
+
outputDir: be(f, "output-dir", s),
|
|
6545
6579
|
standalone: f.attributes.standalone !== void 0 && f.attributes.standalone !== "no"
|
|
6546
6580
|
});
|
|
6547
6581
|
if (o.targets.length === 0) {
|
|
@@ -6549,34 +6583,34 @@ function vs(t, r) {
|
|
|
6549
6583
|
o.targets.push({
|
|
6550
6584
|
name: "default",
|
|
6551
6585
|
format: Pt(n, "format") ?? "",
|
|
6552
|
-
source: f ? mt(f) : kt(e,
|
|
6586
|
+
source: f ? mt(f) : kt(e, br),
|
|
6553
6587
|
publication: Pt(n, "publication"),
|
|
6554
6588
|
standalone: !1
|
|
6555
6589
|
});
|
|
6556
6590
|
}
|
|
6557
6591
|
return o;
|
|
6558
6592
|
}
|
|
6559
|
-
function
|
|
6593
|
+
function ks(t) {
|
|
6560
6594
|
const r = Object.keys(t).filter((n) => yt(n).toLowerCase() === "project.ptx").sort((n, i) => {
|
|
6561
6595
|
const e = n.split("/").length - i.split("/").length;
|
|
6562
6596
|
return e !== 0 ? e : n.localeCompare(i);
|
|
6563
6597
|
});
|
|
6564
6598
|
for (const n of r) {
|
|
6565
|
-
const i =
|
|
6599
|
+
const i = xs(t[n], n);
|
|
6566
6600
|
if (i)
|
|
6567
6601
|
return i;
|
|
6568
6602
|
}
|
|
6569
6603
|
return null;
|
|
6570
6604
|
}
|
|
6571
|
-
function
|
|
6605
|
+
function Ss(t) {
|
|
6572
6606
|
return t.targets.find((r) => !r.standalone) ?? t.targets[0];
|
|
6573
6607
|
}
|
|
6574
|
-
const
|
|
6608
|
+
const Es = /* @__PURE__ */ new Set(["md", "markdown"]), As = /* @__PURE__ */ new Set(["ptx", "xml"]), Is = /* @__PURE__ */ new Set([
|
|
6575
6609
|
"readme",
|
|
6576
6610
|
"changelog",
|
|
6577
6611
|
"contributing",
|
|
6578
6612
|
"license"
|
|
6579
|
-
]),
|
|
6613
|
+
]), vr = [
|
|
6580
6614
|
"main",
|
|
6581
6615
|
"book",
|
|
6582
6616
|
"index",
|
|
@@ -6587,53 +6621,53 @@ const ys = /* @__PURE__ */ new Set(["md", "markdown"]), xs = /* @__PURE__ */ new
|
|
|
6587
6621
|
"article",
|
|
6588
6622
|
"paper"
|
|
6589
6623
|
];
|
|
6590
|
-
function
|
|
6624
|
+
function nn(t, r) {
|
|
6591
6625
|
return Object.fromEntries(
|
|
6592
6626
|
Object.entries(t).filter(([n]) => r.has(St(n)))
|
|
6593
6627
|
);
|
|
6594
6628
|
}
|
|
6595
|
-
function
|
|
6596
|
-
const r =
|
|
6597
|
-
return
|
|
6629
|
+
function Qr(t) {
|
|
6630
|
+
const r = ft(t, "pretext") ?? ft(t, "book") ?? ft(t, "article"), n = r ? r.inner : t;
|
|
6631
|
+
return ft(n, "title")?.inner.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() || void 0;
|
|
6598
6632
|
}
|
|
6599
|
-
function
|
|
6633
|
+
function Ts(t) {
|
|
6600
6634
|
const r = /^#\s+(.+)$/m.exec(t);
|
|
6601
6635
|
return r ? r[1].trim() : void 0;
|
|
6602
6636
|
}
|
|
6603
|
-
function
|
|
6637
|
+
function wr(t) {
|
|
6604
6638
|
return ae(t, "title") || void 0;
|
|
6605
6639
|
}
|
|
6606
|
-
function
|
|
6640
|
+
function Rs(t) {
|
|
6607
6641
|
return /\\documentclass\b/.test(t) || /\\begin *\{document\}/.test(t);
|
|
6608
6642
|
}
|
|
6609
|
-
const
|
|
6610
|
-
function
|
|
6611
|
-
const n =
|
|
6643
|
+
const Cs = /<(pretext|book|article)\b/;
|
|
6644
|
+
function Os(t, r) {
|
|
6645
|
+
const n = Ss(t), i = n ? [n, ...t.targets.filter((s) => s !== n)] : t.targets, e = /* @__PURE__ */ new Set(), a = [];
|
|
6612
6646
|
for (const s of i) {
|
|
6613
6647
|
const o = kt(t.projectRoot, s.source);
|
|
6614
6648
|
e.has(o) || !(o in r) || (e.add(o), a.push({
|
|
6615
6649
|
path: o,
|
|
6616
6650
|
format: "pretext",
|
|
6617
6651
|
reason: "manifest-target",
|
|
6618
|
-
title:
|
|
6652
|
+
title: Qr(r[o]),
|
|
6619
6653
|
targetName: s.name,
|
|
6620
6654
|
targetFormat: s.format
|
|
6621
6655
|
}));
|
|
6622
6656
|
}
|
|
6623
6657
|
return a;
|
|
6624
6658
|
}
|
|
6625
|
-
function
|
|
6626
|
-
const r =
|
|
6659
|
+
function zs(t) {
|
|
6660
|
+
const r = nn(t, /* @__PURE__ */ new Set(["tex", "ltx"])), n = Ya(r), i = Object.keys(r).filter((c) => !n.has(c) && Rs(r[c])).sort(), e = (c) => {
|
|
6627
6661
|
let l = 0;
|
|
6628
6662
|
const f = r[c].match(/\\(input|include) *\{[^{}]+\}/g) ?? [];
|
|
6629
6663
|
for (const p of f) {
|
|
6630
6664
|
const g = /\{([^{}]+)\}/.exec(p)?.[1];
|
|
6631
|
-
g &&
|
|
6665
|
+
g && Qe(g, c, r) && (l += 1);
|
|
6632
6666
|
}
|
|
6633
6667
|
return l;
|
|
6634
6668
|
}, a = (c) => {
|
|
6635
|
-
const l =
|
|
6636
|
-
return l >= 0 ? l :
|
|
6669
|
+
const l = vr.indexOf(se(c).toLowerCase());
|
|
6670
|
+
return l >= 0 ? l : vr.length;
|
|
6637
6671
|
}, o = [...i].sort((c, l) => {
|
|
6638
6672
|
const f = +!/\\documentclass\b/.test(r[c]) - +!/\\documentclass\b/.test(r[l]);
|
|
6639
6673
|
if (f !== 0) return f;
|
|
@@ -6645,41 +6679,41 @@ function Ts(t) {
|
|
|
6645
6679
|
path: c,
|
|
6646
6680
|
format: "latex",
|
|
6647
6681
|
reason: "latex-root",
|
|
6648
|
-
title:
|
|
6682
|
+
title: wr(r[c])
|
|
6649
6683
|
}));
|
|
6650
6684
|
return o.length > 0 ? o : Object.keys(r).sort().map((c) => ({
|
|
6651
6685
|
path: c,
|
|
6652
6686
|
format: "latex",
|
|
6653
6687
|
reason: "fallback",
|
|
6654
|
-
title:
|
|
6688
|
+
title: wr(r[c])
|
|
6655
6689
|
}));
|
|
6656
6690
|
}
|
|
6657
|
-
function
|
|
6658
|
-
const r =
|
|
6691
|
+
function $s(t) {
|
|
6692
|
+
const r = nn(t, Es), n = Object.keys(r).sort(), i = (s) => Is.has(se(s).toLowerCase()), e = ["main", "index", "book", "article"], a = (s) => i(s) ? 2 : e.indexOf(se(s).toLowerCase()) >= 0 ? 0 : 1;
|
|
6659
6693
|
return [...n].sort((s, o) => a(s) - a(o) || s.localeCompare(o)).map((s) => ({
|
|
6660
6694
|
path: s,
|
|
6661
6695
|
format: "markdown",
|
|
6662
6696
|
reason: "markdown-root",
|
|
6663
|
-
title:
|
|
6697
|
+
title: Ts(r[s])
|
|
6664
6698
|
}));
|
|
6665
6699
|
}
|
|
6666
|
-
function
|
|
6667
|
-
const r =
|
|
6700
|
+
function Ls(t) {
|
|
6701
|
+
const r = nn(t, As), n = Qa(r);
|
|
6668
6702
|
return Object.keys(r).filter(
|
|
6669
|
-
(e) => !n.has(e) &&
|
|
6703
|
+
(e) => !n.has(e) && Cs.test(r[e]) && yt(e).toLowerCase() !== "project.ptx" && yt(e).toLowerCase() !== "publication.ptx"
|
|
6670
6704
|
).sort().map((e) => ({
|
|
6671
6705
|
path: e,
|
|
6672
6706
|
format: "pretext",
|
|
6673
6707
|
reason: "pretext-root",
|
|
6674
|
-
title:
|
|
6708
|
+
title: Qr(r[e])
|
|
6675
6709
|
}));
|
|
6676
6710
|
}
|
|
6677
|
-
function
|
|
6678
|
-
const n =
|
|
6679
|
-
...n ?
|
|
6680
|
-
...
|
|
6681
|
-
|
|
6682
|
-
...
|
|
6711
|
+
function Ds(t, r = {}) {
|
|
6712
|
+
const n = ks(t), i = [
|
|
6713
|
+
...n ? Os(n, t) : [],
|
|
6714
|
+
...zs(t),
|
|
6715
|
+
...$s(t),
|
|
6716
|
+
...Ls(t)
|
|
6683
6717
|
], e = [], a = /* @__PURE__ */ new Set();
|
|
6684
6718
|
for (const p of i)
|
|
6685
6719
|
a.has(p.path) || (a.add(p.path), e.push(p));
|
|
@@ -6691,7 +6725,7 @@ function Os(t, r = {}) {
|
|
|
6691
6725
|
const p = r.mainFile;
|
|
6692
6726
|
c = s.find((g) => g.path === p) ?? e.find((g) => g.path === p) ?? (p in t ? {
|
|
6693
6727
|
path: p,
|
|
6694
|
-
format: r.sourceFormat ??
|
|
6728
|
+
format: r.sourceFormat ?? ve(t[p]),
|
|
6695
6729
|
reason: "fallback"
|
|
6696
6730
|
} : c);
|
|
6697
6731
|
}
|
|
@@ -6699,7 +6733,7 @@ function Os(t, r = {}) {
|
|
|
6699
6733
|
const p = Object.keys(t).sort()[0];
|
|
6700
6734
|
c = p ? {
|
|
6701
6735
|
path: p,
|
|
6702
|
-
format: r.sourceFormat ??
|
|
6736
|
+
format: r.sourceFormat ?? ve(t[p]),
|
|
6703
6737
|
reason: "fallback"
|
|
6704
6738
|
} : null;
|
|
6705
6739
|
}
|
|
@@ -6708,11 +6742,11 @@ function Os(t, r = {}) {
|
|
|
6708
6742
|
) : [];
|
|
6709
6743
|
return { manifest: n, candidates: s, formats: o, primary: c, extraRoots: f };
|
|
6710
6744
|
}
|
|
6711
|
-
const
|
|
6712
|
-
function
|
|
6745
|
+
const _r = "\\begin{document}", Ps = "\\end{document}", js = /\\documentclass\s*(?:\[[^\]]*\])?\s*\{(book|report|memoir|scrbook|scrreprt|amsbook)\}/;
|
|
6746
|
+
function ti(t) {
|
|
6713
6747
|
return se(t).replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase()) || "Untitled";
|
|
6714
6748
|
}
|
|
6715
|
-
function
|
|
6749
|
+
function Ue(t, r) {
|
|
6716
6750
|
return {
|
|
6717
6751
|
action: "anomaly",
|
|
6718
6752
|
severity: "info",
|
|
@@ -6723,19 +6757,19 @@ function Be(t, r) {
|
|
|
6723
6757
|
message: r
|
|
6724
6758
|
};
|
|
6725
6759
|
}
|
|
6726
|
-
function
|
|
6760
|
+
function Fs(t) {
|
|
6727
6761
|
const { preamble: r, body: n } = Bt(t);
|
|
6728
|
-
return
|
|
6762
|
+
return js.test(r) || /\\chapter\b/.test(n) ? "chapter" : "section";
|
|
6729
6763
|
}
|
|
6730
|
-
function
|
|
6764
|
+
function qs(t, r) {
|
|
6731
6765
|
const n = t.replace(/^\s*(%[^\n]*\n\s*)*/, "");
|
|
6732
6766
|
return r === "chapter" ? /^\\(chapter|part)\b/.test(n) : /^\\(section|chapter|part)\b/.test(n);
|
|
6733
6767
|
}
|
|
6734
|
-
function
|
|
6768
|
+
function Bs(t, r, n) {
|
|
6735
6769
|
const i = r.filter((w) => w.include !== !1);
|
|
6736
6770
|
if (i.length === 0)
|
|
6737
6771
|
return { source: t, attached: [], warnings: [] };
|
|
6738
|
-
const e = t.includes(
|
|
6772
|
+
const e = t.includes(_r), { preamble: a, body: s } = Bt(t), o = Fs(t), c = [], l = [], f = [], p = [];
|
|
6739
6773
|
for (const w of i) {
|
|
6740
6774
|
const h = n[w.path];
|
|
6741
6775
|
if (h === void 0) {
|
|
@@ -6750,25 +6784,25 @@ function Ps(t, r, n) {
|
|
|
6750
6784
|
});
|
|
6751
6785
|
continue;
|
|
6752
6786
|
}
|
|
6753
|
-
const v = w.level ?? o, b = w.title || ae(h, "title") ||
|
|
6787
|
+
const v = w.level ?? o, b = w.title || ae(h, "title") || ti(w.path), x = {
|
|
6754
6788
|
path: w.path,
|
|
6755
6789
|
title: b,
|
|
6756
6790
|
level: v
|
|
6757
|
-
}, S = Bt(h), { macros: I, warnings: A } =
|
|
6791
|
+
}, S = Bt(h), { macros: I, warnings: A } = Cr(S.preamble);
|
|
6758
6792
|
I && f.push(I), l.push(...A);
|
|
6759
6793
|
const P = S.body.trim();
|
|
6760
6794
|
if (!P) {
|
|
6761
6795
|
l.push(
|
|
6762
|
-
|
|
6796
|
+
Ue(x, `\`${w.path}\` is empty; skipped.`)
|
|
6763
6797
|
);
|
|
6764
6798
|
continue;
|
|
6765
6799
|
}
|
|
6766
6800
|
p.push(
|
|
6767
|
-
|
|
6801
|
+
qs(P, v) ? P : `\\${v}{${b}}
|
|
6768
6802
|
|
|
6769
6803
|
${P}`
|
|
6770
6804
|
), c.push(x), l.push(
|
|
6771
|
-
|
|
6805
|
+
Ue(
|
|
6772
6806
|
x,
|
|
6773
6807
|
`Attached \`${w.path}\` as a ${v}: “${b}”.`
|
|
6774
6808
|
)
|
|
@@ -6782,9 +6816,9 @@ ${P}`
|
|
|
6782
6816
|
return e ? { source: [
|
|
6783
6817
|
[a, ...f].filter(Boolean).join(`
|
|
6784
6818
|
`),
|
|
6785
|
-
|
|
6819
|
+
_r,
|
|
6786
6820
|
g,
|
|
6787
|
-
|
|
6821
|
+
Ps
|
|
6788
6822
|
].join(`
|
|
6789
6823
|
`), attached: c, warnings: l } : {
|
|
6790
6824
|
source: [a, ...f, g].filter(Boolean).join(`
|
|
@@ -6794,7 +6828,7 @@ ${P}`
|
|
|
6794
6828
|
warnings: l
|
|
6795
6829
|
};
|
|
6796
6830
|
}
|
|
6797
|
-
function
|
|
6831
|
+
function Ns(t, r, n) {
|
|
6798
6832
|
const i = r.filter((o) => o.include !== !1), e = [], a = [], s = [];
|
|
6799
6833
|
for (const o of i) {
|
|
6800
6834
|
const c = n[o.path];
|
|
@@ -6813,7 +6847,7 @@ function js(t, r, n) {
|
|
|
6813
6847
|
const l = c.trim();
|
|
6814
6848
|
if (!l)
|
|
6815
6849
|
continue;
|
|
6816
|
-
const f = /^#\s+(.+)$/m.exec(l), p = o.title || f?.[1]?.trim() ||
|
|
6850
|
+
const f = /^#\s+(.+)$/m.exec(l), p = o.title || f?.[1]?.trim() || ti(o.path), g = {
|
|
6817
6851
|
path: o.path,
|
|
6818
6852
|
title: p,
|
|
6819
6853
|
level: o.level ?? "chapter"
|
|
@@ -6821,7 +6855,7 @@ function js(t, r, n) {
|
|
|
6821
6855
|
s.push(l.startsWith("# ") ? l : `# ${p}
|
|
6822
6856
|
|
|
6823
6857
|
${l}`), e.push(g), a.push(
|
|
6824
|
-
|
|
6858
|
+
Ue(g, `Attached \`${o.path}\`: “${p}”.`)
|
|
6825
6859
|
);
|
|
6826
6860
|
}
|
|
6827
6861
|
return s.length === 0 ? { source: t, attached: e, warnings: a } : {
|
|
@@ -6832,7 +6866,7 @@ ${l}`), e.push(g), a.push(
|
|
|
6832
6866
|
warnings: a
|
|
6833
6867
|
};
|
|
6834
6868
|
}
|
|
6835
|
-
const
|
|
6869
|
+
const Us = [
|
|
6836
6870
|
"output",
|
|
6837
6871
|
".git",
|
|
6838
6872
|
".github/workflows/.cache",
|
|
@@ -6842,13 +6876,13 @@ const Fs = [
|
|
|
6842
6876
|
".venv",
|
|
6843
6877
|
"__MACOSX"
|
|
6844
6878
|
];
|
|
6845
|
-
function
|
|
6879
|
+
function Ms(t, r) {
|
|
6846
6880
|
const n = t.toLowerCase();
|
|
6847
|
-
return [...
|
|
6881
|
+
return [...Us, ...r].some(
|
|
6848
6882
|
(i) => i.length > 0 && n.startsWith(`${i.toLowerCase()}/`)
|
|
6849
6883
|
);
|
|
6850
6884
|
}
|
|
6851
|
-
function
|
|
6885
|
+
function Ws(t) {
|
|
6852
6886
|
const { manifest: r, files: n, assets: i } = t, e = r.projectRoot, a = new Set(t.consumedPaths), s = [
|
|
6853
6887
|
...new Set(
|
|
6854
6888
|
r.targets.map((l) => l.outputDir?.split("/")[0]).filter((l) => !!l)
|
|
@@ -6856,9 +6890,9 @@ function Bs(t) {
|
|
|
6856
6890
|
], o = { files: {}, assets: {}, skipped: [] }, c = (l, f) => {
|
|
6857
6891
|
if (e && !l.startsWith(`${e}/`))
|
|
6858
6892
|
return;
|
|
6859
|
-
const p =
|
|
6893
|
+
const p = Ha(e, l);
|
|
6860
6894
|
if (!(a.has(l) || l === r.manifestPath)) {
|
|
6861
|
-
if (
|
|
6895
|
+
if (Ms(p, s)) {
|
|
6862
6896
|
o.skipped.push(p);
|
|
6863
6897
|
return;
|
|
6864
6898
|
}
|
|
@@ -6875,7 +6909,7 @@ function Bs(t) {
|
|
|
6875
6909
|
});
|
|
6876
6910
|
return o;
|
|
6877
6911
|
}
|
|
6878
|
-
function
|
|
6912
|
+
function Zs(t, r, n) {
|
|
6879
6913
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
6880
6914
|
<project ptx-version="2">
|
|
6881
6915
|
<targets>
|
|
@@ -6896,12 +6930,12 @@ ${t.targets.map((e) => {
|
|
|
6896
6930
|
</project>
|
|
6897
6931
|
`;
|
|
6898
6932
|
}
|
|
6899
|
-
const
|
|
6900
|
-
function
|
|
6933
|
+
const ei = "external";
|
|
6934
|
+
function Xs(t, r, n) {
|
|
6901
6935
|
const i = r.replace(/\/+$/, "");
|
|
6902
6936
|
return i ? `${t}${i}/${n}` : `${t}${n}`;
|
|
6903
6937
|
}
|
|
6904
|
-
function
|
|
6938
|
+
function Vs(t, r, n = ei) {
|
|
6905
6939
|
const i = {}, e = {}, a = /* @__PURE__ */ new Set();
|
|
6906
6940
|
for (const s of t) {
|
|
6907
6941
|
const o = yt(s);
|
|
@@ -6913,18 +6947,18 @@ function Ms(t, r, n = Qr) {
|
|
|
6913
6947
|
g += 1;
|
|
6914
6948
|
c = `${f}-${g}${p}`;
|
|
6915
6949
|
}
|
|
6916
|
-
a.add(c), i[s] =
|
|
6950
|
+
a.add(c), i[s] = Xs(r, n, c), o in e || (e[o] = c);
|
|
6917
6951
|
}
|
|
6918
6952
|
return { pathByOriginal: i, sourceByBaseName: e };
|
|
6919
6953
|
}
|
|
6920
|
-
const
|
|
6921
|
-
`(<(?:${
|
|
6954
|
+
const Gs = ["image", "video", "audio"], Hs = new RegExp(
|
|
6955
|
+
`(<(?:${Gs.join("|")})\\b[^>]*?\\bsource\\s*=\\s*)(["'])([^"']*)\\2`,
|
|
6922
6956
|
"g"
|
|
6923
6957
|
);
|
|
6924
|
-
function
|
|
6958
|
+
function Ys(t, r) {
|
|
6925
6959
|
const n = [], i = [];
|
|
6926
6960
|
return { source: t.replace(
|
|
6927
|
-
|
|
6961
|
+
Hs,
|
|
6928
6962
|
(a, s, o, c) => {
|
|
6929
6963
|
if (c === "" || /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(c))
|
|
6930
6964
|
return a;
|
|
@@ -6933,28 +6967,28 @@ function Xs(t, r) {
|
|
|
6933
6967
|
}
|
|
6934
6968
|
), rewritten: n, unresolved: i };
|
|
6935
6969
|
}
|
|
6936
|
-
function
|
|
6937
|
-
const r =
|
|
6970
|
+
function Js(t) {
|
|
6971
|
+
const r = ft(t, "pretext"), n = r ? r.inner : t, i = fe(n);
|
|
6938
6972
|
return i ? i.inner : n;
|
|
6939
6973
|
}
|
|
6940
|
-
function
|
|
6974
|
+
function Co(t) {
|
|
6941
6975
|
function r(n, i) {
|
|
6942
|
-
return
|
|
6976
|
+
return Et(n, zt).map(
|
|
6943
6977
|
(e, a) => {
|
|
6944
6978
|
const s = i ? `${i}.${a}` : String(a);
|
|
6945
6979
|
return {
|
|
6946
6980
|
path: s,
|
|
6947
6981
|
tag: e.name,
|
|
6948
|
-
title:
|
|
6982
|
+
title: Je(e.inner),
|
|
6949
6983
|
xmlId: e.attributes["xml:id"],
|
|
6950
6984
|
children: r(e.inner, s)
|
|
6951
6985
|
};
|
|
6952
6986
|
}
|
|
6953
6987
|
);
|
|
6954
6988
|
}
|
|
6955
|
-
return r(
|
|
6989
|
+
return r(Js(t), "");
|
|
6956
6990
|
}
|
|
6957
|
-
function
|
|
6991
|
+
function Ks(t, r) {
|
|
6958
6992
|
if (r.has(t))
|
|
6959
6993
|
return !0;
|
|
6960
6994
|
for (const n of r)
|
|
@@ -6962,16 +6996,16 @@ function Gs(t, r) {
|
|
|
6962
6996
|
return !0;
|
|
6963
6997
|
return !1;
|
|
6964
6998
|
}
|
|
6965
|
-
function
|
|
6999
|
+
function ni(t, r) {
|
|
6966
7000
|
if (!r || r.length === 0)
|
|
6967
7001
|
return { source: t, removed: [] };
|
|
6968
7002
|
const n = new Set(r), i = [];
|
|
6969
7003
|
function e(p, g, d) {
|
|
6970
7004
|
const w = [];
|
|
6971
|
-
return
|
|
7005
|
+
return Et(p, zt).forEach(
|
|
6972
7006
|
(h, v) => {
|
|
6973
7007
|
const b = g ? `${g}.${v}` : String(v);
|
|
6974
|
-
if (!
|
|
7008
|
+
if (!Ks(b, n)) {
|
|
6975
7009
|
i.push(b), w.push({
|
|
6976
7010
|
start: d + h.start,
|
|
6977
7011
|
end: d + h.end,
|
|
@@ -6985,13 +7019,13 @@ function ti(t, r) {
|
|
|
6985
7019
|
}
|
|
6986
7020
|
), w;
|
|
6987
7021
|
}
|
|
6988
|
-
const a =
|
|
7022
|
+
const a = ft(t, "pretext"), s = a ? a.inner : t, o = a ? a.startTagEnd : 0, c = fe(s), l = o + (c ? c.startTagEnd : 0), f = c ? c.inner : s;
|
|
6989
7023
|
return {
|
|
6990
7024
|
source: Wt(t, e(f, "", l)),
|
|
6991
7025
|
removed: i
|
|
6992
7026
|
};
|
|
6993
7027
|
}
|
|
6994
|
-
const
|
|
7028
|
+
const Qs = /\.(tex|zip|md|markdown|ptx|xml|tar\.gz|tgz)$/i, to = [
|
|
6995
7029
|
"tex",
|
|
6996
7030
|
"md",
|
|
6997
7031
|
"markdown",
|
|
@@ -7005,7 +7039,7 @@ const Hs = /\.(tex|zip|md|markdown|ptx|xml|tar\.gz|tgz)$/i, Ys = [
|
|
|
7005
7039
|
"png",
|
|
7006
7040
|
"ps",
|
|
7007
7041
|
"bbl"
|
|
7008
|
-
],
|
|
7042
|
+
], eo = /* @__PURE__ */ new Set([
|
|
7009
7043
|
"png",
|
|
7010
7044
|
"jpg",
|
|
7011
7045
|
"jpeg",
|
|
@@ -7018,7 +7052,7 @@ const Hs = /\.(tex|zip|md|markdown|ptx|xml|tar\.gz|tgz)$/i, Ys = [
|
|
|
7018
7052
|
"tif",
|
|
7019
7053
|
"webp",
|
|
7020
7054
|
"ico"
|
|
7021
|
-
]),
|
|
7055
|
+
]), no = /* @__PURE__ */ new Set([
|
|
7022
7056
|
"png",
|
|
7023
7057
|
"jpg",
|
|
7024
7058
|
"jpeg",
|
|
@@ -7033,27 +7067,27 @@ const Hs = /\.(tex|zip|md|markdown|ptx|xml|tar\.gz|tgz)$/i, Ys = [
|
|
|
7033
7067
|
"eps",
|
|
7034
7068
|
"ps"
|
|
7035
7069
|
]);
|
|
7036
|
-
function
|
|
7037
|
-
return
|
|
7070
|
+
function ri(t) {
|
|
7071
|
+
return eo.has(t.toLowerCase());
|
|
7038
7072
|
}
|
|
7039
|
-
function
|
|
7040
|
-
return
|
|
7073
|
+
function ro(t) {
|
|
7074
|
+
return no.has(St(yt(t)));
|
|
7041
7075
|
}
|
|
7042
|
-
function
|
|
7076
|
+
function io(t) {
|
|
7043
7077
|
const r = yt(t);
|
|
7044
7078
|
return St(r) === "bib" ? `source/${r}` : null;
|
|
7045
7079
|
}
|
|
7046
|
-
function
|
|
7080
|
+
function At(t) {
|
|
7047
7081
|
return t.replace(/\r\n?/g, `
|
|
7048
7082
|
`).replace(/(\n *){3,}/g, `
|
|
7049
7083
|
|
|
7050
7084
|
`);
|
|
7051
7085
|
}
|
|
7052
|
-
function
|
|
7086
|
+
function ao(t) {
|
|
7053
7087
|
const r = t.toLowerCase();
|
|
7054
7088
|
return r.endsWith(".tar.gz") || r.endsWith(".tgz") ? "tar.gz" : r.endsWith(".zip") ? "zip" : r.endsWith(".tex") ? "tex" : r.endsWith(".md") || r.endsWith(".markdown") ? "markdown" : r.endsWith(".ptx") || r.endsWith(".xml") ? "pretext" : null;
|
|
7055
7089
|
}
|
|
7056
|
-
function
|
|
7090
|
+
function so(t) {
|
|
7057
7091
|
const r = (n, i) => new TextDecoder().decode(t.slice(n, i)).split("\0")[0];
|
|
7058
7092
|
return {
|
|
7059
7093
|
name: r(0, 100),
|
|
@@ -7061,7 +7095,7 @@ function no(t) {
|
|
|
7061
7095
|
type: r(156, 157)
|
|
7062
7096
|
};
|
|
7063
7097
|
}
|
|
7064
|
-
async function
|
|
7098
|
+
async function oo(t) {
|
|
7065
7099
|
if (typeof DecompressionStream > "u")
|
|
7066
7100
|
throw new Error("This runtime does not support gzip decompression.");
|
|
7067
7101
|
const i = new ReadableStream({
|
|
@@ -7083,30 +7117,30 @@ async function ro(t) {
|
|
|
7083
7117
|
s.set(c, o), o += c.length;
|
|
7084
7118
|
return s.buffer;
|
|
7085
7119
|
}
|
|
7086
|
-
function
|
|
7120
|
+
function co(t) {
|
|
7087
7121
|
const r = {}, n = {};
|
|
7088
7122
|
let i = 0;
|
|
7089
7123
|
for (; i < t.length && !(i + 512 > t.length); ) {
|
|
7090
|
-
const e = t.slice(i, i + 512), a =
|
|
7124
|
+
const e = t.slice(i, i + 512), a = so(e);
|
|
7091
7125
|
if (!a.name)
|
|
7092
7126
|
break;
|
|
7093
7127
|
i += 512;
|
|
7094
7128
|
const s = a.size, o = Math.ceil(s / 512) * 512;
|
|
7095
7129
|
if (a.type === "0" || a.type === "") {
|
|
7096
7130
|
const c = t.slice(i, i + s), l = mt(a.name);
|
|
7097
|
-
if (
|
|
7131
|
+
if (ri(St(l)))
|
|
7098
7132
|
n[l] = c;
|
|
7099
7133
|
else {
|
|
7100
7134
|
const f = new TextDecoder().decode(c);
|
|
7101
|
-
r[l] =
|
|
7135
|
+
r[l] = At(f);
|
|
7102
7136
|
}
|
|
7103
7137
|
}
|
|
7104
7138
|
i += o;
|
|
7105
7139
|
}
|
|
7106
7140
|
return { files: r, assets: n };
|
|
7107
7141
|
}
|
|
7108
|
-
async function
|
|
7109
|
-
const r =
|
|
7142
|
+
async function lo(t) {
|
|
7143
|
+
const r = ao(t.name);
|
|
7110
7144
|
if (!r)
|
|
7111
7145
|
throw new Error(
|
|
7112
7146
|
"File format not supported: please upload .tex, .md, .ptx, .xml, .zip, or .tar.gz."
|
|
@@ -7114,31 +7148,31 @@ async function ao(t) {
|
|
|
7114
7148
|
if (r === "tex" || r === "markdown" || r === "pretext") {
|
|
7115
7149
|
const e = await t.text();
|
|
7116
7150
|
return {
|
|
7117
|
-
files: { [mt(t.name)]:
|
|
7151
|
+
files: { [mt(t.name)]: At(e) },
|
|
7118
7152
|
assets: {}
|
|
7119
7153
|
};
|
|
7120
7154
|
}
|
|
7121
7155
|
if (r === "zip") {
|
|
7122
|
-
const a = await new
|
|
7156
|
+
const a = await new Ba().loadAsync(t), s = {}, o = {};
|
|
7123
7157
|
for (const [c, l] of Object.entries(a.files)) {
|
|
7124
7158
|
if (l.dir)
|
|
7125
7159
|
continue;
|
|
7126
7160
|
const f = mt(c);
|
|
7127
|
-
if (
|
|
7161
|
+
if (ri(St(f)))
|
|
7128
7162
|
o[f] = await l.async("uint8array");
|
|
7129
7163
|
else {
|
|
7130
7164
|
const p = await l.async("string");
|
|
7131
|
-
s[f] =
|
|
7165
|
+
s[f] = At(p);
|
|
7132
7166
|
}
|
|
7133
7167
|
}
|
|
7134
7168
|
return { files: s, assets: o };
|
|
7135
7169
|
}
|
|
7136
|
-
const n = await t.arrayBuffer(), i = await
|
|
7137
|
-
return
|
|
7170
|
+
const n = await t.arrayBuffer(), i = await oo(n);
|
|
7171
|
+
return co(new Uint8Array(i));
|
|
7138
7172
|
}
|
|
7139
|
-
function
|
|
7173
|
+
function uo(t) {
|
|
7140
7174
|
const r = { other: 0 };
|
|
7141
|
-
for (const n of
|
|
7175
|
+
for (const n of to)
|
|
7142
7176
|
r[n] = 0;
|
|
7143
7177
|
for (const n of Object.keys(t)) {
|
|
7144
7178
|
const i = St(n);
|
|
@@ -7146,51 +7180,51 @@ function so(t) {
|
|
|
7146
7180
|
}
|
|
7147
7181
|
return r;
|
|
7148
7182
|
}
|
|
7149
|
-
function
|
|
7150
|
-
const n =
|
|
7183
|
+
function fo(t, r) {
|
|
7184
|
+
const n = uo(r);
|
|
7151
7185
|
t.push({ type: "success", message: "File types:" });
|
|
7152
7186
|
for (const i of Object.keys(n).sort())
|
|
7153
7187
|
n[i] && t.push({ type: "success", message: `${i}: ${n[i]}` });
|
|
7154
7188
|
}
|
|
7155
|
-
function
|
|
7189
|
+
function ho(t) {
|
|
7156
7190
|
return t === "latex" ? "tex" : t === "markdown" ? "markdown" : "pretext";
|
|
7157
7191
|
}
|
|
7158
|
-
function
|
|
7192
|
+
function po(t, r) {
|
|
7159
7193
|
return t.targets.find(
|
|
7160
7194
|
(n) => n.source === r
|
|
7161
7195
|
);
|
|
7162
7196
|
}
|
|
7163
|
-
function
|
|
7197
|
+
function mo(t, r) {
|
|
7164
7198
|
return t === !1 ? [] : Array.isArray(t) ? t.filter((n) => n.include !== !1) : r.extraRoots.map((n) => ({ path: n.path }));
|
|
7165
7199
|
}
|
|
7166
|
-
function
|
|
7200
|
+
function go(t) {
|
|
7167
7201
|
if (t.reason === "manifest-target") {
|
|
7168
7202
|
const r = t.targetName ? ` (target \`${t.targetName}\`)` : "";
|
|
7169
7203
|
return `Main source file: ${t.path}${r}`;
|
|
7170
7204
|
}
|
|
7171
7205
|
return `Main source file: ${t.path}`;
|
|
7172
7206
|
}
|
|
7173
|
-
function
|
|
7174
|
-
const n = [], i = r.destination ??
|
|
7207
|
+
function bo(t, r = {}) {
|
|
7208
|
+
const n = [], i = r.destination ?? us;
|
|
7175
7209
|
let e = [];
|
|
7176
7210
|
try {
|
|
7177
7211
|
const a = Object.fromEntries(
|
|
7178
7212
|
Object.entries(t).map(([Q, Y]) => [
|
|
7179
7213
|
mt(Q),
|
|
7180
|
-
|
|
7214
|
+
At(Y)
|
|
7181
7215
|
])
|
|
7182
7216
|
), s = Object.keys(a).length;
|
|
7183
7217
|
n.push({
|
|
7184
7218
|
type: "success",
|
|
7185
7219
|
message: `Found ${s} file${s === 1 ? "" : "s"}.`
|
|
7186
|
-
}),
|
|
7187
|
-
const o =
|
|
7220
|
+
}), fo(n, a);
|
|
7221
|
+
const o = Ds(a, {
|
|
7188
7222
|
sourceFormat: r.sourceFormat,
|
|
7189
7223
|
mainFile: r.mainFile ? mt(r.mainFile) : void 0
|
|
7190
7224
|
}), c = o.primary;
|
|
7191
7225
|
if (!c)
|
|
7192
7226
|
throw new Error("No files were found in the uploaded source.");
|
|
7193
|
-
const l = c.path, f =
|
|
7227
|
+
const l = c.path, f = ho(c.format);
|
|
7194
7228
|
let p = a[l] ?? "";
|
|
7195
7229
|
const g = /* @__PURE__ */ new Set([l]);
|
|
7196
7230
|
if (o.manifest) {
|
|
@@ -7200,7 +7234,7 @@ function ho(t, r = {}) {
|
|
|
7200
7234
|
message: `Found ${o.manifest.manifestPath} with ${Q} target${Q === 1 ? "" : "s"}: ${o.manifest.targets.map((Y) => Y.name).join(", ")}.`
|
|
7201
7235
|
});
|
|
7202
7236
|
}
|
|
7203
|
-
const d =
|
|
7237
|
+
const d = mo(r.attachRoots, o);
|
|
7204
7238
|
let w = [];
|
|
7205
7239
|
const h = [], v = [];
|
|
7206
7240
|
if (c.format === "latex") {
|
|
@@ -7208,8 +7242,8 @@ function ho(t, r = {}) {
|
|
|
7208
7242
|
Object.entries(a).filter(
|
|
7209
7243
|
([rt]) => St(rt) === "tex"
|
|
7210
7244
|
)
|
|
7211
|
-
), Y =
|
|
7212
|
-
if (p =
|
|
7245
|
+
), Y = hr(p, l, Q);
|
|
7246
|
+
if (p = At(Y.expandedText), Y.consumedPaths.forEach((rt) => g.add(rt)), Y.expandedCount > 0 && n.push({
|
|
7213
7247
|
type: "success",
|
|
7214
7248
|
message: `Expanded ${Y.expandedCount} input/include reference${Y.expandedCount === 1 ? "" : "s"}.`
|
|
7215
7249
|
}), Y.missingInputs.length > 0 && n.push({
|
|
@@ -7221,7 +7255,7 @@ function ho(t, r = {}) {
|
|
|
7221
7255
|
const pt = a[st.path];
|
|
7222
7256
|
if (pt === void 0)
|
|
7223
7257
|
continue;
|
|
7224
|
-
const ht =
|
|
7258
|
+
const ht = hr(
|
|
7225
7259
|
pt,
|
|
7226
7260
|
st.path,
|
|
7227
7261
|
Q
|
|
@@ -7230,17 +7264,17 @@ function ho(t, r = {}) {
|
|
|
7230
7264
|
(u) => g.add(u)
|
|
7231
7265
|
), g.add(st.path);
|
|
7232
7266
|
}
|
|
7233
|
-
const ct =
|
|
7234
|
-
p =
|
|
7267
|
+
const ct = Bs(p, d, rt);
|
|
7268
|
+
p = At(ct.source), w = ct.attached, h.push(...ct.warnings);
|
|
7235
7269
|
}
|
|
7236
7270
|
} else if (c.format === "markdown") {
|
|
7237
7271
|
if (d.length > 0) {
|
|
7238
|
-
const Q =
|
|
7272
|
+
const Q = Ns(
|
|
7239
7273
|
p,
|
|
7240
7274
|
d,
|
|
7241
7275
|
a
|
|
7242
7276
|
);
|
|
7243
|
-
p =
|
|
7277
|
+
p = At(Q.source), w = Q.attached, h.push(...Q.warnings), w.forEach((Y) => g.add(Y.path));
|
|
7244
7278
|
}
|
|
7245
7279
|
} else {
|
|
7246
7280
|
const Q = Object.fromEntries(
|
|
@@ -7248,7 +7282,7 @@ function ho(t, r = {}) {
|
|
|
7248
7282
|
const ct = St(rt);
|
|
7249
7283
|
return ct === "ptx" || ct === "xml";
|
|
7250
7284
|
})
|
|
7251
|
-
), Y =
|
|
7285
|
+
), Y = Ka(p, l, Q);
|
|
7252
7286
|
p = Y.expandedText, Y.consumedPaths.forEach((rt) => g.add(rt)), Y.expandedCount > 0 && n.push({
|
|
7253
7287
|
type: "success",
|
|
7254
7288
|
message: `Expanded ${Y.expandedCount} xi:include reference${Y.expandedCount === 1 ? "" : "s"}.`
|
|
@@ -7266,13 +7300,13 @@ function ho(t, r = {}) {
|
|
|
7266
7300
|
message: `Missing xi:include targets: ${Y.missingIncludes.join(", ")}. This content is missing from the import.`
|
|
7267
7301
|
}));
|
|
7268
7302
|
}
|
|
7269
|
-
n.push({ type: "success", message:
|
|
7303
|
+
n.push({ type: "success", message: go(c) });
|
|
7270
7304
|
for (const Q of w)
|
|
7271
7305
|
n.push({
|
|
7272
7306
|
type: "success",
|
|
7273
7307
|
message: `Attached ${Q.path} as a ${Q.level}: ${Q.title}`
|
|
7274
7308
|
});
|
|
7275
|
-
const b =
|
|
7309
|
+
const b = Pa(
|
|
7276
7310
|
p,
|
|
7277
7311
|
c.format,
|
|
7278
7312
|
r.documentKind
|
|
@@ -7291,7 +7325,7 @@ function ho(t, r = {}) {
|
|
|
7291
7325
|
buildLayout: x = !0,
|
|
7292
7326
|
assets: S = {},
|
|
7293
7327
|
...I
|
|
7294
|
-
} = r, A = o.manifest, P = A && c.reason === "manifest-target" ?
|
|
7328
|
+
} = r, A = o.manifest, P = A && c.reason === "manifest-target" ? po(
|
|
7295
7329
|
A,
|
|
7296
7330
|
c.path.slice(
|
|
7297
7331
|
A.projectRoot ? A.projectRoot.length + 1 : 0
|
|
@@ -7301,10 +7335,10 @@ function ho(t, r = {}) {
|
|
|
7301
7335
|
publicationPath: I.publicationPath ?? (L && P?.publication ? P.publication : "publication/publication.ptx"),
|
|
7302
7336
|
projectFilePath: I.projectFilePath ?? "project.ptx",
|
|
7303
7337
|
preserved: L
|
|
7304
|
-
}, $ = {}, W = {}, J = {}, k = r.externalDir ??
|
|
7338
|
+
}, $ = {}, W = {}, J = {}, k = r.externalDir ?? ei;
|
|
7305
7339
|
let D;
|
|
7306
7340
|
if (L && A && P) {
|
|
7307
|
-
const Q =
|
|
7341
|
+
const Q = Ws({
|
|
7308
7342
|
manifest: A,
|
|
7309
7343
|
target: P,
|
|
7310
7344
|
files: a,
|
|
@@ -7322,9 +7356,9 @@ function ho(t, r = {}) {
|
|
|
7322
7356
|
message: `Skipped build output: ${Q.skipped.length} file${Q.skipped.length === 1 ? "" : "s"}.`
|
|
7323
7357
|
});
|
|
7324
7358
|
} else {
|
|
7325
|
-
D =
|
|
7326
|
-
Object.keys(S).filter(
|
|
7327
|
-
|
|
7359
|
+
D = Vs(
|
|
7360
|
+
Object.keys(S).filter(ro),
|
|
7361
|
+
wo(B.mainSourcePath),
|
|
7328
7362
|
k
|
|
7329
7363
|
);
|
|
7330
7364
|
for (const [Q, Y] of Object.entries(
|
|
@@ -7332,26 +7366,26 @@ function ho(t, r = {}) {
|
|
|
7332
7366
|
))
|
|
7333
7367
|
$[Y] = S[Q], W[Q] = S[Q];
|
|
7334
7368
|
}
|
|
7335
|
-
const m = I.documentKind ??
|
|
7369
|
+
const m = I.documentKind ?? Dr(b.pretextSource), F = D ? Ys(b.pretextSource, D.sourceByBaseName) : void 0, it = F?.source ?? b.pretextSource, U = ni(it, r.selection), nt = i.kind === "insert" ? Kr(U.source, i, {
|
|
7336
7370
|
hasSelection: (r.selection?.length ?? 0) > 0
|
|
7337
7371
|
}) : void 0, M = nt?.source ?? U.source, et = [
|
|
7338
|
-
...
|
|
7372
|
+
...ii(U),
|
|
7339
7373
|
...nt?.warnings ?? []
|
|
7340
7374
|
], O = x ? Math.max(
|
|
7341
|
-
|
|
7375
|
+
vo(I, {
|
|
7342
7376
|
format: b.sourceFormat,
|
|
7343
7377
|
latexSource: b.cleanedNativeSource,
|
|
7344
7378
|
documentKind: m
|
|
7345
7379
|
}),
|
|
7346
|
-
|
|
7347
|
-
) : 0, C =
|
|
7380
|
+
Jr(nt?.unwrapRoot ?? !1)
|
|
7381
|
+
) : 0, C = Mr(M, {
|
|
7348
7382
|
documentKind: m,
|
|
7349
7383
|
splitLevel: O,
|
|
7350
7384
|
assets: W,
|
|
7351
7385
|
takenIds: i.kind === "insert" ? i.takenIds : void 0
|
|
7352
7386
|
});
|
|
7353
7387
|
if (x) {
|
|
7354
|
-
const Q =
|
|
7388
|
+
const Q = Gr(C.project, i, {
|
|
7355
7389
|
layout: {
|
|
7356
7390
|
mainSourcePath: B.mainSourcePath,
|
|
7357
7391
|
publicationPath: B.publicationPath,
|
|
@@ -7362,28 +7396,28 @@ function ho(t, r = {}) {
|
|
|
7362
7396
|
},
|
|
7363
7397
|
unwrapRoot: nt?.unwrapRoot
|
|
7364
7398
|
});
|
|
7365
|
-
e = Q.includes, Object.assign(J, Q.files), i.kind === "project" && L && A && P && (J[B.projectFilePath] =
|
|
7399
|
+
e = Q.includes, Object.assign(J, Q.files), i.kind === "project" && L && A && P && (J[B.projectFilePath] = Zs(A, P, {
|
|
7366
7400
|
mainSource: B.mainSourcePath,
|
|
7367
7401
|
publication: B.publicationPath
|
|
7368
|
-
}), B.publicationPath in J || (J[B.publicationPath] =
|
|
7402
|
+
}), B.publicationPath in J || (J[B.publicationPath] = Er()));
|
|
7369
7403
|
} else
|
|
7370
7404
|
J["source/main.ptx"] = b.pretextSource;
|
|
7371
7405
|
for (const [Q, Y] of Object.entries(a)) {
|
|
7372
|
-
const rt =
|
|
7406
|
+
const rt = io(Q);
|
|
7373
7407
|
rt && !(rt in J) && (J[rt] = Y);
|
|
7374
7408
|
}
|
|
7375
7409
|
const K = C.project.documentKind, G = [
|
|
7376
7410
|
...b.warnings,
|
|
7377
7411
|
...h,
|
|
7378
7412
|
...v,
|
|
7379
|
-
...
|
|
7413
|
+
..._o(F),
|
|
7380
7414
|
...et,
|
|
7381
7415
|
...C.warnings
|
|
7382
7416
|
];
|
|
7383
|
-
let V,
|
|
7417
|
+
let V, lt;
|
|
7384
7418
|
return b.cleanedNativeSource !== void 0 && b.cleanedNativeSource.length > 0 && (b.sourceFormat === "latex" || b.sourceFormat === "markdown") && (V = {
|
|
7385
7419
|
[b.sourceFormat === "latex" ? "source/main.tex" : "source/main.md"]: b.cleanedNativeSource
|
|
7386
|
-
},
|
|
7420
|
+
}, lt = Wr(
|
|
7387
7421
|
b.cleanedNativeSource,
|
|
7388
7422
|
b.sourceFormat,
|
|
7389
7423
|
{
|
|
@@ -7420,7 +7454,7 @@ function ho(t, r = {}) {
|
|
|
7420
7454
|
attachedRoots: w,
|
|
7421
7455
|
projectLayout: B,
|
|
7422
7456
|
project: C.project,
|
|
7423
|
-
nativeProject:
|
|
7457
|
+
nativeProject: lt,
|
|
7424
7458
|
files: a,
|
|
7425
7459
|
assets: S,
|
|
7426
7460
|
outputFiles: J,
|
|
@@ -7440,9 +7474,9 @@ function ho(t, r = {}) {
|
|
|
7440
7474
|
};
|
|
7441
7475
|
}
|
|
7442
7476
|
}
|
|
7443
|
-
async function
|
|
7477
|
+
async function Oo(t, r = {}) {
|
|
7444
7478
|
const n = [], i = mt(t.name);
|
|
7445
|
-
if (!
|
|
7479
|
+
if (!Qs.test(i.toLowerCase()))
|
|
7446
7480
|
return {
|
|
7447
7481
|
pretextError: "File format not supported: please upload .tex, .md, .ptx, .xml, .zip, or .tar.gz.",
|
|
7448
7482
|
statusMessages: [
|
|
@@ -7458,7 +7492,7 @@ async function To(t, r = {}) {
|
|
|
7458
7492
|
message: `Processing ${i}...`
|
|
7459
7493
|
});
|
|
7460
7494
|
try {
|
|
7461
|
-
const { files: e, assets: a } = await
|
|
7495
|
+
const { files: e, assets: a } = await lo(t), s = bo(e, { ...r, assets: a });
|
|
7462
7496
|
return {
|
|
7463
7497
|
...s,
|
|
7464
7498
|
statusMessages: [...n, ...s.statusMessages]
|
|
@@ -7472,17 +7506,17 @@ async function To(t, r = {}) {
|
|
|
7472
7506
|
};
|
|
7473
7507
|
}
|
|
7474
7508
|
}
|
|
7475
|
-
function
|
|
7476
|
-
return t.splitLevel !== void 0 ? Math.max(0, t.splitLevel) : t.splitChapters === !1 || r.documentKind === "slideshow" ? 0 : t.splitSections ? r.documentKind === "book" ? 2 : 1 : t.splitChapters ? 1 : r.format === "latex" && r.latexSource ?
|
|
7509
|
+
function vo(t, r) {
|
|
7510
|
+
return t.splitLevel !== void 0 ? Math.max(0, t.splitLevel) : t.splitChapters === !1 || r.documentKind === "slideshow" ? 0 : t.splitSections ? r.documentKind === "book" ? 2 : 1 : t.splitChapters ? 1 : r.format === "latex" && r.latexSource ? ga(
|
|
7477
7511
|
r.latexSource,
|
|
7478
7512
|
r.documentKind ?? (r.latexSource.includes("\\chapter") ? "book" : "article")
|
|
7479
7513
|
) : r.documentKind === "book" ? 1 : 0;
|
|
7480
7514
|
}
|
|
7481
|
-
function
|
|
7515
|
+
function wo(t) {
|
|
7482
7516
|
const r = t.lastIndexOf("/");
|
|
7483
7517
|
return r < 0 ? "" : t.slice(0, r + 1);
|
|
7484
7518
|
}
|
|
7485
|
-
function
|
|
7519
|
+
function _o(t) {
|
|
7486
7520
|
if (!t || t.unresolved.length === 0)
|
|
7487
7521
|
return [];
|
|
7488
7522
|
const r = [...new Set(t.unresolved)];
|
|
@@ -7498,7 +7532,7 @@ function go(t) {
|
|
|
7498
7532
|
}
|
|
7499
7533
|
];
|
|
7500
7534
|
}
|
|
7501
|
-
function
|
|
7535
|
+
function ii(t) {
|
|
7502
7536
|
return t.removed.length === 0 ? [] : [
|
|
7503
7537
|
{
|
|
7504
7538
|
action: "delete",
|
|
@@ -7511,16 +7545,16 @@ function ni(t) {
|
|
|
7511
7545
|
}
|
|
7512
7546
|
];
|
|
7513
7547
|
}
|
|
7514
|
-
function
|
|
7515
|
-
const n = r.targetTag !== void 0 && t.destination.kind === "insert" ? { ...t.destination, targetTag: r.targetTag } : t.destination, i = r.selection ?? t.selection, e =
|
|
7548
|
+
function rn(t, r = {}) {
|
|
7549
|
+
const n = r.targetTag !== void 0 && t.destination.kind === "insert" ? { ...t.destination, targetTag: r.targetTag } : t.destination, i = r.selection ?? t.selection, e = ni(t.pretextSource, i), a = n.kind === "insert" ? Kr(e.source, n, {
|
|
7516
7550
|
hasSelection: (i?.length ?? 0) > 0
|
|
7517
7551
|
}) : void 0, s = Math.max(
|
|
7518
|
-
|
|
7552
|
+
Jr(a?.unwrapRoot ?? !1),
|
|
7519
7553
|
r.splitLevel ?? t.splitLevel
|
|
7520
7554
|
), o = t.destination.kind !== "insert" || n.kind !== "insert" || n.targetTag === t.destination.targetTag, c = (i ?? []).join(" ") === (t.selection ?? []).join(" ");
|
|
7521
7555
|
if (s === t.splitLevel && o && c)
|
|
7522
7556
|
return t;
|
|
7523
|
-
const l =
|
|
7557
|
+
const l = Mr(a?.source ?? e.source, {
|
|
7524
7558
|
documentKind: t.documentKind,
|
|
7525
7559
|
splitLevel: s,
|
|
7526
7560
|
assets: t.assets,
|
|
@@ -7528,8 +7562,8 @@ function en(t, r = {}) {
|
|
|
7528
7562
|
}), f = {};
|
|
7529
7563
|
if (n.kind === "project")
|
|
7530
7564
|
for (const [v, b] of Object.entries(t.outputFiles))
|
|
7531
|
-
|
|
7532
|
-
const p =
|
|
7565
|
+
yo(v, t.projectLayout.mainSourcePath) || (f[v] = b);
|
|
7566
|
+
const p = Gr(l.project, n, {
|
|
7533
7567
|
layout: {
|
|
7534
7568
|
mainSourcePath: t.projectLayout.mainSourcePath,
|
|
7535
7569
|
publicationPath: t.projectLayout.publicationPath,
|
|
@@ -7540,7 +7574,7 @@ function en(t, r = {}) {
|
|
|
7540
7574
|
});
|
|
7541
7575
|
Object.assign(f, p.files);
|
|
7542
7576
|
let g = t.nativeProject;
|
|
7543
|
-
t.cleanedNativeSource && (t.sourceFormat === "latex" || t.sourceFormat === "markdown") && (g =
|
|
7577
|
+
t.cleanedNativeSource && (t.sourceFormat === "latex" || t.sourceFormat === "markdown") && (g = Wr(
|
|
7544
7578
|
t.cleanedNativeSource,
|
|
7545
7579
|
t.sourceFormat,
|
|
7546
7580
|
{
|
|
@@ -7552,7 +7586,7 @@ function en(t, r = {}) {
|
|
|
7552
7586
|
}
|
|
7553
7587
|
).project);
|
|
7554
7588
|
const d = [
|
|
7555
|
-
...
|
|
7589
|
+
...ii(e),
|
|
7556
7590
|
...a?.warnings ?? []
|
|
7557
7591
|
], w = new Set(t.rebuiltWarnings), h = [
|
|
7558
7592
|
...t.warnings.filter((v) => !w.has(v)),
|
|
@@ -7577,97 +7611,97 @@ function en(t, r = {}) {
|
|
|
7577
7611
|
} : t.insert
|
|
7578
7612
|
};
|
|
7579
7613
|
}
|
|
7580
|
-
function
|
|
7581
|
-
return
|
|
7614
|
+
function zo(t, r) {
|
|
7615
|
+
return rn(t, { selection: r });
|
|
7582
7616
|
}
|
|
7583
|
-
function
|
|
7584
|
-
return
|
|
7617
|
+
function $o(t, r) {
|
|
7618
|
+
return rn(t, { splitLevel: r });
|
|
7585
7619
|
}
|
|
7586
|
-
function
|
|
7587
|
-
return
|
|
7620
|
+
function Lo(t, r) {
|
|
7621
|
+
return rn(t, { targetTag: r });
|
|
7588
7622
|
}
|
|
7589
|
-
function
|
|
7623
|
+
function yo(t, r) {
|
|
7590
7624
|
if (t === r) return !0;
|
|
7591
7625
|
const n = r.includes("/") ? r.slice(0, r.lastIndexOf("/") + 1) : "";
|
|
7592
7626
|
return t.startsWith(n) && t.endsWith(".ptx");
|
|
7593
7627
|
}
|
|
7594
7628
|
export {
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7629
|
+
Ut as $,
|
|
7630
|
+
Io as A,
|
|
7631
|
+
_a as B,
|
|
7632
|
+
Ni as C,
|
|
7633
|
+
Nt as D,
|
|
7634
|
+
Me as E,
|
|
7635
|
+
$a as F,
|
|
7636
|
+
La as G,
|
|
7637
|
+
Pa as H,
|
|
7638
|
+
ps as I,
|
|
7639
|
+
Fs as J,
|
|
7640
|
+
Ss as K,
|
|
7641
|
+
zr as L,
|
|
7642
|
+
fi as M,
|
|
7643
|
+
ve as N,
|
|
7610
7644
|
le as O,
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7645
|
+
Ua as P,
|
|
7646
|
+
Pe as Q,
|
|
7647
|
+
Ka as R,
|
|
7648
|
+
Ye as S,
|
|
7615
7649
|
Ft as T,
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7650
|
+
Xe as U,
|
|
7651
|
+
ks as V,
|
|
7652
|
+
Rr as W,
|
|
7653
|
+
Da as X,
|
|
7654
|
+
Eo as Y,
|
|
7655
|
+
Oo as Z,
|
|
7622
7656
|
zt as _,
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7657
|
+
Er as a,
|
|
7658
|
+
Ve as a0,
|
|
7659
|
+
Ao as a1,
|
|
7660
|
+
To as a2,
|
|
7661
|
+
Ge as a3,
|
|
7662
|
+
Co as a4,
|
|
7663
|
+
Ir as a5,
|
|
7664
|
+
xs as a6,
|
|
7665
|
+
Kr as a7,
|
|
7666
|
+
ni as a8,
|
|
7667
|
+
rn as a9,
|
|
7668
|
+
$o as aa,
|
|
7669
|
+
Zs as ab,
|
|
7670
|
+
zo as ac,
|
|
7671
|
+
vo as ad,
|
|
7672
|
+
Fr as ae,
|
|
7673
|
+
Ro as af,
|
|
7674
|
+
Hr as ag,
|
|
7675
|
+
Lo as ah,
|
|
7642
7676
|
Zt as ai,
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7677
|
+
Gr as aj,
|
|
7678
|
+
ls as ak,
|
|
7679
|
+
ss as al,
|
|
7680
|
+
Va as am,
|
|
7681
|
+
ga as an,
|
|
7648
7682
|
It as b,
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7683
|
+
$r as c,
|
|
7684
|
+
Dr as d,
|
|
7685
|
+
Le as e,
|
|
7686
|
+
Et as f,
|
|
7687
|
+
Ze as g,
|
|
7688
|
+
lo as h,
|
|
7689
|
+
cs as i,
|
|
7690
|
+
Ds as j,
|
|
7691
|
+
bo as k,
|
|
7692
|
+
Ar as l,
|
|
7693
|
+
di as m,
|
|
7694
|
+
ma as n,
|
|
7695
|
+
Na as o,
|
|
7662
7696
|
ue as p,
|
|
7663
|
-
|
|
7664
|
-
|
|
7697
|
+
us as q,
|
|
7698
|
+
sa as r,
|
|
7665
7699
|
Wt as s,
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7700
|
+
Qi as t,
|
|
7701
|
+
Bs as u,
|
|
7702
|
+
Ns as v,
|
|
7703
|
+
De as w,
|
|
7704
|
+
Mr as x,
|
|
7705
|
+
Wr as y,
|
|
7706
|
+
Ws as z
|
|
7673
7707
|
};
|