bookstack/public/dist/app.js

55 lines
293 KiB
JavaScript
Raw Normal View History

var Lu=Object.create;var _t=Object.defineProperty;var Iu=Object.getOwnPropertyDescriptor;var $u=Object.getOwnPropertyNames;var Mu=Object.getPrototypeOf,Fu=Object.prototype.hasOwnProperty;var qu=(n,e,t)=>e in n?_t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Bu=(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 $u(e))!Fu.call(n,r)&&r!==t&&_t(n,r,{get:()=>e[r],enumerable:!(i=Iu(e,r))||i.enumerable});return n};var Wo=(n,e,t)=>(t=n!=null?Lu(Mu(n)):{},Vo(e||!n||!n.__esModule?_t(t,"default",{value:n,enumerable:!0}):t,n)),Pu=n=>Vo(_t({},"__esModule",{value:!0}),n);var se=(n,e,t)=>(qu(n,typeof e!="symbol"?e+"":e,t),t),Ou=(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)=>(Ou(n,e,"access private method"),t);var $s=_((Db,qh)=>{qh.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",brvb
`,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:"\u01
`," "],Hh=["{","}","|","\\","^","`"].concat(zh),Uh=["'"].concat(Hh),Us=["%","/","?",";","#"].concat(Uh),js=["/","?","#"],jh=255,Vs=/^[+a-z0-9A-Z_-]{0,63}$/,Vh=/^([+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 Wh(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=Nh.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Oh.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(Vh);x&&(w.push(x[1]),E.unshift(x[2])),E.length&&(a=E.join(".")+a),this.hostname=w.join(".");break}}}}this.hostname.length>jh&&(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=Rh.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=Wh});var Gr=_((qb,Kt)=>{"use strict";Kt.exports.encode=Ps();Kt.exports.decode=Ns();Kt.exports.format=Hs();Kt.exports.parse=Zs()});var Kr=_((Bb,Xs)=>{Xs.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/});var Zr=_((Pb,Ys)=>{Ys.exports=/[\0-\x1F\x7F-\x9F]/});var Qs=_((Ob,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=_((Rb,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 Gh(n){return Object.prototype.toString.call(n)}function Kh(n){return Gh(n)==="[object String]"}var Zh=Object.prototype.hasOwnProperty;function ia(n,e){return Zh.call(n,e)}function Xh(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 Yh(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,Jh=/&([a-z#][a-z0-9]{1,31});/gi,Qh=new RegExp(sa.source+"|"+Jh.source,"gi"),ed=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,na=Wr();function td(n,e){var t=0;return ia(na,e)?na[e]:e.charCodeAt(0)===35&&ed.test(e)&&(t=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10),ra(t))?oa(t):n}function nd(n){return n.indexOf("\\")<0?n:n.replace(sa,"$1")}function id(n){return n.indexOf("\\
`};De.fence=function(n,e,t,i,r){var o=n[e],s=o.info?wd(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=vd({},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=_((Gb,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=_((Kb,va)=>{"use strict";var yd=/\r\n?|\n/g,xd=/\0/g;va.exports=function(e){var t;t=e.src.replace(yd,`
`),t=t.replace(xd,"\uFFFD"),e.src=t}});var xa=_((Zb,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=_((Xb,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=_((Yb,Ea)=>{"use strict";var kd=R().arrayReplaceAt;function Cd(n){return/^<a[>\s]/i.test(n)}function Ed(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"&&(Cd(a.content)&&f>0&&f--,Ed(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=kd(o,t,l)}}}}});var Da=_((Jb,Aa)=>{"use strict";var Sa=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,_d=/\((c|tm|r)\)/i,Sd=/\((c|tm|r)\)/ig,Ad={c:"\xA9",r:"\xAE",tm:"\u2122"};function Dd(n,e){return Ad[e.toLowerCase()]}function Td(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(Sd,Dd)),t.type==="link_open"&&t.info==="auto"&&i--,t.type==="link_close"&&t.info==="auto"&&i++}function Ld(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"&&(_d.test(e.tokens[t].content)&&Td(e.tokens[t].children),Sa.test(e.tokens[t].content)&&Ld(e.tokens[t].children))}});var qa=_((Qb,Fa)=>{"use strict";var Ta=R().isWhiteSpace,La=R().isPunctChar,Ia=R().isMdAsciiPunct,Id=/['"]/,$a=/['"]/g,Ma="\u2019";function hi(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function $d(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=
`,s.map=[t,e.line],!0}});var Xa=_((sv,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=_((av,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=_((lv,el)=>{"use strict";var qd=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&&!qd(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=_((cv,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 Bd(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.blkInde
`);hr(e)}}function ju(n){n.status&&n.status>=400&&n.data&&n.data.message&&hr(n.data.message)}var pr={};St(pr,{HttpError:()=>sn,createXMLHttpRequest:()=>Wu,delete:()=>Yu,get:()=>Gu,patch:()=>Xu,post:()=>Ku,put:()=>Zu});async function Vu(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 Wu(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 Vu(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 Gu(n,e={}){return Go(n,{method:"GET",params:e})}async function Ku(n,e=null){return an("POST",n,e)}async function Zu(n,e=null){return an("PUT",n,e)}async function Xu(n,e=null){return an("PATCH",n,e)}async function Yu(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:()=>th,firstOnElement:()=>ih,get:()=>nh,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 Ju(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 Qu(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 eh(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=Ju(n,e);i.$refs=o.refs,i.$manyRefs=o.manyRefs,i.$opts=Qu(n,e),i.setup()}catch(o){console.error("Failed to cre
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var dh="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 ph(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=ph(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 fh(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);re
`).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 qf(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=qf(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.ac
`).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 Bf(n,e){yr(`#page-navigation a[href="#${n}"]`,t=>{t.closest("li").classList.toggle("current-heading",e)})}function Pf(n){for(let e of n){let t=e.intersectionRatio===1;Bf(e.target.id,t)}}function O
`,t.replace(i)}})}function Qf(n){n.parser.addNodeFilter("div",e=>{for(let t of e)(t.attr("id")==="pointer"||t.attr("class").includes("pointer"))&&t.remove()})}function pu(n){Jf(n),Qf(n)}function fu(n){return n.tagName.toLowerCase()==="code-block"}function gu(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 mu(n,e){gu(n,e.getContent(),e.getLanguage(),(t,i)=>{e.setContent(t,i)})}function em(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 tm(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(fu(e))mu(n,e);else{let i=n.selection.getContent({format:"text"});gu(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();fu(e)&&mu(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",()=>{em(n)})}function bu(){return tm}var de=null,ot=null,rt={};function zo(n){return n.hasAttribute("drawio-diagram")}function nm(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 im(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 rm(){if(!ot)return Promise.resolve("");let n=ot.getAttribute("drawio-diagram");return _i(n)}function vu(n,e=null){de=n,ot=e,en(rt.drawioUrl,rm,im)}function om(n){n.addCommand("drawio",()=>{let e=n.selection.getNode();vu(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.
`),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 Am(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",()=>{pu(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 Dm(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 Au(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:_m(n),contextmenu:!1,toolbar:uu(n),content_style:Dm(n),style_formats:xm,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:km,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:Cm,file_picker_callback:Em,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+=Sm()},setup(t){du(t),hu(t),Am(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=Au({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