2023-05-08 23:05:50 +08:00
var vu = Object . create ; var Ct = Object . defineProperty ; var yu = Object . getOwnPropertyDescriptor ; var wu = Object . getOwnPropertyNames ; var xu = Object . getPrototypeOf , ku = Object . prototype . hasOwnProperty ; var Cu = ( n , e , t ) => e in n ? Ct ( n , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : n [ e ] = t ; var _u = ( n , e ) => ( ) => ( n && ( e = n ( n = 0 ) ) , e ) ; var E = ( n , e ) => ( ) => ( e || n ( ( e = { exports : { } } ) . exports , e ) , e . exports ) , _t = ( n , e ) => { for ( var t in e ) Ct ( n , t , { get : e [ t ] , enumerable : ! 0 } ) } , qo = ( n , e , t , i ) => { if ( e && typeof e == "object" || typeof e == "function" ) for ( let r of wu ( e ) ) ! ku . call ( n , r ) && r !== t && Ct ( n , r , { get : ( ) => e [ r ] , enumerable : ! ( i = yu ( e , r ) ) || i . enumerable } ) ; return n } ; var Bo = ( n , e , t ) => ( t = n != null ? vu ( xu ( n ) ) : { } , qo ( e || ! n || ! n . _ _esModule ? Ct ( t , "default" , { value : n , enumerable : ! 0 } ) : t , n ) ) , Eu = n => qo ( Ct ( { } , "__esModule" , { value : ! 0 } ) , n ) ; var se = ( n , e , t ) => ( Cu ( n , typeof e != "symbol" ? e + "" : e , t ) , t ) , Su = ( 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 ) => ( Su ( n , e , "access private method" ) , t ) ; var xs = E ( ( db , Ch ) => { Ch . 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:" \u 2204",nexists:" \u 2204",Nfr:" \u {1D511}",nfr:" \u {1D52B}",ngE:" \u 2267 \u 0338",nge:" \u 2271",ngeq:" \u 2271",ngeqq:" \u 2267 \u 0338",ngeqslant:" \u 2A7E \u 0338",nges:" \u 2A7E \u 0338",nGg:" \u 22D9 \u 0338",ngsim:" \u 2275",nGt:" \u 226B \u 20D2",ngt:" \u 226F",ngtr:" \u 226F",nGtv:" \u 226B \u 0338",nharr:" \u 21AE",nhArr:" \u 21CE",nhpar:" \u 2AF2",ni:" \u 220B",nis:" \u 22FC",nisd:" \u 22FA",niv:" \u 220B",NJcy:" \u 040A",njcy:" \u 045A",nlarr:" \u 219A",nlArr:" \u 21CD",nldr:" \u 2025",nlE:" \u 2266 \u 0338",nle:" \u 2270",nleftarrow:" \u 219A",nLeftarrow:" \u 21CD",nleftrightarrow:" \u 21AE",nLeftrightarrow:" \u 21CE",nleq:" \u 2270",nleqq:" \u 2266 \u 0338",nleqslant:" \u 2A7D \u 0338",nles:" \u 2A7D \u 0338",nless:" \u 226E",nLl:" \u 22D8 \u 0338",nlsim:" \u 2274",nLt:" \u 226A \u 20D2",nlt:" \u 226E",nltri:" \u 22EA",nltrie:" \u 22EC",nLtv:" \u 226A \u 0338",nmid:" \u 2224",NoBreak:" \u 2060",NonBreakingSpace:" \x A0",nopf:" \u {1D55F}",Nopf:" \u 2115",Not:" \u 2AEC",not:" \x AC",NotCongruent:" \u 2262",NotCupCap:" \u 226D",NotDoubleVerticalBar:" \u 2226",NotElement:" \u 2209",NotEqual:" \u 2260",NotEqualTilde:" \u 2242 \u 0338",NotExists:" \u 2204",NotGreater:" \u 226F",NotGreaterEqual:" \u 2271",NotGreaterFullEqual:" \u 2267 \u 0338",NotGreaterGreater:" \u 226B \u 0338",NotGreaterLess:" \u 2279",NotGreaterSlantEqual:" \u 2A7E \u 0338",NotGreaterTilde:" \u 2275",NotHumpDownHump:" \u 224E \u 0338",NotHumpEqual:" \u 224F \u 0338",notin:" \u 2209",notindot:" \u 22F5 \u 0338",notinE:" \u 22F9 \u 0338",notinva:" \u 2209",notinvb:" \u 22F7",notinvc:" \u 22F6",NotLeftTriangleBar:" \u 29CF \u 0338",NotLeftTriangle:" \u 22EA",NotLeftTriangleEqual:" \u 22EC",NotLess:" \u 226E",NotLessEqual:" \u 2270",NotLessGreater:" \u 2278",NotLessLess:" \u 226A \u 0338",NotLessSlantEqual:" \u 2A7D \u 0338",NotLessTilde:" \u 2274",NotNestedGreaterGreater:" \u 2AA2 \u 0338",NotNestedLessLess:" \u 2AA1 \u 0338",notni:" \u 220C",notniva:" \u 220C",notnivb:" \u 22FE",notnivc:" \u 22FD",NotPrecedes:" \u 2280",NotPrecedesEqual:" \u 2AAF \u 0338",NotPrecedesSlantEqual:" \u 22E0",NotReverseElement:" \u 220C",NotRightTriangleBar:" \u 29D0 \u 0338",NotRightTriangle:" \u 22EB",NotRightTriangleEqual:" \u 22ED",NotSquareSubset:" \u 228F \u 0338",NotSquareSubsetEqual:" \u 22E2",NotSquareSuperset:" \u 2290 \u 0338",NotSquareSupersetEqual:" \u 22E3",NotSubset:" \u 2282 \u 20D2",NotSubsetEqual:" \u 2288",NotSucceeds:" \u 2281",NotSucceedsEqual:" \u 2AB0 \u 0338",NotSucceedsSlantEqual:" \u 22E1",NotSucceedsTilde:" \u 227F \u 0338",NotSuperset:" \u 2283 \u 20D2",NotSupersetEqual:" \u 2289",NotTilde:" \u 2241",NotTildeEqual:" \u 2244",NotTildeFullEqual:" \u 2247",NotTildeTilde:" \u 2249",NotVerticalBar:" \u 2224",nparallel:" \u 2226",npar:" \u 2226",nparsl:" \u 2AFD \u 20E5",npart:" \u 2202 \u 0338",npolint:" \u 2A14",npr:" \u 2280",nprcue:" \u 22E0",nprec:" \u 2280",npreceq:" \u 2AAF \u 0338",npre:" \u 2AAF \u 0338",nrarrc:" \u 2933 \u 0338",nrarr:" \u 219B",nrArr:" \u 21CF",nrarrw:" \u 219D \u 0338",nrightarrow:" \u 219B",nRightarrow:" \u 21CF",nrtri:" \u 22EB",nrtrie:" \u 22ED",nsc:" \u 2281",nsccue:" \u 22E1",nsce:" \u 2AB0 \u 0338",Nscr:" \u {1D4A9}",nscr:" \u {1D4C3}",nshortmid:" \u 2224",nshortparallel:" \u 2226",nsim:" \u 2241",nsime:" \u 2244",nsimeq:" \u 2244",nsmid:" \u 2224",nspar:" \u 2226",nsqsube:" \u 22E2",nsqsupe:" \u 22E3",nsub:" \u 2284",nsubE:" \u 2AC5 \u 0338",nsube:" \u 2288",nsubset:" \u 2282 \u 20D2",nsubseteq:" \u 2288",nsubseteqq:" \u 2AC5 \u 0338",nsucc:" \u 2281",nsucceq:" \u 2AB0 \u 0338",nsup:" \u 2285",nsupE:" \u 2AC6 \u 0338",nsupe:" \u 2289",nsupset:" \u 2283 \u 20D2",nsupseteq:" \u 2289",nsupseteqq:" \u 2AC6 \u 0338",ntgl:" \u 2279",Ntilde:" \x D1",ntilde:" \x F1",ntlg:" \u 2278",ntriangleleft:" \u 22EA",ntrianglelefteq:" \u 22EC",ntriangleright:" \u 22EB",ntrianglerighteq:" \u 22ED",Nu:" \u 039D",nu:" \u 03BD",num:"#",numero:" \u 2116",numsp:" \u 2007",nvap:" \u 224D \u 20D2",nvdash:" \u 22AC",nvDash:" \u 22AD",nVdash:" \u 22AE",nVDash:" \u 22AF",nvge:" \u 2265 \u 20D2",nvgt:"> \u 20D2",nvHarr:" \u 2904",nvinfin:" \u 29DE",nvlArr:" \u 2902",nvle:" \u 2264 \u 20D2",nvlt:"< \u 20D2",nvltrie:" \u 22B4 \u 20D2",nvrArr:" \u 2903",nvrtrie:" \u 22B5 \u 20D2",nvsim:" \u 223C \u 20D2",nwarhk:" \u 2923",nwarr:" \u 2196",nwArr:" \u 21D6",nwarrow:" \u 2196",nwnear:" \u 2927",Oacute:" \x D3",oacute:" \x F3",oast:" \u 229B",Ocirc:" \x D4",ocirc:" \x F4",ocir:" \u 229A",Ocy:" \u 041E",ocy:" \u 043E",odash:" \u 229D",Odblac:" \u 0150",odblac:" \u 0151",odiv:" \u 2A38",odot:" \u 2299",odsold:" \u 29BC",OElig:" \u 0152",oelig:" \u 01
2023-05-23 19:36:46 +08:00
` ," "],Lh=["{","}","|"," \\ ","^"," ` "].concat(Th),Ih=[" '"].concat(Lh),$s=["%","/","?",";","#"].concat(Ih),Ms=["/","?","#"],$h=255,Fs=/^[+a-z0-9A-Z_-]{0,63}$/,Mh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qs={javascript:!0,"javascript:":!0},Bs={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Fh(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=Dh.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Sh.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&&qs[c])&&(a=a.substr(2),this.slashes=!0)),!qs[c]&&(s||c&&!Bs[c])){var u=-1;for(t=0;t<Ms.length;t++)o=a.indexOf(Ms[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<$s.length;t++)o=a.indexOf($s[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 w=m[t];if(w&&!w.match(Fs)){for(var v="",g=0,k=w.length;g<k;g++)w.charCodeAt(g)>127?v+="x":v+=w[g];if(!v.match(Fs)){var y=m.slice(0,t),_=m.slice(t+1),x=w.match(Mh);x&&(y.push(x[1]),_.unshift(x[2])),_.length&&(a=_.join(".")+a),this.hostname=y.join(".");break}}}}this.hostname.length>$h&&(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),Bs[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};li.prototype.parseHost=function(n){var e=Ah.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};Ps.exports=Fh});var Hr=E((yb,Gt)=>{"use strict";Gt.exports.encode=Ss();Gt.exports.decode=Ts();Gt.exports.format=Is();Gt.exports.parse=Os()});var Ur=E((wb,Ns)=>{Ns.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/});var jr=E((xb,Rs)=>{Rs.exports=/[\0-\x1F\x7F-\x9F]/});var Hs=E((kb,zs)=>{zs.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 Vr=E((Cb,Us)=>{Us.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/});var js=E(ft=>{"use strict";ft.Any=Ur();ft.Cc=jr();ft.Cf=Hs();ft.P=oi();ft.Z=Vr()});var O=E(J=>{"use strict";function qh(n){return Object.prototype.toString.call(n)}function Bh(n){return qh(n)==="[object String]"}var Ph=Object.prototype.hasOwnProperty;function Ws(n,e){return Ph.call(n,e)}function Oh(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 Nh(n,e,t){return[].concat(n.slice(0,e),t,n.slice(e+1))}function Gs(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 Zs(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 Ks=/\\([!"#$%&' ( ) * + , \ - . \ / : ; <= > ? @ [ \ \ \ ] ^ _ ` {|}~])/g,Rh=/&([a-z#][a-z0-9]{1,31});/gi,zh=new RegExp(Ks.source+"|"+Rh.source,"gi"),Hh=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,Vs=zr();function Uh(n,e){var t=0;return Ws(Vs,e)?Vs[e]:e.charCodeAt(0)===35&&Hh.test(e)&&(t=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Gs(t))?Zs(t):n}function jh(n){return n.indexOf(" \\ ")<0?n:n.replace(Ks," $ 1")}function Vh(n){return n.indexOf(" \\
2023-05-03 18:05:33 +08:00
` };Ae.fence=function(n,e,t,i,r){var o=n[e],s=o.info?ad(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+ ` < / c o d e > < / p r e >
` ):"<pre><code"+r.renderAttrs(o)+">"+c+ ` < / c o d e > < / p r e >
` };Ae.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)};Ae.hardbreak=function(n,e,t){return t.xhtmlOut? ` < br / >
2020-09-20 17:33:18 +08:00
` : ` < br >
2023-05-03 18:05:33 +08:00
` };Ae.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut? ` < br / >
2020-09-20 17:33:18 +08:00
` : ` < br >
` : `
2023-05-03 18:05:33 +08:00
` };Ae.text=function(n,e){return Je(n[e].content)};Ae.html_block=function(n,e){return n[e].content};Ae.html_inline=function(n,e){return n[e].content};function mt(){this.rules=sd({},Ae)}mt.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};mt.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)};mt.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};mt.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};mt.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};ra.exports=mt});var ui=E((Ib,sa)=>{"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]||[]};sa.exports=Ce});var la=E(( $ b,aa)=>{"use strict";var ld=/ \r \n ?| \n /g,cd=/ \0 /g;aa.exports=function(e){var t;t=e.src.replace(ld, `
2023-05-23 19:36:46 +08:00
` ),t=t.replace(cd," \u FFFD"),e.src=t}});var ua=E((Mb,ca)=>{"use strict";ca.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 da=E((Fb,ha)=>{"use strict";ha.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 fa=E((qb,pa)=>{"use strict";var ud=O().arrayReplaceAt;function hd(n){return/^<a[> \s ]/i.test(n)}function dd(n){return/^< \/ a \s *>/i.test(n)}pa.exports=function(e){var t,i,r,o,s,a,l,c,u,h,d,p,f,m,w,v,g=e.tokens,k;if(e.md.options.linkify){for(i=0,r=g.length;i<r;i++)if(!(g[i].type!=="inline"||!e.md.linkify.pretest(g[i].content)))for(o=g[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"&&(hd(a.content)&&f>0&&f--,dd(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,w=e.md.normalizeLink(m),e.md.validateLink(w)&&(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",w]],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)),g[i].children=o=ud(o,t,l)}}}}});var ba=E((Bb,ga)=>{"use strict";var ma=/ \+ -| \. \. | \? \? \? \? |!!!!|,,|--/,pd=/ \( (c|tm|r) \) /i,fd=/ \( (c|tm|r) \) /ig,md={c:" \x A9",r:" \x AE",tm:" \u 2122"};function gd(n,e){return md[e.toLowerCase()]}function bd(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(fd,gd)),t.type==="link_open"&&t.info==="auto"&&i--,t.type==="link_close"&&t.info==="auto"&&i++}function vd(n){var e,t,i=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!i&&ma.test(t.content)&&(t.content=t.content.replace(/ \+ -/g," \x B1").replace(/ \. {2,}/g," \u 2026").replace(/([?!])…/g," $ 1..").replace(/([?!]){4,}/g," $ 1 $ 1 $ 1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]| $ )/mg," $ 1 \u 2014").replace(/(^| \s )--(?= \s | $ )/mg," $ 1 \u 2013").replace(/(^|[^- \s ])--(?=[^- \s ]| $ )/mg," $ 1 \u 2013")),t.type==="link_open"&&t.info==="auto"&&i--,t.type==="link_close"&&t.info==="auto"&&i++}ga.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(pd.test(e.tokens[t].content)&&bd(e.tokens[t].children),ma.test(e.tokens[t].content)&&vd(e.tokens[t].children))}});var _a=E((Pb,Ca)=>{"use strict";var va=O().isWhiteSpace,ya=O().isPunctChar,wa=O().isMdAsciiPunct,yd=/['"]/,xa=/['"]/g,ka=" \u 2019";function hi(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function wd(n,e){var t,i,r,o,s,a,l,c,u,h,d,p,f,m,w,v,g,k,y,_,x;for(y=[],t=0;t<n.length;t++){for(i=n[t],l=n[t].level,g=y.length-1;g>=0&&!(y[g].level<=l);g--);if(y.length=g+1,i.type==="text"){r=i.content,s=0,a=r.length;e:for(;s<a&&(xa.lastIndex=s,o=xa.exec(r),!!o);){if(w=v=!0,s=o.index+1,k=o[0]==="'",u=32,o.index-1>=0)u=r.charCodeAt(o.index-1);else for(g=t-1;g>=0&&!(n[g].type==="softbreak"||n[g].type==="hardbreak");g--)if(n[g].content){u=n[g].content.charCodeAt(n[g].content.length-1);break}if(h=32,s<a)h=r.charCodeAt(s);else for(g=t+1;g<n.length&&!(n[g].type==="softbreak"||n[g].type==="hardbreak");g++)if(n[g].content){h=n[g].content.charCodeAt(0);break}if(d=wa(u)||ya(String.fromCharCode(u)),p=wa(h)||ya(String.fromCharCode(h)),f=va(u),m=va(h),m?w=!1:p&&(f||d||(w=!1)),f?v=!1:d&&(m||p||(v=!1)),h===34&&o[0]==='"'&&u>=48&&u<=57&&(v=w=!1),w&&v&&(w=
` ,s.map=[t,e.line],!0}});var Na=E((jb,Oa)=>{"use strict";Oa.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 Ha=E((Vb,za)=>{"use strict";var Ra=O().isSpace;za.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,w,v,g,k,y,_,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,y=!0):e.src.charCodeAt(L)===9?(y=!0,(e.bsCount[t]+p)%4===3?(L++,l++,p++,o=!1):o=!0):y=!1,f=[e.bMarks[t]],e.bMarks[t]=L;L<I&&(s=e.src.charCodeAt(L),Ra(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+(y?1:0),u=L>=I,g=[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,y=!0):e.src.charCodeAt(L)===9?(y=!0,(e.bsCount[d]+p)%4===3?(L++,l++,p++,o=!1):o=!0):y=!1,f.push(e.bMarks[d]),e.bMarks[d]=L;L<I&&(s=e.src.charCodeAt(L),Ra(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+(y?1:0),g.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(_=!1,a=0,c=x.length;a<c;a++)if(x[a](e,d,i,!0)){_=!0;break}if(_){e.lineMax=d,e.blkIndent!==0&&(f.push(e.bMarks[d]),m.push(e.bsCount[d]),k.push(e.tShift[d]),g.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]),g.push(e.sCount[d]),e.sCount[d]=-1}for(w=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]=g[a],e.bsCount[a+t]=m[a];return e.blkIndent=w,!0}});var ja=E((Wb,Ua)=>{"use strict";var Cd=O().isSpace;Ua.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&&!Cd(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 Ka=E((Gb,Za)=>{"use strict";var Ga=O().isSpace;function Va(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),!Ga(o))?-1:i}function Wa(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),!Ga(t))?-1:r}function _d(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)}Za.exports=function(e,t,i,r){var o,s,a,l,c,u,h,d,p,f,m,w,v,g,k,y,_,x,S,D,q,L,I,H,R,ee,ge,V,Pe=!1,Oe=!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
` );lr(e)}}function $ u(n){n.status&&n.status>=400&&n.data&&n.data.message&&lr(n.data.message)}var ur={};_t(ur,{HttpError:()=>on,createXMLHttpRequest:()=>Fu,delete:()=>Nu,get:()=>qu,patch:()=>Ou,post:()=>Bu,put:()=>Pu});async function Mu(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 on=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 Fu(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 Po(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 Mu(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 on(o,s);return a}async function sn(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"),Po(e,i)}async function qu(n,e={}){return Po(n,{method:"GET",params:e})}async function Bu(n,e=null){return sn("POST",n,e)}async function Pu(n,e=null){return sn("PUT",n,e)}async function Ou(n,e=null){return sn("PATCH",n,e)}async function Nu(n,e=null){return sn("DELETE",n,e)}var hr=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}},Oo=hr;var gr={};_t(gr,{first:()=>Uu,firstOnElement:()=>Vu,get:()=>ju,init:()=>fr,register:()=>mr});function dr(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 No(n){return n.replace(/[A-Z]/g,(e,t)=>(t>0?"-":"")+e.toLowerCase())}var Et={},Ro={},pr=new WeakMap;function Ru(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(dr);for(let c of l)t[c]=a,typeof i[c]>"u"&&(i[c]=[]),i[c].push(a)}return{refs:t,manyRefs:i}}function zu(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[dr(s)]=o||""}return t}function Hu(n,e){let t=Ro[n];if(t===void 0)return;let i;try{i=new t,i. $ name=n,i. $ el=e;let o=Ru(n,e);i. $ refs=o.refs,i. $ manyRefs=o.manyRefs,i. $ opts=zu(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 eh="1.15.0";function Ie(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var $ e=Ie(/(?:Trident.*rv[ :]?11 \. |msie|iemobile|Windows Phone)/i),Ut=Ie(/Edge/i),Wo=Ie(/firefox/i),Ot=Ie(/safari/i)&&!Ie(/chrome/i)&&!Ie(/android/i),ns=Ie(/iP(ad|od|hone)/i),is=Ie(/chrome/i)&&Ie(/android/i),rs={capture:!1,passive:!1};function P(n,e,t){n.addEventListener(e,t,! $ e&&rs)}function B(n,e,t){n.removeEventListener(e,t,! $ e&&rs)}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 th(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=th(n))}return null}var Go=/ \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(Go," ").replace(" "+e+" "," ");n.className=(i+(t?" "+e:"")).replace(Go," ")}}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 os(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 Ee(){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!==Ee()?(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,! $ e))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 Zo(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===Ee())break;i=je(i,!1)}return!1}function ht(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 Pr(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 Ko(n){var e=0,t=0,i=Ee();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 nh(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 Ee();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 Ee();if(i||e)return t;i=!0}}while(t=t.parentNode);re
2023-05-03 18:05:33 +08:00
` ).map(u=>u.indexOf( ` drawio - diagram = "${r}" ` )!==-1?l:u).join( `
2023-05-08 23:05:50 +08:00
` );T(this,wt,Ei).call(this,c,i),tt()}).catch(a=>{this.handleDrawingUploadError(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,Di,Hc).call(this,o.from,o.to,!0),this.focus()}focus(){this.editor.cm.hasFocus||this.editor.cm.focus()}insertContent(e){T(this,Be,nt).call(this,e,e.length)}prependContent(e){e=T(this,tn,To).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,tn,To).call(this,e),T(this,he,ve).call(this,this.editor.cm.state.doc.length, `
$ { e } ` ),this.focus()}replaceContent(e){T(this,wt,Ei).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 , vt ) . call ( this , i ) ; if ( ! r ) { T ( this , xt , Si ) . 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 , xt , Si ) . call ( this , ` <p class="callout ${ i [ i . length - 1 ] } "> ` , "</p>" ) ; else if ( a === "" ) T ( this , xt , Si ) . 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 = `  } ) ` ; 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 . url } ) ` ; T ( this , nn , Lo ) . call ( this , s , u ) } catch ( c ) { window . $events . emit ( "error" , this . editor . config . text . imageUploadError ) , T ( this , nn , Lo ) . call ( this , s , "" ) , console . error ( c ) } } } ; en = new WeakSet , Do = function ( e , t ) { let i = ` <div drawio-diagram=" ${ e . id } "><img src=" ${ e . url } "></div> ` ; T ( this , Be , nt ) . call ( this , i , i . length , t ) } , yt = new WeakSet , _i = function ( ) { return this . editor . cm . state . doc . toString ( ) } , wt = new WeakSet , Ei = function ( e , t = null ) { t = t || T ( this , ie , ue ) . call ( this ) , T ( this , he , ve ) . call ( this , 0 , this . editor . cm . state . doc . length , e , t . from ) , this . focus ( ) } , Be = 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 , vt = 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 } , tn = new WeakSet , To = function ( e ) { return e . replace ( /\r\n|\r/g , `
2023-05-23 19:36:46 +08:00
` )},nn=new WeakSet,Lo=function(e,t){let i=T(this,yt,_i).call(this).replace(e,t);T(this,wt,Ei).call(this,i)},xt=new WeakSet,Si=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)},Di=new WeakSet,Hc=function(e,t,i=!1){this.editor.cm.dispatch({selection:{anchor:e,head:t},scrollIntoView:i})};var Ti=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 Li({html:n,markdown:e}){return e||n}function Uc(n){window. $ events.listen("editor::replace",e=>{let t=Li(e);n.actions.replaceContent(t)}),window. $ events.listen("editor::append",e=>{let t=Li(e);n.actions.appendContent(t)}),window. $ events.listen("editor::prepend",e=>{let t=Li(e);n.actions.prependContent(t)}),window. $ events.listen("editor::insert",e=>{let t=Li(e);n.actions.insertContent(t)}),window. $ events.listen("editor::focus",()=>{n.actions.focus()})}function wf(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 jc(n){let e=wf(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 Vc(n){let e=await window.importVersioned("code");function t(a){a.docChanged&&n.actions.updateAndRender()}let i=Re(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 Me(a.dataTransfer).getImages();u.length>0&&(a.stopPropagation(),a.preventDefault(),n.actions.insertClipboardImages(u,a.pageX,a.pageY))},paste:a=>{let l=new Me(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,jc(n));return window.mdEditorView=s,s}async function Wc(n){let e={config:n,markdown:new yi,settings:new Ti(n.settingInputs)};return e.ac
` ).length;t.style.height= ` $ { i * 20 + 40 } px ` ,this.editingComment=e}updateComment(e){let t=e.target;e.preventDefault();let r={text:t.querySelector("textarea").value,parent_id:this.parentId||null};this.showLoading(t);let o=this.editingComment.getAttribute("comment");window. $ http.put( ` / comment / $ { o } ` ,r).then(s=>{let a=document.createElement("div");a.innerHTML=s.data,this.editingComment.innerHTML=a.children[0].innerHTML,window. $ events.success(this.updatedText),window. $ components.init(this.editingComment),this.closeUpdateForm(),this.editingComment=null}).catch(window. $ events.showValidationErrors).then(()=>{this.hideLoading(t)})}deleteComment(e){let t=e.getAttribute("comment");this.showLoading(e.querySelector("[comment-content]")),window. $ http.delete( ` / comment / $ { t } ` ).then(()=>{e.parentNode.removeChild(e),window. $ events.success(this.deletedText),this.updateCount(),this.hideForm()})}saveComment(e){e.preventDefault(),e.stopPropagation();let i={text:this.formInput.value,parent_id:this.parentId||null};this.showLoading(this.form),window. $ http.post( ` / comment / $ { this . pageId } ` ,i).then(r=>{let o=Ne(r.data);this.container.appendChild(o),window. $ components.init(o),window. $ events.success(this.createdText),this.resetForm(),this.updateCount()}).catch(r=>{window. $ events.showValidationErrors(r),this.hideLoading(this.form)})}updateCount(){let e=this.container.children.length;this.elem.querySelector("[comments-title]").textContent=window.trans_plural(this.countText,e,{count:e})}resetForm(){this.formInput.value="",this.formContainer.appendChild(this.form),this.hideForm(),this.removeReplyTo(),this.hideLoading(this.form)}showForm(){this.formContainer.style.display="block",this.formContainer.parentNode.style.display="block",this.addButtonContainer.style.display="none",this.formInput.focus(),this.formInput.scrollIntoView({behavior:"smooth"})}hideForm(){this.formContainer.style.display="none",this.formContainer.parentNode.style.display="none",this.getCommentCount()>0?this.elem.appendChild(this.addButtonContainer):this.commentCountBar.appendChild(this.addButtonContainer),this.addButtonContainer.style.display="block"}getCommentCount(){return this.elem.querySelectorAll(".comment-box[comment]").length}setReply(e){this.showForm(),this.parentId=Number(e.getAttribute("local-id")),this.replyToRow.style.display="block";let t=this.replyToRow.querySelector("a");t.textContent= ` # $ { this . parentId } ` ,t.href= ` # comment$ { this . parentId } ` }removeReplyTo(){this.parentId=null,this.replyToRow.style.display="none"}showLoading(e){let t=e.querySelectorAll(".form-group");for(let i of t)i.style.display="none";e.querySelector(".form-group.loading").style.display="block"}hideLoading(e){let t=e.querySelectorAll(".form-group");for(let i of t)i.style.display="block";e.querySelector(".form-group.loading").style.display="none"}};function xf(n,e){br( ` a [ href = "#${n}" ] ` ,t=>{t.closest("li").classList.toggle("current-heading",e)})}function kf(n){for(let e of n){let t=e.intersectionRatio===1;xf(e.target.id,t)}}function Cf(n){let e={rootMargin:"0px 0px 0px 0px",threshold:1},t=new IntersectionObserver(kf,e);for(let i of n)t.observe(i)}var Bi=class extends b{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&&W(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(br(".page-content [data-highlighted]",i=>{i.removeAttribute("data-highlighted"),i.style.backgroundColor=null}),t!==null)Dt(t);else{let i=zo(".page-content > div > *",e);i&&Dt(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&&Cf(t)}setupDetailsCodeBl
2023-05-03 18:05:33 +08:00
` );return a.textContent}connectedCallback(){let s=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split( `
2023-05-08 23:05:50 +08:00
` ).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===" \u FEFF"&&a.remove()}}t.customElements.define("code-block",i)}function Of(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(nu(e))iu(n,e);else{let i=n.selection.getContent({format:"text"});ru(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();nu(e)&&iu(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",()=>{Pf(n)})}function ou(){return Of}var de=null,ot=null,rt={};function Io(n){return n.hasAttribute("drawio-diagram")}function Nf(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}" > < / d i v > ` ; d e . i n s e r t C o n t e n t ( r ) } } , " d r a w i o " ) } a s y n c f u n c t i o n R f ( n ) { l e t e = ` i m a g e - $ { M a t h . r a n d o m ( ) . t o S t r i n g ( 1 6 ) . s l i c e ( 2 ) } ` , t = w i n d o w . b a s e U r l ( " / l o a d i n g . g i f " ) , i = r = > { r . s t a t u s = = = 4 1 3 ? w i n d o w . $ e v e n t s . e m i t ( " e r r o r " , r t . t r a n s l a t i o n s . s e r v e r U p l o a d L i m i t T e x t ) : w i n d o w . $ e v e n t s . e m i t ( " e r r o r " , r t . t r a n s l a t i o n s . i m a g e U p l o a d E r r o r T e x t ) , c o n s o l e . e r r o r ( r ) } ; i f ( o t ) { t t ( ) ; l e t r = o t . q u e r y S e l e c t o r ( " i m g " ) ; t r y { l e t o = a w a i t A o ( n , r t . p a g e I d ) ; d e . u n d o M a n a g e r . t r a n s a c t ( ( ) = > { d e . d o m . s e t A t t r i b ( r , " s r c " , o . u r l ) , d e . d o m . s e t A t t r i b ( o t , " d r a w i o - d i a g r a m " , o . i d ) } ) } c a t c h ( o ) { i ( o ) } r e t u r n } s e t T i m e o u t ( a s y n c ( ) = > { d e . i n s e r t C o n t e n t ( ` < d i v d r a w i o - d i a g r a m c o n t e n t e d i t a b l e = " f a l s e " > < i m g s r c = " $ { t } " i d = " $ { e } " > < / d i v > ` ) , t t ( ) ; t r y { l e t r = a w a i t A o ( n , r t . p a g e I d ) ; d e . u n d o M a n a g e r . t r a n s a c t ( ( ) = > { d e . d o m . s e t A t t r i b ( e , " s r c " , r . u r l ) , d e . d o m . g e t ( e ) . p a r e n t N o d e . s e t A t t r i b u t e ( " d r a w i o - d i a g r a m " , r . i d ) } ) } c a t c h ( r ) { d e . d o m . r e m o v e ( e ) , i ( r ) } } , 5 ) } f u n c t i o n z f ( ) { i f ( ! o t ) r e t u r n P r o m i s e . r e s o l v e ( " " ) ; l e t n = o t . g e t A t t r i b u t e ( " d r a w i o - d i a g r a m " ) ; r e t u r n C i ( n ) } f u n c t i o n s u ( n , e = n u l l ) { d e = n , o t = e , Q t ( r t . d r a w i o U r l , z f , R f ) } f u n c t i o n H f ( n ) { n . a d d C o m m a n d ( " d r a w i o " , ( ) = > { l e t e = n . s e l e c t i o n . g e t N o d e ( ) ; s u ( n , I o ( e ) ? e : n u l l ) } ) , n . u i . r e g i s t r y . a d d I c o n ( " d i a g r a m " , ` < s v g w i d t h = " 2 4 " h e i g h t = " 2 4 " f i l l = " $ { r t . d a r k M o d e ? " # B B B " : " # 0 0 0 0 0 0 " } " x m l n s = " h t t p : / / w w w . w 3 . o r g / 2 0 0 0 / s v g " > < p a t h d = " M 2 0 . 7 1 6 7 . 6 3 9 V 2 . 8 4 5 h - 4 . 7 9 4 v 1 . 5 9 8 h - 7 . 9 9 V 2 . 8 4 5 H 3 . 1 3 8 v 4 . 7 9 4 h 1 . 5 9 8 v 7 . 9 9 H 3 . 1 3 8 v 4 . 7 9 4 h 4 . 7 9 4 v - 1 . 5 9 8 h 7 . 9 9 v 1 . 5 9 8 h 4 . 7 9 4 v - 4 . 7 9 4 h - 1 . 5 9 8 v - 7 . 9 9 z M 4 . 7 3 6 4 . 4 4 3 h 1 . 5 9 8 V 6 . 0 4 H 4 . 7 3 6 z m 1 . 5 9 8 1 4 . 3 8 2 H 4 . 7 3 6 v - 1 . 5 9 8 h 1 . 5 9 8 z m 9 . 5 8 8 - 1 . 5 9 8 h -
2023-05-03 18:05:33 +08:00
` ),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 um(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 hm(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),Kc(t),Jc(t,n),t.on("init",()=>{i(),Xc(t),window.editor=t,Zc(t)}),t.on("PreInit",()=>{um(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 `
2022-02-26 20:01:44 +08:00
html , body , html . dark - mode {
2023-05-03 18:05:33 +08:00
background : $ { n . darkMode ? "#222" : "#fff" } ;
2022-02-26 20:01:44 +08:00
}
body {
padding - left : 15 px ! important ;
padding - right : 15 px ! important ;
height : initial ! important ;
margin : 0 ! important ;
margin - left : auto ! important ;
margin - right : auto ! important ;
overflow - y : hidden ! important ;
} ` .trim().replace( `
2023-05-23 19:36:46 +08:00
` ,"")}function mu(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:lm(n),contextmenu:!1,toolbar:Qc(n),content_style:dm(n),style_formats:rm,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:om,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:sm,file_picker_callback:am,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){tu(t),eu(t),hm(n)(t)}}}var sr=class extends b{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=mu({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=ur;window. $ events=cr;var kt=new Oo;window.trans=kt.get.bind(kt);window.trans_choice=kt.getPlural.bind(kt);window.trans_plural=kt.parsePlural.bind(kt);mr(Mo);window. $ components=gr;fr();
2023-01-31 19:59:51 +08:00
/ * ! B u n d l e d l i c e n s e i n f o r m a t i o n :
sortablejs / modular / sortable . esm . js :
( * * !
* Sortable 1.15 . 0
* @ author RubaXa < trash @ rubaxa . org >
* @ author owenm < owen23355 @ gmail . com >
* @ license MIT
* )
* /
2020-09-20 17:33:18 +08:00
//# sourceMappingURL=app.js.map