BookStack/public/dist/app.js
2023-08-30 12:38:48 +01:00

55 lines
293 KiB
JavaScript

var Tu=Object.create;var _t=Object.defineProperty;var Lu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var $u=Object.getPrototypeOf,Mu=Object.prototype.hasOwnProperty;var Fu=(n,e,t)=>e in n?_t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var qu=(n,e)=>()=>(n&&(e=n(n=0)),e);var _=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),St=(n,e)=>{for(var t in e)_t(n,t,{get:e[t],enumerable:!0})},Vo=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Iu(e))!Mu.call(n,r)&&r!==t&&_t(n,r,{get:()=>e[r],enumerable:!(i=Lu(e,r))||i.enumerable});return n};var Wo=(n,e,t)=>(t=n!=null?Tu($u(n)):{},Vo(e||!n||!n.__esModule?_t(t,"default",{value:n,enumerable:!0}):t,n)),Bu=n=>Vo(_t({},"__esModule",{value:!0}),n);var se=(n,e,t)=>(Fu(n,typeof e!="symbol"?e+"":e,t),t),Pu=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var re=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)};var T=(n,e,t)=>(Pu(n,e,"access private method"),t);var $s=_((Sb,Fh)=>{Fh.exports={Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",amp:"&",AMP:"&",andand:"\u2A55",And:"\u2A53",and:"\u2227",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angmsd:"\u2221",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",apacir:"\u2A6F",ap:"\u2248",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsolb:"\u29C5",bsol:"\\",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",cap:"\u2229",Cap:"\u22D2",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25CB",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cup:"\u222A",Cup:"\u22D3",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21A1",dArr:"\u21D3",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21CA",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21D3",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21BD",DownRightTeeVector:"\u295F",DownRightVectorBar:"\u2957",DownRightVector:"\u21C1",DownTeeArrow:"\u21A7",DownTee:"\u22A4",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",Ecirc:"\xCA",ecirc:"\xEA",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",gescc:"\u2AA9",ges:"\u2A7E",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2AA5",gl:"\u2277",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gt:">",GT:">",Gt:"\u226B",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",harrcir:"\u2948",harr:"\u2194",hArr:"\u21D4",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",incare:"\u2105",in:"\u2208",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",intcal:"\u22BA",int:"\u222B",Int:"\u222C",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larrb:"\u21E4",larrbfs:"\u291F",larr:"\u2190",Larr:"\u219E",lArr:"\u21D0",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",latail:"\u2919",lAtail:"\u291B",lat:"\u2AAB",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",LeftArrowBar:"\u21E4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21D0",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21C3",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTeeArrow:"\u21A4",LeftTee:"\u22A3",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangleBar:"\u29CF",LeftTriangle:"\u22B2",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21BF",LeftVectorBar:"\u2952",LeftVector:"\u21BC",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",lescc:"\u2AA8",les:"\u2A7D",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21C7",ll:"\u226A",Ll:"\u22D8",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoustache:"\u23B0",lmoust:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftrightarrow:"\u27F7",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longmapsto:"\u27FC",longrightarrow:"\u27F6",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",lt:"<",LT:"<",Lt:"\u226A",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midast:"*",midcir:"\u2AF0",mid:"\u2223",middot:"\xB7",minusb:"\u229F",minus:"\u2212",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266E",naturals:"\u2115",natur:"\u266E",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",orarr:"\u21BB",Or:"\u2A54",or:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",otimesas:"\u2A36",Otimes:"\u2A37",otimes:"\u2297",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",para:"\xB6",parallel:"\u2225",par:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plus:"+",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",prap:"\u2AB7",Pr:"\u2ABB",pr:"\u227A",prcue:"\u227C",precapprox:"\u2AB7",prec:"\u227A",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",pre:"\u2AAF",prE:"\u2AB3",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportional:"\u221D",Proportion:"\u2237",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21A0",rArr:"\u21D2",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",Re:"\u211C",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrowBar:"\u21E5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21D2",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVectorBar:"\u2955",RightDownVector:"\u21C2",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTeeArrow:"\u21A6",RightTee:"\u22A2",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangleBar:"\u29D0",RightTriangle:"\u22B3",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVectorBar:"\u2954",RightUpVector:"\u21BE",RightVectorBar:"\u2953",RightVector:"\u21C0",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoustache:"\u23B1",rmoust:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2ABC",sc:"\u227B",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdotb:"\u22A1",sdot:"\u22C5",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",solbar:"\u233F",solb:"\u29C4",sol:"/",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squ:"\u25A1",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succapprox:"\u2AB8",succ:"\u227B",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",Sup:"\u22D1",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2A31",timesb:"\u22A0",times:"\xD7",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",topbot:"\u2336",topcir:"\u2AF1",top:"\u22A4",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",uarr:"\u2191",Uarr:"\u219F",uArr:"\u21D1",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21D1",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21D5",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTeeArrow:"\u21A5",UpTee:"\u22A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",veebar:"\u22BB",vee:"\u2228",Vee:"\u22C1",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xharr:"\u27F7",xhArr:"\u27FA",Xi:"\u039E",xi:"\u03BE",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",yuml:"\xFF",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",zfr:"\u{1D537}",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});var Wr=_((Ab,Ms)=>{"use strict";Ms.exports=$s()});var oi=_((Db,Fs)=>{Fs.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]/});var Ps=_((Tb,Bs)=>{"use strict";var qs={};function qh(n){var e,t,i=qs[n];if(i)return i;for(i=qs[n]=[],e=0;e<128;e++)t=String.fromCharCode(e),/^[0-9a-z]$/i.test(t)?i.push(t):i.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<n.length;e++)i[n.charCodeAt(e)]=n[e];return i}function si(n,e,t){var i,r,o,s,a,l="";for(typeof e!="string"&&(t=e,e=si.defaultChars),typeof t>"u"&&(t=!0),a=qh(e),i=0,r=n.length;i<r;i++){if(o=n.charCodeAt(i),t&&o===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(n.slice(i+1,i+3))){l+=n.slice(i,i+3),i+=2;continue}if(o<128){l+=a[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&i+1<r&&(s=n.charCodeAt(i+1),s>=56320&&s<=57343)){l+=encodeURIComponent(n[i]+n[i+1]),i++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(n[i])}return l}si.defaultChars=";/?:@&=+$,-_.!~*'()#";si.componentChars="-_.!~*'()";Bs.exports=si});var Ns=_((Lb,Rs)=>{"use strict";var Os={};function Bh(n){var e,t,i=Os[n];if(i)return i;for(i=Os[n]=[],e=0;e<128;e++)t=String.fromCharCode(e),i.push(t);for(e=0;e<n.length;e++)t=n.charCodeAt(e),i[t]="%"+("0"+t.toString(16).toUpperCase()).slice(-2);return i}function ai(n,e){var t;return typeof e!="string"&&(e=ai.defaultChars),t=Bh(e),n.replace(/(%[a-f0-9]{2})+/gi,function(i){var r,o,s,a,l,c,u,h="";for(r=0,o=i.length;r<o;r+=3){if(s=parseInt(i.slice(r+1,r+3),16),s<128){h+=t[s];continue}if((s&224)===192&&r+3<o&&(a=parseInt(i.slice(r+4,r+6),16),(a&192)===128)){u=s<<6&1984|a&63,u<128?h+="\uFFFD\uFFFD":h+=String.fromCharCode(u),r+=3;continue}if((s&240)===224&&r+6<o&&(a=parseInt(i.slice(r+4,r+6),16),l=parseInt(i.slice(r+7,r+9),16),(a&192)===128&&(l&192)===128)){u=s<<12&61440|a<<6&4032|l&63,u<2048||u>=55296&&u<=57343?h+="\uFFFD\uFFFD\uFFFD":h+=String.fromCharCode(u),r+=6;continue}if((s&248)===240&&r+9<o&&(a=parseInt(i.slice(r+4,r+6),16),l=parseInt(i.slice(r+7,r+9),16),c=parseInt(i.slice(r+10,r+12),16),(a&192)===128&&(l&192)===128&&(c&192)===128)){u=s<<18&1835008|a<<12&258048|l<<6&4032|c&63,u<65536||u>1114111?h+="\uFFFD\uFFFD\uFFFD\uFFFD":(u-=65536,h+=String.fromCharCode(55296+(u>>10),56320+(u&1023))),r+=9;continue}h+="\uFFFD"}return h})}ai.defaultChars=";/?:@&=+$,#";ai.componentChars="";Rs.exports=ai});var Hs=_((Ib,zs)=>{"use strict";zs.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}});var Zs=_(($b,Ks)=>{"use strict";function li(){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 Ph=/^([a-z0-9.+-]+:)/i,Oh=/:[0-9]*$/,Rh=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Nh=["<",">",'"',"`"," ","\r",`
`," "],zh=["{","}","|","\\","^","`"].concat(Nh),Hh=["'"].concat(zh),Us=["%","/","?",";","#"].concat(Hh),js=["/","?","#"],Uh=255,Vs=/^[+a-z0-9A-Z_-]{0,63}$/,jh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ws={javascript:!0,"javascript:":!0},Gs={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Vh(n,e){if(n&&n instanceof li)return n;var t=new li;return t.parse(n,e),t}li.prototype.parse=function(n,e){var t,i,r,o,s,a=n;if(a=a.trim(),!e&&n.split("#").length===1){var l=Rh.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Ph.exec(a);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,a=a.substr(c.length)),(e||c||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=a.substr(0,2)==="//",s&&!(c&&Ws[c])&&(a=a.substr(2),this.slashes=!0)),!Ws[c]&&(s||c&&!Gs[c])){var u=-1;for(t=0;t<js.length;t++)o=a.indexOf(js[t]),o!==-1&&(u===-1||o<u)&&(u=o);var h,d;for(u===-1?d=a.lastIndexOf("@"):d=a.lastIndexOf("@",u),d!==-1&&(h=a.slice(0,d),a=a.slice(d+1),this.auth=h),u=-1,t=0;t<Us.length;t++)o=a.indexOf(Us[t]),o!==-1&&(u===-1||o<u)&&(u=o);u===-1&&(u=a.length),a[u-1]===":"&&u--;var p=a.slice(0,u);a=a.slice(u),this.parseHost(p),this.hostname=this.hostname||"";var f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){var m=this.hostname.split(/\./);for(t=0,i=m.length;t<i;t++){var y=m[t];if(y&&!y.match(Vs)){for(var v="",b=0,k=y.length;b<k;b++)y.charCodeAt(b)>127?v+="x":v+=y[b];if(!v.match(Vs)){var w=m.slice(0,t),E=m.slice(t+1),x=y.match(jh);x&&(w.push(x[1]),E.unshift(x[2])),E.length&&(a=E.join(".")+a),this.hostname=w.join(".");break}}}}this.hostname.length>Uh&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var S=a.indexOf("#");S!==-1&&(this.hash=a.substr(S),a=a.slice(0,S));var D=a.indexOf("?");return D!==-1&&(this.search=a.substr(D),a=a.slice(0,D)),a&&(this.pathname=a),Gs[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};li.prototype.parseHost=function(n){var e=Oh.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};Ks.exports=Vh});var Gr=_((Mb,Kt)=>{"use strict";Kt.exports.encode=Ps();Kt.exports.decode=Ns();Kt.exports.format=Hs();Kt.exports.parse=Zs()});var Kr=_((Fb,Xs)=>{Xs.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/});var Zr=_((qb,Ys)=>{Ys.exports=/[\0-\x1F\x7F-\x9F]/});var Qs=_((Bb,Js)=>{Js.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]/});var Xr=_((Pb,ea)=>{ea.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/});var ta=_(gt=>{"use strict";gt.Any=Kr();gt.Cc=Zr();gt.Cf=Qs();gt.P=oi();gt.Z=Xr()});var R=_(J=>{"use strict";function Wh(n){return Object.prototype.toString.call(n)}function Gh(n){return Wh(n)==="[object String]"}var Kh=Object.prototype.hasOwnProperty;function ia(n,e){return Kh.call(n,e)}function Zh(n){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(i){n[i]=t[i]})}}),n}function Xh(n,e,t){return[].concat(n.slice(0,e),t,n.slice(e+1))}function ra(n){return!(n>=55296&&n<=57343||n>=64976&&n<=65007||(n&65535)===65535||(n&65535)===65534||n>=0&&n<=8||n===11||n>=14&&n<=31||n>=127&&n<=159||n>1114111)}function oa(n){if(n>65535){n-=65536;var e=55296+(n>>10),t=56320+(n&1023);return String.fromCharCode(e,t)}return String.fromCharCode(n)}var sa=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,Yh=/&([a-z#][a-z0-9]{1,31});/gi,Jh=new RegExp(sa.source+"|"+Yh.source,"gi"),Qh=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,na=Wr();function ed(n,e){var t=0;return ia(na,e)?na[e]:e.charCodeAt(0)===35&&Qh.test(e)&&(t=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10),ra(t))?oa(t):n}function td(n){return n.indexOf("\\")<0?n:n.replace(sa,"$1")}function nd(n){return n.indexOf("\\")<0&&n.indexOf("&")<0?n:n.replace(Jh,function(e,t,i){return t||ed(e,i)})}var id=/[&<>"]/,rd=/[&<>"]/g,od={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function sd(n){return od[n]}function ad(n){return id.test(n)?n.replace(rd,sd):n}var ld=/[.?*+^$[\]\\(){}|-]/g;function cd(n){return n.replace(ld,"\\$&")}function ud(n){switch(n){case 9:case 32:return!0}return!1}function hd(n){if(n>=8192&&n<=8202)return!0;switch(n){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}var dd=oi();function pd(n){return dd.test(n)}function fd(n){switch(n){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}}function md(n){return n=n.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(n=n.replace(/ẞ/g,"\xDF")),n.toLowerCase().toUpperCase()}J.lib={};J.lib.mdurl=Gr();J.lib.ucmicro=ta();J.assign=Zh;J.isString=Gh;J.has=ia;J.unescapeMd=td;J.unescapeAll=nd;J.isValidEntityCode=ra;J.fromCodePoint=oa;J.escapeHtml=ad;J.arrayReplaceAt=Xh;J.isSpace=ud;J.isWhiteSpace=hd;J.isMdAsciiPunct=fd;J.isPunctChar=pd;J.escapeRE=cd;J.normalizeReference=md});var la=_((Nb,aa)=>{"use strict";aa.exports=function(e,t,i){var r,o,s,a,l=-1,c=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos<c;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){o=!0;break}if(a=e.pos,e.md.inline.skipToken(e),s===91){if(a===e.pos-1)r++;else if(i)return e.pos=u,-1}}return o&&(l=e.pos),e.pos=u,l}});var ha=_((zb,ua)=>{"use strict";var ca=R().unescapeAll;ua.exports=function(e,t,i){var r,o,s=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(e.charCodeAt(t)===60){for(t++;t<i;){if(r=e.charCodeAt(t),r===10||r===60)return l;if(r===62)return l.pos=t+1,l.str=ca(e.slice(a+1,t)),l.ok=!0,l;if(r===92&&t+1<i){t+=2;continue}t++}return l}for(o=0;t<i&&(r=e.charCodeAt(t),!(r===32||r<32||r===127));){if(r===92&&t+1<i){if(e.charCodeAt(t+1)===32)break;t+=2;continue}if(r===40&&(o++,o>32))return l;if(r===41){if(o===0)break;o--}t++}return a===t||o!==0||(l.str=ca(e.slice(a,t)),l.lines=s,l.pos=t,l.ok=!0),l}});var pa=_((Hb,da)=>{"use strict";var gd=R().unescapeAll;da.exports=function(e,t,i){var r,o,s=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=i||(o=e.charCodeAt(t),o!==34&&o!==39&&o!==40))return l;for(t++,o===40&&(o=41);t<i;){if(r=e.charCodeAt(t),r===o)return l.pos=t+1,l.lines=s,l.str=gd(e.slice(a+1,t)),l.ok=!0,l;if(r===40&&o===41)return l;r===10?s++:r===92&&t+1<i&&(t++,e.charCodeAt(t)===10&&s++),t++}return l}});var fa=_(ci=>{"use strict";ci.parseLinkLabel=la();ci.parseLinkDestination=ha();ci.parseLinkTitle=pa()});var ga=_((jb,ma)=>{"use strict";var bd=R().assign,vd=R().unescapeAll,Je=R().escapeHtml,De={};De.code_inline=function(n,e,t,i,r){var o=n[e];return"<code"+r.renderAttrs(o)+">"+Je(n[e].content)+"</code>"};De.code_block=function(n,e,t,i,r){var o=n[e];return"<pre"+r.renderAttrs(o)+"><code>"+Je(n[e].content)+`</code></pre>
`};De.fence=function(n,e,t,i,r){var o=n[e],s=o.info?vd(o.info).trim():"",a="",l="",c,u,h,d,p;return s&&(h=s.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),t.highlight?c=t.highlight(o.content,a,l)||Je(o.content):c=Je(o.content),c.indexOf("<pre")===0?c+`
`:s?(u=o.attrIndex("class"),d=o.attrs?o.attrs.slice():[],u<0?d.push(["class",t.langPrefix+a]):(d[u]=d[u].slice(),d[u][1]+=" "+t.langPrefix+a),p={attrs:d},"<pre><code"+r.renderAttrs(p)+">"+c+`</code></pre>
`):"<pre><code"+r.renderAttrs(o)+">"+c+`</code></pre>
`};De.image=function(n,e,t,i,r){var o=n[e];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,t,i),r.renderToken(n,e,t)};De.hardbreak=function(n,e,t){return t.xhtmlOut?`<br />
`:`<br>
`};De.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut?`<br />
`:`<br>
`:`
`};De.text=function(n,e){return Je(n[e].content)};De.html_block=function(n,e){return n[e].content};De.html_inline=function(n,e){return n[e].content};function bt(){this.rules=bd({},De)}bt.prototype.renderAttrs=function(e){var t,i,r;if(!e.attrs)return"";for(r="",t=0,i=e.attrs.length;t<i;t++)r+=" "+Je(e.attrs[t][0])+'="'+Je(e.attrs[t][1])+'"';return r};bt.prototype.renderToken=function(e,t,i){var r,o="",s=!1,a=e[t];return a.hidden?"":(a.block&&a.nesting!==-1&&t&&e[t-1].hidden&&(o+=`
`),o+=(a.nesting===-1?"</":"<")+a.tag,o+=this.renderAttrs(a),a.nesting===0&&i.xhtmlOut&&(o+=" /"),a.block&&(s=!0,a.nesting===1&&t+1<e.length&&(r=e[t+1],(r.type==="inline"||r.hidden||r.nesting===-1&&r.tag===a.tag)&&(s=!1))),o+=s?`>
`:">",o)};bt.prototype.renderInline=function(n,e,t){for(var i,r="",o=this.rules,s=0,a=n.length;s<a;s++)i=n[s].type,typeof o[i]<"u"?r+=o[i](n,s,e,t,this):r+=this.renderToken(n,s,e);return r};bt.prototype.renderInlineAsText=function(n,e,t){for(var i="",r=0,o=n.length;r<o;r++)n[r].type==="text"?i+=n[r].content:n[r].type==="image"?i+=this.renderInlineAsText(n[r].children,e,t):n[r].type==="softbreak"&&(i+=`
`);return i};bt.prototype.render=function(n,e,t){var i,r,o,s="",a=this.rules;for(i=0,r=n.length;i<r;i++)o=n[i].type,o==="inline"?s+=this.renderInline(n[i].children,e,t):typeof a[o]<"u"?s+=a[n[i].type](n,i,e,t,this):s+=this.renderToken(n,i,e,t);return s};ma.exports=bt});var ui=_((Vb,ba)=>{"use strict";function Ce(){this.__rules__=[],this.__cache__=null}Ce.prototype.__find__=function(n){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===n)return e;return-1};Ce.prototype.__compile__=function(){var n=this,e=[""];n.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(i){e.indexOf(i)<0&&e.push(i)})}),n.__cache__={},e.forEach(function(t){n.__cache__[t]=[],n.__rules__.forEach(function(i){i.enabled&&(t&&i.alt.indexOf(t)<0||n.__cache__[t].push(i.fn))})})};Ce.prototype.at=function(n,e,t){var i=this.__find__(n),r=t||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__[i].fn=e,this.__rules__[i].alt=r.alt||[],this.__cache__=null};Ce.prototype.before=function(n,e,t,i){var r=this.__find__(n),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(r,0,{name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null};Ce.prototype.after=function(n,e,t,i){var r=this.__find__(n),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(r+1,0,{name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null};Ce.prototype.push=function(n,e,t){var i=t||{};this.__rules__.push({name:n,enabled:!0,fn:e,alt:i.alt||[]}),this.__cache__=null};Ce.prototype.enable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(i){var r=this.__find__(i);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,t.push(i)},this),this.__cache__=null,t};Ce.prototype.enableOnly=function(n,e){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(n,e)};Ce.prototype.disable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(i){var r=this.__find__(i);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,t.push(i)},this),this.__cache__=null,t};Ce.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};ba.exports=Ce});var wa=_((Wb,va)=>{"use strict";var wd=/\r\n?|\n/g,yd=/\0/g;va.exports=function(e){var t;t=e.src.replace(wd,`
`),t=t.replace(yd,"\uFFFD"),e.src=t}});var xa=_((Gb,ya)=>{"use strict";ya.exports=function(e){var t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}});var Ca=_((Kb,ka)=>{"use strict";ka.exports=function(e){var t=e.tokens,i,r,o;for(r=0,o=t.length;r<o;r++)i=t[r],i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}});var _a=_((Zb,Ea)=>{"use strict";var xd=R().arrayReplaceAt;function kd(n){return/^<a[>\s]/i.test(n)}function Cd(n){return/^<\/a\s*>/i.test(n)}Ea.exports=function(e){var t,i,r,o,s,a,l,c,u,h,d,p,f,m,y,v,b=e.tokens,k;if(e.md.options.linkify){for(i=0,r=b.length;i<r;i++)if(!(b[i].type!=="inline"||!e.md.linkify.pretest(b[i].content)))for(o=b[i].children,f=0,t=o.length-1;t>=0;t--){if(a=o[t],a.type==="link_close"){for(t--;o[t].level!==a.level&&o[t].type!=="link_open";)t--;continue}if(a.type==="html_inline"&&(kd(a.content)&&f>0&&f--,Cd(a.content)&&f++),!(f>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(u=a.content,k=e.md.linkify.match(u),l=[],p=a.level,d=0,k.length>0&&k[0].index===0&&t>0&&o[t-1].type==="text_special"&&(k=k.slice(1)),c=0;c<k.length;c++)m=k[c].url,y=e.md.normalizeLink(m),e.md.validateLink(y)&&(v=k[c].text,k[c].schema?k[c].schema==="mailto:"&&!/^mailto:/i.test(v)?v=e.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=e.md.normalizeLinkText(v):v=e.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),h=k[c].index,h>d&&(s=new e.Token("text","",0),s.content=u.slice(d,h),s.level=p,l.push(s)),s=new e.Token("link_open","a",1),s.attrs=[["href",y]],s.level=p++,s.markup="linkify",s.info="auto",l.push(s),s=new e.Token("text","",0),s.content=v,s.level=p,l.push(s),s=new e.Token("link_close","a",-1),s.level=--p,s.markup="linkify",s.info="auto",l.push(s),d=k[c].lastIndex);d<u.length&&(s=new e.Token("text","",0),s.content=u.slice(d),s.level=p,l.push(s)),b[i].children=o=xd(o,t,l)}}}}});var Da=_((Xb,Aa)=>{"use strict";var Sa=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Ed=/\((c|tm|r)\)/i,_d=/\((c|tm|r)\)/ig,Sd={c:"\xA9",r:"\xAE",tm:"\u2122"};function Ad(n,e){return Sd[e.toLowerCase()]}function Dd(n){var e,t,i=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!i&&(t.content=t.content.replace(_d,Ad)),t.type==="link_open"&&t.info==="auto"&&i--,t.type==="link_close"&&t.info==="auto"&&i++}function Td(n){var e,t,i=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!i&&Sa.test(t.content)&&(t.content=t.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),t.type==="link_open"&&t.info==="auto"&&i--,t.type==="link_close"&&t.info==="auto"&&i++}Aa.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Ed.test(e.tokens[t].content)&&Dd(e.tokens[t].children),Sa.test(e.tokens[t].content)&&Td(e.tokens[t].children))}});var qa=_((Yb,Fa)=>{"use strict";var Ta=R().isWhiteSpace,La=R().isPunctChar,Ia=R().isMdAsciiPunct,Ld=/['"]/,$a=/['"]/g,Ma="\u2019";function hi(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function Id(n,e){var t,i,r,o,s,a,l,c,u,h,d,p,f,m,y,v,b,k,w,E,x;for(w=[],t=0;t<n.length;t++){for(i=n[t],l=n[t].level,b=w.length-1;b>=0&&!(w[b].level<=l);b--);if(w.length=b+1,i.type==="text"){r=i.content,s=0,a=r.length;e:for(;s<a&&($a.lastIndex=s,o=$a.exec(r),!!o);){if(y=v=!0,s=o.index+1,k=o[0]==="'",u=32,o.index-1>=0)u=r.charCodeAt(o.index-1);else for(b=t-1;b>=0&&!(n[b].type==="softbreak"||n[b].type==="hardbreak");b--)if(n[b].content){u=n[b].content.charCodeAt(n[b].content.length-1);break}if(h=32,s<a)h=r.charCodeAt(s);else for(b=t+1;b<n.length&&!(n[b].type==="softbreak"||n[b].type==="hardbreak");b++)if(n[b].content){h=n[b].content.charCodeAt(0);break}if(d=Ia(u)||La(String.fromCharCode(u)),p=Ia(h)||La(String.fromCharCode(h)),f=Ta(u),m=Ta(h),m?y=!1:p&&(f||d||(y=!1)),f?v=!1:d&&(m||p||(v=!1)),h===34&&o[0]==='"'&&u>=48&&u<=57&&(v=y=!1),y&&v&&(y=d,v=p),!y&&!v){k&&(i.content=hi(i.content,o.index,Ma));continue}if(v){for(b=w.length-1;b>=0&&(c=w[b],!(w[b].level<l));b--)if(c.single===k&&w[b].level===l){c=w[b],k?(E=e.md.options.quotes[2],x=e.md.options.quotes[3]):(E=e.md.options.quotes[0],x=e.md.options.quotes[1]),i.content=hi(i.content,o.index,x),n[c.token].content=hi(n[c.token].content,c.pos,E),s+=x.length-1,c.token===t&&(s+=E.length-1),r=i.content,a=r.length,w.length=b;continue e}}y?w.push({token:t,pos:o.index,single:k,level:l}):v&&k&&(i.content=hi(i.content,o.index,Ma))}}}}Fa.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!Ld.test(e.tokens[t].content)||Id(e.tokens[t].children,e)}});var Pa=_((Jb,Ba)=>{"use strict";Ba.exports=function(e){var t,i,r,o,s,a,l=e.tokens;for(t=0,i=l.length;t<i;t++)if(l[t].type==="inline"){for(r=l[t].children,s=r.length,o=0;o<s;o++)r[o].type==="text_special"&&(r[o].type="text");for(o=a=0;o<s;o++)r[o].type==="text"&&o+1<s&&r[o+1].type==="text"?r[o+1].content=r[o].content+r[o+1].content:(o!==a&&(r[a]=r[o]),a++);o!==a&&(r.length=a)}}});var di=_((Qb,Oa)=>{"use strict";function vt(n,e,t){this.type=n,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}vt.prototype.attrIndex=function(e){var t,i,r;if(!this.attrs)return-1;for(t=this.attrs,i=0,r=t.length;i<r;i++)if(t[i][0]===e)return i;return-1};vt.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};vt.prototype.attrSet=function(e,t){var i=this.attrIndex(e),r=[e,t];i<0?this.attrPush(r):this.attrs[i]=r};vt.prototype.attrGet=function(e){var t=this.attrIndex(e),i=null;return t>=0&&(i=this.attrs[t][1]),i};vt.prototype.attrJoin=function(e,t){var i=this.attrIndex(e);i<0?this.attrPush([e,t]):this.attrs[i][1]=this.attrs[i][1]+" "+t};Oa.exports=vt});var za=_((ev,Na)=>{"use strict";var $d=di();function Ra(n,e,t){this.src=n,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}Ra.prototype.Token=$d;Na.exports=Ra});var Ua=_((tv,Ha)=>{"use strict";var Md=ui(),Yr=[["normalize",wa()],["block",xa()],["inline",Ca()],["linkify",_a()],["replacements",Da()],["smartquotes",qa()],["text_join",Pa()]];function Jr(){this.ruler=new Md;for(var n=0;n<Yr.length;n++)this.ruler.push(Yr[n][0],Yr[n][1])}Jr.prototype.process=function(n){var e,t,i;for(i=this.ruler.getRules(""),e=0,t=i.length;e<t;e++)i[e](n)};Jr.prototype.State=za();Ha.exports=Jr});var Wa=_((nv,Va)=>{"use strict";var Qr=R().isSpace;function eo(n,e){var t=n.bMarks[e]+n.tShift[e],i=n.eMarks[e];return n.src.slice(t,i)}function ja(n){var e=[],t=0,i=n.length,r,o=!1,s=0,a="";for(r=n.charCodeAt(t);t<i;)r===124&&(o?(a+=n.substring(s,t-1),s=t):(e.push(a+n.substring(s,t)),a="",s=t+1)),o=r===92,t++,r=n.charCodeAt(t);return e.push(a+n.substring(s)),e}Va.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,y,v,b,k,w,E,x;if(t+2>i||(u=t+1,e.sCount[u]<e.blkIndent)||e.sCount[u]-e.blkIndent>=4||(a=e.bMarks[u]+e.tShift[u],a>=e.eMarks[u])||(E=e.src.charCodeAt(a++),E!==124&&E!==45&&E!==58)||a>=e.eMarks[u]||(x=e.src.charCodeAt(a++),x!==124&&x!==45&&x!==58&&!Qr(x))||E===45&&Qr(x))return!1;for(;a<e.eMarks[u];){if(o=e.src.charCodeAt(a),o!==124&&o!==45&&o!==58&&!Qr(o))return!1;a++}for(s=eo(e,t+1),h=s.split("|"),f=[],l=0;l<h.length;l++){if(m=h[l].trim(),!m){if(l===0||l===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(m))return!1;m.charCodeAt(m.length-1)===58?f.push(m.charCodeAt(0)===58?"center":"right"):m.charCodeAt(0)===58?f.push("left"):f.push("")}if(s=eo(e,t).trim(),s.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4||(h=ja(s),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),d=h.length,d===0||d!==f.length))return!1;if(r)return!0;for(b=e.parentType,e.parentType="table",w=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),p.map=y=[t,0],p=e.push("thead_open","thead",1),p.map=[t,t+1],p=e.push("tr_open","tr",1),p.map=[t,t+1],l=0;l<h.length;l++)p=e.push("th_open","th",1),f[l]&&(p.attrs=[["style","text-align:"+f[l]]]),p=e.push("inline","",0),p.content=h[l].trim(),p.children=[],p=e.push("th_close","th",-1);for(p=e.push("tr_close","tr",-1),p=e.push("thead_close","thead",-1),u=t+2;u<i&&!(e.sCount[u]<e.blkIndent);u++){for(k=!1,l=0,c=w.length;l<c;l++)if(w[l](e,u,i,!0)){k=!0;break}if(k||(s=eo(e,u).trim(),!s)||e.sCount[u]-e.blkIndent>=4)break;for(h=ja(s),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),u===t+2&&(p=e.push("tbody_open","tbody",1),p.map=v=[t+2,0]),p=e.push("tr_open","tr",1),p.map=[u,u+1],l=0;l<d;l++)p=e.push("td_open","td",1),f[l]&&(p.attrs=[["style","text-align:"+f[l]]]),p=e.push("inline","",0),p.content=h[l]?h[l].trim():"",p.children=[],p=e.push("td_close","td",-1);p=e.push("tr_close","tr",-1)}return v&&(p=e.push("tbody_close","tbody",-1),v[1]=u),p=e.push("table_close","table",-1),y[1]=u,e.parentType=b,e.line=u,!0}});var Ka=_((iv,Ga)=>{"use strict";Ga.exports=function(e,t,i){var r,o,s;if(e.sCount[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<i;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}return e.line=o,s=e.push("code_block","code",0),s.content=e.getLines(t,o,4+e.blkIndent,!1)+`
`,s.map=[t,e.line],!0}});var Xa=_((rv,Za)=>{"use strict";Za.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d=!1,p=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||p+3>f||(o=e.src.charCodeAt(p),o!==126&&o!==96)||(c=p,p=e.skipChars(p,o),s=p-c,s<3)||(h=e.src.slice(c,p),a=e.src.slice(p,f),o===96&&a.indexOf(String.fromCharCode(o))>=0))return!1;if(r)return!0;for(l=t;l++,!(l>=i||(p=c=e.bMarks[l]+e.tShift[l],f=e.eMarks[l],p<f&&e.sCount[l]<e.blkIndent));)if(e.src.charCodeAt(p)===o&&!(e.sCount[l]-e.blkIndent>=4)&&(p=e.skipChars(p,o),!(p-c<s)&&(p=e.skipSpaces(p),!(p<f)))){d=!0;break}return s=e.sCount[t],e.line=l+(d?1:0),u=e.push("fence","code",0),u.info=a,u.content=e.getLines(t+1,l,s,!0),u.markup=h,u.map=[t,e.line],!0}});var Qa=_((ov,Ja)=>{"use strict";var Ya=R().isSpace;Ja.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,y,v,b,k,w,E,x,S,D,q=e.lineMax,L=e.bMarks[t]+e.tShift[t],I=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(L++)!==62)return!1;if(r)return!0;for(l=p=e.sCount[t]+1,e.src.charCodeAt(L)===32?(L++,l++,p++,o=!1,w=!0):e.src.charCodeAt(L)===9?(w=!0,(e.bsCount[t]+p)%4===3?(L++,l++,p++,o=!1):o=!0):w=!1,f=[e.bMarks[t]],e.bMarks[t]=L;L<I&&(s=e.src.charCodeAt(L),Ya(s));){s===9?p+=4-(p+e.bsCount[t]+(o?1:0))%4:p++;L++}for(m=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(w?1:0),u=L>=I,b=[e.sCount[t]],e.sCount[t]=p-l,k=[e.tShift[t]],e.tShift[t]=L-e.bMarks[t],x=e.md.block.ruler.getRules("blockquote"),v=e.parentType,e.parentType="blockquote",d=t+1;d<i&&(D=e.sCount[d]<e.blkIndent,L=e.bMarks[d]+e.tShift[d],I=e.eMarks[d],!(L>=I));d++){if(e.src.charCodeAt(L++)===62&&!D){for(l=p=e.sCount[d]+1,e.src.charCodeAt(L)===32?(L++,l++,p++,o=!1,w=!0):e.src.charCodeAt(L)===9?(w=!0,(e.bsCount[d]+p)%4===3?(L++,l++,p++,o=!1):o=!0):w=!1,f.push(e.bMarks[d]),e.bMarks[d]=L;L<I&&(s=e.src.charCodeAt(L),Ya(s));){s===9?p+=4-(p+e.bsCount[d]+(o?1:0))%4:p++;L++}u=L>=I,m.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(w?1:0),b.push(e.sCount[d]),e.sCount[d]=p-l,k.push(e.tShift[d]),e.tShift[d]=L-e.bMarks[d];continue}if(u)break;for(E=!1,a=0,c=x.length;a<c;a++)if(x[a](e,d,i,!0)){E=!0;break}if(E){e.lineMax=d,e.blkIndent!==0&&(f.push(e.bMarks[d]),m.push(e.bsCount[d]),k.push(e.tShift[d]),b.push(e.sCount[d]),e.sCount[d]-=e.blkIndent);break}f.push(e.bMarks[d]),m.push(e.bsCount[d]),k.push(e.tShift[d]),b.push(e.sCount[d]),e.sCount[d]=-1}for(y=e.blkIndent,e.blkIndent=0,S=e.push("blockquote_open","blockquote",1),S.markup=">",S.map=h=[t,0],e.md.block.tokenize(e,t,d),S=e.push("blockquote_close","blockquote",-1),S.markup=">",e.lineMax=q,e.parentType=v,h[1]=e.line,a=0;a<k.length;a++)e.bMarks[a+t]=f[a],e.tShift[a+t]=k[a],e.sCount[a+t]=b[a],e.bsCount[a+t]=m[a];return e.blkIndent=y,!0}});var tl=_((sv,el)=>{"use strict";var Fd=R().isSpace;el.exports=function(e,t,i,r){var o,s,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(c++),o!==42&&o!==45&&o!==95))return!1;for(s=1;c<u;){if(a=e.src.charCodeAt(c++),a!==o&&!Fd(a))return!1;a===o&&s++}return s<3?!1:(r||(e.line=t+1,l=e.push("hr","hr",0),l.map=[t,e.line],l.markup=Array(s+1).join(String.fromCharCode(o))),!0)}});var sl=_((av,ol)=>{"use strict";var rl=R().isSpace;function nl(n,e){var t,i,r,o;return i=n.bMarks[e]+n.tShift[e],r=n.eMarks[e],t=n.src.charCodeAt(i++),t!==42&&t!==45&&t!==43||i<r&&(o=n.src.charCodeAt(i),!rl(o))?-1:i}function il(n,e){var t,i=n.bMarks[e]+n.tShift[e],r=i,o=n.eMarks[e];if(r+1>=o||(t=n.src.charCodeAt(r++),t<48||t>57))return-1;for(;;){if(r>=o)return-1;if(t=n.src.charCodeAt(r++),t>=48&&t<=57){if(r-i>=10)return-1;continue}if(t===41||t===46)break;return-1}return r<o&&(t=n.src.charCodeAt(r),!rl(t))?-1:r}function qd(n,e){var t,i,r=n.level+2;for(t=e+2,i=n.tokens.length-2;t<i;t++)n.tokens[t].level===r&&n.tokens[t].type==="paragraph_open"&&(n.tokens[t+2].hidden=!0,n.tokens[t].hidden=!0,t+=2)}ol.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,y,v,b,k,w,E,x,S,D,q,L,I,H,N,ee,ge,V,Oe=!1,Re=!0;if(e.sCount[t]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]<e.blkIndent)return!1;if(r&&e.parentType==="paragraph"&&e.sCount[t]>=e.blkIndent&&(Oe=!0),(I=il(e,t))>=0){if(h=!0,N=e.bMarks[t]+e.tShift[t],v=Number(e.src.slice(N,I-1)),Oe&&v!==1)return!1}else if((I=nl(e,t))>=0)h=!1;else return!1;if(Oe&&e.skipSpaces(I)>=e.eMarks[t])return!1;if(y=e.src.charCodeAt(I-1),r)return!0;for(m=e.tokens.length,h?(V=e.push("ordered_list_open","ol",1),v!==1&&(V.attrs=[["start",v]])):V=e.push("bullet_list_open","ul",1),V.map=f=[t,0],V.markup=String.fromCharCode(y),k=t,H=!1,ge=e.md.block.ruler.getRules("list"),x=e.parentType,e.parentType="list";k<i;){for(L=I,b=e.eMarks[k],u=w=e.sCount[k]+I-(e.bMarks[t]+e.tShift[t]);L<b;){if(o=e.src.charCodeAt(L),o===9)w+=4-(w+e.bsCount[k])%4;else if(o===32)w++;else break;L++}if(s=L,s>=b?c=1:c=w-u,c>4&&(c=1),l=u+c,V=e.push("list_item_open","li",1),V.markup=String.fromCharCode(y),V.map=d=[t,0],h&&(V.info=e.src.slice(N,I-1)),q=e.tight,D=e.tShift[t],S=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=s-e.bMarks[t],e.sCount[t]=w,s>=b&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,t,i,!0),(!e.tight||H)&&(Re=!1),H=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=D,e.sCount[t]=S,e.tight=q,V=e.push("list_item_close","li",-1),V.markup=String.fromCharCode(y),k=t=e.line,d[1]=k,s=e.bMarks[t],k>=i||e.sCount[k]<e.blkIndent||e.sCount[t]-e.blkIndent>=4)break;for(ee=!1,a=0,p=ge.length;a<p;a++)if(ge[a](e,k,i,!0)){ee=!0;break}if(ee)break;if(h){if(I=il(e,k),I<0)break;N=e.bMarks[k]+e.tShift[k]}else if(I=nl(e,k),I<0)break;if(y!==e.src.charCodeAt(I-1))break}return h?V=e.push("ordered_list_close","ol",-1):V=e.push("bullet_list_close","ul",-1),V.markup=String.fromCharCode(y),f[1]=k,e.line=k,e.parentType=x,Re&&qd(e,m),!0}});var ll=_((lv,al)=>{"use strict";var Bd=R().normalizeReference,pi=R().isSpace;al.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,y,v,b,k,w,E=0,x=e.bMarks[t]+e.tShift[t],S=e.eMarks[t],D=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(x)!==91)return!1;for(;++x<S;)if(e.src.charCodeAt(x)===93&&e.src.charCodeAt(x-1)!==92){if(x+1===S||e.src.charCodeAt(x+1)!==58)return!1;break}for(l=e.lineMax,k=e.md.block.ruler.getRules("reference"),f=e.parentType,e.parentType="reference";D<l&&!e.isEmpty(D);D++)if(!(e.sCount[D]-e.blkIndent>3)&&!(e.sCount[D]<0)){for(b=!1,u=0,h=k.length;u<h;u++)if(k[u](e,D,l,!0)){b=!0;break}if(b)break}for(v=e.getLines(t,D,e.blkIndent,!1).trim(),S=v.length,x=1;x<S;x++){if(o=v.charCodeAt(x),o===91)return!1;if(o===93){p=x;break}else o===10?E++:o===92&&(x++,x<S&&v.charCodeAt(x)===10&&E++)}if(p<0||v.charCodeAt(p+1)!==58)return!1;for(x=p+2;x<S;x++)if(o=v.charCodeAt(x),o===10)E++;else if(!pi(o))break;if(m=e.md.helpers.parseLinkDestination(v,x,S),!m.ok||(c=e.md.normalizeLink(m.str),!e.md.validateLink(c)))return!1;for(x=m.pos,E+=m.lines,s=x,a=E,y=x;x<S;x++)if(o=v.charCodeAt(x),o===10)E++;else if(!pi(o))break;for(m=e.md.helpers.parseLinkTitle(v,x,S),x<S&&y!==x&&m.ok?(w=m.str,x=m.pos,E+=m.lines):(w="",x=s,E=a);x<S&&(o=v.charCodeAt(x),!!pi(o));)x++;if(x<S&&v.charCodeAt(x)!==10&&w)for(w="",x=s,E=a;x<S&&(o=v.charCodeAt(x),!!pi(o));)x++;return x<S&&v.charCodeAt(x)!==10||(d=Bd(v.slice(1,p)),!d)?!1:(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[d]>"u"&&(e.env.references[d]={title:w,href:c}),e.parentType=f,e.line=t+E+1),!0)}});var ul=_((cv,cl)=>{"use strict";cl.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","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]});var no=_((uv,to)=>{"use strict";var Pd="[a-zA-Z_:][a-zA-Z0-9:._-]*",Od="[^\"'=<>`\\x00-\\x20]+",Rd="'[^']*'",Nd='"[^"]*"',zd="(?:"+Od+"|"+Rd+"|"+Nd+")",Hd="(?:\\s+"+Pd+"(?:\\s*=\\s*"+zd+")?)",hl="<[A-Za-z][A-Za-z0-9\\-]*"+Hd+"*\\s*\\/?>",dl="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ud="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",jd="<[?][\\s\\S]*?[?]>",Vd="<![A-Z]+\\s+[^>]*>",Wd="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Gd=new RegExp("^(?:"+hl+"|"+dl+"|"+Ud+"|"+jd+"|"+Vd+"|"+Wd+")"),Kd=new RegExp("^(?:"+hl+"|"+dl+")");to.exports.HTML_TAG_RE=Gd;to.exports.HTML_OPEN_CLOSE_TAG_RE=Kd});var fl=_((hv,pl)=>{"use strict";var Zd=ul(),Xd=no().HTML_OPEN_CLOSE_TAG_RE,wt=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Zd.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Xd.source+"\\s*$"),/^$/,!1]];pl.exports=function(e,t,i,r){var o,s,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(c)!==60)return!1;for(l=e.src.slice(c,u),o=0;o<wt.length&&!wt[o][0].test(l);o++);if(o===wt.length)return!1;if(r)return wt[o][2];if(s=t+1,!wt[o][1].test(l)){for(;s<i&&!(e.sCount[s]<e.blkIndent);s++)if(c=e.bMarks[s]+e.tShift[s],u=e.eMarks[s],l=e.src.slice(c,u),wt[o][1].test(l)){l.length!==0&&s++;break}}return e.line=s,a=e.push("html_block","",0),a.map=[t,s],a.content=e.getLines(t,s,e.blkIndent,!0),!0}});var bl=_((dv,gl)=>{"use strict";var ml=R().isSpace;gl.exports=function(e,t,i,r){var o,s,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(c),o!==35||c>=u))return!1;for(s=1,o=e.src.charCodeAt(++c);o===35&&c<u&&s<=6;)s++,o=e.src.charCodeAt(++c);return s>6||c<u&&!ml(o)?!1:(r||(u=e.skipSpacesBack(u,c),a=e.skipCharsBack(u,35,c),a>c&&ml(e.src.charCodeAt(a-1))&&(u=a),e.line=t+1,l=e.push("heading_open","h"+String(s),1),l.markup="########".slice(0,s),l.map=[t,e.line],l=e.push("inline","",0),l.content=e.src.slice(c,u).trim(),l.map=[t,e.line],l.children=[],l=e.push("heading_close","h"+String(s),-1),l.markup="########".slice(0,s)),!0)}});var wl=_((pv,vl)=>{"use strict";vl.exports=function(e,t,i){var r,o,s,a,l,c,u,h,d,p=t+1,f,m=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(f=e.parentType,e.parentType="paragraph";p<i&&!e.isEmpty(p);p++)if(!(e.sCount[p]-e.blkIndent>3)){if(e.sCount[p]>=e.blkIndent&&(c=e.bMarks[p]+e.tShift[p],u=e.eMarks[p],c<u&&(d=e.src.charCodeAt(c),(d===45||d===61)&&(c=e.skipChars(c,d),c=e.skipSpaces(c),c>=u)))){h=d===61?1:2;break}if(!(e.sCount[p]<0)){for(o=!1,s=0,a=m.length;s<a;s++)if(m[s](e,p,i,!0)){o=!0;break}if(o)break}}return h?(r=e.getLines(t,p,e.blkIndent,!1).trim(),e.line=p+1,l=e.push("heading_open","h"+String(h),1),l.markup=String.fromCharCode(d),l.map=[t,e.line],l=e.push("inline","",0),l.content=r,l.map=[t,e.line-1],l.children=[],l=e.push("heading_close","h"+String(h),-1),l.markup=String.fromCharCode(d),e.parentType=f,!0):!1}});var xl=_((fv,yl)=>{"use strict";yl.exports=function(e,t){var i,r,o,s,a,l,c=t+1,u=e.md.block.ruler.getRules("paragraph"),h=e.lineMax;for(l=e.parentType,e.parentType="paragraph";c<h&&!e.isEmpty(c);c++)if(!(e.sCount[c]-e.blkIndent>3)&&!(e.sCount[c]<0)){for(r=!1,o=0,s=u.length;o<s;o++)if(u[o](e,c,h,!0)){r=!0;break}if(r)break}return i=e.getLines(t,c,e.blkIndent,!1).trim(),e.line=c,a=e.push("paragraph_open","p",1),a.map=[t,e.line],a=e.push("inline","",0),a.content=i,a.map=[t,e.line],a.children=[],a=e.push("paragraph_close","p",-1),e.parentType=l,!0}});var El=_((mv,Cl)=>{"use strict";var kl=di(),fi=R().isSpace;function Te(n,e,t,i){var r,o,s,a,l,c,u,h;for(this.src=n,this.md=e,this.env=t,this.tokens=i,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="",o=this.src,h=!1,s=a=c=u=0,l=o.length;a<l;a++){if(r=o.charCodeAt(a),!h)if(fi(r)){c++,r===9?u+=4-u%4:u++;continue}else h=!0;(r===10||a===l-1)&&(r!==10&&a++,this.bMarks.push(s),this.eMarks.push(a),this.tShift.push(c),this.sCount.push(u),this.bsCount.push(0),h=!1,c=0,u=0,s=a+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Te.prototype.push=function(n,e,t){var i=new kl(n,e,t);return i.block=!0,t<0&&this.level--,i.level=this.level,t>0&&this.level++,this.tokens.push(i),i};Te.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Te.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Te.prototype.skipSpaces=function(e){for(var t,i=this.src.length;e<i&&(t=this.src.charCodeAt(e),!!fi(t));e++);return e};Te.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!fi(this.src.charCodeAt(--e)))return e+1;return e};Te.prototype.skipChars=function(e,t){for(var i=this.src.length;e<i&&this.src.charCodeAt(e)===t;e++);return e};Te.prototype.skipCharsBack=function(e,t,i){if(e<=i)return e;for(;e>i;)if(t!==this.src.charCodeAt(--e))return e+1;return e};Te.prototype.getLines=function(e,t,i,r){var o,s,a,l,c,u,h,d=e;if(e>=t)return"";for(u=new Array(t-e),o=0;d<t;d++,o++){for(s=0,h=l=this.bMarks[d],d+1<t||r?c=this.eMarks[d]+1:c=this.eMarks[d];l<c&&s<i;){if(a=this.src.charCodeAt(l),fi(a))a===9?s+=4-(s+this.bsCount[d])%4:s++;else if(l-h<this.tShift[d])s++;else break;l++}s>i?u[o]=new Array(s-i+1).join(" ")+this.src.slice(l,c):u[o]=this.src.slice(l,c)}return u.join("")};Te.prototype.Token=kl;Cl.exports=Te});var Sl=_((gv,_l)=>{"use strict";var Yd=ui(),mi=[["table",Wa(),["paragraph","reference"]],["code",Ka()],["fence",Xa(),["paragraph","reference","blockquote","list"]],["blockquote",Qa(),["paragraph","reference","blockquote","list"]],["hr",tl(),["paragraph","reference","blockquote","list"]],["list",sl(),["paragraph","reference","blockquote"]],["reference",ll()],["html_block",fl(),["paragraph","reference","blockquote"]],["heading",bl(),["paragraph","reference","blockquote"]],["lheading",wl()],["paragraph",xl()]];function gi(){this.ruler=new Yd;for(var n=0;n<mi.length;n++)this.ruler.push(mi[n][0],mi[n][1],{alt:(mi[n][2]||[]).slice()})}gi.prototype.tokenize=function(n,e,t){for(var i,r,o=this.ruler.getRules(""),s=o.length,a=e,l=!1,c=n.md.options.maxNesting;a<t&&(n.line=a=n.skipEmptyLines(a),!(a>=t||n.sCount[a]<n.blkIndent));){if(n.level>=c){n.line=t;break}for(r=0;r<s&&(i=o[r](n,a,t,!1),!i);r++);n.tight=!l,n.isEmpty(n.line-1)&&(l=!0),a=n.line,a<t&&n.isEmpty(a)&&(l=!0,a++,n.line=a)}};gi.prototype.parse=function(n,e,t,i){var r;n&&(r=new this.State(n,e,t,i),this.tokenize(r,r.line,r.lineMax))};gi.prototype.State=El();_l.exports=gi});var Dl=_((bv,Al)=>{"use strict";function Jd(n){switch(n){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}}Al.exports=function(e,t){for(var i=e.pos;i<e.posMax&&!Jd(e.src.charCodeAt(i));)i++;return i===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,i)),e.pos=i,!0)}});var Ll=_((vv,Tl)=>{"use strict";var Qd=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;Tl.exports=function(e,t){var i,r,o,s,a,l,c,u;return!e.md.options.linkify||e.linkLevel>0||(i=e.pos,r=e.posMax,i+3>r)||e.src.charCodeAt(i)!==58||e.src.charCodeAt(i+1)!==47||e.src.charCodeAt(i+2)!==47||(o=e.pending.match(Qd),!o)||(s=o[1],a=e.md.linkify.matchAtStart(e.src.slice(i-s.length)),!a)||(l=a.url,l=l.replace(/\*+$/,""),c=e.md.normalizeLink(l),!e.md.validateLink(c))?!1:(t||(e.pending=e.pending.slice(0,-s.length),u=e.push("link_open","a",1),u.attrs=[["href",c]],u.markup="linkify",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(l),u=e.push("link_close","a",-1),u.markup="linkify",u.info="auto"),e.pos+=l.length-s.length,!0)}});var $l=_((wv,Il)=>{"use strict";var ep=R().isSpace;Il.exports=function(e,t){var i,r,o,s=e.pos;if(e.src.charCodeAt(s)!==10)return!1;if(i=e.pending.length-1,r=e.posMax,!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){for(o=i-1;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(s++;s<r&&ep(e.src.charCodeAt(s));)s++;return e.pos=s,!0}});var Fl=_((yv,Ml)=>{"use strict";var tp=R().isSpace,ro=[];for(io=0;io<256;io++)ro.push(0);var io;"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(n){ro[n.charCodeAt(0)]=1});Ml.exports=function(e,t){var i,r,o,s,a,l=e.pos,c=e.posMax;if(e.src.charCodeAt(l)!==92||(l++,l>=c))return!1;if(i=e.src.charCodeAt(l),i===10){for(t||e.push("hardbreak","br",0),l++;l<c&&(i=e.src.charCodeAt(l),!!tp(i));)l++;return e.pos=l,!0}return s=e.src[l],i>=55296&&i<=56319&&l+1<c&&(r=e.src.charCodeAt(l+1),r>=56320&&r<=57343&&(s+=e.src[l+1],l++)),o="\\"+s,t||(a=e.push("text_special","",0),i<256&&ro[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"),e.pos=l+1,!0}});var Bl=_((xv,ql)=>{"use strict";ql.exports=function(e,t){var i,r,o,s,a,l,c,u,h=e.pos,d=e.src.charCodeAt(h);if(d!==96)return!1;for(i=h,h++,r=e.posMax;h<r&&e.src.charCodeAt(h)===96;)h++;if(o=e.src.slice(i,h),c=o.length,e.backticksScanned&&(e.backticks[c]||0)<=i)return t||(e.pending+=o),e.pos+=c,!0;for(a=l=h;(a=e.src.indexOf("`",l))!==-1;){for(l=a+1;l<r&&e.src.charCodeAt(l)===96;)l++;if(u=l-a,u===c)return t||(s=e.push("code_inline","code",0),s.markup=o,s.content=e.src.slice(h,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=l,!0;e.backticks[u]=a}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=c,!0}});var so=_((kv,oo)=>{"use strict";oo.exports.tokenize=function(e,t){var i,r,o,s,a,l=e.pos,c=e.src.charCodeAt(l);if(t||c!==126||(r=e.scanDelims(e.pos,!0),s=r.length,a=String.fromCharCode(c),s<2))return!1;for(s%2&&(o=e.push("text","",0),o.content=a,s--),i=0;i<s;i+=2)o=e.push("text","",0),o.content=a+a,e.delimiters.push({marker:c,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0};function Pl(n,e){var t,i,r,o,s,a=[],l=e.length;for(t=0;t<l;t++)r=e[t],r.marker===126&&r.end!==-1&&(o=e[r.end],s=n.tokens[r.token],s.type="s_open",s.tag="s",s.nesting=1,s.markup="~~",s.content="",s=n.tokens[o.token],s.type="s_close",s.tag="s",s.nesting=-1,s.markup="~~",s.content="",n.tokens[o.token-1].type==="text"&&n.tokens[o.token-1].content==="~"&&a.push(o.token-1));for(;a.length;){for(t=a.pop(),i=t+1;i<n.tokens.length&&n.tokens[i].type==="s_close";)i++;i--,t!==i&&(s=n.tokens[i],n.tokens[i]=n.tokens[t],n.tokens[t]=s)}}oo.exports.postProcess=function(e){var t,i=e.tokens_meta,r=e.tokens_meta.length;for(Pl(e,e.delimiters),t=0;t<r;t++)i[t]&&i[t].delimiters&&Pl(e,i[t].delimiters)}});var lo=_((Cv,ao)=>{"use strict";ao.exports.tokenize=function(e,t){var i,r,o,s=e.pos,a=e.src.charCodeAt(s);if(t||a!==95&&a!==42)return!1;for(r=e.scanDelims(e.pos,a===42),i=0;i<r.length;i++)o=e.push("text","",0),o.content=String.fromCharCode(a),e.delimiters.push({marker:a,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0};function Ol(n,e){var t,i,r,o,s,a,l=e.length;for(t=l-1;t>=0;t--)i=e[t],!(i.marker!==95&&i.marker!==42)&&i.end!==-1&&(r=e[i.end],a=t>0&&e[t-1].end===i.end+1&&e[t-1].marker===i.marker&&e[t-1].token===i.token-1&&e[i.end+1].token===r.token+1,s=String.fromCharCode(i.marker),o=n.tokens[i.token],o.type=a?"strong_open":"em_open",o.tag=a?"strong":"em",o.nesting=1,o.markup=a?s+s:s,o.content="",o=n.tokens[r.token],o.type=a?"strong_close":"em_close",o.tag=a?"strong":"em",o.nesting=-1,o.markup=a?s+s:s,o.content="",a&&(n.tokens[e[t-1].token].content="",n.tokens[e[i.end+1].token].content="",t--))}ao.exports.postProcess=function(e){var t,i=e.tokens_meta,r=e.tokens_meta.length;for(Ol(e,e.delimiters),t=0;t<r;t++)i[t]&&i[t].delimiters&&Ol(e,i[t].delimiters)}});var Nl=_((Ev,Rl)=>{"use strict";var np=R().normalizeReference,co=R().isSpace;Rl.exports=function(e,t){var i,r,o,s,a,l,c,u,h,d="",p="",f=e.pos,m=e.posMax,y=e.pos,v=!0;if(e.src.charCodeAt(e.pos)!==91||(a=e.pos+1,s=e.md.helpers.parseLinkLabel(e,e.pos,!0),s<0))return!1;if(l=s+1,l<m&&e.src.charCodeAt(l)===40){for(v=!1,l++;l<m&&(r=e.src.charCodeAt(l),!(!co(r)&&r!==10));l++);if(l>=m)return!1;if(y=l,c=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),c.ok){for(d=e.md.normalizeLink(c.str),e.md.validateLink(d)?l=c.pos:d="",y=l;l<m&&(r=e.src.charCodeAt(l),!(!co(r)&&r!==10));l++);if(c=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<m&&y!==l&&c.ok)for(p=c.str,l=c.pos;l<m&&(r=e.src.charCodeAt(l),!(!co(r)&&r!==10));l++);}(l>=m||e.src.charCodeAt(l)!==41)&&(v=!0),l++}if(v){if(typeof e.env.references>"u")return!1;if(l<m&&e.src.charCodeAt(l)===91?(y=l+1,l=e.md.helpers.parseLinkLabel(e,l),l>=0?o=e.src.slice(y,l++):l=s+1):l=s+1,o||(o=e.src.slice(a,s)),u=e.env.references[np(o)],!u)return e.pos=f,!1;d=u.href,p=u.title}return t||(e.pos=a,e.posMax=s,h=e.push("link_open","a",1),h.attrs=i=[["href",d]],p&&i.push(["title",p]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,h=e.push("link_close","a",-1)),e.pos=l,e.posMax=m,!0}});var Hl=_((_v,zl)=>{"use strict";var ip=R().normalizeReference,uo=R().isSpace;zl.exports=function(e,t){var i,r,o,s,a,l,c,u,h,d,p,f,m,y="",v=e.pos,b=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(l=e.pos+2,a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),a<0))return!1;if(c=a+1,c<b&&e.src.charCodeAt(c)===40){for(c++;c<b&&(r=e.src.charCodeAt(c),!(!uo(r)&&r!==10));c++);if(c>=b)return!1;for(m=c,h=e.md.helpers.parseLinkDestination(e.src,c,e.posMax),h.ok&&(y=e.md.normalizeLink(h.str),e.md.validateLink(y)?c=h.pos:y=""),m=c;c<b&&(r=e.src.charCodeAt(c),!(!uo(r)&&r!==10));c++);if(h=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<b&&m!==c&&h.ok)for(d=h.str,c=h.pos;c<b&&(r=e.src.charCodeAt(c),!(!uo(r)&&r!==10));c++);else d="";if(c>=b||e.src.charCodeAt(c)!==41)return e.pos=v,!1;c++}else{if(typeof e.env.references>"u")return!1;if(c<b&&e.src.charCodeAt(c)===91?(m=c+1,c=e.md.helpers.parseLinkLabel(e,c),c>=0?s=e.src.slice(m,c++):c=a+1):c=a+1,s||(s=e.src.slice(l,a)),u=e.env.references[ip(s)],!u)return e.pos=v,!1;y=u.href,d=u.title}return t||(o=e.src.slice(l,a),e.md.inline.parse(o,e.md,e.env,f=[]),p=e.push("image","img",0),p.attrs=i=[["src",y],["alt",""]],p.children=f,p.content=o,d&&i.push(["title",d])),e.pos=c,e.posMax=b,!0}});var jl=_((Sv,Ul)=>{"use strict";var rp=/^([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])?)*)$/,op=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;Ul.exports=function(e,t){var i,r,o,s,a,l,c=e.pos;if(e.src.charCodeAt(c)!==60)return!1;for(a=e.pos,l=e.posMax;;){if(++c>=l||(s=e.src.charCodeAt(c),s===60))return!1;if(s===62)break}return i=e.src.slice(a+1,c),op.test(i)?(r=e.md.normalizeLink(i),e.md.validateLink(r)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",r]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(i),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=i.length+2,!0):!1):rp.test(i)?(r=e.md.normalizeLink("mailto:"+i),e.md.validateLink(r)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",r]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(i),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=i.length+2,!0):!1):!1}});var Wl=_((Av,Vl)=>{"use strict";var sp=no().HTML_TAG_RE;function ap(n){return/^<a[>\s]/i.test(n)}function lp(n){return/^<\/a\s*>/i.test(n)}function cp(n){var e=n|32;return e>=97&&e<=122}Vl.exports=function(e,t){var i,r,o,s,a=e.pos;return!e.md.options.html||(o=e.posMax,e.src.charCodeAt(a)!==60||a+2>=o)||(i=e.src.charCodeAt(a+1),i!==33&&i!==63&&i!==47&&!cp(i))||(r=e.src.slice(a).match(sp),!r)?!1:(t||(s=e.push("html_inline","",0),s.content=e.src.slice(a,a+r[0].length),ap(s.content)&&e.linkLevel++,lp(s.content)&&e.linkLevel--),e.pos+=r[0].length,!0)}});var Xl=_((Dv,Zl)=>{"use strict";var Gl=Wr(),up=R().has,hp=R().isValidEntityCode,Kl=R().fromCodePoint,dp=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,pp=/^&([a-z][a-z0-9]{1,31});/i;Zl.exports=function(e,t){var i,r,o,s,a=e.pos,l=e.posMax;if(e.src.charCodeAt(a)!==38||a+1>=l)return!1;if(i=e.src.charCodeAt(a+1),i===35){if(o=e.src.slice(a).match(dp),o)return t||(r=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0),s.content=hp(r)?Kl(r):Kl(65533),s.markup=o[0],s.info="entity"),e.pos+=o[0].length,!0}else if(o=e.src.slice(a).match(pp),o&&up(Gl,o[1]))return t||(s=e.push("text_special","",0),s.content=Gl[o[1]],s.markup=o[0],s.info="entity"),e.pos+=o[0].length,!0;return!1}});var Ql=_((Tv,Jl)=>{"use strict";function Yl(n,e){var t,i,r,o,s,a,l,c,u={},h=e.length;if(h){var d=0,p=-2,f=[];for(t=0;t<h;t++)if(r=e[t],f.push(0),(e[d].marker!==r.marker||p!==r.token-1)&&(d=t),p=r.token,r.length=r.length||0,!!r.close){for(u.hasOwnProperty(r.marker)||(u[r.marker]=[-1,-1,-1,-1,-1,-1]),s=u[r.marker][(r.open?3:0)+r.length%3],i=d-f[d]-1,a=i;i>s;i-=f[i]+1)if(o=e[i],o.marker===r.marker&&o.open&&o.end<0&&(l=!1,(o.close||r.open)&&(o.length+r.length)%3===0&&(o.length%3!==0||r.length%3!==0)&&(l=!0),!l)){c=i>0&&!e[i-1].open?f[i-1]+1:0,f[t]=t-i+c,f[i]=c,r.open=!1,o.end=t,o.close=!1,a=-1,p=-2;break}a!==-1&&(u[r.marker][(r.open?3:0)+(r.length||0)%3]=a)}}}Jl.exports=function(e){var t,i=e.tokens_meta,r=e.tokens_meta.length;for(Yl(e,e.delimiters),t=0;t<r;t++)i[t]&&i[t].delimiters&&Yl(e,i[t].delimiters)}});var tc=_((Lv,ec)=>{"use strict";ec.exports=function(e){var t,i,r=0,o=e.tokens,s=e.tokens.length;for(t=i=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<s&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==i&&(o[i]=o[t]),i++);t!==i&&(o.length=i)}});var sc=_((Iv,oc)=>{"use strict";var ho=di(),nc=R().isWhiteSpace,ic=R().isPunctChar,rc=R().isMdAsciiPunct;function Zt(n,e,t,i){this.src=n,this.env=t,this.md=e,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Zt.prototype.pushPending=function(){var n=new ho("text","",0);return n.content=this.pending,n.level=this.pendingLevel,this.tokens.push(n),this.pending="",n};Zt.prototype.push=function(n,e,t){this.pending&&this.pushPending();var i=new ho(n,e,t),r=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Zt.prototype.scanDelims=function(n,e){var t=n,i,r,o,s,a,l,c,u,h,d=!0,p=!0,f=this.posMax,m=this.src.charCodeAt(n);for(i=n>0?this.src.charCodeAt(n-1):32;t<f&&this.src.charCodeAt(t)===m;)t++;return o=t-n,r=t<f?this.src.charCodeAt(t):32,c=rc(i)||ic(String.fromCharCode(i)),h=rc(r)||ic(String.fromCharCode(r)),l=nc(i),u=nc(r),u?d=!1:h&&(l||c||(d=!1)),l?p=!1:c&&(u||h||(p=!1)),e?(s=d,a=p):(s=d&&(!p||c),a=p&&(!d||h)),{can_open:s,can_close:a,length:o}};Zt.prototype.Token=ho;oc.exports=Zt});var cc=_(($v,lc)=>{"use strict";var ac=ui(),po=[["text",Dl()],["linkify",Ll()],["newline",$l()],["escape",Fl()],["backticks",Bl()],["strikethrough",so().tokenize],["emphasis",lo().tokenize],["link",Nl()],["image",Hl()],["autolink",jl()],["html_inline",Wl()],["entity",Xl()]],fo=[["balance_pairs",Ql()],["strikethrough",so().postProcess],["emphasis",lo().postProcess],["fragments_join",tc()]];function Xt(){var n;for(this.ruler=new ac,n=0;n<po.length;n++)this.ruler.push(po[n][0],po[n][1]);for(this.ruler2=new ac,n=0;n<fo.length;n++)this.ruler2.push(fo[n][0],fo[n][1])}Xt.prototype.skipToken=function(n){var e,t,i=n.pos,r=this.ruler.getRules(""),o=r.length,s=n.md.options.maxNesting,a=n.cache;if(typeof a[i]<"u"){n.pos=a[i];return}if(n.level<s)for(t=0;t<o&&(n.level++,e=r[t](n,!0),n.level--,!e);t++);else n.pos=n.posMax;e||n.pos++,a[i]=n.pos};Xt.prototype.tokenize=function(n){for(var e,t,i=this.ruler.getRules(""),r=i.length,o=n.posMax,s=n.md.options.maxNesting;n.pos<o;){if(n.level<s)for(t=0;t<r&&(e=i[t](n,!1),!e);t++);if(e){if(n.pos>=o)break;continue}n.pending+=n.src[n.pos++]}n.pending&&n.pushPending()};Xt.prototype.parse=function(n,e,t,i){var r,o,s,a=new this.State(n,e,t,i);for(this.tokenize(a),o=this.ruler2.getRules(""),s=o.length,r=0;r<s;r++)o[r](a)};Xt.prototype.State=sc();lc.exports=Xt});var hc=_((Mv,uc)=>{"use strict";uc.exports=function(n){var e={};n=n||{},e.src_Any=Kr().source,e.src_Cc=Zr().source,e.src_Z=Xr().source,e.src_P=oi().source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var t="[><\uFF5C]";return e.src_pseudo_letter="(?:(?!"+t+"|"+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="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(n["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+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="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}});var gc=_((Fv,mc)=>{"use strict";function mo(n){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){t&&Object.keys(t).forEach(function(i){n[i]=t[i]})}),n}function vi(n){return Object.prototype.toString.call(n)}function fp(n){return vi(n)==="[object String]"}function mp(n){return vi(n)==="[object Object]"}function gp(n){return vi(n)==="[object RegExp]"}function dc(n){return vi(n)==="[object Function]"}function bp(n){return n.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var fc={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function vp(n){return Object.keys(n||{}).reduce(function(e,t){return e||fc.hasOwnProperty(t)},!1)}var wp={"http:":{validate:function(n,e,t){var i=n.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(i)?i.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(n,e,t){var i=n.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(i)?e>=3&&n[e-3]===":"||e>=3&&n[e-3]==="/"?0:i.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(n,e,t){var i=n.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(i)?i.match(t.re.mailto)[0].length:0}}},yp="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]",xp="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function kp(n){n.__index__=-1,n.__text_cache__=""}function Cp(n){return function(e,t){var i=e.slice(t);return n.test(i)?i.match(n)[0].length:0}}function pc(){return function(n,e){e.normalize(n)}}function bi(n){var e=n.re=hc()(n.__opts__),t=n.__tlds__.slice();n.onCompile(),n.__tlds_replaced__||t.push(yp),t.push(e.src_xn),e.src_tlds=t.join("|");function i(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(i(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(i(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(i(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(i(e.tpl_host_fuzzy_test),"i");var r=[];n.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(n.__schemas__).forEach(function(a){var l=n.__schemas__[a];if(l!==null){var c={validate:null,link:null};if(n.__compiled__[a]=c,mp(l)){gp(l.validate)?c.validate=Cp(l.validate):dc(l.validate)?c.validate=l.validate:o(a,l),dc(l.normalize)?c.normalize=l.normalize:l.normalize?o(a,l):c.normalize=pc();return}if(fp(l)){r.push(a);return}o(a,l)}}),r.forEach(function(a){n.__compiled__[n.__schemas__[a]]&&(n.__compiled__[a].validate=n.__compiled__[n.__schemas__[a]].validate,n.__compiled__[a].normalize=n.__compiled__[n.__schemas__[a]].normalize)}),n.__compiled__[""]={validate:null,normalize:pc()};var s=Object.keys(n.__compiled__).filter(function(a){return a.length>0&&n.__compiled__[a]}).map(bp).join("|");n.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+s+")","i"),n.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+s+")","ig"),n.re.schema_at_start=RegExp("^"+n.re.schema_search.source,"i"),n.re.pretest=RegExp("("+n.re.schema_test.source+")|("+n.re.host_fuzzy_test.source+")|@","i"),kp(n)}function Ep(n,e){var t=n.__index__,i=n.__last_index__,r=n.__text_cache__.slice(t,i);this.schema=n.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=i+e,this.raw=r,this.text=r,this.url=r}function go(n,e){var t=new Ep(n,e);return n.__compiled__[t.schema].normalize(t,n),t}function me(n,e){if(!(this instanceof me))return new me(n,e);e||vp(n)&&(e=n,n={}),this.__opts__=mo({},fc,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=mo({},wp,n),this.__compiled__={},this.__tlds__=xp,this.__tlds_replaced__=!1,this.re={},bi(this)}me.prototype.add=function(e,t){return this.__schemas__[e]=t,bi(this),this};me.prototype.set=function(e){return this.__opts__=mo(this.__opts__,e),this};me.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,i,r,o,s,a,l,c,u;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(t=l.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],l.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(i=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=i.index+i[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=i.index+i[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=e.indexOf("@"),u>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(s=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};me.prototype.pretest=function(e){return this.re.pretest.test(e)};me.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0};me.prototype.match=function(e){var t=0,i=[];this.__index__>=0&&this.__text_cache__===e&&(i.push(go(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)i.push(go(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return i.length?i:null};me.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;var t=this.re.schema_at_start.exec(e);if(!t)return null;var i=this.testSchemaAt(e,t[2],t[0].length);return i?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i,go(this,0)):null};me.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),bi(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,bi(this),this)};me.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};me.prototype.onCompile=function(){};mc.exports=me});var Ec={};St(Ec,{decode:()=>yo,default:()=>$p,encode:()=>xo,toASCII:()=>Cc,toUnicode:()=>kc,ucs2decode:()=>wo,ucs2encode:()=>yc});function Ve(n){throw new RangeError(Dp[n])}function Tp(n,e){let t=[],i=n.length;for(;i--;)t[i]=e(n[i]);return t}function wc(n,e){let t=n.split("@"),i="";t.length>1&&(i=t[0]+"@",n=t[1]),n=n.replace(Ap,".");let r=n.split("."),o=Tp(r,e).join(".");return i+o}function wo(n){let e=[],t=0,i=n.length;for(;t<i;){let r=n.charCodeAt(t++);if(r>=55296&&r<=56319&&t<i){let o=n.charCodeAt(t++);(o&64512)==56320?e.push(((r&1023)<<10)+(o&1023)+65536):(e.push(r),t--)}else e.push(r)}return e}var vc,_p,Sp,Ap,Dp,bo,Le,vo,yc,Lp,bc,xc,yo,xo,kc,Cc,Ip,$p,_c=qu(()=>{"use strict";vc="-",_p=/^xn--/,Sp=/[^\0-\x7F]/,Ap=/[\x2E\u3002\uFF0E\uFF61]/g,Dp={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},bo=36-1,Le=Math.floor,vo=String.fromCharCode;yc=n=>String.fromCodePoint(...n),Lp=function(n){return n>=48&&n<58?26+(n-48):n>=65&&n<91?n-65:n>=97&&n<123?n-97:36},bc=function(n,e){return n+22+75*(n<26)-((e!=0)<<5)},xc=function(n,e,t){let i=0;for(n=t?Le(n/700):n>>1,n+=Le(n/e);n>bo*26>>1;i+=36)n=Le(n/bo);return Le(i+(bo+1)*n/(n+38))},yo=function(n){let e=[],t=n.length,i=0,r=128,o=72,s=n.lastIndexOf(vc);s<0&&(s=0);for(let a=0;a<s;++a)n.charCodeAt(a)>=128&&Ve("not-basic"),e.push(n.charCodeAt(a));for(let a=s>0?s+1:0;a<t;){let l=i;for(let u=1,h=36;;h+=36){a>=t&&Ve("invalid-input");let d=Lp(n.charCodeAt(a++));d>=36&&Ve("invalid-input"),d>Le((2147483647-i)/u)&&Ve("overflow"),i+=d*u;let p=h<=o?1:h>=o+26?26:h-o;if(d<p)break;let f=36-p;u>Le(2147483647/f)&&Ve("overflow"),u*=f}let c=e.length+1;o=xc(i-l,c,l==0),Le(i/c)>2147483647-r&&Ve("overflow"),r+=Le(i/c),i%=c,e.splice(i++,0,r)}return String.fromCodePoint(...e)},xo=function(n){let e=[];n=wo(n);let t=n.length,i=128,r=0,o=72;for(let l of n)l<128&&e.push(vo(l));let s=e.length,a=s;for(s&&e.push(vc);a<t;){let l=2147483647;for(let u of n)u>=i&&u<l&&(l=u);let c=a+1;l-i>Le((2147483647-r)/c)&&Ve("overflow"),r+=(l-i)*c,i=l;for(let u of n)if(u<i&&++r>2147483647&&Ve("overflow"),u===i){let h=r;for(let d=36;;d+=36){let p=d<=o?1:d>=o+26?26:d-o;if(h<p)break;let f=h-p,m=36-p;e.push(vo(bc(p+f%m,0))),h=Le(f/m)}e.push(vo(bc(h,0))),o=xc(r,c,a===s),r=0,++a}++r,++i}return e.join("")},kc=function(n){return wc(n,function(e){return _p.test(e)?yo(e.slice(4).toLowerCase()):e})},Cc=function(n){return wc(n,function(e){return Sp.test(e)?"xn--"+xo(e):e})},Ip={version:"2.1.0",ucs2:{decode:wo,encode:yc},decode:yo,encode:xo,toASCII:Cc,toUnicode:kc},$p=Ip});var Ac=_((qv,Sc)=>{"use strict";Sc.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}});var Tc=_((Bv,Dc)=>{"use strict";Dc.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}}});var Ic=_((Pv,Lc)=>{"use strict";Lc.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},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","fragments_join"]}}}});var qc=_((Ov,Fc)=>{"use strict";var Yt=R(),Mp=fa(),Fp=ga(),qp=Ua(),Bp=Sl(),Pp=cc(),Op=gc(),Qe=Gr(),$c=(_c(),Bu(Ec)),Rp={default:Ac(),zero:Tc(),commonmark:Ic()},Np=/^(vbscript|javascript|file|data):/,zp=/^data:image\/(gif|png|jpeg|webp);/;function Hp(n){var e=n.trim().toLowerCase();return Np.test(e)?!!zp.test(e):!0}var Mc=["http:","https:","mailto:"];function Up(n){var e=Qe.parse(n,!0);if(e.hostname&&(!e.protocol||Mc.indexOf(e.protocol)>=0))try{e.hostname=$c.toASCII(e.hostname)}catch{}return Qe.encode(Qe.format(e))}function jp(n){var e=Qe.parse(n,!0);if(e.hostname&&(!e.protocol||Mc.indexOf(e.protocol)>=0))try{e.hostname=$c.toUnicode(e.hostname)}catch{}return Qe.decode(Qe.format(e),Qe.decode.defaultChars+"%")}function be(n,e){if(!(this instanceof be))return new be(n,e);e||Yt.isString(n)||(e=n||{},n="default"),this.inline=new Pp,this.block=new Bp,this.core=new qp,this.renderer=new Fp,this.linkify=new Op,this.validateLink=Hp,this.normalizeLink=Up,this.normalizeLinkText=jp,this.utils=Yt,this.helpers=Yt.assign({},Mp),this.options={},this.configure(n),e&&this.set(e)}be.prototype.set=function(n){return Yt.assign(this.options,n),this};be.prototype.configure=function(n){var e=this,t;if(Yt.isString(n)&&(t=n,n=Rp[t],!n))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!n)throw new Error("Wrong `markdown-it` preset, can't be empty");return n.options&&e.set(n.options),n.components&&Object.keys(n.components).forEach(function(i){n.components[i].rules&&e[i].ruler.enableOnly(n.components[i].rules),n.components[i].rules2&&e[i].ruler2.enableOnly(n.components[i].rules2)}),this};be.prototype.enable=function(n,e){var t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.enable(n,!0))},this),t=t.concat(this.inline.ruler2.enable(n,!0));var i=n.filter(function(r){return t.indexOf(r)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};be.prototype.disable=function(n,e){var t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.disable(n,!0))},this),t=t.concat(this.inline.ruler2.disable(n,!0));var i=n.filter(function(r){return t.indexOf(r)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};be.prototype.use=function(n){var e=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,e),this};be.prototype.parse=function(n,e){if(typeof n!="string")throw new Error("Input data should be a String");var t=new this.core.State(n,this,e);return this.core.process(t),t.tokens};be.prototype.render=function(n,e){return e=e||{},this.renderer.render(this.parse(n,e),this.options,e)};be.prototype.parseInline=function(n,e){var t=new this.core.State(n,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};be.prototype.renderInline=function(n,e){return e=e||{},this.renderer.render(this.parseInline(n,e),this.options,e)};Fc.exports=be});var Pc=_((Rv,Bc)=>{"use strict";Bc.exports=qc()});var Hc=_((Nv,zc)=>{var ko=!0,Rc=!1,Nc=!1;zc.exports=function(n,e){e&&(ko=!e.enabled,Rc=!!e.label,Nc=!!e.labelAfter),n.core.ruler.after("inline","github-task-lists",function(t){for(var i=t.tokens,r=2;r<i.length;r++)Wp(i,r)&&(Gp(i[r],t.Token),Oc(i[r-2],"class","task-list-item"+(ko?"":" enabled")),Oc(i[Vp(i,r-2)],"class","contains-task-list"))})};function Oc(n,e,t){var i=n.attrIndex(e),r=[e,t];i<0?n.attrPush(r):n.attrs[i]=r}function Vp(n,e){for(var t=n[e].level-1,i=e-1;i>=0;i--)if(n[i].level===t)return i;return-1}function Wp(n,e){return Jp(n[e])&&Qp(n[e-1])&&ef(n[e-2])&&tf(n[e])}function Gp(n,e){if(n.children.unshift(Kp(n,e)),n.children[1].content=n.children[1].content.slice(3),n.content=n.content.slice(3),Rc)if(Nc){n.children.pop();var t="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);n.children[0].content=n.children[0].content.slice(0,-1)+' id="'+t+'">',n.children.push(Yp(n.content,t,e))}else n.children.unshift(Zp(e)),n.children.push(Xp(e))}function Kp(n,e){var t=new e("html_inline","",0),i=ko?' disabled="" ':"";return n.content.indexOf("[ ] ")===0?t.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(n.content.indexOf("[x] ")===0||n.content.indexOf("[X] ")===0)&&(t.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),t}function Zp(n){var e=new n("html_inline","",0);return e.content="<label>",e}function Xp(n){var e=new n("html_inline","",0);return e.content="</label>",e}function Yp(n,e,t){var i=new t("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+e+'">'+n+"</label>",i.attrs=[{for:e}],i}function Jp(n){return n.type==="inline"}function Qp(n){return n.type==="paragraph_open"}function ef(n){return n.type==="list_item_open"}function tf(n){return n.content.indexOf("[ ] ")===0||n.content.indexOf("[x] ")===0||n.content.indexOf("[X] ")===0}});var dr={};St(dr,{emit:()=>ur,emitPublic:()=>Nu,error:()=>hr,listen:()=>Ru,showResponseError:()=>Uu,showValidationErrors:()=>Hu,success:()=>zu});var on={},Ou=[];function ur(n,e){Ou.push({name:n,data:e});let t=on[n]||[];for(let i of t)i(e)}function Ru(n,e){typeof on[n]>"u"&&(on[n]=[]),on[n].push(e)}function Nu(n,e,t){let i=new CustomEvent(e,{detail:t,bubbles:!0});n.dispatchEvent(i)}function zu(n){ur("success",n)}function hr(n){ur("error",n)}function Hu(n){if(n.status&&n.status===422&&n.data){let e=Object.values(n.data).flat().join(`
`);hr(e)}}function Uu(n){n.status&&n.status>=400&&n.data&&n.data.message&&hr(n.data.message)}var pr={};St(pr,{HttpError:()=>sn,createXMLHttpRequest:()=>Vu,delete:()=>Xu,get:()=>Wu,patch:()=>Zu,post:()=>Gu,put:()=>Ku});async function ju(n){if(n.status===204)return null;let t=(n.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return t==="javascript"||t==="json"?n.json():n.text()}var sn=class extends Error{constructor(e,t){super(e.statusText),this.data=t,this.headers=e.headers,this.redirected=e.redirected,this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.original=e}};function Vu(n,e,t={}){let i=document.querySelector("meta[name=token]").getAttribute("content"),r=new XMLHttpRequest;for(let[o,s]of Object.entries(t))r.addEventListener(o,s.bind(r));return r.open(n,e),r.withCredentials=!0,r.setRequestHeader("X-CSRF-TOKEN",i),r}async function Go(n,e={}){let t=n;if(t.startsWith("http")||(t=window.baseUrl(t)),e.params){let l=new URL(t);for(let c of Object.keys(e.params)){let u=e.params[c];typeof u<"u"&&u!==null&&l.searchParams.set(c,u)}t=l.toString()}let i=document.querySelector("meta[name=token]").getAttribute("content"),r={...e,credentials:"same-origin"};r.headers={...r.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":i};let o=await fetch(t,r),s=await ju(o),a={data:s,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new sn(o,s);return a}async function an(n,e,t=null){let i={method:n,body:t};return typeof t=="object"&&!(t instanceof FormData)&&(i.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},i.body=JSON.stringify(t)),t instanceof FormData&&n!=="post"&&(t.append("_method",n),i.method="post"),Go(e,i)}async function Wu(n,e={}){return Go(n,{method:"GET",params:e})}async function Gu(n,e=null){return an("POST",n,e)}async function Ku(n,e=null){return an("PUT",n,e)}async function Zu(n,e=null){return an("PATCH",n,e)}async function Xu(n,e=null){return an("DELETE",n,e)}var fr=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let e=document.querySelectorAll('meta[name="translation"]');for(let t of e){let i=t.getAttribute("key"),r=t.getAttribute("value");this.store.set(i,r)}}get(e,t){let i=this.getTransText(e);return this.performReplacements(i,t)}getPlural(e,t,i){let r=this.getTransText(e);return this.parsePlural(r,t,i)}parsePlural(e,t,i){let r=e.split("|"),o=/^{([0-9]+)}/,s=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of r){let c=l.match(o);if(c!==null&&Number(c[1])===t){a=l.replace(o,"").trim();break}let u=l.match(s);if(u!==null&&Number(u[1])<=t&&(u[2]==="*"||Number(u[2])>=t)){a=l.replace(s,"").trim();break}}return a===null&&r.length>1&&(a=t===1?r[0]:r[1]),a===null&&(a=r[0]),this.performReplacements(a,i)}getTransText(e){let t=this.store.get(e);return t===void 0&&console.warn(`Translation with key "${e}" does not exist`),t}performReplacements(e,t){if(!t)return e;let i=e.match(/:(\S+)/g);if(i===null)return e;let r=e;return i.forEach(o=>{let s=o.substring(1);typeof t[s]>"u"||(r=r.replace(o,t[s]))}),r}},Ko=fr;var wr={};St(wr,{first:()=>eh,firstOnElement:()=>nh,get:()=>th,init:()=>br,register:()=>vr});function mr(n){let e=i=>i.slice(0,1).toUpperCase()+i.slice(1),t=n.split("-");return t[0]+t.slice(1).map(e).join("")}function Zo(n){return n.replace(/[A-Z]/g,(e,t)=>(t>0?"-":"")+e.toLowerCase())}var At={},Xo={},gr=new WeakMap;function Yu(n,e){let t={},i={},r=`${n}@`,o=`[refs*="${r}"]`,s=[...e.querySelectorAll(o)];e.matches(o)&&s.push(e);for(let a of s){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(r)).map(c=>c.replace(r,"")).map(mr);for(let c of l)t[c]=a,typeof i[c]>"u"&&(i[c]=[]),i[c].push(a)}return{refs:t,manyRefs:i}}function Ju(n,e){let t={},i=`option:${n}:`;for(let{name:r,value:o}of e.attributes)if(r.startsWith(i)){let s=r.replace(i,"");t[mr(s)]=o||""}return t}function Qu(n,e){let t=Xo[n];if(t===void 0)return;let i;try{i=new t,i.$name=n,i.$el=e;let o=Yu(n,e);i.$refs=o.refs,i.$manyRefs=o.manyRefs,i.$opts=Ju(n,e),i.setup()}catch(o){console.error("Failed to create component",o,n,e)}typeof At[n]>"u"&&(At[n]=[]),At[n].push(i);let r=gr.get(e)||{};r[n]=i,gr.set(e,r)}function br(n=document){let e=n.querySelectorAll("[component],[components]");for(let t of e){let i=`${t.getAttribute("component")||""} ${t.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let r of i)Qu(r,t)}}function vr(n){let e=Object.keys(n);for(let t of e)Xo[Zo(t)]=n[t]}function eh(n){return(At[n]||[null])[0]}function th(n){return At[n]||[]}function nh(n,e){return(gr.get(n)||{})[e]||null}var Uo={};St(Uo,{AddRemoveRows:()=>cn,AjaxDeleteRow:()=>un,AjaxForm:()=>hn,Attachments:()=>dn,AttachmentsList:()=>pn,AutoSubmit:()=>mn,AutoSuggest:()=>fn,BackToTop:()=>gn,BookSort:()=>Fn,ChapterContents:()=>Bn,CodeEditor:()=>Pn,CodeHighlighter:()=>On,CodeTextarea:()=>Rn,Collapsible:()=>Nn,ConfirmDialog:()=>zn,CustomCheckbox:()=>Hn,DetailsHighlighter:()=>Un,Dropdown:()=>jn,DropdownSearch:()=>Vn,Dropzone:()=>Wn,EditorToolbox:()=>Gn,EntityPermissions:()=>Kn,EntitySearch:()=>Zn,EntitySelector:()=>Xn,EntitySelectorPopup:()=>Yn,EventEmitSelect:()=>Jn,ExpandToggle:()=>Qn,GlobalSearch:()=>ei,HeaderMobileToggle:()=>ti,ImageManager:()=>ni,ImagePicker:()=>ii,ListSortControl:()=>ri,MarkdownEditor:()=>Mi,NewUserPassword:()=>Fi,Notification:()=>qi,OptionalInput:()=>Bi,PageComment:()=>Pi,PageComments:()=>Oi,PageDisplay:()=>Ri,PageEditor:()=>Ni,PagePicker:()=>Hi,PermissionsTable:()=>Ui,Pointer:()=>ji,Popup:()=>Vi,SettingAppColorScheme:()=>Wi,SettingColorPicker:()=>Gi,SettingHomepageControl:()=>Ki,ShelfSort:()=>Zi,ShortcutInput:()=>Yi,Shortcuts:()=>Xi,SortableList:()=>Ji,SubmitOnChange:()=>Qi,Tabs:()=>er,TagManager:()=>tr,TemplateManager:()=>nr,ToggleSwitch:()=>ir,TriLayout:()=>rr,UserSelect:()=>or,WebhookEvents:()=>sr,WysiwygEditor:()=>cr});function Ee(n,e={},t=[]){let i=document.createElement(n);for(let[r,o]of Object.entries(e))o===null?i.removeAttribute(r):i.setAttribute(r,o);for(let r of t)typeof r=="string"?i.append(document.createTextNode(r)):i.append(r);return i}function yr(n,e){let t=document.querySelectorAll(n);for(let i of t)e(i)}function ln(n,e,t){for(let i of e)n.addEventListener(i,t)}function O(n,e){Array.isArray(n)||(n=[n]);for(let t of n)t.addEventListener("click",e),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),e(i))})}function Yo(n,e,t){Array.isArray(e)||(e=[e]);let i=r=>{r.key===n&&t(r)};e.forEach(r=>r.addEventListener("keydown",i))}function st(n,e){Yo("Enter",n,e)}function Jo(n,e){Yo("Escape",n,e)}function K(n,e,t,i){n.addEventListener(t,r=>{let o=r.target.closest(e);o&&i.call(o,r,o)})}function Qo(n,e){let t=document.querySelectorAll(n);e=e.toLowerCase();for(let i of t)if(i.textContent.toLowerCase().includes(e))return i;return null}function Dt(n){n.innerHTML='<div class="loading-container"><div></div><div></div><div></div></div>'}function at(){let n=document.createElement("div");return n.classList.add("loading-container"),n.innerHTML="<div></div><div></div><div></div>",n}function Tt(n){let e=n.querySelectorAll(".loading-container");for(let t of e)t.remove()}function _e(n){let e=document.createElement("div");return e.innerHTML=n,window.$components.init(e),e.children[0]}function Ne(n,e,t){let i;return function(...o){let s=this,a=function(){i=null,t||n.apply(s,o)},l=t&&!i;clearTimeout(i),i=setTimeout(a,e),l&&n.apply(s,o)}}function kr(n){if(!n)return;n.scrollIntoView({behavior:"smooth"});let e=getComputedStyle(document.body).getPropertyValue("--color-primary-light"),t=window.getComputedStyle(n).getPropertyValue("background-color");n.style.backgroundColor=e,setTimeout(()=>{n.classList.add("selectFade"),n.style.backgroundColor=t},10),setTimeout(()=>{n.classList.remove("selectFade"),n.style.backgroundColor=""},3e3)}function es(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ts(){let n=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${n()+n()}-${n()}-${n()}-${n()}-${n()}${n()}${n()}`}function ns(n){return new Promise(e=>{setTimeout(e,n)})}var g=class{constructor(){se(this,"$name","");se(this,"$el",null);se(this,"$refs",{});se(this,"$manyRefs",{});se(this,"$opts",{})}setup(){}$emit(e,t={}){t.from=this;let i=this.$name,r=new CustomEvent(`${i}-${e}`,{bubbles:!0,detail:t});this.$el.dispatchEvent(r)}};var cn=class extends g{setup(){this.modelRow=this.$refs.model,this.addButton=this.$refs.add,this.removeSelector=this.$opts.removeSelector,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.addButton.addEventListener("click",this.add.bind(this)),K(this.$el,this.removeSelector,"click",e=>{e.target.closest(this.rowSelector).remove()})}add(){let e=this.modelRow.cloneNode(!0);e.classList.remove("hidden"),this.setClonedInputNames(e),this.modelRow.parentNode.insertBefore(e,this.modelRow),window.$components.init(e)}setClonedInputNames(e){let t=ts(),i=e.querySelectorAll('[name*="randrowid"]');for(let r of i)r.name=r.name.split("randrowid").join(t)}};var un=class extends g{setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete,O(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(e=>{typeof e.data=="object"&&e.data.message&&window.$events.emit("success",e.data.message),this.row.remove()}).catch(()=>{this.row.style.opacity=null,this.row.style.pointerEvents=null})}};var hn=class extends g{setup(){this.container=this.$el,this.responseContainer=this.container,this.url=this.$opts.url,this.method=this.$opts.method||"post",this.successMessage=this.$opts.successMessage,this.submitButtons=this.$manyRefs.submit||[],this.$opts.responseContainer&&(this.responseContainer=this.container.closest(this.$opts.responseContainer)),this.setupListeners()}setupListeners(){if(this.container.tagName==="FORM"){this.container.addEventListener("submit",this.submitRealForm.bind(this));return}st(this.container,e=>{this.submitFakeForm(),e.preventDefault()}),this.submitButtons.forEach(e=>O(e,this.submitFakeForm.bind(this)))}submitFakeForm(){let e=new FormData,t=this.container.querySelectorAll("[name]");for(let i of t)e.append(i.getAttribute("name"),i.value);this.submit(e)}submitRealForm(e){e.preventDefault();let t=new FormData(this.container);this.submit(t)}async submit(e){this.responseContainer.style.opacity="0.7",this.responseContainer.style.pointerEvents="none";try{let t=await window.$http[this.method.toLowerCase()](this.url,e);this.$emit("success",{formData:e}),this.responseContainer.innerHTML=t.data,this.successMessage&&window.$events.emit("success",this.successMessage)}catch(t){this.responseContainer.innerHTML=t.data}window.$components.init(this.responseContainer),this.responseContainer.style.opacity=null,this.responseContainer.style.pointerEvents=null}};var dn=class extends g{setup(){this.container=this.$el,this.pageId=this.$opts.pageId,this.editContainer=this.$refs.editContainer,this.listContainer=this.$refs.listContainer,this.linksContainer=this.$refs.linksContainer,this.listPanel=this.$refs.listPanel,this.attachLinkButton=this.$refs.attachLinkButton,this.setupListeners()}setupListeners(){let e=this.reloadList.bind(this);this.container.addEventListener("dropzone-upload-success",e),this.container.addEventListener("ajax-form-success",e),this.container.addEventListener("sortable-list-sort",t=>{this.updateOrder(t.detail.ids)}),this.container.addEventListener("event-emit-select-edit",t=>{this.startEdit(t.detail.id)}),this.container.addEventListener("event-emit-select-edit-back",()=>{this.stopEdit()}),this.container.addEventListener("event-emit-select-insert",t=>{let i=t.target.closest("[data-drag-content]").getAttribute("data-drag-content"),r=JSON.parse(i);window.$events.emit("editor::insert",{html:r["text/html"],markdown:r["text/plain"]})}),this.attachLinkButton.addEventListener("click",()=>{this.showSection("links")})}showSection(e){let t={links:this.linksContainer,edit:this.editContainer,list:this.listContainer};for(let[i,r]of Object.entries(t))r.toggleAttribute("hidden",i!==e)}reloadList(){this.stopEdit(),window.$http.get(`/attachments/get/page/${this.pageId}`).then(e=>{this.listPanel.innerHTML=e.data,window.$components.init(this.listPanel)})}updateOrder(e){window.$http.put(`/attachments/sort/page/${this.pageId}`,{order:e}).then(t=>{window.$events.emit("success",t.data.message)})}async startEdit(e){this.showSection("edit"),Dt(this.editContainer);let t=await window.$http.get(`/attachments/edit/${e}`);this.editContainer.innerHTML=t.data,window.$components.init(this.editContainer)}stopEdit(){this.showSection("list")}};var pn=class extends g{setup(){this.container=this.$el,this.setupListeners()}setupListeners(){let e=t=>t.key==="Control"||t.key==="Meta";window.addEventListener("keydown",t=>{e(t)&&this.addOpenQueryToLinks()},{passive:!0}),window.addEventListener("keyup",t=>{e(t)&&this.removeOpenQueryFromLinks()},{passive:!0})}addOpenQueryToLinks(){let e=this.container.querySelectorAll("a.attachment-file");for(let t of e)t.href.split("?")[1]!=="open=true"&&(t.href+="?open=true",t.setAttribute("target","_blank"))}removeOpenQueryFromLinks(){let e=this.container.querySelectorAll("a.attachment-file");for(let t of e)t.href=t.href.split("?")[0],t.removeAttribute("target")}};var Lt,Cr,It,Er,ze=class{constructor(e,t=null,i=null){re(this,Lt);re(this,It);this.containers=[e],this.onEscape=t,this.onEnter=i,e.addEventListener("keydown",T(this,Lt,Cr).bind(this))}shareHandlingToEl(e){this.containers.push(e),e.addEventListener("keydown",T(this,Lt,Cr).bind(this))}focusNext(){let e=T(this,It,Er).call(this),i=e.indexOf(document.activeElement)+1;i>=e.length&&(i=0),e[i].focus()}focusPrevious(){let e=T(this,It,Er).call(this),i=e.indexOf(document.activeElement)-1;i<0&&(i=e.length-1),e[i].focus()}};Lt=new WeakSet,Cr=function(e){e.target.matches("input")&&(e.key==="ArrowRight"||e.key==="ArrowLeft")||(e.key==="ArrowDown"||e.key==="ArrowRight"?(this.focusNext(),e.preventDefault()):e.key==="ArrowUp"||e.key==="ArrowLeft"?(this.focusPrevious(),e.preventDefault()):e.key==="Escape"?this.onEscape?this.onEscape(e):document.activeElement&&document.activeElement.blur():e.key==="Enter"&&this.onEnter&&this.onEnter(e))},It=new WeakSet,Er=function(){let e=[],t='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let i of this.containers)e.push(...i.querySelectorAll(t));return e};var _r={},fn=class extends g{setup(){this.parent=this.$el.parentElement,this.container=this.$el,this.type=this.$opts.type,this.url=this.$opts.url,this.input=this.$refs.input,this.list=this.$refs.list,this.lastPopulated=0,this.setupListeners()}setupListeners(){new ze(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},t=>{t.preventDefault(),this.selectSuggestion(t.target.textContent)}).shareHandlingToEl(this.input),K(this.list,".text-item","click",(t,i)=>{this.selectSuggestion(i.textContent)}),this.input.addEventListener("input",this.requestSuggestions.bind(this)),this.input.addEventListener("focus",this.requestSuggestions.bind(this)),this.input.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this)),this.input.addEventListener("keydown",t=>{t.key==="Tab"&&this.hideSuggestions()})}selectSuggestion(e){this.input.value=e,this.lastPopulated=Date.now(),this.input.focus(),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hideSuggestions()}async requestSuggestions(){if(Date.now()-this.lastPopulated<50)return;let e=this.getNameFilterIfNeeded(),t=this.input.value.toLowerCase(),r=(await this.loadSuggestions(t,e)).filter(o=>t===""||o.toLowerCase().startsWith(t)).slice(0,10);this.displaySuggestions(r)}getNameFilterIfNeeded(){return this.type!=="value"?null:this.parent.querySelector("input").value}async loadSuggestions(e,t=null){e=e.slice(0,4);let i={search:e,name:t},r=`${this.url}:${JSON.stringify(i)}`;if(_r[r])return _r[r];let o=await window.$http.get(this.url,i);return _r[r]=o.data,o.data}displaySuggestions(e){if(e.length===0){this.hideSuggestions();return}this.list.innerHTML=e.map(t=>`<li><div tabindex="0" class="text-item">${es(t)}</div></li>`).join(""),this.list.style.display="block";for(let t of this.list.querySelectorAll(".text-item"))t.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this))}hideSuggestions(){this.list.style.display="none"}hideSuggestionsIfFocusedLost(e){this.container.contains(e.relatedTarget)||this.hideSuggestions()}};var mn=class extends g{setup(){this.form=this.$el,this.form.submit()}};var gn=class extends g{setup(){if(this.button=this.$el,this.targetElem=document.getElementById("header"),this.showing=!1,this.breakPoint=1200,document.body.classList.contains("flexbox")){this.button.style.display="none";return}this.button.addEventListener("click",this.scrollToTop.bind(this)),window.addEventListener("scroll",this.onPageScroll.bind(this))}onPageScroll(){let e=document.documentElement.scrollTop||document.body.scrollTop||0;!this.showing&&e>this.breakPoint?(this.button.style.display="block",this.showing=!0,setTimeout(()=>{this.button.style.opacity=.4},1)):this.showing&&e<this.breakPoint&&(this.button.style.opacity=0,this.showing=!1,setTimeout(()=>{this.button.style.display="none"},500))}scrollToTop(){let e=this.targetElem.getBoundingClientRect().top,t=document.documentElement.scrollTop?document.documentElement:document.body,i=300,r=Date.now(),o=this.targetElem.getBoundingClientRect().top;function s(){let a=1-(Date.now()-r)/i,l=Math.abs(a*o);a>0?(t.scrollTop=l,requestAnimationFrame(s.bind(this))):t.scrollTop=e}requestAnimationFrame(s.bind(this))}};function is(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ae(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?is(Object(t),!0).forEach(function(i){ih(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):is(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Cn(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cn=function(e){return typeof e}:Cn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cn(n)}function ih(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ke(){return ke=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ke.apply(this,arguments)}function rh(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function oh(n,e){if(n==null)return{};var t=rh(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function sh(n){return ah(n)||lh(n)||ch(n)||uh()}function ah(n){if(Array.isArray(n))return Br(n)}function lh(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ch(n,e){if(n){if(typeof n=="string")return Br(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Br(n,e)}}function Br(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function uh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var hh="1.15.0";function $e(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Me=$e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),jt=$e(/Edge/i),rs=$e(/firefox/i),Rt=$e(/safari/i)&&!$e(/chrome/i)&&!$e(/android/i),fs=$e(/iP(ad|od|hone)/i),ms=$e(/chrome/i)&&$e(/android/i),gs={capture:!1,passive:!1};function P(n,e,t){n.addEventListener(e,t,!Me&&gs)}function B(n,e,t){n.removeEventListener(e,t,!Me&&gs)}function Dn(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function dh(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function xe(n,e,t,i){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&Dn(n,e):Dn(n,e))||i&&n===t)return n;if(n===t)break}while(n=dh(n))}return null}var os=/\s+/g;function X(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var i=(" "+n.className+" ").replace(os," ").replace(" "+e+" "," ");n.className=(i+(t?" "+e:"")).replace(os," ")}}function A(n,e,t){var i=n&&n.style;if(i){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in i)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),i[e]=t+(typeof t=="string"?"":"px")}}function Xe(n,e){var t="";if(typeof n=="string")t=n;else do{var i=A(n,"transform");i&&i!=="none"&&(t=i+" "+t)}while(!e&&(n=n.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function bs(n,e,t){if(n){var i=n.getElementsByTagName(e),r=0,o=i.length;if(t)for(;r<o;r++)t(i[r],r);return i}return[]}function Se(){var n=document.scrollingElement;return n||document.documentElement}function j(n,e,t,i,r){if(!(!n.getBoundingClientRect&&n!==window)){var o,s,a,l,c,u,h;if(n!==window&&n.parentNode&&n!==Se()?(o=n.getBoundingClientRect(),s=o.top,a=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(e||t)&&n!==window&&(r=r||n.parentNode,!Me))do if(r&&r.getBoundingClientRect&&(A(r,"transform")!=="none"||t&&A(r,"position")!=="static")){var d=r.getBoundingClientRect();s-=d.top+parseInt(A(r,"border-top-width")),a-=d.left+parseInt(A(r,"border-left-width")),l=s+o.height,c=a+o.width;break}while(r=r.parentNode);if(i&&n!==window){var p=Xe(r||n),f=p&&p.a,m=p&&p.d;p&&(s/=m,a/=f,h/=f,u/=m,l=s+u,c=a+h)}return{top:s,left:a,bottom:l,right:c,width:h,height:u}}}function ss(n,e,t){for(var i=je(n,!0),r=j(n)[e];i;){var o=j(i)[t],s=void 0;if(t==="top"||t==="left"?s=r>=o:s=r<=o,!s)return i;if(i===Se())break;i=je(i,!1)}return!1}function pt(n,e,t,i){for(var r=0,o=0,s=n.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==$.ghost&&(i||s[o]!==$.dragged)&&xe(s[o],t.draggable,n,!1)){if(r===e)return s[o];r++}o++}return null}function zr(n,e){for(var t=n.lastElementChild;t&&(t===$.ghost||A(t,"display")==="none"||e&&!Dn(t,e));)t=t.previousElementSibling;return t||null}function Y(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==$.clone&&(!e||Dn(n,e))&&t++;return t}function as(n){var e=0,t=0,i=Se();if(n)do{var r=Xe(n),o=r.a,s=r.d;e+=n.scrollLeft*o,t+=n.scrollTop*s}while(n!==i&&(n=n.parentNode));return[e,t]}function ph(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var i in e)if(e.hasOwnProperty(i)&&e[i]===n[t][i])return Number(t)}return-1}function je(n,e){if(!n||!n.getBoundingClientRect)return Se();var t=n,i=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var r=A(t);if(t.clientWidth<t.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Se();if(i||e)return t;i=!0}}while(t=t.parentNode);return Se()}function fh(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Sr(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var Nt;function vs(n,e){return function(){if(!Nt){var t=arguments,i=this;t.length===1?n.call(i,t[0]):n.apply(i,t),Nt=setTimeout(function(){Nt=void 0},e)}}}function mh(){clearTimeout(Nt),Nt=void 0}function ws(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function Hr(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function ls(n,e){A(n,"position","absolute"),A(n,"top",e.top),A(n,"left",e.left),A(n,"width",e.width),A(n,"height",e.height)}function Ar(n){A(n,"position",""),A(n,"top",""),A(n,"left",""),A(n,"width",""),A(n,"height","")}var ne="Sortable"+new Date().getTime();function gh(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(r){if(!(A(r,"display")==="none"||r===$.ghost)){n.push({target:r,rect:j(r)});var o=Ae({},n[n.length-1].rect);if(r.thisAnimationDuration){var s=Xe(r,!0);s&&(o.top-=s.f,o.left-=s.e)}r.fromRect=o}})}},addAnimationState:function(i){n.push(i)},removeAnimationState:function(i){n.splice(ph(n,{target:i}),1)},animateAll:function(i){var r=this;if(!this.options.animation){clearTimeout(e),typeof i=="function"&&i();return}var o=!1,s=0;n.forEach(function(a){var l=0,c=a.target,u=c.fromRect,h=j(c),d=c.prevFromRect,p=c.prevToRect,f=a.rect,m=Xe(c,!0);m&&(h.top-=m.f,h.left-=m.e),c.toRect=h,c.thisAnimationDuration&&Sr(d,h)&&!Sr(u,h)&&(f.top-h.top)/(f.left-h.left)===(u.top-h.top)/(u.left-h.left)&&(l=vh(f,d,p,r.options)),Sr(h,u)||(c.prevFromRect=u,c.prevToRect=h,l||(l=r.options.animation),r.animate(c,f,h,l)),l&&(o=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),o?e=setTimeout(function(){typeof i=="function"&&i()},s):typeof i=="function"&&i(),n=[]},animate:function(i,r,o,s){if(s){A(i,"transition",""),A(i,"transform","");var a=Xe(this.el),l=a&&a.a,c=a&&a.d,u=(r.left-o.left)/(l||1),h=(r.top-o.top)/(c||1);i.animatingX=!!u,i.animatingY=!!h,A(i,"transform","translate3d("+u+"px,"+h+"px,0)"),this.forRepaintDummy=bh(i),A(i,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),A(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){A(i,"transition",""),A(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},s)}}}}function bh(n){return n.offsetWidth}function vh(n,e,t,i){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*i.animation}var lt=[],Dr={initializeByDefault:!0},Vt={mount:function(e){for(var t in Dr)Dr.hasOwnProperty(t)&&!(t in e)&&(e[t]=Dr[t]);lt.forEach(function(i){if(i.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),lt.push(e)},pluginEvent:function(e,t,i){var r=this;this.eventCanceled=!1,i.cancel=function(){r.eventCanceled=!0};var o=e+"Global";lt.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][o]&&t[s.pluginName][o](Ae({sortable:t},i)),t.options[s.pluginName]&&t[s.pluginName][e]&&t[s.pluginName][e](Ae({sortable:t},i)))})},initializePlugins:function(e,t,i,r){lt.forEach(function(a){var l=a.pluginName;if(!(!e.options[l]&&!a.initializeByDefault)){var c=new a(e,t,e.options);c.sortable=e,c.options=e.options,e[l]=c,ke(i,c.defaults)}});for(var o in e.options)if(e.options.hasOwnProperty(o)){var s=this.modifyOption(e,o,e.options[o]);typeof s<"u"&&(e.options[o]=s)}},getEventProperties:function(e,t){var i={};return lt.forEach(function(r){typeof r.eventProperties=="function"&&ke(i,r.eventProperties.call(t[r.pluginName],e))}),i},modifyOption:function(e,t,i){var r;return lt.forEach(function(o){e[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[t]=="function"&&(r=o.optionListeners[t].call(e[o.pluginName],i))}),r}};function qt(n){var e=n.sortable,t=n.rootEl,i=n.name,r=n.targetEl,o=n.cloneEl,s=n.toEl,a=n.fromEl,l=n.oldIndex,c=n.newIndex,u=n.oldDraggableIndex,h=n.newDraggableIndex,d=n.originalEvent,p=n.putSortable,f=n.extraEventProperties;if(e=e||t&&t[ne],!!e){var m,y=e.options,v="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!Me&&!jt?m=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(i,!0,!0)),m.to=s||t,m.from=a||t,m.item=r||t,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=h,m.originalEvent=d,m.pullMode=p?p.lastPutMode:void 0;var b=Ae(Ae({},f),Vt.getEventProperties(i,e));for(var k in b)m[k]=b[k];t&&t.dispatchEvent(m),y[v]&&y[v].call(e,m)}}var wh=["evt"],ae=function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.evt,o=oh(i,wh);Vt.pluginEvent.bind($)(e,t,Ae({dragEl:C,parentEl:G,ghostEl:F,rootEl:U,nextEl:Ze,lastDownEl:En,cloneEl:W,cloneHidden:Ue,dragStarted:Bt,putSortable:Q,activeSortable:$.active,originalEvent:r,oldIndex:dt,oldDraggableIndex:zt,newIndex:fe,newDraggableIndex:He,hideGhostForTarget:Cs,unhideGhostForTarget:Es,cloneNowHidden:function(){Ue=!0},cloneNowShown:function(){Ue=!1},dispatchSortableEvent:function(a){oe({sortable:t,name:a,originalEvent:r})}},o))};function oe(n){qt(Ae({putSortable:Q,cloneEl:W,targetEl:C,rootEl:U,oldIndex:dt,oldDraggableIndex:zt,newIndex:fe,newDraggableIndex:He},n))}var C,G,F,U,Ze,En,W,Ue,dt,fe,zt,He,bn,Q,ht=!1,Tn=!1,Ln=[],Ge,we,Tr,Lr,cs,us,Bt,ct,Ht,Ut=!1,vn=!1,_n,te,Ir=[],Pr=!1,In=[],Mn=typeof document<"u",wn=fs,hs=jt||Me?"cssFloat":"float",yh=Mn&&!ms&&!fs&&"draggable"in document.createElement("div"),ys=function(){if(Mn){if(Me)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),xs=function(e,t){var i=A(e),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=pt(e,0,t),s=pt(e,1,t),a=o&&A(o),l=s&&A(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+j(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+j(s).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=r&&i[hs]==="none"||s&&i[hs]==="none"&&c+u>r)?"vertical":"horizontal"},xh=function(e,t,i){var r=i?e.left:e.top,o=i?e.right:e.bottom,s=i?e.width:e.height,a=i?t.left:t.top,l=i?t.right:t.bottom,c=i?t.width:t.height;return r===a||o===l||r+s/2===a+c/2},kh=function(e,t){var i;return Ln.some(function(r){var o=r[ne].options.emptyInsertThreshold;if(!(!o||zr(r))){var s=j(r),a=e>=s.left-o&&e<=s.right+o,l=t>=s.top-o&&t<=s.bottom+o;if(a&&l)return i=r}}),i},ks=function(e){function t(o,s){return function(a,l,c,u){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(s||h))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return t(o(a,l,c,u),s)(a,l,c,u);var d=(s?a:l).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var i={},r=e.group;(!r||Cn(r)!="object")&&(r={name:r}),i.name=r.name,i.checkPull=t(r.pull,!0),i.checkPut=t(r.put),i.revertClone=r.revertClone,e.group=i},Cs=function(){!ys&&F&&A(F,"display","none")},Es=function(){!ys&&F&&A(F,"display","")};Mn&&!ms&&document.addEventListener("click",function(n){if(Tn)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Tn=!1,!1},!0);var Ke=function(e){if(C){e=e.touches?e.touches[0]:e;var t=kh(e.clientX,e.clientY);if(t){var i={};for(var r in e)e.hasOwnProperty(r)&&(i[r]=e[r]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[ne]._onDragOver(i)}}},Ch=function(e){C&&C.parentNode[ne]._isOutsideThisEl(e.target)};function $(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=ke({},e),n[ne]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return xs(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$.supportPointer!==!1&&"PointerEvent"in window&&!Rt,emptyInsertThreshold:5};Vt.initializePlugins(this,n,t);for(var i in t)!(i in e)&&(e[i]=t[i]);ks(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:yh,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?P(n,"pointerdown",this._onTapStart):(P(n,"mousedown",this._onTapStart),P(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(P(n,"dragover",this),P(n,"dragenter",this)),Ln.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ke(this,gh())}$.prototype={constructor:$,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ct=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,C):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,r=this.options,o=r.preventOnFilter,s=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if(Ih(i),!C&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Rt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=xe(l,r.draggable,i,!1),!(l&&l.animated)&&En!==l)){if(dt=Y(l),zt=Y(l,r.draggable),typeof u=="function"){if(u.call(this,e,l,this)){oe({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),ae("filter",t,{evt:e}),o&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=xe(c,h.trim(),i,!1),h)return oe({sortable:t,rootEl:h,name:"filter",targetEl:l,fromEl:i,toEl:i}),ae("filter",t,{evt:e}),!0}),u)){o&&e.cancelable&&e.preventDefault();return}r.handle&&!xe(c,r.handle,i,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,i){var r=this,o=r.el,s=r.options,a=o.ownerDocument,l;if(i&&!C&&i.parentNode===o){var c=j(i);if(U=o,C=i,G=C.parentNode,Ze=C.nextSibling,En=i,bn=s.group,$.dragged=C,Ge={target:C,clientX:(t||e).clientX,clientY:(t||e).clientY},cs=Ge.clientX-c.left,us=Ge.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,C.style["will-change"]="all",l=function(){if(ae("delayEnded",r,{evt:e}),$.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!rs&&r.nativeDraggable&&(C.draggable=!0),r._triggerDragStart(e,t),oe({sortable:r,name:"choose",originalEvent:e}),X(C,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){bs(C,u.trim(),$r)}),P(a,"dragover",Ke),P(a,"mousemove",Ke),P(a,"touchmove",Ke),P(a,"mouseup",r._onDrop),P(a,"touchend",r._onDrop),P(a,"touchcancel",r._onDrop),rs&&this.nativeDraggable&&(this.options.touchStartThreshold=4,C.draggable=!0),ae("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(jt||Me))){if($.eventCanceled){this._onDrop();return}P(a,"mouseup",r._disableDelayedDrag),P(a,"touchend",r._disableDelayedDrag),P(a,"touchcancel",r._disableDelayedDrag),P(a,"mousemove",r._delayedDragTouchMoveHandler),P(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&P(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){C&&$r(C),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;B(e,"mouseup",this._disableDelayedDrag),B(e,"touchend",this._disableDelayedDrag),B(e,"touchcancel",this._disableDelayedDrag),B(e,"mousemove",this._delayedDragTouchMoveHandler),B(e,"touchmove",this._delayedDragTouchMoveHandler),B(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?P(document,"pointermove",this._onTouchMove):t?P(document,"touchmove",this._onTouchMove):P(document,"mousemove",this._onTouchMove):(P(C,"dragend",this),P(U,"dragstart",this._onDragStart));try{document.selection?Sn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ht=!1,U&&C){ae("dragStarted",this,{evt:t}),this.nativeDraggable&&P(document,"dragover",Ch);var i=this.options;!e&&X(C,i.dragClass,!1),X(C,i.ghostClass,!0),$.active=this,e&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(we){this._lastX=we.clientX,this._lastY=we.clientY,Cs();for(var e=document.elementFromPoint(we.clientX,we.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(we.clientX,we.clientY),e!==t);)t=e;if(C.parentNode[ne]._isOutsideThisEl(e),t)do{if(t[ne]){var i=void 0;if(i=t[ne]._onDragOver({clientX:we.clientX,clientY:we.clientY,target:e,rootEl:t}),i&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Es()}},_onTouchMove:function(e){if(Ge){var t=this.options,i=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=F&&Xe(F,!0),a=F&&s&&s.a,l=F&&s&&s.d,c=wn&&te&&as(te),u=(o.clientX-Ge.clientX+r.x)/(a||1)+(c?c[0]-Ir[0]:0)/(a||1),h=(o.clientY-Ge.clientY+r.y)/(l||1)+(c?c[1]-Ir[1]:0)/(l||1);if(!$.active&&!ht){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(F){s?(s.e+=u-(Tr||0),s.f+=h-(Lr||0)):s={a:1,b:0,c:0,d:1,e:u,f:h};var d="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");A(F,"webkitTransform",d),A(F,"mozTransform",d),A(F,"msTransform",d),A(F,"transform",d),Tr=u,Lr=h,we=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!F){var e=this.options.fallbackOnBody?document.body:U,t=j(C,!0,wn,!0,e),i=this.options;if(wn){for(te=e;A(te,"position")==="static"&&A(te,"transform")==="none"&&te!==document;)te=te.parentNode;te!==document.body&&te!==document.documentElement?(te===document&&(te=Se()),t.top+=te.scrollTop,t.left+=te.scrollLeft):te=Se(),Ir=as(te)}F=C.cloneNode(!0),X(F,i.ghostClass,!1),X(F,i.fallbackClass,!0),X(F,i.dragClass,!0),A(F,"transition",""),A(F,"transform",""),A(F,"box-sizing","border-box"),A(F,"margin",0),A(F,"top",t.top),A(F,"left",t.left),A(F,"width",t.width),A(F,"height",t.height),A(F,"opacity","0.8"),A(F,"position",wn?"absolute":"fixed"),A(F,"zIndex","100000"),A(F,"pointerEvents","none"),$.ghost=F,e.appendChild(F),A(F,"transform-origin",cs/parseInt(F.style.width)*100+"% "+us/parseInt(F.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,r=e.dataTransfer,o=i.options;if(ae("dragStart",this,{evt:e}),$.eventCanceled){this._onDrop();return}ae("setupClone",this),$.eventCanceled||(W=Hr(C),W.removeAttribute("id"),W.draggable=!1,W.style["will-change"]="",this._hideClone(),X(W,this.options.chosenClass,!1),$.clone=W),i.cloneId=Sn(function(){ae("clone",i),!$.eventCanceled&&(i.options.removeCloneOnHide||U.insertBefore(W,C),i._hideClone(),oe({sortable:i,name:"clone"}))}),!t&&X(C,o.dragClass,!0),t?(Tn=!0,i._loopId=setInterval(i._emulateDragOver,50)):(B(document,"mouseup",i._onDrop),B(document,"touchend",i._onDrop),B(document,"touchcancel",i._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(i,r,C)),P(document,"drop",i),A(C,"transform","translateZ(0)")),ht=!0,i._dragStartId=Sn(i._dragStarted.bind(i,t,e)),P(document,"selectstart",i),Bt=!0,Rt&&A(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,i=e.target,r,o,s,a=this.options,l=a.group,c=$.active,u=bn===l,h=a.sort,d=Q||c,p,f=this,m=!1;if(Pr)return;function y(Re,Au){ae(Re,f,Ae({evt:e,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:h,fromSortable:d,target:i,completed:b,onMove:function(jo,Du){return yn(U,t,C,r,jo,j(jo),e,Du)},changed:k},Au))}function v(){y("dragOverAnimationCapture"),f.captureAnimationState(),f!==d&&d.captureAnimationState()}function b(Re){return y("dragOverCompleted",{insertion:Re}),Re&&(u?c._hideClone():c._showClone(f),f!==d&&(X(C,Q?Q.options.ghostClass:c.options.ghostClass,!1),X(C,a.ghostClass,!0)),Q!==f&&f!==$.active?Q=f:f===$.active&&Q&&(Q=null),d===f&&(f._ignoreWhileAnimating=i),f.animateAll(function(){y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(i===C&&!C.animated||i===t&&!i.animated)&&(ct=null),!a.dragoverBubble&&!e.rootEl&&i!==document&&(C.parentNode[ne]._isOutsideThisEl(e.target),!Re&&Ke(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function k(){fe=Y(C),He=Y(C,a.draggable),oe({sortable:f,name:"change",toEl:t,newIndex:fe,newDraggableIndex:He,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),i=xe(i,a.draggable,t,!0),y("dragOver"),$.eventCanceled)return m;if(C.contains(e.target)||i.animated&&i.animatingX&&i.animatingY||f._ignoreWhileAnimating===i)return b(!1);if(Tn=!1,c&&!a.disabled&&(u?h||(s=G!==U):Q===this||(this.lastPutMode=bn.checkPull(this,c,C,e))&&l.checkPut(this,c,C,e))){if(p=this._getDirection(e,i)==="vertical",r=j(C),y("dragOverValid"),$.eventCanceled)return m;if(s)return G=U,v(),this._hideClone(),y("revert"),$.eventCanceled||(Ze?U.insertBefore(C,Ze):U.appendChild(C)),b(!0);var w=zr(t,a.draggable);if(!w||Ah(e,p,this)&&!w.animated){if(w===C)return b(!1);if(w&&t===e.target&&(i=w),i&&(o=j(i)),yn(U,t,C,r,i,o,e,!!i)!==!1)return v(),w&&w.nextSibling?t.insertBefore(C,w.nextSibling):t.appendChild(C),G=t,k(),b(!0)}else if(w&&Sh(e,p,this)){var E=pt(t,0,a,!0);if(E===C)return b(!1);if(i=E,o=j(i),yn(U,t,C,r,i,o,e,!1)!==!1)return v(),t.insertBefore(C,E),G=t,k(),b(!0)}else if(i.parentNode===t){o=j(i);var x=0,S,D=C.parentNode!==t,q=!xh(C.animated&&C.toRect||r,i.animated&&i.toRect||o,p),L=p?"top":"left",I=ss(i,"top","top")||ss(C,"top","top"),H=I?I.scrollTop:void 0;ct!==i&&(S=o[L],Ut=!1,vn=!q&&a.invertSwap||D),x=Dh(e,i,o,p,q?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,vn,ct===i);var N;if(x!==0){var ee=Y(C);do ee-=x,N=G.children[ee];while(N&&(A(N,"display")==="none"||N===F))}if(x===0||N===i)return b(!1);ct=i,Ht=x;var ge=i.nextElementSibling,V=!1;V=x===1;var Oe=yn(U,t,C,r,i,o,e,V);if(Oe!==!1)return(Oe===1||Oe===-1)&&(V=Oe===1),Pr=!0,setTimeout(_h,30),v(),V&&!ge?t.appendChild(C):i.parentNode.insertBefore(C,V?ge:i),I&&ws(I,0,H-I.scrollTop),G=C.parentNode,S!==void 0&&!vn&&(_n=Math.abs(S-j(i)[L])),k(),b(!0)}if(t.contains(C))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){B(document,"mousemove",this._onTouchMove),B(document,"touchmove",this._onTouchMove),B(document,"pointermove",this._onTouchMove),B(document,"dragover",Ke),B(document,"mousemove",Ke),B(document,"touchmove",Ke)},_offUpEvents:function(){var e=this.el.ownerDocument;B(e,"mouseup",this._onDrop),B(e,"touchend",this._onDrop),B(e,"pointerup",this._onDrop),B(e,"touchcancel",this._onDrop),B(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;if(fe=Y(C),He=Y(C,i.draggable),ae("drop",this,{evt:e}),G=C&&C.parentNode,fe=Y(C),He=Y(C,i.draggable),$.eventCanceled){this._nulling();return}ht=!1,vn=!1,Ut=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Or(this.cloneId),Or(this._dragStartId),this.nativeDraggable&&(B(document,"drop",this),B(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Rt&&A(document.body,"user-select",""),A(C,"transform",""),e&&(Bt&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),F&&F.parentNode&&F.parentNode.removeChild(F),(U===G||Q&&Q.lastPutMode!=="clone")&&W&&W.parentNode&&W.parentNode.removeChild(W),C&&(this.nativeDraggable&&B(C,"dragend",this),$r(C),C.style["will-change"]="",Bt&&!ht&&X(C,Q?Q.options.ghostClass:this.options.ghostClass,!1),X(C,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:G,newIndex:null,newDraggableIndex:null,originalEvent:e}),U!==G?(fe>=0&&(oe({rootEl:G,name:"add",toEl:G,fromEl:U,originalEvent:e}),oe({sortable:this,name:"remove",toEl:G,originalEvent:e}),oe({rootEl:G,name:"sort",toEl:G,fromEl:U,originalEvent:e}),oe({sortable:this,name:"sort",toEl:G,originalEvent:e})),Q&&Q.save()):fe!==dt&&fe>=0&&(oe({sortable:this,name:"update",toEl:G,originalEvent:e}),oe({sortable:this,name:"sort",toEl:G,originalEvent:e})),$.active&&((fe==null||fe===-1)&&(fe=dt,He=zt),oe({sortable:this,name:"end",toEl:G,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){ae("nulling",this),U=C=G=F=Ze=W=En=Ue=Ge=we=Bt=fe=He=dt=zt=ct=Ht=Q=bn=$.dragged=$.ghost=$.clone=$.active=null,In.forEach(function(e){e.checked=!0}),In.length=Tr=Lr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":C&&(this._onDragOver(e),Eh(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,i=this.el.children,r=0,o=i.length,s=this.options;r<o;r++)t=i[r],xe(t,s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||Lh(t));return e},sort:function(e,t){var i={},r=this.el;this.toArray().forEach(function(o,s){var a=r.children[s];xe(a,this.options.draggable,r,!1)&&(i[o]=a)},this),t&&this.captureAnimationState(),e.forEach(function(o){i[o]&&(r.removeChild(i[o]),r.appendChild(i[o]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return xe(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(t===void 0)return i[e];var r=Vt.modifyOption(this,e,t);typeof r<"u"?i[e]=r:i[e]=t,e==="group"&&ks(i)},destroy:function(){ae("destroy",this);var e=this.el;e[ne]=null,B(e,"mousedown",this._onTapStart),B(e,"touchstart",this._onTapStart),B(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(B(e,"dragover",this),B(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ln.splice(Ln.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ue){if(ae("hideClone",this),$.eventCanceled)return;A(W,"display","none"),this.options.removeCloneOnHide&&W.parentNode&&W.parentNode.removeChild(W),Ue=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ue){if(ae("showClone",this),$.eventCanceled)return;C.parentNode==U&&!this.options.group.revertClone?U.insertBefore(W,C):Ze?U.insertBefore(W,Ze):U.appendChild(W),this.options.group.revertClone&&this.animate(C,W),A(W,"display",""),Ue=!1}}};function Eh(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function yn(n,e,t,i,r,o,s,a){var l,c=n[ne],u=c.options.onMove,h;return window.CustomEvent&&!Me&&!jt?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=n,l.dragged=t,l.draggedRect=i,l.related=r||e,l.relatedRect=o||j(e),l.willInsertAfter=a,l.originalEvent=s,n.dispatchEvent(l),u&&(h=u.call(c,l,s)),h}function $r(n){n.draggable=!1}function _h(){Pr=!1}function Sh(n,e,t){var i=j(pt(t.el,0,t.options,!0)),r=10;return e?n.clientX<i.left-r||n.clientY<i.top&&n.clientX<i.right:n.clientY<i.top-r||n.clientY<i.bottom&&n.clientX<i.left}function Ah(n,e,t){var i=j(zr(t.el,t.options.draggable)),r=10;return e?n.clientX>i.right+r||n.clientX<=i.right&&n.clientY>i.bottom&&n.clientX>=i.left:n.clientX>i.right&&n.clientY>i.top||n.clientX<=i.right&&n.clientY>i.bottom+r}function Dh(n,e,t,i,r,o,s,a){var l=i?n.clientY:n.clientX,c=i?t.height:t.width,u=i?t.top:t.left,h=i?t.bottom:t.right,d=!1;if(!s){if(a&&_n<c*r){if(!Ut&&(Ht===1?l>u+c*o/2:l<h-c*o/2)&&(Ut=!0),Ut)d=!0;else if(Ht===1?l<u+_n:l>h-_n)return-Ht}else if(l>u+c*(1-r)/2&&l<h-c*(1-r)/2)return Th(e)}return d=d||s,d&&(l<u+c*o/2||l>h-c*o/2)?l>u+c/2?1:-1:0}function Th(n){return Y(C)<Y(n)?1:-1}function Lh(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,i=0;t--;)i+=e.charCodeAt(t);return i.toString(36)}function Ih(n){In.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var i=e[t];i.checked&&In.push(i)}}function Sn(n){return setTimeout(n,0)}function Or(n){return clearTimeout(n)}Mn&&P(document,"touchmove",function(n){($.active||ht)&&n.cancelable&&n.preventDefault()});$.utils={on:P,off:B,css:A,find:bs,is:function(e,t){return!!xe(e,t,e,!1)},extend:fh,throttle:vs,closest:xe,toggleClass:X,clone:Hr,index:Y,nextTick:Sn,cancelNextTick:Or,detectDirection:xs,getChild:pt};$.get=function(n){return n[ne]};$.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&($.utils=Ae(Ae({},$.utils),i.utils)),Vt.mount(i)})};$.create=function(n,e){return new $(n,e)};$.version=hh;var Z=[],Pt,Rr,Nr=!1,Mr,Fr,$n,Ot;function $h(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var i=t.originalEvent;this.sortable.nativeDraggable?P(document,"dragover",this._handleAutoScroll):this.options.supportPointer?P(document,"pointermove",this._handleFallbackAutoScroll):i.touches?P(document,"touchmove",this._handleFallbackAutoScroll):P(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var i=t.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?B(document,"dragover",this._handleAutoScroll):(B(document,"pointermove",this._handleFallbackAutoScroll),B(document,"touchmove",this._handleFallbackAutoScroll),B(document,"mousemove",this._handleFallbackAutoScroll)),ds(),An(),mh()},nulling:function(){$n=Rr=Pt=Nr=Ot=Mr=Fr=null,Z.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,i){var r=this,o=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=document.elementFromPoint(o,s);if($n=t,i||this.options.forceAutoScrollFallback||jt||Me||Rt){qr(t,this.options,a,i);var l=je(a,!0);Nr&&(!Ot||o!==Mr||s!==Fr)&&(Ot&&ds(),Ot=setInterval(function(){var c=je(document.elementFromPoint(o,s),!0);c!==l&&(l=c,An()),qr(t,r.options,c,i)},10),Mr=o,Fr=s)}else{if(!this.options.bubbleScroll||je(a,!0)===Se()){An();return}qr(t,this.options,je(a,!1),!1)}}},ke(n,{pluginName:"scroll",initializeByDefault:!0})}function An(){Z.forEach(function(n){clearInterval(n.pid)}),Z=[]}function ds(){clearInterval(Ot)}var qr=vs(function(n,e,t,i){if(e.scroll){var r=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,s=e.scrollSensitivity,a=e.scrollSpeed,l=Se(),c=!1,u;Rr!==t&&(Rr=t,An(),Pt=e.scroll,u=e.scrollFn,Pt===!0&&(Pt=je(t,!0)));var h=0,d=Pt;do{var p=d,f=j(p),m=f.top,y=f.bottom,v=f.left,b=f.right,k=f.width,w=f.height,E=void 0,x=void 0,S=p.scrollWidth,D=p.scrollHeight,q=A(p),L=p.scrollLeft,I=p.scrollTop;p===l?(E=k<S&&(q.overflowX==="auto"||q.overflowX==="scroll"||q.overflowX==="visible"),x=w<D&&(q.overflowY==="auto"||q.overflowY==="scroll"||q.overflowY==="visible")):(E=k<S&&(q.overflowX==="auto"||q.overflowX==="scroll"),x=w<D&&(q.overflowY==="auto"||q.overflowY==="scroll"));var H=E&&(Math.abs(b-r)<=s&&L+k<S)-(Math.abs(v-r)<=s&&!!L),N=x&&(Math.abs(y-o)<=s&&I+w<D)-(Math.abs(m-o)<=s&&!!I);if(!Z[h])for(var ee=0;ee<=h;ee++)Z[ee]||(Z[ee]={});(Z[h].vx!=H||Z[h].vy!=N||Z[h].el!==p)&&(Z[h].el=p,Z[h].vx=H,Z[h].vy=N,clearInterval(Z[h].pid),(H!=0||N!=0)&&(c=!0,Z[h].pid=setInterval(function(){i&&this.layer===0&&$.active._onTouchMove($n);var ge=Z[this.layer].vy?Z[this.layer].vy*a:0,V=Z[this.layer].vx?Z[this.layer].vx*a:0;typeof u=="function"&&u.call($.dragged.parentNode[ne],V,ge,n,$n,Z[this.layer].el)!=="continue"||ws(Z[this.layer].el,V,ge)}.bind({layer:h}),24))),h++}while(e.bubbleScroll&&d!==l&&(d=je(d,!1)));Nr=c}},30),_s=function(e){var t=e.originalEvent,i=e.putSortable,r=e.dragEl,o=e.activeSortable,s=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var c=i||o;a();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,h=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(h)&&(s("spill"),this.onSpill({dragEl:r,putSortable:i}))}};function Ur(){}Ur.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var r=pt(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:_s};ke(Ur,{pluginName:"revertOnSpill"});function jr(){}jr.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable,r=i||this.sortable;r.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),r.animateAll()},drop:_s};ke(jr,{pluginName:"removeOnSpill"});var M=[],pe=[],$t,ye,Mt=!1,le=!1,ut=!1,z,Ft,xn;function Ss(){function n(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?P(document,"pointerup",this._deselectMultiDrag):(P(document,"mouseup",this._deselectMultiDrag),P(document,"touchend",this._deselectMultiDrag))),P(document,"keydown",this._checkKeyDown),P(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(r,o){var s="";M.length&&ye===e?M.forEach(function(a,l){s+=(l?", ":"")+a.textContent}):s=o.textContent,r.setData("Text",s)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var i=t.dragEl;z=i},delayEnded:function(){this.isMultiDrag=~M.indexOf(z)},setupClone:function(t){var i=t.sortable,r=t.cancel;if(this.isMultiDrag){for(var o=0;o<M.length;o++)pe.push(Hr(M[o])),pe[o].sortableIndex=M[o].sortableIndex,pe[o].draggable=!1,pe[o].style["will-change"]="",X(pe[o],this.options.selectedClass,!1),M[o]===z&&X(pe[o],this.options.chosenClass,!1);i._hideClone(),r()}},clone:function(t){var i=t.sortable,r=t.rootEl,o=t.dispatchSortableEvent,s=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||M.length&&ye===i&&(ps(!0,r),o("clone"),s()))},showClone:function(t){var i=t.cloneNowShown,r=t.rootEl,o=t.cancel;this.isMultiDrag&&(ps(!1,r),pe.forEach(function(s){A(s,"display","")}),i(),xn=!1,o())},hideClone:function(t){var i=this,r=t.sortable,o=t.cloneNowHidden,s=t.cancel;this.isMultiDrag&&(pe.forEach(function(a){A(a,"display","none"),i.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),o(),xn=!0,s())},dragStartGlobal:function(t){var i=t.sortable;!this.isMultiDrag&&ye&&ye.multiDrag._deselectMultiDrag(),M.forEach(function(r){r.sortableIndex=Y(r)}),M=M.sort(function(r,o){return r.sortableIndex-o.sortableIndex}),ut=!0},dragStarted:function(t){var i=this,r=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(r.captureAnimationState(),this.options.animation)){M.forEach(function(s){s!==z&&A(s,"position","absolute")});var o=j(z,!1,!0,!0);M.forEach(function(s){s!==z&&ls(s,o)}),le=!0,Mt=!0}r.animateAll(function(){le=!1,Mt=!1,i.options.animation&&M.forEach(function(s){Ar(s)}),i.options.sort&&kn()})}},dragOver:function(t){var i=t.target,r=t.completed,o=t.cancel;le&&~M.indexOf(i)&&(r(!1),o())},revert:function(t){var i=t.fromSortable,r=t.rootEl,o=t.sortable,s=t.dragRect;M.length>1&&(M.forEach(function(a){o.addAnimationState({target:a,rect:le?j(a):s}),Ar(a),a.fromRect=s,i.removeAnimationState(a)}),le=!1,Mh(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(t){var i=t.sortable,r=t.isOwner,o=t.insertion,s=t.activeSortable,a=t.parentEl,l=t.putSortable,c=this.options;if(o){if(r&&s._hideClone(),Mt=!1,c.animation&&M.length>1&&(le||!r&&!s.options.sort&&!l)){var u=j(z,!1,!0,!0);M.forEach(function(d){d!==z&&(ls(d,u),a.appendChild(d))}),le=!0}if(!r)if(le||kn(),M.length>1){var h=xn;s._showClone(i),s.options.animation&&!xn&&h&&pe.forEach(function(d){s.addAnimationState({target:d,rect:Ft}),d.fromRect=Ft,d.thisAnimationDuration=null})}else s._showClone(i)}},dragOverAnimationCapture:function(t){var i=t.dragRect,r=t.isOwner,o=t.activeSortable;if(M.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!r&&o.multiDrag.isMultiDrag){Ft=ke({},i);var s=Xe(z,!0);Ft.top-=s.f,Ft.left-=s.e}},dragOverAnimationComplete:function(){le&&(le=!1,kn())},drop:function(t){var i=t.originalEvent,r=t.rootEl,o=t.parentEl,s=t.sortable,a=t.dispatchSortableEvent,l=t.oldIndex,c=t.putSortable,u=c||this.sortable;if(i){var h=this.options,d=o.children;if(!ut)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),X(z,h.selectedClass,!~M.indexOf(z)),~M.indexOf(z))M.splice(M.indexOf(z),1),$t=null,qt({sortable:s,rootEl:r,name:"deselect",targetEl:z,originalEvent:i});else{if(M.push(z),qt({sortable:s,rootEl:r,name:"select",targetEl:z,originalEvent:i}),i.shiftKey&&$t&&s.el.contains($t)){var p=Y($t),f=Y(z);if(~p&&~f&&p!==f){var m,y;for(f>p?(y=p,m=f):(y=f,m=p+1);y<m;y++)~M.indexOf(d[y])||(X(d[y],h.selectedClass,!0),M.push(d[y]),qt({sortable:s,rootEl:r,name:"select",targetEl:d[y],originalEvent:i}))}}else $t=z;ye=u}if(ut&&this.isMultiDrag){if(le=!1,(o[ne].options.sort||o!==r)&&M.length>1){var v=j(z),b=Y(z,":not(."+this.options.selectedClass+")");if(!Mt&&h.animation&&(z.thisAnimationDuration=null),u.captureAnimationState(),!Mt&&(h.animation&&(z.fromRect=v,M.forEach(function(w){if(w.thisAnimationDuration=null,w!==z){var E=le?j(w):v;w.fromRect=E,u.addAnimationState({target:w,rect:E})}})),kn(),M.forEach(function(w){d[b]?o.insertBefore(w,d[b]):o.appendChild(w),b++}),l===Y(z))){var k=!1;M.forEach(function(w){if(w.sortableIndex!==Y(w)){k=!0;return}}),k&&a("update")}M.forEach(function(w){Ar(w)}),u.animateAll()}ye=u}(r===o||c&&c.lastPutMode!=="clone")&&pe.forEach(function(w){w.parentNode&&w.parentNode.removeChild(w)})}},nullingGlobal:function(){this.isMultiDrag=ut=!1,pe.length=0},destroyGlobal:function(){this._deselectMultiDrag(),B(document,"pointerup",this._deselectMultiDrag),B(document,"mouseup",this._deselectMultiDrag),B(document,"touchend",this._deselectMultiDrag),B(document,"keydown",this._checkKeyDown),B(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof ut<"u"&&ut)&&ye===this.sortable&&!(t&&xe(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;M.length;){var i=M[0];X(i,this.options.selectedClass,!1),M.shift(),qt({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},ke(n,{pluginName:"multiDrag",utils:{select:function(t){var i=t.parentNode[ne];!i||!i.options.multiDrag||~M.indexOf(t)||(ye&&ye!==i&&(ye.multiDrag._deselectMultiDrag(),ye=i),X(t,i.options.selectedClass,!0),M.push(t))},deselect:function(t){var i=t.parentNode[ne],r=M.indexOf(t);!i||!i.options.multiDrag||!~r||(X(t,i.options.selectedClass,!1),M.splice(r,1))}},eventProperties:function(){var t=this,i=[],r=[];return M.forEach(function(o){i.push({multiDragElement:o,index:o.sortableIndex});var s;le&&o!==z?s=-1:le?s=Y(o,":not(."+t.options.selectedClass+")"):s=Y(o),r.push({multiDragElement:o,index:s})}),{items:sh(M),clones:[].concat(pe),oldIndicies:i,newIndicies:r}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function Mh(n,e){M.forEach(function(t,i){var r=e.children[t.sortableIndex+(n?Number(i):0)];r?e.insertBefore(t,r):e.appendChild(t)})}function ps(n,e){pe.forEach(function(t,i){var r=e.children[t.sortableIndex+(n?Number(i):0)];r?e.insertBefore(t,r):e.appendChild(t)})}function kn(){M.forEach(function(n){n!==z&&n.parentNode&&n.parentNode.removeChild(n)})}$.mount(new $h);$.mount(jr,Ur);var Ye=$;var As={name(n,e){let t=n.getAttribute("data-name").trim().toLowerCase(),i=e.getAttribute("data-name").trim().toLowerCase();return t.localeCompare(i)},created(n,e){let t=Number(n.getAttribute("data-created"));return Number(e.getAttribute("data-created"))-t},updated(n,e){let t=Number(n.getAttribute("data-updated"));return Number(e.getAttribute("data-updated"))-t},chaptersFirst(n,e){let t=n.getAttribute("data-type"),i=e.getAttribute("data-type");return t===i?0:t==="chapter"?-1:1},chaptersLast(n,e){let t=n.getAttribute("data-type"),i=e.getAttribute("data-type");return t===i?0:t==="chapter"?1:-1}},Ds={up:{active(n,e){return!(n.previousElementSibling===null&&!e)},run(n,e){(n.previousElementSibling||e).insertAdjacentElement("beforebegin",n)}},down:{active(n,e){return!(n.nextElementSibling===null&&!e)},run(n,e){(n.nextElementSibling||e).insertAdjacentElement("afterend",n)}},next_book:{active(n,e,t){return t.nextElementSibling!==null},run(n,e,t){t.nextElementSibling.querySelector("ul").prepend(n)}},prev_book:{active(n,e,t){return t.previousElementSibling!==null},run(n,e,t){t.previousElementSibling.querySelector("ul").appendChild(n)}},next_chapter:{active(n,e){return n.dataset.type==="page"&&this.getNextChapter(n,e)},run(n,e){this.getNextChapter(n,e).querySelector("ul").prepend(n)},getNextChapter(n,e){let t=e||n,i=Array.from(t.parentElement.children),r=i.indexOf(t);return i.slice(r+1).find(o=>o.dataset.type==="chapter")}},prev_chapter:{active(n,e){return n.dataset.type==="page"&&this.getPrevChapter(n,e)},run(n,e){this.getPrevChapter(n,e).querySelector("ul").append(n)},getPrevChapter(n,e){let t=e||n,i=Array.from(t.parentElement.children),r=i.indexOf(t);return i.slice(0,r).reverse().find(o=>o.dataset.type==="chapter")}},book_end:{active(n,e){return e||e===null&&n.nextElementSibling},run(n,e,t){t.querySelector("ul").append(n)}},book_start:{active(n,e){return e||e===null&&n.previousElementSibling},run(n,e,t){t.querySelector("ul").prepend(n)}},before_chapter:{active(n,e){return e},run(n,e){e.insertAdjacentElement("beforebegin",n)}},after_chapter:{active(n,e){return e},run(n,e){e.insertAdjacentElement("afterend",n)}}},Fn=class extends g{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,Ye.mount(new Ss);let e=this.container.querySelector(".sort-box");this.setupBookSortable(e),this.setupSortPresets(),this.setupMoveActions(),window.$events.listen("entity-select-change",this.bookSelect.bind(this))}setupMoveActions(){this.container.addEventListener("click",e=>{if(e.target.matches("[data-move]")){let t=e.target.getAttribute("data-move"),i=e.target.closest("[data-id]");this.runSortAction(i,t)}}),this.updateMoveActionStateForAll()}setupSortPresets(){let e="",t=!1,i=["name","created","updated"];this.sortContainer.addEventListener("click",r=>{let o=r.target.closest(".sort-box-options [data-sort]");if(!o)return;r.preventDefault();let s=o.closest(".sort-box").querySelectorAll("ul"),a=o.getAttribute("data-sort");t=e===a?!t:!1;let l=As[a];t&&i.includes(a)&&(l=function(u,h){return 0-As[a](u,h)});for(let c of s)Array.from(c.children).filter(h=>h.matches("li")).sort(l).forEach(h=>{c.appendChild(h)});e=a,this.updateMapInput()})}bookSelect(e){if(this.container.querySelector(`[data-type="book"][data-id="${e.id}"]`)!==null)return;let i=`${e.link}/sort-item`;window.$http.get(i).then(r=>{let o=_e(r.data);this.sortContainer.append(o),this.setupBookSortable(o),this.updateMoveActionStateForAll(),o.querySelector("summary").focus()})}setupBookSortable(e){let t=Array.from(e.querySelectorAll(".sort-list, .sortable-page-sublist")),i={name:"book",pull:["book","chapter"],put:["book","chapter"]},r={name:"chapter",pull:["book","chapter"],put(o,s,a){return a.getAttribute("data-type")==="page"}};for(let o of t)Ye.create(o,{group:o.classList.contains("sort-list")?i:r,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:()=>{this.ensureNoNestedChapters(),this.updateMapInput(),this.updateMoveActionStateForAll()},dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"Control",selectedClass:"sortable-selected"})}ensureNoNestedChapters(){let e=this.container.querySelectorAll('[data-type="chapter"] [data-type="chapter"]');for(let t of e)t.parentElement.closest('[data-type="chapter"]').insertAdjacentElement("afterend",t)}updateMapInput(){let e=this.buildEntityMap();this.input.value=JSON.stringify(e)}buildEntityMap(){let e=[],t=this.container.querySelectorAll(".sort-list");for(let i of t){let r=i.closest('[data-type="book"]').getAttribute("data-id"),o=Array.from(i.children).filter(s=>s.matches('[data-type="page"], [data-type="chapter"]'));for(let s=0;s<o.length;s++)this.addBookChildToMap(o[s],s,r,e)}return e}addBookChildToMap(e,t,i,r){let o=e.getAttribute("data-type"),s=!1,a=e.getAttribute("data-id");r.push({id:a,sort:t,parentChapter:s,type:o,book:i});let l=e.querySelectorAll('[data-type="page"]');for(let c=0;c<l.length;c++)r.push({id:l[c].getAttribute("data-id"),sort:c,parentChapter:a,type:"page",book:i})}runSortAction(e,t){let i=e.parentElement.closest("li[data-id]"),r=e.parentElement.closest('[data-type="book"]');Ds[t].run(e,i,r),this.updateMapInput(),this.updateMoveActionStateForAll(),e.scrollIntoView({behavior:"smooth",block:"nearest"}),e.focus()}updateMoveActionState(e){let t=e.parentElement.closest("li[data-id]"),i=e.parentElement.closest('[data-type="book"]');for(let[r,o]of Object.entries(Ds)){let s=e.querySelector(`[data-move="${r}"]`);s.disabled=!o.active(e,t,i)}}updateMoveActionStateForAll(){let e=this.container.querySelectorAll('[data-type="chapter"],[data-type="page"]');for(let t of e)this.updateMoveActionState(t)}};var qn=new WeakMap;function Wt(n,e,t=400,i=null){let r=Object.keys(e);for(let s of r)n.style[s]=e[s][0];let o=()=>{for(let s of r)n.style[s]=null;n.style.transition=null,n.removeEventListener("transitionend",o),qn.delete(n),i&&i()};setTimeout(()=>{n.style.transition=`all ease-in-out ${t}ms`;for(let s of r)n.style[s]=e[s][1];n.addEventListener("transitionend",o),qn.set(n,o)},15)}function Gt(n){qn.has(n)&&qn.get(n)()}function Ts(n,e=400,t=null){Gt(n),n.style.display="block",Wt(n,{opacity:["0","1"]},e,()=>{t&&t()})}function Ls(n,e=400,t=null){Gt(n),Wt(n,{opacity:["1","0"]},e,()=>{n.style.display="none",t&&t()})}function ft(n,e=400){Gt(n);let t=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:[`${t}px`,"0px"],overflow:["hidden","hidden"],paddingTop:[r,"0px"],paddingBottom:[o,"0px"]};Wt(n,s,e,()=>{n.style.display="none"})}function mt(n,e=400){Gt(n),n.style.display="block";let t=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:["0px",`${t}px`],overflow:["hidden","hidden"],paddingTop:["0px",r],paddingBottom:["0px",o]};Wt(n,s,e)}function Is(n,e=400){let t=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom");return()=>{Gt(n);let s=n.getBoundingClientRect().height,a=getComputedStyle(n),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),u={height:[`${t}px`,`${s}px`],overflow:["hidden","hidden"],paddingTop:[r,l],paddingBottom:[o,c]};Wt(n,u,e)}}var Bn=class extends g{setup(){this.list=this.$refs.list,this.toggle=this.$refs.toggle,this.isOpen=this.toggle.classList.contains("open"),this.toggle.addEventListener("click",this.click.bind(this))}open(){this.toggle.classList.add("open"),this.toggle.setAttribute("aria-expanded","true"),mt(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),ft(this.list,180),this.isOpen=!1}click(e){e.preventDefault(),this.isOpen?this.close():this.open()}};var Pn=class extends g{constructor(){super(...arguments);se(this,"editor",null);se(this,"saveCallback",null);se(this,"cancelCallback",null);se(this,"history",{});se(this,"historyKey","code_history")}setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageButtons=this.$manyRefs.languageButton,this.languageOptionsContainer=this.$refs.languageOptionsContainer,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.favourites=new Set(this.$opts.favourites.split(",")),this.setupListeners(),this.setupFavourites()}setupListeners(){this.container.addEventListener("keydown",t=>{t.ctrlKey&&t.key==="Enter"&&this.save()}),O(this.languageButtons,t=>{let i=t.target.dataset.lang;this.languageInput.value=i,this.languageInputChange(i)}),st(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),O(this.saveButton,()=>this.save()),K(this.historyList,"button","click",(t,i)=>{t.preventDefault();let r=i.dataset.time;this.editor&&this.editor.setContent(this.history[r])})}setupFavourites(){for(let t of this.languageButtons)this.setupFavouritesForButton(t);this.sortLanguageList()}setupFavouritesForButton(t){let i=t.dataset.lang,r=this.favourites.has(i);t.setAttribute("data-favourite",r?"true":"false"),K(t.parentElement,".lang-option-favorite-toggle","click",()=>{r=!r,r?this.favourites.add(i):this.favourites.delete(i),t.setAttribute("data-favourite",r?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:i,active:r}),this.sortLanguageList(),r&&t.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let t=this.languageButtons.sort((i,r)=>{let o=i.dataset.favourite==="true",s=r.dataset.favourite==="true";return o&&!s?-1:s&&!o||i.dataset.lang>r.dataset.lang?1:-1}).map(i=>i.parentElement);for(let i of t)this.languageOptionsContainer.append(i)}save(){this.saveCallback&&this.saveCallback(this.editor.getContent(),this.languageInput.value),this.hide()}async open(t,i,r,o){this.languageInput.value=i,this.saveCallback=r,this.cancelCallback=o,await this.show(),this.languageInputChange(i),this.editor.setContent(t)}async show(){let t=await window.importVersioned("code");this.editor||(this.editor=t.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.getPopup().show(()=>{this.editor.focus()},()=>{this.addHistory(),this.cancelCallback&&this.cancelCallback()})}hide(){this.getPopup().hide(),this.addHistory()}getPopup(){return window.$components.firstOnElement(this.popup,"popup")}async updateEditorMode(t){this.editor.setMode(t,this.editor.getContent())}languageInputChange(t){this.updateEditorMode(t);let i=t.toLowerCase();for(let r of this.languageButtons){let o=r.dataset.lang.toLowerCase().trim(),s=i===o;r.classList.toggle("active",s),s&&r.scrollIntoView({block:"center",behavior:"smooth"})}}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let t=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",t.length===0),this.historyList.innerHTML=t.map(i=>{let r=new Date(parseInt(i,10)).toLocaleTimeString();return`<li><button type="button" data-time="${i}" class="text-item">${r}</button></li>`}).join("")}addHistory(){if(!this.editor)return;let t=this.editor.getContent();if(!t)return;let i=Object.keys(this.history).pop();if(this.history[i]===t)return;this.history[String(Date.now())]=t;let r=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,r)}};var On=class extends g{setup(){let e=this.$el;e.querySelectorAll("pre").length>0&&window.importVersioned("code").then(i=>{i.highlightWithin(e)})}};var Rn=class extends g{async setup(){let{mode:e}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,e)}};var Nn=class extends g{setup(){this.container=this.$el,this.trigger=this.$refs.trigger,this.content=this.$refs.content,this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.container.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),mt(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),ft(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var zn=class extends g{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,O(this.confirmButton,()=>{this.sendResult(!0),this.getPopup().hide()})}show(){return this.getPopup().show(null,()=>{this.sendResult(!1)}),new Promise(e=>{this.res=e})}getPopup(){return window.$components.firstOnElement(this.container,"popup")}sendResult(e){this.res&&(this.res(e),this.res=null)}};var Hn=class extends g{setup(){this.container=this.$el,this.checkbox=this.container.querySelector("input[type=checkbox]"),this.display=this.container.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.container.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(e){(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let e=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",e)}};var Un=class extends g{setup(){this.container=this.$el,this.dealtWith=!1,this.container.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(this.container.querySelector("pre")&&window.importVersioned("code").then(e=>{e.highlightWithin(this.container)}),this.dealtWith=!0)}};var jn=class extends g{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.hide=this.hide.bind(this),this.setupListeners()}show(e=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true");let t=this.menu.getBoundingClientRect(),i=0,r=this.toggle.getBoundingClientRect().height,o=t.bottom>window.innerHeight;this.moveMenu&&(this.body.appendChild(this.menu),this.menu.style.position="fixed",this.menu.style.width=`${t.width}px`,this.menu.style.left=`${t.left}px`,o?i=window.innerHeight-t.top-r/2:i=t.top),o?(this.menu.style.top="initial",this.menu.style.bottom=`${i}px`):(this.menu.style.top=`${i}px`,this.menu.style.bottom="initial"),this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",l=>{this.menu.contains(l.target)||this.hide()});let s=this.menu.querySelector("input");s!==null&&s.focus(),this.showing=!0;let a=new Event("show");this.container.dispatchEvent(a),e&&e.stopPropagation()}hideAll(){for(let e of window.$components.get("dropdown"))e.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.menu.style.top="",this.menu.style.bottom="",this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.width="",this.menu.style.left="",this.container.appendChild(this.menu)),this.showing=!1}setupListeners(){let e=new ze(this.container,t=>{this.hide(),this.toggle.focus(),this.bubbleEscapes||t.stopPropagation()},t=>{t.target.nodeName==="INPUT"&&(t.preventDefault(),t.stopPropagation()),this.hide()});this.moveMenu&&e.shareHandlingToEl(this.menu),this.container.addEventListener("click",t=>{Array.from(this.menu.querySelectorAll("a")).includes(t.target)&&this.hide()}),O(this.toggle,t=>{t.stopPropagation(),t.preventDefault(),this.show(t),t instanceof KeyboardEvent&&e.focusNext()})}};var Vn=class extends g{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=Ne(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let e=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(e):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(e))}runAjaxSearch(e){this.loadList(e)}runLocalSearch(e){let t=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let i of t){let r=!e||i.textContent.toLowerCase().includes(e);i.style.display=r?"flex":"none",i.classList.toggle("hidden",!r)}}async loadList(e=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let t=await window.$http.get(this.getAjaxUrl(e)),i=Is(this.listContainerElem,80);this.listContainerElem.innerHTML=t.data,i()}catch(t){console.error(t)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(e=null){if(!e)return this.url;let t=this.url.includes("?")?"&":"?";return`${this.url}${t}search=${encodeURIComponent(e)}`}toggleLoading(e=!1){this.loadingElem.style.display=e?"block":"none"}};var Fe=class{constructor(e){this.data=e}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let e=this.data.getData("text/rtf");return e&&e.includes("\\trowd")}getImages(){let{types:e}=this.data,t=[];for(let r of e)if(r.includes("image")){let o=this.data.getData(r);t.push(o.getAsFile())}let i=this.getFiles().filter(r=>r.type.includes("image"));return t.push(...i),t}getFiles(){let{files:e}=this.data;return[...e]}};async function Vr(n){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(n);return}let e=document.createElement("textarea");e.style="position: absolute; left: -1000px; top: -1000px;",e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}var Wn=class extends g{setup(){this.container=this.$el,this.statusArea=this.$refs.statusArea,this.dropTarget=this.$refs.dropTarget,this.selectButtons=this.$manyRefs.selectButton||[],this.isActive=!0,this.url=this.$opts.url,this.method=(this.$opts.method||"post").toUpperCase(),this.successMessage=this.$opts.successMessage,this.errorMessage=this.$opts.errorMessage,this.uploadLimitMb=Number(this.$opts.uploadLimit),this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.zoneText=this.$opts.zoneText,this.fileAcceptTypes=this.$opts.fileAccept,this.allowMultiple=this.$opts.allowMultiple==="true",this.setupListeners()}toggleActive(e){this.isActive=e}setupListeners(){O(this.selectButtons,this.manualSelectHandler.bind(this)),this.setupDropTargetHandlers()}setupDropTargetHandlers(){let e=0,t=()=>{this.hideOverlay(),e=0};this.dropTarget.addEventListener("dragenter",i=>{i.preventDefault(),e+=1,e===1&&this.isActive&&this.showOverlay()}),this.dropTarget.addEventListener("dragover",i=>{i.preventDefault()}),this.dropTarget.addEventListener("dragend",t),this.dropTarget.addEventListener("dragleave",()=>{e-=1,e===0&&t()}),this.dropTarget.addEventListener("drop",i=>{if(i.preventDefault(),t(),!this.isActive)return;let o=new Fe(i.dataTransfer).getFiles();for(let s of o)this.createUploadFromFile(s)})}manualSelectHandler(){let e=Ee("input",{type:"file",style:"left: -400px; visibility: hidden; position: fixed;",accept:this.fileAcceptTypes,multiple:this.allowMultiple?"":null});this.container.append(e),e.click(),e.addEventListener("change",()=>{for(let t of e.files)this.createUploadFromFile(t);e.remove()})}showOverlay(){if(!this.dropTarget.querySelector(".dropzone-overlay")){let t=Ee("div",{class:"dropzone-overlay"},[this.zoneText]);this.dropTarget.append(t)}}hideOverlay(){let e=this.dropTarget.querySelector(".dropzone-overlay");e&&e.remove()}createUploadFromFile(e){let{dom:t,status:i,progress:r,dismiss:o}=this.createDomForFile(e);this.statusArea.append(t);let s=this,a={file:e,dom:t,updateProgress(l){r.textContent=`${l}%`,r.style.width=`${l}%`},markError(l){i.setAttribute("data-status","error"),i.textContent=l,Tt(t),this.updateProgress(100)},markSuccess(l){i.setAttribute("data-status","success"),i.textContent=l,Tt(t),setTimeout(o,2400),s.$emit("upload-success",{name:e.name})}};return e.size>this.uploadLimitMb*1e6?(a.markError(this.uploadLimitMessage),a):(this.startXhrForUpload(a),a)}startXhrForUpload(e){let t=new FormData;t.append("file",e.file,e.file.name),this.method!=="POST"&&t.append("_method",this.method);let i=this,r=window.$http.createXMLHttpRequest("POST",this.url,{error(){e.markError(i.errorMessage)},readystatechange(){if(this.readyState===XMLHttpRequest.DONE&&this.status===200)e.markSuccess(i.successMessage);else if(this.readyState===XMLHttpRequest.DONE&&this.status>=400){let o=this.responseText,s=o.startsWith("{")?JSON.parse(o):{message:o},a=s?.message||s?.error||o;e.markError(a)}}});r.upload.addEventListener("progress",o=>{let s=Math.min(Math.ceil(o.loaded/o.total*100),100);e.updateProgress(s)}),r.setRequestHeader("Accept","application/json"),r.send(t)}createDomForFile(e){let t=Ee("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"}),i=Ee("div",{class:"dropzone-file-item-status"},[]),r=Ee("div",{class:"dropzone-file-item-progress"}),o=Ee("div",{class:"dropzone-file-item-image-wrap"},[t]),s=Ee("div",{class:"dropzone-file-item"},[o,Ee("div",{class:"dropzone-file-item-text-wrap"},[Ee("div",{class:"dropzone-file-item-label"},[e.name]),at(),i]),r]);e.type.startsWith("image/")&&(t.src=URL.createObjectURL(e));let a=()=>{s.classList.add("dismiss"),s.addEventListener("animationend",()=>{s.remove()})};return s.addEventListener("click",a),{dom:s,progress:r,status:i,dismiss:a}}};var Gn=class extends g{setup(){this.container=this.$el,this.buttons=this.$manyRefs.tabButton,this.contentElements=this.$manyRefs.tabContent,this.toggleButton=this.$refs.toggle,this.setupListeners(),this.setActiveTab(this.contentElements[0].dataset.tabContent)}setupListeners(){this.toggleButton.addEventListener("click",()=>this.toggle()),this.container.addEventListener("click",e=>{let t=e.target.closest("button");if(this.buttons.includes(t)){let i=t.dataset.tab;this.setActiveTab(i,!0)}})}toggle(){this.container.classList.toggle("open");let e=this.container.classList.contains("open")?"true":"false";this.toggleButton.setAttribute("aria-expanded",e)}setActiveTab(e,t=!1){for(let i of this.buttons)i.classList.remove("active"),i.dataset.tab===e&&i.classList.add("active");for(let i of this.contentElements)i.style.display="none",i.dataset.tabContent===e&&(i.style.display="block");t&&!this.container.classList.contains("open")&&this.toggle()}};var Kn=class extends g{setup(){this.container=this.$el,this.entityType=this.$opts.entityType,this.everyoneInheritToggle=this.$refs.everyoneInherit,this.roleSelect=this.$refs.roleSelect,this.roleContainer=this.$refs.roleContainer,this.setupListeners()}setupListeners(){this.everyoneInheritToggle.addEventListener("change",e=>{let t=e.target.checked,i=document.querySelectorAll('input[name^="permissions[0]["]');for(let r of i)r.disabled=t,r.checked=!1}),this.container.addEventListener("click",e=>{let t=e.target.closest("button");t&&t.dataset.roleId&&this.removeRowOnButtonClick(t)}),this.roleSelect.addEventListener("change",()=>{let e=this.roleSelect.value;e&&this.addRoleRow(e)})}async addRoleRow(e){this.roleSelect.disabled=!0;let t=this.roleSelect.querySelector(`option[value="${e}"]`);t&&t.remove();let i=await window.$http.get(`/permissions/form-row/${this.entityType}/${e}`),r=_e(i.data);this.roleContainer.append(r),this.roleSelect.disabled=!1}removeRowOnButtonClick(e){let t=e.closest(".item-list-row"),{roleId:i}=e.dataset,{roleName:r}=e.dataset,o=document.createElement("option");o.value=i,o.textContent=r,this.roleSelect.append(o),t.remove()}};var Zn=class extends g{setup(){this.entityId=this.$opts.entityId,this.entityType=this.$opts.entityType,this.contentView=this.$refs.contentView,this.searchView=this.$refs.searchView,this.searchResults=this.$refs.searchResults,this.searchInput=this.$refs.searchInput,this.searchForm=this.$refs.searchForm,this.clearButton=this.$refs.clearButton,this.loadingBlock=this.$refs.loadingBlock,this.setupListeners()}setupListeners(){this.searchInput.addEventListener("change",this.runSearch.bind(this)),this.searchForm.addEventListener("submit",e=>{e.preventDefault(),this.runSearch()}),O(this.clearButton,this.clearSearch.bind(this))}runSearch(){let e=this.searchInput.value.trim();if(e.length===0){this.clearSearch();return}this.searchView.classList.remove("hidden"),this.contentView.classList.add("hidden"),this.loadingBlock.classList.remove("hidden");let t=window.baseUrl(`/search/${this.entityType}/${this.entityId}`);window.$http.get(t,{term:e}).then(i=>{this.searchResults.innerHTML=i.data}).catch(console.error).then(()=>{this.loadingBlock.classList.add("hidden")})}clearSearch(){this.searchView.classList.add("hidden"),this.contentView.classList.remove("hidden"),this.loadingBlock.classList.add("hidden"),this.searchInput.value=""}};var Xn=class extends g{setup(){this.elem=this.$el,this.entityTypes=this.$opts.entityTypes||"page,book,chapter",this.entityPermission=this.$opts.entityPermission||"view",this.input=this.$refs.input,this.searchInput=this.$refs.search,this.loading=this.$refs.loading,this.resultsContainer=this.$refs.results,this.search="",this.lastClick=0,this.selectedItemData=null,this.setupListeners(),this.showLoading(),this.initialLoad()}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let e=0;this.searchInput.addEventListener("input",()=>{e=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-e<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",t=>{t.keyCode===13&&t.preventDefault()}),K(this.$el,"[data-entity-type]","keydown",t=>{if(t.ctrlKey&&t.code==="Enter"){let i=this.$el.closest("form");if(i){i.submit(),t.preventDefault();return}}t.code==="ArrowDown"&&this.focusAdjacent(!0),t.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",t=>{t.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(e=!0){let t=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),i=t.indexOf(document.activeElement),r=t[i+(e?1:-1)]||t[0];r&&r.focus()}reset(){this.searchInput.value="",this.showLoading(),this.initialLoad()}focusSearch(){this.searchInput.focus()}showLoading(){this.loading.style.display="block",this.resultsContainer.style.display="none"}hideLoading(){this.loading.style.display="none",this.resultsContainer.style.display="block"}initialLoad(){window.$http.get(this.searchUrl()).then(e=>{this.resultsContainer.innerHTML=e.data,this.hideLoading()})}searchUrl(){return`/search/entity-selector?types=${encodeURIComponent(this.entityTypes)}&permission=${encodeURIComponent(this.entityPermission)}`}searchEntities(e){this.input.value="";let t=`${this.searchUrl()}&term=${encodeURIComponent(e)}`;window.$http.get(t).then(i=>{this.resultsContainer.innerHTML=i.data,this.hideLoading()})}isDoubleClick(){let e=Date.now(),t=e-this.lastClick<300;return this.lastClick=e,t}onClick(e){let t=e.target.closest("[data-entity-type]");t&&(e.preventDefault(),e.stopPropagation(),this.selectItem(t))}selectItem(e){let t=this.isDoubleClick(),i=e.getAttribute("data-entity-type"),r=e.getAttribute("data-entity-id"),o=!e.classList.contains("selected")||t;this.unselectAll(),this.input.value=o?`${i}:${r}`:"";let s=e.getAttribute("href"),a=e.querySelector(".entity-list-item-name").textContent,l={id:Number(r),name:a,link:s};o?(e.classList.add("selected"),this.selectedItemData=l):window.$events.emit("entity-select-change",null),!(!t&&!o)&&(t&&this.confirmSelection(l),o&&window.$events.emit("entity-select-change",l))}confirmSelection(e){window.$events.emit("entity-select-confirm",e)}unselectAll(){let e=this.elem.querySelectorAll(".selected");for(let t of e)t.classList.remove("selected","primary-background");this.selectedItemData=null}};var Yn=class extends g{setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.callback=null,this.selection=null,this.selectButton.addEventListener("click",this.onSelectButtonClick.bind(this)),window.$events.listen("entity-select-change",this.onSelectionChange.bind(this)),window.$events.listen("entity-select-confirm",this.handleConfirmedSelection.bind(this))}show(e){this.callback=e,this.getPopup().show(),this.getSelector().focusSearch()}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.container,"popup")}getSelector(){return window.$components.firstOnElement(this.selectorEl,"entity-selector")}onSelectButtonClick(){this.handleConfirmedSelection(this.selection)}onSelectionChange(e){this.selection=e,e===null?this.selectButton.setAttribute("disabled","true"):this.selectButton.removeAttribute("disabled")}handleConfirmedSelection(e){this.hide(),this.getSelector().reset(),this.callback&&e&&this.callback(e)}};var Jn=class extends g{setup(){this.container=this.$el,this.name=this.$opts.name,O(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var Qn=class extends g{setup(){this.targetSelector=this.$opts.targetSelector,this.isOpen=this.$opts.isOpen==="true",this.updateEndpoint=this.$opts.updateEndpoint,this.$el.addEventListener("click",this.click.bind(this))}open(e){mt(e,200)}close(e){ft(e,200)}click(e){e.preventDefault();let t=document.querySelectorAll(this.targetSelector);for(let i of t)(this.isOpen?this.close:this.open)(i);this.isOpen=!this.isOpen,this.updateSystemAjax(this.isOpen)}updateSystemAjax(e){window.$http.patch(this.updateEndpoint,{expand:e?"true":"false"})}};var ei=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.suggestions=this.$refs.suggestions,this.suggestionResultsWrap=this.$refs.suggestionResults,this.loadingWrap=this.$refs.loading,this.button=this.$refs.button,this.setupListeners()}setupListeners(){let e=Ne(this.updateSuggestions.bind(this),200,!1);this.input.addEventListener("input",()=>{let{value:t}=this.input;t.length>0?(this.loadingWrap.style.display="block",this.suggestionResultsWrap.style.opacity="0.5",e(t)):this.hideSuggestions()}),this.input.addEventListener("dblclick",()=>{this.input.setAttribute("autocomplete","on"),this.button.focus(),this.input.focus()}),new ze(this.container,()=>{this.hideSuggestions()})}async updateSuggestions(e){let{data:t}=await window.$http.get("/search/suggest",{term:e});if(!this.input.value)return;let i=_e(t);this.suggestionResultsWrap.innerHTML="",this.suggestionResultsWrap.style.opacity="1",this.loadingWrap.style.display="none",this.suggestionResultsWrap.append(i),this.container.classList.contains("search-active")||this.showSuggestions()}showSuggestions(){this.container.classList.add("search-active"),window.requestAnimationFrame(()=>{this.suggestions.classList.add("search-suggestions-animation")})}hideSuggestions(){this.container.classList.remove("search-active"),this.suggestions.classList.remove("search-suggestions-animation"),this.suggestionResultsWrap.innerHTML=""}};var ti=class extends g{setup(){this.elem=this.$el,this.toggleButton=this.$refs.toggle,this.menu=this.$refs.menu,this.open=!1,this.toggleButton.addEventListener("click",this.onToggle.bind(this)),this.onWindowClick=this.onWindowClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}onToggle(e){this.open=!this.open,this.menu.classList.toggle("show",this.open),this.toggleButton.setAttribute("aria-expanded",this.open?"true":"false"),this.open?(this.elem.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.onWindowClick)):(this.elem.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.onWindowClick)),e.stopPropagation()}onKeyDown(e){e.code==="Escape"&&this.onToggle(e)}onWindowClick(e){this.onToggle(e)}};var ni=class extends g{setup(){this.uploadedTo=this.$opts.uploadedTo,this.container=this.$el,this.popupEl=this.$refs.popup,this.searchForm=this.$refs.searchForm,this.searchInput=this.$refs.searchInput,this.cancelSearch=this.$refs.cancelSearch,this.listContainer=this.$refs.listContainer,this.filterTabs=this.$manyRefs.filterTabs,this.selectButton=this.$refs.selectButton,this.uploadButton=this.$refs.uploadButton,this.uploadHint=this.$refs.uploadHint,this.formContainer=this.$refs.formContainer,this.formContainerPlaceholder=this.$refs.formContainerPlaceholder,this.dropzoneContainer=this.$refs.dropzoneContainer,this.loadMore=this.$refs.loadMore,this.type="gallery",this.lastSelected={},this.lastSelectedTime=0,this.callback=null,this.resetState=()=>{this.hasData=!1,this.page=1,this.filter="all"},this.resetState(),this.setupListeners()}setupListeners(){O(this.filterTabs,i=>{this.resetAll(),this.filter=i.target.dataset.filter,this.setActiveFilterTab(this.filter),this.loadGallery()}),this.searchForm.addEventListener("submit",i=>{this.resetListView(),this.loadGallery(),this.cancelSearch.toggleAttribute("hidden",!this.searchInput.value),i.preventDefault()}),O(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),K(this.container,".load-more button","click",this.runLoadMore.bind(this)),this.listContainer.addEventListener("event-emit-select-image",this.onImageSelectEvent.bind(this)),this.listContainer.addEventListener("error",i=>{i.target.src=window.baseUrl("loading_error.png")},!0),O(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),K(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),this.formContainer.addEventListener("ajax-form-success",()=>{this.refreshGallery(),this.resetEditForm()}),this.container.addEventListener("dropzone-upload-success",this.refreshGallery.bind(this));let e=this.listContainer.parentElement,t=[];e.addEventListener("wheel",i=>{if(!(Math.ceil(e.scrollHeight-e.scrollTop)===e.clientHeight)||i.deltaY<1)return;let s=Date.now()-1e3;t.push(Date.now()),t=t.filter(a=>a>=s),t.length>5&&this.canLoadMore()&&this.runLoadMore()})}show(e,t="gallery"){this.resetAll(),this.callback=e,this.type=t,this.getPopup().show();let i=t!=="gallery";this.dropzoneContainer.classList.toggle("hidden",i),this.uploadButton.classList.toggle("hidden",i),this.uploadHint.classList.toggle("hidden",i),window.$components.firstOnElement(this.container,"dropzone").toggleActive(!i),this.hasData||(this.loadGallery(),this.hasData=!0)}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.popupEl,"popup")}async loadGallery(){let e={page:this.page,search:this.searchInput.value||null,uploaded_to:this.uploadedTo,filter_type:this.filter==="all"?null:this.filter},{data:t}=await window.$http.get(`images/${this.type}`,e);e.page===1&&(this.listContainer.innerHTML=""),this.addReturnedHtmlElementsToList(t),Tt(this.listContainer)}addReturnedHtmlElementsToList(e){let t=document.createElement("div");t.innerHTML=e;let i=t.querySelector(".load-more");i&&(i.remove(),this.loadMore.innerHTML=i.innerHTML),this.loadMore.toggleAttribute("hidden",!i),window.$components.init(t);for(let r of[...t.children])this.listContainer.appendChild(r)}setActiveFilterTab(e){for(let t of this.filterTabs){let i=t.dataset.filter===e;t.setAttribute("aria-selected",i?"true":"false")}}resetAll(){this.resetState(),this.resetListView(),this.resetSearchView(),this.resetEditForm(),this.setActiveFilterTab("all"),this.selectButton.classList.add("hidden")}resetSearchView(){this.searchInput.value="",this.cancelSearch.toggleAttribute("hidden",!0)}resetEditForm(){this.formContainer.innerHTML="",this.formContainerPlaceholder.removeAttribute("hidden")}resetListView(){Dt(this.listContainer),this.page=1}refreshGallery(){this.resetListView(),this.loadGallery()}onImageSelectEvent(e){let t=JSON.parse(e.detail.data),i=t&&t.id===this.lastSelected.id&&Date.now()-this.lastSelectedTime<400,r=e.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(o=>{o.classList.remove("selected")}),r?this.resetEditForm():(e.target.classList.add("selected"),this.loadImageEditForm(t.id)),this.selectButton.classList.toggle("hidden",r),i&&this.callback&&(this.callback(t),this.hide()),this.lastSelected=t,this.lastSelectedTime=Date.now()}async loadImageEditForm(e,t=!1){t||(this.formContainer.innerHTML="");let i=t?{delete:!0}:{},{data:r}=await window.$http.get(`/images/edit/${e}`,i);this.formContainer.innerHTML=r,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer)}runLoadMore(){Dt(this.loadMore),this.page+=1,this.loadGallery()}canLoadMore(){return this.loadMore.querySelector("button")&&!this.loadMore.hasAttribute("hidden")}};var ii=class extends g{setup(){this.imageElem=this.$refs.image,this.imageInput=this.$refs.imageInput,this.resetInput=this.$refs.resetInput,this.removeInput=this.$refs.removeInput,this.resetButton=this.$refs.resetButton,this.removeButton=this.$refs.removeButton||null,this.defaultImage=this.$opts.defaultImage,this.setupListeners()}setupListeners(){this.resetButton.addEventListener("click",this.reset.bind(this)),this.removeButton&&this.removeButton.addEventListener("click",this.removeImage.bind(this)),this.imageInput.addEventListener("change",this.fileInputChange.bind(this))}fileInputChange(){this.resetInput.setAttribute("disabled","disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled");for(let e of this.imageInput.files)this.imageElem.src=window.URL.createObjectURL(e);this.imageElem.classList.remove("none")}reset(){this.imageInput.value="",this.imageElem.src=this.defaultImage,this.resetInput.removeAttribute("disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled"),this.imageElem.classList.remove("none")}removeImage(){this.imageInput.value="",this.imageElem.classList.add("none"),this.removeInput.removeAttribute("disabled"),this.resetInput.setAttribute("disabled","disabled")}};var ri=class extends g{setup(){this.elem=this.$el,this.menu=this.$refs.menu,this.sortInput=this.$refs.sort,this.orderInput=this.$refs.order,this.form=this.$refs.form,this.setupListeners()}setupListeners(){this.menu.addEventListener("click",e=>{e.target.closest("[data-sort-value]")!==null&&this.sortOptionClick(e)}),this.elem.addEventListener("click",e=>{e.target.closest("[data-sort-dir]")!==null&&this.sortDirectionClick(e)})}sortOptionClick(e){let t=e.target.closest("[data-sort-value]");this.sortInput.value=t.getAttribute("data-sort-value"),e.preventDefault(),this.form.submit()}sortDirectionClick(e){let t=this.orderInput.value;this.orderInput.value=t==="asc"?"desc":"asc",e.preventDefault(),this.form.submit()}};var Uc=Wo(Pc()),jc=Wo(Hc()),wi=class{constructor(){this.renderer=new Uc.default({html:!0}),this.renderer.use(jc.default,{label:!0})}getRenderer(){return this.renderer}render(e){return this.renderer.render(e)}};function nf(n,e){return document.createElement(n,e)}function rf(n,e,t){return document.createElementNS(n,e,t)}function of(){return et(document.createDocumentFragment())}function sf(n){return document.createTextNode(n)}function af(n){return document.createComment(n)}function lf(n,e,t){if(qe(n)){let i=n;for(;i&&qe(i);)i=et(i).parent;n=i??n}qe(e)&&(e=et(e,n)),t&&qe(t)&&(t=et(t).firstChildNode),n.insertBefore(e,t)}function cf(n,e){n.removeChild(e)}function uf(n,e){qe(e)&&(e=et(e,n)),n.appendChild(e)}function Vc(n){if(qe(n)){for(;n&&qe(n);)n=et(n).parent;return n??null}return n.parentNode}function hf(n){var e;if(qe(n)){let t=et(n),i=Vc(t);if(i&&t.lastChildNode){let r=Array.from(i.childNodes),o=r.indexOf(t.lastChildNode);return(e=r[o+1])!==null&&e!==void 0?e:null}return null}return n.nextSibling}function df(n){return n.tagName}function pf(n,e){n.textContent=e}function ff(n){return n.textContent}function mf(n){return n.nodeType===1}function gf(n){return n.nodeType===3}function bf(n){return n.nodeType===8}function qe(n){return n.nodeType===11}function et(n,e){var t,i,r;let o=n;return(t=o.parent)!==null&&t!==void 0||(o.parent=e??null),(i=o.firstChildNode)!==null&&i!==void 0||(o.firstChildNode=n.firstChild),(r=o.lastChildNode)!==null&&r!==void 0||(o.lastChildNode=n.lastChild),o}var yi={createElement:nf,createElementNS:rf,createTextNode:sf,createDocumentFragment:of,createComment:af,insertBefore:lf,removeChild:cf,appendChild:uf,parentNode:Vc,nextSibling:hf,tagName:df,setTextContent:pf,getTextContent:ff,isElement:mf,isText:gf,isComment:bf,isDocumentFragment:qe};function Be(n,e,t,i,r){let o=e===void 0?void 0:e.key;return{sel:n,data:e,children:t,text:i,elm:r,key:o}}var Wc=Array.isArray;function Gc(n){return typeof n=="string"||typeof n=="number"||n instanceof String||n instanceof Number}function Co(n){return n===void 0}function ce(n){return n!==void 0}var Eo=Be("",{},[],void 0,void 0);function Jt(n,e){var t,i;let r=n.key===e.key,o=((t=n.data)===null||t===void 0?void 0:t.is)===((i=e.data)===null||i===void 0?void 0:i.is),s=n.sel===e.sel,a=!n.sel&&n.sel===e.sel?typeof n.text==typeof e.text:!0;return s&&r&&o&&a}function wf(){throw new Error("The document fragment is not supported on this platform.")}function yf(n,e){return n.isElement(e)}function xf(n,e){return n.isDocumentFragment(e)}function kf(n,e,t){var i;let r={};for(let o=e;o<=t;++o){let s=(i=n[o])===null||i===void 0?void 0:i.key;s!==void 0&&(r[s]=o)}return r}var Cf=["create","update","remove","destroy","pre","post"];function _o(n,e,t){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=e!==void 0?e:yi;for(let f of Cf)for(let m of n){let y=m[f];y!==void 0&&i[f].push(y)}function o(f){let m=f.id?"#"+f.id:"",y=f.getAttribute("class"),v=y?"."+y.split(" ").join("."):"";return Be(r.tagName(f).toLowerCase()+m+v,{},[],void 0,f)}function s(f){return Be(void 0,{},[],void 0,f)}function a(f,m){return function(){if(--m===0){let v=r.parentNode(f);r.removeChild(v,f)}}}function l(f,m){var y,v,b,k;let w,E=f.data;if(E!==void 0){let D=(y=E.hook)===null||y===void 0?void 0:y.init;ce(D)&&(D(f),E=f.data)}let x=f.children,S=f.sel;if(S==="!")Co(f.text)&&(f.text=""),f.elm=r.createComment(f.text);else if(S!==void 0){let D=S.indexOf("#"),q=S.indexOf(".",D),L=D>0?D:S.length,I=q>0?q:S.length,H=D!==-1||q!==-1?S.slice(0,Math.min(L,I)):S,N=f.elm=ce(E)&&ce(w=E.ns)?r.createElementNS(w,H,E):r.createElement(H,E);for(L<I&&N.setAttribute("id",S.slice(L+1,I)),q>0&&N.setAttribute("class",S.slice(I+1).replace(/\./g," ")),w=0;w<i.create.length;++w)i.create[w](Eo,f);if(Wc(x))for(w=0;w<x.length;++w){let ge=x[w];ge!=null&&r.appendChild(N,l(ge,m))}else Gc(f.text)&&r.appendChild(N,r.createTextNode(f.text));let ee=f.data.hook;ce(ee)&&((v=ee.create)===null||v===void 0||v.call(ee,Eo,f),ee.insert&&m.push(f))}else if(!((b=t?.experimental)===null||b===void 0)&&b.fragments&&f.children){for(f.elm=((k=r.createDocumentFragment)!==null&&k!==void 0?k:wf)(),w=0;w<i.create.length;++w)i.create[w](Eo,f);for(w=0;w<f.children.length;++w){let D=f.children[w];D!=null&&r.appendChild(f.elm,l(D,m))}}else f.elm=r.createTextNode(f.text);return f.elm}function c(f,m,y,v,b,k){for(;v<=b;++v){let w=y[v];w!=null&&r.insertBefore(f,l(w,k),m)}}function u(f){var m,y;let v=f.data;if(v!==void 0){(y=(m=v?.hook)===null||m===void 0?void 0:m.destroy)===null||y===void 0||y.call(m,f);for(let b=0;b<i.destroy.length;++b)i.destroy[b](f);if(f.children!==void 0)for(let b=0;b<f.children.length;++b){let k=f.children[b];k!=null&&typeof k!="string"&&u(k)}}}function h(f,m,y,v){for(var b,k;y<=v;++y){let w,E,x=m[y];if(x!=null)if(ce(x.sel)){u(x),w=i.remove.length+1,E=a(x.elm,w);for(let D=0;D<i.remove.length;++D)i.remove[D](x,E);let S=(k=(b=x?.data)===null||b===void 0?void 0:b.hook)===null||k===void 0?void 0:k.remove;ce(S)?S(x,E):E()}else x.children?(u(x),h(f,x.children,0,x.children.length-1)):r.removeChild(f,x.elm)}}function d(f,m,y,v){let b=0,k=0,w=m.length-1,E=m[0],x=m[w],S=y.length-1,D=y[0],q=y[S],L,I,H,N;for(;b<=w&&k<=S;)E==null?E=m[++b]:x==null?x=m[--w]:D==null?D=y[++k]:q==null?q=y[--S]:Jt(E,D)?(p(E,D,v),E=m[++b],D=y[++k]):Jt(x,q)?(p(x,q,v),x=m[--w],q=y[--S]):Jt(E,q)?(p(E,q,v),r.insertBefore(f,E.elm,r.nextSibling(x.elm)),E=m[++b],q=y[--S]):Jt(x,D)?(p(x,D,v),r.insertBefore(f,x.elm,E.elm),x=m[--w],D=y[++k]):(L===void 0&&(L=kf(m,b,w)),I=L[D.key],Co(I)?r.insertBefore(f,l(D,v),E.elm):(H=m[I],H.sel!==D.sel?r.insertBefore(f,l(D,v),E.elm):(p(H,D,v),m[I]=void 0,r.insertBefore(f,H.elm,E.elm))),D=y[++k]);k<=S&&(N=y[S+1]==null?null:y[S+1].elm,c(f,N,y,k,S,v)),b<=w&&h(f,m,b,w)}function p(f,m,y){var v,b,k,w,E,x,S,D;let q=(v=m.data)===null||v===void 0?void 0:v.hook;(b=q?.prepatch)===null||b===void 0||b.call(q,f,m);let L=m.elm=f.elm;if(f===m)return;if(m.data!==void 0||ce(m.text)&&m.text!==f.text){(k=m.data)!==null&&k!==void 0||(m.data={}),(w=f.data)!==null&&w!==void 0||(f.data={});for(let N=0;N<i.update.length;++N)i.update[N](f,m);(S=(x=(E=m.data)===null||E===void 0?void 0:E.hook)===null||x===void 0?void 0:x.update)===null||S===void 0||S.call(x,f,m)}let I=f.children,H=m.children;Co(m.text)?ce(I)&&ce(H)?I!==H&&d(L,I,H,y):ce(H)?(ce(f.text)&&r.setTextContent(L,""),c(L,null,H,0,H.length-1,y)):ce(I)?h(L,I,0,I.length-1):ce(f.text)&&r.setTextContent(L,""):f.text!==m.text&&(ce(I)&&h(L,I,0,I.length-1),r.setTextContent(L,m.text)),(D=q?.postpatch)===null||D===void 0||D.call(q,f,m)}return function(m,y){let v,b,k,w=[];for(v=0;v<i.pre.length;++v)i.pre[v]();for(yf(r,m)?m=o(m):xf(r,m)&&(m=s(m)),Jt(m,y)?p(m,y,w):(b=m.elm,k=r.parentNode(b),l(y,w),k!==null&&(r.insertBefore(k,y.elm,r.nextSibling(b)),h(k,[m],0,0))),v=0;v<w.length;++v)w[v].data.hook.insert(w[v]);for(v=0;v<i.post.length;++v)i.post[v]();return y}}function So(n,e,t){if(n.ns="http://www.w3.org/2000/svg",t!=="foreignObject"&&e!==void 0)for(let i=0;i<e.length;++i){let r=e[i];if(typeof r=="string")continue;let o=r.data;o!==void 0&&So(o,r.children,r.sel)}}function Qt(n,e){let t=e!==void 0?e:yi,i;if(t.isElement(n)){let r=n.id?"#"+n.id:"",o=n.getAttribute("class"),s=o?"."+o.split(" ").join("."):"",a=t.tagName(n).toLowerCase()+r+s,l={},c={},u={},h=[],d,p,f,m=n.attributes,y=n.childNodes;for(p=0,f=m.length;p<f;p++)d=m[p].nodeName,d[0]==="d"&&d[1]==="a"&&d[2]==="t"&&d[3]==="a"&&d[4]==="-"?c[d.slice(5)]=m[p].nodeValue||"":d!=="id"&&d!=="class"&&(l[d]=m[p].nodeValue);for(p=0,f=y.length;p<f;p++)h.push(Qt(y[p],e));return Object.keys(l).length>0&&(u.attrs=l),Object.keys(c).length>0&&(u.dataset=c),a[0]==="s"&&a[1]==="v"&&a[2]==="g"&&(a.length===3||a[3]==="."||a[3]==="#")&&So(u,h,a),Be(a,u,h,void 0,n)}else return t.isText(n)?(i=t.getTextContent(n),Be(void 0,void 0,void 0,i,n)):t.isComment(n)?(i=t.getTextContent(n),Be("!",{},[],i,n)):Be("",{},[],void 0,n)}var Ef="http://www.w3.org/1999/xlink",_f="http://www.w3.org/XML/1998/namespace";function Kc(n,e){let t,i=e.elm,r=n.data.attrs,o=e.data.attrs;if(!(!r&&!o)&&r!==o){r=r||{},o=o||{};for(t in o){let s=o[t];r[t]!==s&&(s===!0?i.setAttribute(t,""):s===!1?i.removeAttribute(t):t.charCodeAt(0)!==120?i.setAttribute(t,s):t.charCodeAt(3)===58?i.setAttributeNS(_f,t,s):t.charCodeAt(5)===58?i.setAttributeNS(Ef,t,s):i.setAttribute(t,s))}for(t in r)t in o||i.removeAttribute(t)}}var Ao={create:Kc,update:Kc};var xi;function Sf(){return xi||(xi=_o([Ao]),xi)}function Zc(n,e){let t=document.createElement("div");t.innerHTML=e,Sf()(Qt(n),Qt(t))}var ki=class{constructor(e){this.editor=e,this.container=e.config.displayEl,this.doc=null,this.lastDisplayClick=0,this.container.contentDocument.readyState==="complete"?this.onLoad():this.container.addEventListener("load",this.onLoad.bind(this)),this.updateVisibility(e.settings.get("showPreview")),e.settings.onChange("showPreview",t=>this.updateVisibility(t))}updateVisibility(e){let t=this.container.closest(".markdown-editor-wrap");t.style.display=e?null:"none"}onLoad(){this.doc=this.container.contentDocument,this.loadStylesIntoDisplay(),this.doc.body.className="page-content",this.doc.addEventListener("click",this.onDisplayClick.bind(this))}onDisplayClick(e){let t=Date.now()-this.lastDisplayClick<300,i=e.target.closest("a");if(i!==null){e.preventDefault(),window.open(i.getAttribute("href"));return}let r=e.target.closest("[drawio-diagram]");if(r!==null&&t){this.editor.actions.editDrawing(r);return}this.lastDisplayClick=Date.now()}loadStylesIntoDisplay(){this.doc.documentElement.classList.add("markdown-editor-display"),document.documentElement.classList.contains("dark-mode")&&(this.doc.documentElement.style.backgroundColor="#222",this.doc.documentElement.classList.add("dark-mode")),this.doc.head.innerHTML="";let e=document.head.querySelectorAll("style,link[rel=stylesheet]");for(let t of e){let i=t.cloneNode(!0);this.doc.head.appendChild(i)}}patchWithHtml(e){let{body:t}=this.doc;if(t.children.length===0){let r=document.createElement("div");this.doc.body.append(r)}let i=t.children[0];Zc(i,e)}scrollToIndex(e){let t=this.doc.body?.children[0]?.children;if(t&&t.length<=e)return;(e===-1?t[t.length-1]:t[e]).scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}};function Ci(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}function Af(n,e){let t=indexedDB.open(n);t.onupgradeneeded=()=>t.result.createObjectStore(e);let i=Ci(t);return(r,o)=>i.then(s=>o(s.transaction(e,r).objectStore(e)))}var Do;function To(){return Do||(Do=Af("keyval-store","keyval")),Do}function Lo(n,e=To()){return e("readonly",t=>Ci(t.get(n)))}function Io(n,e,t=To()){return t("readwrite",i=>(i.put(e,n),Ci(i.transaction)))}function $o(n,e=To()){return e("readwrite",t=>(t.delete(n),Ci(t.transaction)))}var Ie=null,qo,Ei,Mo,Fo="last-drawing-save";function Bo(n){Ie.contentWindow.postMessage(JSON.stringify(n),qo)}function Tf(n){Io(Fo,n.data),Mo&&Mo(n.data).then(()=>{$o(Fo)})}function Lf(n){Bo({action:"export",format:"xmlpng",xml:n.xml,spin:"Updating drawing"})}function If(){Ei&&Ei().then(n=>{Bo({action:"load",autosave:1,xml:n})})}function $f(){let n={};window.$events.emitPublic(Ie,"editor-drawio::configure",{config:n}),Bo({action:"configure",config:n})}function Xc(){window.removeEventListener("message",Yc),Ie&&document.body.removeChild(Ie)}function Yc(n){if(!n.data||n.data.length<1||n.origin!==qo)return;let e=JSON.parse(n.data);e.event==="init"?If():e.event==="exit"?Xc():e.event==="save"?Lf(e):e.event==="export"?Tf(e):e.event==="configure"&&$f()}async function Mf(){let n=await Lo(Fo),e=document.getElementById("unsaved-drawing-dialog");e||console.error("Missing expected unsaved-drawing dialog"),n&&await window.$components.firstOnElement(e,"confirm-dialog").show()&&(Ei=async()=>n)}async function en(n,e,t){Ei=e,Mo=t,await Mf(),Ie=document.createElement("iframe"),Ie.setAttribute("frameborder","0"),window.addEventListener("message",Yc),Ie.setAttribute("src",n),Ie.setAttribute("class","fullscreen"),Ie.style.backgroundColor="#FFFFFF",document.body.appendChild(Ie),qo=new URL(n).origin}async function Po(n,e){let t={image:n,uploaded_to:e};return(await window.$http.post(window.baseUrl("/images/drawio"),t)).data}function tt(){Xc()}async function _i(n){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${n}`))).data.content}`}catch(e){throw e instanceof window.$http.HttpError&&window.$events.showResponseError(e),tt(),e}}var tn,Oo,xt,Si,kt,Ai,Pe,nt,We,yt,ie,ue,nn,Ro,rn,No,Ct,Di,he,ve,Li,Qc,Ti=class{constructor(e){re(this,tn);re(this,xt);re(this,kt);re(this,Pe);re(this,We);re(this,ie);re(this,nn);re(this,rn);re(this,Ct);re(this,he);re(this,Li);this.editor=e,this.lastContent={html:"",markdown:""}}updateAndRender(){let e=T(this,xt,Si).call(this);this.editor.config.inputEl.value=e;let t=this.editor.markdown.render(e);window.$events.emit("editor-html-change",""),window.$events.emit("editor-markdown-change",""),this.lastContent.html=t,this.lastContent.markdown=e,this.editor.display.patchWithHtml(t)}getContent(){return this.lastContent}showImageInsert(){window.$components.first("image-manager").show(t=>{let i=t.thumbs.display||t.url,o=`[![${T(this,We,yt).call(this)||t.name}](${i})](${t.url})`;T(this,Pe,nt).call(this,o,o.length)},"gallery")}insertImage(){let e=`![${T(this,We,yt).call(this)}](http://)`;T(this,Pe,nt).call(this,e,e.length-1)}insertLink(){let e=T(this,We,yt).call(this),t=`[${e}]()`,i=e===""?-3:-1;T(this,Pe,nt).call(this,t,t.length+i)}showImageManager(){let e=T(this,ie,ue).call(this);window.$components.first("image-manager").show(i=>{T(this,tn,Oo).call(this,i,e)},"drawio")}showLinkSelector(){let e=T(this,ie,ue).call(this);window.$components.first("entity-selector-popup").show(i=>{let o=`[${T(this,We,yt).call(this,e)||i.name}](${i.link})`;T(this,Pe,nt).call(this,o,o.length,e)})}startDrawing(){let e=this.editor.config.drawioUrl;if(!e)return;let t=T(this,ie,ue).call(this);en(e,()=>Promise.resolve(""),async i=>{let r={image:i,uploaded_to:Number(this.editor.config.pageId)};try{let o=await window.$http.post("/images/drawio",r);T(this,tn,Oo).call(this,o.data,t),tt()}catch(o){throw this.handleDrawingUploadError(o),new Error(`Failed to save image with error: ${o}`)}})}editDrawing(e){let{drawioUrl:t}=this.editor.config;if(!t)return;let i=T(this,ie,ue).call(this),r=e.getAttribute("drawio-diagram");en(t,()=>_i(r),async o=>{let s={image:o,uploaded_to:Number(this.editor.config.pageId)};try{let a=await window.$http.post("/images/drawio",s),l=`<div drawio-diagram="${a.data.id}"><img src="${a.data.url}"></div>`,c=T(this,xt,Si).call(this).split(`
`).map(u=>u.indexOf(`drawio-diagram="${r}"`)!==-1?l:u).join(`
`);T(this,kt,Ai).call(this,c,i),tt()}catch(a){throw this.handleDrawingUploadError(a),new Error(`Failed to save image with error: ${a}`)}})}handleDrawingUploadError(e){e.status===413?window.$events.emit("error",this.editor.config.text.serverUploadLimit):window.$events.emit("error",this.editor.config.text.imageUploadError),console.error(e)}fullScreen(){let{container:e}=this.editor.config,t=e.classList.contains("fullscreen");e.classList.toggle("fullscreen",!t),document.body.classList.toggle("markdown-fullscreen",!t)}scrollToText(e){if(!e)return;let t=this.editor.cm.state.doc,i=1,r=-1;for(let s of t.iterLines()){if(s.includes(e)){r=i;break}i+=1}if(r===-1)return;let o=t.line(r);T(this,Li,Qc).call(this,o.from,o.to,!0),this.focus()}focus(){this.editor.cm.hasFocus||this.editor.cm.focus()}insertContent(e){T(this,Pe,nt).call(this,e,e.length)}prependContent(e){e=T(this,nn,Ro).call(this,e);let i=T(this,ie,ue).call(this).from+e.length+1;T(this,he,ve).call(this,0,0,`${e}
`,i),this.focus()}appendContent(e){e=T(this,nn,Ro).call(this,e),T(this,he,ve).call(this,this.editor.cm.state.doc.length,`
${e}`),this.focus()}replaceContent(e){T(this,kt,Ai).call(this,e)}replaceLineStart(e){let t=T(this,ie,ue).call(this),i=this.editor.cm.state.doc.lineAt(t.from),r=i.text,o=r.split(" ")[0];if(o===e){let c=r.replace(`${e} `,""),u=t.from+(c.length-r.length);T(this,he,ve).call(this,i.from,i.to,c,u);return}let s=r;/^[#>`]/.test(o)?s=r.replace(o,e).trim():e!==""&&(s=`${e} ${r}`);let l=t.from+(s.length-r.length);T(this,he,ve).call(this,i.from,i.to,s,l)}wrapSelection(e,t){let i=T(this,ie,ue).call(this),r=T(this,We,yt).call(this,i);if(!r){T(this,Ct,Di).call(this,e,t);return}let o=r,s;r.startsWith(e)&&r.endsWith(t)?(o=r.slice(e.length,r.length-t.length),s=i.extend(i.from,i.to-(e.length+t.length))):(o=`${e}${r}${t}`,s=i.extend(i.from,i.to+(e.length+t.length))),T(this,he,ve).call(this,i.from,i.to,o,s.anchor,s.head)}replaceLineStartForOrderedList(){let e=T(this,ie,ue).call(this),t=this.editor.cm.state.doc.lineAt(e.from),r=this.editor.cm.state.doc.line(t.number-1).text.match(/^(\s*)(\d)([).])\s/)||[],o=(Number(r[2])||0)+1,s=r[1]||"",a=r[3]||".",l=`${s}${o}${a}`;return this.replaceLineStart(l)}cycleCalloutTypeAtSelection(){let e=T(this,ie,ue).call(this),t=this.editor.cm.state.doc.lineAt(e.from),i=["info","success","warning","danger"],r=i.join("|"),s=new RegExp(`class="((${r})\\s+callout|callout\\s+(${r}))"`,"i").exec(t.text),a=(s?s[2]||s[3]:"").toLowerCase();if(a===i[i.length-1])T(this,Ct,Di).call(this,`<p class="callout ${i[i.length-1]}">`,"</p>");else if(a==="")T(this,Ct,Di).call(this,'<p class="callout info">',"</p>");else{let l=i.indexOf(a)+1,c=i[l],u=t.text.replace(s[0],s[0].replace(a,c)),h=u.length-t.text.length;T(this,he,ve).call(this,t.from,t.to,u,e.anchor+h,e.head+h)}}syncDisplayPosition(e){let t=e.target;if(Math.abs(t.scrollHeight-t.clientHeight-t.scrollTop)<1){this.editor.display.scrollToIndex(-1);return}let r=this.editor.cm.lineBlockAtHeight(t.scrollTop),o=this.editor.cm.state.sliceDoc(0,r.from),l=new DOMParser().parseFromString(this.editor.markdown.render(o),"text/html").documentElement.querySelectorAll("body > *");this.editor.display.scrollToIndex(l.length)}async insertTemplate(e,t,i){let r=this.editor.cm.posAtCoords({x:t,y:i},!1),{data:o}=await window.$http.get(`/templates/${e}`),s=o.markdown||o.html;T(this,he,ve).call(this,r,r,s,r)}insertClipboardImages(e,t,i){let r=this.editor.cm.posAtCoords({x:t,y:i},!1);for(let o of e)this.uploadImage(o,r)}async uploadImage(e,t=null){if(e===null||e.type.indexOf("image")!==0)return;let i="png";if(t===null&&(t=T(this,ie,ue).call(this).from),e.name){let c=e.name.match(/\.(.+)$/);c.length>1&&(i=c[1])}let r=`image-${Math.random().toString(16).slice(2)}`,s=`![](${window.baseUrl(`/loading.gif#upload${r}`)})`;T(this,he,ve).call(this,t,t,s,t);let a=`image-${Date.now()}.${i}`,l=new FormData;l.append("file",e,a),l.append("uploaded_to",this.editor.config.pageId);try{let{data:c}=await window.$http.post("/images/gallery",l),u=`[![](${c.thumbs.display})](${c.url})`;T(this,rn,No).call(this,s,u)}catch(c){window.$events.emit("error",this.editor.config.text.imageUploadError),T(this,rn,No).call(this,s,""),console.error(c)}}};tn=new WeakSet,Oo=function(e,t){let i=`<div drawio-diagram="${e.id}"><img src="${e.url}"></div>`;T(this,Pe,nt).call(this,i,i.length,t)},xt=new WeakSet,Si=function(){return this.editor.cm.state.doc.toString()},kt=new WeakSet,Ai=function(e,t=null){t=t||T(this,ie,ue).call(this);let i=this.editor.cm.state.toText(e),r=Math.min(t.from,i.length);T(this,he,ve).call(this,0,this.editor.cm.state.doc.length,e,r),this.focus()},Pe=new WeakSet,nt=function(e,t=0,i=null){i=i||this.editor.cm.state.selection.main;let r=i.from+t;T(this,he,ve).call(this,i.from,i.to,e,r),this.focus()},We=new WeakSet,yt=function(e=null){return e=e||T(this,ie,ue).call(this),this.editor.cm.state.sliceDoc(e.from,e.to)},ie=new WeakSet,ue=function(){return this.editor.cm.state.selection.main},nn=new WeakSet,Ro=function(e){return e.replace(/\r\n|\r/g,`
`)},rn=new WeakSet,No=function(e,t){let i=T(this,xt,Si).call(this).replace(e,t);T(this,kt,Ai).call(this,i)},Ct=new WeakSet,Di=function(e,t){let i=T(this,ie,ue).call(this),r=this.editor.cm.state.doc.lineAt(i.from),o=r.text,s,a=0;o.startsWith(e)&&o.endsWith(t)?(s=o.slice(e.length,o.length-t.length),a=-e.length):(s=`${e}${o}${t}`,a=e.length),T(this,he,ve).call(this,r.from,r.to,s,i.from+a)},he=new WeakSet,ve=function(e,t=null,i=null,r=null,o=null){let s={changes:{from:e,to:t,insert:i}};r&&(s.selection={anchor:r},o&&(s.selection.head=o)),this.editor.cm.dispatch(s)},Li=new WeakSet,Qc=function(e,t,i=!1){this.editor.cm.dispatch({selection:{anchor:e,head:t},scrollIntoView:i})};var Ii=class{constructor(e){this.settingMap={scrollSync:!0,showPreview:!0,editorWidth:50},this.changeListeners={},this.loadFromLocalStorage(),this.applyToInputs(e),this.listenToInputChanges(e)}applyToInputs(e){for(let t of e){let i=t.getAttribute("name").replace("md-","");t.checked=this.settingMap[i]}}listenToInputChanges(e){for(let t of e)t.addEventListener("change",()=>{let i=t.getAttribute("name").replace("md-","");this.set(i,t.checked)})}loadFromLocalStorage(){let e=window.localStorage.getItem("md-editor-settings");if(!e)return;let t=JSON.parse(e);for(let[i,r]of Object.entries(t))r!==null&&this.settingMap[i]!==void 0&&(this.settingMap[i]=r)}set(e,t){this.settingMap[e]=t,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));for(let i of this.changeListeners[e]||[])i(t)}get(e){return this.settingMap[e]||null}onChange(e,t){let i=this.changeListeners[e]||[];i.push(t),this.changeListeners[e]=i}};function $i({html:n,markdown:e}){return e||n}function eu(n){window.$events.listen("editor::replace",e=>{let t=$i(e);n.actions.replaceContent(t)}),window.$events.listen("editor::append",e=>{let t=$i(e);n.actions.appendContent(t)}),window.$events.listen("editor::prepend",e=>{let t=$i(e);n.actions.prependContent(t)}),window.$events.listen("editor::insert",e=>{let t=$i(e);n.actions.insertContent(t)}),window.$events.listen("editor::focus",()=>{n.actions.focus()})}function Ff(n){let e={};return e["Shift-Mod-i"]=()=>n.actions.insertImage(),e["Mod-s"]=()=>window.$events.emit("editor-save-draft"),e["Mod-Enter"]=()=>window.$events.emit("editor-save-page"),e["Shift-Mod-k"]=()=>n.actions.showLinkSelector(),e["Mod-k"]=()=>n.actions.insertLink(),e["Mod-1"]=()=>n.actions.replaceLineStart("##"),e["Mod-2"]=()=>n.actions.replaceLineStart("###"),e["Mod-3"]=()=>n.actions.replaceLineStart("####"),e["Mod-4"]=()=>n.actions.replaceLineStart("#####"),e["Mod-5"]=()=>n.actions.replaceLineStart(""),e["Mod-d"]=()=>n.actions.replaceLineStart(""),e["Mod-6"]=()=>n.actions.replaceLineStart(">"),e["Mod-q"]=()=>n.actions.replaceLineStart(">"),e["Mod-7"]=()=>n.actions.wrapSelection("\n```\n","\n```"),e["Mod-8"]=()=>n.actions.wrapSelection("`","`"),e["Shift-Mod-e"]=()=>n.actions.wrapSelection("`","`"),e["Mod-9"]=()=>n.actions.cycleCalloutTypeAtSelection(),e["Mod-p"]=()=>n.actions.replaceLineStart("-"),e["Mod-o"]=()=>n.actions.replaceLineStartForOrderedList(),e}function tu(n){let e=Ff(n),t=[],i=r=>()=>(r(),!0);for(let[r,o]of Object.entries(e))t.push({key:r,run:i(o),preventDefault:!0});return t}async function nu(n){let e=await window.importVersioned("code");function t(a){a.docChanged&&n.actions.updateAndRender()}let i=Ne(n.actions.syncDisplayPosition.bind(n.actions),100,!1),r=n.settings.get("scrollSync");n.settings.onChange("scrollSync",a=>{r=a});let o={scroll:a=>r&&i(a),drop:a=>{let l=a.dataTransfer.getData("bookstack/template");l&&(a.preventDefault(),n.actions.insertTemplate(l,a.pageX,a.pageY));let u=new Fe(a.dataTransfer).getImages();u.length>0&&(a.stopPropagation(),a.preventDefault(),n.actions.insertClipboardImages(u,a.pageX,a.pageY))},paste:a=>{let l=new Fe(a.clipboardData||a.dataTransfer);if(!l.hasItems()||l.containsTabularData())return;let c=l.getImages();for(let u of c)n.actions.uploadImage(u)}},s=e.markdownEditor(n.config.inputEl,t,o,tu(n));return window.mdEditorView=s,s}async function iu(n){let e={config:n,markdown:new wi,settings:new Ii(n.settingInputs)};return e.actions=new Ti(e),e.display=new ki(e),e.cm=await nu(e),eu(e),e}var Mi=class extends g{setup(){this.elem=this.$el,this.pageId=this.$opts.pageId,this.textDirection=this.$opts.textDirection,this.imageUploadErrorText=this.$opts.imageUploadErrorText,this.serverUploadLimitText=this.$opts.serverUploadLimitText,this.display=this.$refs.display,this.input=this.$refs.input,this.divider=this.$refs.divider,this.displayWrap=this.$refs.displayWrap;let{settingContainer:e}=this.$refs,t=e.querySelectorAll('input[type="checkbox"]');this.editor=null,iu({pageId:this.pageId,container:this.elem,displayEl:this.display,inputEl:this.input,drawioUrl:this.getDrawioUrl(),settingInputs:Array.from(t),text:{serverUploadLimit:this.serverUploadLimitText,imageUploadError:this.imageUploadErrorText}}).then(i=>{this.editor=i,this.setupListeners(),this.emitEditorEvents(),this.scrollToTextIfNeeded(),this.editor.actions.updateAndRender()})}emitEditorEvents(){window.$events.emitPublic(this.elem,"editor-markdown::setup",{markdownIt:this.editor.markdown.getRenderer(),displayEl:this.display,cmEditorView:this.editor.cm})}setupListeners(){this.elem.addEventListener("click",e=>{let t=e.target.closest("button[data-action]");if(t===null)return;let i=t.getAttribute("data-action");if(i==="insertImage"&&this.editor.actions.showImageInsert(),i==="insertLink"&&this.editor.actions.showLinkSelector(),i==="insertDrawing"&&(e.ctrlKey||e.metaKey)){this.editor.actions.showImageManager();return}i==="insertDrawing"&&this.editor.actions.startDrawing(),i==="fullscreen"&&this.editor.actions.fullScreen()}),this.elem.addEventListener("click",e=>{let t=e.target.closest(".editor-toolbar-label");if(!t)return;let i=this.elem.querySelectorAll(".markdown-editor-wrap");for(let r of i)r.classList.remove("active");t.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let t=this.elem.getBoundingClientRect(),i=o=>{let s=o.pageX-t.left,a=Math.min(Math.max(20,Math.floor(s/t.width*100)),80);this.displayWrap.style.flexBasis=`${100-a}%`,this.editor.settings.set("editorWidth",a)},r=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",r),this.display.style.pointerEvents=null,document.body.style.userSelect=null};this.display.style.pointerEvents="none",document.body.style.userSelect="none",window.addEventListener("pointermove",i),window.addEventListener("pointerup",r)});let e=this.editor.settings.get("editorWidth");e&&(this.displayWrap.style.flexBasis=`${100-e}%`)}scrollToTextIfNeeded(){let t=new URL(window.location).searchParams.get("content-text");t&&this.editor.actions.scrollToText(t)}getDrawioUrl(){let e=document.querySelector("[drawio-url]");return e&&e.getAttribute("drawio-url")||""}getContent(){return this.editor.actions.getContent()}};var Fi=class extends g{setup(){this.container=this.$el,this.inputContainer=this.$refs.inputContainer,this.inviteOption=this.container.querySelector("input[name=send_invite]"),this.inviteOption&&(this.inviteOption.addEventListener("change",this.inviteOptionChange.bind(this)),this.inviteOptionChange())}inviteOptionChange(){let e=this.inviteOption.value==="true",t=this.container.querySelectorAll("input[type=password]");for(let i of t)i.disabled=e;this.inputContainer.style.display=e?"none":"block"}};var qi=class extends g{setup(){this.container=this.$el,this.type=this.$opts.type,this.textElem=this.container.querySelector("span"),this.autoHide=this.$opts.autoHide==="true",this.initialShow=this.$opts.show==="true",this.container.style.display="grid",window.$events.listen(this.type,e=>{this.show(e)}),this.container.addEventListener("click",this.hide.bind(this)),this.initialShow&&setTimeout(()=>this.show(this.textElem.textContent),100),this.hideCleanup=this.hideCleanup.bind(this)}show(e=""){if(this.container.removeEventListener("transitionend",this.hideCleanup),this.textElem.textContent=e,this.container.style.display="grid",setTimeout(()=>{this.container.classList.add("showing")},1),this.autoHide){let t=e.split(" ").length,i=Math.max(2e3,1e3+250*t);setTimeout(this.hide.bind(this),i)}}hide(){this.container.classList.remove("showing"),this.container.addEventListener("transitionend",this.hideCleanup)}hideCleanup(){this.container.style.display="none",this.container.removeEventListener("transitionend",this.hideCleanup)}};var Bi=class extends g{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){O(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),O(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};var Pi=class extends g{setup(){this.commentId=this.$opts.commentId,this.commentLocalId=this.$opts.commentLocalId,this.commentParentId=this.$opts.commentParentId,this.deletedText=this.$opts.deletedText,this.updatedText=this.$opts.updatedText,this.container=this.$el,this.contentContainer=this.$refs.contentContainer,this.form=this.$refs.form,this.formCancel=this.$refs.formCancel,this.editButton=this.$refs.editButton,this.deleteButton=this.$refs.deleteButton,this.replyButton=this.$refs.replyButton,this.input=this.$refs.input,this.setupListeners()}setupListeners(){this.replyButton&&this.replyButton.addEventListener("click",()=>this.$emit("reply",{id:this.commentLocalId,element:this.container})),this.editButton&&(this.editButton.addEventListener("click",this.startEdit.bind(this)),this.form.addEventListener("submit",this.update.bind(this)),this.formCancel.addEventListener("click",()=>this.toggleEditMode(!1))),this.deleteButton&&this.deleteButton.addEventListener("click",this.delete.bind(this))}toggleEditMode(e){this.contentContainer.toggleAttribute("hidden",e),this.form.toggleAttribute("hidden",!e)}startEdit(){this.toggleEditMode(!0);let e=this.$refs.input.value.split(`
`).length;this.$refs.input.style.height=`${e*20+40}px`}async update(e){e.preventDefault();let t=this.showLoading();this.form.toggleAttribute("hidden",!0);let i={text:this.input.value,parent_id:this.parentId||null};try{let r=await window.$http.put(`/comment/${this.commentId}`,i),o=_e(r.data);this.container.replaceWith(o),window.$events.success(this.updatedText)}catch(r){console.error(r),window.$events.showValidationErrors(r),this.form.toggleAttribute("hidden",!1),t.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.container.closest(".comment-branch").remove(),window.$events.success(this.deletedText),this.$emit("delete")}showLoading(){let e=at();return e.classList.add("px-l"),this.container.append(e),e}};var Oi=class extends g{setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.commentsTitle=this.$refs.commentsTitle,this.addButtonContainer=this.$refs.addButtonContainer,this.replyToRow=this.$refs.replyToRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink.textContent,this.setupListeners()}setupListeners(){this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",e=>{this.setReply(e.detail.id,e.detail.element)}),this.form&&this.form.addEventListener("submit",this.saveComment.bind(this))}saveComment(e){e.preventDefault(),e.stopPropagation();let t=at();t.classList.add("px-l"),this.form.after(t),this.form.toggleAttribute("hidden",!0);let r={text:this.formInput.value,parent_id:this.parentId||null};window.$http.post(`/comment/${this.pageId}`,r).then(o=>{let s=_e(o.data);this.formContainer.after(s),window.$events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(o=>{this.form.toggleAttribute("hidden",!1),window.$events.showValidationErrors(o)}),this.form.toggleAttribute("hidden",!1),t.remove()}updateCount(){let e=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,e,{count:e})}resetForm(){this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),setTimeout(()=>{this.formInput.focus()},100)}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(e,t){t.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=e,this.replyToRow.toggleAttribute("hidden",!1);let r=this.replyToRow.querySelector("a");r.textContent=this.formReplyText.replace("1234",this.parentId),r.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function qf(n,e){yr(`#page-navigation a[href="#${n}"]`,t=>{t.closest("li").classList.toggle("current-heading",e)})}function Bf(n){for(let e of n){let t=e.intersectionRatio===1;qf(e.target.id,t)}}function Pf(n){let e={rootMargin:"0px 0px 0px 0px",threshold:1},t=new IntersectionObserver(Bf,e);for(let i of n)t.observe(i)}var Ri=class extends g{setup(){if(this.container=this.$el,this.pageId=this.$opts.pageId,window.importVersioned("code").then(t=>t.highlight()),this.setupNavHighlighting(),this.setupDetailsCodeBlockRefresh(),window.location.hash){let t=window.location.hash.replace(/%20/g," ").substring(1);this.goToText(t)}let e=document.querySelector(".sidebar-page-nav");e&&K(e,"a","click",(t,i)=>{t.preventDefault(),window.$components.first("tri-layout").showContent();let r=i.getAttribute("href").substr(1);this.goToText(r),window.history.pushState(null,null,`#${r}`)})}goToText(e){let t=document.getElementById(e);if(yr(".page-content [data-highlighted]",i=>{i.removeAttribute("data-highlighted"),i.style.backgroundColor=null}),t!==null)kr(t);else{let i=Qo(".page-content > div > *",e);i&&kr(i)}}setupNavHighlighting(){let e=document.querySelector(".sidebar-page-nav"),t=document.querySelector(".page-content").querySelectorAll("h1, h2, h3, h4, h5, h6");t.length>0&&e!==null&&Pf(t)}setupDetailsCodeBlockRefresh(){let e=i=>{[...i.target.querySelectorAll(".CodeMirror")].forEach(o=>o.CodeMirror&&o.CodeMirror.refresh())};[...this.container.querySelectorAll("details")].forEach(i=>i.addEventListener("toggle",e))}};function ru(n){let e=new Date(n*1e3),t=e.getHours(),i=e.getMinutes();return`${(t>9?"":"0")+t}:${(i>9?"":"0")+i}`}var Ni=class extends g{setup(){this.draftsEnabled=this.$opts.draftsEnabled==="true",this.editorType=this.$opts.editorType,this.pageId=Number(this.$opts.pageId),this.isNewDraft=this.$opts.pageNewDraft==="true",this.hasDefaultTitle=this.$opts.hasDefaultTitle||!1,this.container=this.$el,this.titleElem=this.$refs.titleContainer.querySelector("input"),this.saveDraftButton=this.$refs.saveDraft,this.discardDraftButton=this.$refs.discardDraft,this.discardDraftWrap=this.$refs.discardDraftWrap,this.deleteDraftButton=this.$refs.deleteDraft,this.deleteDraftWrap=this.$refs.deleteDraftWrap,this.draftDisplay=this.$refs.draftDisplay,this.draftDisplayIcon=this.$refs.draftDisplayIcon,this.changelogInput=this.$refs.changelogInput,this.changelogDisplay=this.$refs.changelogDisplay,this.changeEditorButtons=this.$manyRefs.changeEditor||[],this.switchDialogContainer=this.$refs.switchDialog,this.deleteDraftDialogContainer=this.$refs.deleteDraftDialog,this.draftText=this.$opts.draftText,this.autosaveFailText=this.$opts.autosaveFailText,this.editingPageText=this.$opts.editingPageText,this.draftDiscardedText=this.$opts.draftDiscardedText,this.draftDeleteText=this.$opts.draftDeleteText,this.draftDeleteFailText=this.$opts.draftDeleteFailText,this.setChangelogText=this.$opts.setChangelogText,this.autoSave={interval:null,frequency:3e4,last:0,pendingChange:!1},this.shownWarningsCache=new Set,this.pageId!==0&&this.draftsEnabled&&window.setTimeout(()=>{this.startAutoSave()},1e3),this.draftDisplay.innerHTML=this.draftText,this.setupListeners(),this.setInitialFocus()}setupListeners(){window.$events.listen("editor-save-draft",this.saveDraft.bind(this)),window.$events.listen("editor-save-page",this.savePage.bind(this));let e=()=>{this.autoSave.pendingChange=!0};window.$events.listen("editor-html-change",e),window.$events.listen("editor-markdown-change",e),this.titleElem.addEventListener("input",e);let t=Ne(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",t),O(this.saveDraftButton,this.saveDraft.bind(this)),O(this.discardDraftButton,this.discardDraft.bind(this)),O(this.deleteDraftButton,this.deleteDraft.bind(this)),O(this.changeEditorButtons,this.changeEditor.bind(this))}setInitialFocus(){if(this.hasDefaultTitle){this.titleElem.select();return}window.setTimeout(()=>{window.$events.emit("editor::focus","")},500)}startAutoSave(){this.autoSave.interval=window.setInterval(this.runAutoSave.bind(this),this.autoSave.frequency)}runAutoSave(){Date.now()-this.autoSave.last<this.autoSave.frequency/2||!this.autoSave.pendingChange||this.saveDraft()}savePage(){this.container.closest("form").submit()}async saveDraft(){let e={name:this.titleElem.value.trim()},t=this.getEditorComponent().getContent();Object.assign(e,t);let i=!1;try{let r=await window.$http.put(`/ajax/page/${this.pageId}/save-draft`,e);this.isNewDraft||(this.discardDraftWrap.toggleAttribute("hidden",!1),this.deleteDraftWrap.toggleAttribute("hidden",!1)),this.draftNotifyChange(`${r.data.message} ${ru(r.data.timestamp)}`),this.autoSave.last=Date.now(),r.data.warning&&!this.shownWarningsCache.has(r.data.warning)&&(window.$events.emit("warning",r.data.warning),this.shownWarningsCache.add(r.data.warning)),i=!0,this.autoSave.pendingChange=!1}catch{try{let o=`draft-save-fail-${new Date().toISOString()}`;window.localStorage.setItem(o,JSON.stringify(e))}catch(o){console.error(o)}window.$events.emit("error",this.autosaveFailText)}return i}draftNotifyChange(e){this.draftDisplay.innerText=e,this.draftDisplayIcon.classList.add("visible"),window.setTimeout(()=>{this.draftDisplayIcon.classList.remove("visible")},2e3)}async discardDraft(e=!0){let t;try{t=await window.$http.get(`/ajax/page/${this.pageId}`)}catch(i){console.error(i);return}this.autoSave.interval&&window.clearInterval(this.autoSave.interval),this.draftDisplay.innerText=this.editingPageText,this.discardDraftWrap.toggleAttribute("hidden",!0),window.$events.emit("editor::replace",{html:t.data.html,markdown:t.data.markdown}),this.titleElem.value=t.data.name,window.setTimeout(()=>{this.startAutoSave()},1e3),e&&window.$events.success(this.draftDiscardedText)}async deleteDraft(){if(await window.$components.firstOnElement(this.deleteDraftDialogContainer,"confirm-dialog").show())try{let i=this.discardDraft(!1),r=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([i,r]),window.$events.success(this.draftDeleteText),this.deleteDraftWrap.toggleAttribute("hidden",!0)}catch(i){console.error(i),window.$events.error(this.draftDeleteFailText)}}updateChangelogDisplay(){let e=this.changelogInput.value.trim();e.length===0?e=this.setChangelogText:e.length>16&&(e=`${e.slice(0,16)}...`),this.changelogDisplay.innerText=e}async changeEditor(e){e.preventDefault();let t=e.target.closest("a").href,i=window.$components.firstOnElement(this.switchDialogContainer,"confirm-dialog"),[r,o]=await Promise.all([this.saveDraft(),i.show()]);r&&o&&(window.location=t)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")}};function zi(n,e){n.style.display=e?null:"none"}var Hi=class extends g{setup(){this.input=this.$refs.input,this.resetButton=this.$refs.resetButton,this.selectButton=this.$refs.selectButton,this.display=this.$refs.display,this.defaultDisplay=this.$refs.defaultDisplay,this.buttonSep=this.$refs.buttonSeperator,this.value=this.input.value,this.setupListeners()}setupListeners(){this.selectButton.addEventListener("click",this.showPopup.bind(this)),this.display.parentElement.addEventListener("click",this.showPopup.bind(this)),this.resetButton.addEventListener("click",()=>{this.setValue("","")})}showPopup(){window.$components.first("entity-selector-popup").show(t=>{this.setValue(t.id,t.name)})}setValue(e,t){this.value=e,this.input.value=e,this.controlView(t)}controlView(e){let t=this.value&&this.value!==0;if(zi(this.resetButton,t),zi(this.buttonSep,t),zi(this.defaultDisplay,!t),zi(this.display,t),t){let i=this.getAssetIdFromVal();this.display.textContent=`#${i}, ${e}`,this.display.href=window.baseUrl(`/link/${i}`)}}getAssetIdFromVal(){return Number(this.value)}};var Ui=class extends g{setup(){this.container=this.$el,this.cellSelector=this.$opts.cellSelector||"td,th",this.rowSelector=this.$opts.rowSelector||"tr";for(let e of this.$manyRefs.toggleAll||[])e.addEventListener("click",this.toggleAllClick.bind(this));for(let e of this.$manyRefs.toggleRow||[])e.addEventListener("click",this.toggleRowClick.bind(this));for(let e of this.$manyRefs.toggleColumn||[])e.addEventListener("click",this.toggleColumnClick.bind(this))}toggleAllClick(e){e.preventDefault(),this.toggleAllInElement(this.container)}toggleRowClick(e){e.preventDefault(),this.toggleAllInElement(e.target.closest(this.rowSelector))}toggleColumnClick(e){e.preventDefault();let t=e.target.closest(this.cellSelector),i=Array.from(t.parentElement.children).indexOf(t),r=this.container.querySelectorAll(this.rowSelector),o=[];for(let s of r){let a=s.children[i];a&&o.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(o)}toggleAllInElement(e){let t=e.querySelectorAll("input[type=checkbox]");this.toggleAllInputs(t)}toggleAllInputs(e){let t=e.length>0?e[0].checked:!1;for(let i of e)i.checked=!t,i.dispatchEvent(new Event("change"))}};var ji=class extends g{setup(){this.container=this.$el,this.pointer=this.$refs.pointer,this.linkInput=this.$refs.linkInput,this.linkButton=this.$refs.linkButton,this.includeInput=this.$refs.includeInput,this.includeButton=this.$refs.includeButton,this.sectionModeButton=this.$refs.sectionModeButton,this.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.showing=!1,this.isSelection=!1,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Vr(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Vr(this.linkInput.value)),O([this.includeInput,this.linkInput],t=>{t.target.select(),t.stopPropagation()}),ln(this.pointer,["click","focus"],t=>{t.stopPropagation()}),ln(document.body,["click","focus"],()=>{!this.showing||this.isSelection||this.hidePointer()}),Jo(this.pointer,this.hidePointer.bind(this));let e=document.querySelector(".page-content");ln(e,["mouseup","keyup"],t=>{t.stopPropagation();let i=t.target.closest('[id^="bkmrk"]');i&&window.getSelection().toString().length>0&&this.showPointerAtTarget(i,t.pageX,!1)}),O(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),O(this.modeToggles,t=>{for(let i of this.modeSections){let r=!i.contains(t.target);i.toggleAttribute("hidden",!r)}this.modeToggles.find(i=>i!==t.target).focus()})}hidePointer(){this.pointer.style.display=null,this.showing=!1}showPointerAtTarget(e,t,i){this.updateForTarget(e),this.pointer.style.display="block";let r=e.getBoundingClientRect(),o=this.pointer.getBoundingClientRect(),a=Math.min(Math.max(t,r.left),r.right)-o.width/2,l=r.top-o.height-16;this.pointer.style.left=`${a}px`,this.pointer.style.top=`${l}px`,this.showing=!0,this.isSelection=!0,setTimeout(()=>{this.isSelection=!1},100);let c=()=>{this.hidePointer(),window.removeEventListener("scroll",c,{passive:!0})};e.parentElement.insertBefore(this.pointer,e),i||window.addEventListener("scroll",c,{passive:!0})}updateForTarget(e){let t=window.baseUrl(`/link/${this.pageId}#${e.id}`),i=`{{@${this.pageId}#${e.id}}}`;this.linkInput.value=t,this.includeInput.value=i;let r=this.pointer.querySelector("#pointer-edit");if(r&&e){let{editHref:o}=r.dataset,s=e.id,a=e.textContent&&e.textContent.substring(0,50);r.href=`${o}?content-id=${s}&content-text=${encodeURIComponent(a)}`}}enterSectionSelectMode(){let e=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let t of e)t.setAttribute("tabindex","0");e[0].focus(),st(e,t=>{this.showPointerAtTarget(t.target,0,!0),this.pointer.focus()})}};var Vi=class extends g{setup(){this.container=this.$el,this.hideButtons=this.$manyRefs.hide||[],this.onkeyup=null,this.onHide=null,this.setupListeners()}setupListeners(){let e=null;this.container.addEventListener("mousedown",t=>{e=t.target}),this.container.addEventListener("click",t=>{t.target===this.container&&e===this.container&&this.hide()}),O(this.hideButtons,()=>this.hide())}hide(e=null){Ls(this.container,120,e),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(e=null,t=null){Ts(this.container,120,e),this.onkeyup=i=>{i.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=t}};var Wi=class extends g{setup(){this.container=this.$el,this.mode=this.$opts.mode,this.lightContainer=this.$refs.lightContainer,this.darkContainer=this.$refs.darkContainer,this.container.addEventListener("tabs-change",t=>{let r=t.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(r)});let e=t=>{this.updateAppColorsFromInputs(),t.target.name.startsWith("setting-app-color")&&this.updateLightForInput(t.target)};this.container.addEventListener("change",e),this.container.addEventListener("input",e)}handleModeChange(e){this.mode=e;let t=e==="dark";document.documentElement.classList.toggle("dark-mode",t),this.updateAppColorsFromInputs()}updateAppColorsFromInputs(){let t=(this.mode==="dark"?this.darkContainer:this.lightContainer).querySelectorAll('input[type="color"]');for(let i of t){let r=i.name.split("-"),o=r.indexOf("color"),s=r.slice(1,o).join("-");s==="app"&&(s="primary");let a=`--color-${s}`;document.body.style.setProperty(a,i.value)}}updateLightForInput(e){let t=e.name.replace("-color","-color-light"),i=e.value,r=this.hexToRgb(i),o=`rgba(${[r.r,r.g,r.b,"0.15"].join(",")})`,s=this.container.querySelector(`input[name="${t}"][type="hidden"]`);s.value=o}hexToRgb(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return{r:t?parseInt(t[1],16):0,g:t?parseInt(t[2],16):0,b:t?parseInt(t[3],16):0}}};var Gi=class extends g{setup(){this.colorInput=this.$refs.input,this.resetButton=this.$refs.resetButton,this.defaultButton=this.$refs.defaultButton,this.currentColor=this.$opts.current,this.defaultColor=this.$opts.default,this.resetButton.addEventListener("click",()=>this.setValue(this.currentColor)),this.defaultButton.addEventListener("click",()=>this.setValue(this.defaultColor))}setValue(e){this.colorInput.value=e,this.colorInput.dispatchEvent(new Event("change",{bubbles:!0}))}};var Ki=class extends g{setup(){this.typeControl=this.$refs.typeControl,this.pagePickerContainer=this.$refs.pagePickerContainer,this.typeControl.addEventListener("change",this.controlPagePickerVisibility.bind(this)),this.controlPagePickerVisibility()}controlPagePickerVisibility(){let e=this.typeControl.value==="page";this.pagePickerContainer.style.display=e?"block":"none"}};var Rf={move_up(n){let e=n.parentNode,t=Array.from(e.children).indexOf(n),i=Math.max(t-1,0);e.insertBefore(n,e.children[i]||null)},move_down(n){let e=n.parentNode,t=Array.from(e.children).indexOf(n),i=Math.min(t+2,e.children.length);e.insertBefore(n,e.children[i]||null)},remove(n,e,t){t.appendChild(n)},add(n,e){e.appendChild(n)}},Zi=class extends g{setup(){this.elem=this.$el,this.input=this.$refs.input,this.shelfBookList=this.$refs.shelfBookList,this.allBookList=this.$refs.allBookList,this.bookSearchInput=this.$refs.bookSearch,this.sortButtonContainer=this.$refs.sortButtonContainer,this.lastSort=null,this.initSortable(),this.setupListeners()}initSortable(){let e=this.elem.querySelectorAll(".scroll-box");for(let t of e)new Ye(t,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){this.elem.addEventListener("click",e=>{let t=e.target.closest(".scroll-box-item button[data-action]");t&&this.sortItemActionClick(t)}),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",e=>{let t=e.target.closest("button[data-sort]");t&&this.sortShelfBooks(t.dataset.sort)})}filterBooksByName(e){this.allBookList.style.height||(this.allBookList.style.height=`${this.allBookList.getBoundingClientRect().height}px`);let t=this.allBookList.children,i=e.trim().toLowerCase();for(let r of t){let o=!e||r.textContent.toLowerCase().includes(i);r.style.display=o?null:"none"}}sortItemActionClick(e){let t=e.closest(".scroll-box-item"),{action:i}=e.dataset,r=Rf[i];r(t,this.shelfBookList,this.allBookList),this.onChange()}onChange(){let e=Array.from(this.shelfBookList.querySelectorAll("[data-id]"));this.input.value=e.map(t=>t.getAttribute("data-id")).join(",")}sortShelfBooks(e){let t=Array.from(this.shelfBookList.children),i=e===this.lastSort;t.sort((r,o)=>{let s=r.dataset[e].toLowerCase(),a=o.dataset[e].toLowerCase();return i?a.localeCompare(s):s.localeCompare(a)});for(let r of t)this.shelfBookList.append(r);this.lastSort=this.lastSort===e?null:e,this.onChange()}};function Nf(n){let e={};for(let[t,i]of Object.entries(n))e[i]=t;return e}var Xi=class extends g{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=Nf(this.mapById),this.hintsShowing=!1,this.hideHints=this.hideHints.bind(this),this.hintAbortController=null,this.setupListeners()}setupListeners(){window.addEventListener("keydown",e=>{e.target.closest("input, select, textarea, .cm-editor")||this.handleShortcutPress(e)}),window.addEventListener("keydown",e=>{e.key==="?"&&(this.hintsShowing?this.hideHints():this.showHints())})}handleShortcutPress(e){let i=[e.ctrlKey?"Ctrl":"",e.metaKey?"Cmd":"",e.key].filter(o=>!!o).join(" + "),r=this.mapByShortcut[i];r&&this.runShortcut(r)&&e.preventDefault()}runShortcut(e){let t=this.container.querySelector(`[data-shortcut="${e}"]`);return t?t.matches("input, textarea, select")?(t.focus(),!0):t.matches("a, button")?(t.click(),!0):t.matches("div[tabindex]")?(t.click(),t.focus(),!0):(console.error("Shortcut attempted to be ran for element type that does not have handling setup",t),!1):!1}showHints(){let e=document.createElement("div");e.classList.add("shortcut-container"),this.container.append(e);let t=this.container.querySelectorAll("[data-shortcut]"),i=new Set;for(let o of t){let s=o.getAttribute("data-shortcut");if(i.has(s))continue;let a=this.mapById[s];this.showHintLabel(o,a,e),i.add(s)}this.hintAbortController=new AbortController;let r=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:r}),window.addEventListener("focus",this.hideHints,{signal:r}),window.addEventListener("blur",this.hideHints,{signal:r}),window.addEventListener("click",this.hideHints,{signal:r}),this.hintsShowing=!0}showHintLabel(e,t,i){let r=e.getBoundingClientRect(),o=document.createElement("div");o.classList.add("shortcut-hint"),o.textContent=t;let s=document.createElement("div");s.classList.add("shortcut-linkage"),s.style.left=`${r.x}px`,s.style.top=`${r.y}px`,s.style.width=`${r.width}px`,s.style.height=`${r.height}px`,i.append(o,s);let a=o.getBoundingClientRect();o.style.insetInlineStart=`${r.x+r.width-(a.width+6)}px`,o.style.insetBlockStart=`${r.y+(r.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var zf=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Yi=class extends g{setup(){this.input=this.$el,this.setupListeners()}setupListeners(){this.listenerRecordKey=this.listenerRecordKey.bind(this),this.input.addEventListener("focus",()=>{this.startListeningForInput()}),this.input.addEventListener("blur",()=>{this.stopListeningForInput()})}startListeningForInput(){this.input.addEventListener("keydown",this.listenerRecordKey)}listenerRecordKey(e){if(zf.includes(e.key))return;let t=[e.ctrlKey?"Ctrl":"",e.metaKey?"Cmd":"",e.key];this.input.value=t.filter(i=>!!i).join(" + ")}stopListeningForInput(){this.input.removeEventListener("keydown",this.listenerRecordKey)}};var Ji=class extends g{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let e=new Ye(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:e.toArray()})},setData(t,i){let r=i.getAttribute("data-drag-content");if(r){let o=JSON.parse(r);for(let[s,a]of Object.entries(o))t.setData(s,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Qi=class extends g{setup(){this.filter=this.$opts.filter,this.$el.addEventListener("change",e=>{if(this.filter&&!e.target.matches(this.filter))return;let t=this.$el.closest("form");t&&t.submit()})}};var er=class extends g{setup(){this.container=this.$el,this.tabList=this.container.querySelector('[role="tablist"]'),this.tabs=Array.from(this.tabList.querySelectorAll('[role="tab"]')),this.panels=Array.from(this.container.querySelectorAll(':scope > [role="tabpanel"], :scope > * > [role="tabpanel"]')),this.activeUnder=this.$opts.activeUnder?Number(this.$opts.activeUnder):1e4,this.active=null,this.container.addEventListener("click",e=>{let t=e.target.closest('[role="tab"]');t&&this.tabs.includes(t)&&this.show(t.getAttribute("aria-controls"))}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(e){for(let t of this.panels)t.toggleAttribute("hidden",t.id!==e);for(let t of this.tabs){let r=t.getAttribute("aria-controls")===e;t.setAttribute("aria-selected",r?"true":"false")}this.$emit("change",{showing:e})}updateActiveState(){let e=window.innerWidth<this.activeUnder;e!==this.active&&(e?this.activate():this.deactivate(),this.active=e)}activate(){let e=this.panels.find(t=>!t.hasAttribute("hidden"))||this.panels[0];this.show(e.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let e of this.panels)e.removeAttribute("hidden");for(let e of this.tabs)e.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var tr=class extends g{setup(){this.addRemoveComponentEl=this.$refs.addRemove,this.container=this.$el,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.container.addEventListener("input",e=>{let t=window.$components.firstOnElement(this.addRemoveComponentEl,"add-remove-rows");!this.hasEmptyRows()&&e.target.value&&t.add()})}hasEmptyRows(){return[...this.container.querySelectorAll(this.rowSelector)].find(i=>[...i.querySelectorAll("input")].filter(r=>r.value).length===0)!==void 0}};var nr=class extends g{setup(){this.container=this.$el,this.list=this.$refs.list,this.searchInput=this.$refs.searchInput,this.searchButton=this.$refs.searchButton,this.searchCancel=this.$refs.searchCancel,this.setupListeners()}setupListeners(){K(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),K(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),K(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),K(this.container,".template-item","dragstart",this.handleTemplateItemDragStart.bind(this)),this.searchInput.addEventListener("keypress",e=>{e.key==="Enter"&&(e.preventDefault(),this.performSearch())}),this.searchButton.addEventListener("click",()=>this.performSearch()),this.searchCancel.addEventListener("click",()=>{this.searchInput.value="",this.performSearch()})}handleTemplateItemClick(e,t){let i=t.closest("[template-id]").getAttribute("template-id");this.insertTemplate(i,"replace")}handleTemplateItemDragStart(e,t){let i=t.closest("[template-id]").getAttribute("template-id");e.dataTransfer.setData("bookstack/template",i),e.dataTransfer.setData("text/plain",i)}handleTemplateActionClick(e,t){e.stopPropagation();let i=t.getAttribute("template-action"),r=t.closest("[template-id]").getAttribute("template-id");this.insertTemplate(r,i)}async insertTemplate(e,t="replace"){let i=await window.$http.get(`/templates/${e}`),r=`editor::${t}`;window.$events.emit(r,i.data)}async handlePaginationClick(e,t){e.preventDefault();let i=t.getAttribute("href"),r=await window.$http.get(i);this.list.innerHTML=r.data}async performSearch(){let e=this.searchInput.value,t=await window.$http.get("/templates",{search:e});this.searchCancel.style.display=e?"block":"none",this.list.innerHTML=t.data}};var ir=class extends g{setup(){this.input=this.$el.querySelector("input[type=hidden]"),this.checkbox=this.$el.querySelector("input[type=checkbox]"),this.checkbox.addEventListener("change",this.stateChange.bind(this))}stateChange(){this.input.value=this.checkbox.checked?"true":"false";let e=new Event("change");this.input.dispatchEvent(e)}};var rr=class extends g{setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.lastLayoutType="none",this.onDestroy=null,this.scrollCache={content:0,info:0},this.lastTabShown="content",this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0})}updateLayout(){let e="tablet";window.innerWidth<=1e3&&(e="mobile"),window.innerWidth>=1400&&(e="desktop"),e!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),e==="desktop"?this.setupDesktop():e==="mobile"&&this.setupMobile(),this.lastLayoutType=e)}setupMobile(){for(let e of this.tabs)e.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let e of this.tabs)e.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(e){let{tab:t}=e.target.dataset;this.showTab(t)}showContent(){this.showTab("content",!1)}showTab(e,t=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let r of this.tabs){let o=r.dataset.tab===e;r.setAttribute("aria-selected",o?"true":"false")}let i=e==="info";if(this.container.classList.toggle("show-info",i),t){let o=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[e]||o,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[e]||o},50)}this.lastTabShown=e}};var or=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,K(this.container,"a.dropdown-search-item","click",this.selectUser.bind(this))}selectUser(e,t){e.preventDefault(),this.input.value=t.getAttribute("data-id"),this.userInfoContainer.innerHTML=t.innerHTML,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hide()}hide(){window.$components.firstOnElement(this.container,"dropdown").hide()}};var sr=class extends g{setup(){this.checkboxes=this.$el.querySelectorAll('input[type="checkbox"]'),this.allCheckbox=this.$el.querySelector('input[type="checkbox"][value="all"]'),this.$el.addEventListener("change",e=>{e.target.checked&&e.target===this.allCheckbox?this.deselectIndividualEvents():e.target.checked&&(this.allCheckbox.checked=!1)})}deselectIndividualEvents(){for(let e of this.checkboxes)e!==this.allCheckbox&&(e.checked=!1)}};function ou(n){for(let e=1;e<5;e++)n.shortcuts.add(`meta+${e}`,"",["FormatBlock",!1,`h${e+1}`]);n.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+o","","InsertOrderedList"),n.shortcuts.add("meta+p","","InsertUnorderedList"),n.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),n.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),n.shortcuts.add("meta+9","",()=>{let e=n.selection.getNode(),t=e?e.closest(".callout"):null,i=["info","success","warning","danger"],o=(i.findIndex(a=>t&&t.classList.contains(a))+1)%i.length,s=i[o];n.formatter.apply(`callout${s}`)}),n.shortcuts.add("meta+shift+K","",()=>{window.$components.first("entity-selector-popup").show(t=>{n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{href:t.link},n.dom.encode(t.name))):n.formatter.apply("link",{href:t.link}),n.selection.collapse(!1),n.focus()})})}function su(n){window.$events.listen("editor::replace",({html:e})=>{n.setContent(e)}),window.$events.listen("editor::append",({html:e})=>{let t=n.getContent()+e;n.setContent(t)}),window.$events.listen("editor::prepend",({html:e})=>{let t=e+n.getContent();n.setContent(t)}),window.$events.listen("editor::insert",({html:e})=>{n.insertContent(e)}),window.$events.listen("editor::focus",()=>{n.initialized&&n.focus()})}function Hf(n,e){let t=n.dom.get(encodeURIComponent(e).replace(/!/g,"%21"));t&&(t.scrollIntoView(),n.selection.select(t,!0),n.selection.collapse(!1),n.focus())}function au(n){let t=new URL(window.location).searchParams.get("content-id");t&&Hf(n,t)}var it,ar;function Uf(n){return n&&!!(n.textContent||n.innerText)}async function jf(n,e){if(n===null||n.type.indexOf("image")!==0)throw new Error("Not an image file");let t=n.name||`image-${Date.now()}.png`,i=new FormData;return i.append("file",n,t),i.append("uploaded_to",e),(await window.$http.post(window.baseUrl("/images/gallery"),i)).data}function lu(n,e,t){let i=new Fe(t.clipboardData||t.dataTransfer);if(!i.hasItems()||i.containsTabularData())return;let r=i.getImages();for(let o of r){let s=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");t.preventDefault(),setTimeout(()=>{n.insertContent(`<p><img src="${a}" id="${s}"></p>`),jf(o,e.pageId).then(l=>{let c=l.name.replace(/"/g,""),u=`<img src="${l.thumbs.display}" alt="${c}" />`,h=n.dom.create("a",{target:"_blank",href:l.url},u);n.dom.replace(h,s)}).catch(l=>{n.dom.remove(s),window.$events.emit("error",e.translations.imageUploadErrorText),console.error(l)})},10)}}function Vf(n){let e=n.selection.getNode();e.nodeName==="IMG"&&(it=n.dom.getParent(e,".mceTemp"),!it&&e.parentNode.nodeName==="A"&&!Uf(e.parentNode)&&(it=e.parentNode)),e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")==="false"&&(ar=e)}function Wf(n,e,t){let{dom:i}=n,r=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(t.clientX,t.clientY,n.getDoc()),o=t.dataTransfer&&t.dataTransfer.getData("bookstack/template");o&&(t.preventDefault(),window.$http.get(`/templates/${o}`).then(s=>{n.selection.setRng(r),n.undoManager.transact(()=>{n.execCommand("mceInsertContent",!1,s.data.html)})})),i.getParent(r.startContainer,".mceTemp")?t.preventDefault():it&&(t.preventDefault(),n.undoManager.transact(()=>{n.selection.setRng(r),n.selection.setNode(it),i.remove(it)})),!t.isDefaultPrevented()&&ar&&(t.preventDefault(),n.undoManager.transact(()=>{let s=n.selection.getNode(),a=n.selection.getRng(),l=s.closest("body > *");a.startOffset>a.startContainer.length/2?l.after(ar):l.before(ar)})),t.isDefaultPrevented()||lu(n,e,t),it=null}function cu(n,e){n.on("dragstart",()=>Vf(n)),n.on("drop",t=>Wf(n,e,t)),n.on("paste",t=>lu(n,e,t))}function uu(n){return["undo redo","styles","bold italic underline forecolor backcolor formatoverflow","alignleft aligncenter alignright alignjustify","bullist numlist listoverflow",n.textDirection==="rtl"?"ltr rtl":"","link table imagemanager-insert insertoverflow","code about fullscreen"].filter(i=>!!i).join(" | ")}function Gf(n){n.ui.registry.addGroupToolbarButton("formatoverflow",{icon:"more-drawer",tooltip:"More",items:"strikethrough superscript subscript inlinecode removeformat"}),n.ui.registry.addGroupToolbarButton("listoverflow",{icon:"more-drawer",tooltip:"More",items:"tasklist outdent indent"}),n.ui.registry.addGroupToolbarButton("insertoverflow",{icon:"more-drawer",tooltip:"More",items:"customhr codeeditor drawio media details"})}function Kf(n){n.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(e){return e.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function Zf(n){n.ui.registry.addContextToolbar("imagecontexttoolbar",{predicate(e){return e.closest("img")!==null},position:"node",scope:"node",items:"image"})}function hu(n){Gf(n),Kf(n),Zf(n)}var Xf={"table-delete-column":'<svg width="24" height="24"><path d="M21 19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14c1.1 0 2 .9 2 2zm-2 0V5h-4v2.2h-2V5h-2v2.2H9V5H5v14h4v-2.1h2V19h2v-2.1h2V19Z"/><path d="M14.829 10.585 13.415 12l1.414 1.414c.943.943-.472 2.357-1.414 1.414L12 13.414l-1.414 1.414c-.944.944-2.358-.47-1.414-1.414L10.586 12l-1.414-1.415c-.943-.942.471-2.357 1.414-1.414L12 10.585l1.344-1.343c1.111-1.112 2.2.627 1.485 1.343z" style="fill-rule:nonzero"/></svg>',"table-delete-row":'<svg width="24" height="24"><path d="M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14c0 1.1-.9 2-2 2zm0-2h14v-4h-2.2v-2H19v-2h-2.2V9H19V5H5v4h2.1v2H5v2h2.1v2H5Z"/><path d="M13.415 14.829 12 13.415l-1.414 1.414c-.943.943-2.357-.472-1.414-1.414L10.586 12l-1.414-1.414c-.944-.944.47-2.358 1.414-1.414L12 10.586l1.415-1.414c.942-.943 2.357.471 1.414 1.414L13.415 12l1.343 1.344c1.112 1.111-.627 2.2-1.343 1.485z" style="fill-rule:nonzero"/></svg>',"table-insert-column-after":'<svg width="24" height="24"><path d="M16 5h-5v14h5c1.235 0 1.234 2 0 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11c1.229 0 1.236 2 0 2zm-7 6V5H5v6zm0 8v-6H5v6zm11.076-6h-2v2c0 1.333-2 1.333-2 0v-2h-2c-1.335 0-1.335-2 0-2h2V9c0-1.333 2-1.333 2 0v2h1.9c1.572 0 1.113 2 .1 2z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path d="M8 19h5V5H8C6.764 5 6.766 3 8 3h11a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H8c-1.229 0-1.236-2 0-2zm7-6v6h4v-6zm0-8v6h4V5ZM3.924 11h2V9c0-1.333 2-1.333 2 0v2h2c1.335 0 1.335 2 0 2h-2v2c0 1.333-2 1.333-2 0v-2h-1.9c-1.572 0-1.113-2-.1-2z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path d="M5 8v5h14V8c0-1.235 2-1.234 2 0v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8C3 6.77 5 6.764 5 8zm6 7H5v4h6zm8 0h-6v4h6zM13 3.924v2h2c1.333 0 1.333 2 0 2h-2v2c0 1.335-2 1.335-2 0v-2H9c-1.333 0-1.333-2 0-2h2v-1.9c0-1.572 2-1.113 2-.1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path d="M19 16v-5H5v5c0 1.235-2 1.234-2 0V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v11c0 1.229-2 1.236-2 0zm-6-7h6V5h-6zM5 9h6V5H5Zm6 11.076v-2H9c-1.333 0-1.333-2 0-2h2v-2c0-1.335 2-1.335 2 0v2h2c1.333 0 1.333 2 0 2h-2v1.9c0 1.572-2 1.113-2 .1z"/></svg>',table:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2ZM5 14v5h6v-5zm14 0h-6v5h6zm0-7h-6v5h6zM5 12h6V7H5Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><path d="M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14c0 1.1-.9 2-2 2zm0-2h14V5H5v14z"/><path d="m13.711 15.423-1.71-1.712-1.712 1.712c-1.14 1.14-2.852-.57-1.71-1.712l1.71-1.71-1.71-1.712c-1.143-1.142.568-2.853 1.71-1.71L12 10.288l1.711-1.71c1.141-1.142 2.852.57 1.712 1.71L13.71 12l1.626 1.626c1.345 1.345-.76 2.663-1.626 1.797z" style="fill-rule:nonzero;stroke-width:1.20992"/></svg>'};function du(n){for(let[e,t]of Object.entries(Xf))n.ui.registry.addIcon(e,t)}function pu(n){return n.tagName.toLowerCase()==="code-block"}function mu(n,e,t,i){let r=window.$components.first("code-editor"),o=n.selection.getBookmark();r.open(e,t,(s,a)=>{i(s,a),n.focus(),n.selection.moveToBookmark(o)},()=>{n.focus(),n.selection.moveToBookmark(o)})}function fu(n,e){mu(n,e.getContent(),e.getLanguage(),(t,i)=>{e.setContent(t,i)})}function Yf(n){let e=n.getDoc(),t=e.defaultView;class i extends t.HTMLElement{constructor(){super();se(this,"editor",null);this.attachShadow({mode:"open"});let s=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(s).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let s=c=>(c.split(" ").filter(h=>h.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return s(l.className)||a&&s(a.className)||""}setContent(s,a){this.editor&&(this.editor.setContent(s),this.editor.setMode(a,s));let l=this.querySelector("pre");l||(l=e.createElement("pre"),this.append(l)),l.innerHTML="";let c=e.createElement("code");l.append(c),c.innerText=s,c.className=`language-${a}`}getContent(){let s=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=s.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(`
`);return a.textContent}connectedCallback(){let s=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split(`
`).length*19.2+18+24;this.style.height=`${c}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),h=d=>{this.editor=d.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(d=>{let p=Date.now()-s<20?20:0;setTimeout(()=>h(d),p)})}cleanChildContent(){let s=this.querySelector("pre");if(s)for(let a of s.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}t.customElements.define("code-block",i)}function Jf(n){n.ui.registry.addIcon("codeblock",'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5Z"/><path d="M11.103 15.423c.277.277.277.738 0 .922a.692.692 0 0 1-1.106 0l-4.057-3.78a.738.738 0 0 1 0-1.107l4.057-3.872c.276-.277.83-.277 1.106 0a.724.724 0 0 1 0 1.014L7.6 12.012ZM12.897 8.577c-.245-.312-.2-.675.08-.955.28-.281.727-.27 1.027.033l4.057 3.78a.738.738 0 0 1 0 1.107l-4.057 3.872c-.277.277-.83.277-1.107 0a.724.724 0 0 1 0-1.014l3.504-3.412z"/></svg>'),n.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){n.execCommand("codeeditor")}}),n.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){n.execCommand("codeeditor")}}),n.addCommand("codeeditor",()=>{let e=n.selection.getNode(),t=e.ownerDocument;if(pu(e))fu(n,e);else{let i=n.selection.getContent({format:"text"});mu(n,i,"",(r,o)=>{let s=t.createElement("pre"),a=t.createElement("code");a.classList.add(`language-${o}`),a.innerText=r,s.append(a),n.insertContent(s.outerHTML)})}}),n.on("dblclick",()=>{let e=n.selection.getNode();pu(e)&&fu(n,e)}),n.on("PreInit",()=>{n.parser.addNodeFilter("pre",e=>{for(let t of e){let i=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),r=t.getAll("span");for(let o of r)o.unwrap();t.attr("style",null),t.wrap(i)}}),n.parser.addNodeFilter("code-block",e=>{for(let t of e)t.attr("contenteditable","false")}),n.serializer.addNodeFilter("code-block",e=>{for(let t of e)t.unwrap()})}),n.ui.registry.addContextToolbar("codeeditor",{predicate(e){return e.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),n.on("PreInit",()=>{Yf(n)})}function gu(){return Jf}var de=null,ot=null,rt={};function zo(n){return n.hasAttribute("drawio-diagram")}function Qf(n,e=null){de=n,ot=e,window.$components.first("image-manager").show(i=>{if(e){let r=e.querySelector("img");de.undoManager.transact(()=>{de.dom.setAttrib(r,"src",i.url),de.dom.setAttrib(e,"drawio-diagram",i.id)})}else{let r=`<div drawio-diagram="${i.id}" contenteditable="false"><img src="${i.url}"></div>`;de.insertContent(r)}},"drawio")}async function em(n){let e=window.baseUrl("/loading.gif"),t=o=>{o.status===413?window.$events.emit("error",rt.translations.serverUploadLimitText):window.$events.emit("error",rt.translations.imageUploadErrorText),console.error(o)};if(ot){tt();let o=ot.querySelector("img");try{let s=await Po(n,rt.pageId);de.undoManager.transact(()=>{de.dom.setAttrib(o,"src",s.url),de.dom.setAttrib(ot,"drawio-diagram",s.id)})}catch(s){throw t(s),new Error(`Failed to save image with error: ${s}`)}return}await ns(5);let i=`drawing-${Math.random().toString(16).slice(2)}`,r=`drawing-wrap-${Math.random().toString(16).slice(2)}`;de.insertContent(`<div drawio-diagram contenteditable="false" id="${r}"><img src="${e}" id="${i}"></div>`),tt();try{let o=await Po(n,rt.pageId);de.undoManager.transact(()=>{de.dom.setAttrib(i,"src",o.url),de.dom.setAttrib(r,"drawio-diagram",o.id)})}catch(o){throw de.dom.remove(r),t(o),new Error(`Failed to save image with error: ${o}`)}}function tm(){if(!ot)return Promise.resolve("");let n=ot.getAttribute("drawio-diagram");return _i(n)}function bu(n,e=null){de=n,ot=e,en(rt.drawioUrl,tm,em)}function nm(n){n.addCommand("drawio",()=>{let e=n.selection.getNode();bu(n,zo(e)?e:null)}),n.ui.registry.addIcon("diagram",`<svg width="24" height="24" fill="${rt.darkMode?"#BBB":"#000000"}" xmlns="http://www.w3.org/2000/svg"><path d="M20.716 7.639V2.845h-4.794v1.598h-7.99V2.845H3.138v4.794h1.598v7.99H3.138v4.794h4.794v-1.598h7.99v1.598h4.794v-4.794h-1.598v-7.99zM4.736 4.443h1.598V6.04H4.736zm1.598 14.382H4.736v-1.598h1.598zm9.588-1.598h-7.99v-1.598H6.334v-7.99h1.598V6.04h7.99v1.598h1.598v7.99h-1.598zm3.196 1.598H17.52v-1.598h1.598zM17.52 6.04V4.443h1.598V6.04zm-4.21 7.19h-2.79l-.582 1.599H8.643l2.717-7.191h1.119l2.724 7.19h-1.302zm-2.43-1.006h2.086l-1.039-3.06z"/></svg>`),n.ui.registry.addSplitButton("drawio",{tooltip:"Insert/edit drawing",icon:"diagram",onAction(){n.execCommand("drawio"),window.document.body.dispatchEvent(new Event("mousedown",{bubbles:!0}))},fetch(e){e([{type:"choiceitem",text:"Drawing manager",value:"drawing-manager"}])},onItemAction(e,t){if(t==="drawing-manager"){let i=n.selection.getNode();Qf(n,zo(i)?i:null)}}}),n.on("dblclick",()=>{let e=n.selection.getNode();zo(e)&&bu(n,e)}),n.on("SetContent",()=>{let e=n.dom.select("body > div[drawio-diagram]");e.length&&n.undoManager.transact(()=>{for(let t of e)t.setAttribute("contenteditable","false")})})}function vu(n){return rt=n,nm}function im(n){n.addCommand("InsertHorizontalRule",()=>{let e=document.createElement("hr"),t=n.selection.getNode(),{parentNode:i}=t;i.insertBefore(e,t)}),n.ui.registry.addButton("customhr",{icon:"horizontal-rule",tooltip:"Insert horizontal line",onAction(){n.execCommand("InsertHorizontalRule")}})}function wu(){return im}function rm(n){n.ui.registry.addButton("imagemanager-insert",{title:"Insert image",icon:"image",tooltip:"Insert image",onAction(){window.$components.first("image-manager").show(t=>{let i=t.thumbs.display||t.url,r=`<a href="${t.url}" target="_blank">`;r+=`<img src="${i}" alt="${t.name}">`,r+="</a>",n.execCommand("mceInsertContent",!1,r)},"gallery")}})}function yu(){return rm}function om(n){let e={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/wysiwyg")};n.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(e)}})}function xu(){return om}var ku=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function lr(n){return n.selection.getNode().closest("details")}function sm(n,e){let t=lr(n);t&&n.undoManager.transact(()=>{let i=t.querySelector("summary");i||(i=document.createElement("summary"),t.prepend(i)),i.textContent=e})}function am(n){return{title:"Edit collapsible block",body:{type:"panel",items:[{type:"input",name:"summary",label:"Toggle label"}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",text:"Save",primary:!0}],onSubmit(e){let{summary:t}=e.getData();sm(n,t),e.close()}}}function lm(n){let e=n.querySelector("summary");return e?e.textContent:""}function Cu(n){let e=lr(n);n.windowManager.open(am(n)).setData({summary:lm(e)})}function cm(n){let e=n.selection.getNode().closest("details"),t=n.selection.getBookmark();if(e){let i=e.querySelectorAll("details > *:not(summary, doc-root), doc-root > *");n.undoManager.transact(()=>{for(let r of i)e.parentNode.insertBefore(r,e);e.remove()})}n.focus(),n.selection.moveToBookmark(t)}function Ho(n){n.attr("contenteditable",null);let e=!1;for(let t of n.children())t.name==="doc-root"&&(t.unwrap(),e=!0);e&&Ho(n)}function um(n){Ho(n),n.attr("contenteditable","false");let e=window.tinymce.html.Node.create("doc-root",{contenteditable:"true"}),t=null;for(let i of n.children()){if(i.name==="summary")continue;ku.includes(i.name)?(e.append(i),t=null):(t||(t=window.tinymce.html.Node.create("p"),e.append(t)),t.append(i))}n.append(e)}function hm(n){n.parser.addNodeFilter("details",e=>{for(let t of e)um(t)}),n.serializer.addNodeFilter("details",e=>{for(let t of e)Ho(t),t.attr("open",null)}),n.serializer.addNodeFilter("doc-root",e=>{for(let t of e)t.unwrap()})}function dm(n){n.ui.registry.addIcon("details",'<svg width="24" height="24"><path d="M8.2 9a.5.5 0 0 0-.4.8l4 5.6a.5.5 0 0 0 .8 0l4-5.6a.5.5 0 0 0-.4-.8ZM20.122 18.151h-16c-.964 0-.934 2.7 0 2.7h16c1.139 0 1.173-2.7 0-2.7zM20.122 3.042h-16c-.964 0-.934 2.7 0 2.7h16c1.139 0 1.173-2.7 0-2.7z"/></svg>'),n.ui.registry.addIcon("togglefold",'<svg height="24" width="24"><path d="M8.12 19.3c.39.39 1.02.39 1.41 0L12 16.83l2.47 2.47c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41l-3.17-3.17c-.39-.39-1.02-.39-1.41 0l-3.17 3.17c-.4.38-.4 1.02-.01 1.41zm7.76-14.6c-.39-.39-1.02-.39-1.41 0L12 7.17 9.53 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.03 0 1.42l3.17 3.17c.39.39 1.02.39 1.41 0l3.17-3.17c.4-.39.4-1.03.01-1.42z"/></svg>'),n.ui.registry.addIcon("togglelabel",'<svg height="18" width="18" viewBox="0 0 24 24"><path d="M21.41,11.41l-8.83-8.83C12.21,2.21,11.7,2,11.17,2H4C2.9,2,2,2.9,2,4v7.17c0,0.53,0.21,1.04,0.59,1.41l8.83,8.83 c0.78,0.78,2.05,0.78,2.83,0l7.17-7.17C22.2,13.46,22.2,12.2,21.41,11.41z M6.5,8C5.67,8,5,7.33,5,6.5S5.67,5,6.5,5S8,5.67,8,6.5 S7.33,8,6.5,8z"/></svg>'),n.ui.registry.addButton("details",{icon:"details",tooltip:"Insert collapsible block",onAction(){n.execCommand("InsertDetailsBlock")}}),n.ui.registry.addButton("removedetails",{icon:"table-delete-table",tooltip:"Unwrap",onAction(){cm(n)}}),n.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){Cu(n)}}),n.on("dblclick",e=>{!lr(n)||e.target.closest("doc-root")||Cu(n)}),n.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){lr(n).toggleAttribute("open"),n.focus()}}),n.addCommand("InsertDetailsBlock",()=>{let e=n.selection.getContent({format:"html"}),t=document.createElement("details"),i=document.createElement("summary"),r=`details-${Date.now()}`;t.setAttribute("data-id",r),t.appendChild(i),e||(e="<p><br></p>"),t.innerHTML+=e,n.insertContent(t.outerHTML),n.focus();let o=n.dom.select(`[data-id="${r}"]`)[0]||null;if(o){let s=o.querySelector("doc-root > *");s&&s.focus(),o.removeAttribute("data-id")}}),n.ui.registry.addContextToolbar("details",{predicate(e){return e.nodeName.toLowerCase()==="details"},items:"editdetials toggledetails removedetails",position:"node",scope:"node"}),n.on("PreInit",()=>{hm(n)})}function Eu(){return dm}function pm(n){let e=n.closest("li");return e&&e.parentNode.nodeName==="UL"&&e.classList.contains("task-list-item")}function fm(n,e,t){let i=e.getBoundingClientRect();n.clientX<=i.right&&n.clientX>=i.left&&n.clientY>=i.top&&n.clientY<=i.bottom||t.undoManager.transact(()=>{e.hasAttribute("checked")?e.removeAttribute("checked"):e.setAttribute("checked","checked")})}function mm(n){n.attr("class","task-list-item");for(let e of n.children())e.name==="input"&&(e.attr("checked")==="checked"&&n.attr("checked","checked"),e.remove())}function gm(n){let e=n.attr("checked")==="checked";n.attr("checked",null);let t={type:"checkbox",disabled:"disabled"};e&&(t.checked="checked");let i=window.tinymce.html.Node.create("input",t);i.shortEnded=!0,n.firstChild?n.insert(i,n.firstChild,!0):n.append(i)}function bm(n){n.ui.registry.addIcon("tasklist",'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22,8c0-0.55-0.45-1-1-1h-7c-0.55,0-1,0.45-1,1s0.45,1,1,1h7C21.55,9,22,8.55,22,8z M13,16c0,0.55,0.45,1,1,1h7 c0.55,0,1-0.45,1-1c0-0.55-0.45-1-1-1h-7C13.45,15,13,15.45,13,16z M10.47,4.63c0.39,0.39,0.39,1.02,0,1.41l-4.23,4.25 c-0.39,0.39-1.02,0.39-1.42,0L2.7,8.16c-0.39-0.39-0.39-1.02,0-1.41c0.39-0.39,1.02-0.39,1.41,0l1.42,1.42l3.54-3.54 C9.45,4.25,10.09,4.25,10.47,4.63z M10.48,12.64c0.39,0.39,0.39,1.02,0,1.41l-4.23,4.25c-0.39,0.39-1.02,0.39-1.42,0L2.7,16.16 c-0.39-0.39-0.39-1.02,0-1.41s1.02-0.39,1.41,0l1.42,1.42l3.54-3.54C9.45,12.25,10.09,12.25,10.48,12.64L10.48,12.64z"/></svg>'),n.ui.registry.addToggleButton("tasklist",{tooltip:"Task list",icon:"tasklist",active:!1,onAction(i){i.isActive()?n.execCommand("RemoveList"):n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:"task-list-item"},"list-style-type":"tasklist"})},onSetup(i){n.on("NodeChange",r=>{let o=r.parents.find(a=>a.nodeName==="LI"),s=o&&o.classList.contains("task-list-item");i.setActive(!!s)})}});let e=n.ui.registry.getAll().buttons.bullist;e.onSetup=function(r){n.on("NodeChange",o=>{let s=o.parents.find(c=>c.nodeName==="LI"),a=s&&s.classList.contains("task-list-item"),l=s&&s.parentNode.nodeName==="UL";r.setActive(!!(l&&!a))})},e.onAction=function(){pm(n.selection.getNode())&&n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}}),n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:null}})};let t=n.ui.registry.getAll().buttons.numlist;t.onAction=function(){n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}})},n.on("PreInit",()=>{n.parser.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&mm(r)}),n.serializer.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&gm(r)})}),n.on("click",i=>{let r=i.target;r.nodeName==="LI"&&r.classList.contains("task-list-item")&&(fm(i,r,n),i.preventDefault())})}function _u(){return bm}var vm=[{title:"Large Header",format:"h2",preview:"color: blue;"},{title:"Medium Header",format:"h3"},{title:"Small Header",format:"h4"},{title:"Tiny Header",format:"h5"},{title:"Paragraph",format:"p",exact:!0,classes:""},{title:"Blockquote",format:"blockquote"},{title:"Callouts",items:[{title:"Information",format:"calloutinfo"},{title:"Success",format:"calloutsuccess"},{title:"Warning",format:"calloutwarning"},{title:"Danger",format:"calloutdanger"}]}],wm={alignleft:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-left"},aligncenter:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-center"},alignright:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-right"},calloutsuccess:{block:"p",exact:!0,attributes:{class:"callout success"}},calloutinfo:{block:"p",exact:!0,attributes:{class:"callout info"}},calloutwarning:{block:"p",exact:!0,attributes:{class:"callout warning"}},calloutdanger:{block:"p",exact:!0,attributes:{class:"callout danger"}}},ym=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function xm(n,e,t){t.filetype==="file"&&window.$components.first("entity-selector-popup").show(r=>{n(r.link,{text:r.name,title:r.name})}),t.filetype==="image"&&window.$components.first("image-manager").show(r=>{n(r.url,{alt:r.name})},"gallery")}function km(n){let e=["image","table","link","autolink","fullscreen","code","customhr","autosave","lists","codeeditor","media","imagemanager","about","details","tasklist",n.textDirection==="rtl"?"directionality":""];return window.tinymce.PluginManager.add("codeeditor",gu()),window.tinymce.PluginManager.add("customhr",wu()),window.tinymce.PluginManager.add("imagemanager",yu()),window.tinymce.PluginManager.add("about",xu()),window.tinymce.PluginManager.add("details",Eu()),window.tinymce.PluginManager.add("tasklist",_u()),n.drawioUrl&&(window.tinymce.PluginManager.add("drawio",vu(n)),e.push("drawio")),e.filter(t=>!!t)}function Cm(){let n=document.head.innerHTML.split(`
`),e=n.findIndex(i=>i.trim()==="<!-- Start: custom user content -->"),t=n.findIndex(i=>i.trim()==="<!-- End: custom user content -->");return e===-1||t===-1?"":n.slice(e+1,t).join(`
`)}function Em(n){n.serializer.addNodeFilter("br",e=>{for(let t of e)if(t.parent&&t.parent.name==="code"){let i=window.tinymce.html.Node.create("#text");i.value=`
`,t.replace(i)}})}function _m(n){return function(t){function i(){n.darkMode&&t.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change","")}t.on("ExecCommand change input NodeChange ObjectResized",i),su(t),cu(t,n),t.on("init",()=>{i(),au(t),window.editor=t,ou(t)}),t.on("PreInit",()=>{Em(t)}),window.$events.emitPublic(n.containerElement,"editor-tinymce::setup",{editor:t}),t.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){t.execCommand("mceToggleFormat",!1,"code")}})}}function Sm(n){return`
html, body, html.dark-mode {
background: ${n.darkMode?"#222":"#fff"};
}
body {
padding-left: 15px !important;
padding-right: 15px !important;
height: initial !important;
margin:0!important;
margin-left: auto! important;
margin-right: auto !important;
overflow-y: hidden !important;
}`.trim().replace(`
`,"")}function Su(n){return window.tinymce.addI18n(n.language,n.translationMap),{width:"100%",height:"100%",selector:"#html-editor",cache_suffix:`?version=${document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1]}`,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:n.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"page-content",browser_spellcheck:!0,relative_urls:!1,language:n.language,directionality:n.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,paste_data_images:!1,extended_valid_elements:"pre[*],svg[*],div[drawio-diagram],details[*],summary[*],div[*],li[class|checked|style]",automatic_uploads:!1,custom_elements:"doc-root,code-block",valid_children:["-div[p|h1|h2|h3|h4|h5|h6|blockquote|code-block]","+div[pre|img]","-doc-root[doc-root|#text]","-li[details]","+code-block[pre]","+doc-root[p|h1|h2|h3|h4|h5|h6|blockquote|code-block|div|hr]"].join(","),plugins:km(n),contextmenu:!1,toolbar:uu(n),content_style:Sm(n),style_formats:vm,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:wm,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:ym,file_picker_callback:xm,paste_preprocess(t,i){let{content:r}=i;r.indexOf('<img src="file://')!==-1&&(i.content="")},init_instance_callback(t){let i=t.getDoc().querySelector("head");i.innerHTML+=Cm()},setup(t){du(t),hu(t),_m(n)(t)}}}var cr=class extends g{setup(){this.elem=this.$el,this.pageId=this.$opts.pageId,this.textDirection=this.$opts.textDirection,this.isDarkMode=document.documentElement.classList.contains("dark-mode"),this.tinyMceConfig=Su({language:this.$opts.language,containerElement:this.elem,darkMode:this.isDarkMode,textDirection:this.textDirection,drawioUrl:this.getDrawIoUrl(),pageId:Number(this.pageId),translations:{imageUploadErrorText:this.$opts.imageUploadErrorText,serverUploadLimitText:this.$opts.serverUploadLimitText},translationMap:window.editor_translations}),window.$events.emitPublic(this.elem,"editor-tinymce::pre-init",{config:this.tinyMceConfig}),window.tinymce.init(this.tinyMceConfig).then(e=>{this.editor=e[0]})}getDrawIoUrl(){let e=document.querySelector("[drawio-url]");return e?e.getAttribute("drawio-url"):""}getContent(){return{html:this.editor.getContent()}}};window.baseUrl=function(e){let t=e,i=document.querySelector('meta[name="base-url"]').getAttribute("content");return i[i.length-1]==="/"&&(i=i.slice(0,i.length-1)),t[0]==="/"&&(t=t.slice(1)),`${i}/${t}`};window.importVersioned=function(e){let t=document.querySelector('link[href*="/dist/styles.css?version="]').href.split("?version=").pop();return import(window.baseUrl(`dist/${e}.js?version=${t}`))};window.$http=pr;window.$events=dr;var Et=new Ko;window.trans=Et.get.bind(Et);window.trans_choice=Et.getPlural.bind(Et);window.trans_plural=Et.parsePlural.bind(Et);vr(Uo);window.$components=wr;br();
/*! Bundled license information:
sortablejs/modular/sortable.esm.js:
(**!
* Sortable 1.15.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*)
*/
//# sourceMappingURL=app.js.map