text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("highlight.js")}catch(t){}}()):"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.stacksEditor=e(function(){try{return require("highlight.js")}catch(t){}}()):t.stacksEditor=e(t.hljs)}(self,(function(t){return(()=>{var e={4007:t=>{"use strict";t.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ﬃ","fflig":"ﬀ","ffllig":"ﬄ","Ffr":"𝔉","ffr":"𝔣","filig":"ﬁ","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"ﬂ","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"Ĳ","ijlig":"ĳ","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ŉ","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},8337:(t,e,n)=>{"use strict";function r(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t}function o(t){return Object.prototype.toString.call(t)}function i(t){return"[object Function]"===o(t)}function s(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},c={"http:":{validate:function(t,e,n){var r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},l="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(t){var e=t.re=n(6066)(t.__opts__),r=t.__tlds__.slice();function a(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(a(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(a(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(a(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(a(e.tpl_host_fuzzy_test),"i");var c=[];function l(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach((function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,"[object Object]"===o(n))return"[object RegExp]"!==o(n.validate)?i(n.validate)?r.validate=n.validate:l(e,n):r.validate=function(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(i(n.normalize)?r.normalize=n.normalize:n.normalize?l(e,n):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===o(t)}(n)?l(e,n):c.push(e)}})),c.forEach((function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)})),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var u=Object.keys(t.__compiled__).filter((function(e){return e.length>0&&t.__compiled__[e]})).map(s).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><｜]|"+e.src_ZPCc+"))("+u+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><｜]|"+e.src_ZPCc+"))("+u+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function p(t,e){var n=t.__index__,r=t.__last_index__,o=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=o,this.text=o,this.url=o}function h(t,e){var n=new p(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function d(t,e){if(!(this instanceof d))return new d(t,e);var n;e||(n=t,Object.keys(n||{}).reduce((function(t,e){return t||a.hasOwnProperty(e)}),!1)&&(e=t,t={})),this.__opts__=r({},a,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,t),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},u(this)}d.prototype.add=function(t,e){return this.__schemas__[t]=e,u(this),this},d.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},d.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,o,i,s,a,c;if(this.re.schema_test.test(t))for((a=this.re.schema_search).lastIndex=0;null!==(e=a.exec(t));)if(o=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c<this.__index__)&&null!==(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(i=n.index+n[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__="",this.__index__=i,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==(r=t.match(this.re.email_fuzzy))&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s)),this.__index__>=0},d.prototype.pretest=function(t){return this.re.pretest.test(t)},d.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},d.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(h(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)n.push(h(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter((function(t,e,n){return t!==n[e-1]})).reverse(),u(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,u(this),this)},d.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},d.prototype.onCompile=function(){},t.exports=d},6066:(t,e,n)=>{"use strict";t.exports=function(t){var e={};return e.src_Any=n(9369).source,e.src_Cc=n(9413).source,e.src_Z=n(5045).source,e.src_P=n(3189).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|"),e.src_pseudo_letter="(?:(?![><｜]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><｜]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><｜]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><｜]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|"+e.src_ZPCc+"))((?![$+<=>^`|｜])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|"+e.src_ZPCc+"))((?![$+<=>^`|｜])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},9980:(t,e,n)=>{"use strict";t.exports=n(7024)},6233:(t,e,n)=>{"use strict";t.exports=n(4007)},813:t=>{"use strict";t.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},1947:t=>{"use strict";var e="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+e+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),o=new RegExp("^(?:"+e+"|"+n+")");t.exports.n=r,t.exports.q=o},7022:(t,e,n)=>{"use strict";var r=Object.prototype.hasOwnProperty;function o(t,e){return r.call(t,e)}function i(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||65535==(65535&t)||65534==(65535&t)||t>=0&&t<=8||11===t||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=n(6233),p=/[&<>"]/,h=/[&<>"]/g,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function f(t){return d[t]}var m=/[.?*+^$[\]\\(){}|-]/g,g=n(3189);e.lib={},e.lib.mdurl=n(8765),e.lib.ucmicro=n(4205),e.assign=function(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(n){t[n]=e[n]}))}})),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=o,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(a,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,(function(t,e,n){return e||function(t,e){var n=0;return o(u,e)?u[e]:35===e.charCodeAt(0)&&l.test(e)&&i(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)}))},e.isValidEntityCode=i,e.fromCodePoint=s,e.escapeHtml=function(t){return p.test(t)?t.replace(h,f):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}},1685:(t,e,n)=>{"use strict";e.parseLinkLabel=n(3595),e.parseLinkDestination=n(2548),e.parseLinkTitle=n(8040)},2548:(t,e,n)=>{"use strict";var r=n(7022).unescapeAll;t.exports=function(t,e,n){var o,i,s=e,a={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){for(e++;e<n;){if(10===(o=t.charCodeAt(e)))return a;if(62===o)return a.pos=e+1,a.str=r(t.slice(s+1,e)),a.ok=!0,a;92===o&&e+1<n?e+=2:e++}return a}for(i=0;e<n&&32!==(o=t.charCodeAt(e))&&!(o<32||127===o);)if(92===o&&e+1<n)e+=2;else{if(40===o&&i++,41===o){if(0===i)break;i--}e++}return s===e||0!==i||(a.str=r(t.slice(s,e)),a.lines=0,a.pos=e,a.ok=!0),a}},3595:t=>{"use strict";t.exports=function(t,e,n){var r,o,i,s,a=-1,c=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<c;){if(93===(i=t.src.charCodeAt(t.pos))&&0==--r){o=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===i)if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}return o&&(a=t.pos),t.pos=l,a}},8040:(t,e,n)=>{"use strict";var r=n(7022).unescapeAll;t.exports=function(t,e,n){var o,i,s=0,a=e,c={ok:!1,pos:0,lines:0,str:""};if(e>=n)return c;if(34!==(i=t.charCodeAt(e))&&39!==i&&40!==i)return c;for(e++,40===i&&(i=41);e<n;){if((o=t.charCodeAt(e))===i)return c.pos=e+1,c.lines=s,c.str=r(t.slice(a+1,e)),c.ok=!0,c;10===o?s++:92===o&&e+1<n&&(e++,10===t.charCodeAt(e)&&s++),e++}return c}},7024:(t,e,n)=>{"use strict";var r=n(7022),o=n(1685),i=n(7529),s=n(7346),a=n(2471),c=n(4485),l=n(8337),u=n(8765),p=n(3689),h={default:n(4218),zero:n(873),commonmark:n(6895)},d=/^(vbscript|javascript|file|data):/,f=/^data:image\/(gif|png|jpeg|webp);/;function m(t){var e=t.trim().toLowerCase();return!d.test(e)||!!f.test(e)}var g=["http:","https:","mailto:"];function v(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=p.toASCII(e.hostname)}catch(t){}return u.encode(u.format(e))}function y(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=p.toUnicode(e.hostname)}catch(t){}return u.decode(u.format(e))}function b(t,e){if(!(this instanceof b))return new b(t,e);e||r.isString(t)||(e=t||{},t="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new i,this.linkify=new l,this.validateLink=m,this.normalizeLink=v,this.normalizeLinkText=y,this.utils=r,this.helpers=r.assign({},o),this.options={},this.configure(t),e&&this.set(e)}b.prototype.set=function(t){return r.assign(this.options,t),this},b.prototype.configure=function(t){var e,n=this;if(r.isString(t)&&!(t=h[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach((function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)})),this},b.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.enable(t,!0))}),this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.disable(t,!0))}),this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},b.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},b.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},b.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=b},2471:(t,e,n)=>{"use strict";var r=n(9580),o=[["table",n(1785),["paragraph","reference"]],["code",n(8768)],["fence",n(3542),["paragraph","reference","blockquote","list"]],["blockquote",n(5258),["paragraph","reference","blockquote","list"]],["hr",n(5634),["paragraph","reference","blockquote","list"]],["list",n(8532),["paragraph","reference","blockquote"]],["reference",n(3804)],["heading",n(1630),["paragraph","reference","blockquote"]],["lheading",n(6850)],["html_block",n(6329),["paragraph","reference","blockquote"]],["paragraph",n(6864)]];function i(){this.ruler=new r;for(var t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1],{alt:(o[t][2]||[]).slice()})}i.prototype.tokenize=function(t,e,n){for(var r,o=this.ruler.getRules(""),i=o.length,s=e,a=!1,c=t.md.options.maxNesting;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=c){t.line=n;break}for(r=0;r<i&&!o[r](t,s,n,!1);r++);t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(s=t.line)<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},i.prototype.parse=function(t,e,n,r){var o;t&&(o=new this.State(t,e,n,r),this.tokenize(o,o.line,o.lineMax))},i.prototype.State=n(2948),t.exports=i},7346:(t,e,n)=>{"use strict";var r=n(9580),o=[["normalize",n(4129)],["block",n(898)],["inline",n(9827)],["linkify",n(7830)],["replacements",n(2834)],["smartquotes",n(8450)]];function i(){this.ruler=new r;for(var t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1])}i.prototype.process=function(t){var e,n,r;for(e=0,n=(r=this.ruler.getRules("")).length;e<n;e++)r[e](t)},i.prototype.State=n(6480),t.exports=i},4485:(t,e,n)=>{"use strict";var r=n(9580),o=[["text",n(9941)],["newline",n(3905)],["escape",n(1917)],["backticks",n(9755)],["strikethrough",n(4814).w],["emphasis",n(7894).w],["link",n(1727)],["image",n(3006)],["autolink",n(3420)],["html_inline",n(1779)],["entity",n(9391)]],i=[["balance_pairs",n(9354)],["strikethrough",n(4814).g],["emphasis",n(7894).g],["text_collapse",n(8996)]];function s(){var t;for(this.ruler=new r,t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1]);for(this.ruler2=new r,t=0;t<i.length;t++)this.ruler2.push(i[t][0],i[t][1])}s.prototype.skipToken=function(t){var e,n,r=t.pos,o=this.ruler.getRules(""),i=o.length,s=t.md.options.maxNesting,a=t.cache;if(void 0===a[r]){if(t.level<s)for(n=0;n<i&&(t.level++,e=o[n](t,!0),t.level--,!e);n++);else t.pos=t.posMax;e||t.pos++,a[r]=t.pos}else t.pos=a[r]},s.prototype.tokenize=function(t){for(var e,n,r=this.ruler.getRules(""),o=r.length,i=t.posMax,s=t.md.options.maxNesting;t.pos<i;){if(t.level<s)for(n=0;n<o&&!(e=r[n](t,!1));n++);if(e){if(t.pos>=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,r){var o,i,s,a=new this.State(t,e,n,r);for(this.tokenize(a),s=(i=this.ruler2.getRules("")).length,o=0;o<s;o++)i[o](a)},s.prototype.State=n(670),t.exports=s},6895:t=>{"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},4218:t=>{"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},873:t=>{"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},7529:(t,e,n)=>{"use strict";var r=n(7022).assign,o=n(7022).unescapeAll,i=n(7022).escapeHtml,s={};function a(){this.rules=r({},s)}s.code_inline=function(t,e,n,r,o){var s=t[e];return"<code"+o.renderAttrs(s)+">"+i(t[e].content)+"</code>"},s.code_block=function(t,e,n,r,o){var s=t[e];return"<pre"+o.renderAttrs(s)+"><code>"+i(t[e].content)+"</code></pre>\n"},s.fence=function(t,e,n,r,s){var a,c,l,u,p=t[e],h=p.info?o(p.info).trim():"",d="";return h&&(d=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(p.content,d)||i(p.content)).indexOf("<pre")?a+"\n":h?(c=p.attrIndex("class"),l=p.attrs?p.attrs.slice():[],c<0?l.push(["class",n.langPrefix+d]):l[c][1]+=" "+n.langPrefix+d,u={attrs:l},"<pre><code"+s.renderAttrs(u)+">"+a+"</code></pre>\n"):"<pre><code"+s.renderAttrs(p)+">"+a+"</code></pre>\n"},s.image=function(t,e,n,r,o){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(t,e,n)},s.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(t,e){return i(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},a.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+i(t.attrs[e][0])+'="'+i(t.attrs[e][1])+'"';return r},a.prototype.renderToken=function(t,e,n){var r,o="",i=!1,s=t[e];return s.hidden?"":(s.block&&-1!==s.nesting&&e&&t[e-1].hidden&&(o+="\n"),o+=(-1===s.nesting?"</":"<")+s.tag,o+=this.renderAttrs(s),0===s.nesting&&n.xhtmlOut&&(o+=" /"),s.block&&(i=!0,1===s.nesting&&e+1<t.length&&("inline"===(r=t[e+1]).type||r.hidden||-1===r.nesting&&r.tag===s.tag)&&(i=!1)),o+=i?">\n":">")},a.prototype.renderInline=function(t,e,n){for(var r,o="",i=this.rules,s=0,a=t.length;s<a;s++)void 0!==i[r=t[s].type]?o+=i[r](t,s,e,n,this):o+=this.renderToken(t,s,e);return o},a.prototype.renderInlineAsText=function(t,e,n){for(var r="",o=0,i=t.length;o<i;o++)"text"===t[o].type?r+=t[o].content:"image"===t[o].type&&(r+=this.renderInlineAsText(t[o].children,e,n));return r},a.prototype.render=function(t,e,n){var r,o,i,s="",a=this.rules;for(r=0,o=t.length;r<o;r++)"inline"===(i=t[r].type)?s+=this.renderInline(t[r].children,e,n):void 0!==a[i]?s+=a[t[r].type](t,r,e,n,this):s+=this.renderToken(t,r,e,n);return s},t.exports=a},9580:t=>{"use strict";function e(){this.__rules__=[],this.__cache__=null}e.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},e.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))}))}))},e.prototype.at=function(t,e,n){var r=this.__find__(t),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=o.alt||[],this.__cache__=null},e.prototype.before=function(t,e,n,r){var o=this.__find__(t),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},e.prototype.after=function(t,e,n,r){var o=this.__find__(t),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},e.prototype.push=function(t,e,n){var r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},e.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!0,n.push(t)}),this),this.__cache__=null,n},e.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach((function(t){t.enabled=!1})),this.enable(t,e)},e.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!1,n.push(t)}),this),this.__cache__=null,n},e.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=e},5258:(t,e,n)=>{"use strict";var r=n(7022).isSpace;t.exports=function(t,e,n,o){var i,s,a,c,l,u,p,h,d,f,m,g,v,y,b,k,w,x,_,C,S=t.lineMax,M=t.bMarks[e]+t.tShift[e],A=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(M++))return!1;if(o)return!0;for(c=d=t.sCount[e]+M-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(M)?(M++,c++,d++,i=!1,k=!0):9===t.src.charCodeAt(M)?(k=!0,(t.bsCount[e]+d)%4==3?(M++,c++,d++,i=!1):i=!0):k=!1,f=[t.bMarks[e]],t.bMarks[e]=M;M<A&&(s=t.src.charCodeAt(M),r(s));)9===s?d+=4-(d+t.bsCount[e]+(i?1:0))%4:d++,M++;for(m=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(k?1:0),u=M>=A,y=[t.sCount[e]],t.sCount[e]=d-c,b=[t.tShift[e]],t.tShift[e]=M-t.bMarks[e],x=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",C=!1,h=e+1;h<n&&(t.sCount[h]<t.blkIndent&&(C=!0),!((M=t.bMarks[h]+t.tShift[h])>=(A=t.eMarks[h])));h++)if(62!==t.src.charCodeAt(M++)||C){if(u)break;for(w=!1,a=0,l=x.length;a<l;a++)if(x[a](t,h,n,!0)){w=!0;break}if(w){t.lineMax=h,0!==t.blkIndent&&(f.push(t.bMarks[h]),m.push(t.bsCount[h]),b.push(t.tShift[h]),y.push(t.sCount[h]),t.sCount[h]-=t.blkIndent);break}f.push(t.bMarks[h]),m.push(t.bsCount[h]),b.push(t.tShift[h]),y.push(t.sCount[h]),t.sCount[h]=-1}else{for(c=d=t.sCount[h]+M-(t.bMarks[h]+t.tShift[h]),32===t.src.charCodeAt(M)?(M++,c++,d++,i=!1,k=!0):9===t.src.charCodeAt(M)?(k=!0,(t.bsCount[h]+d)%4==3?(M++,c++,d++,i=!1):i=!0):k=!1,f.push(t.bMarks[h]),t.bMarks[h]=M;M<A&&(s=t.src.charCodeAt(M),r(s));)9===s?d+=4-(d+t.bsCount[h]+(i?1:0))%4:d++,M++;u=M>=A,m.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(k?1:0),y.push(t.sCount[h]),t.sCount[h]=d-c,b.push(t.tShift[h]),t.tShift[h]=M-t.bMarks[h]}for(g=t.blkIndent,t.blkIndent=0,(_=t.push("blockquote_open","blockquote",1)).markup=">",_.map=p=[e,0],t.md.block.tokenize(t,e,h),(_=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=S,t.parentType=v,p[1]=t.line,a=0;a<b.length;a++)t.bMarks[a+e]=f[a],t.tShift[a+e]=b[a],t.sCount[a+e]=y[a],t.bsCount[a+e]=m[a];return t.blkIndent=g,!0}},8768:t=>{"use strict";t.exports=function(t,e,n){var r,o,i;if(t.sCount[e]-t.blkIndent<4)return!1;for(o=r=e+1;r<n;)if(t.isEmpty(r))r++;else{if(!(t.sCount[r]-t.blkIndent>=4))break;o=++r}return t.line=o,(i=t.push("code_block","code",0)).content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},3542:t=>{"use strict";t.exports=function(t,e,n,r){var o,i,s,a,c,l,u,p=!1,h=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>d)return!1;if(126!==(o=t.src.charCodeAt(h))&&96!==o)return!1;if(c=h,(i=(h=t.skipChars(h,o))-c)<3)return!1;if(u=t.src.slice(c,h),s=t.src.slice(h,d),96===o&&s.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;for(a=e;!(++a>=n||(h=c=t.bMarks[a]+t.tShift[a])<(d=t.eMarks[a])&&t.sCount[a]<t.blkIndent);)if(t.src.charCodeAt(h)===o&&!(t.sCount[a]-t.blkIndent>=4||(h=t.skipChars(h,o))-c<i||(h=t.skipSpaces(h))<d)){p=!0;break}return i=t.sCount[e],t.line=a+(p?1:0),(l=t.push("fence","code",0)).info=s,l.content=t.getLines(e+1,a,i,!0),l.markup=u,l.map=[e,t.line],!0}},1630:(t,e,n)=>{"use strict";var r=n(7022).isSpace;t.exports=function(t,e,n,o){var i,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(35!==(i=t.src.charCodeAt(l))||l>=u)return!1;for(s=1,i=t.src.charCodeAt(++l);35===i&&l<u&&s<=6;)s++,i=t.src.charCodeAt(++l);return!(s>6||l<u&&!r(i)||(o||(u=t.skipSpacesBack(u,l),(a=t.skipCharsBack(u,35,l))>l&&r(t.src.charCodeAt(a-1))&&(u=a),t.line=e+1,(c=t.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(l,u).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s)),0))}},5634:(t,e,n)=>{"use strict";var r=n(7022).isSpace;t.exports=function(t,e,n,o){var i,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(42!==(i=t.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(s=1;l<u;){if((a=t.src.charCodeAt(l++))!==i&&!r(a))return!1;a===i&&s++}return!(s<3||(o||(t.line=e+1,(c=t.push("hr","hr",0)).map=[e,t.line],c.markup=Array(s+1).join(String.fromCharCode(i))),0))}},6329:(t,e,n)=>{"use strict";var r=n(813),o=n(1947).q,i=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(o.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var o,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(l))return!1;for(c=t.src.slice(l,u),o=0;o<i.length&&!i[o][0].test(c);o++);if(o===i.length)return!1;if(r)return i[o][2];if(s=e+1,!i[o][1].test(c))for(;s<n&&!(t.sCount[s]<t.blkIndent);s++)if(l=t.bMarks[s]+t.tShift[s],u=t.eMarks[s],c=t.src.slice(l,u),i[o][1].test(c)){0!==c.length&&s++;break}return t.line=s,(a=t.push("html_block","",0)).map=[e,s],a.content=t.getLines(e,s,t.blkIndent,!0),!0}},6850:t=>{"use strict";t.exports=function(t,e,n){var r,o,i,s,a,c,l,u,p,h,d=e+1,f=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";d<n&&!t.isEmpty(d);d++)if(!(t.sCount[d]-t.blkIndent>3)){if(t.sCount[d]>=t.blkIndent&&(c=t.bMarks[d]+t.tShift[d])<(l=t.eMarks[d])&&(45===(p=t.src.charCodeAt(c))||61===p)&&(c=t.skipChars(c,p),(c=t.skipSpaces(c))>=l)){u=61===p?1:2;break}if(!(t.sCount[d]<0)){for(o=!1,i=0,s=f.length;i<s;i++)if(f[i](t,d,n,!0)){o=!0;break}if(o)break}}return!!u&&(r=t.getLines(e,d,t.blkIndent,!1).trim(),t.line=d+1,(a=t.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(p),a.map=[e,t.line],(a=t.push("inline","",0)).content=r,a.map=[e,t.line-1],a.children=[],(a=t.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(p),t.parentType=h,!0)}},8532:(t,e,n)=>{"use strict";var r=n(7022).isSpace;function o(t,e){var n,o,i,s;return o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],42!==(n=t.src.charCodeAt(o++))&&45!==n&&43!==n||o<i&&(s=t.src.charCodeAt(o),!r(s))?-1:o}function i(t,e){var n,o=t.bMarks[e]+t.tShift[e],i=o,s=t.eMarks[e];if(i+1>=s)return-1;if((n=t.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=s)return-1;if(!((n=t.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-o>=10)return-1}return i<s&&(n=t.src.charCodeAt(i),!r(n))?-1:i}t.exports=function(t,e,n,r){var s,a,c,l,u,p,h,d,f,m,g,v,y,b,k,w,x,_,C,S,M,A,D,O,E,T,N,I,L=!1,z=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(t.listIndent>=0&&t.sCount[e]-t.listIndent>=4&&t.sCount[e]<t.blkIndent)return!1;if(r&&"paragraph"===t.parentType&&t.tShift[e]>=t.blkIndent&&(L=!0),(D=i(t,e))>=0){if(h=!0,E=t.bMarks[e]+t.tShift[e],y=Number(t.src.substr(E,D-E-1)),L&&1!==y)return!1}else{if(!((D=o(t,e))>=0))return!1;h=!1}if(L&&t.skipSpaces(D)>=t.eMarks[e])return!1;if(v=t.src.charCodeAt(D-1),r)return!0;for(g=t.tokens.length,h?(I=t.push("ordered_list_open","ol",1),1!==y&&(I.attrs=[["start",y]])):I=t.push("bullet_list_open","ul",1),I.map=m=[e,0],I.markup=String.fromCharCode(v),k=e,O=!1,N=t.md.block.ruler.getRules("list"),_=t.parentType,t.parentType="list";k<n;){for(A=D,b=t.eMarks[k],p=w=t.sCount[k]+D-(t.bMarks[e]+t.tShift[e]);A<b;){if(9===(s=t.src.charCodeAt(A)))w+=4-(w+t.bsCount[k])%4;else{if(32!==s)break;w++}A++}if((u=(a=A)>=b?1:w-p)>4&&(u=1),l=p+u,(I=t.push("list_item_open","li",1)).markup=String.fromCharCode(v),I.map=d=[e,0],M=t.tight,S=t.tShift[e],C=t.sCount[e],x=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=l,t.tight=!0,t.tShift[e]=a-t.bMarks[e],t.sCount[e]=w,a>=b&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!O||(z=!1),O=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=x,t.tShift[e]=S,t.sCount[e]=C,t.tight=M,(I=t.push("list_item_close","li",-1)).markup=String.fromCharCode(v),k=e=t.line,d[1]=k,a=t.bMarks[e],k>=n)break;if(t.sCount[k]<t.blkIndent)break;if(t.sCount[e]-t.blkIndent>=4)break;for(T=!1,c=0,f=N.length;c<f;c++)if(N[c](t,k,n,!0)){T=!0;break}if(T)break;if(h){if((D=i(t,k))<0)break}else if((D=o(t,k))<0)break;if(v!==t.src.charCodeAt(D-1))break}return(I=h?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(v),m[1]=k,t.line=k,t.parentType=_,z&&function(t,e){var n,r,o=t.level+2;for(n=e+2,r=t.tokens.length-2;n<r;n++)t.tokens[n].level===o&&"paragraph_open"===t.tokens[n].type&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}(t,g),!0}},6864:t=>{"use strict";t.exports=function(t,e){var n,r,o,i,s,a,c=e+1,l=t.md.block.ruler.getRules("paragraph"),u=t.lineMax;for(a=t.parentType,t.parentType="paragraph";c<u&&!t.isEmpty(c);c++)if(!(t.sCount[c]-t.blkIndent>3||t.sCount[c]<0)){for(r=!1,o=0,i=l.length;o<i;o++)if(l[o](t,c,u,!0)){r=!0;break}if(r)break}return n=t.getLines(e,c,t.blkIndent,!1).trim(),t.line=c,(s=t.push("paragraph_open","p",1)).map=[e,t.line],(s=t.push("inline","",0)).content=n,s.map=[e,t.line],s.children=[],s=t.push("paragraph_close","p",-1),t.parentType=a,!0}},3804:(t,e,n)=>{"use strict";var r=n(7022).normalizeReference,o=n(7022).isSpace;t.exports=function(t,e,n,i){var s,a,c,l,u,p,h,d,f,m,g,v,y,b,k,w,x=0,_=t.bMarks[e]+t.tShift[e],C=t.eMarks[e],S=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(_))return!1;for(;++_<C;)if(93===t.src.charCodeAt(_)&&92!==t.src.charCodeAt(_-1)){if(_+1===C)return!1;if(58!==t.src.charCodeAt(_+1))return!1;break}for(l=t.lineMax,k=t.md.block.ruler.getRules("reference"),m=t.parentType,t.parentType="reference";S<l&&!t.isEmpty(S);S++)if(!(t.sCount[S]-t.blkIndent>3||t.sCount[S]<0)){for(b=!1,p=0,h=k.length;p<h;p++)if(k[p](t,S,l,!0)){b=!0;break}if(b)break}for(C=(y=t.getLines(e,S,t.blkIndent,!1).trim()).length,_=1;_<C;_++){if(91===(s=y.charCodeAt(_)))return!1;if(93===s){f=_;break}(10===s||92===s&&++_<C&&10===y.charCodeAt(_))&&x++}if(f<0||58!==y.charCodeAt(f+1))return!1;for(_=f+2;_<C;_++)if(10===(s=y.charCodeAt(_)))x++;else if(!o(s))break;if(!(g=t.md.helpers.parseLinkDestination(y,_,C)).ok)return!1;if(u=t.md.normalizeLink(g.str),!t.md.validateLink(u))return!1;for(a=_=g.pos,c=x+=g.lines,v=_;_<C;_++)if(10===(s=y.charCodeAt(_)))x++;else if(!o(s))break;for(g=t.md.helpers.parseLinkTitle(y,_,C),_<C&&v!==_&&g.ok?(w=g.str,_=g.pos,x+=g.lines):(w="",_=a,x=c);_<C&&(s=y.charCodeAt(_),o(s));)_++;if(_<C&&10!==y.charCodeAt(_)&&w)for(w="",_=a,x=c;_<C&&(s=y.charCodeAt(_),o(s));)_++;return!(_<C&&10!==y.charCodeAt(_)||!(d=r(y.slice(1,f)))||(i||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[d]&&(t.env.references[d]={title:w,href:u}),t.parentType=m,t.line=e+x+1),0))}},2948:(t,e,n)=>{"use strict";var r=n(5872),o=n(7022).isSpace;function i(t,e,n,r){var i,s,a,c,l,u,p,h;for(this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",h=!1,a=c=u=p=0,l=(s=this.src).length;c<l;c++){if(i=s.charCodeAt(c),!h){if(o(i)){u++,9===i?p+=4-p%4:p++;continue}h=!0}10!==i&&c!==l-1||(10!==i&&c++,this.bMarks.push(a),this.eMarks.push(c),this.tShift.push(u),this.sCount.push(p),this.bsCount.push(0),h=!1,u=0,p=0,a=c+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(t,e,n){var o=new r(t,e,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},i.prototype.skipSpaces=function(t){for(var e,n=this.src.length;t<n&&(e=this.src.charCodeAt(t),o(e));t++);return t},i.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!o(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},i.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,n,r){var i,s,a,c,l,u,p,h=t;if(t>=e)return"";for(u=new Array(e-t),i=0;h<e;h++,i++){for(s=0,p=c=this.bMarks[h],l=h+1<e||r?this.eMarks[h]+1:this.eMarks[h];c<l&&s<n;){if(a=this.src.charCodeAt(c),o(a))9===a?s+=4-(s+this.bsCount[h])%4:s++;else{if(!(c-p<this.tShift[h]))break;s++}c++}u[i]=s>n?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},i.prototype.Token=r,t.exports=i},1785:(t,e,n)=>{"use strict";var r=n(7022).isSpace;function o(t,e){var n=t.bMarks[e]+t.blkIndent,r=t.eMarks[e];return t.src.substr(n,r-n)}function i(t){var e,n=[],r=0,o=t.length,i=0,s=0,a=!1,c=0;for(e=t.charCodeAt(r);r<o;)96===e?a?(a=!1,c=r):i%2==0&&(a=!0,c=r):124!==e||i%2!=0||a||(n.push(t.substring(s,r)),s=r+1),92===e?i++:i=0,++r===o&&a&&(a=!1,r=c+1),e=t.charCodeAt(r);return n.push(t.substring(s)),n}t.exports=function(t,e,n,s){var a,c,l,u,p,h,d,f,m,g,v,y;if(e+2>n)return!1;if(p=e+1,t.sCount[p]<t.blkIndent)return!1;if(t.sCount[p]-t.blkIndent>=4)return!1;if((l=t.bMarks[p]+t.tShift[p])>=t.eMarks[p])return!1;if(124!==(a=t.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l<t.eMarks[p];){if(124!==(a=t.src.charCodeAt(l))&&45!==a&&58!==a&&!r(a))return!1;l++}for(h=(c=o(t,e+1)).split("|"),m=[],u=0;u<h.length;u++){if(!(g=h[u].trim())){if(0===u||u===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?m.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?m.push("left"):m.push("")}if(-1===(c=o(t,e).trim()).indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if((d=(h=i(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((f=t.push("table_open","table",1)).map=v=[e,0],(f=t.push("thead_open","thead",1)).map=[e,e+1],(f=t.push("tr_open","tr",1)).map=[e,e+1],u=0;u<h.length;u++)(f=t.push("th_open","th",1)).map=[e,e+1],m[u]&&(f.attrs=[["style","text-align:"+m[u]]]),(f=t.push("inline","",0)).content=h[u].trim(),f.map=[e,e+1],f.children=[],f=t.push("th_close","th",-1);for(f=t.push("tr_close","tr",-1),f=t.push("thead_close","thead",-1),(f=t.push("tbody_open","tbody",1)).map=y=[e+2,0],p=e+2;p<n&&!(t.sCount[p]<t.blkIndent)&&-1!==(c=o(t,p).trim()).indexOf("|")&&!(t.sCount[p]-t.blkIndent>=4);p++){for(h=i(c.replace(/^\||\|$/g,"")),f=t.push("tr_open","tr",1),u=0;u<d;u++)f=t.push("td_open","td",1),m[u]&&(f.attrs=[["style","text-align:"+m[u]]]),(f=t.push("inline","",0)).content=h[u]?h[u].trim():"",f.children=[],f=t.push("td_close","td",-1);f=t.push("tr_close","tr",-1)}return f=t.push("tbody_close","tbody",-1),f=t.push("table_close","table",-1),v[1]=y[1]=p,t.line=p,!0}},898:t=>{"use strict";t.exports=function(t){var e;t.inlineMode?((e=new t.Token("inline","",0)).content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},9827:t=>{"use strict";t.exports=function(t){var e,n,r,o=t.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(e=o[n]).type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},7830:(t,e,n)=>{"use strict";var r=n(7022).arrayReplaceAt;function o(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,i,s,a,c,l,u,p,h,d,f,m,g,v,y,b,k,w=t.tokens;if(t.md.options.linkify)for(n=0,i=w.length;n<i;n++)if("inline"===w[n].type&&t.md.linkify.pretest(w[n].content))for(m=0,e=(s=w[n].children).length-1;e>=0;e--)if("link_close"!==(c=s[e]).type){if("html_inline"===c.type&&(k=c.content,/^<a[>\s]/i.test(k)&&m>0&&m--,o(c.content)&&m++),!(m>0)&&"text"===c.type&&t.md.linkify.test(c.content)){for(p=c.content,b=t.md.linkify.match(p),l=[],f=c.level,d=0,u=0;u<b.length;u++)g=b[u].url,v=t.md.normalizeLink(g),t.md.validateLink(v)&&(y=b[u].text,y=b[u].schema?"mailto:"!==b[u].schema||/^mailto:/i.test(y)?t.md.normalizeLinkText(y):t.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,""),(h=b[u].index)>d&&((a=new t.Token("text","",0)).content=p.slice(d,h),a.level=f,l.push(a)),(a=new t.Token("link_open","a",1)).attrs=[["href",v]],a.level=f++,a.markup="linkify",a.info="auto",l.push(a),(a=new t.Token("text","",0)).content=y,a.level=f,l.push(a),(a=new t.Token("link_close","a",-1)).level=--f,a.markup="linkify",a.info="auto",l.push(a),d=b[u].lastIndex);d<p.length&&((a=new t.Token("text","",0)).content=p.slice(d),a.level=f,l.push(a)),w[n].children=s=r(s,e,l)}}else for(e--;s[e].level!==c.level&&"link_open"!==s[e].type;)e--}},4129:t=>{"use strict";var e=/\r\n?|\n/g,n=/\0/g;t.exports=function(t){var r;r=(r=t.src.replace(e,"\n")).replace(n,"�"),t.src=r}},2834:t=>{"use strict";var e=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,r=/\((c|tm|r|p)\)/gi,o={c:"©",r:"®",p:"§",tm:"™"};function i(t,e){return o[e.toLowerCase()]}function s(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||(n.content=n.content.replace(r,i)),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}function a(t){var n,r,o=0;for(n=t.length-1;n>=0;n--)"text"!==(r=t[n]).type||o||e.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===r.type&&"auto"===r.info&&o--,"link_close"===r.type&&"auto"===r.info&&o++}t.exports=function(t){var r;if(t.md.options.typographer)for(r=t.tokens.length-1;r>=0;r--)"inline"===t.tokens[r].type&&(n.test(t.tokens[r].content)&&s(t.tokens[r].children),e.test(t.tokens[r].content)&&a(t.tokens[r].children))}},8450:(t,e,n)=>{"use strict";var r=n(7022).isWhiteSpace,o=n(7022).isPunctChar,i=n(7022).isMdAsciiPunct,s=/['"]/,a=/['"]/g;function c(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function l(t,e){var n,s,l,u,p,h,d,f,m,g,v,y,b,k,w,x,_,C,S,M,A;for(S=[],n=0;n<t.length;n++){for(s=t[n],d=t[n].level,_=S.length-1;_>=0&&!(S[_].level<=d);_--);if(S.length=_+1,"text"===s.type){p=0,h=(l=s.content).length;t:for(;p<h&&(a.lastIndex=p,u=a.exec(l));){if(w=x=!0,p=u.index+1,C="'"===u[0],m=32,u.index-1>=0)m=l.charCodeAt(u.index-1);else for(_=n-1;_>=0&&"softbreak"!==t[_].type&&"hardbreak"!==t[_].type;_--)if("text"===t[_].type){m=t[_].content.charCodeAt(t[_].content.length-1);break}if(g=32,p<h)g=l.charCodeAt(p);else for(_=n+1;_<t.length&&"softbreak"!==t[_].type&&"hardbreak"!==t[_].type;_++)if("text"===t[_].type){g=t[_].content.charCodeAt(0);break}if(v=i(m)||o(String.fromCharCode(m)),y=i(g)||o(String.fromCharCode(g)),b=r(m),(k=r(g))?w=!1:y&&(b||v||(w=!1)),b?x=!1:v&&(k||y||(x=!1)),34===g&&'"'===u[0]&&m>=48&&m<=57&&(x=w=!1),w&&x&&(w=!1,x=y),w||x){if(x)for(_=S.length-1;_>=0&&(f=S[_],!(S[_].level<d));_--)if(f.single===C&&S[_].level===d){f=S[_],C?(M=e.md.options.quotes[2],A=e.md.options.quotes[3]):(M=e.md.options.quotes[0],A=e.md.options.quotes[1]),s.content=c(s.content,u.index,A),t[f.token].content=c(t[f.token].content,f.pos,M),p+=A.length-1,f.token===n&&(p+=M.length-1),h=(l=s.content).length,S.length=_;continue t}w?S.push({token:n,pos:u.index,single:C,level:d}):x&&C&&(s.content=c(s.content,u.index,"’"))}else C&&(s.content=c(s.content,u.index,"’"))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&s.test(t.tokens[e].content)&&l(t.tokens[e].children,t)}},6480:(t,e,n)=>{"use strict";var r=n(5872);function o(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}o.prototype.Token=r,t.exports=o},3420:t=>{"use strict";var e=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,n=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,r){var o,i,s,a,c,l,u=t.pos;return!(60!==t.src.charCodeAt(u)||(o=t.src.slice(u)).indexOf(">")<0||(n.test(o)?(a=(i=o.match(n))[0].slice(1,-1),c=t.md.normalizeLink(a),!t.md.validateLink(c)||(r||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=i[0].length,0)):!e.test(o)||(a=(s=o.match(e))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+a),!t.md.validateLink(c)||(r||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=s[0].length,0))))}},9755:t=>{"use strict";t.exports=function(t,e){var n,r,o,i,s,a,c=t.pos;if(96!==t.src.charCodeAt(c))return!1;for(n=c,c++,r=t.posMax;c<r&&96===t.src.charCodeAt(c);)c++;for(o=t.src.slice(n,c),i=s=c;-1!==(i=t.src.indexOf("`",s));){for(s=i+1;s<r&&96===t.src.charCodeAt(s);)s++;if(s-i===o.length)return e||((a=t.push("code_inline","code",0)).markup=o,a.content=t.src.slice(c,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),t.pos=s,!0}return e||(t.pending+=o),t.pos+=o.length,!0}},9354:t=>{"use strict";function e(t,e){var n,r,o,i,s,a,c,l,u={},p=e.length;for(n=0;n<p;n++)if((o=e[n]).length=o.length||0,o.close){for(u.hasOwnProperty(o.marker)||(u[o.marker]=[-1,-1,-1]),s=u[o.marker][o.length%3],a=-1,r=n-o.jump-1;r>s;r-=i.jump+1)if((i=e[r]).marker===o.marker&&(-1===a&&(a=r),i.open&&i.end<0&&i.level===o.level&&(c=!1,(i.close||o.open)&&(i.length+o.length)%3==0&&(i.length%3==0&&o.length%3==0||(c=!0)),!c))){l=r>0&&!e[r-1].open?e[r-1].jump+1:0,o.jump=n-r+l,o.open=!1,i.end=n,i.jump=l,i.close=!1,a=-1;break}-1!==a&&(u[o.marker][(o.length||0)%3]=a)}}t.exports=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(e(0,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&e(0,r[n].delimiters)}},7894:t=>{"use strict";function e(t,e){var n,r,o,i,s,a;for(n=e.length-1;n>=0;n--)95!==(r=e[n]).marker&&42!==r.marker||-1!==r.end&&(o=e[r.end],a=n>0&&e[n-1].end===r.end+1&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1&&e[n-1].marker===r.marker,s=String.fromCharCode(r.marker),(i=t.tokens[r.token]).type=a?"strong_open":"em_open",i.tag=a?"strong":"em",i.nesting=1,i.markup=a?s+s:s,i.content="",(i=t.tokens[o.token]).type=a?"strong_close":"em_close",i.tag=a?"strong":"em",i.nesting=-1,i.markup=a?s+s:s,i.content="",a&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}t.exports.w=function(t,e){var n,r,o=t.pos,i=t.src.charCodeAt(o);if(e)return!1;if(95!==i&&42!==i)return!1;for(r=t.scanDelims(t.pos,42===i),n=0;n<r.length;n++)t.push("text","",0).content=String.fromCharCode(i),t.delimiters.push({marker:i,length:r.length,jump:n,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.g=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(e(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&e(t,r[n].delimiters)}},9391:(t,e,n)=>{"use strict";var r=n(6233),o=n(7022).has,i=n(7022).isValidEntityCode,s=n(7022).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,l,u=t.pos,p=t.posMax;if(38!==t.src.charCodeAt(u))return!1;if(u+1<p)if(35===t.src.charCodeAt(u+1)){if(l=t.src.slice(u).match(a))return e||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),t.pending+=i(n)?s(n):s(65533)),t.pos+=l[0].length,!0}else if((l=t.src.slice(u).match(c))&&o(r,l[1]))return e||(t.pending+=r[l[1]]),t.pos+=l[0].length,!0;return e||(t.pending+="&"),t.pos++,!0}},1917:(t,e,n)=>{"use strict";for(var r=n(7022).isSpace,o=[],i=0;i<256;i++)o.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){o[t.charCodeAt(0)]=1})),t.exports=function(t,e){var n,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i<s){if((n=t.src.charCodeAt(i))<256&&0!==o[n])return e||(t.pending+=t.src[i]),t.pos+=2,!0;if(10===n){for(e||t.push("hardbreak","br",0),i++;i<s&&(n=t.src.charCodeAt(i),r(n));)i++;return t.pos=i,!0}}return e||(t.pending+="\\"),t.pos++,!0}},1779:(t,e,n)=>{"use strict";var r=n(1947).n;t.exports=function(t,e){var n,o,i,s=t.pos;return!(!t.md.options.html||(i=t.posMax,60!==t.src.charCodeAt(s)||s+2>=i||33!==(n=t.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n)||!(o=t.src.slice(s).match(r))||(e||(t.push("html_inline","",0).content=t.src.slice(s,s+o[0].length)),t.pos+=o[0].length,0)))}},3006:(t,e,n)=>{"use strict";var r=n(7022).normalizeReference,o=n(7022).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,p,h,d,f,m,g,v="",y=t.pos,b=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(l=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((u=c+1)<b&&40===t.src.charCodeAt(u)){for(u++;u<b&&(i=t.src.charCodeAt(u),o(i)||10===i);u++);if(u>=b)return!1;for(g=u,(h=t.md.helpers.parseLinkDestination(t.src,u,t.posMax)).ok&&(v=t.md.normalizeLink(h.str),t.md.validateLink(v)?u=h.pos:v=""),g=u;u<b&&(i=t.src.charCodeAt(u),o(i)||10===i);u++);if(h=t.md.helpers.parseLinkTitle(t.src,u,t.posMax),u<b&&g!==u&&h.ok)for(d=h.str,u=h.pos;u<b&&(i=t.src.charCodeAt(u),o(i)||10===i);u++);else d="";if(u>=b||41!==t.src.charCodeAt(u))return t.pos=y,!1;u++}else{if(void 0===t.env.references)return!1;if(u<b&&91===t.src.charCodeAt(u)?(g=u+1,(u=t.md.helpers.parseLinkLabel(t,u))>=0?a=t.src.slice(g,u++):u=c+1):u=c+1,a||(a=t.src.slice(l,c)),!(p=t.env.references[r(a)]))return t.pos=y,!1;v=p.href,d=p.title}return e||(s=t.src.slice(l,c),t.md.inline.parse(s,t.md,t.env,m=[]),(f=t.push("image","img",0)).attrs=n=[["src",v],["alt",""]],f.children=m,f.content=s,d&&n.push(["title",d])),t.pos=u,t.posMax=b,!0}},1727:(t,e,n)=>{"use strict";var r=n(7022).normalizeReference,o=n(7022).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,p,h,d="",f=t.pos,m=t.posMax,g=t.pos,v=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(c=t.pos+1,(a=t.md.helpers.parseLinkLabel(t,t.pos,!0))<0)return!1;if((l=a+1)<m&&40===t.src.charCodeAt(l)){for(v=!1,l++;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);if(l>=m)return!1;for(g=l,(u=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(d=t.md.normalizeLink(u.str),t.md.validateLink(d)?l=u.pos:d=""),g=l;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);if(u=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<m&&g!==l&&u.ok)for(h=u.str,l=u.pos;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);else h="";(l>=m||41!==t.src.charCodeAt(l))&&(v=!0),l++}if(v){if(void 0===t.env.references)return!1;if(l<m&&91===t.src.charCodeAt(l)?(g=l+1,(l=t.md.helpers.parseLinkLabel(t,l))>=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),!(p=t.env.references[r(s)]))return t.pos=f,!1;d=p.href,h=p.title}return e||(t.pos=c,t.posMax=a,t.push("link_open","a",1).attrs=n=[["href",d]],h&&n.push(["title",h]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}},3905:(t,e,n)=>{"use strict";var r=n(7022).isSpace;t.exports=function(t,e){var n,o,i=t.pos;if(10!==t.src.charCodeAt(i))return!1;for(n=t.pending.length-1,o=t.posMax,e||(n>=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),i++;i<o&&r(t.src.charCodeAt(i));)i++;return t.pos=i,!0}},670:(t,e,n)=>{"use strict";var r=n(5872),o=n(7022).isWhiteSpace,i=n(7022).isPunctChar,s=n(7022).isMdAsciiPunct;function a(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[]}a.prototype.pushPending=function(){var t=new r("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},a.prototype.push=function(t,e,n){this.pending&&this.pushPending();var o=new r(t,e,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(i),o},a.prototype.scanDelims=function(t,e){var n,r,a,c,l,u,p,h,d,f=t,m=!0,g=!0,v=this.posMax,y=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;f<v&&this.src.charCodeAt(f)===y;)f++;return a=f-t,r=f<v?this.src.charCodeAt(f):32,p=s(n)||i(String.fromCharCode(n)),d=s(r)||i(String.fromCharCode(r)),u=o(n),(h=o(r))?m=!1:d&&(u||p||(m=!1)),u?g=!1:p&&(h||d||(g=!1)),e?(c=m,l=g):(c=m&&(!g||p),l=g&&(!m||d)),{can_open:c,can_close:l,length:a}},a.prototype.Token=r,t.exports=a},4814:t=>{"use strict";function e(t,e){var n,r,o,i,s,a=[],c=e.length;for(n=0;n<c;n++)126===(o=e[n]).marker&&-1!==o.end&&(i=e[o.end],(s=t.tokens[o.token]).type="s_open",s.tag="s",s.nesting=1,s.markup="~~",s.content="",(s=t.tokens[i.token]).type="s_close",s.tag="s",s.nesting=-1,s.markup="~~",s.content="","text"===t.tokens[i.token-1].type&&"~"===t.tokens[i.token-1].content&&a.push(i.token-1));for(;a.length;){for(r=(n=a.pop())+1;r<t.tokens.length&&"s_close"===t.tokens[r].type;)r++;n!==--r&&(s=t.tokens[r],t.tokens[r]=t.tokens[n],t.tokens[n]=s)}}t.exports.w=function(t,e){var n,r,o,i,s=t.pos,a=t.src.charCodeAt(s);if(e)return!1;if(126!==a)return!1;if(o=(r=t.scanDelims(t.pos,!0)).length,i=String.fromCharCode(a),o<2)return!1;for(o%2&&(t.push("text","",0).content=i,o--),n=0;n<o;n+=2)t.push("text","",0).content=i+i,t.delimiters.push({marker:a,length:0,jump:n,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.g=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(e(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&e(t,r[n].delimiters)}},9941:t=>{"use strict";function e(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,n){for(var r=t.pos;r<t.posMax&&!e(t.src.charCodeAt(r));)r++;return r!==t.pos&&(n||(t.pending+=t.src.slice(t.pos,r)),t.pos=r,!0)}},8996:t=>{"use strict";t.exports=function(t){var e,n,r=0,o=t.tokens,i=t.tokens.length;for(e=n=0;e<i;e++)o[e].nesting<0&&r--,o[e].level=r,o[e].nesting>0&&r++,"text"===o[e].type&&e+1<i&&"text"===o[e+1].type?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}},5872:t=>{"use strict";function e(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}e.prototype.attrIndex=function(t){var e,n,r;if(!this.attrs)return-1;for(n=0,r=(e=this.attrs).length;n<r;n++)if(e[n][0]===t)return n;return-1},e.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},e.prototype.attrSet=function(t,e){var n=this.attrIndex(t),r=[t,e];n<0?this.attrPush(r):this.attrs[n]=r},e.prototype.attrGet=function(t){var e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},e.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=e},3122:t=>{"use strict";var e={};function n(t,r){var o;return"string"!=typeof r&&(r=n.defaultChars),o=function(t){var n,r,o=e[t];if(o)return o;for(o=e[t]=[],n=0;n<128;n++)r=String.fromCharCode(n),o.push(r);for(n=0;n<t.length;n++)o[r=t.charCodeAt(n)]="%"+("0"+r.toString(16).toUpperCase()).slice(-2);return o}(r),t.replace(/(%[a-f0-9]{2})+/gi,(function(t){var e,n,r,i,s,a,c,l="";for(e=0,n=t.length;e<n;e+=3)(r=parseInt(t.slice(e+1,e+3),16))<128?l+=o[r]:192==(224&r)&&e+3<n&&128==(192&(i=parseInt(t.slice(e+4,e+6),16)))?(l+=(c=r<<6&1984|63&i)<128?"��":String.fromCharCode(c),e+=3):224==(240&r)&&e+6<n&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),128==(192&i)&&128==(192&s))?(l+=(c=r<<12&61440|i<<6&4032|63&s)<2048||c>=55296&&c<=57343?"���":String.fromCharCode(c),e+=6):240==(248&r)&&e+9<n&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),a=parseInt(t.slice(e+10,e+12),16),128==(192&i)&&128==(192&s)&&128==(192&a))?((c=r<<18&1835008|i<<12&258048|s<<6&4032|63&a)<65536||c>1114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),e+=9):l+="�";return l}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",t.exports=n},729:t=>{"use strict";var e={};function n(t,r,o){var i,s,a,c,l,u="";for("string"!=typeof r&&(o=r,r=n.defaultChars),void 0===o&&(o=!0),l=function(t){var n,r,o=e[t];if(o)return o;for(o=e[t]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?o.push(r):o.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n<t.length;n++)o[t.charCodeAt(n)]=t[n];return o}(r),i=0,s=t.length;i<s;i++)if(a=t.charCodeAt(i),o&&37===a&&i+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3)))u+=t.slice(i,i+3),i+=2;else if(a<128)u+=l[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1<s&&(c=t.charCodeAt(i+1))>=56320&&c<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(t[i]);return u}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",t.exports=n},2201:t=>{"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",(e+=t.search||"")+(t.hash||"")}},8765:(t,e,n)=>{"use strict";t.exports.encode=n(729),t.exports.decode=n(3122),t.exports.format=n(2201),t.exports.parse=n(9553)},9553:t=>{"use strict";function e(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),s=["'"].concat(i),a=["%","/","?",";","#"].concat(s),c=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},h={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};e.prototype.parse=function(t,e){var r,i,s,d,f,m=t;if(m=m.trim(),!e&&1===t.split("#").length){var g=o.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var v=n.exec(m);if(v&&(s=(v=v[0]).toLowerCase(),this.protocol=v,m=m.substr(v.length)),(e||v||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(f="//"===m.substr(0,2))||v&&p[v]||(m=m.substr(2),this.slashes=!0)),!p[v]&&(f||v&&!h[v])){var y,b,k=-1;for(r=0;r<c.length;r++)-1!==(d=m.indexOf(c[r]))&&(-1===k||d<k)&&(k=d);for(-1!==(b=-1===k?m.lastIndexOf("@"):m.lastIndexOf("@",k))&&(y=m.slice(0,b),m=m.slice(b+1),this.auth=y),k=-1,r=0;r<a.length;r++)-1!==(d=m.indexOf(a[r]))&&(-1===k||d<k)&&(k=d);-1===k&&(k=m.length),":"===m[k-1]&&k--;var w=m.slice(0,k);m=m.slice(k),this.parseHost(w),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x){var _=this.hostname.split(/\./);for(r=0,i=_.length;r<i;r++){var C=_[r];if(C&&!C.match(l)){for(var S="",M=0,A=C.length;M<A;M++)C.charCodeAt(M)>127?S+="x":S+=C[M];if(!S.match(l)){var D=_.slice(0,r),O=_.slice(r+1),E=C.match(u);E&&(D.push(E[1]),O.unshift(E[2])),O.length&&(m=O.join(".")+m),this.hostname=D.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var T=m.indexOf("#");-1!==T&&(this.hash=m.substr(T),m=m.slice(0,T));var N=m.indexOf("?");return-1!==N&&(this.search=m.substr(N),m=m.slice(0,N)),m&&(this.pathname=m),h[s]&&this.hostname&&!this.pathname&&(this.pathname=""),this},e.prototype.parseHost=function(t){var e=r.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,n){if(t&&t instanceof e)return t;var r=new e;return r.parse(t,n),r}},4943:(t,e,n)=>{!function(t,e){for(var n in e)t[n]=e[n]}(e,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=n(8780)},function(t,e){t.exports=n(6922)},,,function(t,e,n){"use strict";n.r(e),n.d(e,"getHighlightDecorations",(function(){return i})),n.d(e,"DecorationCache",(function(){return l})),n.d(e,"highlightPlugin",(function(){return u}));var r=n(0),o=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};function i(t,e,n,i,a){if(!(t&&t.nodeSize&&(null==n?void 0:n.length)&&i))return[];var c=function(t,e){var n=[];return t.descendants((function(t,r){if(t.isBlock&&e.indexOf(t.type.name)>-1)return n.push({node:t,pos:r}),!1})),n}(t,n),l=[];return c.forEach((function(t){if(null==a?void 0:a.preRenderer){var n=a.preRenderer(t.node,t.pos);if(n)return void(l=o(l,n))}var c=i(t.node);if(!c||e.getLanguage(c)){var u=c?e.highlight(c,t.node.textContent):e.highlightAuto(t.node.textContent);!c&&(null==a?void 0:a.autohighlightCallback)&&a.autohighlightCallback(t.node,t.pos,u.language);var p=u.emitter,h=new s(p,t.pos,p.options.classPrefix).value(),d=[];h.forEach((function(t){if(t.kind){var e=r.Decoration.inline(t.from,t.to,{class:t.classes});d.push(e)}})),(null==a?void 0:a.postRenderer)&&a.postRenderer(t.node,t.pos,d),l=o(l,d)}})),l}var s=function(){function t(t,e,n){this.buffer=[],this.nodeQueue=[],this.classPrefix=n,this.currentPosition=e+1,t.walk(this)}return Object.defineProperty(t.prototype,"currentNode",{get:function(){return this.nodeQueue.length?this.nodeQueue.slice(-1):null},enumerable:!1,configurable:!0}),t.prototype.addText=function(t){this.currentNode&&(this.currentPosition+=t.length)},t.prototype.openNode=function(t){var e=t.kind||"";t.sublanguage||(e=""+this.classPrefix+e);var n=this.newNode();n.kind=t.kind,n.classes=e,n.from=this.currentPosition,this.nodeQueue.push(n)},t.prototype.closeNode=function(t){var e=this.nodeQueue.pop();if(!e)throw"Cannot close node!";if(e.to=this.currentPosition,t.kind!==e.kind)throw"Mismatch!";this.buffer.push(e)},t.prototype.value=function(){return this.buffer},t.prototype.newNode=function(){return{from:0,to:0,kind:void 0,classes:""}},t}(),a=n(1),c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=function(){function t(t){this.cache=c({},t)}return t.prototype.get=function(t){return this.cache[t]||null},t.prototype.set=function(t,e,n){this.cache[t]={node:e,decorations:n}},t.prototype.replace=function(t,e,n,r){this.remove(t),this.set(e,n,r)},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.invalidate=function(e){var n=this,r=new t(this.cache),o=e.mapping;return Object.keys(this.cache).forEach((function(t){var i=+t,s=o.mapResult(i),a=e.doc.nodeAt(s.pos),c=n.get(i),l=c.node,u=c.decorations;if(s.deleted||!(null==a?void 0:a.eq(l)))r.remove(i);else if(i!==s.pos){var p=u.map((function(t){return t.map(o,0,0)})).filter((function(t){return null!==t}));r.replace(i,s.pos,a,p)}})),r},t}();function u(t,e,n,o){void 0===e&&(e=["code_block"]);var s=n||function(t){var e=t.attrs.detectedHighlightLanguage,n=t.attrs.params;return e||(null==n?void 0:n.split(" ")[0])||""},c=o||function(t,e,n,r){var o=e.attrs||{};return o.detectedHighlightLanguage=r,t.setNodeMarkup(n,void 0,o)},u=function(n,r){var o=[];return{content:i(n,t,e,s,{preRenderer:function(t,e){var n;return null===(n=r.get(e))||void 0===n?void 0:n.decorations},postRenderer:function(t,e,n){r.set(e,t,n)},autohighlightCallback:function(t,e,n){o.push({node:t,pos:e,language:n})}}),autodetectedLanguages:o}},p=new a.PluginKey;return new a.Plugin({key:p,state:{init:function(t,e){var n=new l({}),o=u(e.doc,n);return{cache:n,decorations:r.DecorationSet.create(e.doc,o.content),autodetectedLanguages:o.autodetectedLanguages}},apply:function(t,e){var n=e.cache.invalidate(t);if(!t.docChanged)return{cache:n,decorations:e.decorations.map(t.mapping,t.doc),autodetectedLanguages:[]};var o=u(t.doc,n);return{cache:n,decorations:r.DecorationSet.create(t.doc,o.content),autodetectedLanguages:o.autodetectedLanguages}}},props:{decorations:function(t){return this.getState(t).decorations}},view:function(t){var e=function(t){var e=p.getState(t.state);if(e&&e.autodetectedLanguages.length){var n=t.state.tr;e.autodetectedLanguages.forEach((function(t){if(t.language){var e=c(n,t.node,t.pos,t.language);n=e||n}})),n=n.setMeta("addToHistory",!1),t.dispatch(n)}};return e(t),{update:e}}})}}]))},8638:(t,e,n)=>{"use strict";function r(t){this.content=t}n.d(e,{sI:()=>R,aw:()=>st,PW:()=>vt,HY:()=>a,vc:()=>h,ZU:()=>rt,NB:()=>z,Ts:()=>N,Jq:()=>X,e4:()=>d,V_:()=>ot,p2:()=>f}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};const o=r;function i(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var o=t.child(r),s=e.child(r);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(var a=0;o.text[a]==s.text[a];a++)n++;return n}if(o.content.size||s.content.size){var c=i(o.content,s.content,n+1);if(null!=c)return c}n+=o.nodeSize}else n+=o.nodeSize}}function s(t,e,n,r){for(var o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=t.child(--o),c=e.child(--i),l=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){for(var u=0,p=Math.min(a.text.length,c.text.length);u<p&&a.text[a.text.length-u-1]==c.text[c.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){var h=s(a.content,c.content,n-1,r-1);if(h)return h}n-=l,r-=l}else n-=l,r-=l}}var a=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},c={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};a.prototype.nodesBetween=function(t,e,n,r,o){void 0===r&&(r=0);for(var i=0,s=0;s<e;i++){var a=this.content[i],c=s+a.nodeSize;if(c>t&&!1!==n(a,r+s,o,i)&&a.content.size){var l=s+1;a.nodesBetween(Math.max(0,t-l),Math.min(a.content.size,e-l),n,r+l)}s=c}},a.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},a.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},a.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new a(r,this.size+t.size)},a.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],r=0;if(e>t)for(var o=0,i=0;i<e;o++){var s=this.content[o],c=i+s.nodeSize;c>t&&((i<t||c>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=c}return new a(n,r)},a.prototype.cutByIndex=function(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))},a.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new a(r,o)},a.prototype.addToStart=function(t){return new a([t].concat(this.content),this.size+t.nodeSize)},a.prototype.addToEnd=function(t){return new a(this.content.concat(t),this.size+t.nodeSize)},a.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},c.firstChild.get=function(){return this.content.length?this.content[0]:null},c.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},c.childCount.get=function(){return this.content.length},a.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},a.prototype.maybeChild=function(t){return this.content[t]},a.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}},a.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),i(this,t,e)},a.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),s(this,t,e,n)},a.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return u(0,t);if(t==this.size)return u(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?u(n+1,o):u(n,r);r=o}},a.prototype.toString=function(){return"<"+this.toStringInner()+">"},a.prototype.toStringInner=function(){return this.content.join(", ")},a.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},a.fromJSON=function(t,e){if(!e)return a.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(e.map(t.nodeFromJSON))},a.fromArray=function(t){if(!t.length)return a.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new a(e||t,n)},a.from=function(t){if(!t)return a.empty;if(t instanceof a)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new a([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(a.prototype,c);var l={index:0,offset:0};function u(t,e){return l.index=t,l.offset=e,l}function p(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!p(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e)||!p(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}a.empty=new a([],0);var h=function(t,e){this.type=t,this.attrs=e};function d(t){var e=Error.call(this,t);return e.__proto__=d.prototype,e}h.prototype.addToSet=function(t){for(var e,n=!1,r=0;r<t.length;r++){var o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},h.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},h.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},h.prototype.eq=function(t){return this==t||this.type==t.type&&p(this.attrs,t.attrs)},h.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},h.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},h.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},h.setFrom=function(t){if(!t||0==t.length)return h.none;if(t instanceof h)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},h.none=[],d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="ReplaceError";var f=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},m={size:{configurable:!0}};function g(t,e,n){var r=t.findIndex(e),o=r.index,i=r.offset,s=t.maybeChild(o),a=t.findIndex(n),c=a.index,l=a.offset;if(i==e||s.isText){if(l!=n&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(g(s.content,e-i-1,n-i-1)))}function v(t,e,n,r){var o=t.findIndex(e),i=o.index,s=o.offset,a=t.maybeChild(i);if(s==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));var c=v(a.content,e-s-1,n);return c&&t.replaceChild(i,a.copy(c))}function y(t,e,n){if(n.openStart>t.depth)throw new d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d("Inconsistent open depths");return b(t,e,n,0)}function b(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){var s=b(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){var c=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),o=n-1;o>=0;o--)r=e.node(o).copy(a.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return C(i,S(t,c.start,c.end,e,r))}var l=t.parent,u=l.content;return C(l,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}return C(i,M(t,e,r))}function k(t,e){if(!e.type.compatibleContent(t.type))throw new d("Cannot join "+e.type.name+" onto "+t.type.name)}function w(t,e,n){var r=t.node(n);return k(r,e.node(n)),r}function x(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(x(t.nodeAfter,r),i++));for(var a=i;a<s;a++)x(o.child(a),r);e&&e.depth==n&&e.textOffset&&x(e.nodeBefore,r)}function C(t,e){if(!t.type.validContent(e))throw new d("Invalid content for node "+t.type.name);return t.copy(e)}function S(t,e,n,r,o){var i=t.depth>o&&w(t,e,o+1),s=r.depth>o&&w(n,r,o+1),c=[];return _(null,t,o,c),i&&s&&e.index(o)==n.index(o)?(k(i,s),x(C(i,S(t,e,n,r,o+1)),c)):(i&&x(C(i,M(t,e,o+1)),c),_(e,n,o,c),s&&x(C(s,M(n,r,o+1)),c)),_(r,null,o,c),new a(c)}function M(t,e,n){var r=[];return _(null,t,n,r),t.depth>n&&x(C(w(t,e,n+1),M(t,e,n+1)),r),_(e,null,n,r),new a(r)}m.size.get=function(){return this.content.size-this.openStart-this.openEnd},f.prototype.insertAt=function(t,e){var n=v(this.content,t+this.openStart,e,null);return n&&new f(n,this.openStart,this.openEnd)},f.prototype.removeBetween=function(t,e){return new f(g(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},f.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},f.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},f.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},f.fromJSON=function(t,e){if(!e)return f.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(a.fromJSON(t,e.content),n,r)},f.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new f(t,n,r)},Object.defineProperties(f.prototype,m),f.empty=new f(a.empty,0,0);var A=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},D={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};A.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},D.parent.get=function(){return this.node(this.depth)},D.doc.get=function(){return this.node(0)},A.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},A.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},A.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},A.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},A.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},A.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},A.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},D.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},D.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},D.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},A.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o<t;o++)r+=n.child(o).nodeSize;return r},A.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return h.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i},A.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},A.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},A.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new N(this,t,n)},A.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},A.prototype.max=function(t){return t.pos>this.pos?t:this},A.prototype.min=function(t){return t.pos<this.pos?t:this},A.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},A.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new A(e,n,o)},A.resolveCached=function(t,e){for(var n=0;n<O.length;n++){var r=O[n];if(r.pos==e&&r.doc==t)return r}var o=O[E]=A.resolve(t,e);return E=(E+1)%T,o},Object.defineProperties(A.prototype,D);var O=[],E=0,T=12,N=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},I={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};I.start.get=function(){return this.$from.before(this.depth+1)},I.end.get=function(){return this.$to.after(this.depth+1)},I.parent.get=function(){return this.$from.node(this.depth)},I.startIndex.get=function(){return this.$from.index(this.depth)},I.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(N.prototype,I);var L=Object.create(null),z=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||a.empty,this.marks=r||h.none},P={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};P.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},P.childCount.get=function(){return this.content.childCount},z.prototype.child=function(t){return this.content.child(t)},z.prototype.maybeChild=function(t){return this.content.maybeChild(t)},z.prototype.forEach=function(t){this.content.forEach(t)},z.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},z.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},P.textContent.get=function(){return this.textBetween(0,this.content.size,"")},z.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},P.firstChild.get=function(){return this.content.firstChild},P.lastChild.get=function(){return this.content.lastChild},z.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},z.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},z.prototype.hasMarkup=function(t,e,n){return this.type==t&&p(this.attrs,e||t.defaultAttrs||L)&&h.sameSet(this.marks,n||h.none)},z.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},z.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},z.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},z.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return f.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new f(a,r.depth-i,o.depth-i)},z.prototype.replace=function(t,e,n){return y(this.resolve(t),this.resolve(e),n)},z.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},z.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},z.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},z.prototype.resolve=function(t){return A.resolveCached(this,t)},z.prototype.resolveNoCache=function(t){return A.resolve(this,t)},z.prototype.rangeHasMark=function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},P.isBlock.get=function(){return this.type.isBlock},P.isTextblock.get=function(){return this.type.isTextblock},P.inlineContent.get=function(){return this.type.inlineContent},P.isInline.get=function(){return this.type.isInline},P.isText.get=function(){return this.type.isText},P.isLeaf.get=function(){return this.type.isLeaf},P.isAtom.get=function(){return this.type.isAtom},z.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),q(this.marks,t)},z.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},z.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=a.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var c=r;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},z.prototype.canReplaceWith=function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd},z.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},z.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach((function(t){return t.check()}))},z.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},z.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=a.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)},Object.defineProperties(z.prototype,P);var F=function(t){function e(e,n,r,o){if(t.call(this,e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):q(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(z);function q(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var R=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},B={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};R.parse=function(t,e){var n=new V(t,e);if(null==n.next)return R.empty;var r=$(n);n.next&&n.err("Unexpected trailing text");var o,i,s=(o=function(t){var e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(t(n,i))}),[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],i);if(s==e.exprs.length-1)return a;o(a,i=n())}else{if("star"==e.type){var c=n();return r(i,c),o(t(e.expr,c),c),[r(c)]}if("plus"==e.type){var l=n();return o(t(e.expr,i),l),o(t(e.expr,l),l),[r(l)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){for(var u=i,p=0;p<e.min;p++){var h=n();o(t(e.expr,u),h),u=h}if(-1==e.max)o(t(e.expr,u),u);else for(var d=e.min;d<e.max;d++){var f=n();r(u,f),o(t(e.expr,u),f),u=f}return[r(u)]}if("name"==e.type)return[r(i,null,e.value)]}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((function(t){return t.to=e}))}}(r),i=Object.create(null),function t(e){var n=[];e.forEach((function(t){o[t].forEach((function(t){var e=t.term,r=t.to;if(e){var i=n.indexOf(e),s=i>-1&&n[i+1];K(o,r).forEach((function(t){s||n.push(e,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var r=i[e.join(",")]=new R(e.indexOf(o.length-1)>-1),s=0;s<n.length;s+=2){var a=n[s+1].sort(G);r.next.push(n[s],i[a.join(",")]||t(a))}return r}(K(o,0)));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var o=r[n],i=!o.validEnd,s=[],a=0;a<o.next.length;a+=2){var c=o.next[a],l=o.next[a+1];s.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,n),s},R.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},R.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var r=this,o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r},B.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},B.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},R.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},R.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var r=[this];return function o(i,s){var c=i.matchFragment(t,n);if(c&&(!e||c.validEnd))return a.from(s.map((function(t){return t.createAndFill()})));for(var l=0;l<i.next.length;l+=2){var u=i.next[l],p=i.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(p)){r.push(p);var h=o(p,s.concat(u));if(h)return h}}}(this,[])},R.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},R.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(t)){for(var i=[],s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(var a=0;a<o.next.length;a+=2){var c=o.next[a];c.isLeaf||c.hasRequiredAttrs()||c.name in e||r.type&&!o.next[a+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}},B.edgeCount.get=function(){return this.next.length>>1},R.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},R.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r<n.next.length;r+=2)-1==t.indexOf(n.next[r])&&e(n.next[r])}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",o=0;o<e.next.length;o+=2)r+=(o?", ":"")+e.next[o].name+"->"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(R.prototype,B),R.empty=new R(!0);var V=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},j={next:{configurable:!0}};function $(t){var e=[];do{e.push(H(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function H(t){var e=[];do{e.push(U(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function U(t){for(var e=function(t){if(t.eat("(")){var e=$(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=J(t,e)}return e}function W(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function J(t,e){var n=W(t),r=n;return t.eat(",")&&(r="}"!=t.next?W(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function G(t,e){return e-t}function K(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var s=o[i],a=s.term,c=s.to;a||-1!=n.indexOf(c)||e(c)}}(e),n.sort(G)}function Y(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Z(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(void 0===o){var i=t[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function Q(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new et(t[n]);return e}j.next.get=function(){return this.tokens[this.pos]},V.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},V.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(V.prototype,j);var X=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=Q(n.attrs),this.defaultAttrs=Y(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},tt={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};tt.isInline.get=function(){return!this.isBlock},tt.isTextblock.get=function(){return this.isBlock&&this.inlineContent},tt.isLeaf.get=function(){return this.contentMatch==R.empty},tt.isAtom.get=function(){return this.isLeaf||this.spec.atom},X.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},X.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},X.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:Z(this.attrs,t)},X.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new z(this,this.computeAttrs(t),a.from(e),h.setFrom(n))},X.prototype.createChecked=function(t,e,n){if(e=a.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new z(this,this.computeAttrs(t),e,h.setFrom(n))},X.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=a.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentMatch.matchFragment(e).fillBefore(a.empty,!0);return o?new z(this,t,e.append(o),h.setFrom(n)):null},X.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},X.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},X.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},X.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:h.empty:t},X.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,r){return n[t]=new X(t,e,r)}));var r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(X.prototype,tt);var et=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},nt={isRequired:{configurable:!0}};nt.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(et.prototype,nt);var rt=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=Q(r.attrs),this.rank=e,this.excluded=null;var o=Y(this.attrs);this.instance=o&&new h(this,o)};rt.prototype.create=function(t){return!t&&this.instance?this.instance:new h(this,Z(this.attrs,t))},rt.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach((function(t,o){return n[t]=new rt(t,r++,e,o)})),n},rt.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t.slice(0,e).concat(t.slice(e+1));return t},rt.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},rt.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var ot=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=o.from(t.nodes),this.spec.marks=o.from(t.marks),this.nodes=X.compile(this.spec.nodes,this),this.marks=rt.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=R.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?it(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:it(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function it(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(var a in t.marks){var c=t.marks[a];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}ot.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof X))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},ot.prototype.text=function(t,e){var n=this.nodes.text;return new F(n,n.defaultAttrs,t,h.setFrom(e))},ot.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},ot.prototype.nodeFromJSON=function(t){return z.fromJSON(this,t)},ot.prototype.markFromJSON=function(t){return h.fromJSON(this,t)},ot.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var st=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};st.prototype.parse=function(t,e){void 0===e&&(e={});var n=new ht(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},st.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new ht(this,e,!0);return n.addAll(t,null,e.from,e.to),f.maxOpen(n.finish())},st.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(ft(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},st.prototype.matchStyle=function(t,e,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},st.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var o=e[r];if((null==o.priority?50:o.priority)<n)break}e.splice(r,0,t)}var r,o=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=mt(t)),t.mark=e}))};for(var i in t.marks)o(i);for(var s in t.nodes)r=void 0,(r=t.nodes[s].spec.parseDOM)&&r.forEach((function(t){n(t=mt(t)),t.node=s}));return e},st.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new st(t,st.schemaRules(t)))};var at={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ct={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lt={ol:!0,ul:!0};function ut(t){return(t?1:0)|("full"===t?2:0)}var pt=function(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.solid=o,this.match=i||(4&s?null:t.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=h.none,this.pendingMarks=r,this.stashMarks=[]};pt.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(a.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},pt.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=a.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},pt.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},pt.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):gt(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}};var ht=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=ut(e.preserveWhitespace)|(n?4:0);r=o?new pt(o.type,o.attrs,h.none,h.none,!0,e.topMatch||o.type.contentMatch,i):new pt(n?null:t.schema.topNodeType,null,h.none,h.none,!0,null,i),this.nodes=[r],this.open=0,this.find=e.findPositions,this.needsBlock=!1},dt={top:{configurable:!0},currentPos:{configurable:!0}};function ft(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function mt(t){var e={};for(var n in t)e[n]=t[n];return e}function gt(t,e){var n=e.schema.nodes,r=function(r){var o=n[r];if(o.allowsMarkType(t)){var i=[],s=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var r=t.edge(n),o=r.type,a=r.next;if(o==e)return!0;if(i.indexOf(a)<0&&s(a))return!0}};return s(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var i=r(o);if(i)return i.v}}dt.top.get=function(){return this.nodes[this.open]},ht.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){for(var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}},ht.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)2&n.options||(e=e.replace(/\r?\n|\r/g," "));else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},ht.prototype.addElement=function(t,e){var n,r=t.nodeName.toLowerCase();lt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&lt.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:ct.hasOwnProperty(r))this.findInside(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var i,s=this.top,a=this.needsBlock;if(at.hasOwnProperty(r))i=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(s),this.needsBlock=a}else this.addElementByRule(t,o,!1===o.consuming?n:null)},ht.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},ht.prototype.readStyles=function(t){var e=h.none;t:for(var n=0;n<t.length;n+=2)for(var r=null;;){var o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e},ht.prototype.addElementByRule=function(t,e,n){var r,o,i,s=this;e.node?(o=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return s.insertNode(t)}));else{var c=e.contentElement;"string"==typeof c?c=t.querySelector(c):"function"==typeof c&&(c=c(t)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,r)}r&&(this.sync(a),this.open--),i&&this.removePendingMark(i,a)},ht.prototype.addAll=function(t,e,n,r){for(var o=n||0,i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i),e&&at.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,o)},ht.prototype.findPlace=function(t){for(var e,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0},ht.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,o=0;o<t.marks.length;o++)n.type&&!n.type.allowsMarkType(t.marks[o].type)||(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1},ht.prototype.enter=function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r},ht.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t,e);var i=null==r?-5&o.options:ut(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new pt(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++},ht.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},ht.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ht.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},dt.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},ht.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},ht.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},ht.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)},ht.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},ht.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var l=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},ht.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},ht.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},ht.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(ht.prototype,dt);var vt=function(t,e){this.nodes=t||{},this.marks=e||{}};function yt(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function bt(t){return t.document||window.document}vt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=bt(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n<i.length&&s<t.marks.length;){var a=t.marks[s];if(r.marks[a.type.name]){if(!a.eq(i[n])||!1===a.type.spec.spanning)break;n+=2,s++}else s++}for(;n<i.length;)o=i.pop(),i.pop();for(;s<t.marks.length;){var c=t.marks[s++],l=r.serializeMark(c,t.isInline,e);l&&(i.push(c,o),o.appendChild(l.dom),o=l.contentDOM||l.dom)}}o.appendChild(r.serializeNode(t,e))})),n},vt.prototype.serializeNode=function(t,e){void 0===e&&(e={});var n=vt.renderSpec(bt(e),this.nodes[t.type.name](t)),r=n.dom,o=n.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,o,e):this.serializeFragment(t.content,e,o)}return r},vt.prototype.serializeNodeAndMarks=function(t,e){void 0===e&&(e={});for(var n=this.serializeNode(t,e),r=t.marks.length-1;r>=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},vt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&vt.renderSpec(bt(n),r(t,e))},vt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var l in c=2,a)if(null!=a[l]){var u=l.indexOf(" ");u>0?s.setAttributeNS(l.slice(0,u),l.slice(u+1),a[l]):s.setAttribute(l,a[l])}for(var p=c;p<e.length;p++){var h=e[p];if(0===h){if(p<e.length-1||p>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var d=vt.renderSpec(t,h,n),f=d.dom,m=d.contentDOM;if(s.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},vt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new vt(this.nodesFromSchema(t),this.marksFromSchema(t)))},vt.nodesFromSchema=function(t){var e=yt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},vt.marksFromSchema=function(t){return yt(t.marks)}},6922:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AllSelection:()=>d,EditorState:()=>x,NodeSelection:()=>p,Plugin:()=>M,PluginKey:()=>O,Selection:()=>s,SelectionRange:()=>c,TextSelection:()=>l,Transaction:()=>v});var r=n(8638),o=n(1081),i=Object.create(null),s=function(t,e,n){this.ranges=n||[new c(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},a={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};a.anchor.get=function(){return this.$anchor.pos},a.head.get=function(){return this.$head.pos},a.from.get=function(){return this.$from.pos},a.to.get=function(){return this.$to.pos},a.$from.get=function(){return this.ranges[0].$from},a.$to.get=function(){return this.ranges[0].$to},a.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},s.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},s.prototype.replace=function(t,e){void 0===e&&(e=r.p2.empty);for(var n=e.content.lastChild,o=null,i=0;i<e.openEnd;i++)o=n,n=n.lastChild;for(var s=t.steps.length,a=this.ranges,c=0;c<a.length;c++){var l=a[c],u=l.$from,p=l.$to,h=t.mapping.slice(s);t.replaceRange(h.map(u.pos),h.map(p.pos),c?r.p2.empty:e),0==c&&g(t,s,(n?n.isInline:o&&o.isTextblock)?-1:1)}},s.prototype.replaceWith=function(t,e){for(var n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],s=i.$from,a=i.$to,c=t.mapping.slice(n),l=c.map(s.pos),u=c.map(a.pos);o?t.deleteRange(l,u):(t.replaceRangeWith(l,u,e),g(t,n,e.isInline?-1:1))}},s.findFrom=function(t,e,n){var r=t.parent.inlineContent?new l(t):m(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;o>=0;o--){var i=e<0?m(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):m(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},s.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new d(t.node(0))},s.atStart=function(t){return m(t,t,0,0,1)||new d(t)},s.atEnd=function(t){return m(t,t,t.content.size,t.childCount,-1)||new d(t)},s.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},s.jsonID=function(t,e){if(t in i)throw new RangeError("Duplicate use of selection JSON ID "+t);return i[t]=e,e.prototype.jsonID=t,e},s.prototype.getBookmark=function(){return l.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(s.prototype,a),s.prototype.visible=!0;var c=function(t,e){this.$from=t,this.$to=e},l=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=r.p2.empty),t.prototype.replace.call(this,e,n),n==r.p2.empty){var o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new u(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new e(n,r)},Object.defineProperties(e.prototype,n),e}(s);s.jsonID("text",l);var u=function(t,e){this.anchor=t,this.head=e};u.prototype.map=function(t){return new u(t.map(this.anchor),t.map(this.head))},u.prototype.resolve=function(t){return l.between(t.resolve(this.anchor),t.resolve(this.head))};var p=function(t){function e(e){var n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,r),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,s=o.pos,a=n.resolve(s);return i?t.near(a):new e(a)},e.prototype.content=function(){return new r.p2(r.HY.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new h(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(s);p.prototype.visible=!1,s.jsonID("node",p);var h=function(t){this.anchor=t};h.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,r=e.pos;return n?new u(r,r):new h(r)},h.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&p.isSelectable(n)?new p(e):s.near(e)};var d=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=r.p2.empty),n==r.p2.empty){e.delete(0,e.doc.content.size);var o=t.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return f},e}(s);s.jsonID("all",d);var f={map:function(){return this},resolve:function(t){return new d(t)}};function m(t,e,n,r,o,i){if(e.inlineContent)return l.create(t,n);for(var s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&p.isSelectable(a))return p.create(t,n-(o<0?a.nodeSize:0))}else{var c=m(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function g(t,e,n){var r=t.steps.length-1;if(!(r<e)){var i,a=t.steps[r];(a instanceof o.Pu||a instanceof o.FC)&&(t.mapping.maps[r].forEach((function(t,e,n,r){null==i&&(i=r)})),t.setSelection(s.near(t.doc.resolve(i),n)))}}var v=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(o.wx);function y(t,e){return e&&t?t.bind(e):t}var b=function(t,e,n){this.name=t,this.init=y(e.init,n),this.apply=y(e.apply,n)},k=[new b("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new b("selection",{init:function(t,e){return t.selection||s.atStart(e.doc)},apply:function(t){return t.selection}}),new b("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],w=function(t,e){var n=this;this.schema=t,this.fields=k.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new b(t.key,t.spec.state,t))}))},x=function(t){this.config=t},_={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};_.schema.get=function(){return this.config.schema},_.plugins.get=function(){return this.config.plugins},x.prototype.apply=function(t){return this.applyTransaction(t).state},x.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0},x.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var s=this.config.plugins[i];if(s.spec.appendTransaction){var a=r?r[i].n:0,c=r?r[i].state:this,l=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,c,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",t),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<i?{state:n,n:e.length}:{state:this,n:0})}e.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}},x.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new x(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}for(var i=0;i<C.length;i++)C[i](this,t,e);return e},_.tr.get=function(){return new v(this)},x.create=function(t){for(var e=new w(t.schema||t.doc.type.schema,t.plugins),n=new x(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},x.prototype.reconfigure=function(t){for(var e=new w(t.schema||this.schema,t.plugins),n=e.fields,r=new x(e),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(t,r)}return r},x.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e},x.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new w(t.schema,t.plugins),i=new x(o);return o.fields.forEach((function(o){if("doc"==o.name)i.doc=r.NB.fromJSON(t.schema,e.doc);else if("selection"==o.name)i.selection=s.fromJSON(i.doc,e.selection);else if("storedMarks"==o.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var a in n){var c=n[a],l=c.spec.state;if(c.key==o.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,a))return void(i[o.name]=l.fromJSON.call(c,t,e[a],i))}i[o.name]=o.init(t,i)}})),i},x.addApplyListener=function(t){C.push(t)},x.removeApplyListener=function(t){var e=C.indexOf(t);e>-1&&C.splice(e,1)},Object.defineProperties(x.prototype,_);var C=[];function S(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=S(o,e,{})),n[r]=o}return n}var M=function(t){this.props={},t.props&&S(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:D("plugin")};M.prototype.getState=function(t){return t[this.key]};var A=Object.create(null);function D(t){return t in A?t+"$"+ ++A[t]:(A[t]=0,t+"$")}var O=function(t){void 0===t&&(t="key"),this.key=D(t)};O.prototype.get=function(t){return t.config.pluginsByKey[this.key]},O.prototype.getState=function(t){return t[this.key]}},1081:(t,e,n)=>{"use strict";n.d(e,{vs:()=>c,FC:()=>v,Pu:()=>g,wx:()=>u,Mn:()=>C,Ax:()=>_,nj:()=>S,nd:()=>w,k9:()=>k});var r=n(8638),o=Math.pow(2,16);function i(t){return 65535&t}var s=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},a=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};a.prototype.recover=function(t){var e=0,n=i(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/o}(t)},a.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},a.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},a.prototype._map=function(t,e,n){for(var r=0,i=this.inverted?2:1,a=this.inverted?1:2,c=0;c<this.ranges.length;c+=3){var l=this.ranges[c]-(this.inverted?r:0);if(l>t)break;var u=this.ranges[c+i],p=this.ranges[c+a],h=l+u;if(t<=h){var d=l+r+((u?t==l?-1:t==h?1:e:e)<0?0:p);return n?d:new s(d,e<0?t!=l:t!=h,t==(e<0?l:h)?null:c/3+(t-l)*o)}r+=p-u}return n?t+r:new s(t+r)},a.prototype.touches=function(t,e){for(var n=0,r=i(e),o=this.inverted?2:1,s=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var c=this.ranges[a]-(this.inverted?n:0);if(c>t)break;var l=this.ranges[a+o];if(t<=c+l&&a==3*r)return!0;n+=this.ranges[a+s]-l}return!1},a.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+e],l=this.ranges[r+n];t(s,s+c,a,a+l),o+=l-c}},a.prototype.invert=function(){return new a(this.ranges,!this.inverted)},a.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},a.offset=function(t){return 0==t?a.empty:new a(t<0?[0,-t,0]:[0,0,t])},a.empty=new a([]);var c=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};function l(t){var e=Error.call(this,t);return e.__proto__=l.prototype,e}c.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new c(this.maps,this.mirror,t,e)},c.prototype.copy=function(){return new c(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},c.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},c.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:null)}},c.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},c.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},c.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},c.prototype.invert=function(){var t=new c;return t.appendMappingInverted(this),t},c.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},c.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},c.prototype._map=function(t,e,n){for(var r=!1,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(t,e);if(null!=i.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,t=this.maps[a].recover(i.recover);continue}}i.deleted&&(r=!0),t=i.pos}return n?t:new s(t,r)},l.prototype=Object.create(Error.prototype),l.prototype.constructor=l,l.prototype.name="TransformError";var u=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new c},p={before:{configurable:!0},docChanged:{configurable:!0}};function h(){throw new Error("Override me")}p.before.get=function(){return this.docs.length?this.docs[0]:this.doc},u.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new l(e.failed);return this},u.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},p.docChanged.get=function(){return this.steps.length>0},u.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(u.prototype,p);var d=Object.create(null),f=function(){};f.prototype.apply=function(t){return h()},f.prototype.getMap=function(){return a.empty},f.prototype.invert=function(t){return h()},f.prototype.map=function(t){return h()},f.prototype.merge=function(t){return null},f.prototype.toJSON=function(){return h()},f.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},f.jsonID=function(t,e){if(t in d)throw new RangeError("Duplicate use of step JSON ID "+t);return d[t]=e,e.prototype.jsonID=t,e};var m=function(t,e){this.doc=t,this.failed=e};m.ok=function(t){return new m(t,null)},m.fail=function(t){return new m(null,t)},m.fromReplace=function(t,e,n,o){try{return m.ok(t.replace(e,n,o))}catch(t){if(t instanceof r.e4)return m.fail(t.message);throw t}};var g=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&y(t,this.from,this.to)?m.fail("Structure replace would overwrite content"):m.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new a([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var o=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),o,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,r.p2.fromJSON(t,n.slice),!!n.structure)},e}(f);f.jsonID("replace",g);var v=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(y(t,this.from,this.gapFrom)||y(t,this.gapTo,this.to)))return m.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return m.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?m.fromReplace(t,this.from,this.to,n):m.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new a([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,r.p2.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(f);function y(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function b(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function k(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!b(r,o,i))break}}function w(t,e,n,r){void 0===r&&(r=t);var o=function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(x).concat({type:e,attrs:n}).concat(i.map(x)):null}function x(t){return{type:t,attrs:null}}function _(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=n-2;a>i;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),h=r&&r[c]||l;if(h!=l&&(p=p.replaceChild(0,h.type.create(h.attrs))),!l.canReplace(u+1,l.childCount)||!h.type.validContent(p))return!1}var d=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(d,d,f?f.type:o.node(i+1).type)}function C(t,e){var n,r,o=t.resolve(e),i=o.index();return n=o.nodeBefore,r=o.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&o.parent.canReplace(i,i+1)}function S(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(c>0?1:0);if(1==s?r.node(a).canReplace(l,l,o):r.node(a).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function M(t,e,n){for(var o=[],i=0;i<t.childCount;i++){var s=t.child(i);s.content.size&&(s=s.copy(M(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}return r.HY.fromArray(o)}f.jsonID("replaceAround",v),u.prototype.lift=function(t,e){for(var n=t.$from,o=t.$to,i=t.depth,s=n.before(i+1),a=o.after(i+1),c=s,l=a,u=r.HY.empty,p=0,h=i,d=!1;h>e;h--)d||n.index(h)>0?(d=!0,u=r.HY.from(n.node(h).copy(u)),p++):c--;for(var f=r.HY.empty,m=0,g=i,y=!1;g>e;g--)y||o.after(g+1)<o.end(g)?(y=!0,f=r.HY.from(o.node(g).copy(f)),m++):l++;return this.step(new v(c,l,s,a,new r.p2(u.append(f),p,m),u.size-p,!0))},u.prototype.wrap=function(t,e){for(var n=r.HY.empty,o=e.length-1;o>=0;o--)n=r.HY.from(e[o].type.create(e[o].attrs,n));var i=t.start,s=t.end;return this.step(new v(i,s,i,s,new r.p2(n,0,0),e.length,!0))},u.prototype.setBlockType=function(t,e,n,o){var i=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,o)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(s).map(e),n)){i.clearIncompatible(i.mapping.slice(s).map(e,1),n);var a=i.mapping.slice(s),c=a.map(e,1),l=a.map(e+t.nodeSize,1);return i.step(new v(c,l,c+1,l-1,new r.p2(r.HY.from(n.create(o,null,t.marks)),0,0),1,!0)),!1}})),this},u.prototype.setNodeMarkup=function(t,e,n,o){var i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");e||(e=i.type);var s=e.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(t,t+i.nodeSize,s);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new v(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new r.p2(r.HY.from(s),0,0),1,!0))},u.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var o=this.doc.resolve(t),i=r.HY.empty,s=r.HY.empty,a=o.depth,c=o.depth-e,l=e-1;a>c;a--,l--){i=r.HY.from(o.node(a).copy(i));var u=n&&n[l];s=r.HY.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}return this.step(new g(t,t,new r.p2(i.append(s),e,e),!0))},u.prototype.join=function(t,e){void 0===e&&(e=1);var n=new g(t-e,t+e,r.p2.empty,!0);return this.step(n)};var A=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new r.p2(M(n.content,(function(t,n){return n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),i),n.openStart,n.openEnd);return m.fromReplace(t,this.from,this.to,s)},e.prototype.invert=function(){return new D(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(f);f.jsonID("addMark",A);var D=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=new r.p2(M(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return m.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new A(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(f);function O(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}f.jsonID("removeMark",D),u.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,t),h=Math.min(c+r.nodeSize,e),d=n.addToSet(u),f=0;f<u.length;f++)u[f].isInSet(d)||(s&&s.to==p&&s.mark.eq(u[f])?s.to=h:o.push(s=new D(p,h,u[f])));a&&a.to==p?a.to=h:i.push(a=new A(p,h,n))}}})),o.forEach((function(t){return r.step(t)})),i.forEach((function(t){return r.step(t)})),this},u.prototype.removeMark=function(t,e,n){var o=this;void 0===n&&(n=null);var i=[],s=0;return this.doc.nodesBetween(t,e,(function(o,a){if(o.isInline){s++;var c=null;if(n instanceof r.ZU){var l=n.isInSet(o.marks);l&&(c=[l])}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length)for(var u=Math.min(a+o.nodeSize,e),p=0;p<c.length;p++){for(var h=c[p],d=void 0,f=0;f<i.length;f++){var m=i[f];m.step==s-1&&h.eq(i[f].style)&&(d=m)}d?(d.to=u,d.step=s):i.push({style:h,from:Math.max(a,t),to:u,step:s})}}})),i.forEach((function(t){return o.step(new D(t.from,t.to,t.style))})),this},u.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var o=this.doc.nodeAt(t),i=[],s=t+1,a=0;a<o.childCount;a++){var c=o.child(a),l=s+c.nodeSize,u=n.matchType(c.type,c.attrs);if(u){n=u;for(var p=0;p<c.marks.length;p++)e.allowsMarkType(c.marks[p].type)||this.step(new D(s,l,c.marks[p]))}else i.push(new g(s,l,r.p2.empty));s=l}if(!n.validEnd){var h=n.fillBefore(r.HY.empty,!0);this.replace(s,s,new r.p2(h,0,0))}for(var d=i.length-1;d>=0;d--)this.step(i[d]);return this},u.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=r.p2.empty);var o=function(t,e,n,o){if(void 0===n&&(n=e),void 0===o&&(o=r.p2.empty),e==n&&!o.size)return null;var i=t.resolve(e),s=t.resolve(n);return O(i,s,o)?new g(e,n,o):new E(i,s,o).fit()}(this.doc,t,e,n);return o&&this.step(o),this},u.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new r.p2(r.HY.from(n),0,0))},u.prototype.delete=function(t,e){return this.replace(t,e,r.p2.empty)},u.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var E=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=r.HY.empty;for(var s=t.depth;s>0;s--)this.placed=r.HY.from(t.node(s).copy(this.placed))},T={depth:{configurable:!0}};function N(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(N(t.firstChild.content,e-1,n)))}function I(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(I(t.lastChild.content,e-1,n)))}function L(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function z(t,e,n){if(e<=0)return t;var o=t.content;return e>1&&(o=o.replaceChild(0,z(o.firstChild,e-1,1==o.childCount?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(r.HY.empty,!0)))),t.copy(o)}function P(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function F(t,e,n,o,i){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(F(s.content,e+1,n,o,s)))}if(e>o){var a=i.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(r.HY.empty,!0))}return t}function q(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}T.depth.get=function(){return this.frontier.length-1},E.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&1==s.childCount;)s=s.firstChild.content,a--,c--;var l=new r.p2(s,a,c);return e>-1?new v(o.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new g(o.pos,i.pos,l):void 0},E.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,o=(e?(n=L(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var s=this.frontier[i],a=s.type,c=s.match,l=void 0,u=void 0;if(1==t&&(o?c.matchType(o.type)||(u=c.fillBefore(r.HY.from(o),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:i,parent:n,inject:u};if(2==t&&o&&(l=c.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:i,parent:n,wrap:l};if(n&&c.matchType(n.type))break}},E.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,i=L(e,n);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new r.p2(e,n+1,Math.max(o,i.size+n>=e.size-o?n+1:0)),0))},E.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,i=L(e,n);if(i.childCount<=1&&n>0){var s=e.size-n<=n+i.size;this.unplaced=new r.p2(N(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new r.p2(N(e,n,1),n,o)},E.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var c=this.unplaced,l=o?o.content:c.content,u=c.openStart-e,p=0,h=[],d=this.frontier[n],f=d.match,m=d.type;if(i){for(var g=0;g<i.childCount;g++)h.push(i.child(g));f=f.matchFragment(i)}for(var v=l.size+e-(c.content.size-c.openEnd);p<l.childCount;){var y=l.child(p),b=f.matchType(y.type);if(!b)break;(++p>1||0==u||y.content.size)&&(f=b,h.push(z(y.mark(m.allowedMarks(y.marks)),1==p?u:0,p==l.childCount?v:-1)))}var k=p==l.childCount;k||(v=-1),this.placed=I(this.placed,n,r.HY.from(h)),this.frontier[n].match=f,k&&v<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,x=l;w<v;w++){var _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=k?0==e?r.p2.empty:new r.p2(N(c.content,e-1,1),e-1,v<0?c.openEnd:e-1):new r.p2(N(c.content,e,p),c.openStart,c.openEnd)},E.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!P(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},E.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=P(t,e,o,r,i);if(s){for(var a=e-1;a>=0;a--){var c=this.frontier[a],l=c.match,u=P(t,a,c.type,l,!0);if(!u||u.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},E.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=I(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},E.prototype.openFrontierNode=function(t,e,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=I(this.placed,this.depth,r.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},E.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(r.HY.empty,!0);t.childCount&&(this.placed=I(this.placed,this.frontier.length,t))},Object.defineProperties(E.prototype,T),u.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var o=this.doc.resolve(t),i=this.doc.resolve(e);if(O(o,i,n))return this.step(new g(t,e,n));var s=q(o,this.doc.resolve(e));0==s[s.length-1]&&s.pop();var a=-(o.depth+1);s.unshift(a);for(var c=o.depth,l=o.pos-1;c>0;c--,l--){var u=o.node(c).type.spec;if(u.defining||u.isolating)break;s.indexOf(c)>-1?a=c:o.before(c)==l&&s.splice(1,0,-c)}for(var p=s.indexOf(a),h=[],d=n.openStart,f=n.content,m=0;;m++){var v=f.firstChild;if(h.push(v),m==n.openStart)break;f=v.content}d>0&&h[d-1].type.spec.defining&&o.node(p).type!=h[d-1].type?d-=1:d>=2&&h[d-1].isTextblock&&h[d-2].type.spec.defining&&o.node(p).type!=h[d-2].type&&(d-=2);for(var y=n.openStart;y>=0;y--){var b=(y+d+1)%(n.openStart+1),k=h[b];if(k)for(var w=0;w<s.length;w++){var x=s[(w+p)%s.length],_=!0;x<0&&(_=!1,x=-x);var C=o.node(x-1),S=o.index(x-1);if(C.canReplaceWith(S,S,k.type,k.marks))return this.replace(o.before(x),_?i.after(x):e,new r.p2(F(n.content,0,n.openStart,b),b,n.openEnd))}}for(var M=this.steps.length,A=s.length-1;A>=0&&(this.replace(t,e,n),!(this.steps.length>M));A--){var D=s[A];A<0||(t=o.before(D),e=i.after(D))}return this},u.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var o=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}}(this.doc,t,n.type);null!=o&&(t=e=o)}return this.replaceRange(t,e,new r.p2(r.HY.from(n),0,0))},u.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=this.doc.resolve(e),o=q(n,r),i=0;i<o.length;i++){var s=o[i],a=i==o.length-1;if(a&&0==s||n.node(s).type.contentMatch.validEnd)return this.delete(n.start(s),r.end(s));if(s>0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)}},8780:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Decoration:()=>Se,DecorationSet:()=>Oe,EditorView:()=>Be,__endComposition:()=>me,__parseFromClipboard:()=>Rt,__serializeForClipboard:()=>qt});var r=n(6922),o=n(8638),i=n(1081),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!p,s.chrome_version=p&&+p[1],s.safari=!u&&/Apple Computer/.test(navigator.vendor),s.ios=s.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var h=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},d=function(t){var e=t.parentNode;return e&&11==e.nodeType?e.host:e},f=null,m=function(t,e,n){var r=f||(f=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},g=function(t,e,n,r){return n&&(y(t,e,n,r,-1)||y(t,e,n,r,1))},v=/^(img|br|input|textarea|hr)$/i;function y(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:b(t))){var i=t.parentNode;if(1!=i.nodeType||k(t)||v.test(t.nodeName)||"false"==t.contentEditable)return!1;e=h(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?b(t):0}}}function b(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function k(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var w=function(t){var e=t.isCollapsed;return e&&s.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function x(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function _(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function C(t,e){return"number"==typeof t?t:t[e]}function S(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.left+t.clientWidth,top:e.top,bottom:e.top+t.clientHeight}}function M(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=d(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?_(i):S(s),l=0,u=0;if(e.top<c.top+C(r,"top")?u=-(c.top-e.top+C(o,"top")):e.bottom>c.bottom-C(r,"bottom")&&(u=e.bottom-c.bottom+C(o,"bottom")),e.left<c.left+C(r,"left")?l=-(c.left-e.left+C(o,"left")):e.right>c.right-C(r,"right")&&(l=e.right-c.right+C(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var p=s.scrollLeft,h=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var f=s.scrollLeft-p,m=s.scrollTop-h;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(a)break}}function A(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=d(t));return e}function D(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}var O=null;function E(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,c=t.firstChild,l=0;c;c=c.nextSibling,l++){var u=void 0;if(1==c.nodeType)u=c.getClientRects();else{if(3!=c.nodeType)continue;u=m(c).getClientRects()}for(var p=0;p<u.length;p++){var h=u[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);var d=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(d<o){n=c,o=d,r=d&&3==n.nodeType?{left:h.right<e.left?h.right:h.left,top:e.top}:e,1==c.nodeType&&d&&(i=l+(e.left>=(h.left+h.right)/2?1:0));continue}}!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=L(r,1);if(i.top!=i.bottom&&T(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:E(n,r)}function T(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function N(t,e,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var s=t.childNodes[i];if(1==s.nodeType)for(var a=s.getClientRects(),c=0;c<a.length;c++){var l=a[c];if(T(e,l))return N(s,e,l)}if((i=(i+1)%r)==o)break}return t}function I(t,e){var n,r,o,i,a=t.root;if(a.caretPositionFromPoint)try{var c=a.caretPositionFromPoint(e.left,e.top);c&&(o=(n=c).offsetNode,i=n.offset)}catch(t){}if(!o&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(e.left,e.top);l&&(o=(r=l).startContainer,i=r.startOffset)}var u,p=a.elementFromPoint(e.left,e.top+1);if(!p||!t.dom.contains(1!=p.nodeType?p.parentNode:p)){var h=t.dom.getBoundingClientRect();if(!T(e,h))return null;if(!(p=N(t.dom,e,h)))return null}if(s.safari&&p.draggable&&(o=i=null),p=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(p,e),o){if(s.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var d,f=o.childNodes[i];"IMG"==f.nodeName&&(d=f.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==u&&(u=function(t,e,n){var r=E(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,p,e));var m=t.docView.nearestDesc(p,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function L(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var z=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function P(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,a=s.webkit||s.gecko;if(3==o.nodeType){if(!a||!z.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var c=i,l=i,u=n<0?1:-1;return n<0&&!i?(l++,u=-1):n>=0&&i==o.nodeValue.length?(c--,u=1):n<0?c--:l++,F(L(m(o,c,l),u),u<0)}var p=L(m(o,i,i),n);if(s.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var h=L(m(o,i-1,i-1),-1);if(h.top==p.top){var d=L(m(o,i,i+1),-1);if(d.top!=p.top)return F(d,d.left<h.left)}}return p}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==b(o))){var f=o.childNodes[i-1];if(1==f.nodeType)return q(f.getBoundingClientRect(),!1)}if(i<b(o)){var g=o.childNodes[i];if(1==g.nodeType)return q(g.getBoundingClientRect(),!0)}return q(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==b(o))){var v=o.childNodes[i-1],y=3==v.nodeType?m(v,b(v)-(a?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(y)return F(L(y,1),!1)}if(i<b(o)){var k=o.childNodes[i],w=3==k.nodeType?m(k,0,a?0:1):1==k.nodeType?k:null;if(w)return F(L(w,-1),!0)}return F(L(3==o.nodeType?m(o):o,-n),n>=0)}function F(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function q(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function R(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var B=/[\u0590-\u08ac]/,V=null,j=null,$=!1;var H=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},U={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};H.prototype.matchesWidget=function(){return!1},H.prototype.matchesMark=function(){return!1},H.prototype.matchesNode=function(){return!1},H.prototype.matchesHack=function(){return!1},U.beforePosition.get=function(){return!1},H.prototype.parseRule=function(){return null},H.prototype.stopEvent=function(){return!1},U.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},U.border.get=function(){return 0},H.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},H.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var r=this.children[e];if(r==t)return n;n+=r.size}},U.posBefore.get=function(){return this.parent.posBeforeChild(this)},U.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},U.posAfter.get=function(){return this.posBefore+this.size},U.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},H.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,o;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var l=t;;l=l.parentNode){if(l==this.dom){a=!0;break}if(l.parentNode.lastChild!=l)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},H.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},H.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},H.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},H.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}},H.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,o=!0;;r++,o=!1){for(;r<this.children.length&&(this.children[r].beforePosition||this.children[r].dom.parentNode!=this.contentDOM);)n+=this.children[r++].size;var i=r==this.children.length?null:this.children[r];if(n==t&&(0==e||!i||i.border||e<0&&o))return{node:this.contentDOM,offset:i?h(i.dom):this.contentDOM.childNodes.length};if(!i)throw new Error("Invalid position "+t);var s=n+i.size;if(e<0&&!i.border?s>=t:s>t)return i.domFromPos(t-n-i.border,e);n=s}},H.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var l=i+a.border;if(t>=l&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,l);t=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=h(p.dom)+1;break}t-=p.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var d=s+1;d<this.children.length;d++){var f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=h(f.dom);break}e+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}},H.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},H.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},H.prototype.setSelection=function(t,e,n,r){for(var o=Math.min(t,e),i=Math.max(t,e),a=0,c=0;a<this.children.length;a++){var l=this.children[a],u=c+l.size;if(o>c&&i<u)return l.setSelection(t-c-l.border,e-c-l.border,n,r);c=u}var p=this.domFromPos(t,t?-1:1),h=e==t?p:this.domFromPos(e,e?-1:1),d=n.getSelection(),f=!1;if((s.gecko||s.safari)&&t==e)if(3==p.node.nodeType)f=p.offset&&"\n"==p.node.nodeValue[p.offset-1];else{var m=p.node.childNodes[p.offset-1];f=m&&("BR"==m.nodeName||"false"==m.contentEditable)}if(r||f&&s.safari||!g(p.node,p.offset,d.anchorNode,d.anchorOffset)||!g(h.node,h.offset,d.focusNode,d.focusOffset)){var v=!1;if((d.extend||t==e)&&!f){d.collapse(p.node,p.offset);try{t!=e&&d.extend(h.node,h.offset),v=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!v){if(t>e){var y=p;p=h,h=y}var b=document.createRange();b.setEnd(h.node,h.offset),b.setStart(p.node,p.offset),d.removeAllRanges(),d.addRange(b)}}},H.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},U.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},H.prototype.markDirty=function(t,e){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},H.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Object.defineProperties(H.prototype,U);var W=[],J=function(t){function e(e,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}t.call(this,e,W,s,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={beforePosition:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},Object.defineProperties(e.prototype,n),e}(H),G=function(t){function e(e,n,r,o){t.call(this,e,W,n,null),this.textDOM=r,this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(H),K=function(t){function e(e,n,r,o){t.call(this,e,[],r,o),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,i){var s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return a&&a.dom||(a=o.PW.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,a.dom,a.contentDOM||a.dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,r){var o=e.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=ht(i,n,s,r)),t>0&&(i=ht(i,0,t,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},e}(H),Y=function(t){function e(e,n,r,o,i,s,a,c,l){t.call(this,e,n.isLeaf?W:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,l)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0}};return e.create=function(t,n,r,i,s,a){var c,l,u=s.nodeViews[n.type.name],p=u&&u(n,s,(function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a}),r),h=p&&p.dom,d=p&&p.contentDOM;if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else h||(h=(c=o.PW.renderSpec(document,n.type.spec.toDOM(n))).dom,d=c.contentDOM);d||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),n.type.spec.draggable&&(h.draggable=!0));var f=h;return h=at(h,r,n),p?l=new tt(t,n,r,i,h,d,f,p,s,a+1):n.isText?new Q(t,n,r,i,h,f,s):new e(t,n,r,i,h,d,f,s,a+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?o.HY.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&ct(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,r=this.node.inlineContent,i=e,a=r&&t.composing&&this.localCompositionNode(t,e),c=new ut(this,a&&a.node);!function(t,e,n,r){var o=e.locals(t),i=0;if(0!=o.length)for(var s=0,a=[],c=null,l=0;;){if(s<o.length&&o[s].to==i){for(var u=o[s++],p=void 0;s<o.length&&o[s].to==i;)(p||(p=[u])).push(o[s++]);if(p){p.sort(pt);for(var h=0;h<p.length;h++)n(p[h],l,!!c)}else n(u,l,!!c)}var d=void 0,f=void 0;if(c)f=-1,d=c,c=null;else{if(!(l<t.childCount))break;f=l,d=t.child(l++)}for(var m=0;m<a.length;m++)a[m].to<=i&&a.splice(m--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);var g=i+d.nodeSize;if(d.isText){var v=g;s<o.length&&o[s].from<v&&(v=o[s].from);for(var y=0;y<a.length;y++)a[y].to<v&&(v=a[y].to);v<g&&(c=d.cut(v-i),d=d.cut(0,v-i),g=v,f=-1)}r(d,a.length?d.isInline&&!d.isLeaf?a.filter((function(t){return!t.inline})):a.slice():W,e.forChild(i,d),f),i=g}else for(var b=0;b<t.childCount;b++){var k=t.child(b);r(k,o,e.forChild(i,k),b),i+=k.nodeSize}}(this.node,this.innerDeco,(function(e,s,a){e.spec.marks?c.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!a&&c.syncToMarks(s==n.node.childCount?o.vc.none:n.node.child(s).marks,r,t),c.placeWidget(e,t,i)}),(function(e,n,o,s){c.syncToMarks(e.marks,r,t),c.findNodeMatch(e,n,o,s)||c.updateNextNode(e,n,o,t,s)||c.addNode(e,n,o,t,i),i+=e.nodeSize})),c.syncToMarks(W,r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),et(this.contentDOM,this.children,t),s.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionNode=function(t,e){var n=t.state.selection,o=n.from,i=n.to;if(!(!(t.state.selection instanceof r.TextSelection)||o<e||i>e+this.node.content.size)){var s=t.root.getSelection(),a=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=b(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(s.focusNode,s.focusOffset);if(a&&this.dom.contains(a.parentNode)){var c=a.nodeValue,l=function(t,e,n,r){for(var o=0,i=0;o<t.childCount&&i<=r;){var s=t.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<t.childCount;){var l=t.child(o++);if(i+=l.nodeSize,!l.isText)break;c+=l.text}if(i>=n){var u=c.lastIndexOf(e,r-a);if(u>=0&&u+e.length+a>=n)return a+u}}}return-1}(this.node.content,c,o-e,i-e);return l<0?null:{node:a,pos:l,text:c}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new G(this,i,n,o);t.compositionNodes.push(s),this.children=ht(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,r),0))},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!ct(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=it(this.dom,this.nodeDOM,ot(this.outerDeco,this.node,e),ot(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},Object.defineProperties(e.prototype,n),e}(H);function Z(t,e,n,r,o){return at(r,e,t),new Y(null,t,e,n,r,r,r,o,0)}var Q=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,0))},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e}(Y),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return 0==this.dirty},e}(H),tt=function(t){function e(e,n,r,o,i,s,a,c,l,u){t.call(this,e,n,r,o,i,s,a,l,u),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(Y);function et(t,e,n){for(var r=t.firstChild,o=!1,i=0;i<e.length;i++){var s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=lt(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof K){var c=r?r.previousSibling:t.lastChild;et(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=lt(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}function nt(t){t&&(this.nodeName=t)}nt.prototype=Object.create(null);var rt=[new nt];function ot(t,e,n){if(0==t.length)return rt;for(var r=n?rt[0]:new nt,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs;if(s)for(var a in s.nodeName&&o.push(r=new nt(s.nodeName)),s){var c=s[a];null!=c&&(n&&1==o.length&&o.push(r=new nt(e.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+c:"style"==a?r.style=(r.style?r.style+";":"")+c:"nodeName"!=a&&(r[a]=c))}}return o}function it(t,e,n,r){if(n==rt&&r==rt)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=t&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName||((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=rt[0]),o=c}st(o,a||rt[0],s)}return o}function st(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){for(var i=e.class?e.class.split(" "):W,s=n.class?n.class.split(" "):W,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c])}if(e.style!=n.style){if(e.style)for(var l,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=u.exec(e.style);)t.style.removeProperty(l[1]);n.style&&(t.style.cssText+=n.style)}}function at(t,e,n){return it(t,t,rt,ot(e,n,1!=t.nodeType))}function ct(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function lt(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var ut=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1;var n=function(t,e){for(var n=[],r=t.childCount,o=e.length-1;r>0&&o>=0;o--){var i=e[o],s=i.node;if(s){if(s!=t.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(t.node.content,t.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function pt(t,e){return t.type.side-e.type.side}function ht(t,e,n,r,o){for(var i=[],s=0,a=0;s<t.length;s++){var c=t[s],l=a,u=a+=c.size;l>=n||u<=e?i.push(c):(l<e&&i.push(c.slice(0,e-l,r)),o&&(i.push(o),o=null),u>n&&i.push(c.slice(n-l,c.size,r)))}return i}function dt(t,e){var n=t.root.getSelection(),o=t.state.doc;if(!n.focusNode)return null;var i=t.docView.nearestDesc(n.focusNode),s=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var c,l,u=o.resolve(a);if(w(n)){for(c=u;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&r.NodeSelection.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(t,e,n){for(var r=0==e,o=e==b(t);r||o;){if(t==n)return!0;var i=h(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==b(t)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new r.NodeSelection(a==p?u:o.resolve(p))}}else{var d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;c=o.resolve(d)}return l||(l=wt(t,c,u,"pointer"==e||t.state.selection.head<u.pos&&!s?1:-1)),l}function ft(t,e){var n=t.state.selection;if(bt(t,n),t.editable?t.hasFocus():xt(t)&&document.activeElement&&document.activeElement.contains(t.dom)){if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,h(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&s.ie&&s.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{var o,i,a=n.anchor,c=n.head;!mt||n instanceof r.TextSelection||(n.$from.parent.inlineContent||(o=gt(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=gt(t,n.to))),t.docView.setSelection(a,c,t.root,e),mt&&(o&&yt(o),i&&yt(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.hideSelectionGuard),t.dom.classList.remove("ProseMirror-hideselection"))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}ut.prototype.getPreMatch=function(t){return t>=this.preMatchOffset?this.preMatched[t-this.preMatchOffset]:null},ut.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},ut.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},ut.prototype.syncToMarks=function(t,e,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,t.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(t[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=K.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},ut.prototype.findNodeMatch=function(t,e,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(t,e,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a<c;a++){var l=s[a];if(l.matchesNode(t,e,n)&&this.preMatched.indexOf(l)<0){o=a;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))},ut.prototype.updateNextNode=function(t,e,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof Y){var a=this.preMatched.indexOf(s);if(a>-1&&a+this.preMatchOffset!=o)return!1;var c=s.dom;if((!this.lock||!(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))||t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&ct(e,s.outerDeco))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},ut.prototype.addNode=function(t,e,n,r,o){this.top.children.splice(this.index++,0,Y.create(this.top,t,e,n,r,o)),this.changed=!0},ut.prototype.placeWidget=function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var o=new J(this.top,t,e,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},ut.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof K;)t=t.children[t.children.length-1];if(!t||!(t instanceof Q)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new X(this.top,W,e,null)),this.changed=!0}};var mt=s.safari||s.chrome&&s.chrome_version<63;function gt(t,e){var n=t.docView.domFromPos(e,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(s.safari&&i&&"false"==i.contentEditable)return vt(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return vt(i);if(a)return vt(a)}}function vt(t){return t.contentEditable="true",s.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function yt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function bt(t,e){if(e instanceof r.NodeSelection){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(kt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else kt(t)}function kt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function wt(t,e,n,o){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||r.TextSelection.between(e,n,o)}function xt(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function _t(t,e){var n=t.selection,o=n.$anchor,i=n.$head,s=e>0?o.max(i):o.min(i),a=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,e)}function Ct(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function St(t,e,n){var o=t.state.selection;if(!(o instanceof r.TextSelection)){if(o instanceof r.NodeSelection&&o.node.isInline)return Ct(t,new r.TextSelection(e>0?o.$to:o.$from));var i=_t(t.state,e);return!!i&&Ct(t,i)}if(!o.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var a=_t(t.state,e);return!!(a&&a instanceof r.NodeSelection)&&Ct(t,a)}if(!(s.mac&&n.indexOf("m")>-1)){var c,l=o.$head,u=l.textOffset?null:e<0?l.nodeBefore:l.nodeAfter;if(!u||u.isText)return!1;var p=e<0?l.pos-u.nodeSize:l.pos;return!!(u.isAtom||(c=t.docView.descAt(p))&&!c.contentDOM)&&(r.NodeSelection.isSelectable(u)?Ct(t,new r.NodeSelection(e<0?t.state.doc.resolve(l.pos-u.nodeSize):l)):!!s.webkit&&Ct(t,new r.TextSelection(t.state.doc.resolve(e<0?p:p+u.nodeSize))))}}function Mt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function At(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Dt(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,a=!1;for(s.gecko&&1==n.nodeType&&r<Mt(n)&&At(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var c=n.childNodes[r-1];if(At(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(Et(n))break;for(var l=n.previousSibling;l&&At(l);)o=n.parentNode,i=h(l),l=l.previousSibling;if(l)r=Mt(n=l);else{if((n=n.parentNode)==t.dom)break;r=0}}a?Tt(t,e,n,r):o&&Tt(t,e,o,i)}}function Ot(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Mt(n);;)if(r<s){if(1!=n.nodeType)break;if(!At(n.childNodes[r]))break;o=n,i=++r}else{if(Et(n))break;for(var a=n.nextSibling;a&&At(a);)o=a.parentNode,i=h(a)+1,a=a.nextSibling;if(a)r=0,s=Mt(n=a);else{if((n=n.parentNode)==t.dom)break;r=s=0}}o&&Tt(t,e,o,i)}}function Et(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Tt(t,e,n,r){if(w(e)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),e.removeAllRanges(),e.addRange(o)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&ft(t)}),50)}function Nt(t,e,n){var o=t.state.selection;if(o instanceof r.TextSelection&&!o.empty||n.indexOf("s")>-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var c=_t(t.state,e);if(c&&c instanceof r.NodeSelection)return Ct(t,c)}if(!i.parent.inlineContent){var l=r.Selection.findFrom(e<0?i:a,e);return!l||Ct(t,l)}return!1}function It(t,e){if(!(t.state.selection instanceof r.TextSelection))return!0;var n=t.state.selection,o=n.$head,i=n.$anchor,s=n.empty;if(!o.sameParent(i))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!o.textOffset&&(e<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var c=t.state.tr;return e<0?c.delete(o.pos-a.nodeSize,o.pos):c.delete(o.pos,o.pos+a.nodeSize),t.dispatch(c),!0}return!1}function Lt(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function zt(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(s.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||s.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function Pt(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:wt(t,e.resolve(n.anchor),e.resolve(n.head))}function Ft(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function qt(t,e){for(var n=[],r=e.content,i=e.openStart,s=e.openEnd;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var c=t.someProp("clipboardSerializer")||o.PW.fromSchema(t.state.schema),l=Wt(),u=l.createElement("div");u.appendChild(c.serializeFragment(r,{document:l}));for(var p,h=u.firstChild;h&&1==h.nodeType&&(p=Ht[h.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var f=l.createElement(p[d]);u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f)}h=u.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(n)),{dom:u,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Rt(t,e,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!e)return null;var l=e&&(r||c||!n);if(l){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return new o.p2(o.HY.from(t.state.schema.text(e)),0,0);var u=t.someProp("clipboardTextParser",(function(t){return t(e,i,r)}));u?a=u:(s=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){s.appendChild(document.createElement("p")).textContent=t})))}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=Wt().createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),i=0;(n=o&&Ht[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""),i=n.length),r.innerHTML=t;for(var s=0;s<i;s++)r=r.firstChild;return r}(n);var p=s&&s.querySelector("[data-pm-slice]"),h=p&&/^(\d+) (\d+) (.*)/.exec(p.getAttribute("data-pm-slice"));if(!a){var d=t.someProp("clipboardParser")||t.someProp("domParser")||o.aw.fromSchema(t.state.schema);a=d.parseSlice(s,{preserveWhitespace:!(!l&&!h),context:i})}return a=h?function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var i=t.content,s=t.openStart,a=t.openEnd,c=n.length-2;c>=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=o.HY.from(l.create(n[c+1],i)),s++,a++}return new o.p2(i,s,a)}(function(t,e,n){return e<t.openStart&&(t=new o.p2($t(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new o.p2($t(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}(a,+h[1],+h[2]),h[3]):o.p2.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),i=void 0,s=[];if(t.forEach((function(t){if(s){var e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&i.length&&Vt(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=jt(s[s.length-1],i.length));var o=Bt(t,n);s.push(o),r=r.matchType(o.type,o.attrs),i=n}}})),s)return{v:o.HY.from(s)}},r=e.depth;r>=0;r--){var i=n(r);if(i)return i.v}return t}(a.content,i),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function Bt(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,o.HY.from(t));return t}function Vt(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){var s=Vt(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(o.HY.from(Bt(n,t,i+1))))}}function jt(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,jt(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(o.HY.empty,!0);return t.copy(n.append(r))}function $t(t,e,n,r,i,s){var a=e<0?t.firstChild:t.lastChild,c=a.content;return i<r-1&&(c=$t(c,e,n,r,i+1,s)),i>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.HY.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}var Ht={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Ut=null;function Wt(){return Ut||(Ut=document.implementation.createHTMLDocument("title"))}var Jt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gt=s.ie&&s.ie_version<=11,Kt=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Kt.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},Kt.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Yt=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);s.ie&&s.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new Kt,Gt&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Yt.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},Yt.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Yt.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Jt),Gt&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Yt.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}Gt&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Yt.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Yt.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Yt.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},Yt.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&xt(t)){var t;if(this.suppressingSelectionUpdates)return ft(this.view);if(s.ie&&s.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&g(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},Yt.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Yt.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},Yt.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&xt(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var c=0;c<t.length;c++){var l=this.registerMutation(t[c],a);l&&(r=r<0?l.from:Math.min(l.from,r),o=o<0?l.to:Math.max(l.to,o),l.typeOver&&(i=!0))}if(s.gecko&&a.length>1){var u=a.filter((function(t){return"BR"==t.nodeName}));if(2==u.length){var p=u[0],h=u[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),d=this.view,Zt||(Zt=!0,"normal"==getComputedStyle(d.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||ft(this.view))}var d},Yt.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){var r=t.previousSibling,o=t.nextSibling;if(s.ie&&s.ie_version<=11&&t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){var a=t.addedNodes[i],c=a.previousSibling,l=a.nextSibling;(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(r=c),(!l||Array.prototype.indexOf.call(t.addedNodes,l)<0)&&(o=l)}for(var u=r&&r.parentNode==t.target?h(r)+1:0,p=n.localPosFromDOM(t.target,u,-1),d=o&&o.parentNode==t.target?h(o):t.target.childNodes.length,f=0;f<t.addedNodes.length;f++)e.push(t.addedNodes[f]);return{from:p,to:n.localPosFromDOM(t.target,d,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var Zt=!1,Qt={},Xt={};function te(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function ee(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return ne(t,e)})}))}function ne(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function re(t){return{left:t.clientX,top:t.clientY}}function oe(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,(function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function ie(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function se(t,e,n,r){return oe(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function ae(t,e,n,o){return oe(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",(function(n){return n(t,e,o)}))||function(t,e){var n=t.state.doc;if(-1==e)return!!n.inlineContent&&(ie(t,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var o=n.resolve(e),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)ie(t,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;ie(t,r.NodeSelection.create(n,a),"pointer")}return!0}}(t,n)}function ce(t){return me(t)}Xt.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!pe(t,e))if(t.domObserver.forceFlush(),t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!s.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||function(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||s.mac&&72==n&&"c"==r?It(t,-1)||Dt(t):46==n||s.mac&&68==n&&"c"==r?It(t,1)||Ot(t):13==n||27==n||(37==n?St(t,-1,r)||Dt(t):39==n?St(t,1,r)||Ot(t):38==n?Nt(t,-1,r)||Dt(t):40==n?function(t){if(s.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Lt(t,o,!0),setTimeout((function(){return Lt(t,o,!1)}),20)}}}(t)||Nt(t,1,r)||Ot(t):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}(t,e)?e.preventDefault():te(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,x(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},Xt.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},Xt.keypress=function(t,e){if(!(pe(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||s.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,o)}))||t.dispatch(t.state.tr.insertText(o).scrollIntoView()),e.preventDefault()}}};var le=s.mac?"metaKey":"ctrlKey";Qt.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=ce(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[le]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(re(e));i&&("singleClick"==o?t.mouseDown=new ue(t,i,e,n):("doubleClick"==o?se:ae)(t,i.pos,i.inside,e)?e.preventDefault():te(t,"pointer"))};var ue=function(t,e,n,o){var i,a,c=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=o,this.selectNode=n[le],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),a=e.inside;else{var l=t.state.doc.resolve(e.pos);i=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var u=o?null:n.target,p=u?t.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||t.state.selection instanceof r.NodeSelection&&a==t.state.selection.from)&&(this.mightDrag={node:i,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){return c.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),te(t,"pointer")};function pe(t,e){return!!t.composing||!!(s.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}ue.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},ue.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(re(t))),this.allowDefault||!e?te(this.view,"pointer"):function(t,e,n,o,i){return oe(t,"handleClickOn",e,n,o)||t.someProp("handleClick",(function(n){return n(t,e,o)}))||(i?function(t,e){if(-1==e)return!1;var n,o,i=t.state.selection;i instanceof r.NodeSelection&&(n=i.node);for(var s=t.state.doc.resolve(e),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(c)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(ie(t,r.NodeSelection.create(t.state.doc,o),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),o=n.nodeAfter;return!!(o&&o.isAtom&&r.NodeSelection.isSelectable(o))&&(ie(t,new r.NodeSelection(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(e.pos==this.view.state.selection.from||e.pos==this.view.state.selection.to)?(ie(this.view,r.Selection.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):te(this.view,"pointer")}},ue.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),te(this.view,"pointer")},Qt.touchdown=function(t){ce(t),te(t,"pointer")},Qt.contextmenu=function(t){return ce(t)};var he=s.android?5e3:-1;function de(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return me(t)}),e))}function fe(t){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function me(t,e){if(t.domObserver.forceFlush(),fe(t),e||t.docView.dirty){var n=dt(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}Xt.compositionstart=Xt.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),me(t,!0),t.markCursor=null;else if(me(t),s.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}t.composing=!0}de(t,he)},Xt.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,de(t,20))};var ge=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function ve(t,e,n,r){var i=Rt(t,e,n,t.shiftKey,t.state.selection.$from);if(!t.someProp("handlePaste",(function(e){return e(t,r,i||o.p2.empty)}))&&i){var s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=s?t.state.tr.replaceSelectionWith(s,t.shiftKey):t.state.tr.replaceSelection(i);t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}Qt.copy=Xt.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=ge?null:e.clipboardData,i=qt(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Xt.paste=function(t,e){var n=ge?null:e.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(ve(t,o,r,e),e.preventDefault()):function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ve(t,r.value,null,e):ve(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)};var ye=function(t,e){this.slice=t,this.move=e},be=s.mac?"altKey":"ctrlKey";for(var ke in Qt.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var o=t.state.selection,i=o.empty?null:t.posAtCoords(re(e));if(i&&i.pos>=o.from&&i.pos<=(o instanceof r.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(r.NodeSelection.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var s=t.docView.nearestDesc(e.target,!0);if(!s||!s.node.type.spec.draggable||s==t.docView)return;t.dispatch(t.state.tr.setSelection(r.NodeSelection.create(t.state.doc,s.posBefore)))}var a=t.state.selection.content(),c=qt(t,a),l=c.dom,u=c.text;e.dataTransfer.clearData(),e.dataTransfer.setData(ge?"Text":"text/html",l.innerHTML),ge||e.dataTransfer.setData("text/plain",u),t.dragging=new ye(a,!e[be])}},Qt.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},Xt.dragover=Xt.dragenter=function(t,e){return e.preventDefault()},Xt.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var s=t.posAtCoords(re(e));if(s){var a=t.state.doc.resolve(s.pos);if(a){var c=n&&n.slice||Rt(t,e.dataTransfer.getData(ge?"Text":"text/plain"),ge?null:e.dataTransfer.getData("text/html"),!1,a),l=n&&!e[be];if(t.someProp("handleDrop",(function(n){return n(t,e,c||o.p2.empty,l)})))e.preventDefault();else if(c){e.preventDefault();var u=c?(0,i.nj)(t.state.doc,a.pos,c):a.pos;null==u&&(u=a.pos);var p=t.state.tr;l&&p.deleteSelection();var h=p.mapping.map(u),d=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,f=p.doc;if(d?p.replaceRangeWith(h,h,c.content.firstChild):p.replaceRange(h,h,c),!p.doc.eq(f)){var m=p.doc.resolve(h);if(d&&r.NodeSelection.isSelectable(c.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(c.content.firstChild))p.setSelection(new r.NodeSelection(m));else{var g=p.mapping.map(u);p.mapping.maps[p.mapping.maps.length-1].forEach((function(t,e,n,r){return g=r})),p.setSelection(wt(t,m,p.doc.resolve(g)))}t.focus(),t.dispatch(p.setMeta("uiEvent","drop"))}}}}}},Qt.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&ft(t)}),20))},Qt.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},Qt.beforeinput=function(t,e){if(s.chrome&&s.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,x(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},Xt)Qt[ke]=Xt[ke];function we(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var xe=function(t,e){this.spec=e||De,this.side=this.spec.side||0,this.toDOM=t};xe.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Se(i-n,i-n,this)},xe.prototype.valid=function(){return!0},xe.prototype.eq=function(t){return this==t||t instanceof xe&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&we(this.spec,t.spec))};var _e=function(t,e){this.spec=e||De,this.attrs=t};_e.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Se(o,i,this)},_e.prototype.valid=function(t,e){return e.from<e.to},_e.prototype.eq=function(t){return this==t||t instanceof _e&&we(this.attrs,t.attrs)&&we(this.spec,t.spec)},_e.is=function(t){return t.type instanceof _e};var Ce=function(t,e){this.spec=e||De,this.attrs=t};Ce.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Se(o.pos-n,i.pos-n,this)},Ce.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,o=n.offset;return o==e.from&&o+t.child(r).nodeSize==e.to},Ce.prototype.eq=function(t){return this==t||t instanceof Ce&&we(this.attrs,t.attrs)&&we(this.spec,t.spec)};var Se=function(t,e,n){this.from=t,this.to=e,this.type=n},Me={spec:{configurable:!0},inline:{configurable:!0}};Se.prototype.copy=function(t,e){return new Se(t,e,this.type)},Se.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},Se.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},Se.widget=function(t,e,n){return new Se(t,t,new xe(e,n))},Se.inline=function(t,e,n,r){return new Se(t,e,new _e(n,r))},Se.node=function(t,e,n,r){return new Se(t,e,new Ce(n,r))},Me.spec.get=function(){return this.type.spec},Me.inline.get=function(){return this.type instanceof _e},Object.defineProperties(Se.prototype,Me);var Ae=[],De={},Oe=function(t,e){this.local=t&&t.length?t:Ae,this.children=e&&e.length?e:Ae};Oe.create=function(t,e){return e.length?ze(e,t,0,De):Ee},Oe.prototype.find=function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r},Oe.prototype.findInner=function(t,e,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>t){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Oe.prototype.map=function(t,e,n){return this==Ee||0==t.maps.length?this:this.mapInner(t,e,0,0,n||De)},Oe.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){for(var a=t.slice(),c=function(t,e,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],l=void 0;-1==c||t>c+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(l=r-n-(e-t))&&(a[s]+=l,a[s+1]+=l))}},l=0;l<n.maps.length;l++)n.maps[l].forEach(c);for(var u=!1,p=0;p<a.length;p+=3)if(-1==a[p+1]){var h=n.map(t[p]+i),d=h-o;if(d<0||d>=r.content.size){u=!0;continue}var f=n.map(t[p+1]+i,-1)-o,m=r.content.findIndex(d),g=m.index,v=m.offset,y=r.maybeChild(g);if(y&&v==d&&v+y.nodeSize==f){var b=a[p+2].mapInner(n,y,h+1,t[p]+i+1,s);b!=Ee?(a[p]=d,a[p+1]=f,a[p+2]=b):(a[p+1]=-2,u=!0)}else u=!0}if(u){var k=ze(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;i<t.local.length;i++){var c=t.local[i].map(r,o,e);c?n.push(c):s.onRemove&&s.onRemove(t.local[i].spec)}for(var l=0;l<t.children.length;l+=3)a(t.children[l+2],t.children[l]+e+1)}for(var c=0;c<t.length;c+=3)-1==t[c+1]&&a(t[c+2],e[c]+i+1);return n}(a,t,e||[],n,o,i,s),r,0,s);e=k.local;for(var w=0;w<a.length;w+=3)a[w+1]<0&&(a.splice(w,3),w-=3);for(var x=0,_=0;x<k.children.length;x+=3){for(var C=k.children[x];_<a.length&&a[_]<C;)_+=3;a.splice(_,0,k.children[x],k.children[x+1],k.children[x+2])}}return new Oe(e&&e.sort(Pe),a)}(this.children,i,t,e,n,r,o):i?new Oe(i.sort(Pe)):Ee},Oe.prototype.add=function(t,e){return e.length?this==Ee?Oe.create(t,e):this.addInner(t,e,0):this},Oe.prototype.addInner=function(t,e,n){var r,o=this,i=0;t.forEach((function(t,s){var a,c=s+n;if(a=Ie(e,t,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(t,a,c+1):r.splice(i,0,s,s+t.nodeSize,ze(a,t,c+1,De)),i+=3}}));var s=Ne(i?Le(e):e,-n);return new Oe(s.length?this.local.concat(s).sort(Pe):this.local,r||this.children)},Oe.prototype.remove=function(t){return 0==t.length||this==Ee?this:this.removeInner(t,0)},Oe.prototype.removeInner=function(t,e){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+e,a=n[o+1]+e,c=0,l=void 0;c<t.length;c++)(l=t[c])&&l.from>s&&l.to<a&&(t[c]=null,(i||(i=[])).push(l));if(i){n==this.children&&(n=this.children.slice());var u=n[o+2].removeInner(i,s+1);u!=Ee?n[o+2]=u:(n.splice(o,3),o-=3)}}if(r.length)for(var p=0,h=void 0;p<t.length;p++)if(h=t[p])for(var d=0;d<r.length;d++)r[d].eq(h,e)&&(r==this.local&&(r=this.local.slice()),r.splice(d--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Oe(r,n):Ee},Oe.prototype.forChild=function(t,e){if(this==Ee)return this;if(e.isLeaf)return Oe.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof _e){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;l<u&&(r||(r=[])).push(c.copy(l,u))}}if(r){var p=new Oe(r.sort(Pe));return n?new Te([p,n]):p}return n||Ee},Oe.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof Oe)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},Oe.prototype.locals=function(t){return Fe(this.localsInner(t))},Oe.prototype.localsInner=function(t){if(this==Ee)return Ae;if(t.inlineContent||!this.local.some(_e.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof _e||e.push(this.local[n]);return e};var Ee=new Oe;Oe.empty=Ee,Oe.removeOverlap=Fe;var Te=function(t){this.members=t};function Ne(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new Se(o.from+e,o.to+e,o.type))}return n}function Ie(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Le(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function ze(t,e,n,r){var o=[],i=!1;e.forEach((function(e,s){var a=Ie(t,e,s+n);if(a){i=!0;var c=ze(a,e,n+s+1,r);c!=Ee&&o.push(s,s+e.nodeSize,c)}}));for(var s=Ne(i?Le(t):t,-n).sort(Pe),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Oe(s,o):Ee}function Pe(t,e){return t.from-e.from||t.to-e.to}function Fe(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),qe(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),qe(e,o+1,i.copy(r.to,i.to)))}}return e}function qe(t,e,n){for(;e<t.length&&Pe(n,t[e])>0;)e++;t.splice(e,0,n)}function Re(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=Ee&&e.push(r)})),t.cursorWrapper&&e.push(Oe.create(t.state.doc,[t.cursorWrapper.deco])),Te.from(e)}Te.prototype.forChild=function(t,e){if(e.isLeaf)return Oe.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(t,e);o!=Ee&&(o instanceof Te?n=n.concat(o.members):n.push(o))}return Te.from(n)},Te.prototype.eq=function(t){if(!(t instanceof Te)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Te.prototype.locals=function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<o.length;i++)e.push(o[i])}else e=o}return e?Fe(n?e:e.sort(Pe)):Ae},Te.from=function(t){switch(t.length){case 0:return Ee;case 1:return t[0];default:return new Te(t)}};var Be=function(t,e){this._props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=He(this),this.markCursor=null,this.cursorWrapper=null,$e(this),this.nodeViews=Ue(this),this.docView=Z(this.state.doc,je(this),Re(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new Yt(t,(function(e,n,i,a){return function(t,e,n,i,a){if(e<0){var c=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,l=dt(t,c);if(l&&!t.state.selection.eq(l)){var u=t.state.tr.setSelection(l);"pointer"==c?u.setMeta("pointer",!0):"key"==c&&u.scrollIntoView(),t.dispatch(u)}}else{var p=t.state.doc.resolve(e),h=p.sharedDepth(n);e=p.before(h+1),n=t.state.doc.resolve(n).after(h+1);var d=t.state.selection,f=function(t,e,n){var r=t.docView.parseRange(e,n),i=r.node,a=r.fromOffset,c=r.toOffset,l=r.from,u=r.to,p=t.root.getSelection(),h=null,d=p.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(h=[{node:d,offset:p.anchorOffset}],w(p)||h.push({node:p.focusNode,offset:p.focusOffset})),s.chrome&&8===t.lastKeyCode)for(var f=c;f>a;f--){var m=i.childNodes[f-1],g=m.pmViewDesc;if("BR"==m.nodeType&&!g){c=f;break}if(!g||g.size)break}var v=t.state.doc,y=t.someProp("domParser")||o.aw.fromSchema(t.state.schema),b=v.resolve(l),k=null,x=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:h,ruleFromNode:zt,context:b});if(h&&null!=h[0].pos){var _=h[0].pos,C=h[1]&&h[1].pos;null==C&&(C=_),k={anchor:_+l,head:C+l}}return{doc:x,sel:k,from:l,to:u}}(t,e,n);if(s.chrome&&t.cursorWrapper&&f.sel&&f.sel.anchor==t.cursorWrapper.deco.from){var m=t.cursorWrapper.deco.type.toDOM.nextSibling,g=m&&m.nodeValue?m.nodeValue.length:1;f.sel={anchor:f.sel.anchor+g,head:f.sel.anchor+g}}var v,y,b=t.state.doc,k=b.slice(f.from,f.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(v=t.state.selection.to,y="end"):(v=t.state.selection.from,y="start"),t.lastKeyCode=null;var _=function(t,e,n,r,o){var i=t.findDiffStart(e,n);if(null==i)return null;var s=t.findDiffEnd(e,n+t.size,n+e.size),a=s.a,c=s.b;return"end"==o&&(r-=a+Math.max(0,i-Math.min(a,c))-i),a<i&&t.size<e.size?(c=(i-=r<=i&&r>=a?i-r:0)+(c-a),a=i):c<i&&(a=(i-=r<=i&&r>=c?i-r:0)+(a-c),c=i),{start:i,endA:a,endB:c}}(k.content,f.doc.content,f.from,v,y);if(!_){if(!(i&&d instanceof r.TextSelection&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||f.sel&&f.sel.anchor!=f.sel.head){if(s.ios&&t.lastIOSEnter>Date.now()-225&&a.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,x(13,"Enter"))})))return void(t.lastIOSEnter=0);if(f.sel){var C=Pt(t,t.state.doc,f.sel);C&&!C.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(C))}return}_={start:d.from,endA:d.to,endB:d.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&_.start==_.endB&&t.state.selection instanceof r.TextSelection&&(_.start>t.state.selection.from&&_.start<=t.state.selection.from+2?_.start=t.state.selection.from:_.endA<t.state.selection.to&&_.endA>=t.state.selection.to-2&&(_.endB+=t.state.selection.to-_.endA,_.endA=t.state.selection.to)),s.ie&&s.ie_version<=11&&_.endB==_.start+1&&_.endA==_.start&&_.start>f.from&&"  "==f.doc.textBetween(_.start-f.from-1,_.start-f.from+1)&&(_.start--,_.endA--,_.endB--);var S,M=f.doc.resolveNoCache(_.start-f.from),A=f.doc.resolveNoCache(_.endB-f.from),D=M.sameParent(A)&&M.parent.inlineContent;if((s.ios&&t.lastIOSEnter>Date.now()-225&&(!D||a.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!D&&M.pos<f.doc.content.size&&(S=r.Selection.findFrom(f.doc.resolve(M.pos+1),1,!0))&&S.head==A.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,x(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>_.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Ft(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(Ft(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ft(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(b,_.start,_.endA,M,A)&&t.someProp("handleKeyDown",(function(e){return e(t,x(8,"Backspace"))})))s.android&&s.chrome&&t.domObserver.suppressSelectionUpdates();else{s.android&&!D&&M.start()!=A.start()&&0==A.parentOffset&&M.depth==A.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==_.endA&&(_.endB-=2,A=f.doc.resolveNoCache(_.endB-f.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,x(13,"Enter"))}))}),20));var O,E,T,N,I=_.start,L=_.endA;if(D)if(M.pos==A.pos)s.ie&&s.ie_version<=11&&0==M.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return ft(t)}),20)),O=t.state.tr.delete(I,L),E=b.resolve(_.start).marksAcross(b.resolve(_.endA));else if(_.endA==_.endB&&(N=b.resolve(_.start))&&(T=function(t,e){for(var n,r,i,s=t.firstChild.marks,a=e.firstChild.marks,c=s,l=a,u=0;u<a.length;u++)c=a[u].removeFromSet(c);for(var p=0;p<s.length;p++)l=s[p].removeFromSet(l);if(1==c.length&&0==l.length)r=c[0],n="add",i=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=c.length||1!=l.length)return null;r=l[0],n="remove",i=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var h=[],d=0;d<e.childCount;d++)h.push(i(e.child(d)));if(o.HY.from(h).eq(t))return{mark:r,type:n}}(M.parent.content.cut(M.parentOffset,A.parentOffset),N.parent.content.cut(N.parentOffset,_.endA-N.start()))))O=t.state.tr,"add"==T.type?O.addMark(I,L,T.mark):O.removeMark(I,L,T.mark);else if(M.parent.child(M.index()).isText&&M.index()==A.index()-(A.textOffset?0:1)){var z=M.parent.textBetween(M.parentOffset,A.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,I,L,z)})))return;O=t.state.tr.insertText(z,I,L)}if(O||(O=t.state.tr.replace(I,L,f.doc.slice(_.start-f.from,_.endB-f.from))),f.sel){var P=Pt(t,O.doc,f.sel);P&&!(s.chrome&&s.android&&t.composing&&P.empty&&(P.head==I||P.head==O.mapping.map(L)-1)||s.ie&&P.empty&&P.head==I)&&O.setSelection(P)}E&&O.ensureMarks(E),t.dispatch(O.scrollIntoView())}}}(t,e,n,i,a)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=Qt[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||ne(t,e)||!t.editable&&e.type in Xt||n(t,e)})};for(var n in Qt)e(n);s.safari&&t.dom.addEventListener("input",(function(){return null})),ee(t)}(this),this.pluginViews=[],this.updatePluginViews()},Ve={props:{configurable:!0},root:{configurable:!0}};function je(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e.class+=" "+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))})),[Se.node(0,t.state.doc.content.size,e)]}function $e(t){if(t.markCursor){var e=document.createElement("img");e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Se.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function He(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function Ue(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}Ve.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Be.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ee(this),this._props=t,this.updateStateInner(t.state,!0)},Be.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)},Be.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Be.prototype.updateStateInner=function(t,e){var n=this,o=this.state,i=!1,a=!1;if(t.storedMarks&&this.composing&&(fe(this),a=!0),this.state=t,e){var c=Ue(this);(function(t,e){var n=0,r=0;for(var o in t){if(t[o]!=e[o])return!0;n++}for(var i in e)r++;return n!=r})(c,this.nodeViews)&&(this.nodeViews=c,i=!0),ee(this)}this.editable=He(this),$e(this);var l=Re(this),u=je(this),p=e?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(t.doc,u,l);!h&&t.selection.eq(o.selection)||(a=!0);var d,f,m,v,y,b,k,w,x,_,C="preserve"==p&&a&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=t.root.elementFromPoint(i,s);if(a!=t.dom&&t.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:A(t.dom)}}(this);if(a){this.domObserver.stop();var S=h&&(s.ie||s.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&(v=o.selection,y=t.selection,b=Math.min(v.$anchor.sharedDepth(v.head),y.$anchor.sharedDepth(y.head)),v.$anchor.start(b)!=y.$anchor.start(b));if(h){var O=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(t.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Z(t.doc,u,l,this.dom,this)),O&&!this.trackWrites&&(S=!0)}S||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(d=this,f=d.docView.domFromPos(d.state.selection.anchor,0),m=d.root.getSelection(),g(f.node,f.offset,m.anchorNode,m.anchorOffset)))?ft(this,S):(bt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var E=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof r.NodeSelection?M(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),E):M(this,this.coordsAtPos(t.selection.head,1),E))}else C&&(w=(k=C).refDOM,x=k.refTop,D(k.stack,0==(_=w?w.getBoundingClientRect().top:0)?0:_-x))},Be.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Be.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},Be.prototype.someProp=function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[t];if(null!=s&&(n=e?e(s):s))return n}},Be.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Be.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(O)return t.focus(O);var e=A(t);t.focus(null==O?{get preventScroll(){return O={preventScroll:!0},!0}}:void 0),O||(O=!1,D(e,0))}(this.dom),ft(this),this.domObserver.start()},Ve.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Be.prototype.posAtCoords=function(t){return I(this,t)},Be.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),P(this,t,e)},Be.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Be.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Be.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Be.prototype.endOfTextblock=function(t,e){return function(t,e,n){return V==e&&j==n?$:(V=e,j=n,$="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return R(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=P(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=m(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var l=a[c];if(l.bottom>l.top&&("up"==n?l.bottom<i.top+1:l.top>i.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return B.test(r.parent.textContent)&&a.modify?R(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}(this,e||this.state,t)},Be.prototype.destroy=function(){this.docView&&(function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Re(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Be.prototype.dispatchEvent=function(t){return function(t,e){ne(t,e)||!Qt[e.type]||!t.editable&&e.type in Xt||Qt[e.type](t,e)}(this,t)},Be.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Be.prototype,Ve)},3689:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ucs2decode:()=>d,ucs2encode:()=>f,decode:()=>v,encode:()=>y,toASCII:()=>k,toUnicode:()=>b,default:()=>w});const r=2147483647,o=36,i=/^xn--/,s=/[^\0-\x7E]/,a=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=Math.floor,u=String.fromCharCode;function p(t){throw new RangeError(c[t])}function h(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]);const o=function(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}((t=t.replace(a,".")).split("."),e).join(".");return r+o}function d(t){const e=[];let n=0;const r=t.length;for(;n<r;){const o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const r=t.charCodeAt(n++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),n--)}else e.push(o)}return e}const f=t=>String.fromCodePoint(...t),m=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},g=function(t,e,n){let r=0;for(t=n?l(t/700):t>>1,t+=l(t/e);t>455;r+=o)t=l(t/35);return l(r+36*t/(t+38))},v=function(t){const e=[],n=t.length;let i=0,s=128,a=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let n=0;n<c;++n)t.charCodeAt(n)>=128&&p("not-basic"),e.push(t.charCodeAt(n));for(let h=c>0?c+1:0;h<n;){let c=i;for(let e=1,s=o;;s+=o){h>=n&&p("invalid-input");const c=(u=t.charCodeAt(h++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:o;(c>=o||c>l((r-i)/e))&&p("overflow"),i+=c*e;const d=s<=a?1:s>=a+26?26:s-a;if(c<d)break;const f=o-d;e>l(r/f)&&p("overflow"),e*=f}const d=e.length+1;a=g(i-c,d,0==c),l(i/d)>r-s&&p("overflow"),s+=l(i/d),i%=d,e.splice(i++,0,s)}var u;return String.fromCodePoint(...e)},y=function(t){const e=[];let n=(t=d(t)).length,i=128,s=0,a=72;for(const n of t)n<128&&e.push(u(n));let c=e.length,h=c;for(c&&e.push("-");h<n;){let n=r;for(const e of t)e>=i&&e<n&&(n=e);const d=h+1;n-i>l((r-s)/d)&&p("overflow"),s+=(n-i)*d,i=n;for(const n of t)if(n<i&&++s>r&&p("overflow"),n==i){let t=s;for(let n=o;;n+=o){const r=n<=a?1:n>=a+26?26:n-a;if(t<r)break;const i=t-r,s=o-r;e.push(u(m(r+i%s,0))),t=l(i/s)}e.push(u(m(t,0))),a=g(s,d,h==c),s=0,++h}++s,++i}return e.join("")},b=function(t){return h(t,(function(t){return i.test(t)?v(t.slice(4).toLowerCase()):t}))},k=function(t){return h(t,(function(t){return s.test(t)?"xn--"+y(t):t}))},w={version:"2.1.0",ucs2:{decode:d,encode:f},decode:v,encode:y,toASCII:k,toUnicode:b}},1027:(t,e,n)=>{"use strict";n.r(e),n.d(e,{EditorType:()=>jr,StacksEditor:()=>Jr});var r=n(1081),o=n(8638),i=n(6922);function s(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function a(t,e){for(;t;t="start"==e?t.firstChild:t.lastChild)if(t.isTextblock)return!0;return!1}function c(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function l(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function u(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function p(t,e){var n=t.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var s=r.node(-1),a=r.indexAfter(-1),c=u(s.contentMatchAt(a));if(!s.canReplaceWith(a,a,c))return!1;if(e){var l=r.after(),p=t.tr.replaceWith(l,l,c.createAndFill());p.setSelection(i.Selection.near(p.doc.resolve(l),1)),e(p.scrollIntoView())}return!0}function h(t,e,n){var s,a,c=e.nodeBefore,l=e.nodeAfter;if(c.type.spec.isolating||l.type.spec.isolating)return!1;if(function(t,e,n){var o=e.nodeBefore,i=e.nodeAfter,s=e.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(s,s+1)||!i.isTextblock&&!(0,r.Mn)(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,o.type,o.contentMatchAt(o.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;if(e.parent.canReplace(e.index(),e.index()+1)&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(l.type))&&a.matchType(s[0]||l.type).validEnd){if(n){for(var u=e.pos+l.nodeSize,p=o.HY.empty,h=s.length-1;h>=0;h--)p=o.HY.from(s[h].create(null,p));p=o.HY.from(c.copy(p));var d=t.tr.step(new r.FC(e.pos-1,u,e.pos,u,new o.p2(p,1,0),s.length,!0)),f=u+2*s.length;(0,r.Mn)(d.doc,f)&&d.join(f),n(d.scrollIntoView())}return!0}var m=i.Selection.findFrom(e,1),g=m&&m.$from.blockRange(m.$to),v=g&&(0,r.k9)(g);return null!=v&&v>=e.depth&&(n&&n(t.tr.lift(g,v).scrollIntoView()),!0)}function d(t,e){return function(n,o){var i=n.selection,s=i.$from,a=i.$to,c=s.blockRange(a),l=c&&(0,r.nd)(c,t,e);return!!l&&(o&&o(n.tr.wrap(c,l).scrollIntoView()),!0)}}function f(t,e){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,t)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,t,e).scrollIntoView()),!0)}}function m(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<e.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,t))return!1;if(r)if(s)t.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var c=!1,l=n.tr,u=0;!c&&u<a.length;u++){var p=a[u],h=p.$from,d=p.$to;c=n.doc.rangeHasMark(h.pos,d.pos,t)}for(var f=0;f<a.length;f++){var m=a[f],g=m.$from,v=m.$to;c?l.removeMark(g.pos,v.pos,t):l.addMark(g.pos,v.pos,t.create(e))}r(l.scrollIntoView())}return!0}}function g(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var v=g(s,(function(t,e,n){var o=t.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",t):o.parentOffset>0))return!1;var s=c(o);if(!s){var l=o.blockRange(),u=l&&(0,r.k9)(l);return null!=u&&(e&&e(t.tr.lift(l,u).scrollIntoView()),!0)}var p=s.nodeBefore;if(!p.type.spec.isolating&&h(t,s,e))return!0;if(0==o.parent.content.size&&(a(p,"end")||i.NodeSelection.isSelectable(p))){if(e){var d=t.tr.deleteRange(o.before(),o.after());d.setSelection(a(p,"end")?i.Selection.findFrom(d.doc.resolve(d.mapping.map(s.pos,-1)),-1):i.NodeSelection.create(d.doc,s.pos-p.nodeSize)),e(d.scrollIntoView())}return!0}return!(!p.isAtom||s.depth!=o.depth-1||(e&&e(t.tr.delete(s.pos-p.nodeSize,s.pos).scrollIntoView()),0))}),(function(t,e,n){var r=t.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;s=c(o)}var a=s&&s.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a)||(e&&e(t.tr.setSelection(i.NodeSelection.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))})),y=g(s,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;var o=l(r);if(!o)return!1;var s=o.nodeAfter;if(h(t,o,e))return!0;if(0==r.parent.content.size&&(a(s,"start")||i.NodeSelection.isSelectable(s))){if(e){var c=t.tr.deleteRange(r.before(),r.after());c.setSelection(a(s,"start")?i.Selection.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):i.NodeSelection.create(c.doc,c.mapping.map(o.pos))),e(c.scrollIntoView())}return!0}return!(!s.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),0))}),(function(t,e,n){var r=t.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;s=l(o)}var a=s&&s.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a)||(e&&e(t.tr.setSelection(i.NodeSelection.create(t.doc,s.pos)).scrollIntoView()),0))})),b={Enter:g((function(t,e){var n=t.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))}),(function(t,e){var n=t.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var s=u(r.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=t.tr.insert(a,s.createAndFill());c.setSelection(i.TextSelection.create(c.doc,a+1)),e(c.scrollIntoView())}return!0}),(function(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if((0,r.Ax)(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&(0,r.k9)(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}),(function(t,e){var n=t.selection,s=n.$from,a=n.$to;if(t.selection instanceof i.NodeSelection&&t.selection.node.isBlock)return!(!s.parentOffset||!(0,r.Ax)(t.doc,s.pos)||(e&&e(t.tr.split(s.pos).scrollIntoView()),0));if(!s.parent.isBlock)return!1;if(e){var c=a.parentOffset==a.parent.content.size,l=t.tr;t.selection instanceof i.TextSelection&&l.deleteSelection();var p=0==s.depth?null:u(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=c&&p?[{type:p}]:null,d=(0,r.Ax)(l.doc,l.mapping.map(s.pos),1,h);h||d||!(0,r.Ax)(l.doc,l.mapping.map(s.pos),1,p&&[{type:p}])||(h=[{type:p}],d=!0),d&&(l.split(l.mapping.map(s.pos),1,h),c||s.parentOffset||s.parent.type==p||!s.node(-1).canReplace(s.index(-1),s.indexAfter(-1),o.HY.from(p.create(),s.parent))||l.setNodeMarkup(l.mapping.map(s.before()),p)),e(l.scrollIntoView())}return!0})),"Mod-Enter":p,Backspace:v,"Mod-Backspace":v,Delete:y,"Mod-Delete":y,"Mod-a":function(t,e){return e&&e(t.tr.setSelection(new i.AllSelection(t.doc))),!0}},k={"Ctrl-h":b.Backspace,"Alt-Backspace":b["Mod-Backspace"],"Ctrl-d":b.Delete,"Ctrl-Alt-Backspace":b["Mod-Delete"],"Alt-Delete":b["Mod-Delete"],"Alt-d":b["Mod-Delete"]};for(var w in b)k[w]=b[w];var x=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?k:b,_=200,C=function(){};C.prototype.append=function(t){return t.length?(t=C.from(t),!this.length&&t||t.length<_&&this.leafAppend(t)||this.length<_&&t.leafPrepend(this)||this.appendInner(t)):this},C.prototype.prepend=function(t){return t.length?C.from(t).append(this):this},C.prototype.appendInner=function(t){return new M(this,t)},C.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?C.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},C.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},C.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},C.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},C.from=function(t){return t instanceof C?t:t&&t.length?new S(t):C.empty};var S=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=_)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=_)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(C);C.empty=new S([]);var M=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(C);const A=C;var D=function(t,e){this.items=t,this.eventCount=e};D.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--)if(this.items.get(i-1).selection){--i;break}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,l=[],u=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void u.push(t);if(r){u.push(new O(t.map));var p,h=t.step.map(r.slice(o));h&&c.maybeStep(h).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],l.push(new O(p,null,null,l.length+u.length))),o--,p&&r.appendMap(p,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new D(n.items.slice(0,i).append(u.reverse().concat(l)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},D.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var l,u=t.steps[c].invert(t.docs[c]),p=new O(t.mapping.maps[c],u,e);(l=a&&a.merge(p))&&(p=l,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),e&&(i++,e=null),r||(a=p)}var h,d,f,m=i-n.depth;return m>T&&(d=m,(h=s).forEach((function(t,e){if(t.selection&&0==d--)return f=e,!1})),s=h.slice(f),i-=m),new D(s.append(o),i)},D.prototype.remapping=function(t,e){var n=new r.vs;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},D.prototype.addMaps=function(t){return 0==this.eventCount?this:new D(this.items.append(t.map((function(t){return new O(t)}))),this.eventCount)},D.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var l=t.steps[r].invert(t.docs[r]),u=e.selection&&e.selection.map(o.slice(a+1,r));u&&s++,n.push(new O(c,l,u))}else n.push(new O(c))}}),r);for(var c=[],l=e;l<i;l++)c.push(new O(o.maps[l]));var u=this.items.slice(0,r).append(c).append(n),p=new D(u,s);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-n.length)),p},D.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},D.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var l=i.selection&&i.selection.map(e.slice(n));l&&o++;var u,p=new O(c.invert(),a,l),h=r.length-1;(u=r.length&&r[h].merge(p))?r[h]=u:r.push(p)}}else i.map&&n--}),this.items.length,0),new D(A.from(r.reverse()),o)},D.empty=new D(A.empty,0);var O=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};O.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new O(e.getMap().invert(),e,this.selection)}};var E=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},T=20;function N(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function I(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function L(t,e,n,r){var o=F(e),i=q.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(s){var a=s.selection.resolve(s.transform.doc),c=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),l=new E(r?c:s.remaining,r?s.remaining:c,null,0);n(s.transform.setSelection(a).setMeta(q,{redo:r,historyState:l}).scrollIntoView())}}var z=!1,P=null;function F(t){var e=t.plugins;if(P!=e){z=!1,P=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){z=!0;break}}return z}var q=new i.PluginKey("history"),R=new i.PluginKey("closeHistory");function B(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new i.Plugin({key:q,state:{init:function(){return new E(D.empty,D.empty,null,0)},apply:function(e,n,r){return function(t,e,n,r){var o,i=n.getMeta(q);if(i)return i.historyState;n.getMeta(R)&&(t=new E(t.done,t.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(q))return s.getMeta(q).redo?new E(t.done.addTransform(n,null,r,F(e)),t.undone,N(n.mapping.maps[n.steps.length-1]),t.prevTime):new E(t.done,t.undone.addTransform(n,null,r,F(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new E(t.done.rebased(n,o),t.undone.rebased(n,o),I(t.prevRanges,n.mapping),t.prevTime):new E(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),I(t.prevRanges,n.mapping),t.prevTime);var a=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?I(t.prevRanges,n.mapping):N(n.mapping.maps[n.steps.length-1]);return new E(t.done.addTransform(n,a?e.selection.getBookmark():null,r,F(e)),D.empty,c,n.time)}(n,r,e,t)}},config:t})}function V(t,e){var n=q.getState(t);return!(!n||0==n.done.eventCount||(e&&L(n,t,e,!1),0))}function j(t,e){var n=q.getState(t);return!(!n||0==n.undone.eventCount||(e&&L(n,t,e,!0),0))}for(var $={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},H={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},U="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),W="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),J="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),G="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),K="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Y=U&&(G||+U[1]<57)||J&&G,Z=0;Z<10;Z++)$[48+Z]=$[96+Z]=String(Z);for(Z=1;Z<=24;Z++)$[Z+111]="F"+Z;for(Z=65;Z<=90;Z++)$[Z]=String.fromCharCode(Z+32),H[Z]=String.fromCharCode(Z);for(var Q in $)H.hasOwnProperty(Q)||(H[Q]=$[Q]);var X="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function tt(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);X?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function et(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function nt(t){return new i.Plugin({props:{handleKeyDown:rt(t)}})}function rt(t){var e=function(t){var e=Object.create(null);for(var n in t)e[tt(n)]=t[n];return e}(t);return function(t,n){var r,o=function(t){var e=!(Y&&(t.ctrlKey||t.altKey||t.metaKey)||(W||K)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?H:$)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[et(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=$[n.keyCode])&&r!=o){var a=e[et(r,n,!0)];if(a&&a(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var c=e[et(o,n,!0)];if(c&&c(t.state,t.dispatch,t))return!0}return!1}}var ot=n(8780),it=n(4943),st={bsh:"bash",csh:"bash",sh:"bash",c:"cpp",cc:"cpp",cxx:"cpp",cyc:"cpp",m:"cpp",cs:"csharp",coffee:"coffeescript",html:"xml",xsl:"xml",js:"javascript",pl:"perl",py:"python",cv:"python",rb:"ruby",clj:"clojure",erl:"erlang",hs:"haskell",mma:"mathematica",tex:"latex",cl:"lisp",el:"lisp",lsp:"lisp",scm:"scheme",ss:"scheme",rkt:"scheme",fs:"ocaml",ml:"ocaml",s:"r",rc:"rust",rs:"rust",vhd:"vhdl",none:"plaintext"};function at(t,e){return void 0===e&&(e="none"),n=(t.attrs.params||"").split(/\s/)[0].toLowerCase()||e||null,st[n]||n;var n}function ct(t){var e=function(){var t=n.g.hljs;if(!t)try{t=n(4287)}catch(t){}return t&&t.highlight?t:null}();return e?(0,it.highlightPlugin)(e,["code_block"],(function(e){return e.attrs.detectedHighlightLanguage||at(e,t)})):new i.Plugin({})}var lt=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};function ut(t,e){return void 0===e&&(e=""),t?["%c"+e+t,"font-weight: bold;"]:[]}function pt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n]}function ht(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];console.error.apply(console,lt(ut(t),e))}var dt=n(7022),ft=n(9980),mt=n.n(ft),gt=new o.V_({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){return{params:t.getAttribute("data-params")||""}}}],toDOM:function(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM:function(t){return["ol",{start:1==t.attrs.order?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:function(t){return{tight:t.hasAttribute("data-tight")}}}],toDOM:function(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"paragraph block*",defining:!0,parseDOM:[{tag:"li"}],toDOM:function(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM:function(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:function(t){return"italic"==t&&null}}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"b"},{tag:"strong"},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:function(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return["code"]}}}}),vt=function(t,e){this.schema=t,this.stack=[{type:t.topNodeType,content:[]}],this.marks=o.vc.none,this.tokenHandlers=e};function yt(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function bt(t,e){return t.noCloseToken||"code_inline"==e||"code_block"==e||"fence"==e}function kt(t){return"\n"==t[t.length-1]?t.slice(0,t.length-1):t}function wt(){}vt.prototype.top=function(){return this.stack[this.stack.length-1]},vt.prototype.push=function(t){this.stack.length&&this.top().content.push(t)},vt.prototype.addText=function(t){if(t){var e,n=this.top().content,r=n[n.length-1],i=this.schema.text(t,this.marks);r&&(e=function(t,e){if(t.isText&&e.isText&&o.vc.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}(r,i))?n[n.length-1]=e:n.push(i)}},vt.prototype.openMark=function(t){this.marks=t.addToSet(this.marks)},vt.prototype.closeMark=function(t){this.marks=t.removeFromSet(this.marks)},vt.prototype.parseTokens=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.tokenHandlers[n.type];if(!r)throw new Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,t,e)}},vt.prototype.addNode=function(t,e,n){var r=t.createAndFill(e,n,this.marks);return r?(this.push(r),r):null},vt.prototype.openNode=function(t,e){this.stack.push({type:t,attrs:e,content:[]})},vt.prototype.closeNode=function(){this.marks.length&&(this.marks=o.vc.none);var t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)};var xt=function(t,e,n){this.tokens=n,this.schema=t,this.tokenizer=e,this.tokenHandlers=function(t,e){var n=Object.create(null),r=function(r){var o=e[r];if(o.block){var i=t.nodeType(o.block);bt(o,r)?n[r]=function(t,e,n,r){t.openNode(i,yt(o,e,n,r)),t.addText(kt(e.content)),t.closeNode()}:(n[r+"_open"]=function(t,e,n,r){return t.openNode(i,yt(o,e,n,r))},n[r+"_close"]=function(t){return t.closeNode()})}else if(o.node){var s=t.nodeType(o.node);n[r]=function(t,e,n,r){return t.addNode(s,yt(o,e,n,r))}}else if(o.mark){var a=t.marks[o.mark];bt(o,r)?n[r]=function(t,e,n,r){t.openMark(a.create(yt(o,e,n,r))),t.addText(kt(e.content)),t.closeMark(a)}:(n[r+"_open"]=function(t,e,n,r){return t.openMark(a.create(yt(o,e,n,r)))},n[r+"_close"]=function(t){return t.closeMark(a)})}else{if(!o.ignore)throw new RangeError("Unrecognized parsing spec "+JSON.stringify(o));bt(o,r)?n[r]=wt:(n[r+"_open"]=wt,n[r+"_close"]=wt)}};for(var o in e)r(o);return n.text=function(t,e){return t.addText(e.content)},n.inline=function(t,e){return t.parseTokens(e.children)},n.softbreak=n.softbreak||function(t){return t.addText("\n")},n}(t,n)};function _t(t,e){for(;++e<t.length;)if("list_item_open"!=t[e].type)return t[e].hidden;return!1}xt.prototype.parse=function(t){var e,n=new vt(this.schema,this.tokenHandlers);n.parseTokens(this.tokenizer.parse(t,{}));do{e=n.closeNode()}while(n.stack.length);return e};var Ct=new xt(gt,mt()("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:function(t,e,n){return{tight:_t(e,n)}}},ordered_list:{block:"ordered_list",getAttrs:function(t,e,n){return{order:+t.attrGet("start")||1,tight:_t(e,n)}}},heading:{block:"heading",getAttrs:function(t){return{level:+t.tag.slice(1)}}},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:function(t){return{params:t.info||""}},noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:function(t){return{src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null}}},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:function(t){return{href:t.attrGet("href"),title:t.attrGet("title")||null}}},code_inline:{mark:"code",noCloseToken:!0}}),St=function(t,e){this.nodes=t,this.marks=e};St.prototype.serialize=function(t,e){var n=new Ot(this.nodes,this.marks,e);return n.renderContent(t),n.out};var Mt=new St({blockquote:function(t,e){t.wrapBlock("> ",null,e,(function(){return t.renderContent(e)}))},code_block:function(t,e){t.write("```"+(e.attrs.params||"")+"\n"),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},heading:function(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e),t.closeBlock(e)},horizontal_rule:function(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list:function(t,e){t.renderList(e,"  ",(function(){return(e.attrs.bullet||"*")+" "}))},ordered_list:function(t,e){var n=e.attrs.order||1,r=String(n+e.childCount-1).length,o=t.repeat(" ",r+2);t.renderList(e,o,(function(e){var o=String(n+e);return t.repeat(" ",r-o.length)+o+". "}))},list_item:function(t,e){t.renderContent(e)},paragraph:function(t,e){t.renderInline(e),t.closeBlock(e)},image:function(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+t.esc(e.attrs.src)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")")},hard_break:function(t,e,n,r){for(var o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type)return void t.write("\\\n")},text:function(t,e){t.text(e.text)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open:function(t,e,n,r){return Dt(e,n,r,1)?"<":"["},close:function(t,e,n,r){return Dt(e,n,r,-1)?">":"]("+t.esc(e.attrs.href)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")"}},code:{open:function(t,e,n,r){return At(n.child(r),-1)},close:function(t,e,n,r){return At(n.child(r-1),1)},escape:!1}});function At(t,e){var n,r=/`+/g,o=0;if(t.isText)for(;n=r.exec(t.text);)o=Math.max(o,n[0].length);for(var i=o>0&&e>0?" `":"`",s=0;s<o;s++)i+="`";return o>0&&e<0&&(i+=" "),i}function Dt(t,e,n,r){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;var o=e.child(n+(r<0?-1:0));if(!o.isText||o.text!=t.attrs.href||o.marks[o.marks.length-1]!=t)return!1;if(n==(r<0?1:e.childCount-1))return!0;var i=e.child(n+(r<0?-2:1));return!t.isInSet(i.marks)}var Ot=function(t,e,n){this.nodes=t,this.marks=e,this.delim=this.out="",this.closed=!1,this.inTightList=!1,this.options=n||{},void 0===this.options.tightLists&&(this.options.tightLists=!1)};Ot.prototype.flushClose=function(t){if(this.closed){if(this.atBlank()||(this.out+="\n"),null==t&&(t=2),t>1){var e=this.delim,n=/\s+$/.exec(e);n&&(e=e.slice(0,e.length-n[0].length));for(var r=1;r<t;r++)this.out+=e+"\n"}this.closed=!1}},Ot.prototype.wrapBlock=function(t,e,n,r){var o=this.delim;this.write(e||t),this.delim+=t,r(),this.delim=o,this.closeBlock(n)},Ot.prototype.atBlank=function(){return/(^|\n)$/.test(this.out)},Ot.prototype.ensureNewLine=function(){this.atBlank()||(this.out+="\n")},Ot.prototype.write=function(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)},Ot.prototype.closeBlock=function(t){this.closed=t},Ot.prototype.text=function(t,e){for(var n=t.split("\n"),r=0;r<n.length;r++){var o=this.atBlank()||this.closed;this.write(),this.out+=!1!==e?this.esc(n[r],o):n[r],r!=n.length-1&&(this.out+="\n")}},Ot.prototype.render=function(t,e,n){if("number"==typeof e)throw new Error("!");if(!this.nodes[t.type.name])throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");this.nodes[t.type.name](this,t,e,n)},Ot.prototype.renderContent=function(t){var e=this;t.forEach((function(n,r,o){return e.render(n,t,o)}))},Ot.prototype.renderInline=function(t){var e=this,n=[],r="",o=function(o,i,s){var a=o?o.marks:[];o&&"hard_break"===o.type.name&&(a=a.filter((function(e){if(s+1==t.childCount)return!1;var n=t.child(s+1);return e.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))})));var c=r;if(r="",o&&o.isText&&a.some((function(t){var n=e.marks[t.type.name];return n&&n.expelEnclosingWhitespace}))){var l=/^(\s*)(.*?)(\s*)$/m.exec(o.text),u=(l[0],l[1]),p=l[2],h=l[3];c+=u,r=h,(u||h)&&((o=p?o.withText(p):null)||(a=n))}var d=a.length&&a[a.length-1],f=d&&!1===e.marks[d.type.name].escape,m=a.length-(f?1:0);t:for(var g=0;g<m;g++){var v=a[g];if(!e.marks[v.type.name].mixable)break;for(var y=0;y<n.length;y++){var b=n[y];if(!e.marks[b.type.name].mixable)break;if(v.eq(b)){g>y?a=a.slice(0,y).concat(v).concat(a.slice(y,g)).concat(a.slice(g+1,m)):y>g&&(a=a.slice(0,g).concat(a.slice(g+1,y)).concat(v).concat(a.slice(y,m)));continue t}}}for(var k=0;k<Math.min(n.length,m)&&a[k].eq(n[k]);)++k;for(;k<n.length;)e.text(e.markString(n.pop(),!1,t,s),!1);if(c&&e.text(c),o){for(;n.length<m;){var w=a[n.length];n.push(w),e.text(e.markString(w,!0,t,s),!1)}f&&o.isText?e.text(e.markString(d,!0,t,s)+o.text+e.markString(d,!1,t,s+1),!1):e.render(o,t,s)}};t.forEach(o),o(null,0,t.childCount)},Ot.prototype.renderList=function(t,e,n){var r=this;this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);var o=void 0!==t.attrs.tight?t.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=o,t.forEach((function(i,s,a){a&&o&&r.flushClose(1),r.wrapBlock(e,n(a),t,(function(){return r.render(i,t,a)}))})),this.inTightList=i},Ot.prototype.esc=function(t,e){return t=t.replace(/[`*\\~\[\]]/g,"\\$&"),e&&(t=t.replace(/^[:#\-*+]/,"\\$&").replace(/^(\s*\d+)\./,"$1\\.")),t},Ot.prototype.quote=function(t){var e=-1==t.indexOf('"')?'""':-1==t.indexOf("'")?"''":"()";return e[0]+t+e[1]},Ot.prototype.repeat=function(t,e){for(var n="",r=0;r<e;r++)n+=t;return n},Ot.prototype.markString=function(t,e,n,r){var o=this.marks[t.type.name],i=e?o.open:o.close;return"string"==typeof i?i:i(this,t,n,r)},Ot.prototype.getEnclosingWhitespace=function(t){return{leading:(t.match(/^(\s+)/)||[])[0],trailing:(t.match(/(\s+)$/)||[])[0]}};var Et,Tt=(Et=function(t,e){return(Et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}Et(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),Nt=function(){return(Nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},It=gt,Lt=It.spec.nodes,zt=Nt(Nt({},Lt.get("image")),{attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:function(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt"),height:t.getAttribute("height"),width:t.getAttribute("width")}}}],toDOM:function(t){return["img",t.attrs]}}),Pt=Nt(Nt({},Lt.get("code_block")),{attrs:{params:{default:""},detectedHighlightLanguage:{default:""}}}),Ft=Lt.addBefore("image","pre",("pre",{content:"block+",marks:"",group:"block",inline:!1,selectable:!0,toDOM:function(){return["pre",0]},parseDOM:[{tag:"pre"}]})).addBefore("image","html_block",{content:"text*",attrs:{content:{default:""}},marks:"_",group:"block",atom:!0,inline:!1,selectable:!0,defining:!0,isolating:!0,parseDOM:[{tag:"div.html_block"}],toDOM:function(t){return["div",{class:"html_block"},t.attrs.content]}}).addBefore("image","html_inline",{content:"text*",attrs:{content:{default:""}},marks:"_",group:"inline",atom:!0,inline:!0,selectable:!0,defining:!0,isolating:!0,parseDOM:[{tag:"span.html_inline"}],toDOM:function(t){return["span",{class:"html_inline"},t.attrs.content]}}).addBefore("image","html_block_container",{content:"block*",attrs:{contentOpen:{default:""},contentClose:{default:""}},marks:"_",group:"block",inline:!1,selectable:!0,defining:!0,isolating:!0}).addBefore("image","softbreak",{content:"inline+",attrs:{},marks:"_",inline:!0,group:"inline",parseDOM:[{tag:"span[softbreak]",getAttrs:function(t){return{content:t.innerHTML}}}],toDOM:function(){return["span",{softbreak:""},0]}}).addBefore("image","table",{content:"table_head table_body*",isolating:!0,group:"block",selectable:!1,parseDOM:[{tag:"table"}],toDOM:function(){return["div",{class:"s-table-container"},["table",{class:"s-table"},0]]}}).addBefore("image","table_head",{content:"table_row",isolating:!0,group:"table_block",selectable:!1,parseDOM:[{tag:"thead"}],toDOM:function(){return["thead",0]}}).addBefore("image","table_body",{content:"table_row+",isolating:!0,group:"table_block",selectable:!1,parseDOM:[{tag:"tbody"}],toDOM:function(){return["tbody",0]}}).addBefore("image","table_row",{content:"(table_cell | table_header)+",isolating:!0,group:"table_block",selectable:!1,parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}}).addBefore("image","table_cell",{content:"inline*",isolating:!0,group:"table_block",selectable:!1,attrs:{style:{default:null}},parseDOM:[{tag:"td",getAttrs:function(t){var e=t.style.textAlign;return e?{style:"text-align: "+e}:null}}],toDOM:function(t){return["td",t.attrs,0]}}).addBefore("image","table_header",{content:"inline*",isolating:!0,group:"table_block",selectable:!1,attrs:{style:{default:null}},parseDOM:[{tag:"th",getAttrs:function(t){var e=t.style.textAlign;return e?{style:"text-align: "+e}:null}}],toDOM:function(t){return["th",t.attrs,0]}}).addBefore("image","tagLink",{content:"text*",marks:"",atom:!0,inline:!0,group:"inline",attrs:{tagName:{default:null},tagType:{default:"tag"}}}).addBefore("blockquote","spoiler",{content:"block+",group:"block",attrs:{revealed:{default:!1}},parseDOM:[{tag:"blockquote.spoiler",getAttrs:function(t){return{revealed:t.classList.contains("is-visible")}}}],toDOM:function(t){return["blockquote",{class:"spoiler"+(t.attrs.revealed?" is-visible":"")},0]}}).update("image",zt).update("code_block",Pt);function qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{toDOM:function(){return[t[0],0]},parseDOM:t.map((function(t){return{tag:t}}))}}var Rt=It.spec.marks,Bt=Nt(Nt({},Rt.get("link")),{toDOM:function(t){return["a",{href:t.attrs.href,title:t.attrs.title}]}}),Vt=Rt.addBefore("strong","strike",qt("del","s","strike")).addBefore("strong","kbd",qt("kbd")).addBefore("strong","sup",qt("sup")).addBefore("strong","sub",qt("sub")).update("link",Bt);Vt.forEach((function(t,e){var n=e.attrs||{};n.markup={default:""},e.attrs=n})),Ft.forEach((function(t,e){if("text"!==t){var n=e.attrs||{};n.markup={default:""},e.attrs=n}}));var jt,$t=new o.V_({nodes:Ft,marks:Vt}),Ht=[$t.nodes.table,$t.nodes.table_head,$t.nodes.table_body,$t.nodes.table_row,$t.nodes.table_cell,$t.nodes.table_header],Ut=new o.V_({nodes:{doc:{content:"code_block+"},text:{group:"inline"},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,isolating:!0,selectable:!1,attrs:{params:{default:"markdown"}},parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return["pre",{class:"s-code-block markdown"},["code",0]]}}},marks:{}}),Wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tt(e,t),e.prototype.parseCode=function(e,n){var r="<pre>"+(0,dt.escapeHtml)(e)+"</pre>",o=document.createElement("div");return o.innerHTML=r,t.prototype.parse.call(this,o,n)},e.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))},e.toString=function(t){return t.textBetween(0,t.content.size,"\n\n")},e}(o.aw),Jt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gt=function(t){function e(e){return t.call(this,e)||this}return Jt(e,t),e.prototype.get=function(e){return t.prototype.get.call(this,e)},e.prototype.setMeta=function(t,e){return t.setMeta(this,e)},e}(i.PluginKey),Kt=function(t){function e(e){return t.call(this,e)||this}return Jt(e,t),Object.defineProperty(e.prototype,"transactionKey",{get:function(){return this.spec.key},enumerable:!1,configurable:!0}),e.prototype.getMeta=function(t){return t.getMeta(this.transactionKey)},e}(i.Plugin),Yt=function(t){function e(e){return t.call(this,e)||this}return Jt(e,t),e.prototype.setMeta=function(t,e){var n={callbackData:null,state:e};return t.setMeta(this,n)},e.prototype.setCallbackData=function(t,e){var n={callbackData:e,state:null};return t.setMeta(this,n)},e}(Gt),Zt=function(){function t(t,e,n){this.callback=n,this.transactionKey=e,this.attachCallback(t,null)}return t.prototype.update=function(t,e){t.state.doc.eq(e.doc)||this.attachCallback(t,e)},t.prototype.destroy=function(){},t.prototype.attachCallback=function(t,e){var n=this,r=this.inProgressPromise=Math.random();this.callback(t,e).then((function(e){if(r===n.inProgressPromise){n.inProgressPromise=null;var o=t.state.tr;n.transactionKey.setCallbackData(o,e),t.updateState(t.state.apply(o))}else pt("AsyncViewHandler attachCallback","cancelling promise update due to another callback taking its place")})).catch((function(){n.inProgressPromise=null}))},t}(),Qt=function(t){function e(e){return e.view=function(t){return new Zt(t,e.key,e.asyncCallback)},t.call(this,e)||this}return Jt(e,t),e.prototype.getMeta=function(t){var e=t.getMeta(this.transactionKey);return null==e?void 0:e.state},e.prototype.getCallbackData=function(t){var e=t.getMeta(this.transactionKey);return null==e?void 0:e.callbackData},e}(Kt);function Xt(t){return e=this,n=void 0,o=function(){var e,n;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(r){switch(r.label){case 0:return(e=new FormData).append("file",t),[4,fetch("/image/upload",{method:"POST",cache:"no-cache",body:e})];case 1:if(!(n=r.sent()).ok)throw Error("Failed to upload image: "+n.status+" - "+n.statusText);return[4,n.json()];case 2:return[2,r.sent().UploadedImage]}}))},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}c((o=o.apply(e,n||[])).next())}));var e,n,r,o}!function(t){t[t.Ok=0]="Ok",t[t.FileTooLarge=1]="FileTooLarge",t[t.InvalidFileType=2]="InvalidFileType"}(jt||(jt={}));var te=function(){function t(t,e,n,r){var o,i,s=this;this.image=null,this.isVisible=!1,this.uploadOptions=e,this.pluginContainer=n,this.addTransactionDispatcher=r,this.uploadContainer=document.createElement("div"),this.uploadContainer.className="mt6 bt bb bc-black-400 d-none js-image-uploader",this.uploadField=document.createElement("input"),this.uploadField.type="file",this.uploadField.className="d-none",this.uploadField.accept="image/*",this.uploadField.multiple=!1,this.uploadField.id="fileUpload",this.uploadContainer.innerHTML='\n            <div class="fs-body2 p12 pb0"><label class="s-link" for="'+this.uploadField.id+'">Browse</label>, drag & drop, or paste an image <span class="fc-light fs-caption">Max size 2 MiB</span></div>\n            '+this.uploadField.outerHTML+'\n\n            <div class="js-image-preview wmx100 pt12 px12 d-none"></div>\n            <aside class="s-notice s-notice__warning d-none m8 js-validation-message" role="status" aria-hidden="true"></aside>\n\n            <div class="grid ai-center p12">\n                <button class="s-btn s-btn__primary ws-nowrap mr8 js-add-image" type="button" disabled>Add image</button>\n                <button class="s-btn ws-nowrap js-cancel-button" type="button">Cancel</button>\n                <div class="ml64 grid fd-column fs-caption fc-black-300 s-anchors s-anchors__muted">\n                    <div>'+((null===(o=this.uploadOptions)||void 0===o?void 0:o.brandingHtml)||"")+"</div>\n                    <div>"+((null===(i=this.uploadOptions)||void 0===i?void 0:i.contentPolicyHtml)||"")+"</div>\n                </div>\n            </div>\n        ",this.uploadField=this.uploadContainer.querySelector("#fileUpload"),this.uploadField.addEventListener("change",(function(){s.handleFileSelection(t)})),n.appendChild(this.uploadContainer),this.uploadContainer.addEventListener("dragenter",this.highlightDropArea.bind(this)),this.uploadContainer.addEventListener("dragover",this.highlightDropArea.bind(this)),this.uploadContainer.addEventListener("drop",(function(e){s.unhighlightDropArea(e),s.handleDrop(e,t)})),this.uploadContainer.addEventListener("paste",(function(e){s.handlePaste(e,t)})),this.uploadContainer.addEventListener("dragleave",this.unhighlightDropArea.bind(this)),t.dom.parentNode.addEventListener("keydown",(function(e){"Escape"===e.key&&ee(t)})),this.uploadContainer.querySelector(".js-cancel-button").addEventListener("click",(function(){return ee(t)})),this.uploadContainer.querySelector(".js-add-image").addEventListener("click",(function(e){return s.handleUploadTrigger(e,s.image,t)}))}return t.prototype.highlightDropArea=function(t){this.uploadContainer.classList.add("bs-ring"),this.uploadContainer.classList.add("bc-blue-300"),t.preventDefault(),t.stopPropagation()},t.prototype.unhighlightDropArea=function(t){this.uploadContainer.classList.remove("bs-ring"),this.uploadContainer.classList.remove("bc-blue-300"),t.preventDefault(),t.stopPropagation()},t.prototype.handleFileSelection=function(t){this.resetImagePreview();var e=this.uploadField.files;t.state.selection.$from.parent.inlineContent&&e.length&&this.showImagePreview(e[0])},t.prototype.handleDrop=function(t,e){this.resetImagePreview();var n=t.dataTransfer.files;e.state.selection.$from.parent.inlineContent&&n.length&&this.showImagePreview(n[0])},t.prototype.handlePaste=function(t,e){this.resetImagePreview();var n=t.clipboardData.files;e.state.selection.$from.parent.inlineContent&&n.length&&this.showImagePreview(n[0])},t.prototype.validateImage=function(t){return-1===["image/jpeg","image/png","image/gif"].indexOf(t.type)?jt.InvalidFileType:t.size>=2097152?jt.FileTooLarge:jt.Ok},t.prototype.showValidationError=function(t,e){void 0===e&&(e="warning"),this.uploadField.value=null;var n=this.uploadContainer.querySelector(".js-validation-message");"warning"===e?(n.classList.remove("s-notice__danger"),n.classList.add("s-notice__warning")):(n.classList.remove("s-notice__warning"),n.classList.add("s-notice__danger")),n.classList.remove("d-none"),n.innerHTML=t},t.prototype.hideValidationError=function(){var t=this.uploadContainer.querySelector(".js-validation-message");t.classList.add("d-none"),t.classList.remove("s-notice__warning"),t.classList.remove("s-notice__danger"),t.innerHTML=""},t.prototype.showImagePreview=function(t){var e=this;return new Promise((function(n,r){return e.showImagePreviewAsync(t,n,r)}))},t.prototype.showImagePreviewAsync=function(t,e,n){var r=this,o=this.uploadContainer.querySelector(".js-image-preview"),i=this.uploadContainer.querySelector(".js-add-image");switch(this.hideValidationError(),this.validateImage(t)){case jt.FileTooLarge:return this.showValidationError("Your image is too large to upload (over 2 MiB)"),void n("file too large");case jt.InvalidFileType:return this.showValidationError("Please select an image (jpeg, png, gif) to upload"),void n("invalid filetype")}this.resetImagePreview();var s=new FileReader;s.addEventListener("load",(function(){var n=new Image;n.className="hmx1 w-auto",n.title=t.name,n.src=s.result,o.appendChild(n),o.classList.remove("d-none"),r.image=t,i.disabled=!1,e()}),!1),s.readAsDataURL(t)},t.prototype.resetImagePreview=function(){this.uploadContainer.querySelector(".js-image-preview").innerHTML="",this.image=null,this.uploadContainer.querySelector(".js-add-image").disabled=!0},t.prototype.resetUploader=function(){this.resetImagePreview(),this.hideValidationError()},t.prototype.handleUploadTrigger=function(t,e,n){e&&(this.startImageUpload(n,e),this.resetUploader(),ee(n),n.focus())},t.prototype.startImageUpload=function(t,e){var n,r=this,o={},i=t.state.tr;i.selection.empty||i.deleteSelection(),ie.setMeta(i,{add:{id:o,pos:i.selection.from},file:null,visible:!1}),t.dispatch(i),(null===(n=this.uploadOptions)||void 0===n?void 0:n.handler)?this.uploadOptions.handler(e).then((function(e){var n=ie.getState(t.state).decorations.find(null,null,(function(t){return t.id==o})),i=n.length?n[0].from:null;if(null!==i){var s=r.addTransactionDispatcher(t.state,e,i);s=ie.setMeta(s,{remove:{id:o},visible:!1,file:null}),t.dispatch(s)}}),(function(){t.dispatch(ie.setMeta(t.state.tr,{remove:{id:o},visible:!1,file:null})),ne(t),r.showValidationError("Image upload failed. Please try again.","error")})):console.error("No upload handler registered. Ensure you set a proper handler on the editor's options.imageUploadHandler")},t.prototype.update=function(t){var e=ie.getState(t.state),n=null==e?void 0:e.visible;"boolean"!=typeof n&&(n=!1),n!==this.isVisible&&(this.isVisible=n,this.image=(null==e?void 0:e.file)||this.image,this.isVisible?(this.uploadContainer.classList.remove("d-none"),this.uploadContainer.querySelector("button").focus(),this.image&&this.showImagePreview(this.image)):(this.resetUploader(),this.uploadContainer.classList.add("d-none"),this.uploadContainer.classList.remove("outline-ring")))},t.prototype.destroy=function(){this.uploadField.remove(),this.uploadContainer.remove(),this.image=null},t}();function ee(t){var e=ie.getState(t.state);if(e&&e.visible){var n=t.state.tr;ie.setMeta(n,{visible:!1,file:null});var r=t.state.apply(n);t.updateState(r)}}function ne(t,e){var n=ie.getState(t.state);if(n&&!n.visible){var r=t.state.tr;ie.setMeta(r,{visible:!0,file:e||null});var o=t.state.apply(r);t.updateState(o)}}function re(t){return!!ie.getState(t.state)}function oe(t,e,n){return(null==t?void 0:t.handler)?new Kt({key:ie,state:{init:function(){return{visible:!1,decorations:ot.DecorationSet.empty,file:null}},apply:function(t,e){var n=e.decorations||ot.DecorationSet.empty;n=n.map(t.mapping,t.doc);var r,o=this.getMeta(t),i={visible:e.visible,file:e.file,decorations:n};if(!o)return i;if("visible"in o&&(i.visible=o.visible),i.file="file"in o?o.file:null,o.add){var s=ot.Decoration.widget(o.add.pos,((r=document.createElement("div")).className="ws-normal d-block m8",r.innerHTML='\n<div class="py6 px12 bg-black-050 bar-sm grid gsx gs8 d-inline-flex ai-center fw-normal fs-body1">\n    <span class="icon-bg iconImage"></span>\n    <div class="grid--cell">Uploading image</div>\n    <div class="s-spinner s-spinner__sm grid--cell">\n        <div class="v-visible-sr">Loading…</div>\n    </div>\n</div>\n',r),{id:o.add.id});i.decorations=n.add(t.doc,[s])}else o.remove&&(i.decorations=n.remove(n.find(null,null,(function(t){return t.id==o.remove.id}))));return i}},props:{decorations:function(t){return this.getState(t).decorations},handleClick:function(t){return ee(t),!1},handleDrop:function(t,e){var n=e.dataTransfer.files;return!(!t.state.selection.$from.parent.inlineContent||!n.length||(ne(t,n[0]),0))},handlePaste:function(t,e){var n=e.clipboardData.files;return!(!t.state.selection.$from.parent.inlineContent||!n.length||(ee(t),ne(t,n[0]),0))}},view:function(r){return new te(r,t,(e=e||function(t){return t.dom.parentElement})(r),n)}}):new i.Plugin({})}var ie=new Gt(te.name),se=new i.PluginKey(le.name);function ae(t){return!se.getState(t)}function ce(t,e,n){if(se.getState(e)===t)return!1;var r=e.tr.setMeta(se,t);return r=r.setMeta("addToHistory",!1),n&&n(r),!0}function le(){return new i.Plugin({key:se,state:{init:function(){return!1},apply:function(t,e){var n=t.getMeta(se);return void 0===n?e:n}}})}function ue(t,e){return he(t,e)}function pe(t){return t instanceof Object&&!(t instanceof Function)&&!(t instanceof Array)}function he(t,e){if(t instanceof Array&&e instanceof Array)return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}(t,e);var n=pe(t),r=pe(e);if(!n&&r)return he({},e);if(n&&!r)return he({},t);if(!n&&!r)return e;for(var o={},i=t,s=e,a=Object.keys(i),c=0,l=a;c<l.length;c++)o[h=l[c]]=h in s?he(i[h],s[h]):i[h];for(var u=0,p=a=Object.keys(s);u<p.length;u++){var h;(h=p[u])in o||(o[h]=s[h])}return o}function de(t,e){return!(t&&e&&t.selection.eq(e.selection)&&t.doc.eq(e.doc)&&t.storedMarks===e.storedMarks)}var fe=/^((https?|ftp):\/\/|\/)[-a-z0-9+&@#/%?=~_|!:,.;()*[\]$]+/,me=/^mailto:[#-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+/;function ge(t){var e=null==t?void 0:t.trim().toLowerCase();return fe.test(e)||me.test(e)}var ve={snippets:!0,html:!0,extraEmphasis:!0,tables:!0,tagLinks:{allowMetaTags:!0,allowNonAscii:!1}},ye=function(){function t(){}return Object.defineProperty(t.prototype,"document",{get:function(){return this.editorView.state.doc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dom",{get:function(){return this.editorView.dom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!this.editorView.editable},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t;null===(t=this.editorView)||void 0===t||t.focus()},t.prototype.destroy=function(){var t;null===(t=this.editorView)||void 0===t||t.destroy()},Object.defineProperty(t.prototype,"content",{get:function(){return this.serializeContent()},set:function(t){var e=this.editorView.state.tr,n=this.editorView.state.doc,r=this.parseContent(t);e=e.replaceWith(0,n.content.size,r),this.editorView.dispatch(e)},enumerable:!1,configurable:!0}),t}(),be=function(){return!1},ke=function(){function t(e,n){var r,o=this;this.items=e,this.view=n,this.menuCommands=(r=[]).concat.apply(r,this.items.map((function(t){return t.children?function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}([t],t.children):t}))),this.dom=document.createElement("div"),this.dom.className="grid gs2 mln4 fl1 ai-center js-editor-menu",this.items.forEach((function(t){var e=t.dom;return o.dom.appendChild(e)})),this.update(n,null);var i=this.menuCommands;this.dom.addEventListener("click",(function(e){var r=e.target.closest(".js-editor-btn");if(r&&!r.classList.contains(t.disabledClass)){var o=r.dataset.key;e.preventDefault(),n.focus();var s=i.find((function(t){return t.key===o}));s&&s.command(n.state,n.dispatch.bind(n),n)}})),this.readonly=!n.editable}return t.prototype.update=function(e,n){var r=this;if(de(n,e.state)||this.readonly===e.editable){this.readonly=!e.editable,this.dom.classList.toggle("pe-none",this.readonly);var o=this.readonly,i="is-selected",s="d-none",a=t.disabledClass;this.menuCommands.forEach((function(t){var e=t.dom;if(!e.classList.contains("js-editor-btn")){var n=e.querySelector(".js-editor-btn");e=null!=n?n:e}var c=r.view.hasFocus(),l=!t.visible||t.visible(r.view.state),u=!(!c||!t.active)&&t.active(r.view.state),p=!o&&t.command(r.view.state,void 0,r.view);e.classList.remove(a),e.classList.remove(i),e.classList.remove(s),e.dataset.key=t.key,l?u?e.classList.add(i):p||e.classList.add(a):e.classList.add(s)}))}},t.prototype.destroy=function(){this.dom.remove()},t.disabledClass="is-disabled",t}();function we(t,e){return e?t:null}function xe(t,e){var n=t.filter((function(t){return!!t}));return new i.Plugin({view:function(t){var r=new ke(n,t),o=(e=e||function(t){return t.dom.parentNode})(t);return o.contains(t.dom)?o.insertBefore(r.dom,t.dom):o.insertBefore(r.dom,o.firstChild),r}})}function _e(t,e,n,r){var o,i=document.createElement("button");i.className="s-editor-btn grid--cell js-editor-btn js-"+n,r&&(o=i.classList).add.apply(o,r),i.title=e,i.dataset.controller="s-tooltip",i.dataset.sTooltipPlacement="top",i.dataset.key=n,i.type="button";var s=document.createElement("span");return s.className="icon-bg icon"+t,i.append(s),i}function Ce(t,e){var n,r=document.createElement("div");return r.className="grid--cell w16",e&&(n=r.classList).add.apply(n,e),{key:"spacer",command:be,active:be,visible:t,dom:r}}function Se(t,e,n){var r=document.createElement("button");return r.type="button",r.className="s-btn s-btn__unset grid--cell ta-left px12 py4 h:bg-black-050 c-pointer js-editor-btn",r.dataset.key=n,r.innerHTML=t,{key:n,command:e,dom:r}}function Me(t,e){var n=document.createElement("span");return n.className="grid--cell ta-left fs-fine tt-uppercase mx12 mb6 mt12 fc-black-400",n.dataset.key=e,n.innerHTML=t,{key:e,command:function(){return!0},visible:function(){return!0},active:function(){return!1},dom:n}}function Ae(t,e,n){var r=document.createElement("a");r.className="s-editor-btn js-editor-btn grid--cell",r.href=n,r.target="_blank",r.title=e,r.dataset.controller="s-tooltip",r.dataset.sTooltipPlacement="top";var o=document.createElement("span");return o.className="icon-bg icon"+t,r.append(o),{key:e,command:function(t,e){return e&&window.open(r.href,r.target),!!n},active:be,dom:r}}var De=function(t){return Ne.bind(null,t)},Oe=function(t){return Te.bind(null,t)},Ee=function(t,e){return t.text(e)};function Te(t,e,n){return!!function(t,e,n){if(e.selection.empty)return!1;var r=e.selection,o=r.from,s=r.to,a=e.doc.textBetween(o,s),c=a.slice(0,t.length),l=a.slice(-1*t.length);if(c!==t||l!==t)return!1;if(n){var u=e.tr,p=a.slice(t.length,-1*t.length);u.replaceSelectionWith(Ee(u.doc.type.schema,p)),u.setSelection(i.TextSelection.create(e.apply(u).doc,o,s-2*t.length)),n(u)}return!0}(t,e,n)||function(t,e,n){var r="your text",o=e.selection,s=o.from,a=o.to,c=e.tr.insertText(t,a);if(e.selection.empty&&c.insertText(r,a),c.insertText(t,s).scrollIntoView(),n){var l=s,u=a+2*t.length;e.selection.empty&&(u=(l=s+t.length)+r.length),c.setSelection(i.TextSelection.create(e.apply(c).doc,l,u)),n(c)}return!0}(t,e,n)}function Ne(t,e,n){return!!function(t,e,n){if(e.selection.empty)return!1;var r=e.selection.from,o=e.doc.cut(r,e.selection.to).textContent;if(!o.includes("\n"))return!1;var s=" ",a=e.tr,c=o.split("\n"),l=c.some((function(e){return!e.startsWith(t+s)})),u=r;if(c.forEach((function(e){var n,r=Ie(e);n=l&&r===t+s?e:l&&r.length?t+s+e.slice(r.length):l?t+s+e:e.slice(r.length);var o=u+e.length;a=n.length?a.replaceRangeWith(u,o,Ee(a.doc.type.schema,n)):a.deleteRange(u,o),u+=n.length+"\n".length})),r>1&&"\n"!==e.doc.textBetween(r-1,r)&&(a=a.insertText("\n",r,r),r+="\n".length,u+="\n".length),n){var p=u-"\n".length;a.setSelection(i.TextSelection.create(e.apply(a).doc,r,p)),a.scrollIntoView(),n(a)}return!0}(t,e,n)||function(t,e,n){var r,o=e.selection.from,i=e.doc.cut(0,o).textContent.lastIndexOf("\n");r=-1===i?1:i+1+"\n".length;var s=Ie(e.doc.cut(r).textContent),a=e.tr;s.length&&(a=a.delete(r,r+s.length));var c=!1;return s===t+" "&&(c=!0),c||(a=a.insertText(t+" ",r)),n&&n(a=a.scrollIntoView()),!0}(t,e,n)}function Ie(t){var e;return(null===(e=/^[^a-zA-Z]+\s{1}(?=[a-zA-Z_*[!]|$)/.exec(t))||void 0===e?void 0:e[0])||""}function Le(t,e,n){if(e.selection.empty)return!1;var r=e.selection,o=r.from,s=r.to,a=e.doc.textBetween(o,s),c=t.length+"\n".length,l=a.slice(0,c),u=a.slice(-1*c);if(l!==t+"\n"||u!=="\n"+t)return!1;var p=e.tr;return p=(p=p.delete(s-c,s)).delete(o,o+c),n&&(p.setSelection(i.TextSelection.create(e.apply(p).doc,o,s-2*c)),p.scrollIntoView(),n(p)),!0}function ze(t,e,n,r,o){var s=r.tr,a=r.selection.from;return s=r.selection.empty?s.insertText(t,a):s.replaceSelectionWith(Ee(s.doc.type.schema,t)),o&&o(s=(s=void 0!==e&&void 0!==n?s.setSelection(i.TextSelection.create(r.apply(s).doc,a+e,a+n)):s.setSelection(i.TextSelection.create(r.apply(s).doc,a))).scrollIntoView()),!0}function Pe(t,e){var n="https://www.stackoverflow.com/";if(t.selection.empty)return ze("[text]("+n+")",1,5,t,e);var r=t.selection,o=r.from,i=r.to,s=t.doc.textBetween(o,i),a="["+s+"]("+n+")",c=3+s.length;return ze(a,c,c+n.length,t,e)}function Fe(t,e){if(t.selection.empty)return ze("\n| Column A | Column B |\n| -------- | -------- |\n| Cell 1   | Cell 2   |\n| Cell 3   | Cell 4   |\n",1,1,t,e)}var qe=Oe("**"),Re=Oe("*"),Be=Oe("`"),Ve=function(){return!1},je=De("#"),$e=Oe("~~"),He=De(">"),Ue=De("1."),We=De("-"),Je=("\n---\n",ze.bind(null,"\n---\n",undefined,undefined)),Ge=("```",function(t,e,n){return!!Le(t,e,n)||function(t,e,n){if(e.selection.empty){var r="type here";return ze("\n"+t+"\n"+"type here\n"+t+"\n",t.length+2,t.length+r.length+2,e,n)}var o=e.selection,s=o.from,a=o.to;if(Le(t,e,n))return!0;var c=e.tr;s>0&&"\n"!==e.doc.textBetween(s-1,s)&&(c=c.insertText("\n",s,s),s+=1,a+=1),a+1<e.doc.content.size&&"\n"!==e.doc.textBetween(a,a+1)&&(c=c.insertText("\n",a+1,a+1),a+=1);if(c.insertText("\n"+t,a),c.insertText(t+"\n",s),n){var l="\n".length+t.length;c.setSelection(i.TextSelection.create(e.apply(c).doc,s,a+2*l)),c.scrollIntoView(),n(c)}return!0}(t,e,n)}.bind(null,"```"));function Ke(t,e,n){return!(!re(n)||e&&(ne(n),0))}var Ye=function(t){var e;return xe([{key:"toggleHeading",command:je,dom:_e("Header","Heading","heading-btn")},{key:"togglBold",command:qe,dom:_e("Bold","Bold","bold-btn")},{key:"toggleEmphasis",command:Re,dom:_e("Italic","Italic","italic-btn")},{key:"toggleCode",command:Be,dom:_e("Code","Inline code","code-btn")},we({key:"toggleStrikethrough",command:$e,dom:_e("Strikethrough","Strikethrough","strike-btn")},t.parserFeatures.extraEmphasis),Ce(),{key:"toggleLink",command:Pe,dom:_e("Link","Insert link","insert-link-btn")},{key:"toggleBlockquote",command:He,dom:_e("Quote","Blockquote","blockquote-btn")},{key:"insertCodeblock",command:Ge,dom:_e("Codeblock","Insert code block","code-block-btn")},we({key:"insertImage",command:Ke,dom:_e("Image","Insert image","insert-image-btn")},!!(null===(e=t.imageUpload)||void 0===e?void 0:e.handler)),we({key:"insertTable",command:Fe,dom:_e("Table","Insert table","insert-table-btn")},t.parserFeatures.tables),Ce(),{key:"toggleOrderedList",command:Ue,dom:_e("OrderedList","Numbered list","numbered-list-btn")},{key:"toggleUnorderedList",command:We,dom:_e("UnorderedList","Bulleted list","bullet-list-btn")},{key:"insertRule",command:Je,dom:_e("HorizontalRule","Insert Horizontal rule","horizontal-rule-btn")},Ce((function(){return!1}),["sm:d-inline-block"]),{key:"undo",command:V,dom:_e("Undo","Undo","undo-btn",["sm:d-inline-block"]),visible:function(){return!1}},{key:"redo",command:j,dom:_e("Refresh","Redo","redo-btn",["sm:d-inline-block"]),visible:function(){return!1}},Ce(),Ae("Help","Help",t.editorHelpLink)],t.menuParentContainer)},Ze=nt({"Mod-z":V,"Mod-y":j,"Mod-Shift-z":j,Tab:Ve,"Shift-Tab":Ve,"Mod-b":qe,"Mod-i":Re,"Mod-l":Pe,"Ctrl-q":He,"Mod-k":Be,"Mod-g":Ke,"Ctrl-g":Ke,"Mod-o":Ue,"Mod-u":We,"Mod-h":je,"Mod-r":Je,"Mod-m":Ge}),Qe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xe=function(t){function e(n,r,o){void 0===o&&(o={});var s,a,c=t.call(this)||this;return c.options=ue(e.defaultOptions,o),c.editorView=new ot.EditorView((function(t){var e;(e=t.classList).add.apply(e,c.options.classList),n.appendChild(t)}),{editable:ae,state:i.EditorState.create({doc:c.parseContent(r),plugins:[B(),Ze,nt(x),Ye(c.options),ct(null),(s=c.options.imageUpload,a=c.options.pluginParentContainer,oe(s,a,(function(t,e,n){var r="enter image description here",o="!["+r+"]("+e+")",s=t.tr.insertText(o,n);return s.setSelection(i.TextSelection.create(t.apply(s).doc,n+2,n+r.length+2)),s}))),le()]})}),pt("prosemirror commonmark document",c.editorView.state.doc.toJSON()),c}return Qe(e,t),Object.defineProperty(e,"defaultOptions",{get:function(){return{editorHelpLink:null,menuParentContainer:null,parserFeatures:ve,imageUpload:{handler:Xt}}},enumerable:!1,configurable:!0}),e.prototype.parseContent=function(t){return Wt.fromSchema(Ut).parseCode(t)},e.prototype.serializeContent=function(){return Wt.toString(this.editorView.state.doc)},e}(ye);function tn(t,e){t.contentMatch=o.sI.parse(t.spec.content||"",e.nodes),t.inlineContent=t.contentMatch.inlineContent}var en,nn=n(7024),rn=n.n(nn),on=n(5872),sn=n.n(on);!function(t){t[t.unknown=0]="unknown",t[t.comment=1]="comment",t[t.strike=2]="strike",t[t.strong=3]="strong",t[t.emphasis=4]="emphasis",t[t.hardbreak=5]="hardbreak",t[t.code=6]="code",t[t.link=7]="link",t[t.image=8]="image",t[t.keyboard=9]="keyboard",t[t.pre=10]="pre",t[t.sup=11]="sup",t[t.sub=12]="sub",t[t.heading=13]="heading",t[t.paragraph=14]="paragraph",t[t.horizontal_rule=15]="horizontal_rule",t[t.blockquote=16]="blockquote",t[t.list_item=17]="list_item",t[t.ordered_list=18]="ordered_list",t[t.unordered_list=19]="unordered_list",t[t.dd=20]="dd",t[t.dl=21]="dl",t[t.dt=22]="dt"}(en||(en={}));var an=[en.blockquote,en.heading,en.list_item,en.ordered_list,en.unordered_list,en.dd,en.dl,en.dt,en.paragraph,en.horizontal_rule,en.pre];function cn(t){var e,n,r,o,i,s,a;if(!t)return{type:en.unknown,isSelfClosing:!1,isClosing:!1,isBlock:!1,tagName:null,attributes:{},markup:null};var c=en.unknown,l=/^<\/\S+?.*?>$/.test(t),u=t.replace(/[<>/]/g,"").trim().split(/\s/)[0],p=!1,h={};["del","strike","s"].includes(u)?c=en.strike:["b","strong"].includes(u)?c=en.strong:["em","i"].includes(u)?c=en.emphasis:"code"===u?c=en.code:"br"===u?(c=en.hardbreak,p=!0):"blockquote"===u?c=en.blockquote:"a"===u?(c=en.link,h.href=(null===(e=/href=["'](.+?)["']/.exec(t))||void 0===e?void 0:e[1])||"",h.title=(null===(n=/title=["'](.+?)["']/.exec(t))||void 0===n?void 0:n[1])||""):"img"===u?(c=en.image,h.src=(null===(r=/src=["'](.+?)["']/.exec(t))||void 0===r?void 0:r[1])||"",h.width=(null===(o=/width=["'](.+?)["']/.exec(t))||void 0===o?void 0:o[1])||"",h.height=(null===(i=/height=["'](.+?)["']/.exec(t))||void 0===i?void 0:i[1])||"",h.alt=(null===(s=/alt=["'](.+?)["']/.exec(t))||void 0===s?void 0:s[1])||"",h.title=(null===(a=/title=["'](.+?)["']/.exec(t))||void 0===a?void 0:a[1])||"",p=!0):/h[1,2,3,4,5,6]/.test(u)?c=en.heading:"kbd"===u?c=en.keyboard:"pre"===u?c=en.pre:"sup"===u?c=en.sup:"sub"===u?c=en.sub:"ul"===u?c=en.unordered_list:"ol"===u?c=en.ordered_list:"li"===u?c=en.list_item:"p"===u?c=en.paragraph:"hr"===u?(c=en.horizontal_rule,p=!0):c=en.unknown;var d=u?"<"+(l?"/":"")+u+">":"";return p&&(d=t.replace(/^(<[a-z]+).*?(\s?\/?>)$/i,"$1$2")),{type:c,isSelfClosing:p,isClosing:l,isBlock:an.includes(c),tagName:u,attributes:h,markup:d}}function ln(t,e){var n=e||new(sn())("","",0),r=t.isSelfClosing?"":t.isClosing?"_close":"_open",o="";switch(t.type){case en.unknown:o="text";break;case en.strike:o="s"+r;break;case en.emphasis:o="em"+r;break;case en.code:o="code_inline";break;case en.horizontal_rule:o="hr";break;case en.link:o="link"+r,n.attrSet("href",t.attributes.href),n.attrSet("title",t.attributes.title);break;case en.image:o="image",n.attrSet("src",t.attributes.src),n.attrSet("height",t.attributes.height),n.attrSet("width",t.attributes.width),n.attrSet("alt",t.attributes.alt),n.attrSet("title",t.attributes.title);break;case en.keyboard:o="kbd"+r;break;default:o=en[t.type]+r}return n.type=o,n.markup=t.markup,n.nesting=t.isClosing?-1:1,t.isSelfClosing&&(n.nesting=0),n.tag=t.tagName||"",n}function un(t,e){if(t.block)return[t];var n=[en.blockquote,en.pre],r=new(sn())("inline","",0);return r.children=[t],!e||n.includes(e)?[new(sn())("paragraph_open","p",1),r,new(sn())("paragraph_close","p",-1)]:[r]}function pn(t){var e=null;return"html_inline"===t.type?e=cn(t.content):t.children&&t.children.length&&(t.children=hn(t.children)),e?(e.isBlock||(t=ln(e,t)).attrSet("inline_html","true"),t):t}function hn(t){for(var e=0,n=(t=t.map(pn).filter((function(t){return!!t}))).length;e<n;e++){var r=t[e];if(r.attrGet("inline_html"))if(!r.type.includes("_close")||r.attrGet("paired")){if(r.type.includes("_open")){for(var o=!1,i=e+1,s=t.length;i<s;i++){var a=t[i];if(a&&a.attrGet("inline_html")&&!a.attrGet("paired")&&r.tag===a.tag){o=!0,a.attrSet("paired","true");break}}o||(r.type="html_inline")}}else r.type="html_inline"}return t}function dn(t){var e,n=null===(e=t.match(/(<\/?[a-z]+.*?>)/gi))||void 0===e?void 0:e.map((function(t){return{match:t,tagInfo:cn(t)}}));if(!n||!n.length)return t;var r=t;return n.forEach((function(t){var e;if(t.tagInfo.type===en.unknown)e="";else if(t.tagInfo.type===en.image){var n=t.match.match(/((width|height|src|alt|title)=["'].+?["'])/g),o=t.tagInfo.markup;(null==n?void 0:n.length)&&(o=o.replace("<img","<img "+n.join(" "))),e=o}else t.tagInfo.type===en.link?(n=t.match.match(/((href|title)=["'].+?["'])/g),o=t.tagInfo.markup,(null==n?void 0:n.length)&&(o=o.replace("<a","<a "+n.join(" "))),e=o):e=t.tagInfo.markup;r=r.replace(t.match,e)})),r}function fn(t){var e=[];return t.forEach((function(t){var n,r=null;if("html_block"===t.type?r=function(t){var e=t.content,n=/^(?:(<[a-z0-9]+.*?>)([^<>]+?)(<\/[a-z0-9]+>))$|^(<[a-z0-9]+(?:\s.+?)?\s?\/?>)$/i.exec(e);if(!n)return null;var r=[],o=!1;if(n[4]){var i=cn(e);i.type!==en.unknown&&(o=i.isBlock,r.push(i))}else{var s=cn(n[1]),a=n[2],c=cn(n[3]);s.type!==en.unknown&&c.type!==en.unknown&&s.type===c.type&&(o=s.isBlock,r.push(s),r.push(a),r.push(c))}return r.length>0?{isBlock:o,tagInfo:r}:null}(t):(null===(n=t.children)||void 0===n?void 0:n.length)&&(t.children=fn(t.children)),r&&r.tagInfo.length){var o=[];r.tagInfo.forEach((function(t,e,n){var r,i=n[e-1],s="string"==typeof t||!t.isBlock;if("string"==typeof t){var a=new(sn())("text","",0);a.content=t,r=a}else r=ln(t);var c=[r];s&&(c=un(r,null==i?void 0:i.type)),o.push.apply(o,c)})),e.push.apply(e,o)}else e.push(t)})),e}function mn(t){var e=[];return t.forEach((function(t){var n;if((null===(n=t.children)||void 0===n?void 0:n.length)&&(t.children=mn(t.children)),0===t.type.indexOf("html_block"))if("html_block"===t.type){if(t.content=dn(t.content),!t.content.trim())return;if(t.content.includes("<"))e.push(t);else{var r=new(sn())("text","",0);r.content=t.content;var o=un(r,null);e.push.apply(e,o)}}else if("html_block_container_open"===t.type){var i=t.attrGet("contentOpen"),s=t.attrGet("contentClose");t.attrSet("contentOpen",dn(i)),t.attrSet("contentClose",dn(s)),e.push(t)}else e.push(t);else e.push(t)})),e}function gn(t){var e=[],n=0,r=t.map((function(t,e){var r,o,i,s;if("html_block"!==t.type)return null;var a=null!==(o=null===(r=t.content.match(/<[a-z]+(\s[a-z0-9\-"'=\s])?>/gi))||void 0===r?void 0:r.length)&&void 0!==o?o:0,c=null!==(s=null===(i=t.content.match(/<\/[a-z]+>/gi))||void 0===i?void 0:i.length)&&void 0!==s?s:0;return a>c||a<c&&n%2==1?(n+=1,e):null})).filter((function(t){return null!==t}));r.length%2==1&&(r=r.slice(0,-1));var o=null;return t.forEach((function(t,n){if(t.children&&t.children.length&&(t.children=gn(t.children)),"html_block"===t.type&&r.includes(n)){var i=new(sn())("html_block_container_"+(o?"close":"open"),"",o?-1:1);o?(o.attrSet("contentClose",t.content),o=null,e.push(i)):(i.attrSet("contentOpen",t.content),o=i,e.push(i))}else e.push(t)})),e}function vn(t){t.core.ruler.push("so-sanitize-html",(function(t){return t.tokens=hn(t.tokens),t.tokens=fn(t.tokens),t.tokens=gn(t.tokens),t.tokens=mn(t.tokens),!1}))}function yn(t,e,n,r,o){var i,s,a,c,l,u,p,h,d,f,m,g,v,y,b,k,w,x,_,C,S=e.lineMax,M=e.bMarks[n]+e.tShift[n],A=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(M)||!t.followingCharRegex.test(e.src[M+1]))return!1;if(M+=t.markup.length,o)return!0;for(c=d=e.sCount[n]+M-(e.bMarks[n]+e.tShift[n]),32===e.src.charCodeAt(M)?(M++,c++,d++,i=!1,k=!0):9===e.src.charCodeAt(M)?(k=!0,(e.bsCount[n]+d)%4==3?(M++,c++,d++,i=!1):i=!0):k=!1,f=[e.bMarks[n]],e.bMarks[n]=M;M<A&&(s=e.src.charCodeAt(M),(0,dt.isSpace)(s));)9===s?d+=4-(d+e.bsCount[n]+(i?1:0))%4:d++,M++;for(m=[e.bsCount[n]],e.bsCount[n]=e.sCount[n]+1+(k?1:0),u=M>=A,y=[e.sCount[n]],e.sCount[n]=d-c,b=[e.tShift[n]],e.tShift[n]=M-e.bMarks[n],x=e.md.block.ruler.getRules("spoiler"),v=e.parentType,e.parentType="spoiler",C=!1,h=n+1;h<r&&(e.sCount[h]<e.blkIndent&&(C=!0),!((M=e.bMarks[h]+e.tShift[h])>=(A=e.eMarks[h])));h++)if(M+=t.markup.length,62!==e.src.charCodeAt(M-t.markup.length)||!t.followingCharRegex.test(e.src[M-t.markup.length+1])||C){if(u)break;for(w=!1,a=0,l=x.length;a<l;a++)if(x[a](e,h,r,!0)){w=!0;break}if(w){e.lineMax=h,0!==e.blkIndent&&(f.push(e.bMarks[h]),m.push(e.bsCount[h]),b.push(e.tShift[h]),y.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}f.push(e.bMarks[h]),m.push(e.bsCount[h]),b.push(e.tShift[h]),y.push(e.sCount[h]),e.sCount[h]=-1}else{for(c=d=e.sCount[h]+M-(e.bMarks[h]+e.tShift[h]),32===e.src.charCodeAt(M)?(M++,c++,d++,i=!1,k=!0):9===e.src.charCodeAt(M)?(k=!0,(e.bsCount[h]+d)%4==3?(M++,c++,d++,i=!1):i=!0):k=!1,f.push(e.bMarks[h]),e.bMarks[h]=M;M<A&&(s=e.src.charCodeAt(M),(0,dt.isSpace)(s));)9===s?d+=4-(d+e.bsCount[h]+(i?1:0))%4:d++,M++;u=M>=A,m.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(k?1:0),y.push(e.sCount[h]),e.sCount[h]=d-c,b.push(e.tShift[h]),e.tShift[h]=M-e.bMarks[h]}for(g=e.blkIndent,e.blkIndent=0,(_=e.push(t.name+"_open",t.name,1)).markup=t.markup,_.map=p=[n,0],e.md.block.tokenize(e,n,h),(_=e.push(t.name+"_close",t.name,-1)).markup=t.markup,e.lineMax=S,e.parentType=v,p[1]=e.line,a=0;a<b.length;a++)e.bMarks[a+n]=f[a],e.tShift[a+n]=b[a],e.sCount[a+n]=y[a],e.bsCount[a+n]=m[a];return e.blkIndent=g,!0}function bn(t,e,n,r){return yn({followingCharRegex:/!/,markup:">!",name:"spoiler"},t,e,n,r)}function kn(t,e,n,r){return yn({followingCharRegex:/[^!]/,markup:">",name:"blockquote"},t,e,n,r)}function wn(t){t.block.ruler.__rules__.forEach((function(t){var e=t.alt.indexOf("blockquote");e>-1&&t.alt.splice(e,0,"spoiler")})),t.block.ruler.before("blockquote","spoiler",bn,{alt:["paragraph","reference","spoiler","blockquote","list"]}),t.block.ruler.at("blockquote",kn,{alt:["paragraph","reference","spoiler","blockquote","list"]})}function xn(t,e,n,r,o,i){var s=n.bMarks[r]+n.tShift[r],a=n.eMarks[r];if(60!==n.src.charCodeAt(s)||s+2>=a)return!1;if(33!==n.src.charCodeAt(s+1))return!1;var c=n.src.slice(s,a),l=t.exec(c);if(!(null==l?void 0:l.length))return!1;if(i)return!0;var u=r+1;n.line=u;var p=n.push(e,"",0);return p.map=[r,u],p.content=n.getLines(r,u,n.blkIndent,!0),p.attrSet("language",l[1]),!0}function _n(t,e,n,r){return xn(/<!-- language: lang-(.+?) -->/,"stack_language_comment",t,e,0,r)}function Cn(t,e,n,r){return xn(/<!-- language-all: lang-(.+?) -->/,"stack_language_all_comment",t,e,0,r)}function Sn(t){for(var e=null,n=0,r=t.tokens;n<r.length;n++){var o=r[n];if("stack_language_all_comment"===o.type){e=o.attrGet("language");break}}for(var i=0,s=t.tokens.length;i<s;i++){var a=t.tokens[i],c=t.tokens[i+1];if("stack_language_comment"===a.type&&"code_block"===(null==c?void 0:c.type)){var l=a.attrGet("language");c.info=l}else"stack_language_all_comment"===a.type?e=a.attrGet("language"):"code_block"===a.type&&!a.info&&e&&(a.info=e)}return t.tokens=t.tokens.filter((function(t){return!t.type.startsWith("stack_language")})),!1}function Mn(t){t.block.ruler.before("html_block","stack_language_comment",_n),t.block.ruler.before("html_block","stack_language_all_comment",Cn),t.core.ruler.push("so-sanitize-code-lang",Sn)}function An(t,e){t.inline.ruler.push("tag_link",(function(t,n){return function(t,e,n){if(91!==t.src.charCodeAt(t.pos))return!1;if("[tag:"!==t.src.slice(t.pos,t.pos+5)&&"[meta-tag:"!==t.src.slice(t.pos,t.pos+10))return!1;var r=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(r<0)return!1;var o=t.src.slice(t.pos,r+1),i="[meta-tag:"===o.slice(0,10);if(i&&!n.allowMetaTags)return!1;var s=o.slice(i?10:5,-1);if(!(n.allowNonAscii?/([a-z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF#+.-]+)/i:/([a-z0-9#+.-]+)/i).exec(s))return!1;if(!e){var a=t.push("tag_link_open","a",1);a.attrSet("tagName",s),a.attrSet("tagType",i?"meta-tag":"tag"),a.content=o,(a=t.push("text","",0)).content=s,a=t.push("tag_link_close","a",-1)}return t.pos=r+1,!0}(t,n,e)}))}function Dn(t){for(var e=0,n=!1,r=!1,o=0;o<t.length;o++){var i=t[o];if("bullet_list_open"!==i.type&&"ordered_list_open"!==i.type){if(i.type.startsWith("list_item_"))n=i.type.endsWith("open");else if(i.type.startsWith("paragraph_")&&n&&i.hidden)r=!0;else if("bullet_list_close"===i.type||"ordered_list_close"===i.type){e=o;break}}else{var s=Dn(t.slice(o+1));s.isTight&&i.attrSet("tight",s.isTight.toString()),o+=s.iteratedElements+1}}return{iteratedElements:e,isTight:r}}function On(t){t.core.ruler.push("tight-list",(function(t){return Dn(t.tokens),!1}))}var En=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tn=function(){return(Tn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nn=Tn(Tn({},Ct.tokens),{pre:{block:"pre"},kbd:{mark:"kbd"},sup:{mark:"sup"},sub:{mark:"sub"},html_inline:{node:"html_inline",getAttrs:function(t){return{content:t.content}}},html_block:{node:"html_block",getAttrs:function(t){return{content:t.content}}},html_block_container:{block:"html_block_container",getAttrs:function(t){return{contentOpen:t.attrGet("contentOpen"),contentClose:t.attrGet("contentClose")}}},stack_language_comment:{ignore:!0},stack_language_all_comment:{ignore:!0},bullet_list:{block:"bullet_list",getAttrs:function(t){return{tight:"true"===t.attrGet("tight")}}},ordered_list:{block:"ordered_list",getAttrs:function(t){return{order:+t.attrGet("start")||1,tight:"true"===t.attrGet("tight")}}},code_block:{block:"code_block",getAttrs:function(t){return{params:t.info||""}}},s:{mark:"strike"},table:{block:"table"},thead:{block:"table_head"},tbody:{block:"table_body"},th:{block:"table_header",getAttrs:function(t){return{style:t.attrGet("style")}}},tr:{block:"table_row"},td:{block:"table_cell",getAttrs:function(t){return{style:t.attrGet("style")}}},image:{node:"image",getAttrs:function(t){var e,n;return{src:t.attrGet("src"),width:t.attrGet("width"),height:t.attrGet("height"),alt:t.attrGet("alt")||(null===(n=null===(e=t.children)||void 0===e?void 0:e[0])||void 0===n?void 0:n.content)||null,title:t.attrGet("title")}}},tag_link:{block:"tagLink",getAttrs:function(t){return{tagName:t.attrGet("tagName"),tagType:t.attrGet("tagType")}}},spoiler:{block:"spoiler"}});Object.keys(Nn).forEach((function(t){var e=Nn[t];if(e.getAttrs){var n=e.getAttrs.bind(e);e.getAttrs=function(t){var e=n(t);return e.markup=t.markup,e}}else e.getAttrs=function(t){return{markup:t.markup}}}));var In=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.tokenHandlers.softbreak=function(t){var e=o.schema.nodes.softbreak;t.openNode(e,{}),t.addText(" "),t.closeNode()},o}return En(e,t),e}(xt),Ln=function(t){function e(e,n){return t.call(this,e,n)||this}return En(e,t),e.prototype.parse=function(e,n){var r=t.prototype.parse.call(this,e,n);return pt("Sanitized markdown token tree",r),r},e}(rn()),zn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pn=function(){function t(t){var e=this,n='<div class="s-popover is-visible p4 w-auto wmx-initial wmn-initial js-link-tooltip"\n    id="link-tooltip-popover"\n    role="menu">\n    <div class="s-popover--arrow"></div>\n    <div class="grid ai-center">\n        <a href="'+this.href+'"\n            class="wmx3 grid--cell fs-body1 fw-normal d-inline-block truncate ml8 mr4"\n            target="_blank"\n            rel="nofollow noreferrer">'+this.href+'</a>\n        <div class="grid--cell d-none wmn2 ml2 mr4 js-link-tooltip-input-wrapper">\n            <input type="text"\n                    class="s-input s-input__sm js-link-tooltip-input"\n                    autocomplete="off"\n                    name="link"\n                    value="'+this.href+'" />\n        </div>\n        <button type="button"\n                class="grid--cell s-btn mr4 js-link-tooltip-edit"\n                title="Edit link"><span class="svg-icon icon-bg iconPencilSm"></span></button>\n        <button type="button"\n                class="grid--cell s-btn d-none js-link-tooltip-apply"\n                title="Apply new link">Apply</button>\n        <button type="button"\n                class="grid--cell s-btn js-link-tooltip-remove"\n                title="Remove link"><span class="svg-icon icon-bg iconTrashSm"></span></button>\n    </div>\n</div>';this.content=document.createElement("span"),this.content.className="w0",this.content.setAttribute("aria-controls","link-tooltip-popover"),this.content.setAttribute("data-controller","s-popover"),this.content.setAttribute("data-s-popover-placement","bottom"),this.content.innerHTML=n,this.content.addEventListener("s-popover:hide",(function(t){t.preventDefault()}));var r=function(t){e.applyListener.call(e,t)};this.input.addEventListener("keydown",(function(t){"Enter"===t.key&&(t.stopPropagation(),t.preventDefault(),r(t))})),this.bindElementInteraction(this.applyButton,r),this.bindElementInteraction(this.removeButton,(function(t){e.removeListener.call(e,t)})),this.bindElementInteraction(this.editButton,(function(){e.showEditMode(e.href)})),this.editing=!1,this.update(t)}return Object.defineProperty(t.prototype,"editButton",{get:function(){return this.content.querySelector(".js-link-tooltip-edit")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyButton",{get:function(){return this.content.querySelector(".js-link-tooltip-apply")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"removeButton",{get:function(){return this.content.querySelector(".js-link-tooltip-remove")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"link",{get:function(){return this.content.querySelector("a")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"input",{get:function(){return this.content.querySelector(".js-link-tooltip-input")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inputWrapper",{get:function(){return this.content.querySelector(".js-link-tooltip-input-wrapper")},enumerable:!1,configurable:!0}),t.prototype.bindElementInteraction=function(t,e){var n=this;t.addEventListener("mousedown",(function(t){t.stopPropagation(),t.preventDefault(),e.call(n,t)})),t.addEventListener("keydown",(function(t){"Tab"!==t.key&&(t.stopPropagation(),t.preventDefault(),"Enter"!==t.key&&" "!==t.key||e.call(n,t))}))},t.prototype.update=function(t){if(this.isLink(t)){var e=this.findMarksInSelection(t);if(e.length>0){this.href=e[0].attrs.href;var n=this.link;n.href=n.title=n.innerText=this.href}m($t.marks.link)(t)&&this.href&&this.hideEditMode(),(this.editing||""===this.href)&&this.showEditMode(this.href)}},t.prototype.getDecorations=function(t,e,n,r){var o=this;if("forceHide"in e&&e.forceHide)return ot.DecorationSet.empty;if(!this.findMarksInSelection(r).length)return ot.DecorationSet.empty;this.update(r);var i=ot.Decoration.widget(r.selection.from,(function(t){return o.updateEventListeners(t),o.content}),{side:-1,ignoreSelection:!0,stopEvent:function(){return!0}});return ot.DecorationSet.create(r.doc,[i])},t.prototype.hasFocus=function(t){return this.content.contains(t.relatedTarget)},t.prototype.isLink=function(t){var e=t.selection,n=e.from,r=e.$from,o=e.to;return e.empty?void 0!==$t.marks.link.isInSet(t.storedMarks||r.marks()):t.doc.rangeHasMark(n,o,$t.marks.link)},t.prototype.showEditMode=function(t){this.hideValidationError();var e=this.input;e.value=t||"https://",this.inputWrapper.classList.remove("d-none"),e.select(),this.applyButton.classList.remove("d-none"),this.editButton.classList.add("d-none"),this.link.classList.add("d-none"),e.focus()},t.prototype.hideEditMode=function(){this.editButton.classList.remove("d-none"),this.link.classList.remove("d-none"),this.inputWrapper.classList.add("d-none"),this.applyButton.classList.add("d-none")},t.prototype.showValidationError=function(){this.inputWrapper.classList.add("has-error")},t.prototype.hideValidationError=function(){this.inputWrapper.classList.remove("has-error")},t.prototype.expandSelection=function(t,e){var n=this.linkAround(t);return e.setSelection(i.TextSelection.create(e.doc,n.from,n.to))},t.prototype.linkAround=function(t){var e=t.selection.$from,n=e.parent.childAfter(e.parentOffset);if(n.node){var r=n.node.marks.find((function(e){return e.type===t.schema.marks.link}));if(r){for(var o=e.index(),i=e.start()+n.offset;o>0&&r.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(var s=e.indexAfter(),a=i+n.node.nodeSize;s<e.parent.childCount&&r.isInSet(e.parent.child(s).marks);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}}},t.prototype.findMarksInSelection=function(t){var e=[],n=t.selection,r=n.to,o=n.from,i=n.$from;if(n.empty)return i.marks().filter((function(t){return t.type===$t.marks.link}));r>o&&t.doc.nodesBetween(o,r,(function(t){e.push(t.marks.filter((function(t){return t.type===$t.marks.link})))}));var s=[];return s.concat.apply(s,e)},t.prototype.updateEventListeners=function(t){var e=this;this.removeListener=function(){var n=t.state;t.state.selection.empty&&(t.dispatch(e.expandSelection(n,t.state.tr)),n=t.state),m($t.marks.link)(n,t.dispatch.bind(t))},this.applyListener=function(){var n=e.link,r=e.input,o=t.state.selection,i=o.from,s=o.to;if(e.editing=!1,t.focus(),n.href!==r.value)if(e.hideValidationError(),ge(r.value)){if(n.href=n.title=n.innerText=r.value,t.state.selection.empty){var a=e.linkAround(t.state);i=a.from,s=a.to}var c=t.state.tr.addMark(i,s,$t.marks.link.create({href:e.link.href}));t.dispatch(c)}else e.showValidationError();else e.hideEditMode()}},t}(),Fn=new(function(t){function e(){return t.call(this,Pn.name)||this}return zn(e,t),e.prototype.setEditMode=function(t,e,n){var r=this.getState(e);return r.editing=t,this.setMeta(n,r)},e.prototype.forceHide=function(t,e){var n=this.getState(t);n.decorations!==ot.DecorationSet.empty&&(n.forceHide=!0,e(this.setMeta(t.tr,n)))},e}(Gt)),qn=new Kt({key:Fn,state:{init:function(t,e){return{linkTooltip:new Pn(e),decorations:ot.DecorationSet.empty}},apply:function(t,e,n,r){var o=this.getMeta(t)||e;"forceHide"in o&&(e.forceHide=o.forceHide),e.linkTooltip.editing="editing"in o&&o.editing;var i=e.linkTooltip.getDecorations(t,e,n,r);return{linkTooltip:e.linkTooltip,decorations:i}}},props:{decorations:function(t){return this.getState(t).decorations},handleDOMEvents:{blur:function(t,e){var n=Fn.getState(t.state).linkTooltip;return t.hasFocus()||n.hasFocus(e)||Fn.forceHide(t.state,t.dispatch.bind(t)),!1}}}});function Rn(t){var e=or(t),n=d(t);return function(t,o){if(!e(t))return n(t,o);var i=t.selection,s=i.$from,a=i.$to,c=s.blockRange(a),l=c&&(0,r.k9)(c);return null!=l&&(o&&o(t.tr.lift(c,l)),!0)}}var Bn=f($t.nodes.paragraph);function Vn(t,e){var n=or(t),r=f(t,e);return function(t,e){return n(t)?Bn(t,e):r(t,e)}}function jn(t,e){return!$n(t.selection)&&(e&&e(t.tr.replaceSelectionWith($t.nodes.horizontal_rule.create())),!0)}function $n(t){return Ht.includes(t.$head.parent.type)}function Hn(t){return t.$head.parent.type===$t.nodes.table_header}var Un=g(p,(function(t,e){return e(t.tr.replaceSelectionWith($t.nodes.hard_break.create()).scrollIntoView()),!0}));function Wn(t,e){return Jn(t,e,!1)}function Jn(t,e,n){if(void 0===n&&(n=!1),!$n(t.selection))return!1;if(e){var r=$t.nodes.paragraph,o=n?t.selection.$head.before(-3)-1:t.selection.$head.after(-3)+1,s=t.tr;try{s.doc.resolve(o)}catch(t){var a=n?o+1:o-1;s.insert(a,r.create())}s.setSelection(i.Selection.near(s.doc.resolve(Math.max(0,o)),1)),e(s.scrollIntoView())}return!0}function Gn(t,e,n){if(!$n(e.selection)||Hn(e.selection))return!1;if(n){var r=e.selection.$head,o=r.node(-1),i=[];o.forEach((function(t){i.push($t.nodes.table_cell.create(t.attrs))}));var s=$t.nodes.table_row.create(null,i),a=t?r.before(-1):r.after(-1);n(e.tr.insert(a,s).scrollIntoView())}return!0}function Kn(t,e,n){if(!$n(e.selection))return!1;if(n){var r,o=e.selection.$head,i=o.node(-3),s=o.index(-1),a=[],c=o.start(-3);i.descendants((function(e,n){if(!Ht.includes(e.type))return!1;if(e.type===$t.nodes.table_row&&(r=e.child(s)),r&&e==r){var o=t?i.resolve(n+1).before():i.resolve(n+1).after();a.push([e.type,c+o])}}));for(var l=e.tr,u=0,p=a.reverse();u<p.length;u++){var h=p[u];l=l.insert(h[1],h[0].create())}n(l.scrollIntoView())}return!0}function Yn(t,e){if(!$n(t.selection)||Hn(t.selection))return!1;if(e){var n=t.tr,r=t.selection.$head;if(1===r.node(-2).childCount)return tr(t,e);n.delete(r.start(-1)-1,r.end(-1)+1),e(n.scrollIntoView())}return!0}function Zn(t,e){if(!$n(t.selection))return!1;var n=t.selection,r=n.$from,o=n.$to;return r.start(-3)>=r.pos-3&&r.end(-3)<=o.pos+3?tr(t,e):r.start(-1)>=r.pos-1&&r.end(-1)<=o.pos+1?Yn(t,e):!r.sameParent(o)}function Qn(t,e,n){if(-1!==n&&1!==n)return!1;if(!$n(t.selection))return!1;for(var r=t.selection.$head,o=-1;o>-4;o--){var s=r.index(o),a=r.node(o);if(a&&a.maybeChild(s+n)){var c=-1===n?r.start()- -1*o*2:r.end()+-1*o*2;return e(t.tr.setSelection(i.Selection.near(t.tr.doc.resolve(c),1)).scrollIntoView()),!0}}return 1===n?Wn(t,e):function(t,e){return Jn(t,e,!0)}(t,e)}function Xn(t,e){return Qn(t,e,1)}function tr(t,e){var n=t.selection.$head;return e&&e(t.tr.deleteRange(n.start(-3)-1,n.end(-3)+1)),!0}function er(t,e){if(!f($t.nodes.table)(t))return!1;if(!e)return!0;var n,r,o=1,i=1,s=function(){return $t.nodes.table_cell.create(null,$t.text("cell "+i++))},a=function(){return $t.nodes.table_header.create(null,$t.text("header "+o++))},c=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $t.nodes.table_row.create(null,t)},l=(n=function(t){return $t.nodes.table_head.create(null,t)}(c(a(),a(),a())),r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $t.nodes.table_body.create(null,t)}(c(s(),s(),s()),c(s(),s(),s()),c(s(),s(),s())),$t.nodes.table.createChecked(null,[n,r])),u=t.tr.replaceSelectionWith(l);e(u.scrollIntoView());var p=t.apply(u),h=p.doc.nodeAt(p.tr.selection.to-1);return h&&h.type===$t.nodes.text&&e((u=p.tr.insert(p.tr.selection.to,$t.nodes.paragraph.create(null))).scrollIntoView()),!0}function nr(t,e,n){return!(!re(n)||e&&(ne(n),0))}function rr(t,e,n){var r,o;if(t.selection.empty)return!1;if(e){var i=null!==(o=null===(r=t.selection.content().content.firstChild)||void 0===r?void 0:r.textContent)&&void 0!==o?o:null,s=/^http(s)?:\/\/\S+$/.exec(i),a=(null==s?void 0:s.length)>0?s[0]:"";if(m($t.marks.link,{href:a})(t,e)){var c=Fn.setEditMode(!0,t,n.state.tr);n.dispatch(c)}}return!0}function or(t){return function(e){var n=e.selection,r=n.from,o=n.to,i=!1;return e.doc.nodesBetween(r,o,(function(e){return!(i=e.type.name===t.name)})),i}}function ir(t){return function(e){var n=e.selection,r=n.from,o=n.$from,i=n.to;return n.empty?!!t.isInSet(e.storedMarks||o.marks()):e.doc.rangeHasMark(r,i,t)}}var sr=function(t){var e;return xe([{key:"toggleHeading",command:Vn($t.nodes.heading,{level:1}),dom:_e("Header","Heading","heading-btn"),active:or($t.nodes.heading)},{key:"toggleBold",command:m($t.marks.strong),dom:_e("Bold","Bold","bold-btn"),active:ir($t.marks.strong)},{key:"toggleEmphasis",command:m($t.marks.em),dom:_e("Italic","Italic","italic-btn"),active:ir($t.marks.em)},{key:"toggleCode",command:m($t.marks.code),dom:_e("Code","Inline code","code-btn"),active:ir($t.marks.code)},we({key:"toggleStrike",command:m($t.marks.strike),dom:_e("Strikethrough","Strikethrough","strike-btn"),active:ir($t.marks.strike)},t.parserFeatures.extraEmphasis),Ce(),{key:"toggleLink",command:rr,dom:_e("Link","Link selection","insert-link-btn")},{key:"toggleBlockquote",command:Rn($t.nodes.blockquote),dom:_e("Quote","Blockquote","blockquote-btn"),active:or($t.nodes.blockquote)},{key:"toggleCodeblock",command:Vn($t.nodes.code_block),dom:_e("Codeblock","Code block","code-block-btn"),active:or($t.nodes.code_block)},we({key:"insertImage",command:nr,dom:_e("Image","Image","insert-image-btn")},!!(null===(e=t.imageUpload)||void 0===e?void 0:e.handler)),we({key:"insertTable",command:er,dom:_e("Table","Table","insert-table-btn"),visible:function(t){return!$n(t.selection)}},t.parserFeatures.tables),we(ar,t.parserFeatures.tables),Ce(),{key:"toggleOrderedList",command:Rn($t.nodes.ordered_list),dom:_e("OrderedList","Numbered list","numbered-list-btn"),active:or($t.nodes.ordered_list)},{key:"toggleUnorderedList",command:Rn($t.nodes.bullet_list),dom:_e("UnorderedList","Bulleted list","bullet-list-btn"),active:or($t.nodes.bullet_list)},{key:"insertRule",command:jn,dom:_e("HorizontalRule","Horizontal rule","horizontal-rule-btn")},Ce((function(){return!1}),["sm:d-inline-block"]),{key:"undo",command:V,dom:_e("Undo","Undo","undo-btn",["sm:d-inline-block"]),visible:function(){return!1}},{key:"redo",command:j,dom:_e("Refresh","Redo","redo-btn",["sm:d-inline-block"]),visible:function(){return!1}},Ce(),Ae("Help","Help",t.editorHelpLink)],t.menuParentContainer)},ar=function(t,e,n,r){for(var o=[],i=4;i<arguments.length;i++)o[i-4]=arguments[i];var s="table-button-popover",a=_e(t,e,n);a.classList.add("s-btn","s-btn__dropdown"),a.setAttribute("aria-controls",s),a.setAttribute("data-controller","s-popover"),a.setAttribute("data-action","s-popover#toggle"),a.setAttribute("data-s-popover-toggle-class","is-selected"),a.dataset.key=n;var c=document.createElement("div");c.className="s-popover wmn-initial w-auto px0 pt0 pb8",c.id=s,c.setAttribute("role","menu");var l=document.createElement("div");l.className="s-popover--arrow",c.appendChild(l);var u=document.createElement("div");u.className="grid fd-column",u.append.apply(u,o.map((function(t){return t.dom}))),c.appendChild(u);var p=document.createElement("div");return p.appendChild(a),p.appendChild(c),{key:n,dom:p,children:o,command:function(){return!0},visible:r}}("Table","Edit table","table-dropdown",(function(t){return $n(t.selection)}),Me("Column","columnSection"),Se("Remove column",(function(t,e){if(!$n(t.selection))return!1;if(e){var n=t.selection.$head,r=n.node(-3);if(1===n.node(-1).childCount)return tr(t,e);var o,i=n.index(-1),s=[],a=n.start(-3);r.descendants((function(t,e){if(!Ht.includes(t.type))return!1;t.type===$t.nodes.table_row&&(o=t.childCount>=i+1?t.child(i):null),o&&t==o&&s.push(r.resolve(e+1))}));for(var c=t.tr,l=0,u=s.reverse();l<u.length;l++){var p=u[l];c=c.delete(a+p.start()-1,a+p.end()+1)}e(c.scrollIntoView())}return!0}),"remove-column-btn"),Se("Insert column before",(function(t,e){return Kn(!0,t,e)}),"insert-column-before-btn"),Se("Insert column after",(function(t,e){return Kn(!1,t,e)}),"insert-column-after-btn"),Me("Row","rowSection"),Se("Remove row",Yn,"remove-row-btn"),Se("Insert row before",(function(t,e){return Gn(!0,t,e)}),"insert-row-before-btn"),Se("Insert row after",(function(t,e){return Gn(!1,t,e)}),"insert-row-after-btn")),cr=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function lr(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"￼")+r,l=0;l<o.length;l++){var u=o[l].match.exec(c),p=u&&o[l].handler(s,u,e-(u[0].length-r.length),n);if(p)return t.dispatch(p.setMeta(i,{transform:p,from:e,to:n,text:r})),!0}return!1}function ur(t,e,n,o){return new cr(t,(function(t,i,s,a){var c=n instanceof Function?n(i):n,l=t.tr.delete(s,a),u=l.doc.resolve(s).blockRange(),p=u&&(0,r.nd)(u,e,c);if(!p)return null;l.wrap(u,p);var h=l.doc.resolve(s-1).nodeBefore;return h&&h.type==e&&(0,r.Mn)(l.doc,s-1)&&(!o||o(i,h))&&l.join(s-1),l}))}function pr(t,e,n){return new cr(t,(function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}var hr,dr,fr,mr,gr=(hr={rules:function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}([new cr(/--$/,"—"),new cr(/\.\.\.$/,"…")],[new cr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new cr(/"$/,"”"),new cr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new cr(/'$/,"’")],[ur(/^\s*>\s$/,$t.nodes.blockquote),pr(new RegExp("^(#{1,3})\\s$"),$t.nodes.heading,(function(t){return{level:t[1].length}})),pr(/^```$/,$t.nodes.code_block),ur(/^\s*[*+-]\s$/,$t.nodes.bullet_list),ur(/^\s*\d\.\s$/,$t.nodes.ordered_list,(function(t){return{order:+t[1]}}),(function(t,e){return e.childCount+e.attrs.order==+t[1]}))])},dr=hr.rules,fr=new i.Plugin({state:{init:function(){return null},apply:function(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,e,n,r){return lr(t,e,n,r,dr,fr)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var e=t.state.selection.$cursor;e&&lr(t,e.pos,e.pos,"",dr,fr)}))}}},isInputRules:!0})),vr=nt({"Mod-z":V,"Mod-y":j,"Mod-Shift-z":j,Backspace:function(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){for(var s=t.tr,a=i.transform,c=a.steps.length-1;c>=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to);e(s)}return!0}}return!1},Enter:(mr=$t.nodes.list_item,function(t,e){var n=t.selection,i=n.$from,s=n.$to,a=n.node;if(a&&a.isBlock||i.depth<2||!i.sameParent(s))return!1;var c=i.node(-1);if(c.type!=mr)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(2==i.depth||i.node(-3).type!=mr||i.index(-2)!=i.node(-2).childCount-1)return!1;if(e){for(var l=o.HY.empty,u=i.index(-1)>0,p=i.depth-(u?1:2);p>=i.depth-3;p--)l=o.HY.from(i.node(p).copy(l));l=l.append(o.HY.from(mr.createAndFill()));var h=t.tr.replace(i.before(u?null:-1),i.after(-3),new o.p2(l,u?3:2,2));h.setSelection(t.selection.constructor.near(h.doc.resolve(i.pos+(u?3:2)))),e(h.scrollIntoView())}return!0}var d=s.pos==i.end()?c.contentMatchAt(0).defaultType:null,f=t.tr.delete(i.pos,s.pos),m=d&&[null,{type:d}];return!!(0,r.Ax)(f.doc,i.pos,2,m)&&(e&&e(f.split(i.pos,2,m).scrollIntoView()),!0)}),Tab:function(t){return function(e,n){var i=e.selection,s=i.$from,a=i.$to,c=s.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));if(!c)return!1;var l=c.startIndex;if(0==l)return!1;var u=c.parent,p=u.child(l-1);if(p.type!=t)return!1;if(n){var h=p.lastChild&&p.lastChild.type==u.type,d=o.HY.from(h?t.create():null),f=new o.p2(o.HY.from(t.create(null,o.HY.from(u.type.create(null,d)))),h?3:1,0),m=c.start,g=c.end;n(e.tr.step(new r.FC(m-(h?3:1),g,m,g,f,1,!0)).scrollIntoView())}return!0}}($t.nodes.list_item),"Shift-Tab":function(t){return function(e,n){var i=e.selection,s=i.$from,a=i.$to,c=s.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));return!!c&&(!n||(s.node(c.depth-1).type==t?function(t,e,n,i){var s=t.tr,a=i.end,c=i.$to.end(i.depth);return a<c&&(s.step(new r.FC(a-1,c,a,c,new o.p2(o.HY.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.Ts(s.doc.resolve(i.$from.pos),s.doc.resolve(c),i.depth)),e(s.lift(i,(0,r.k9)(i)).scrollIntoView()),!0}(e,n,t,c):function(t,e,n){for(var i=t.tr,s=n.parent,a=n.end,c=n.endIndex-1,l=n.startIndex;c>l;c--)a-=s.child(c).nodeSize,i.delete(a-1,a+1);var u=i.doc.resolve(n.start),p=u.nodeAfter,h=0==n.startIndex,d=n.endIndex==s.childCount,f=u.node(-1),m=u.index(-1);if(!f.canReplace(m+(h?0:1),m+1,p.content.append(d?o.HY.empty:o.HY.from(s))))return!1;var g=u.pos,v=g+p.nodeSize;return i.step(new r.FC(g-(h?1:0),v+(d?1:0),g+1,v-1,new o.p2((h?o.HY.empty:o.HY.from(s.copy(o.HY.empty))).append(d?o.HY.empty:o.HY.from(s.copy(o.HY.empty))),h?0:1,d?0:1),h?0:1)),e(i.scrollIntoView()),!0}(e,n,c)))}}($t.nodes.list_item),"Mod-Enter":Un,"Shift-Enter":Un,"Mod-b":m($t.marks.strong),"Mod-i":m($t.marks.em),"Mod-l":rr,"Ctrl-q":d($t.nodes.blockquote),"Mod-k":m($t.marks.code),"Mod-g":nr,"Ctrl-g":nr,"Mod-o":d($t.nodes.ordered_list),"Mod-u":d($t.nodes.bullet_list),"Mod-h":f($t.nodes.heading),"Mod-r":jn,"Mod-m":f($t.nodes.code_block)}),yr=nt({"Mod-Enter":Wn,"Shift-Enter":Wn,Enter:Xn,Backspace:Zn,Delete:Zn,"Mod-Backspace":Zn,"Mod-Delete":Zn,Tab:Xn,"Shift-Tab":function(t,e){return Qn(t,e,-1)}}),br=function(){return(br=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kr=br(br({},Mt.nodes),{blockquote:function(t,e){var n=e.attrs.markup||">";t.wrapBlock(n+" ",null,e,(function(){return t.renderContent(e)}))},code_block:function(t,e){var n=e.attrs.markup;n?(t.write(n+(e.attrs.params||"")+"\n"),t.text(e.textContent,!1),t.ensureNewLine(),t.write(n)):e.textContent.split("\n").forEach((function(e,n){n>0&&t.ensureNewLine(),t.text("    "+e,!1)})),t.closeBlock(e)},heading:function(t,e){var n=e.attrs.markup||"";n.startsWith("<")?(t.write("h1 tag TODO"),t.closeBlock(e)):n&&!n.startsWith("#")?(t.renderInline(e),t.ensureNewLine(),t.write(n),t.closeBlock(e)):(t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e),t.closeBlock(e))},horizontal_rule:function(t,e){t.write(e.attrs.markup||"----------"),t.closeBlock(e)},bullet_list:function(t,e){var n=e.attrs.markup||"-";t.renderList(e,"  ",(function(){return n+" "}))},ordered_list:function(t,e){var n=e.attrs.order||1,r=String(n+e.childCount-1).length,o=t.repeat(" ",r+2),i=e.attrs.markup||".";t.renderList(e,o,(function(e){var o=String(n+e);return t.repeat(" ",r-o.length)+o+i+" "}))},list_item:function(t,e){t.renderContent(e)},paragraph:function(t,e){t.renderInline(e),t.closeBlock(e)},image:function(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+t.esc(e.attrs.src)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")")},hard_break:function(t,e,n,r){for(var o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type)return void t.write("  \n")},text:function(t,e){var n=t.atBlank()||t.closed,r=t.esc(e.text,n);r=r.replace(/\b_|_\b/g,"\\_"),t.text(r,!1)}}),wr={html_inline:function(t,e){t.write(e.attrs.content),t.ensureNewLine(),t.write("\n")},html_block:function(t,e){t.write(e.attrs.content),t.ensureNewLine(),t.write("\n")},html_block_container:function(t,e){t.write(e.attrs.contentOpen),t.ensureNewLine(),t.write("\n"),t.renderContent(e),t.write(e.attrs.contentClose),t.closeBlock(e)},softbreak:function(t){t.write("\n")},table:function(t,e){function n(e){var n=[];return e.forEach((function(e){if(e.type===$t.nodes.table_header||e.type===$t.nodes.table_cell){var r=function(e){return t.write("| "),t.renderInline(e),t.write(" "),function(t){var e=t.attrs.style;if(!e)return null;var n=e.match(/text-align:[ ]?(left|right|center)/);return n&&n[1]?n[1]:null}(e)}(e);n.push(r)}})),t.write("|"),t.ensureNewLine(),n}e.forEach((function(e){e.type===$t.nodes.table_head&&function(e){var r=[];e.forEach((function(t){t.type===$t.nodes.table_row&&(r=n(t))}));for(var o=0,i=r;o<i.length;o++){var s=i[o];t.write("|"),t.write("left"===s||"center"===s?":":" "),t.write("---"),t.write("right"===s||"center"===s?":":" ")}t.write("|"),t.ensureNewLine()}(e),e.type===$t.nodes.table_body&&(e.forEach((function(t){t.type===$t.nodes.table_row&&n(t)})),t.ensureNewLine())})),t.ensureNewLine(),t.write("\n")},tagLink:function(t,e){var n="meta-tag"===e.attrs.tagType?"meta-tag":"tag",r=e.attrs.tagName;t.write("["+n+":"+r+"]")},spoiler:function(t,e){t.wrapBlock(">! ",null,e,(function(){return t.renderContent(e)}))}};function xr(t){return t.open instanceof Function||t.close instanceof Function?(ht("markdown-serializer genMarkupAwareMarkSpec","Unable to extend mark config with open/close as functions",t),t):br(br({},t),{open:function(e,n){return n.attrs.markup||t.open},close:function(e,n){var r=n.attrs.markup;return(r=/^<[a-z]+>$/i.test(r)?r.replace(/^</,"</"):r)||t.close}})}var _r=Mt.marks.link,Cr={open:function(t,e,n,r){if(!e.attrs.markup)return"string"==typeof _r.open?_r.open:_r.open(t,e,n,r);if("linkify"===e.attrs.markup)return"";if("autolink"===e.attrs.markup)return"<";var o=e.attrs.title?' title="'+e.attrs.title+'"':"";return"<a"+(e.attrs.href?' href="'+e.attrs.href+'"':"")+o+">"},close:function(t,e,n,r){return e.attrs.markup?"linkify"===e.attrs.markup?"":"autolink"===e.attrs.markup?">":"</a>":"string"==typeof _r.close?_r.close:_r.close(t,e,n,r)}},Sr=br(br({},Mt.marks),{em:xr(Mt.marks.em),strong:xr(Mt.marks.strong),link:Cr,strike:xr({open:"~~",close:"~~",mixable:!0,expelEnclosingWhitespace:!0}),kbd:xr({open:"<kbd>",close:"</kbd>",mixable:!0,expelEnclosingWhitespace:!0}),sup:xr({open:"<sup>",close:"</sup>",mixable:!0,expelEnclosingWhitespace:!0}),sub:xr({open:"<sub>",close:"</sub>",mixable:!0,expelEnclosingWhitespace:!0})}),Mr=function(){function t(t){this.language=null,this.dom=document.createElement("div"),this.dom.classList.add("ps-relative","p0","ws-normal","ow-normal");var e=this.getLanguageFromBlock(t);this.language=e,this.dom.innerHTML='\n<div class="ps-absolute t2 r4 fs-fine pe-none us-none fc-black-300 js-language-indicator" contenteditable=false>'+e+'</div>\n<pre class="s-code-block"><code class="content-dom"></code></pre>\n        ',this.contentDOM=this.dom.querySelector(".content-dom")}return t.prototype.update=function(t){var e=this.getLanguageFromBlock(t);return this.language!==e&&(this.dom.querySelector(".js-language-indicator").textContent=e,this.language=e),!0},t.prototype.getLanguageFromBlock=function(t){var e=t.attrs.detectedHighlightLanguage;return e&&(e+=" (auto)"),e||at(t)},t}(),Ar=function(t){this.dom=document.createElement("div"),this.dom.className="html_block ProseMirror-widget",this.dom.innerHTML=t.attrs.content},Dr=function(t){if(this.dom=document.createElement("div"),this.dom.className="html_block_container ProseMirror-widget",t.childCount){var e=t.attrs.contentOpen+'<div class="ProseMirror-contentdom"></div>'+t.attrs.contentClose;this.dom.innerHTML=e,this.contentDOM=this.dom.querySelector(".ProseMirror-contentdom")}else this.dom.innerHTML="invalid html_block_container"},Or=0,Er=function(){function t(t,e,n){var r=this;this.id=Or++,this.img=this.createImage(t),this.form=this.createForm(),this.form.addEventListener("submit",(function(t){return r.handleChangedImageAttributes(t,n,e)})),this.popover=this.createPopover(),this.dom=document.createElement("div"),this.dom.appendChild(this.img),this.dom.appendChild(this.popover),this.dom.addEventListener("s-popover:hide",(function(t){return r.preventClose(t)}))}return t.prototype.selectNode=function(){this.img.classList.add("bs-ring"),this.selectionActive=!0,this.img.dispatchEvent(new Event("image-popover-show"));var t=this.form.querySelectorAll("input");t.length>0&&t[0].focus({preventScroll:!0})},t.prototype.deselectNode=function(){this.img.classList.remove("bs-ring"),this.selectionActive=!1,this.img.dispatchEvent(new Event("image-popover-hide"))},t.prototype.stopEvent=function(t){return this.popover.contains(t.target)},t.prototype.ignoreMutation=function(){return!0},t.prototype.destroy=function(){this.img.remove(),this.popover.remove(),this.dom=null,this.form.remove()},t.prototype.createImage=function(t){var e=document.createElement("img");return e.setAttribute("aria-controls","img-popover-"+this.id),e.setAttribute("data-controller","s-popover"),e.setAttribute("data-action","image-popover-show->s-popover#show image-popover-hide->s-popover#hide"),e.src=t.attrs.src,t.attrs.alt&&(e.alt=t.attrs.alt),t.attrs.title&&(e.title=t.attrs.title),e},t.prototype.createForm=function(){var t=document.createElement("form");return t.className="grid fd-column",t.innerHTML='\n            <label class="grid--cell s-label mb4" for="img-src-'+this.id+'">Image source</label>\n            <div class="grid ps-relative mb12">\n                <input class="grid--cell s-input" type="text" name="src" id="img-src-'+this.id+'" value="'+this.img.src+'" placeholder="https://example.com/image.png"/>\n            </div>\n            <label class="grid--cell s-label mb4" for="img-alt-'+this.id+'">Image description</label>\n            <div class="grid ps-relative mb12">\n                <input class="grid--cell s-input" type="text" name="alt" id="img-alt-'+this.id+'" value="'+this.img.alt+'" placeholder="A description for the image"/>\n            </div>\n            <label class="grid--cell s-label mb4" for="img-title-'+this.id+'">Title</label>\n            <div class="grid ps-relative mb12">\n                <input class="grid--cell s-input" type="text" name="title" id="img-title-'+this.id+'" value="'+this.img.title+'" placeholder="A title shown on hover"/>\n            </div>\n\n            <button class="s-btn s-btn__primary" type="submit" aria-pressed="false">Apply</button>\n        ',t},t.prototype.createPopover=function(){var t=document.createElement("div");return t.className="s-popover ws-normal wb-normal js-img-popover",t.id="img-popover-"+this.id,t.innerHTML='<div class="s-popover--arrow ws-normal"></div>',t.append(this.form),t},t.prototype.handleChangedImageAttributes=function(t,e,n){var r=this;if(t.preventDefault(),"function"==typeof e){var o=function(t){return r.form.querySelector(t)},i=o("#img-src-"+this.id),s=o("#img-alt-"+this.id),a=o("#img-title-"+this.id);n.dispatch(n.state.tr.setNodeMarkup(e(),null,{src:i.value,alt:s.value,title:a.value})),n.focus()}},t.prototype.preventClose=function(t){this.selectionActive&&t.preventDefault()},t}(),Tr=function(t,e){var n=this;if(this.dom=document.createElement("a"),this.dom.setAttribute("href","#"),this.dom.setAttribute("rel","tag"),this.dom.classList.add("s-tag"),this.dom.innerText=t.attrs.tagName,null==e?void 0:e.renderer){var r=e.renderer(t.attrs.tagName,"meta-tag"===t.attrs.tagType);if(!r||!(null==r?void 0:r.link))return void ht("TagLink NodeView","Unable to render taglink due to invalid response from options.renderer: ",r);(r.additionalClasses||[]).forEach((function(t){return n.dom.classList.add(t)})),this.dom.setAttribute("href",r.link),this.dom.setAttribute("title",r.linkTitle)}},Nr=new i.Plugin({props:{handlePaste:function(t,e,n){var r;if(!(r=1===n.content.childCount&&"code_block"===n.content.child(0).type.name?n.content.child(0).textContent:function(t){var e=t.getData("text/html");if(e&&e.includes("<code>")){var n=(new DOMParser).parseFromString(e,"text/html"),r=n.querySelector("code");return n.body.textContent.trim()!==r.textContent?null:r.textContent}var o=t.getData("text/plain");return o&&(t.getData("vscode-editor-data")||/^([ ]{2,}|\t)/m.test(o))?o:null}(e.clipboardData)))return!1;if("code_block"===t.state.selection.$from.node().type.name)t.dispatch(t.state.tr.insertText(r));else{var o=t.state.schema,i=o.node("code_block",{},o.text(r));t.dispatch(t.state.tr.replaceSelectionWith(i))}return!0}}}),Ir={};function Lr(t,e){var n=[];return t.descendants((function(t,r){var o=function(t,e){var n,r;if(!function(t){var e=t.content.firstChild;if(!e)return!1;var n=1===t.childCount,r="text"===e.type.name,o=e.marks.some((function(t){return"link"===t.type.name}));return n&&r&&o}(e))return null;var o=null===(r=null===(n=e.content.firstChild.marks.find((function(t){return"link"===t.type.name})))||void 0===n?void 0:n.attrs)||void 0===r?void 0:r.href;if(!o)return null;for(var i=0,s=t;i<s.length;i++){var a=s[i];if(a.domainTest&&a.domainTest.test(o))return{url:o,provider:a}}return null}(e,t);if(o)return n.push({provider:o,pos:r,node:t}),!1})),n}function zr(t,e){var n=[];return Lr(t,e).forEach((function(t){var e=function(){var t=document.createElement("div");return t.className="js-placeholder",t.innerHTML='<div class="s-spinner s-spinner__xs"></div>',t}();n.push(ot.Decoration.widget(t.pos,e)),t.provider.url in Ir&&function(t,e){t.innerHTML="",e&&t.appendChild(e)}(e,Ir[t.provider.url])})),ot.DecorationSet.create(t,n)}var Pr=new Yt("linkPreviews");var Fr=function(){return(Fr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function qr(t,e,n,r){var o=e.selection,i=o.from,s=o.to;return e.doc.nodesBetween(i,s,(function(e,o){if("spoiler"===e.type.name){var i=Fr({},e.attrs);i.revealed=n;var s=!1;return(null==r?void 0:r.length)&&r.forEach((function(t){var e=t.mapping.mapResult(o);if(e.deleted)return s=!0,!1;o=e.pos})),s||(t=t.setNodeMarkup(o,null,i)),!1}})),t}var Rr=new i.Plugin({appendTransaction:function(t,e,n){if(!de(e,n))return null;var r=n.tr;return r=qr(r,e,!1,t),(r=qr(r,n,!0)).steps.length?r=r.setMeta("addToHistory",!1):null}}),Br=new i.Plugin({key:new i.PluginKey("tablesPlugin"),props:{transformPasted:function(t){return new o.p2(Vr(t.content),1,1)},handlePaste:function(t,e,n){return!!$n(t.state.selection)&&(t.dispatch(t.state.tr.insertText(function(t){return t.size&&t.content&&t.content.firstChild?t.content.firstChild.textContent:null}(n))),!0)}}});function Vr(t){var e=[];return t.forEach((function(t){t.type===$t.nodes.table?e.push($t.nodes.paragraph.createAndFill({},$t.text(t.textContent))):e.push(t.copy(Vr(t.content)))})),o.HY.fromArray(e)}var jr,$r=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hr=function(){return(Hr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ur=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},Wr=function(t){function e(n,r,o){void 0===o&&(o={});var s,a=t.call(this)||this;a.options=ue(e.defaultOptions,o),a.externalPlugins=(a.options.externalPlugins||[]).reduce((function(t,e){return t?ue(t,e):e}),null)||{menuEntries:[],nodeViews:{},markdownParser:{tokens:{},plugins:[]},markdownSerializers:{},plugins:[],schema:null},a.markdownSerializer=(s=a.externalPlugins,new St(br(br(br({},kr),wr),s.markdownSerializers),Sr));var c,l,u,p=a.parseContent(r),h=a.options.parserFeatures.tagLinks;return a.editorView=new ot.EditorView((function(t){var e;(e=t.classList).add.apply(e,a.options.classList),n.appendChild(t)}),{editable:ae,state:i.EditorState.create({doc:p,plugins:Ur([B(),yr,vr,nt(x),sr(a.options),gr,(u=a.options.linkPreviewProviders,u=u||[],new Qt({key:Pr,asyncCallback:function(t){return function(t,e){var n=Lr(t.state.doc,e).filter((function(t){return!(t.provider.url in Ir)}));if(!n.length)return Promise.reject(null);var r=n.map((function(t){return t.provider.provider.renderer(t.provider.url).then((function(e){return Ir[t.provider.url]=e,e})).catch((function(){var e=document.createElement("div");return e.innerText="Error fetching content.",Ir[t.provider.url]=e,Promise.resolve(e)}))}));return Promise.all(r)}(t,u)},state:{init:function(t,e){return zr(e.doc,u)},apply:function(t,e){return this.getCallbackData(t)?zr(t.doc,u):e.map(t.mapping,t.doc)}},props:{decorations:function(t){return this.getState(t)}}})),ct(a.options.codeblockOverrideLanguage),qn,(c=a.options.imageUpload,l=a.options.pluginParentContainer,oe(c,l,(function(t,e,n){return t.tr.replaceWith(n,n,$t.nodes.image.create({src:e}))}))),le(),Rr,Br,Nr],a.externalPlugins.plugins)}),nodeViews:Hr({code_block:function(t){return new Mr(t)},image:function(t,e,n){return new Er(t,e,n)},tagLink:function(t){return new Tr(t,h)},html_block:function(t){return new Ar(t)},html_block_container:function(t){return new Dr(t)}},a.externalPlugins.nodeViews)}),pt("prosemirror rich-text document",a.editorView.state.doc.toJSON().content),a}return $r(e,t),Object.defineProperty(e,"defaultOptions",{get:function(){return{parserFeatures:ve,editorHelpLink:null,linkPreviewProviders:[],codeblockOverrideLanguage:null,menuParentContainer:null,imageUpload:{handler:Xt},externalPlugins:[]}},enumerable:!1,configurable:!0}),e.prototype.parseContent=function(t){var e,n,i=function(t,e){return e?(Object.keys(e.nodes).forEach((function(n){if(!t.nodes[n]){var r=new o.Jq(n,t,e.nodes[n]);tn(r,t),t.nodes[n]=r}})),Object.keys(t.nodes).forEach((function(e){tn(t.nodes[e],t)})),t):t}($t,null===(e=this.externalPlugins)||void 0===e?void 0:e.schema),s=function(t,e,n){var r;if(!t)throw"Cannot build markdown parser without passed features.";var o=new Ln("default",{html:t.html,linkify:!0});return t.tables||o.disable("table"),t.extraEmphasis||o.disable("strikethrough"),o.linkify.set({fuzzyLink:!1}),o.validateLink=ge,t.html&&o.use((function(t){return vn(t)})),o.use(Mn),t.tagLinks&&o.use(An,t.tagLinks),o.use(wn),o.use(On),(null==n?void 0:n.markdownParser)&&n.markdownParser.plugins.forEach((function(t){o.use(t)})),new In(e,o,Tn(Tn({},Nn),null===(r=null==n?void 0:n.markdownParser)||void 0===r?void 0:r.tokens))}(this.options.parserFeatures,i,this.externalPlugins);try{n=s.parse(t)}catch(e){ht("RichTextEditorConstructor markdownParser.parse","Catastrophic parse error!",e),n=Wt.fromSchema(i).parseCode(t),n=new r.wx(n).insert(0,i.node("heading",{level:1},i.text("WARNING! There was an error parsing the document"))).doc}return n},e.prototype.serializeContent=function(){return this.markdownSerializer.serialize(this.editorView.state.doc)},e}(ye);!function(t){t[t.RichText=0]="RichText",t[t.Commonmark=1]="Commonmark"}(jr||(jr={}));var Jr=function(){function t(e,n,r){void 0===r&&(r={}),this.options=ue(t.defaultOptions,r),this.target=e,this.internalId=(1e4*Math.random()).toFixed(0),this.innerTarget=document.createElement("div"),this.target.appendChild(this.innerTarget),this.setupPluginContainer(),this.setBackingView(this.options.defaultView,n)}return Object.defineProperty(t.prototype,"editorView",{get:function(){var t;return null===(t=this.backingView)||void 0===t?void 0:t.editorView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){var t;return(null===(t=this.backingView)||void 0===t?void 0:t.content)||""},set:function(t){this.backingView.content=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.editorView.state.doc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dom",{get:function(){return this.editorView.dom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!!this.editorView&&!this.editorView.editable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentViewType",{get:function(){return this.backingView instanceof Wr?jr.RichText:jr.Commonmark},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultOptions",{get:function(){var t=["fl1","outline-none","p12","pt6","w100","s-prose","js-editor","ProseMirror"];return{defaultView:jr.RichText,targetClassList:["ps-relative","z-base","s-textarea","overflow-auto","hmn2","w100","p0","s-editor-resizable"],parserFeatures:Wr.defaultOptions.parserFeatures,commonmarkOptions:{classList:t},richTextOptions:{classList:t}}},enumerable:!1,configurable:!0}),t.prototype.focus=function(){this.backingView.focus()},t.prototype.destroy=function(){this.backingView.destroy()},t.prototype.setView=function(t){this.setBackingView(t,null)},t.prototype.enable=function(){var e;ce(!1,this.editorView.state,this.editorView.dispatch.bind(null)),(e=this.innerTarget.classList).remove.apply(e,t.READONLY_CLASSES)},t.prototype.disable=function(){var e;ce(!0,this.editorView.state,this.editorView.dispatch.bind(null)),(e=this.innerTarget.classList).add.apply(e,t.READONLY_CLASSES)},t.prototype.reinitialize=function(t){void 0===t&&(t={}),this.options=ue(this.options,t),this.setBackingView(this.currentViewType,this.content)},t.prototype.setupPluginContainer=function(){this.pluginContainer=document.createElement("div"),this.pluginContainer.className="py6 bg-inherit btr-sm w100 ps-sticky t0 l0 z-nav s-editor-shadow js-plugin-container js-sticky";var t=document.createElement("div");t.className="grid overflow-x-auto ai-center px12 py4 pb0",this.pluginContainer.appendChild(t),this.options.menuParentContainer=function(){return t};var e,n,r=document.createElement("div");this.pluginContainer.appendChild(r),this.options.pluginParentContainer=function(){return r},this.innerTarget.appendChild(this.pluginContainer),this.createEditorSwitcher(this.options.defaultView,t),this.pluginContainer.addEventListener("mousedown",(function(t){t.preventDefault()})),e=this.innerTarget,n=new IntersectionObserver((function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],o=!r.isIntersecting,i=r.target.nextElementSibling,s=new CustomEvent("sticky-change",{detail:{stuck:o,target:i}});document.dispatchEvent(s)}}),{threshold:[0],root:e}),e.querySelectorAll(".js-sticky").forEach((function(t){var e=document.createElement("div");e.className="js-sticky-sentinel",t.parentNode.insertBefore(e,t),n.observe(e)})),document.addEventListener("sticky-change",(function(t){var e=t.detail.target;e.classList.contains("js-plugin-container")&&e.classList.toggle("is-stuck",t.detail.stuck)}))},t.prototype.setBackingView=function(t,e){var n,r=this,o=this.readonly;if(this.backingView&&(e=e||this.backingView.content,this.backingView.destroy()),(n=this.innerTarget.classList).add.apply(n,this.options.targetClassList),t===jr.RichText)this.backingView=new Wr(this.innerTarget,e,ue(this.options,this.options.richTextOptions));else{if(t!==jr.Commonmark)throw"Unable to set editor to unknown type: "+jr[t];this.backingView=new Xe(this.innerTarget,e,ue(this.options,this.options.commonmarkOptions))}this.backingView.editorView.props.handleDOMEvents={focus:function(){return r.innerTarget.classList.add("bs-ring","bc-blue-300"),!1},blur:function(){return r.innerTarget.classList.remove("bs-ring","bc-blue-300"),!1}},o?this.disable():this.enable()},t.prototype.createEditorSwitcher=function(t,e){var n=t===jr.Commonmark?"checked":"",r='<label class="grid--cell fs-caption mr4 sm:d-none" for="js-editor-toggle-'+this.internalId+'">Markdown</label>\n<label class="grid--cell mr4 d-none sm:d-block" for="js-editor-toggle-'+this.internalId+'">\n    <span class="icon-bg iconMarkdown"></span>\n</label>\n<div class="grid--cell s-editor-toggle">\n    <input class="js-editor-toggle-state" id="js-editor-toggle-'+this.internalId+'" type="checkbox" '+n+'/>\n    <label class="js-editor-toggle-label" for="js-editor-toggle-'+this.internalId+'"></label>\n</div>',o=document.createElement("div");o.className="grid--cell grid ai-center ml24 fc-medium",o.innerHTML=r,o.title="Toggle Markdown editing",o.querySelector("#js-editor-toggle-"+this.internalId).addEventListener("change",this.editorSwitcherChangeHandler.bind(this)),e.appendChild(o)},t.prototype.prefixEventName=function(t){return"StacksEditor:"+t},t.prototype.editorSwitcherChangeHandler=function(t){t.stopPropagation(),t.preventDefault();var e=this.currentViewType===jr.Commonmark?jr.RichText:jr.Commonmark;this.setView(e),this.target.querySelector("#js-editor-toggle-"+this.internalId).checked=e===jr.Commonmark;var n=new CustomEvent(this.prefixEventName("view-change"),{detail:{editorType:e}});this.target.dispatchEvent(n),this.focus()},t.READONLY_CLASSES=["s-input__readonly"],t}()},9413:t=>{t.exports=/[\0-\x1F\x7F-\x9F]/},2326:t=>{t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},3189:t=>{t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},5045:t=>{t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},4205:(t,e,n)=>{"use strict";e.Any=n(9369),e.Cc=n(9413),e.Cf=n(2326),e.P=n(3189),e.Z=n(5045)},9369:t=>{t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},4287:e=>{"use strict";if(void 0===t){var n=new Error("Cannot find module 'undefined'");throw n.code="MODULE_NOT_FOUND",n}e.exports=t}},n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(1027)})()}));