From 6282528dd893e41104b85cdaf35b6312d1fff6f5 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 4 Jul 2026 15:40:28 +0200 Subject: [PATCH] feat(post-form): EasyMDE editor + /post-scoped ESM bundle (U3) Add a page-scoped js/src/post-form.js bundle (built ESM + code-splitting so U4's heic-to becomes a deferred chunk) loaded only by post-form.html.twig via a new base head_assets block. EasyMDE replaces the bare textarea with a minimal toolbar (bold/italic/list/link/preview), FA-free via CSS glyphs, and syncs codemirror.save() on change + capture-phase submit so the inline required-field validator and payload see the live value. Refs R7, R15, KTD2, KTD3. --- themes/intotheeast/css-compiled/post-form.css | 11 +++ themes/intotheeast/js/post/post-form.js | 95 +++++++++++++++++++ themes/intotheeast/js/src/post-form.css | 21 ++++ themes/intotheeast/js/src/post-form.js | 63 ++++++++++++ themes/intotheeast/package-lock.json | 77 +++++++++++++++ themes/intotheeast/package.json | 3 +- .../templates/partials/base.html.twig | 1 + .../intotheeast/templates/post-form.html.twig | 5 + 8 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 themes/intotheeast/css-compiled/post-form.css create mode 100644 themes/intotheeast/js/post/post-form.js create mode 100644 themes/intotheeast/js/src/post-form.css create mode 100644 themes/intotheeast/js/src/post-form.js diff --git a/themes/intotheeast/css-compiled/post-form.css b/themes/intotheeast/css-compiled/post-form.css new file mode 100644 index 0000000..91c98aa --- /dev/null +++ b/themes/intotheeast/css-compiled/post-form.css @@ -0,0 +1,11 @@ +.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:0;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none;outline:0}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:0 0}.EasyMDEContainer{display:block}.CodeMirror-rtl pre{direction:rtl}.EasyMDEContainer.sided--no-fullscreen{display:flex;flex-direction:row;flex-wrap:wrap}.EasyMDEContainer .CodeMirror{box-sizing:border-box;height:auto;border:1px solid #ced4da;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:0;word-wrap:break-word}.EasyMDEContainer .CodeMirror-scroll{cursor:text}.EasyMDEContainer .CodeMirror-fullscreen{background:#fff;position:fixed!important;inset:50px 0 0;height:auto;z-index:8;border-right:none!important;border-bottom-right-radius:0!important}.EasyMDEContainer .CodeMirror-sided{width:50%!important}.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided{border-right:none!important;border-bottom-right-radius:0;position:relative;flex:1 1 auto}.EasyMDEContainer .CodeMirror-placeholder{opacity:.5}.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected{background:#d9d9d9}.editor-toolbar{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:9px 10px;border-top:1px solid #ced4da;border-left:1px solid #ced4da;border-right:1px solid #ced4da;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar.fullscreen{width:100%;height:50px;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen:before{width:20px;height:50px;background:-moz-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,#fff),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,#fff 0,#fff0);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen:after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to right,#fff0 0,#fff);position:fixed;top:0;right:0;margin:0;padding:0}.EasyMDEContainer.sided--no-fullscreen .editor-toolbar{width:100%}.editor-toolbar .easymde-dropdown,.editor-toolbar button{background:0 0;display:inline-block;text-align:center;text-decoration:none!important;height:30px;margin:0;padding:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar button{font-weight:700;min-width:30px;padding:0 6px;white-space:nowrap}.editor-toolbar button.active,.editor-toolbar button:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar button:after{font-family:Arial,Helvetica Neue,Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar button.heading-1:after{content:"1"}.editor-toolbar button.heading-2:after{content:"2"}.editor-toolbar button.heading-3:after{content:"3"}.editor-toolbar button.heading-bigger:after{content:"\25b2"}.editor-toolbar button.heading-smaller:after{content:"\25bc"}.editor-toolbar.disabled-for-preview button:not(.no-disable){opacity:.6;pointer-events:none}@media only screen and (max-width:700px){.editor-toolbar i.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.EasyMDEContainer.sided--no-fullscreen .editor-statusbar{width:100%}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-statusbar .lines:before{content:"lines: "}.editor-statusbar .words:before{content:"words: "}.editor-statusbar .characters:before{content:"characters: "}.editor-preview-full{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7;overflow:auto;display:none;box-sizing:border-box}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;overflow:auto;display:none;box-sizing:border-box;border:1px solid #ddd;word-wrap:break-word}.editor-preview-active-side{display:block}.EasyMDEContainer.sided--no-fullscreen .editor-preview-active-side{flex:1 1 auto;height:auto;position:static}.editor-preview-active{display:block}.editor-preview{padding:10px;background:#fafafa}.editor-preview>p{margin-top:0}.editor-preview pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th{border:1px solid #ddd;padding:5px}.cm-s-easymde .cm-tag{color:#63a35c}.cm-s-easymde .cm-attribute{color:#795da3}.cm-s-easymde .cm-string{color:#183691}.cm-s-easymde .cm-header-1{font-size:calc(1.375rem + 1.5vw)}.cm-s-easymde .cm-header-2{font-size:calc(1.325rem + .9vw)}.cm-s-easymde .cm-header-3{font-size:calc(1.3rem + .6vw)}.cm-s-easymde .cm-header-4{font-size:calc(1.275rem + .3vw)}.cm-s-easymde .cm-header-5{font-size:1.25rem}.cm-s-easymde .cm-header-6{font-size:1rem}.cm-s-easymde .cm-header-1,.cm-s-easymde .cm-header-2,.cm-s-easymde .cm-header-3,.cm-s-easymde .cm-header-4,.cm-s-easymde .cm-header-5,.cm-s-easymde .cm-header-6{margin-bottom:.5rem;line-height:1.2}.cm-s-easymde .cm-comment{background:#0000000d;border-radius:2px}.cm-s-easymde .cm-link{color:#7f8c8d}.cm-s-easymde .cm-url{color:#aab2b3}.cm-s-easymde .cm-quote{color:#7f8c8d;font-style:italic}.editor-toolbar .easymde-dropdown{position:relative;background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%);border-radius:0;border:1px solid #fff}.editor-toolbar .easymde-dropdown:hover{background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%)}.easymde-dropdown-content{display:block;visibility:hidden;position:absolute;background-color:#f9f9f9;box-shadow:0 8px 16px #0003;padding:8px;z-index:2;top:30px}.easymde-dropdown:active .easymde-dropdown-content,.easymde-dropdown:focus .easymde-dropdown-content,.easymde-dropdown:focus-within .easymde-dropdown-content{visibility:visible}.easymde-dropdown-content button{display:block}span[data-img-src]:after{content:"";background-image:var(--bg-image);display:block;max-height:100%;max-width:100%;background-size:contain;height:0;padding-top:var(--height);width:var(--width);background-repeat:no-repeat}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:#ff000026}.editor-toolbar .mde-btn:before{font-style:normal;font-weight:400;font-family:inherit}.editor-toolbar .mde-bold:before{content:"B";font-weight:700}.editor-toolbar .mde-italic:before{content:"I";font-style:italic}.editor-toolbar .mde-ul:before{content:"\2022\2002\2014"}.editor-toolbar .mde-link:before{content:"\1f517"}.editor-toolbar .mde-preview:before{content:"\1f441"}.EasyMDEContainer .CodeMirror{min-height:180px} +/*! Bundled license information: + +easymde/dist/easymde.min.css: + (** + * easymde v2.21.0 + * Copyright Jeroen Akkerman + * @link https://github.com/ionaru/easy-markdown-editor + * @license MIT + *) +*/ diff --git a/themes/intotheeast/js/post/post-form.js b/themes/intotheeast/js/post/post-form.js new file mode 100644 index 0000000..bf2fbba --- /dev/null +++ b/themes/intotheeast/js/post/post-form.js @@ -0,0 +1,95 @@ +var zc=Object.create;var ps=Object.defineProperty;var Rc=Object.getOwnPropertyDescriptor;var Pc=Object.getOwnPropertyNames;var Wc=Object.getPrototypeOf,_c=Object.prototype.hasOwnProperty;var gs=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(h,d)=>(typeof require<"u"?require:h)[d]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var Ye=(a,h)=>()=>(h||a((h={exports:{}}).exports,h),h.exports);var qc=(a,h,d,l)=>{if(h&&typeof h=="object"||typeof h=="function")for(let u of Pc(h))!_c.call(a,u)&&u!==d&&ps(a,u,{get:()=>h[u],enumerable:!(l=Rc(h,u))||l.enumerable});return a};var Uc=(a,h,d)=>(d=a!=null?zc(Wc(a)):{},qc(h||!a||!a.__esModule?ps(d,"default",{value:a,enumerable:!0}):d,a));var ct=Ye((jo,Go)=>{(function(a,h){typeof jo=="object"&&typeof Go<"u"?Go.exports=h():typeof define=="function"&&define.amd?define(h):(a=a||self,a.CodeMirror=h())})(jo,function(){"use strict";var a=navigator.userAgent,h=navigator.platform,d=/gecko\/\d/i.test(a),l=/MSIE \d/.test(a),u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),v=/Edge\/(\d+)/.exec(a),c=l||u||v,g=c&&(l?document.documentMode||6:+(v||u)[1]),y=!v&&/WebKit\//.test(a),w=y&&/Qt\/\d+\.\d+/.test(a),C=!v&&/Chrome\/(\d+)/.exec(a),M=C&&+C[1],L=/Opera\//.test(a),T=/Apple Computer/.test(navigator.vendor),O=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(a),I=/PhantomJS/.test(a),F=T&&(/Mobile\/\w+/.test(a)||navigator.maxTouchPoints>2),B=/Android/.test(a),N=F||B||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(a),R=F||/Mac/.test(h),z=/\bCrOS\b/.test(a),W=/win/i.test(h),X=L&&a.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(L=!1,y=!0);var K=R&&(w||L&&(X==null||X<12.11)),ge=d||c&&g>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function A(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=f-o,s+=i-s%i,o=f+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(s,t-n);if(n+=o-r,n+=i-n%i,r=o+1,n>=t)return r}}var xt=[""];function Pt(e){for(;xt.length<=e;)xt.push(me(xt)+" ");return xt[e]}function me(e){return e[e.length-1]}function yt(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ku.test(e))}function ki(e,t){return t?t.source.indexOf("\\w")>-1&&In(e)?!0:t.test(e):In(e)}function sa(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Su=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function On(e){return e.charCodeAt(0)>=768&&Su.test(e)}function ua(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}function Fu(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;ot||t==i&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,i),s.level==1?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}var Ur=null;function jr(e,t,i){var r;Ur=null;for(var n=0;nt)return n;o.to==t&&(o.from!=o.to&&i=="before"?r=n:Ur=n),o.from==t&&(o.from!=o.to&&i!="before"?r=n:Ur=n)}return r??Ur}var Au=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,f=/[1n]/;function p(m,b,D){this.level=m,this.from=b,this.to=D}return function(m,b){var D=b=="ltr"?"L":"R";if(m.length==0||b=="ltr"&&!r.test(m))return!1;for(var E=m.length,S=[],H=0;H-1&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function Ie(e,t){var i=Hn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function gr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function da(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function zn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Gr(e){it(e),da(e)}function Rn(e){return e.target||e.srcElement}function ha(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),R&&e.ctrlKey&&t==1&&(t=3),t}var Eu=function(){if(c&&g<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}(),Pn;function Lu(e){if(Pn==null){var t=A("span","\u200B");de(e,A("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Pn=t.offsetWidth<=1&&t.offsetHeight>2&&!(c&&g<8))}var i=Pn?A("span","\u200B"):A("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Wn;function Tu(e){if(Wn!=null)return Wn;var t=de(e,document.createTextNode("A\u062EA")),i=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:Wn=r.right-i.right<3}var _n=` + +b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` +`,t);n==-1&&(n=e.length);var o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),s=o.indexOf("\r");s!=-1?(i.push(o.slice(0,s)),t+=s+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Mu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Bu=function(){var e=A("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),qn=null;function Nu(e){if(qn!=null)return qn;var t=de(e,A("span","x")),i=t.getBoundingClientRect(),r=_(t,0,1).getBoundingClientRect();return qn=Math.abs(i.left-r.left)>1}var Un={},vr={};function Iu(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Un[e]=t}function Ou(e,t){vr[e]=t}function Si(e){if(typeof e=="string"&&vr.hasOwnProperty(e))e=vr[e];else if(e&&typeof e.name=="string"&&vr.hasOwnProperty(e.name)){var t=vr[e.name];typeof t=="string"&&(t={name:t}),e=la(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Si("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Si("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function jn(e,t){t=Si(t);var i=Un[t.name];if(!i)return jn(e,"text/plain");var r=i(e,t);if(mr.hasOwnProperty(t.name)){var n=mr[t.name];for(var o in n)n.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var mr={};function Hu(e,t){var i=mr.hasOwnProperty(e)?mr[e]:mr[e]={};dt(t,i)}function $t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Gn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function pa(e,t,i){return e.startState?e.startState(t,i):!0}var Oe=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Oe.prototype.eol=function(){return this.pos>=this.string.length},Oe.prototype.sol=function(){return this.pos==this.lineStart},Oe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Oe.prototype.next=function(){if(this.post},Oe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Oe.prototype.skipToEnd=function(){this.pos=this.string.length},Oe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Oe.prototype.backUp=function(e){this.pos-=e},Oe.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Oe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Oe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Oe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Oe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t=e.first&&ti?q(i,re(e,i).text.length):zu(t,re(e,t.line).text.length)}function zu(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function va(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},At.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},At.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},At.fromSaved=function(e,t,i){return t instanceof Ei?new At(e,$t(e.mode,t.state),i,t.lookAhead):new At(e,$t(e.mode,t),i)},At.prototype.save=function(e){var t=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ei(t,this.maxLookAhead):t};function ma(e,t,i,r){var n=[e.state.modeGen],o={};wa(e,t.text,e.doc.mode,i,function(m,b){return n.push(m,b)},o,r);for(var s=i.state,f=function(m){i.baseTokens=n;var b=e.state.overlays[m],D=1,E=0;i.state=!0,wa(e,t.text,b.mode,i,function(S,H){for(var P=D;ES&&n.splice(D,1,S,n[D+1],j),D+=2,E=Math.min(S,j)}if(H)if(b.opaque)n.splice(P,D-P,S,"overlay "+H),D=P+2;else for(;Pe.options.maxHighlightLength&&$t(e.doc.mode,r.state),o=ma(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new At(r,!0,t);var o=Ru(e,t,i),s=o>r.first&&re(r,o-1).stateAfter,f=s?At.fromSaved(r,s,o):new At(r,pa(r.mode),o);return r.iter(o,t,function(p){Qn(e,p.text,f);var m=f.line;p.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&mt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var ba=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Da(e,t,i,r){var n=e.doc,o=n.mode,s;t=ce(n,t);var f=re(n,t.line),p=Xr(e,t.line,i),m=new Oe(f.text,e.options.tabSize,p),b;for(r&&(b=[]);(r||m.pose.options.maxHighlightLength?(f=!1,s&&Qn(e,t,r,b.pos),b.pos=t.length,D=null):D=Ca(Jn(i,b,r.state,E),o),E){var S=E[0].name;S&&(D="m-"+(D?S+" "+D:S))}if(!f||m!=D){for(;ps;--f){if(f<=o.first)return o.first;var p=re(o,f-1),m=p.stateAfter;if(m&&(!i||f+(m instanceof Ei?m.lookAhead:0)<=o.modeFrontier))return f;var b=Re(p.text,null,e.options.tabSize);(n==null||r>b)&&(n=f-1,r=b)}return n}function Pu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Ei)||r+n.lookAhead=t:o.to>t);(r||(r=[])).push(new Li(s,o.from,p?null:o.to))}}return r}function Gu(e,t,i){var r;if(e)for(var n=0;n=t:o.to>t);if(f||o.from==t&&s.type=="bookmark"&&(!i||o.marker.insertLeft)){var p=o.from==null||(s.inclusiveLeft?o.from<=t:o.from0&&f)for(var $=0;$0)){var b=[p,1],D=fe(m.from,f.from),E=fe(m.to,f.to);(D<0||!s.inclusiveLeft&&!D)&&b.push({from:m.from,to:f.from}),(E>0||!s.inclusiveRight&&!E)&&b.push({from:f.to,to:m.to}),n.splice.apply(n,b),p+=b.length-3}}return n}function Fa(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||Vn(r,o.marker)<0)&&(r=o.marker)}return r}function Ta(e,t,i,r,n){var o=re(e,t),s=Bt&&o.markedSpans;if(s)for(var f=0;f=0&&D<=0||b<=0&&D>=0)&&(b<=0&&(p.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||b>=0&&(p.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function bt(e){for(var t;t=La(e);)e=t.find(-1,!0).line;return e}function Yu(e){for(var t;t=Bi(e);)e=t.find(1,!0).line;return e}function Zu(e){for(var t,i;t=Bi(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function eo(e,t){var i=re(e,t),r=bt(i);return i==r?t:be(r)}function Ma(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!_t(e,i))return t;for(;r=Bi(i);)i=r.find(1,!0).line;return be(i)+1}function _t(e,t){var i=Bt&&t.markedSpans;if(i){for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var xr=function(e,t,i){this.text=e,Aa(this,t),this.height=i?i(this):1};xr.prototype.lineNo=function(){return be(this)},gr(xr);function Qu(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Fa(e),Aa(e,i);var n=r?r(e):1;n!=e.height&&Ft(e,n)}function Ju(e){e.parent=null,Fa(e)}var $u={},Vu={};function Ba(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Vu:$u;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Na(e,t){var i=U("span",null,null,y?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,s=void 0;r.pos=0,r.addToken=tf,Tu(e.display.measure)&&(s=Mt(o,e.doc.direction))&&(r.addToken=nf(r.addToken,s)),r.map=[];var f=t!=e.display.externalMeasured&&be(o);of(o,r,xa(e,o,f)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=vt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=vt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Lu(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var p=r.content.lastChild;(/\bcm-tab\b/.test(p.className)||p.querySelector&&p.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=vt(r.pre.className,r.textClass||"")),r}function ef(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tf(e,t,i,r,n,o,s){if(t){var f=e.splitSpaces?rf(t,e.trailingSpace):t,p=e.cm.state.specialChars,m=!1,b;if(!p.test(t))e.col+=t.length,b=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,b),c&&g<9&&(m=!0),e.pos+=t.length;else{b=document.createDocumentFragment();for(var D=0;;){p.lastIndex=D;var E=p.exec(t),S=E?E.index-D:t.length-D;if(S){var H=document.createTextNode(f.slice(D,D+S));c&&g<9?b.appendChild(A("span",[H])):b.appendChild(H),e.map.push(e.pos,e.pos+S,H),e.col+=S,e.pos+=S}if(!E)break;D+=S+1;var P=void 0;if(E[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;P=b.appendChild(A("span",Pt(Y),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Y}else E[0]=="\r"||E[0]==` +`?(P=b.appendChild(A("span",E[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",E[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(E[0]),P.setAttribute("cm-text",E[0]),c&&g<9?b.appendChild(A("span",[P])):b.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||r||n||m||o||s){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=A("span",[b],Q,o);if(s)for(var $ in s)s.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,s[$]);return e.content.appendChild(Z)}e.content.appendChild(b)}}function rf(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nm&&D.from<=m));E++);if(D.to>=b)return e(i,r,n,o,s,f,p);e(i,r.slice(0,D.to-m),n,o,null,f,p),o=null,r=r.slice(D.to-m),m=D.to}}}function Ia(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function of(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(!r){for(var s=1;sp||pe.collapsed&&ie.to==p&&ie.from==p)){if(ie.to!=null&&ie.to!=p&&S>ie.to&&(S=ie.to,P=""),pe.className&&(H+=" "+pe.className),pe.css&&(E=(E?E+";":"")+pe.css),pe.startStyle&&ie.from==p&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==S&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var Ce in pe.attributes)(Q||(Q={}))[Ce]=pe.attributes[Ce];pe.collapsed&&(!Y||Vn(Y.marker,pe)<0)&&(Y=ie)}else ie.from>p&&S>ie.from&&(S=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==S&&(P+=" "+$[Ge]);if(!Y||Y.from==p)for(var Le=0;Le=f)break;for(var ft=Math.min(f,S);;){if(b){var at=p+b.length;if(!Y){var He=at>ft?b.slice(0,ft-p):b;t.addToken(t,He,D?D+H:H,j,p+He.length==S?P:"",E,Q)}if(at>=ft){b=b.slice(ft-p),p=ft;break}p=at,j=""}b=n.slice(o,o=i[m++]),D=Ba(i[m++],t.cm.options)}}}function Oa(e,t,i){this.line=t,this.rest=Zu(t),this.size=this.rest?be(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=_t(e,t)}function Ii(e,t,i){for(var r=[],n,o=t;o2&&o.push((p.bottom+m.top)/2-i.top)}}o.push(i.bottom-i.top)}}function qa(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function vf(e,t){t=bt(t);var i=be(t),r=e.display.externalMeasured=new Oa(e.doc,t,i);r.lineN=i;var n=r.built=Na(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Ua(e,t,i,r){return Lt(e,br(e,t),i,r)}function ao(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(o=p-f,n=o-1,t>=p&&(s="right")),n!=null){if(r=e[m+2],f==p&&i==(r.insertLeft?"left":"right")&&(s=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],s="left";if(i=="right"&&n==p-f)for(;m=0&&(i=e[n]).left==i.right;n--);return i}function xf(e,t,i,r){var n=Ga(t.map,i,r),o=n.node,s=n.start,f=n.end,p=n.collapse,m;if(o.nodeType==3){for(var b=0;b<4;b++){for(;s&&On(t.line.text.charAt(n.coverStart+s));)--s;for(;n.coverStart+f0&&(p=r="right");var D;e.options.lineWrapping&&(D=o.getClientRects()).length>1?m=D[r=="right"?D.length-1:0]:m=o.getBoundingClientRect()}if(c&&g<9&&!s&&(!m||!m.left&&!m.right)){var E=o.parentNode.getClientRects()[0];E?m={left:E.left,right:E.left+Cr(e.display),top:E.top,bottom:E.bottom}:m=ja}for(var S=m.top-t.rect.top,H=m.bottom-t.rect.top,P=(S+H)/2,j=t.view.measure.heights,Y=0;Y=r.text.length?(p=r.text.length,m="before"):p<=0&&(p=0,m="after"),!f)return s(m=="before"?p-1:p,m=="before");function b(H,P,j){var Y=f[P],Q=Y.level==1;return s(j?H-1:H,Q!=j)}var D=jr(f,p,m),E=Ur,S=b(p,D,m=="before");return E!=null&&(S.other=b(p,E,m!="before")),S}function Ja(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=Cr(e.display)*t.ch);var r=re(e.doc,t.line),n=Nt(r)+Oi(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function so(e,t,i,r,n){var o=q(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function uo(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return so(r.first,0,null,-1,-1);var n=er(r,i),o=r.first+r.size-1;if(n>o)return so(r.first+r.size-1,re(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=re(r,n);;){var f=bf(e,s,n,t,i),p=Xu(s,f.ch+(f.xRel>0||f.outside>0?1:0));if(!p)return f;var m=p.find(1);if(m.line==n)return m;s=re(r,n=m.line)}}function $a(e,t,i,r){r-=lo(t);var n=t.text.length,o=qr(function(s){return Lt(e,i,s-1).bottom<=r},n,0);return n=qr(function(s){return Lt(e,i,s).top>r},o,n),{begin:o,end:n}}function Va(e,t,i,r){i||(i=br(e,t));var n=Hi(e,t,Lt(e,i,r),"line").top;return $a(e,t,i,n)}function fo(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function bf(e,t,i,r,n){n-=Nt(t);var o=br(e,t),s=lo(t),f=0,p=t.text.length,m=!0,b=Mt(t,e.doc.direction);if(b){var D=(e.options.lineWrapping?Cf:Df)(e,t,i,o,b,r,n);m=D.level!=1,f=m?D.from:D.to-1,p=m?D.to:D.from-1}var E=null,S=null,H=qr(function(ne){var ie=Lt(e,o,ne);return ie.top+=s,ie.bottom+=s,fo(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(E=ne,S=ie),!0):!1},f,p),P,j,Y=!1;if(S){var Q=r-S.left=$.bottom?1:0}return H=ua(t.text,H,1),so(i,H,j,Y,r-P)}function Df(e,t,i,r,n,o,s){var f=qr(function(D){var E=n[D],S=E.level!=1;return fo(Dt(e,q(i,S?E.to:E.from,S?"before":"after"),"line",t,r),o,s,!0)},0,n.length-1),p=n[f];if(f>0){var m=p.level!=1,b=Dt(e,q(i,m?p.from:p.to,m?"after":"before"),"line",t,r);fo(b,o,s,!0)&&b.top>s&&(p=n[f-1])}return p}function Cf(e,t,i,r,n,o,s){var f=$a(e,t,r,s),p=f.begin,m=f.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var b=null,D=null,E=0;E=m||S.to<=p)){var H=S.level!=1,P=Lt(e,r,H?Math.min(m,S.to)-1:Math.max(p,S.from)).right,j=Pj)&&(b=S,D=j)}}return b||(b=n[n.length-1]),b.fromm&&(b={from:b.from,to:m,level:b.level}),b}var rr;function Dr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(rr==null){rr=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(A("br"));rr.appendChild(document.createTextNode("x"))}de(e.measure,rr);var i=rr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function Cr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),i=A("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function co(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var f=e.display.gutterSpecs[s].className;i[f]=o.offsetLeft+o.clientLeft+n,r[f]=o.clientWidth}return{fixedPos:ho(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ho(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function el(e){var t=Dr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Cr(e.display)-3);return function(n){if(_t(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s0&&(m=re(e.doc,p.line).text).length==p.ch){var b=Re(m,m.length,e.options.tabSize)-m.length;p=q(p.line,Math.max(0,Math.round((o-_a(e.display).left)/Cr(e.display))-b))}return p}function nr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Bt&&eo(e.doc,t)n.viewFrom?Ut(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ut(e);else if(t<=n.viewFrom){var o=Ri(e,i,i+r,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=r):Ut(e)}else if(i>=n.viewTo){var s=Ri(e,t,t,-1);s?(n.view=n.view.slice(0,s.index),n.viewTo=s.lineN):Ut(e)}else{var f=Ri(e,t,t,-1),p=Ri(e,i,i+r,1);f&&p?(n.view=n.view.slice(0,f.index).concat(Ii(e,f.lineN,p.lineN)).concat(n.view.slice(p.index)),n.viewTo+=r):Ut(e)}var m=n.externalMeasured;m&&(i=n.lineN&&t=r.viewTo)){var o=r.view[nr(e,t)];if(o.node!=null){var s=o.changes||(o.changes=[]);Fe(s,i)==-1&&s.push(i)}}}function Ut(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ri(e,t,i,r){var n=nr(e,t),o,s=e.display.view;if(!Bt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var f=e.display.viewFrom,p=0;p0){if(n==s.length-1)return null;o=f+s[n].size-t,n++}else o=f-t;t+=o,i+=o}for(;eo(e.doc,i)!=i;){if(n==(r<0?0:s.length-1))return null;i+=r*s[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function wf(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Ii(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Ii(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,nr(e,i)))),r.viewTo=i}function tl(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||p.to().line0?s:e.defaultCharWidth())+"px"}if(r.other){var f=i.appendChild(A("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="",f.style.left=r.other.left+"px",f.style.top=r.other.top+"px",f.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pi(e,t){return e.top-t.top||e.left-t.left}function kf(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),s=_a(e.display),f=s.left,p=Math.max(r.sizerWidth,tr(e)-r.sizer.offsetLeft)-s.right,m=n.direction=="ltr";function b(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px; + top: `+$+"px; width: "+(ne??p-Z)+`px; + height: `+(ie-$)+"px"))}function D(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,Ce,Ge;function Le(He,lt){return zi(e,q(Z,He),"div",ie,lt)}function ft(He,lt,Xe){var We=Va(e,ie,null,He),ze=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?We.begin:We.end-(/\s/.test(ie.text.charAt(We.end-1))?2:1);return Le(Be,ze)[ze]}var at=Mt(ie,n.direction);return Fu(at,$||0,ne??pe,function(He,lt,Xe,We){var ze=Xe=="ltr",Be=Le(He,ze?"left":"right"),st=Le(lt-1,ze?"right":"left"),Or=$==null&&He==0,Zt=ne==null&<==pe,Qe=We==0,Tt=!at||We==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Or:Zt)&&Qe,qo=(m?Zt:Or)&&Tt,zt=Ke?f:(ze?Be:st).left,ur=qo?p:(ze?st:Be).right;b(zt,Be.top,ur-zt,Be.bottom)}else{var fr,Ve,Hr,Uo;ze?(fr=m&&Or&&Qe?f:Be.left,Ve=m?p:ft(He,Xe,"before"),Hr=m?f:ft(lt,Xe,"after"),Uo=m&&Zt&&Tt?p:st.right):(fr=m?ft(He,Xe,"before"):f,Ve=!m&&Or&&Qe?p:Be.right,Hr=!m&&Zt&&Tt?f:st.left,Uo=m?ft(lt,Xe,"after"):p),b(fr,Be.top,Ve-fr,Be.bottom),Be.bottom0?t.blinker=setInterval(function(){e.hasFocus()||wr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function il(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xo(e))}function mo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&wr(e))},100)}function xo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),vo(e))}function wr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Wi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s.005||S<-.005)&&(ne.display.sizerWidth){var P=Math.ceil(b/Cr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function nl(e){if(e.widgets)for(var t=0;t=s&&(o=er(t,Nt(re(t,p))-e.wrapper.clientHeight),s=p)}return{from:o,to:Math.max(s,o+1)}}function Sf(e,t){if(!_e(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,o=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(n=!1),n!=null&&!I){var s=A("div","\u200B",null,`position: absolute; + top: `+(t.top-i.viewOffset-Oi(e.display))+`px; + height: `+(t.bottom-t.top+Et(e)+i.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}function Ff(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,f=Dt(e,t),p=!i||i==t?f:Dt(e,i);n={left:Math.min(f.left,p.left),top:Math.min(f.top,p.top)-r,right:Math.max(f.left,p.left),bottom:Math.max(f.bottom,p.bottom)+r};var m=yo(e,n),b=e.doc.scrollTop,D=e.doc.scrollLeft;if(m.scrollTop!=null&&(ti(e,m.scrollTop),Math.abs(e.doc.scrollTop-b)>1&&(s=!0)),m.scrollLeft!=null&&(or(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-D)>1&&(s=!0)),!s)break}return n}function Af(e,t){var i=yo(e,t);i.scrollTop!=null&&ti(e,i.scrollTop),i.scrollLeft!=null&&or(e,i.scrollLeft)}function yo(e,t){var i=e.display,r=Dr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,o=oo(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var f=e.doc.height+no(i),p=t.topf-r;if(t.topn+o){var b=Math.min(t.top,(m?f:t.bottom)-o);b!=n&&(s.scrollTop=b)}var D=e.options.fixedGutter?0:i.gutters.offsetWidth,E=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-D,S=tr(e)-i.gutters.offsetWidth,H=t.right-t.left>S;return H&&(t.right=t.left+S),t.left<10?s.scrollLeft=0:t.leftS+E-3&&(s.scrollLeft=t.right+(H?0:10)-S),s}function bo(e,t){t!=null&&(qi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function kr(e){qi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ei(e,t,i){(t!=null||i!=null)&&qi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Ef(e,t){qi(e),e.curOp.scrollToPos=t}function qi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ja(e,t.from),r=Ja(e,t.to);ol(e,i,r,t.margin)}}function ol(e,t,i,r){var n=yo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ei(e,n.scrollLeft,n.scrollTop)}function ti(e,t){Math.abs(e.doc.scrollTop-t)<2||(d||Co(e,{top:t}),al(e,t,!0),d&&Co(e),ni(e,100))}function al(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function or(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,cl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ri(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+no(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Et(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var ar=function(e,t,i){this.cm=i;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,c&&g<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ar.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},ar.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ar.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ar.prototype.zeroWidthHack=function(){var e=R&&!O?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},ar.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},ar.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ii=function(){};ii.prototype.update=function(){return{bottom:0,right:0}},ii.prototype.setScrollLeft=function(){},ii.prototype.setScrollTop=function(){},ii.prototype.clear=function(){};function Sr(e,t){t||(t=ri(e));var i=e.display.barWidth,r=e.display.barHeight;ll(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Wi(e),ll(e,ri(e)),i=e.display.barWidth,r=e.display.barHeight}function ll(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var sl={native:ar,null:ii};function ul(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?or(e,t):ti(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Lf=0;function lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Lf,markArrays:null},af(e.curOp)}function sr(e){var t=e.curOp;t&&sf(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ui(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bf(e){e.updatedDisplay=e.mustUpdate&&Do(e.cm,e.update)}function Nf(e){var t=e.cm,i=t.display;e.updatedDisplay&&Wi(t),e.barMeasure=ri(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ua(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Et(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function If(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Xr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,f=o.text.length>e.options.maxHighlightLength?$t(t.mode,r.state):null,p=ma(e,o,r,!0);f&&(r.state=f),o.styles=p.styles;var m=o.styleClasses,b=p.classes;b?o.styleClasses=b:m&&(o.styleClasses=null);for(var D=!s||s.length!=o.styles.length||m!=b&&(!m||!b||m.bgClass!=b.bgClass||m.textClass!=b.textClass),E=0;!D&&Ei)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var o=0;o=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&tl(e)==0)return!1;dl(e)&&(Ut(e),t.dims=co(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFroms&&i.viewTo-s<20&&(s=Math.min(n,i.viewTo)),Bt&&(o=eo(e.doc,o),s=Ma(e.doc,s));var f=o!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;wf(e,o,s),i.viewOffset=Nt(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var p=tl(e);if(!f&&p==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Rf(e);return p>4&&(i.lineDiv.style.display="none"),Wf(e,i.updateLineNumbers,t.dims),p>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Pf(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ni(e,400)),i.updateLineNumbers=null,!0}function fl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==tr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+no(e.display)-oo(e),i.top)}),t.visible=_i(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=_i(e.display,e.doc,i));if(!Do(e,t))break;Wi(e);var n=ri(e);Vr(e),Sr(e,n),ko(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Co(e,t){var i=new Ui(e,t);if(Do(e,i)){Wi(e),fl(e,i);var r=ri(e);Vr(e),Sr(e,r),ko(e,r),i.finish()}}function Wf(e,t,i){var r=e.display,n=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function f(H){var P=H.nextSibling;return y&&R&&e.display.currentWheelTarget==H?H.style.display="none":H.parentNode.removeChild(H),P}for(var p=r.view,m=r.viewFrom,b=0;b-1&&(S=!1),Ha(e,D,m,i)),S&&(ae(D.lineNumber),D.lineNumber.appendChild(document.createTextNode(Xn(e.options,m)))),s=D.node.nextSibling}m+=D.size}for(;s;)s=f(s)}function wo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function ko(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Et(e)+"px"}function cl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=ho(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",s=0;sf.clientWidth,m=f.scrollHeight>f.clientHeight;if(r&&p||n&&m){if(n&&R&&y){e:for(var b=t.target,D=s.view;b!=f;b=b.parentNode)for(var E=0;E=0&&fe(e,r.to())<=0)return i}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Ai(this.anchor,this.head)},ye.prototype.to=function(){return Fi(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(E,S){return fe(E.from(),S.from())}),i=Fe(t,n);for(var o=1;o0:p>=0){var m=Ai(f.from(),s.from()),b=Fi(f.to(),s.to()),D=f.empty()?s.from()==s.head:f.from()==f.head;o<=i&&--i,t.splice(--o,2,new ye(D?b:m,D?m:b))}}return new pt(t,i)}function jt(e,t){return new pt([new ye(e,t||e)],0)}function Gt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function vl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Gt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Gt(t).ch-t.to.ch),q(i,r)}function Fo(e,t){for(var i=[],r=0;r1&&e.remove(f.line+1,H-1),e.insert(f.line+1,Y)}qe(e,"change",e,t)}function Kt(e,t,i){function r(n,o,s){if(n.linked)for(var f=0;f1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function Cl(e,t,i,r){var n=e.history;n.undone.length=0;var o=+new Date,s,f;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(s=Gf(n,n.lastOp==r)))f=me(s.changes),fe(t.from,t.to)==0&&fe(t.from,f.to)==0?f.to=Gt(t):s.changes.push(Lo(e,t));else{var p=me(n.done);for((!p||!p.ranges)&&Ki(e.sel,n.done),s={changes:[Lo(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,f||Ie(e,"historyAdded")}function Kf(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Xf(e,t,i,r){var n=e.history,o=r&&r.origin;i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Kf(e,o,me(n.done),t))?n.done[n.done.length-1]=t:Ki(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=i,r&&r.clearRedo!==!1&&Dl(n.undone)}function Ki(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function wl(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(s){s.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=s.markedSpans),++o})}function Yf(e){if(!e)return null;for(var t,i=0;i-1&&(me(f)[D]=m[D],delete m[D])}}return r}function To(e,t,i,r){if(r){var n=e.anchor;if(i){var o=fe(t,n)<0;o!=fe(i,n)<0?(n=t,t=i):o!=fe(t,i)<0&&(t=i)}return new ye(n,t)}else return new ye(i||t,t)}function Xi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([To(e.sel.primary(),t,i,n)],0),r)}function Sl(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:f.to>t.ch))){if(n&&(Ie(p,"beforeCursorEnter"),p.explicitlyCleared))if(o.markedSpans){--s;continue}else break;if(!p.atomic)continue;if(i){var D=p.find(r<0?1:-1),E=void 0;if((r<0?b:m)&&(D=Ml(e,D,-r,D&&D.line==t.line?o:null)),D&&D.line==t.line&&(E=fe(D,i))&&(r<0?E<0:E>0))return Ar(e,D,t,r,n)}var S=p.find(r<0?-1:1);return(r<0?m:b)&&(S=Ml(e,S,r,S.line==t.line?o:null)),S?Ar(e,S,t,r,n):null}}return t}function Zi(e,t,i,r,n){var o=r||1,s=Ar(e,t,i,o,n)||!n&&Ar(e,t,i,o,!0)||Ar(e,t,i,-o,n)||!n&&Ar(e,t,i,-o,!0);return s||(e.cantEdit=!0,q(e.first,0))}function Ml(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line=0;--n)Il(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Il(e,t)}}function Il(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Fo(e,t);Cl(e,t,i,e.cm?e.cm.curOp.id:NaN),li(e,t,i,$n(e,t));var r=[];Kt(e,function(n,o){!o&&Fe(r,n.history)==-1&&(Rl(n.history,t),r.push(n.history)),li(n,t,null,$n(n,t))})}}function Qi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,o,s=e.sel,f=t=="undo"?n.done:n.undone,p=t=="undo"?n.undone:n.done,m=0;m=0;--S){var H=E(S);if(H)return H.v}}}}function Ol(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(yt(e.sel.ranges,function(n){return new ye(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:q(o,re(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),i||(i=Fo(e,t)),e.cm?Jf(e.cm,t,r):Eo(e,t,r),Yi(e,i,rt),e.cantEdit&&Zi(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function Jf(e,t,i){var r=e.doc,n=e.display,o=t.from,s=t.to,f=!1,p=o.line;e.options.lineWrapping||(p=be(bt(re(r,o.line))),r.iter(p,s.line+1,function(S){if(S==n.maxLine)return f=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ca(e),Eo(r,t,i,el(e)),e.options.lineWrapping||(r.iter(p,o.line+t.text.length,function(S){var H=Ni(S);H>n.maxLineLength&&(n.maxLine=S,n.maxLineLength=H,n.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Pu(r,o.line),ni(e,400);var m=t.text.length-(s.line-o.line)-1;t.full?nt(e):o.line==s.line&&t.text.length==1&&!xl(e.doc,t)?qt(e,o.line,"text"):nt(e,o.line,s.line+1,m);var b=mt(e,"changes"),D=mt(e,"change");if(D||b){var E={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};D&&qe(e,"change",e,E),b&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(E)}e.display.selForContextMenu=null}function Lr(e,t,i,r,n){var o;r||(r=i),fe(r,i)<0&&(o=[r,i],i=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Er(e,{from:i,to:r,text:t,origin:n})}function Hl(e,t,i,r){i1||!(this.children[0]instanceof ui))){var f=[];this.collapse(f),this.children=[new ui(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=n.lines.length%25+25,f=s;f10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=b,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ll(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&sr(e),this.parent&&this.parent.clear()}},Xt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||s==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=U("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ta(e,t.line,t,i,o)||t.line!=i.line&&Ta(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");_u()}o.addToHistory&&Cl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,p=e.cm,m;if(e.iter(f,i.line+1,function(D){p&&o.collapsed&&!p.options.lineWrapping&&bt(D)==p.display.maxLine&&(m=!0),o.collapsed&&f!=t.line&&Ft(D,0),Uu(D,new Li(o,f==t.line?t.ch:null,f==i.line?i.ch:null),e.cm&&e.cm.curOp),++f}),o.collapsed&&e.iter(t.line,i.line+1,function(D){_t(e,D)&&Ft(D,0)}),o.clearOnEnter&&oe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Wu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Wl,o.atomic=!0),p){if(m&&(p.curOp.updateMaxLine=!0),o.collapsed)nt(p,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var b=t.line;b<=i.line;b++)qt(p,b,"text");o.atomic&&Ll(p.doc),qe(p,"markerAdded",p,o)}return o}var di=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;p--)Er(this,r[p]);f?Al(this,f):this.cm&&kr(this.cm)}),undo:je(function(){Qi(this,"undo")}),redo:je(function(){Qi(this,"redo")}),undoSelection:je(function(){Qi(this,"undo",!0)}),redoSelection:je(function(){Qi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var f=0;f=p.to||p.from==null&&n!=e.line||p.from!=null&&n==t.line&&p.from>=t.ch)&&(!i||i(p.marker))&&r.push(p.marker.parent||p.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=o,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var b=e.dataTransfer.getData("Text");if(b){var D;if(t.state.draggingText&&!t.state.draggingText.copy&&(D=t.listSelections()),Yi(t.doc,jt(i,i)),D)for(var E=0;E=0;f--)Lr(e.doc,"",r[f].from,r[f].to,"+delete");kr(e)})}function Bo(e,t,i){var r=ua(e.text,t+i,i);return r<0||r>e.text.length?null:r}function No(e,t,i){var r=Bo(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function Io(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var o=Mt(i,t.doc.direction);if(o){var s=n<0?me(o):o[0],f=n<0==(s.level==1),p=f?"after":"before",m;if(s.level>0||t.doc.direction=="rtl"){var b=br(t,i);m=n<0?i.text.length-1:0;var D=Lt(t,b,m).top;m=qr(function(E){return Lt(t,b,E).top==D},n<0==(s.level==1)?s.from:s.to-1,m),p=="before"&&(m=Bo(i,m,1))}else m=n<0?s.to:s.from;return new q(r,m,p)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function cc(e,t,i,r){var n=Mt(t,e.doc.direction);if(!n)return No(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=jr(n,i.ch,i.sticky),s=n[o];if(e.doc.direction=="ltr"&&s.level%2==0&&(r>0?s.to>i.ch:s.from=s.from&&E>=b.begin)){var S=D?"before":"after";return new q(i.line,E,S)}}var H=function(Y,Q,Z){for(var $=function(Ce,Ge){return Ge?new q(i.line,f(Ce,1),"before"):new q(i.line,Ce,"after")};Y>=0&&Y0==(ne.level!=1),pe=ie?Z.begin:f(Z.end,-1);if(ne.from<=pe&&pe0?b.end:f(b.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(P=H(r>0?0:n.length-1,r,m(j)),P)?P:null}var gi={selectAll:Bl,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return Br(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new q(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var s=re(e.doc,n.line-1).text;s&&(n=new q(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),q(n.line-1,s.length-1),n,"+transpose"))}}i.push(new ye(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&fe(t,this.pos)==0&&i==this.button};var mi,xi;function xc(e,t){var i=+new Date;return xi&&xi.compare(i,e,t)?(mi=xi=null,"triple"):mi&&mi.compare(i,e,t)?(xi=new Ho(i,e,t),mi=null,"double"):(mi=new Ho(i,e,t),xi=null,"single")}function rs(e){var t=this,i=t.display;if(!(_e(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,It(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!zo(t,e)){var r=ir(t,e),n=ha(e),o=r?xc(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&yc(t,n,r,o,e))&&(n==1?r?Dc(t,r,o,e):Rn(e)==i.scroller&&it(e):n==2?(r&&Xi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):mo(t)))}}}function yc(e,t,i,r,n){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,vi(e,Xl(o,n),n,function(s){if(typeof s=="string"&&(s=gi[s]),!s)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=s(e,i)!=Pe}finally{e.state.suppressEdits=!1}return f})}function bc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var o=z?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=R?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(R?i.altKey:i.ctrlKey)),n}function Dc(e,t,i,r){c?setTimeout(tt(il,e),0):e.curOp.focus=ve(ee(e));var n=bc(e,i,r),o=e.doc.sel,s;e.options.dragDrop&&Eu&&!e.isReadOnly()&&i=="single"&&(s=o.contains(t))>-1&&(fe((s=o.ranges[s]).from(),t)<0||t.xRel>0)&&(fe(s.to(),t)>0||t.xRel<0)?Cc(e,r,t,n):wc(e,r,t,n)}function Cc(e,t,i,r){var n=e.display,o=!1,s=Ue(e,function(m){y&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:mo(e)),ht(n.wrapper.ownerDocument,"mouseup",s),ht(n.wrapper.ownerDocument,"mousemove",f),ht(n.scroller,"dragstart",p),ht(n.scroller,"drop",s),o||(it(m),r.addNew||Xi(e.doc,i,null,null,r.extend),y&&!T||c&&g==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),f=function(m){o=o||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},p=function(){return o=!0};y&&(n.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",s),oe(n.wrapper.ownerDocument,"mousemove",f),oe(n.scroller,"dragstart",p),oe(n.scroller,"drop",s),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function is(e,t,i){if(i=="char")return new ye(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new ye(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new ye(r.from,r.to)}function wc(e,t,i,r){c&&mo(e);var n=e.display,o=e.doc;it(t);var s,f,p=o.sel,m=p.ranges;if(r.addNew&&!r.extend?(f=o.sel.contains(i),f>-1?s=m[f]:s=new ye(i,i)):(s=o.sel.primary(),f=o.sel.primIndex),r.unit=="rectangle")r.addNew||(s=new ye(i,i)),i=ir(e,t,!0,!0),f=-1;else{var b=is(e,i,r.unit);r.extend?s=To(s,b.anchor,b.head,r.extend):s=b}r.addNew?f==-1?(f=m.length,Ze(o,Ct(e,m.concat([s]),f),{scroll:!1,origin:"*mouse"})):m.length>1&&m[f].empty()&&r.unit=="char"&&!r.extend?(Ze(o,Ct(e,m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=o.sel):Mo(o,f,s,_r):(f=0,Ze(o,new pt([s],0),_r),p=o.sel);var D=i;function E(Z){if(fe(D,Z)!=0)if(D=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(o,i.line).text,i.ch,ne),pe=Re(re(o,Z.line).text,Z.ch,ne),Ce=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(o,Le).text,He=St(at,Ce,ne);Ce==Ge?$.push(new ye(q(Le,He),q(Le,He))):at.length>He&&$.push(new ye(q(Le,He),q(Le,St(at,Ge,ne))))}$.length||$.push(new ye(i,i)),Ze(o,Ct(e,p.ranges.slice(0,f).concat($),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=s,Xe=is(e,Z,r.unit),We=lt.anchor,ze;fe(Xe.anchor,We)>0?(ze=Xe.head,We=Ai(lt.from(),Xe.anchor)):(ze=Xe.anchor,We=Fi(lt.to(),Xe.head));var Be=p.ranges.slice(0);Be[f]=kc(e,new ye(ce(o,We),ze)),Ze(o,Ct(e,Be,f),_r)}}var S=n.wrapper.getBoundingClientRect(),H=0;function P(Z){var $=++H,ne=ir(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,D)!=0){e.curOp.focus=ve(ee(e)),E(ne);var ie=_i(n,o);(ne.line>=ie.to||ne.lineS.bottom?20:0;pe&&setTimeout(Ue(e,function(){H==$&&(n.scroller.scrollTop+=pe,P(Z))}),50)}}function j(Z){e.state.selectingText=!1,H=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!ha(Z)?j(Z):P(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function kc(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var o=Mt(n);if(!o)return t;var s=jr(o,i.ch,i.sticky),f=o[s];if(f.from!=i.ch&&f.to!=i.ch)return t;var p=s+(f.from==i.ch==(f.level!=1)?0:1);if(p==0||p==o.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var b=jr(o,r.ch,r.sticky),D=b-s||(r.ch-i.ch)*(f.level==1?-1:1);b==p-1||b==p?m=D<0:m=D>0}var E=o[p+(m?-1:0)],S=m==(E.level==1),H=S?E.from:E.to,P=S?"after":"before";return i.ch==H&&i.sticky==P?t:new ye(new q(i.line,H,P),r)}function ns(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var s=e.display,f=s.lineDiv.getBoundingClientRect();if(o>f.bottom||!mt(e,i))return zn(t);o-=f.top-s.viewOffset;for(var p=0;p=n){var b=er(e.doc,o),D=e.display.gutterSpecs[p];return Ie(e,i,e,b,D.className,t),zn(t)}}}function zo(e,t){return ns(e,t,"gutterClick",!0)}function os(e,t){It(e.display,t)||Sc(e,t)||_e(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function Sc(e,t){return mt(e,"gutterContextMenu")?ns(e,t,"gutterContextMenu",!1):!1}function as(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),$r(e)}var Nr={toString:function(){return"CodeMirror.Init"}},ls={},en={};function Fc(e){var t=e.optionHandlers;function i(r,n,o,s){e.defaults[r]=n,o&&(t[r]=s?function(f,p,m){m!=Nr&&o(f,p,m)}:o)}e.defineOption=i,e.Init=Nr,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ao(r)},!0),i("indentUnit",2,Ao,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){ai(r),$r(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var o=[],s=r.doc.first;r.doc.iter(function(p){for(var m=0;;){var b=p.text.indexOf(n,m);if(b==-1)break;m=b+n.length,o.push(q(s,b))}s++});for(var f=o.length-1;f>=0;f--)Lr(r.doc,n,o[f],q(o[f].line,o[f].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,o){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),o!=Nr&&r.refresh()}),i("specialCharPlaceholder",ef,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!W),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){as(r),oi(r)},!0),i("keyMap","default",function(r,n,o){var s=$i(n),f=o!=Nr&&$i(o);f&&f.detach&&f.detach(r,s),s.attach&&s.attach(r,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ec,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=So(n,r.options.lineNumbers),oi(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?ho(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Sr(r)},!0),i("scrollbarStyle","native",function(r){ul(r),Sr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=So(r.options.gutters,n),oi(r)},!0),i("firstLineNumber",1,oi,!0),i("lineNumberFormatter",function(r){return r},oi,!0),i("showCursorWhenSelecting",!1,Vr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(wr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Ac),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Vr,!0),i("singleCursorHeightPerLine",!0,Vr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ai,!0),i("addModeClass",!1,ai,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,ai,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Ac(e,t,i){var r=i&&i!=Nr;if(!t!=!r){var n=e.display.dragFunctions,o=t?oe:ht;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Ec(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),ro(e)),po(e),nt(e),$r(e),setTimeout(function(){return Sr(e)},100)}function Ae(e,t){var i=this;if(!(this instanceof Ae))return new Ae(e,t);this.options=t=t?dt(t):{},dt(ls,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ae.inputStyles[t.inputStyle](this),o=this.display=new _f(e,r,n,t);o.wrapper.CodeMirror=this,as(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ul(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Je,keySeq:null,specialChars:null},t.autofocus&&!N&&o.input.focus(),c&&g<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Lc(this),ac(),lr(this),this.curOp.forceUpdate=!0,yl(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&xo(i)},20):wr(this);for(var s in en)en.hasOwnProperty(s)&&en[s](this,t[s],Nr);dl(this),t.finishInit&&t.finishInit(this);for(var f=0;f20*20}oe(t.scroller,"touchstart",function(p){if(!_e(e,p)&&!o(p)&&!zo(e,p)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},p.touches.length==1&&(t.activeTouch.left=p.touches[0].pageX,t.activeTouch.top=p.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(p){var m=t.activeTouch;if(m&&!It(t,p)&&m.left!=null&&!m.moved&&new Date-m.start<300){var b=e.coordsChar(t.activeTouch,"page"),D;!m.prev||s(m,m.prev)?D=new ye(b,b):!m.prev.prev||s(m,m.prev.prev)?D=e.findWordAt(b):D=new ye(q(b.line,0),ce(e.doc,q(b.line+1,0))),e.setSelection(D.anchor,D.head),e.focus(),it(p)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ti(e,t.scroller.scrollTop),or(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(p){return gl(e,p)}),oe(t.scroller,"DOMMouseScroll",function(p){return gl(e,p)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(p){_e(e,p)||Gr(p)},over:function(p){_e(e,p)||(oc(e,p),Gr(p))},start:function(p){return nc(e,p)},drop:Ue(e,ic),leave:function(p){_e(e,p)||Ul(e)}};var f=t.input.getField();oe(f,"keyup",function(p){return es.call(e,p)}),oe(f,"keydown",Ue(e,Vl)),oe(f,"keypress",Ue(e,ts)),oe(f,"focus",function(p){return xo(e,p)}),oe(f,"blur",function(p){return wr(e,p)})}var Ro=[];Ae.defineInitHook=function(e){return Ro.push(e)};function yi(e,t,i,r){var n=e.doc,o;i==null&&(i="add"),i=="smart"&&(n.mode.indent?o=Xr(e,t).state:i="prev");var s=e.options.tabSize,f=re(n,t),p=Re(f.text,null,s);f.stateAfter&&(f.stateAfter=null);var m=f.text.match(/^\s*/)[0],b;if(!r&&!/\S/.test(f.text))b=0,i="not";else if(i=="smart"&&(b=n.mode.indent(o,f.text.slice(m.length),f.text),b==Pe||b>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?b=Re(re(n,t-1).text,null,s):b=0:i=="add"?b=p+e.options.indentUnit:i=="subtract"?b=p-e.options.indentUnit:typeof i=="number"&&(b=p+i),b=Math.max(0,b);var D="",E=0;if(e.options.indentWithTabs)for(var S=Math.floor(b/s);S;--S)E+=s,D+=" ";if(Es,p=_n(t),m=null;if(f&&r.ranges.length>1)if(wt&&wt.text.join(` +`)==t){if(r.ranges.length%wt.text.length==0){m=[];for(var b=0;b=0;E--){var S=r.ranges[E],H=S.from(),P=S.to();S.empty()&&(i&&i>0?H=q(H.line,H.ch-i):e.state.overwrite&&!f?P=q(P.line,Math.min(re(o,P.line).text.length,P.ch+me(p).length)):f&&wt&&wt.lineWise&&wt.text.join(` +`)==p.join(` +`)&&(H=P=q(H.line,0)));var j={from:H,to:P,text:m?m[E%m.length]:p,origin:n||(f?"paste":e.state.cutIncoming>s?"cut":"+input")};Er(e.doc,j),qe(e,"inputRead",e,j)}t&&!f&&us(e,t),kr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=D),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return Po(t,i,0,null,"paste")}),!0}function us(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),s=!1;if(o.electricChars){for(var f=0;f-1){s=yi(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(s=yi(e,n.head.line,"smart"));s&&qe(e,"electricInput",e,n.head.line)}}}function fs(e){for(var t=[],i=[],r=0;ro&&(yi(this,f.head.line,r,!0),o=f.head.line,s==this.doc.sel.primIndex&&kr(this));else{var p=f.from(),m=f.to(),b=Math.max(o,p.line);o=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var D=b;D0&&Mo(this.doc,s,new ye(p,E[s].to()),rt)}}}),getTokenAt:function(r,n){return Da(this,r,n)},getLineTokens:function(r,n){return Da(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=xa(this,re(this.doc,r.line)),o=0,s=(n.length-1)/2,f=r.ch,p;if(f==0)p=n[2];else for(;;){var m=o+s>>1;if((m?n[m*2-1]:0)>=f)s=m;else if(n[m*2+1]p&&(r=p,s=!0),f=re(this.doc,r)}else f=r;return Hi(this,f,{top:0,left:0},n||"page",o||s).top+(s?this.doc.height-Nt(f):0)},defaultTextHeight:function(){return Dr(this.display)},defaultCharWidth:function(){return Cr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,o,s,f){var p=this.display;r=Dt(this,ce(this.doc,r));var m=r.bottom,b=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),p.sizer.appendChild(n),s=="over")m=r.top;else if(s=="above"||s=="near"){var D=Math.max(p.wrapper.clientHeight,this.doc.height),E=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);(s=="above"||r.bottom+n.offsetHeight>D)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=D&&(m=r.bottom),b+n.offsetWidth>E&&(b=E-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",f=="right"?(b=p.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(f=="left"?b=0:f=="middle"&&(b=(p.sizer.clientWidth-n.offsetWidth)/2),n.style.left=b+"px"),o&&Af(this,{left:b,top:m,right:b+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(Vl),triggerOnKeyPress:$e(ts),triggerOnKeyUp:es,triggerOnMouseDown:$e(rs),execCommand:function(r){if(gi.hasOwnProperty(r))return gi[r].call(null,this)},triggerElectric:$e(function(r){us(this,r)}),findPosH:function(r,n,o,s){var f=1;n<0&&(f=-1,n=-n);for(var p=ce(this.doc,r),m=0;m0&&b(o.charAt(s-1));)--s;for(;f.5||this.options.lineWrapping)&&po(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),yl(this,r),$r(this),this.display.input.reset(),ei(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},gr(e),e.registerHelper=function(r,n,o){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=o},e.registerGlobalHelper=function(r,n,o,s){e.registerHelper(r,n,s),i[r]._global.push({pred:o,val:s})}}function _o(e,t,i,r,n){var o=t,s=i,f=re(e,t.line),p=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+p;return Q=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),f=re(e,Q))}function b(Q){var Z;if(r=="codepoint"){var $=f.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=cc(e.cm,f,t,i):Z=No(f,t,i);if(Z==null)if(!Q&&m())t=Io(n,e.cm,f,t.line,p);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")b();else if(r=="column")b(!0);else if(r=="word"||r=="group")for(var D=null,E=r=="group",S=e.cm&&e.cm.getHelper(t,"wordChars"),H=!0;!(i<0&&!b(!H));H=!1){var P=f.text.charAt(t.ch)||` +`,j=ki(P,S)?"w":E&&P==` +`?"n":!E||/\s/.test(P)?null:"p";if(E&&!H&&!j&&(j="s"),D&&D!=j){i<0&&(i=1,b(),t.sticky="after");break}if(j&&(D=j),i>0&&!b(!H))break}var Y=Zi(e,t,o,s,!0);return Yn(o,Y)&&(Y.hitSide=!0),Y}function ds(e,t,i,r){var n=e.doc,o=t.left,s;if(r=="page"){var f=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),p=Math.max(f-.5*Dr(e.display),3);s=(i>0?t.bottom:t.top)+i*p}else r=="line"&&(s=i>0?t.bottom+3:t.top-3);for(var m;m=uo(e,o,s),!!m.outside;){if(i<0?s<=0:s>=n.height){m.hitSide=!0;break}s+=i*5}return m}var De=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,Wo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(f){for(var p=f.target;p;p=p.parentNode){if(p==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(p.className))break}return!1}oe(n,"paste",function(f){!o(f)||_e(r,f)||ss(f,r)||g<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),oe(n,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),oe(n,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function s(f){if(!(!o(f)||_e(r,f))){if(r.somethingSelected())tn({lineWise:!1,text:r.getSelections()}),f.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var p=fs(r);tn({lineWise:!0,text:p.text}),f.type=="cut"&&r.operation(function(){r.setSelections(p.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var m=wt.text.join(` +`);if(f.clipboardData.setData("Text",m),f.clipboardData.getData("Text")==m){f.preventDefault();return}}var b=cs(),D=b.firstChild;Wo(D),r.display.lineSpace.insertBefore(b,r.display.lineSpace.firstChild),D.value=wt.text.join(` +`);var E=ve(xe(n));k(D),setTimeout(function(){r.display.lineSpace.removeChild(b),E.focus(),E==n&&i.showPrimarySelection()},50)}}oe(n,"copy",s),oe(n,"cut",s)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=rl(this.cm,!1);return e.focus=ve(xe(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&hs(t,r)||{node:f[0].measure.map[2],offset:0},m=n.linee.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var o,s,f;r.line==t.viewFrom||(o=nr(e,r.line))==0?(s=be(t.view[0].line),f=t.view[0].node):(s=be(t.view[o].line),f=t.view[o-1].node.nextSibling);var p=nr(e,n.line),m,b;if(p==t.view.length-1?(m=t.viewTo-1,b=t.lineDiv.lastChild):(m=be(t.view[p+1].line)-1,b=t.view[p+1].node.previousSibling),!f)return!1;for(var D=e.doc.splitLines(Bc(e,f,b,s,m)),E=Vt(e.doc,q(s,0),q(m,re(e.doc,m).text.length));D.length>1&&E.length>1;)if(me(D)==me(E))D.pop(),E.pop(),m--;else if(D[0]==E[0])D.shift(),E.shift(),s++;else break;for(var S=0,H=0,P=D[0],j=E[0],Y=Math.min(P.length,j.length);Sr.ch&&Q.charCodeAt(Q.length-H-1)==Z.charCodeAt(Z.length-H-1);)S--,H++;D[D.length-1]=Q.slice(0,Q.length-H).replace(/^\u200b+/,""),D[0]=D[0].slice(S).replace(/\u200b+$/,"");var ne=q(s,S),ie=q(m,E.length?me(E).length-H:0);if(D.length>1||D[0]||fe(ne,ie))return Lr(e.doc,D,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,Po)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function hs(e,t){var i=ao(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=qa(i,r,t.line),o=Mt(r,e.doc.direction),s="left";if(o){var f=jr(o,t.ch);s=f%2?"right":"left"}var p=Ga(n.map,t.ch,s);return p.offset=p.collapse=="right"?p.end:p.start,p}function Mc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ir(e,t){return t&&(e.bad=!0),e}function Bc(e,t,i,r,n){var o="",s=!1,f=e.doc.lineSeparator(),p=!1;function m(S){return function(H){return H.id==S}}function b(){s&&(o+=f,p&&(o+=f),s=p=!1)}function D(S){S&&(b(),o+=S)}function E(S){if(S.nodeType==1){var H=S.getAttribute("cm-text");if(H){D(H);return}var P=S.getAttribute("cm-marker"),j;if(P){var Y=e.findMarks(q(r,0),q(n+1,0),m(+P));Y.length&&(j=Y[0].find(0))&&D(Vt(e.doc,j.from,j.to).join(f));return}if(S.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(S.nodeName);if(!/^br$/i.test(S.nodeName)&&S.textContent.length==0)return;Q&&b();for(var Z=0;Z=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(s){_e(r,s)||ss(s,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function o(s){if(!_e(r,s)){if(r.somethingSelected())tn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var f=fs(r);tn({lineWise:!0,text:f.text}),s.type=="cut"?r.setSelections(f.ranges,null,rt):(i.prevInput="",n.value=f.text.join(` +`),k(n))}else return;s.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",o),oe(n,"copy",o),oe(e.scroller,"paste",function(s){if(!(It(e,s)||_e(r,s))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=s.clipboardData,n.dispatchEvent(f)}}),oe(e.lineSpace,"selectstart",function(s){It(e,s)||it(s)}),oe(n,"compositionstart",function(){var s=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:s,range:r.markText(s,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=cs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Wo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=rl(e);if(e.options.moveInputWithCursor){var n=Dt(e,i.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+s.left-o.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&k(this.textarea),c&&g>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",c&&g>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||ve(xe(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Mu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(c&&g>=9&&this.hasSelection===n||R&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var s=0,f=Math.min(r.length,n.length);s1e3||n.indexOf(` +`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){c&&g>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ir(i,e),s=r.scroller.scrollTop;if(!o||L)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(o)==-1&&Ue(i,Ze)(i.doc,jt(o),rt);var p=n.style.cssText,m=t.wrapper.style.cssText,b=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-b.top-5)+"px; left: "+(e.clientX-b.left-5)+`px; + z-index: 1000; background: `+(c?"rgba(255, 255, 255, .05)":"transparent")+`; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var D;y&&(D=n.ownerDocument.defaultView.scrollY),r.input.focus(),y&&n.ownerDocument.defaultView.scrollTo(null,D),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=S,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function E(){if(n.selectionStart!=null){var P=i.somethingSelected(),j="\u200B"+(P?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=P?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function S(){if(t.contextMenuPending==S&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=p,c&&g<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=s),n.selectionStart!=null)){(!c||c&&g<9)&&E();var P=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,Bl)(i):P++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(c&&g>=9&&E(),ge){Gr(e);var H=function(){ht(window,"mouseup",H),setTimeout(S,20)};oe(window,"mouseup",H)}else setTimeout(S,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function Ic(e,t){if(t=t?dt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ve(xe(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=f.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;n=o.submit;try{var s=o.submit=function(){r(),o.submit=n,o.submit(),o.submit=s}}catch{}}t.finishInit=function(p){p.save=r,p.getTextArea=function(){return e},p.toTextArea=function(){p.toTextArea=isNaN,r(),e.parentNode.removeChild(p.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var f=Ae(function(p){return e.parentNode.insertBefore(p,e.nextSibling)},t);return f}function Oc(e){e.off=ht,e.on=oe,e.wheelEventPixels=qf,e.Doc=ot,e.splitLines=_n,e.countColumn=Re,e.findColumn=St,e.isWordChar=In,e.Pass=Pe,e.signal=Ie,e.Line=xr,e.changeEnd=Gt,e.scrollbarModel=sl,e.Pos=q,e.cmpPos=fe,e.modes=Un,e.mimeModes=vr,e.resolveMode=Si,e.getMode=jn,e.modeExtensions=mr,e.extendMode=Hu,e.copyState=$t,e.startState=pa,e.innerMode=Gn,e.commands=gi,e.keyMap=Ht,e.keyName=Yl,e.isModifierKey=Kl,e.lookupKey=Mr,e.normalizeKeyMap=fc,e.StringStream=Oe,e.SharedTextMarker=di,e.TextMarker=Xt,e.LineWidget=ci,e.e_preventDefault=it,e.e_stopPropagation=da,e.e_stop=Gr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Yt}Fc(Ae),Tc(Ae);var Hc="iter insert remove copy getEditor constructor".split(" ");for(var nn in ot.prototype)ot.prototype.hasOwnProperty(nn)&&Fe(Hc,nn)<0&&(Ae.prototype[nn]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[nn]));return gr(ot),Ae.inputStyles={textarea:Ne,contenteditable:De},Ae.defineMode=function(e){!Ae.defaults.mode&&e!="null"&&(Ae.defaults.mode=e),Iu.apply(this,arguments)},Ae.defineMIME=Ou,Ae.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ae.defineMIME("text/plain","null"),Ae.defineExtension=function(e,t){Ae.prototype[e]=t},Ae.defineDocExtension=function(e,t){ot.prototype[e]=t},Ae.fromTextArea=Ic,Oc(Ae),Ae.version="5.65.21",Ae})});var xs=Ye((vs,ms)=>{(function(a){typeof vs=="object"&&typeof ms=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(v){if(v.getOption("disableInput"))return a.Pass;for(var c=v.listSelections(),g=[],y=0;y\s*$/.test(O),N=!/>\s*$/.test(O);(B||N)&&v.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),g[y]=` +`}else{var R=I[1],z=I[5],W=!(l.test(I[2])||I[2].indexOf(">")>=0),X=W?parseInt(I[3],10)+1+I[4]:I[2].replace("x"," ");g[y]=` +`+R+X+z,W&&u(v,w)}}v.replaceSelections(g)};function u(v,c){var g=c.line,y=0,w=0,C=h.exec(v.getLine(g)),M=C[1];do{y+=1;var L=g+y,T=v.getLine(L),O=h.exec(T);if(O){var I=O[1],F=parseInt(C[3],10)+y-w,B=parseInt(O[3],10),N=B;if(M===I&&!isNaN(B))F===B&&(N=B+1),F>B&&(N=F+1),v.replaceRange(T.replace(h,I+N+O[4]+O[5]),{line:L,ch:0},{line:L,ch:T.length});else{if(M.length>I.length||M.length{var ys=ct();ys.commands.tabAndIndentMarkdownList=function(a){var h=a.listSelections(),d=h[0].head,l=a.getStateAfter(d.line),u=l.list!==!1;if(u){a.execCommand("indentMore");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var v=Array(a.options.tabSize+1).join(" ");a.replaceSelection(v)}};ys.commands.shiftTabAndUnindentMarkdownList=function(a){var h=a.listSelections(),d=h[0].head,l=a.getStateAfter(d.line),u=l.list!==!1;if(u){a.execCommand("indentLess");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var v=Array(a.options.tabSize+1).join(" ");a.replaceSelection(v)}}});var ws=Ye((Ds,Cs)=>{(function(a){typeof Ds=="object"&&typeof Cs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("fullScreen",!1,function(l,u,v){v==a.Init&&(v=!1),!v!=!u&&(u?h(l):d(l))});function h(l){var u=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:u.style.width,height:u.style.height},u.style.width="",u.style.height="auto",u.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function d(l){var u=l.getWrapperElement();u.className=u.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var v=l.state.fullScreenRestore;u.style.width=v.width,u.style.height=v.height,window.scrollTo(v.scrollLeft,v.scrollTop),l.refresh()}})});var Ko=Ye((ks,Ss)=>{(function(a){typeof ks=="object"&&typeof Ss=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},d={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(l,u){var v=l.indentUnit,c={},g=u.htmlMode?h:d;for(var y in g)c[y]=g[y];for(var y in u)c[y]=u[y];var w,C;function M(A,U){function _(Te){return U.tokenize=Te,Te(A,U)}var V=A.next();if(V=="<")return A.eat("!")?A.eat("[")?A.match("CDATA[")?_(O("atom","]]>")):null:A.match("--")?_(O("comment","-->")):A.match("DOCTYPE",!0,!0)?(A.eatWhile(/[\w\._\-]/),_(I(1))):null:A.eat("?")?(A.eatWhile(/[\w\._\-]/),U.tokenize=O("meta","?>"),"meta"):(w=A.eat("/")?"closeTag":"openTag",U.tokenize=L,"tag bracket");if(V=="&"){var ve;return A.eat("#")?A.eat("x")?ve=A.eatWhile(/[a-fA-F\d]/)&&A.eat(";"):ve=A.eatWhile(/[\d]/)&&A.eat(";"):ve=A.eatWhile(/[\w\.\-:]/)&&A.eat(";"),ve?"atom":"error"}else return A.eatWhile(/[^&<]/),null}M.isInText=!0;function L(A,U){var _=A.next();if(_==">"||_=="/"&&A.eat(">"))return U.tokenize=M,w=_==">"?"endTag":"selfcloseTag","tag bracket";if(_=="=")return w="equals",null;if(_=="<"){U.tokenize=M,U.state=z,U.tagName=U.tagStart=null;var V=U.tokenize(A,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(_)?(U.tokenize=T(_),U.stringStartCol=A.column(),U.tokenize(A,U)):(A.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function T(A){var U=function(_,V){for(;!_.eol();)if(_.next()==A){V.tokenize=L;break}return"string"};return U.isInAttribute=!0,U}function O(A,U){return function(_,V){for(;!_.eol();){if(_.match(U)){V.tokenize=M;break}_.next()}return A}}function I(A){return function(U,_){for(var V;(V=U.next())!=null;){if(V=="<")return _.tokenize=I(A+1),_.tokenize(U,_);if(V==">")if(A==1){_.tokenize=M;break}else return _.tokenize=I(A-1),_.tokenize(U,_)}return"meta"}}function F(A){return A&&A.toLowerCase()}function B(A,U,_){this.prev=A.context,this.tagName=U||"",this.indent=A.indented,this.startOfLine=_,(c.doNotIndent.hasOwnProperty(U)||A.context&&A.context.noIndent)&&(this.noIndent=!0)}function N(A){A.context&&(A.context=A.context.prev)}function R(A,U){for(var _;;){if(!A.context||(_=A.context.tagName,!c.contextGrabbers.hasOwnProperty(F(_))||!c.contextGrabbers[F(_)].hasOwnProperty(F(U))))return;N(A)}}function z(A,U,_){return A=="openTag"?(_.tagStart=U.column(),W):A=="closeTag"?X:z}function W(A,U,_){return A=="word"?(_.tagName=U.current(),C="tag",G):c.allowMissingTagName&&A=="endTag"?(C="tag bracket",G(A,U,_)):(C="error",W)}function X(A,U,_){if(A=="word"){var V=U.current();return _.context&&_.context.tagName!=V&&c.implicitlyClosed.hasOwnProperty(F(_.context.tagName))&&N(_),_.context&&_.context.tagName==V||c.matchClosing===!1?(C="tag",K):(C="tag error",ge)}else return c.allowMissingTagName&&A=="endTag"?(C="tag bracket",K(A,U,_)):(C="error",ge)}function K(A,U,_){return A!="endTag"?(C="error",K):(N(_),z)}function ge(A,U,_){return C="error",K(A,U,_)}function G(A,U,_){if(A=="word")return C="attribute",ue;if(A=="endTag"||A=="selfcloseTag"){var V=_.tagName,ve=_.tagStart;return _.tagName=_.tagStart=null,A=="selfcloseTag"||c.autoSelfClosers.hasOwnProperty(F(V))?R(_,V):(R(_,V),_.context=new B(_,V,ve==_.indented)),z}return C="error",G}function ue(A,U,_){return A=="equals"?ae:(c.allowMissing||(C="error"),G(A,U,_))}function ae(A,U,_){return A=="string"?de:A=="word"&&c.allowUnquoted?(C="string",G):(C="error",G(A,U,_))}function de(A,U,_){return A=="string"?de:G(A,U,_)}return{startState:function(A){var U={tokenize:M,state:z,indented:A||0,tagName:null,tagStart:null,context:null};return A!=null&&(U.baseIndent=A),U},token:function(A,U){if(!U.tagName&&A.sol()&&(U.indented=A.indentation()),A.eatSpace())return null;w=null;var _=U.tokenize(A,U);return(_||w)&&_!="comment"&&(C=null,U.state=U.state(w||_,A,U),C&&(_=C=="error"?_+" error":C)),_},indent:function(A,U,_){var V=A.context;if(A.tokenize.isInAttribute)return A.tagStart==A.indented?A.stringStartCol+1:A.indented+v;if(V&&V.noIndent)return a.Pass;if(A.tokenize!=L&&A.tokenize!=M)return _?_.match(/^(\s*)/)[0].length:0;if(A.tagName)return c.multilineTagIndentPastTag!==!1?A.tagStart+A.tagName.length+2:A.tagStart+v*(c.multilineTagIndentFactor||1);if(c.alignCDATA&&/$/,blockCommentStart:"",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml",skipAttribute:function(A){A.state==ae&&(A.state=G)},xmlCurrentTag:function(A){return A.tagName?{name:A.tagName,close:A.type=="closeTag"}:null},xmlCurrentContext:function(A){for(var U=[],_=A.context;_;_=_.prev)U.push(_.tagName);return U.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Es=Ye((Fs,As)=>{(function(a){typeof Fs=="object"&&typeof As=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var h=0;h-1&&l.substring(c+1,l.length);if(g)return a.findModeByExtension(g)},a.findModeByName=function(l){l=l.toLowerCase();for(var u=0;u{(function(a){typeof Ls=="object"&&typeof Ts=="object"?a(ct(),Ko(),Es()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})(function(a){"use strict";a.defineMode("markdown",function(h,d){var l=a.getMode(h,"text/html"),u=l.name=="null";function v(k){if(a.findModeByName){var x=a.findModeByName(k);x&&(k=x.mime||x.mimes[0])}var ee=a.getMode(h,k);return ee.name=="null"?null:ee}d.highlightFormatting===void 0&&(d.highlightFormatting=!1),d.maxBlockquoteDepth===void 0&&(d.maxBlockquoteDepth=0),d.taskLists===void 0&&(d.taskLists=!1),d.strikethrough===void 0&&(d.strikethrough=!1),d.emoji===void 0&&(d.emoji=!1),d.fencedCodeBlockHighlighting===void 0&&(d.fencedCodeBlockHighlighting=!0),d.fencedCodeBlockDefaultMode===void 0&&(d.fencedCodeBlockDefaultMode="text/plain"),d.xml===void 0&&(d.xml=!0),d.tokenTypeOverrides===void 0&&(d.tokenTypeOverrides={});var c={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var g in c)c.hasOwnProperty(g)&&d.tokenTypeOverrides[g]&&(c[g]=d.tokenTypeOverrides[g]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,C=/^\[(x| )\](?=\s)/i,M=d.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ {0,3}(?:\={1,}|-{2,})\s*$/,T=/^[^#!\[\]*_\\<>` "'(~:]+/,O=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,I=/^\s*\[[^\]]+?\]:.*$/,F=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,B=" ";function N(k,x,ee){return x.f=x.inline=ee,ee(k,x)}function R(k,x,ee){return x.f=x.block=ee,ee(k,x)}function z(k){return!k||!/\S/.test(k.string)}function W(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==K){var x=u;if(!x){var ee=a.innerMode(l,k.htmlState);x=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}x&&(k.f=ae,k.block=X,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function X(k,x){var ee=k.column()===x.indentation,xe=z(x.prevLine.stream),he=x.indentedCode,tt=x.prevLine.hr,dt=x.list!==!1,Re=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var Je=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,dt)){for(x.list=null;Je=4&&(he||x.prevLine.fencedCodeEnd||x.prevLine.header||xe))return k.skipToEnd(),x.indentedCode=!0,c.code;if(k.eatSpace())return null;if(ee&&x.indentation<=Re&&(Pe=k.match(M))&&Pe[1].length<=6)return x.quote=0,x.header=Pe[1].length,x.thisLine.header=!0,d.highlightFormatting&&(x.formatting="header"),x.f=x.inline,G(x);if(x.indentation<=Re&&k.eat(">"))return x.quote=ee?1:x.quote+1,d.highlightFormatting&&(x.formatting="quote"),k.eatSpace(),G(x);if(!Me&&!x.setext&&ee&&x.indentation<=Re&&(Pe=k.match(w))){var rt=Pe[1]?"ol":"ul";return x.indentation=Je+k.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,d.taskLists&&k.match(C,!1)&&(x.taskList=!0),x.f=x.inline,d.highlightFormatting&&(x.formatting=["list","list-"+rt]),G(x)}else{if(ee&&x.indentation<=Re&&(Pe=k.match(O,!0)))return x.quote=0,x.fencedEndRE=new RegExp(Pe[1]+"+ *$"),x.localMode=d.fencedCodeBlockHighlighting&&v(Pe[2]||d.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=a.startState(x.localMode)),x.f=x.block=ge,d.highlightFormatting&&(x.formatting="code-block"),x.code=-1,G(x);if(x.setext||(!Fe||!dt)&&!x.quote&&x.list===!1&&!x.code&&!Me&&!I.test(k.string)&&(Pe=k.lookAhead(1))&&(Pe=Pe.match(L)))return x.setext?(x.header=x.setext,x.setext=0,k.skipToEnd(),d.highlightFormatting&&(x.formatting="header")):(x.header=Pe[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,G(x);if(Me)return k.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,c.hr;if(k.peek()==="[")return N(k,x,V)}return N(k,x,x.inline)}function K(k,x){var ee=l.token(k,x.htmlState);if(!u){var xe=a.innerMode(l,x.htmlState);(xe.mode.name=="xml"&&xe.state.tagStart===null&&!xe.state.context&&xe.state.tokenize.isInText||x.md_inside&&k.current().indexOf(">")>-1)&&(x.f=ae,x.block=X,x.htmlState=null)}return ee}function ge(k,x){var ee=x.listStack[x.listStack.length-1]||0,xe=x.indentation=k.quote?x.push(c.formatting+"-"+k.formatting[ee]+"-"+k.quote):x.push("error"))}if(k.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(k.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(k.linkHref?x.push(c.linkHref,"url"):(k.strong&&x.push(c.strong),k.em&&x.push(c.em),k.strikethrough&&x.push(c.strikethrough),k.emoji&&x.push(c.emoji),k.linkText&&x.push(c.linkText),k.code&&x.push(c.code),k.image&&x.push(c.image),k.imageAltText&&x.push(c.imageAltText,"link"),k.imageMarker&&x.push(c.imageMarker)),k.header&&x.push(c.header,c.header+"-"+k.header),k.quote&&(x.push(c.quote),!d.maxBlockquoteDepth||d.maxBlockquoteDepth>=k.quote?x.push(c.quote+"-"+k.quote):x.push(c.quote+"-"+d.maxBlockquoteDepth)),k.list!==!1){var xe=(k.listStack.length-1)%3;xe?xe===1?x.push(c.list2):x.push(c.list3):x.push(c.list1)}return k.trailingSpaceNewLine?x.push("trailing-space-new-line"):k.trailingSpace&&x.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function ue(k,x){if(k.match(T,!0))return G(x)}function ae(k,x){var ee=x.text(k,x);if(typeof ee<"u")return ee;if(x.list)return x.list=null,G(x);if(x.taskList){var xe=k.match(C,!0)[1]===" ";return xe?x.taskOpen=!0:x.taskClosed=!0,d.highlightFormatting&&(x.formatting="task"),x.taskList=!1,G(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&k.match(/^#+$/,!0))return d.highlightFormatting&&(x.formatting="header"),G(x);var he=k.next();if(x.linkTitle){x.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(k.match(new RegExp(dt),!0))return c.linkHref}if(he==="`"){var Re=x.formatting;d.highlightFormatting&&(x.formatting="code"),k.eatWhile("`");var Je=k.current().length;if(x.code==0&&(!x.quote||Je==1))return x.code=Je,G(x);if(Je==x.code){var Fe=G(x);return x.code=0,Fe}else return x.formatting=Re,G(x)}else if(x.code)return G(x);if(he==="\\"&&(k.next(),d.highlightFormatting)){var Me=G(x),Pe=c.formatting+"-escape";return Me?Me+" "+Pe:Pe}if(he==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,d.highlightFormatting&&(x.formatting="image"),G(x);if(he==="["&&x.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,d.highlightFormatting&&(x.formatting="image"),G(x);if(he==="]"&&x.imageAltText){d.highlightFormatting&&(x.formatting="image");var Me=G(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=A,Me}if(he==="["&&!x.image)return x.linkText&&k.match(/^.*?\]/)||(x.linkText=!0,d.highlightFormatting&&(x.formatting="link")),G(x);if(he==="]"&&x.linkText){d.highlightFormatting&&(x.formatting="link");var Me=G(x);return x.linkText=!1,x.inline=x.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?A:ae,Me}if(he==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=de,d.highlightFormatting&&(x.formatting="link");var Me=G(x);return Me?Me+=" ":Me="",Me+c.linkInline}if(he==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=de,d.highlightFormatting&&(x.formatting="link");var Me=G(x);return Me?Me+=" ":Me="",Me+c.linkEmail}if(d.xml&&he==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=k.string.indexOf(">",k.pos);if(rt!=-1){var _r=k.string.substring(k.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_r)&&(x.md_inside=!0)}return k.backUp(1),x.htmlState=a.startState(l),R(k,x,K)}if(d.xml&&he==="<"&&k.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var kt=1,St=k.pos==1?" ":k.string.charAt(k.pos-2);kt<3&&k.eat(he);)kt++;var xt=k.peek()||" ",Pt=!/\s/.test(xt)&&(!F.test(xt)||/\s/.test(St)||F.test(St)),me=!/\s/.test(St)&&(!F.test(St)||/\s/.test(xt)||F.test(xt)),yt=null,Wt=null;if(kt%2&&(!x.em&&Pt&&(he==="*"||!me||F.test(St))?yt=!0:x.em==he&&me&&(he==="*"||!Pt||F.test(xt))&&(yt=!1)),kt>1&&(!x.strong&&Pt&&(he==="*"||!me||F.test(St))?Wt=!0:x.strong==he&&me&&(he==="*"||!Pt||F.test(xt))&&(Wt=!1)),Wt!=null||yt!=null){d.highlightFormatting&&(x.formatting=yt==null?"strong":Wt==null?"em":"strong em"),yt===!0&&(x.em=he),Wt===!0&&(x.strong=he);var Fe=G(x);return yt===!1&&(x.em=!1),Wt===!1&&(x.strong=!1),Fe}}else if(he===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return G(x);k.backUp(1)}if(d.strikethrough){if(he==="~"&&k.eatWhile(he)){if(x.strikethrough){d.highlightFormatting&&(x.formatting="strikethrough");var Fe=G(x);return x.strikethrough=!1,Fe}else if(k.match(/^[^\s]/,!1))return x.strikethrough=!0,d.highlightFormatting&&(x.formatting="strikethrough"),G(x)}else if(he===" "&&k.match("~~",!0)){if(k.peek()===" ")return G(x);k.backUp(2)}}if(d.emoji&&he===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,d.highlightFormatting&&(x.formatting="emoji");var wi=G(x);return x.emoji=!1,wi}return he===" "&&(k.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),G(x)}function de(k,x){var ee=k.next();if(ee===">"){x.f=x.inline=ae,d.highlightFormatting&&(x.formatting="link");var xe=G(x);return xe?xe+=" ":xe="",xe+c.linkInline}return k.match(/^[^>]+/,!0),c.linkInline}function A(k,x){if(k.eatSpace())return null;var ee=k.next();return ee==="("||ee==="["?(x.f=x.inline=_(ee==="("?")":"]"),d.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,G(x)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(k){return function(x,ee){var xe=x.next();if(xe===k){ee.f=ee.inline=ae,d.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return x.match(U[k]),ee.linkHref=!0,G(ee)}}function V(k,x){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=ve,k.next(),d.highlightFormatting&&(x.formatting="link"),x.linkText=!0,G(x)):N(k,x,ae)}function ve(k,x){if(k.match("]:",!0)){x.f=x.inline=Te,d.highlightFormatting&&(x.formatting="link");var ee=G(x);return x.linkText=!1,ee}return k.match(/^([^\]\\]|\\.)+/,!0),c.linkText}function Te(k,x){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?x.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),x.f=x.inline=ae,c.linkHref+" url")}var vt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&a.copyState(l,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?a.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,x){if(x.formatting=!1,k!=x.thisLine.stream){if(x.header=0,x.hr=!1,k.match(/^\s*$/,!0))return W(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:k},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=K)){var ee=k.match(/^\s*/,!0)[0].replace(/\t/g,B).length;if(x.indentation=ee,x.indentationDiff=null,ee>0)return null}}return x.f(k,x)},innerMode:function(k){return k.block==K?{state:k.htmlState,mode:l}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:vt}},indent:function(k,x,ee){return k.block==K&&l.indent?l.indent(k.htmlState,x,ee):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,x,ee):a.Pass},blankLine:W,getType:G,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return vt},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})});var Yo=Ye((Ms,Bs)=>{(function(a){typeof Ms=="object"&&typeof Bs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.overlayMode=function(h,d,l){return{startState:function(){return{base:a.startState(h),overlay:a.startState(d),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(u){return{base:a.copyState(h,u.base),overlay:a.copyState(d,u.overlay),basePos:u.basePos,baseCur:null,overlayPos:u.overlayPos,overlayCur:null}},token:function(u,v){return(u!=v.streamSeen||Math.min(v.basePos,v.overlayPos){(function(a){typeof Ns=="object"&&typeof Is=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("placeholder","",function(g,y,w){var C=w&&w!=a.Init;if(y&&!C)g.on("blur",u),g.on("change",v),g.on("swapDoc",v),a.on(g.getInputField(),"compositionupdate",g.state.placeholderCompose=function(){l(g)}),v(g);else if(!y&&C){g.off("blur",u),g.off("change",v),g.off("swapDoc",v),a.off(g.getInputField(),"compositionupdate",g.state.placeholderCompose),h(g);var M=g.getWrapperElement();M.className=M.className.replace(" CodeMirror-empty","")}y&&!g.hasFocus()&&u(g)});function h(g){g.state.placeholder&&(g.state.placeholder.parentNode.removeChild(g.state.placeholder),g.state.placeholder=null)}function d(g){h(g);var y=g.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=g.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var w=g.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),y.appendChild(w),g.display.lineSpace.insertBefore(y,g.display.lineSpace.firstChild)}function l(g){setTimeout(function(){var y=!1;if(g.lineCount()==1){var w=g.getInputField();y=w.nodeName=="TEXTAREA"?!g.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}y?d(g):h(g)},20)}function u(g){c(g)&&d(g)}function v(g){var y=g.getWrapperElement(),w=c(g);y.className=y.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?d(g):h(g)}function c(g){return g.lineCount()===1&&g.getLine(0)===""}})});var Rs=Ye((Hs,zs)=>{(function(a){typeof Hs=="object"&&typeof zs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("autoRefresh",!1,function(l,u){l.state.autoRefresh&&(d(l,l.state.autoRefresh),l.state.autoRefresh=null),u&&l.display.wrapper.offsetHeight==0&&h(l,l.state.autoRefresh={delay:u.delay||250})});function h(l,u){function v(){l.display.wrapper.offsetHeight?(d(l,u),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):u.timeout=setTimeout(v,u.delay)}u.timeout=setTimeout(v,u.delay),u.hurry=function(){clearTimeout(u.timeout),u.timeout=setTimeout(v,50)},a.on(window,"mouseup",u.hurry),a.on(window,"keyup",u.hurry)}function d(l,u){clearTimeout(u.timeout),a.off(window,"mouseup",u.hurry),a.off(window,"keyup",u.hurry)}})});var _s=Ye((Ps,Ws)=>{(function(a){typeof Ps=="object"&&typeof Ws=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("styleSelectedText",!1,function(C,M,L){var T=L&&L!=a.Init;M&&!T?(C.state.markedSelection=[],C.state.markedSelectionStyle=typeof M=="string"?M:"CodeMirror-selectedtext",y(C),C.on("cursorActivity",h),C.on("change",d)):!M&&T&&(C.off("cursorActivity",h),C.off("change",d),g(C),C.state.markedSelection=C.state.markedSelectionStyle=null)});function h(C){C.state.markedSelection&&C.operation(function(){w(C)})}function d(C){C.state.markedSelection&&C.state.markedSelection.length&&C.operation(function(){g(C)})}var l=8,u=a.Pos,v=a.cmpPos;function c(C,M,L,T){if(v(M,L)!=0)for(var O=C.state.markedSelection,I=C.state.markedSelectionStyle,F=M.line;;){var B=F==M.line?M:u(F,0),N=F+l,R=N>=L.line,z=R?L:u(N,0),W=C.markText(B,z,{className:I});if(T==null?O.push(W):O.splice(T++,0,W),R)break;F=N}}function g(C){for(var M=C.state.markedSelection,L=0;L1)return y(C);var M=C.getCursor("start"),L=C.getCursor("end"),T=C.state.markedSelection;if(!T.length)return c(C,M,L);var O=T[0].find(),I=T[T.length-1].find();if(!O||!I||L.line-M.line<=l||v(M,I.to)>=0||v(L,O.from)<=0)return y(C);for(;v(M,O.from)>0;)T.shift().clear(),O=T[0].find();for(v(M,O.from)<0&&(O.to.line-M.line0&&(L.line-I.from.line{(function(a){typeof qs=="object"&&typeof Us=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h=a.Pos;function d(F){var B=F.flags;return B??(F.ignoreCase?"i":"")+(F.global?"g":"")+(F.multiline?"m":"")}function l(F,B){for(var N=d(F),R=N,z=0;zX);K++){var ge=F.getLine(W++);R=R==null?ge:R+` +`+ge}z=z*2,B.lastIndex=N.ch;var G=B.exec(R);if(G){var ue=R.slice(0,G.index).split(` +`),ae=G[0].split(` +`),de=N.line+ue.length-1,A=ue[ue.length-1].length;return{from:h(de,A),to:h(de+ae.length-1,ae.length==1?A+ae[0].length:ae[ae.length-1].length),match:G}}}}function g(F,B,N){for(var R,z=0;z<=F.length;){B.lastIndex=z;var W=B.exec(F);if(!W)break;var X=W.index+W[0].length;if(X>F.length-N)break;(!R||X>R.index+R[0].length)&&(R=W),z=W.index+1}return R}function y(F,B,N){B=l(B,"g");for(var R=N.line,z=N.ch,W=F.firstLine();R>=W;R--,z=-1){var X=F.getLine(R),K=g(X,B,z<0?0:X.length-z);if(K)return{from:h(R,K.index),to:h(R,K.index+K[0].length),match:K}}}function w(F,B,N){if(!u(B))return y(F,B,N);B=l(B,"gm");for(var R,z=1,W=F.getLine(N.line).length-N.ch,X=N.line,K=F.firstLine();X>=K;){for(var ge=0;ge=K;ge++){var G=F.getLine(X--);R=R==null?G:G+` +`+R}z*=2;var ue=g(R,B,W);if(ue){var ae=R.slice(0,ue.index).split(` +`),de=ue[0].split(` +`),A=X+ae.length,U=ae[ae.length-1].length;return{from:h(A,U),to:h(A+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var C,M;String.prototype.normalize?(C=function(F){return F.normalize("NFD").toLowerCase()},M=function(F){return F.normalize("NFD")}):(C=function(F){return F.toLowerCase()},M=function(F){return F});function L(F,B,N,R){if(F.length==B.length)return N;for(var z=0,W=N+Math.max(0,F.length-B.length);;){if(z==W)return z;var X=z+W>>1,K=R(F.slice(0,X)).length;if(K==N)return X;K>N?W=X:z=X+1}}function T(F,B,N,R){if(!B.length)return null;var z=R?C:M,W=z(B).split(/\r|\n\r?/);e:for(var X=N.line,K=N.ch,ge=F.lastLine()+1-W.length;X<=ge;X++,K=0){var G=F.getLine(X).slice(K),ue=z(G);if(W.length==1){var ae=ue.indexOf(W[0]);if(ae==-1)continue e;var N=L(G,ue,ae,z)+K;return{from:h(X,L(G,ue,ae,z)+K),to:h(X,L(G,ue,ae+W[0].length,z)+K)}}else{var de=ue.length-W[0].length;if(ue.slice(de)!=W[0])continue e;for(var A=1;A=ge;X--,K=-1){var G=F.getLine(X);K>-1&&(G=G.slice(0,K));var ue=z(G);if(W.length==1){var ae=ue.lastIndexOf(W[0]);if(ae==-1)continue e;return{from:h(X,L(G,ue,ae,z)),to:h(X,L(G,ue,ae+W[0].length,z))}}else{var de=W[W.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var A=1,N=X-W.length+1;A(this.doc.getLine(B.line)||"").length&&(B.ch=0,B.line++)),a.cmpPos(B,this.doc.clipPos(B))!=0))return this.atOccurrence=!1;var N=this.matches(F,B);if(this.afterEmptyMatch=N&&a.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var R=h(F?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:R,to:R},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(F,B){if(this.atOccurrence){var N=a.splitLines(F);this.doc.replaceRange(N,this.pos.from,this.pos.to,B),this.pos.to=h(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(F,B,N){return new I(this.doc,F,B,N)}),a.defineDocExtension("getSearchCursor",function(F,B,N){return new I(this,F,B,N)}),a.defineExtension("selectMatches",function(F,B){for(var N=[],R=this.getSearchCursor(F,this.getCursor("from"),B);R.findNext()&&!(a.cmpPos(R.to(),this.getCursor("to"))>0);)N.push({anchor:R.from(),head:R.to()});N.length&&this.setSelections(N,0)})})});var Xs=Ye((Gs,Ks)=>{(function(a){typeof Gs=="object"&&typeof Ks=="object"?a(ct(),Xo(),Yo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)})(function(a){"use strict";var h=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;a.defineMode("gfm",function(d,l){var u=0;function v(w){return w.code=!1,null}var c={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(w){return{code:w.code,codeBlock:w.codeBlock,ateSpace:w.ateSpace}},token:function(w,C){if(C.combineTokens=null,C.codeBlock)return w.match(/^```+/)?(C.codeBlock=!1,null):(w.skipToEnd(),null);if(w.sol()&&(C.code=!1),w.sol()&&w.match(/^```+/))return w.skipToEnd(),C.codeBlock=!0,null;if(w.peek()==="`"){w.next();var M=w.pos;w.eatWhile("`");var L=1+w.pos-M;return C.code?L===u&&(C.code=!1):(u=L,C.code=!0),null}else if(C.code)return w.next(),null;if(w.eatSpace())return C.ateSpace=!0,null;if((w.sol()||C.ateSpace)&&(C.ateSpace=!1,l.gitHubSpice!==!1)){if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return C.combineTokens=!0,"link";if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return C.combineTokens=!0,"link"}return w.match(h)&&w.string.slice(w.start-2,w.start)!="]("&&(w.start==0||/\W/.test(w.string.charAt(w.start-1)))?(C.combineTokens=!0,"link"):(w.next(),null)},blankLine:v},g={taskLists:!0,strikethrough:!0,emoji:!0};for(var y in l)g[y]=l[y];return g.name="markdown",a.overlayMode(a.getMode(d,g),c)},"markdown"),a.defineMIME("text/x-gfm","gfm")})});var Ys=Ye(()=>{});var Zs=Ye((_d,Qo)=>{var Zo;(function(){"use strict";Zo=function(a,h,d,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var u=this,v,c,g,y,w;a&&(u.dictionary=a,h&&d?T():(typeof window<"u"?(l.dictionaryPath?v=l.dictionaryPath:v="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?v=window.chrome.runtime.getURL(v):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(v=window.browser.runtime.getURL(v))):typeof __dirname<"u"?v=__dirname+"/dictionaries":v="./dictionaries",h||C(v+"/"+a+"/"+a+".aff",M),d||C(v+"/"+a+"/"+a+".dic",L)));function C(O,I){var F=u._readFile(O,null,l?.asyncLoad);l?.asyncLoad?F.then(function(B){I(B)}):I(F)}function M(O){h=O,d&&T()}function L(O){d=O,h&&T()}function T(){for(u.rules=u._parseAFF(h),u.compoundRuleCodes={},c=0,y=u.compoundRules.length;c0&&(W.continuationClasses=R),z!=="."&&(L==="SFX"?W.match=new RegExp(z+"$"):W.match=new RegExp("^"+z)),F!="0"&&(L==="SFX"?W.remove=new RegExp(F+"$"):W.remove=F),I.push(W)}h[T]={type:L,combineable:O==="Y",entries:I},c+=u}else if(L==="COMPOUNDRULE"){for(u=parseInt(M[1],10),g=c+1,w=c+1+u;g0&&(d.get(ue)===null&&d.set(ue,[]),d.get(ue).push(ae))}for(var u=1,v=h.length;u1){var C=this.parseRuleCodes(y[1]);(!("NEEDAFFIX"in this.flags)||C.indexOf(this.flags.NEEDAFFIX)===-1)&&l(w,C);for(var M=0,L=C.length;M"u"){if("COMPOUNDMIN"in this.flags&&a.length>=this.flags.COMPOUNDMIN){for(d=0,l=this.compoundRules.length;d"u"&&(d=Array.prototype.concat.apply([],this.dictionaryTable.get(a))),d&&d.indexOf(this.flags[h])!==-1))},alphabet:"",suggest:function(a,h){if(!this.loaded)throw"Dictionary not loaded.";if(h=h||5,this.memoized.hasOwnProperty(a)){var d=this.memoized[a].limit;if(h<=d||this.memoized[a].suggestions.length1&&K[1][1]!==K[1][0]&&(z=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!T||w.check(z))&&(z in O?O[z]+=1:O[z]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(F=0;Fde?1:ue[0].localeCompare(G[0])}z.sort(W).reverse();var X=[],K="lowercase";L.toUpperCase()===L?K="uppercase":L.substr(0,1).toUpperCase()+L.substr(1).toLowerCase()===L&&(K="capitalized");var ge=h;for(N=0;N{"use strict";var Qs=Zs();function Ee(a){if(a=a||{},typeof a.codeMirrorInstance!="function"||typeof a.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),a.codeMirrorInstance.defineMode("spell-checker",function(h){if(!Ee.aff_loading){Ee.aff_loading=!0;var d=new XMLHttpRequest;d.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),d.onload=function(){d.readyState===4&&d.status===200&&(Ee.aff_data=d.responseText,Ee.num_loaded++,Ee.num_loaded==2&&(Ee.typo=new Qs("en_US",Ee.aff_data,Ee.dic_data,{platform:"any"})))},d.send(null)}if(!Ee.dic_loading){Ee.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ee.dic_data=l.responseText,Ee.num_loaded++,Ee.num_loaded==2&&(Ee.typo=new Qs("en_US",Ee.aff_data,Ee.dic_data,{platform:"any"})))},l.send(null)}var u='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',v={token:function(g){var y=g.peek(),w="";if(u.includes(y))return g.next(),null;for(;(y=g.peek())!=null&&!u.includes(y);)w+=y,g.next();return Ee.typo&&!Ee.typo.check(w)?"spell-error":null}},c=a.codeMirrorInstance.getMode(h,h.backdrop||"text/plain");return a.codeMirrorInstance.overlayMode(c,v,!0)})}Ee.num_loaded=0;Ee.aff_loading=!1;Ee.dic_loading=!1;Ee.aff_data="";Ee.dic_data="";Ee.typo;Js.exports=Ee});var cu=Ye(Se=>{"use strict";function Vs(a,h){for(var d=0;da.length)&&(h=a.length);for(var d=0,l=new Array(h);d=a.length?{done:!0}:{done:!1,value:a[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kc(a,h){if(typeof a!="object"||a===null)return a;var d=a[Symbol.toPrimitive];if(d!==void 0){var l=d.call(a,h||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(a)}function Xc(a){var h=Kc(a,"string");return typeof h=="symbol"?h:String(h)}function Jo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Se.defaults=Jo();function Yc(a){Se.defaults=a}var lu=/[&<>"']/,Zc=new RegExp(lu.source,"g"),su=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Qc=new RegExp(su.source,"g"),Jc={"&":"&","<":"<",">":">",'"':""","'":"'"},tu=function(h){return Jc[h]};function et(a,h){if(h){if(lu.test(a))return a.replace(Zc,tu)}else if(su.test(a))return a.replace(Qc,tu);return a}var $c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function uu(a){return a.replace($c,function(h,d){return d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""})}var Vc=/(^|[^\[])\^/g;function we(a,h){a=typeof a=="string"?a:a.source,h=h||"";var d={replace:function(u,v){return v=v.source||v,v=v.replace(Vc,"$1"),a=a.replace(u,v),d},getRegex:function(){return new RegExp(a,h)}};return d}var ed=/[^\w:]/g,td=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ru(a,h,d){if(a){var l;try{l=decodeURIComponent(uu(d)).replace(ed,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}h&&!td.test(d)&&(d=od(h,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch{return null}return d}var an={},rd=/^[^:]+:\/*[^/]*$/,id=/^([^:]+:)[\s\S]*$/,nd=/^([^:]+:\/*[^/]*)[\s\S]*$/;function od(a,h){an[" "+a]||(rd.test(a)?an[" "+a]=a+"/":an[" "+a]=ln(a,"/",!0)),a=an[" "+a];var d=a.indexOf(":")===-1;return h.substring(0,2)==="//"?d?h:a.replace(id,"$1")+h:h.charAt(0)==="/"?d?h:a.replace(nd,"$1")+h:a+h}var sn={exec:function(){}};function iu(a,h){var d=a.replace(/\|/g,function(v,c,g){for(var y=!1,w=c;--w>=0&&g[w]==="\\";)y=!y;return y?"|":" |"}),l=d.split(/ \|/),u=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>h)l.splice(h);else for(;l.length1;)h&1&&(d+=a),h>>=1,a+=a;return d+a}function ou(a,h,d,l){var u=h.href,v=h.title?et(h.title):null,c=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){l.state.inLink=!0;var g={type:"link",raw:d,href:u,title:v,text:c,tokens:l.inlineTokens(c)};return l.state.inLink=!1,g}return{type:"image",raw:d,href:u,title:v,text:et(c)}}function sd(a,h){var d=a.match(/^(\s+)(?:```)/);if(d===null)return h;var l=d[1];return h.split(` +`).map(function(u){var v=u.match(/^\s+/);if(v===null)return u;var c=v[0];return c.length>=l.length?u.slice(l.length):u}).join(` +`)}var un=function(){function a(d){this.options=d||Se.defaults}var h=a.prototype;return h.space=function(l){var u=this.rules.block.newline.exec(l);if(u&&u[0].length>0)return{type:"space",raw:u[0]}},h.code=function(l){var u=this.rules.block.code.exec(l);if(u){var v=u[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:u[0],codeBlockStyle:"indented",text:this.options.pedantic?v:ln(v,` +`)}}},h.fences=function(l){var u=this.rules.block.fences.exec(l);if(u){var v=u[0],c=sd(v,u[3]||"");return{type:"code",raw:v,lang:u[2]?u[2].trim().replace(this.rules.inline._escapes,"$1"):u[2],text:c}}},h.heading=function(l){var u=this.rules.block.heading.exec(l);if(u){var v=u[2].trim();if(/#$/.test(v)){var c=ln(v,"#");(this.options.pedantic||!c||/ $/.test(c))&&(v=c.trim())}return{type:"heading",raw:u[0],depth:u[1].length,text:v,tokens:this.lexer.inline(v)}}},h.hr=function(l){var u=this.rules.block.hr.exec(l);if(u)return{type:"hr",raw:u[0]}},h.blockquote=function(l){var u=this.rules.block.blockquote.exec(l);if(u){var v=u[0].replace(/^ *>[ \t]?/gm,""),c=this.lexer.state.top;this.lexer.state.top=!0;var g=this.lexer.blockTokens(v);return this.lexer.state.top=c,{type:"blockquote",raw:u[0],tokens:g,text:v}}},h.list=function(l){var u=this.rules.block.list.exec(l);if(u){var v,c,g,y,w,C,M,L,T,O,I,F,B=u[1].trim(),N=B.length>1,R={type:"list",raw:"",ordered:N,start:N?+B.slice(0,-1):"",loose:!1,items:[]};B=N?"\\d{1,9}\\"+B.slice(-1):"\\"+B,this.options.pedantic&&(B=N?B:"[*+-]");for(var z=new RegExp("^( {0,3}"+B+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(F=!1,!(!(u=z.exec(l))||this.rules.block.hr.test(l)));){if(v=u[0],l=l.substring(v.length),L=u[2].split(` +`,1)[0].replace(/^\t+/,function(de){return" ".repeat(3*de.length)}),T=l.split(` +`,1)[0],this.options.pedantic?(y=2,I=L.trimLeft()):(y=u[2].search(/[^ ]/),y=y>4?1:y,I=L.slice(y),y+=u[1].length),C=!1,!L&&/^ *$/.test(T)&&(v+=T+` +`,l=l.substring(T.length+1),F=!0),!F)for(var W=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,y-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,y-1)+"}#");l&&(O=l.split(` +`,1)[0],T=O,this.options.pedantic&&(T=T.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(T)||ge.test(T)||W.test(T)||X.test(l)));){if(T.search(/[^ ]/)>=y||!T.trim())I+=` +`+T.slice(y);else{if(C||L.search(/[^ ]/)>=4||K.test(L)||ge.test(L)||X.test(L))break;I+=` +`+T}!C&&!T.trim()&&(C=!0),v+=O+` +`,l=l.substring(O.length+1),L=T.slice(y)}R.loose||(M?R.loose=!0:/\n *\n *$/.test(v)&&(M=!0)),this.options.gfm&&(c=/^\[[ xX]\] /.exec(I),c&&(g=c[0]!=="[ ] ",I=I.replace(/^\[[ xX]\] +/,""))),R.items.push({type:"list_item",raw:v,task:!!c,checked:g,loose:!1,text:I}),R.raw+=v}R.items[R.items.length-1].raw=v.trimRight(),R.items[R.items.length-1].text=I.trimRight(),R.raw=R.raw.trimRight();var G=R.items.length;for(w=0;w0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});R.loose=ae}if(R.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",g=u[3]?u[3].substring(1,u[3].length-1).replace(this.rules.inline._escapes,"$1"):u[3];return{type:"def",tag:v,raw:u[0],href:c,title:g}}},h.table=function(l){var u=this.rules.block.table.exec(l);if(u){var v={type:"table",header:iu(u[1]).map(function(M){return{text:M}}),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:u[3]&&u[3].trim()?u[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(v.header.length===v.align.length){v.raw=u[0];var c=v.align.length,g,y,w,C;for(g=0;g/i.test(u[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(u[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(u[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:u[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(u[0]):et(u[0]):u[0]}},h.link=function(l){var u=this.rules.inline.link.exec(l);if(u){var v=u[2].trim();if(!this.options.pedantic&&/^$/.test(v))return;var c=ln(v.slice(0,-1),"\\");if((v.length-c.length)%2===0)return}else{var g=ad(u[2],"()");if(g>-1){var y=u[0].indexOf("!")===0?5:4,w=y+u[1].length+g;u[2]=u[2].substring(0,g),u[0]=u[0].substring(0,w).trim(),u[3]=""}}var C=u[2],M="";if(this.options.pedantic){var L=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(C);L&&(C=L[1],M=L[3])}else M=u[3]?u[3].slice(1,-1):"";return C=C.trim(),/^$/.test(v)?C=C.slice(1):C=C.slice(1,-1)),ou(u,{href:C&&C.replace(this.rules.inline._escapes,"$1"),title:M&&M.replace(this.rules.inline._escapes,"$1")},u[0],this.lexer)}},h.reflink=function(l,u){var v;if((v=this.rules.inline.reflink.exec(l))||(v=this.rules.inline.nolink.exec(l))){var c=(v[2]||v[1]).replace(/\s+/g," ");if(c=u[c.toLowerCase()],!c){var g=v[0].charAt(0);return{type:"text",raw:g,text:g}}return ou(v,c,v[0],this.lexer)}},h.emStrong=function(l,u,v){v===void 0&&(v="");var c=this.rules.inline.emStrong.lDelim.exec(l);if(c&&!(c[3]&&v.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var g=c[1]||c[2]||"";if(!g||g&&(v===""||this.rules.inline.punctuation.exec(v))){var y=c[0].length-1,w,C,M=y,L=0,T=c[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(T.lastIndex=0,u=u.slice(-1*l.length+y);(c=T.exec(u))!=null;)if(w=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!!w){if(C=w.length,c[3]||c[4]){M+=C;continue}else if((c[5]||c[6])&&y%3&&!((y+C)%3)){L+=C;continue}if(M-=C,!(M>0)){C=Math.min(C,C+M+L);var O=l.slice(0,y+c.index+(c[0].length-w.length)+C);if(Math.min(y,C)%2){var I=O.slice(1,-1);return{type:"em",raw:O,text:I,tokens:this.lexer.inlineTokens(I)}}var F=O.slice(2,-2);return{type:"strong",raw:O,text:F,tokens:this.lexer.inlineTokens(F)}}}}}},h.codespan=function(l){var u=this.rules.inline.code.exec(l);if(u){var v=u[2].replace(/\n/g," "),c=/[^ ]/.test(v),g=/^ /.test(v)&&/ $/.test(v);return c&&g&&(v=v.substring(1,v.length-1)),v=et(v,!0),{type:"codespan",raw:u[0],text:v}}},h.br=function(l){var u=this.rules.inline.br.exec(l);if(u)return{type:"br",raw:u[0]}},h.del=function(l){var u=this.rules.inline.del.exec(l);if(u)return{type:"del",raw:u[0],text:u[2],tokens:this.lexer.inlineTokens(u[2])}},h.autolink=function(l,u){var v=this.rules.inline.autolink.exec(l);if(v){var c,g;return v[2]==="@"?(c=et(this.options.mangle?u(v[1]):v[1]),g="mailto:"+c):(c=et(v[1]),g=c),{type:"link",raw:v[0],text:c,href:g,tokens:[{type:"text",raw:c,text:c}]}}},h.url=function(l,u){var v;if(v=this.rules.inline.url.exec(l)){var c,g;if(v[2]==="@")c=et(this.options.mangle?u(v[0]):v[0]),g="mailto:"+c;else{var y;do y=v[0],v[0]=this.rules.inline._backpedal.exec(v[0])[0];while(y!==v[0]);c=et(v[0]),v[1]==="www."?g="http://"+v[0]:g=v[0]}return{type:"link",raw:v[0],text:c,href:g,tokens:[{type:"text",raw:c,text:c}]}}},h.inlineText=function(l,u){var v=this.rules.inline.text.exec(l);if(v){var c;return this.lexer.state.inRawBlock?c=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(v[0]):et(v[0]):v[0]:c=et(this.options.smartypants?u(v[0]):v[0]),{type:"text",raw:v[0],text:c}}},a}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:sn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=we(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=we(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=we(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/|$)/;se.html=we(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=we(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=we(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:we(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sn,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";te.punctuation=we(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=we(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=we(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=we(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=we(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;te.autolink=we(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=we(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=we(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=we(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=we(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=we(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:we(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),h+="&#"+l+";";return h}var zr=function(){function a(d){this.tokens=[],this.tokens.links=Object.create(null),this.options=d||Se.defaults,this.options.tokenizer=this.options.tokenizer||new un,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}a.lex=function(l,u){var v=new a(u);return v.lex(l)},a.lexInline=function(l,u){var v=new a(u);return v.inlineTokens(l)};var h=a.prototype;return h.lex=function(l){l=l.replace(/\r\n|\r/g,` +`),this.blockTokens(l,this.tokens);for(var u;u=this.inlineQueue.shift();)this.inlineTokens(u.src,u.tokens);return this.tokens},h.blockTokens=function(l,u){var v=this;u===void 0&&(u=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(M,L,T){return L+" ".repeat(T.length)});for(var c,g,y,w;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(M){return(c=M.call({lexer:v},l,u))?(l=l.substring(c.raw.length),u.push(c),!0):!1}))){if(c=this.tokenizer.space(l)){l=l.substring(c.raw.length),c.raw.length===1&&u.length>0?u[u.length-1].raw+=` +`:u.push(c);continue}if(c=this.tokenizer.code(l)){l=l.substring(c.raw.length),g=u[u.length-1],g&&(g.type==="paragraph"||g.type==="text")?(g.raw+=` +`+c.raw,g.text+=` +`+c.text,this.inlineQueue[this.inlineQueue.length-1].src=g.text):u.push(c);continue}if(c=this.tokenizer.fences(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.heading(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.hr(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.blockquote(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.list(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.html(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.def(l)){l=l.substring(c.raw.length),g=u[u.length-1],g&&(g.type==="paragraph"||g.type==="text")?(g.raw+=` +`+c.raw,g.text+=` +`+c.raw,this.inlineQueue[this.inlineQueue.length-1].src=g.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.lheading(l)){l=l.substring(c.raw.length),u.push(c);continue}if(y=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var M=1/0,L=l.slice(1),T=void 0;v.options.extensions.startBlock.forEach(function(O){T=O.call({lexer:this},L),typeof T=="number"&&T>=0&&(M=Math.min(M,T))}),M<1/0&&M>=0&&(y=l.substring(0,M+1))}(),this.state.top&&(c=this.tokenizer.paragraph(y))){g=u[u.length-1],w&&g.type==="paragraph"?(g.raw+=` +`+c.raw,g.text+=` +`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=g.text):u.push(c),w=y.length!==l.length,l=l.substring(c.raw.length);continue}if(c=this.tokenizer.text(l)){l=l.substring(c.raw.length),g=u[u.length-1],g&&g.type==="text"?(g.raw+=` +`+c.raw,g.text+=` +`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=g.text):u.push(c);continue}if(l){var C="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(C);break}else throw new Error(C)}}return this.state.top=!0,u},h.inline=function(l,u){return u===void 0&&(u=[]),this.inlineQueue.push({src:l,tokens:u}),u},h.inlineTokens=function(l,u){var v=this;u===void 0&&(u=[]);var c,g,y,w=l,C,M,L;if(this.tokens.links){var T=Object.keys(this.tokens.links);if(T.length>0)for(;(C=this.tokenizer.rules.inline.reflinkSearch.exec(w))!=null;)T.includes(C[0].slice(C[0].lastIndexOf("[")+1,-1))&&(w=w.slice(0,C.index)+"["+nu("a",C[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(C=this.tokenizer.rules.inline.blockSkip.exec(w))!=null;)w=w.slice(0,C.index)+"["+nu("a",C[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(C=this.tokenizer.rules.inline.escapedEmSt.exec(w))!=null;)w=w.slice(0,C.index+C[0].length-2)+"++"+w.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(M||(L=""),M=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(I){return(c=I.call({lexer:v},l,u))?(l=l.substring(c.raw.length),u.push(c),!0):!1}))){if(c=this.tokenizer.escape(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.tag(l)){l=l.substring(c.raw.length),g=u[u.length-1],g&&c.type==="text"&&g.type==="text"?(g.raw+=c.raw,g.text+=c.text):u.push(c);continue}if(c=this.tokenizer.link(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(c.raw.length),g=u[u.length-1],g&&c.type==="text"&&g.type==="text"?(g.raw+=c.raw,g.text+=c.text):u.push(c);continue}if(c=this.tokenizer.emStrong(l,w,L)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.codespan(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.br(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.del(l)){l=l.substring(c.raw.length),u.push(c);continue}if(c=this.tokenizer.autolink(l,au)){l=l.substring(c.raw.length),u.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(l,au))){l=l.substring(c.raw.length),u.push(c);continue}if(y=l,this.options.extensions&&this.options.extensions.startInline&&function(){var I=1/0,F=l.slice(1),B=void 0;v.options.extensions.startInline.forEach(function(N){B=N.call({lexer:this},F),typeof B=="number"&&B>=0&&(I=Math.min(I,B))}),I<1/0&&I>=0&&(y=l.substring(0,I+1))}(),c=this.tokenizer.inlineText(y,ud)){l=l.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(L=c.raw.slice(-1)),M=!0,g=u[u.length-1],g&&g.type==="text"?(g.raw+=c.raw,g.text+=c.text):u.push(c);continue}if(l){var O="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(O);break}else throw new Error(O)}}return u},jc(a,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),a}(),fn=function(){function a(d){this.options=d||Se.defaults}var h=a.prototype;return h.code=function(l,u,v){var c=(u||"").match(/\S*/)[0];if(this.options.highlight){var g=this.options.highlight(l,c);g!=null&&g!==l&&(v=!0,l=g)}return l=l.replace(/\n$/,"")+` +`,c?'
'+(v?l:et(l,!0))+`
+`:"
"+(v?l:et(l,!0))+`
+`},h.blockquote=function(l){return`
+`+l+`
+`},h.html=function(l){return l},h.heading=function(l,u,v,c){if(this.options.headerIds){var g=this.options.headerPrefix+c.slug(v);return"'+l+" +`}return""+l+" +`},h.hr=function(){return this.options.xhtml?`
+`:`
+`},h.list=function(l,u,v){var c=u?"ol":"ul",g=u&&v!==1?' start="'+v+'"':"";return"<"+c+g+`> +`+l+" +`},h.listitem=function(l){return"
  • "+l+`
  • +`},h.checkbox=function(l){return" "},h.paragraph=function(l){return"

    "+l+`

    +`},h.table=function(l,u){return u&&(u=""+u+""),` + +`+l+` +`+u+`
    +`},h.tablerow=function(l){return` +`+l+` +`},h.tablecell=function(l,u){var v=u.header?"th":"td",c=u.align?"<"+v+' align="'+u.align+'">':"<"+v+">";return c+l+(" +`)},h.strong=function(l){return""+l+""},h.em=function(l){return""+l+""},h.codespan=function(l){return""+l+""},h.br=function(){return this.options.xhtml?"
    ":"
    "},h.del=function(l){return""+l+""},h.link=function(l,u,v){if(l=ru(this.options.sanitize,this.options.baseUrl,l),l===null)return v;var c='",c},h.image=function(l,u,v){if(l=ru(this.options.sanitize,this.options.baseUrl,l),l===null)return v;var c=''+v+'":">",c},h.text=function(l){return l},a}(),$o=function(){function a(){}var h=a.prototype;return h.strong=function(l){return l},h.em=function(l){return l},h.codespan=function(l){return l},h.del=function(l){return l},h.html=function(l){return l},h.text=function(l){return l},h.link=function(l,u,v){return""+v},h.image=function(l,u,v){return""+v},h.br=function(){return""},a}(),Vo=function(){function a(){this.seen={}}var h=a.prototype;return h.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},h.getNextSafeSlug=function(l,u){var v=l,c=0;if(this.seen.hasOwnProperty(v)){c=this.seen[l];do c++,v=l+"-"+c;while(this.seen.hasOwnProperty(v))}return u||(this.seen[l]=c,this.seen[v]=0),v},h.slug=function(l,u){u===void 0&&(u={});var v=this.serialize(l);return this.getNextSafeSlug(v,u.dryrun)},a}(),Rr=function(){function a(d){this.options=d||Se.defaults,this.options.renderer=this.options.renderer||new fn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $o,this.slugger=new Vo}a.parse=function(l,u){var v=new a(u);return v.parse(l)},a.parseInline=function(l,u){var v=new a(u);return v.parseInline(l)};var h=a.prototype;return h.parse=function(l,u){u===void 0&&(u=!0);var v="",c,g,y,w,C,M,L,T,O,I,F,B,N,R,z,W,X,K,ge,G=l.length;for(c=0;c0&&z.tokens[0].type==="paragraph"?(z.tokens[0].text=K+" "+z.tokens[0].text,z.tokens[0].tokens&&z.tokens[0].tokens.length>0&&z.tokens[0].tokens[0].type==="text"&&(z.tokens[0].tokens[0].text=K+" "+z.tokens[0].tokens[0].text)):z.tokens.unshift({type:"text",text:K}):R+=K),R+=this.parse(z.tokens,N),O+=this.renderer.listitem(R,X,W);v+=this.renderer.list(O,F,B);continue}case"html":{v+=this.renderer.html(I.text);continue}case"paragraph":{v+=this.renderer.paragraph(this.parseInline(I.tokens));continue}case"text":{for(O=I.tokens?this.parseInline(I.tokens):I.text;c+1";if(h)return Promise.resolve(u);if(d){d(null,u);return}return u}if(h)return Promise.reject(l);if(d){d(l);return}throw l}}function fu(a,h){return function(d,l,u){typeof l=="function"&&(u=l,l=null);var v=gt({},l);l=gt({},le.defaults,v);var c=fd(l.silent,l.async,u);if(typeof d>"u"||d===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof d!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(d)+", string expected"));if(ld(l),l.hooks&&(l.hooks.options=l),u){var g=l.highlight,y;try{l.hooks&&(d=l.hooks.preprocess(d)),y=a(d,l)}catch(T){return c(T)}var w=function(O){var I;if(!O)try{l.walkTokens&&le.walkTokens(y,l.walkTokens),I=h(y,l),l.hooks&&(I=l.hooks.postprocess(I))}catch(F){O=F}return l.highlight=g,O?c(O):u(null,I)};if(!g||g.length<3||(delete l.highlight,!y.length))return w();var C=0;le.walkTokens(y,function(T){T.type==="code"&&(C++,setTimeout(function(){g(T.text,T.lang,function(O,I){if(O)return w(O);I!=null&&I!==T.text&&(T.text=I,T.escaped=!0),C--,C===0&&w()})},0))}),C===0&&w();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(d):d).then(function(T){return a(T,l)}).then(function(T){return l.walkTokens?Promise.all(le.walkTokens(T,l.walkTokens)).then(function(){return T}):T}).then(function(T){return h(T,l)}).then(function(T){return l.hooks?l.hooks.postprocess(T):T}).catch(c);try{l.hooks&&(d=l.hooks.preprocess(d));var M=a(d,l);l.walkTokens&&le.walkTokens(M,l.walkTokens);var L=h(M,l);return l.hooks&&(L=l.hooks.postprocess(L)),L}catch(T){return c(T)}}}function le(a,h,d){return fu(zr.lex,Rr.parse)(a,h,d)}le.options=le.setOptions=function(a){return le.defaults=gt({},le.defaults,a),Yc(le.defaults),le};le.getDefaults=Jo;le.defaults=Se.defaults;le.use=function(){for(var a=le.defaults.extensions||{renderers:{},childTokens:{}},h=arguments.length,d=new Array(h),l=0;l{"use strict";var Pr=ct();xs();bs();ws();Xo();Yo();Os();Rs();_s();js();Xs();Ko();var yd=$s(),ea=cu().marked,pu=/Mac/.test(navigator.platform),bd=new RegExp(/()+?/g),Di={toggleBold:hn,toggleItalic:pn,drawLink:Fn,toggleHeadingSmaller:Ci,toggleHeadingBigger:xn,drawImage:An,toggleBlockquote:mn,toggleOrderedList:wn,toggleUnorderedList:Cn,toggleCheckList:kn,toggleCodeBlock:vn,togglePreview:Bn,toggleStrikethrough:gn,toggleHeading1:yn,toggleHeading2:bn,toggleHeading3:Dn,toggleHeading4:ra,toggleHeading5:ia,toggleHeading6:na,cleanBlock:Sn,drawTable:En,drawHorizontalRule:Ln,undo:Tn,redo:Mn,toggleSideBySide:Wr,toggleFullScreen:dr},Dd={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Cd=function(a){for(var h in Di)if(Di[h]===a)return h;return null},ta=function(){var a=!1;return function(h){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(h)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(h.substr(0,4)))&&(a=!0)}(navigator.userAgent||navigator.vendor||window.opera),a};function wd(a){for(var h;(h=bd.exec(a))!==null;){var d=h[0];if(d.indexOf("target=")===-1){var l=d.replace(/>$/,' target="_blank">');a=a.replace(d,l)}}return a}function kd(a){for(var h=new DOMParser,d=h.parseFromString(a,"text/html"),l=d.getElementsByTagName("li"),u=0;u0){for(var T=document.createElement("i"),O=0;O=0&&(C=c.getLineHandle(L),!d(C));L--);var B=c.getTokenAt({line:L,ch:1}),N=l(B).fencedChars,R,z,W,X;d(c.getLineHandle(g.line))?(R="",z=g.line):d(c.getLineHandle(g.line-1))?(R="",z=g.line-1):(R=N+` +`,z=g.line),d(c.getLineHandle(y.line))?(W="",X=y.line,y.ch===0&&(X+=1)):y.ch!==0&&d(c.getLineHandle(y.line+1))?(W="",X=y.line+1):(W=N+` +`,X=y.line+1),y.ch===0&&(X-=1),c.operation(function(){c.replaceRange(W,{line:X,ch:0},{line:X+(W?0:1),ch:0}),c.replaceRange(R,{line:z,ch:0},{line:z+(R?0:1),ch:0})}),c.setSelection({line:z+(R?1:0),ch:0},{line:X+(R?1:-1),ch:0}),c.focus()}else{var K=g.line;if(d(c.getLineHandle(g.line))&&(u(c,g.line+1)==="fenced"?(L=g.line,K=g.line+1):(T=g.line,K=g.line-1)),L===void 0)for(L=K;L>=0&&(C=c.getLineHandle(L),!d(C));L--);if(T===void 0)for(O=c.lineCount(),T=K;T=0;L--)if(C=c.getLineHandle(L),!C.text.match(/^\s*$/)&&u(c,L,C)!=="indented"){L+=1;break}for(O=c.lineCount(),T=g.line;T\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},w=function(B,N){var R={quote:">","unordered-list":d,"ordered-list":"%%i.","check-list":"- [ ]"};return R[B].replace("%%i",N)},C=function(B,N){var R={quote:">","unordered-list":"\\"+d,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},z=new RegExp(R[B]);return N&&z.test(N)},M=function(B,N,R){var z=l.exec(N),W=w(B,L);return z!==null?(C(B,z[2])&&(W=""),N=z[1]+W+z[3]+N.replace(u,"").replace(y[B],"$1")):R==!1&&(N=W+" "+N),N},L=1,T=["unordered-list","ordered-list","check-list"],O=Object.keys(v)[0];if(!T.includes(O)){var I=a.getLine(c.line);/^\s*- \[[ xX]]\s/.test(I)?O="check-list":/^\s*\d+\.\s/.test(I)?O="ordered-list":/^\s*[*\-+]\s/.test(I)&&(O="unordered-list")}for(var F=c.line;F<=g.line;F++)(function(B){var N=a.getLine(B);v[h]?N=N.replace(y[h],"$1"):T.includes(O)&&T.includes(h)?(N=N.replace(y[O],"$1"),N=M(h,N,!1),L+=1):(N=M(h,N,!1),L+=1),a.replaceRange(N,{line:B,ch:0},{line:B,ch:99999999999999})})(F);a.focus()}}function xu(a,h,d,l){if(!(!a.codemirror||a.isPreviewActive())){var u=a.codemirror,v=Qt(u),c=v[h];if(!c){hr(u,c,d,l);return}var g=u.getCursor("start"),y=u.getCursor("end"),w=u.getLine(g.line),C=w.slice(0,g.ch),M=w.slice(g.ch);h=="link"?C=C.replace(/(.*)[^!]\[/,"$1"):h=="image"&&(C=C.replace(/(.*)!\[$/,"$1")),M=M.replace(/]\(.*?\)/,""),u.replaceRange(C+M,{line:g.line,ch:0},{line:g.line,ch:99999999999999}),g.ch-=d[0].length,g!==y&&(y.ch-=d[0].length),u.setSelection(g,y),u.focus()}}function aa(a,h,d,l){if(!(!a.codemirror||a.isPreviewActive())){l=typeof l>"u"?d:l;var u=a.codemirror,v=Qt(u),c,g=d,y=l,w=u.getCursor("start"),C=u.getCursor("end");v[h]?(c=u.getLine(w.line),g=c.slice(0,w.ch),y=c.slice(w.ch),h=="bold"?(g=g.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):h=="italic"?(g=g.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):h=="strikethrough"&&(g=g.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),u.replaceRange(g+y,{line:w.line,ch:0},{line:w.line,ch:99999999999999}),h=="bold"||h=="strikethrough"?(w.ch-=2,w!==C&&(C.ch-=2)):h=="italic"&&(w.ch-=1,w!==C&&(C.ch-=1))):(c=u.getSelection(),h=="bold"?(c=c.split("**").join(""),c=c.split("__").join("")):h=="italic"?(c=c.split("*").join(""),c=c.split("_").join("")):h=="strikethrough"&&(c=c.split("~~").join("")),u.replaceSelection(g+c+y),w.ch+=d.length,C.ch=w.ch+c.length),u.setSelection(w,C),u.focus()}}function Ed(a){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var h=a.getCursor("start"),d=a.getCursor("end"),l,u=h.line;u<=d.line;u++)l=a.getLine(u),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),a.replaceRange(l,{line:u,ch:0},{line:u,ch:99999999999999})}function dn(a,h){if(Math.abs(a)<1024)return""+a+h[0];var d=0;do a/=1024,++d;while(Math.abs(a)>=1024&&d=19968?l+=d[u].length:l+=1;return l}var ke={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},cr={bold:{name:"bold",action:hn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:pn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:gn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:Ci,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:Ci,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:yn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:bn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:Dn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:vn,className:ke.code,title:"Code"},quote:{name:"quote",action:mn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:Cn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:wn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:kn,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:Sn,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:Fn,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:An,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:oa,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:En,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Ln,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Bn,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Wr,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:dr,className:ke.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Tn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Mn,className:ke.redo,noDisable:!0,title:"Redo"}},Ld={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` + +| Column 1 | Column 2 | Column 3 | +| -------- | -------- | -------- | +| Text | Text | Text | + +`],horizontalRule:["",` + +----- + +`]},Td={link:"URL for the link:",image:"URL of the image:"},Md={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Bd={bold:"**",code:"```",italic:"*"},Nd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Id={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). +Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(a){a=a||{},a.parent=this;var h=!0;if(a.autoDownloadFontAwesome===!1&&(h=!1),a.autoDownloadFontAwesome!==!0)for(var d=document.styleSheets,l=0;l-1&&(h=!1);if(h){var u=document.createElement("link");u.rel="stylesheet",u.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(u)}if(a.element)this.element=a.element;else if(a.element===null){console.log("EasyMDE: Error. No element was found.");return}if(a.toolbar===void 0){a.toolbar=[];for(var v in cr)Object.prototype.hasOwnProperty.call(cr,v)&&(v.indexOf("separator-")!=-1&&a.toolbar.push("|"),(cr[v].default===!0||a.showIcons&&a.showIcons.constructor===Array&&a.showIcons.indexOf(v)!=-1)&&a.toolbar.push(v))}if(Object.prototype.hasOwnProperty.call(a,"previewClass")||(a.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(a,"status")||(a.status=["autosave","lines","words","cursor"],a.uploadImage&&a.status.unshift("upload-image")),a.previewRender||(a.previewRender=function(g){return this.parent.markdown(g)}),a.parsingConfig=Rt({highlightFormatting:!0},a.parsingConfig||{}),a.insertTexts=Rt({},Ld,a.insertTexts||{}),a.promptTexts=Rt({},Td,a.promptTexts||{}),a.blockStyles=Rt({},Bd,a.blockStyles||{}),a.autosave!=null&&(a.autosave.timeFormat=Rt({},Md,a.autosave.timeFormat||{})),a.iconClassMap=Rt({},ke,a.iconClassMap||{}),a.shortcuts=Rt({},Dd,a.shortcuts||{}),a.maxHeight=a.maxHeight||void 0,a.direction=a.direction||"ltr",typeof a.maxHeight<"u"?a.minHeight=a.maxHeight:a.minHeight=a.minHeight||"300px",a.errorCallback=a.errorCallback||function(g){alert(g)},a.uploadImage=a.uploadImage||!1,a.imageMaxSize=a.imageMaxSize||2097152,a.imageAccept=a.imageAccept||"image/png, image/jpeg, image/gif, image/avif",a.imageTexts=Rt({},Nd,a.imageTexts||{}),a.errorMessages=Rt({},Id,a.errorMessages||{}),a.imagePathAbsolute=a.imagePathAbsolute||!1,a.imageCSRFName=a.imageCSRFName||"csrfmiddlewaretoken",a.imageCSRFHeader=a.imageCSRFHeader||!1,a.imageInputName=a.imageInputName||"image",a.autosave!=null&&a.autosave.unique_id!=null&&a.autosave.unique_id!=""&&(a.autosave.uniqueId=a.autosave.unique_id),a.overlayMode&&a.overlayMode.combine===void 0&&(a.overlayMode.combine=!0),this.options=a,this.render(),a.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(a.initialValue),a.uploadImage){var c=this;this.codemirror.on("dragenter",function(g,y){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(g,y){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(g,y){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(g,y){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(g,y){y.stopPropagation(),y.preventDefault(),a.imageUploadFunction?c.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.dataTransfer.files):c.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(g,y){a.imageUploadFunction?c.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.clipboardData.files):c.uploadImages(y.clipboardData.files)})}}J.prototype.uploadImages=function(a,h,d){if(a.length!==0){for(var l=[],u=0;u=2){var R=N[1];if(h.imagesPreviewHandler){var z=h.imagesPreviewHandler(N[1]);typeof z=="string"&&(R=z)}if(window.EMDEimagesCache[R])T(B,window.EMDEimagesCache[R]);else{window.EMDEimagesCache[R]={};var W=document.createElement("img");W.onload=function(){window.EMDEimagesCache[R]={naturalWidth:W.naturalWidth,naturalHeight:W.naturalHeight,url:R},T(B,window.EMDEimagesCache[R])},W.src=R}}}})}this.codemirror.on("update",function(){O()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(h.autofocus===!0||a.autofocus)&&this.codemirror.focus();var I=this.codemirror;setTimeout(function(){I.refresh()}.bind(I),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function bu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(bu()){var a=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(a.element.form!=null&&a.element.form!=null&&a.element.form.addEventListener("submit",function(){clearTimeout(a.autosaveTimeoutId),a.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+a.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var h=a.value();h!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,h):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var d=document.getElementById("autosaved");if(d!=null&&d!=null&&d!=""){var l=new Date,u=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),v=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;d.innerHTML=v+u}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(bu()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.openBrowseFileWindow=function(a,h){var d=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function u(v){d.options.imageUploadFunction?d.uploadImagesUsingCustomFunction(d.options.imageUploadFunction,v.target.files):d.uploadImages(v.target.files,a,h),l.removeEventListener("change",u)}l.addEventListener("change",u)};J.prototype.uploadImage=function(a,h,d){var l=this;h=h||function(w){mu(l,w)};function u(y){l.updateStatusBar("upload-image",y),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),d&&typeof d=="function"&&d(y),l.options.errorCallback(y)}function v(y){var w=l.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",a.name).replace("#image_size#",dn(a.size,w)).replace("#image_max_size#",dn(l.options.imageMaxSize,w))}if(a.size>this.options.imageMaxSize){u(v(this.options.errorMessages.fileTooLarge));return}var c=new FormData;c.append("image",a),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&c.append(l.options.imageCSRFName,l.options.imageCSRFToken);var g=new XMLHttpRequest;g.upload.onprogress=function(y){if(y.lengthComputable){var w=""+Math.round(y.loaded*100/y.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",a.name).replace("#progress#",w))}},g.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&g.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),g.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),u(v(l.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?h((l.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in l.options.errorMessages?u(v(l.options.errorMessages[y.error])):y.error?u(v(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),u(v(l.options.errorMessages.importError)))},g.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),u(l.options.errorMessages.importError)},g.send(c)};J.prototype.uploadImageUsingCustomFunction=function(a,h){var d=this;function l(c){mu(d,c)}function u(c){var g=v(c);d.updateStatusBar("upload-image",g),setTimeout(function(){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit)},1e4),d.options.errorCallback(g)}function v(c){var g=d.options.imageTexts.sizeUnits.split(",");return c.replace("#image_name#",h.name).replace("#image_size#",dn(h.size,g)).replace("#image_max_size#",dn(d.options.imageMaxSize,g))}a.apply(this,[h,l,u])};J.prototype.setPreviewMaxHeight=function(){var a=this.codemirror,h=a.getWrapperElement(),d=h.nextSibling,l=parseInt(window.getComputedStyle(h).paddingTop),u=parseInt(window.getComputedStyle(h).borderTopWidth),v=parseInt(this.options.maxHeight),c=v+l*2+u*2,g=c.toString()+"px";d.style.height=g};J.prototype.createSideBySide=function(){var a=this.codemirror,h=a.getWrapperElement(),d=h.nextSibling;if(!d||!d.classList.contains("editor-preview-side")){if(d=document.createElement("div"),d.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l in sync with the editor so the + // form's custom required-field validator (which reads [name="data[content]"]) + // and the submitted payload both see the live value. + editor.codemirror.on('change', function () { editor.codemirror.save(); }); + + var form = textarea.closest('form'); + if (form) { + // Capture phase fires before the inline bubble-phase validator, so the + // textarea already holds the current value when validation reads it. + form.addEventListener('submit', function () { editor.codemirror.save(); }, true); + } + + return editor; +} + +/* ── Boot ────────────────────────────────────────────────── */ +function boot() { + // Exposed for later units (U6 draft restore) and the Playwright specs; + // null when this bundle loads on a page without the content field. + window.postFormEditor = initEditor(); +} + +if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', boot); +} else { + boot(); +} diff --git a/themes/intotheeast/package-lock.json b/themes/intotheeast/package-lock.json index 1caf532..75e1ef7 100644 --- a/themes/intotheeast/package-lock.json +++ b/themes/intotheeast/package-lock.json @@ -8,6 +8,7 @@ "@fontsource-variable/dm-sans": "latest", "@fontsource/dm-serif-display": "latest", "@mapbox/togeojson": "^0.16.2", + "easymde": "^2", "maplibre-gl": "^4", "photoswipe": "^5", "scrollama": "^3" @@ -523,6 +524,21 @@ "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", "license": "ISC" }, + "node_modules/@types/codemirror": { + "version": "5.60.17", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.17.tgz", + "integrity": "sha512-AZq2FIsUHVMlp7VSe2hTfl5w4pcUkoFkM3zVsRKsn1ca8CXRDYvnin04+HP2REkwsxemuHqvDofdlhUWNpbwfw==", + "license": "MIT", + "dependencies": { + "@types/tern": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "license": "MIT" + }, "node_modules/@types/geojson": { "version": "7946.0.16", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", @@ -555,6 +571,12 @@ "@types/pbf": "*" } }, + "node_modules/@types/marked": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.3.2.tgz", + "integrity": "sha512-a79Yc3TOk6dGdituy8hmTTJXjOkZ7zsFYV10L337ttq/rec8lRMDBpV7fL3uLx6TgbFCa5DU/h8FmIBQPSbU0w==", + "license": "MIT" + }, "node_modules/@types/pbf": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", @@ -570,6 +592,15 @@ "@types/geojson": "*" } }, + "node_modules/@types/tern": { + "version": "0.23.9", + "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz", + "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.13", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz", @@ -585,6 +616,21 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT" }, + "node_modules/codemirror": { + "version": "5.65.21", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.21.tgz", + "integrity": "sha512-6teYk0bA0nR3QP0ihGMoxuKzpl5W80FpnHpBJpgy66NK3cZv5b/d/HY8PnRvfSsCG1MTfr92u2WUl+wT0E40mQ==", + "license": "MIT" + }, + "node_modules/codemirror-spell-checker": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz", + "integrity": "sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ==", + "license": "MIT", + "dependencies": { + "typo-js": "*" + } + }, "node_modules/concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -606,6 +652,19 @@ "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", "license": "ISC" }, + "node_modules/easymde": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/easymde/-/easymde-2.21.0.tgz", + "integrity": "sha512-5uE7I/DEN8gvGRwxaqAv7h1PMEK2ykNXVX5zL0dK3nCYROGja3AMbdQz8eCEELnfvCfy7tRkTmLuvyJG8uSWjQ==", + "license": "MIT", + "dependencies": { + "@types/codemirror": "^5.60.10", + "@types/marked": "^4.0.7", + "codemirror": "^5.65.15", + "codemirror-spell-checker": "1.1.2", + "marked": "^4.1.0" + } + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -796,6 +855,18 @@ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -936,6 +1007,12 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "license": "MIT" }, + "node_modules/typo-js": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/typo-js/-/typo-js-1.3.2.tgz", + "integrity": "sha512-Z1YkJ7IIYNrFeOxAlHUercY4Q2I+PhYD/3VkWpJGy/Oqudy3bFpNcQxnv6Oa9fTSXCHPGz1eDoX1bZYm2Z891A==", + "license": "BSD-3-Clause" + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/themes/intotheeast/package.json b/themes/intotheeast/package.json index 7c91665..c0d1f08 100644 --- a/themes/intotheeast/package.json +++ b/themes/intotheeast/package.json @@ -1,12 +1,13 @@ { "private": true, "scripts": { - "build": "node scripts/gen-weather-icons.js && esbuild js/src/main.js --bundle --minify --format=iife --outfile=js/main.js --loader:.woff2=file --loader:.woff=file --asset-names=../fonts/[name] && esbuild js/src/map.js --bundle --minify --format=iife --outfile=js/map.js && mkdir -p css-compiled fonts && { mv js/main.css css-compiled/main.css 2>/dev/null || true; } && { mv js/map.css css-compiled/map.css 2>/dev/null || true; }" + "build": "node scripts/gen-weather-icons.js && esbuild js/src/main.js --bundle --minify --format=iife --outfile=js/main.js --loader:.woff2=file --loader:.woff=file --asset-names=../fonts/[name] && esbuild js/src/map.js --bundle --minify --format=iife --outfile=js/map.js && esbuild js/src/post-form.js --bundle --minify --format=esm --splitting --outdir=js/post && mkdir -p css-compiled fonts && { mv js/main.css css-compiled/main.css 2>/dev/null || true; } && { mv js/map.css css-compiled/map.css 2>/dev/null || true; } && { mv js/post/post-form.css css-compiled/post-form.css 2>/dev/null || true; }" }, "dependencies": { "@fontsource-variable/dm-sans": "latest", "@fontsource/dm-serif-display": "latest", "@mapbox/togeojson": "^0.16.2", + "easymde": "^2", "maplibre-gl": "^4", "photoswipe": "^5", "scrollama": "^3" diff --git a/themes/intotheeast/templates/partials/base.html.twig b/themes/intotheeast/templates/partials/base.html.twig index e7c92c9..f6fcc1f 100644 --- a/themes/intotheeast/templates/partials/base.html.twig +++ b/themes/intotheeast/templates/partials/base.html.twig @@ -10,6 +10,7 @@ {% do assets.addJs('theme://js/main.js', {group: 'bottom'}) %} {% do assets.addJs('theme://js/nav.js', {group: 'bottom'}) %} {% block map_assets %}{% endblock %} + {% block head_assets %}{% endblock %} {{ assets.css()|raw }} {{ assets.js()|raw }} diff --git a/themes/intotheeast/templates/post-form.html.twig b/themes/intotheeast/templates/post-form.html.twig index bd4e6ac..91fde01 100644 --- a/themes/intotheeast/templates/post-form.html.twig +++ b/themes/intotheeast/templates/post-form.html.twig @@ -1,5 +1,10 @@ {% extends 'default.html.twig' %} +{% block head_assets %} + {% do assets.addCss('theme://css-compiled/post-form.css') %} + +{% endblock %} + {% block content %}

    New Entry