You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/public/js/filament/forms/components/markdown-editor.js

52 lines
509 KiB
JavaScript

2 months ago
var ss=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Cd=(o,p)=>()=>(o&&(p=o(o=0)),p);var Ke=(o,p)=>()=>(p||o((p={exports:{}}).exports,p),p.exports);var Ed=(o,p,v,C)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Td(p))!Ld.call(o,b)&&b!==v&&ss(o,b,{get:()=>p[b],enumerable:!(C=Sd(p,b))||C.enumerable});return o};var zd=o=>Ed(ss({},"__esModule",{value:!0}),o);var We=Ke((Yo,Qo)=>{(function(o,p){typeof Yo=="object"&&typeof Qo<"u"?Qo.exports=p():typeof define=="function"&&define.amd?define(p):(o=o||self,o.CodeMirror=p())})(Yo,function(){"use strict";var o=navigator.userAgent,p=navigator.platform,v=/gecko\/\d/i.test(o),C=/MSIE \d/.test(o),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),S=/Edge\/(\d+)/.exec(o),s=C||b||S,h=s&&(C?document.documentMode||6:+(S||b)[1]),g=!S&&/WebKit\//.test(o),T=g&&/Qt\/\d+\.\d+/.test(o),x=!S&&/Chrome\/(\d+)/.exec(o),c=x&&+x[1],d=/Opera\//.test(o),w=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),z=/PhantomJS/.test(o),y=w&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),R=/Android/.test(o),M=y||R||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),H=y||/Mac/.test(p),Z=/\bCrOS\b/.test(o),ee=/win/i.test(p),re=d&&o.match(/Version\/(\d*\.\d*)/);re&&(re=Number(re[1])),re&&re>=15&&(d=!1,g=!0);var N=H&&(T||d&&(re==null||re<12.11)),F=v||s&&h>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return j(e).appendChild(t)}function _(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function K(e,t,n,r){var i=_(e,t,n,r);return i.setAttribute("role","presentation"),i}var X;document.createRange?X=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:X=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function I(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function le(e,t){var n=e.className;D(t).test(n)||(e.className+=(n?" ":"")+t)}function xe(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!D(n[r]).test(t)&&(t+=" "+n[r]);return t}var q=function(e){e.select()};y?q=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(q=function(e){try{e.select()}catch{}});function L(e){return e.display.wrapper.ownerDocument}function de(e){return ze(e.display.wrapper)}function ze(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function pe(e){return L(e).defaultView}function Ee(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ge(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Oe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,l=i||0;;){var u=e.indexOf(" ",a);if(u<0||u>=t)return l+(t-a);l+=u-a,l+=n-l%n,a=u+1}}var qe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ee(this.onTimeout,this)};qe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},qe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Se(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var je=50,Ze={toString:function(){return
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},hr=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},ti=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),$t=null;function to(e){if($t!=null)return $t;var t=V(e,_("span","x")),n=t.getBoundingClientRect(),r=X(t,0,1).getBoundingClientRect();return $t=Math.abs(n.left-r.left)>1}var Wr={},Kt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wr[e]=t}function Cr(e,t){Kt[e]=t}function Ur(e){if(typeof e=="string"&&Kt.hasOwnProperty(e))e=Kt[e];else if(e&&typeof e.name=="string"&&Kt.hasOwnProperty(e.name)){var t=Kt[e.name];typeof t=="string"&&(t={name:t}),e=oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ur("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ur("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $r(e,t){t=Ur(t);var n=Wr[t.name];if(!n)return $r(e,"text/plain");var r=n(e,t);if(gr.hasOwnProperty(t.name)){var i=gr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var gr={};function Kr(e,t){var n=gr.hasOwnProperty(e)?gr[e]:gr[e]={};ge(t,n)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _n(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Gr(e,t,n){return e.startState?e.startState(t,n):!0}var at=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};at.prototype.eol=function(){return this.pos>=this.string.length},at.prototype.sol=function(){return this.pos==this.lineStart},at.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},at.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},at.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},at.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},at.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},at.prototype.skipToEnd=function(){this.pos=this.string.length},at.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},at.prototype.backUp=function(e){this.pos-=e},at.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.indentation=function(){return Oe(this.string,null,this.tabSize)-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},at.prototype.current=function(){return this.string.slice(this.start,this.pos)},at.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},at.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},at.p
`?(ue=A.appendChild(_("span",J[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ue.setAttribute("cm-text",J[0]),e.col+=1):(ue=e.cm.options.specialCharPlaceholder(J[0]),ue.setAttribute("cm-text",J[0]),s&&h<9?A.appendChild(_("span",[ue])):A.appendChild(ue),e.col+=1);e.map.push(e.pos,e.pos+1,ue),e.pos++}}if(e.trailingSpace=u.charCodeAt(t.length-1)==32,n||r||i||m||a||l){var _e=n||"";r&&(_e+=r),i&&(_e+=i);var be=_("span",[A],_e,a);if(l)for(var Ce in l)l.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&be.setAttribute(Ce,l[Ce]);return e.content.appendChild(be)}e.content.appendChild(A)}}function Wc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function Uc(e,t){return function(n,r,i,a,l,u,f){i=i?i+" cm-force-border":"cm-force-border";for(var m=n.pos,A=m+r.length;;){for(var P=void 0,J=0;J<t.length&&(P=t[J],!(P.to>m&&P.from<=m));J++);if(P.to>=A)return e(n,r,i,a,l,u,f);e(n,r.slice(0,P.to-m),i,a,null,u,f),a=null,r=r.slice(P.to-m),m=P.to}}}function Ea(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function $c(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(a,a=n[l]),La(n[l+1],t.cm.options));return}for(var u=i.length,f=0,m=1,A="",P,J,Y=0,ie,ue,me,ve,_e;;){if(Y==f){ie=ue=me=J="",_e=null,ve=null,Y=1/0;for(var be=[],Ce=void 0,Ne=0;Ne<r.length;++Ne){var Ie=r[Ne],$e=Ie.marker;if($e.type=="bookmark"&&Ie.from==f&&$e.widgetNode)be.push($e);else if(Ie.from<=f&&(Ie.to==null||Ie.to>f||$e.collapsed&&Ie.to==f&&Ie.from==f)){if(Ie.to!=null&&Ie.to!=f&&Y>Ie.to&&(Y=Ie.to,ue=""),$e.className&&(ie+=" "+$e.className),$e.css&&(J=(J?J+";":"")+$e.css),$e.startStyle&&Ie.from==f&&(me+=" "+$e.startStyle),$e.endStyle&&Ie.to==Y&&(Ce||(Ce=[])).push($e.endStyle,Ie.to),$e.title&&((_e||(_e={})).title=$e.title),$e.attributes)for(var Ve in $e.attributes)(_e||(_e={}))[Ve]=$e.attributes[Ve];$e.collapsed&&(!ve||oo(ve.marker,$e)<0)&&(ve=Ie)}else Ie.from>f&&Y>Ie.from&&(Y=Ie.from)}if(Ce)for(var vt=0;vt<Ce.length;vt+=2)Ce[vt+1]==Y&&(ue+=" "+Ce[vt]);if(!ve||ve.from==f)for(var rt=0;rt<be.length;++rt)Ea(t,0,be[rt]);if(ve&&(ve.from||0)==f){if(Ea(t,(ve.to==null?u+1:ve.to)-f,ve.marker,ve.from==null),ve.to==null)return;ve.to==f&&(ve=!1)}}if(f>=u)break;for(var Ot=Math.min(u,Y);;){if(A){var At=f+A.length;if(!ve){var ut=At>Ot?A.slice(0,Ot-f):A;t.addToken(t,ut,P?P+ie:ie,me,f+ut.length==Y?ue:"",J,_e)}if(At>=Ot){A=A.slice(Ot-f),f=Ot;break}f=At,me=""}A=i.slice(a,a=n[m++]),P=La(n[m++],t.cm.options)}}}function za(e,t,n){this.line=t,this.rest=Nc(t),this.size=this.rest?k(ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=mr(e,t)}function si(e,t,n){for(var r=[],i,a=t;a<n;a=i){var l=new za(e.doc,Ae(e.doc,a),a);i=a+l.size,r.push(l)}return r}var Yr=null;function Kc(e){Yr?Yr.ops.push(e):e.ownsGroup=Yr={ops:[e],delayedCallbacks:[]}}function Gc(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Zc(e,t){var n=e.ownsGroup;if(n)try{Gc(n)}finally{Yr=null,t(n)}}var Tn=null;function ht(e,t){var n=nr(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Yr?i=Yr.delayedCallbacks:Tn?i=Tn:(i=Tn=[],setTimeout(Xc,0));for(var a=function(u){i.push(function(){return n[u].apply(null,r)})},l=0;l<n.length;++l)a(l)}}function Xc(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function Ma(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Qc(e,t):a=="gutter"?Da(e,t,n,r):a=="class"?uo(e,t):a=="widget"&&Vc(e,t,r)}t.changes=null}function Ln(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relat
top: `+Ce+"px; width: "+(Ne??f-be)+`px;
height: `+(Ie-Ce)+"px"))}function P(be,Ce,Ne){var Ie=Ae(i,be),$e=Ie.text.length,Ve,vt;function rt(ut,Dt){return fi(e,ne(be,ut),"div",Ie,Dt)}function Ot(ut,Dt,yt){var ft=Ga(e,Ie,null,ut),ct=Dt=="ltr"==(yt=="after")?"left":"right",lt=yt=="after"?ft.begin:ft.end-(/\s/.test(Ie.text.charAt(ft.end-1))?2:1);return rt(lt,ct)[ct]}var At=Pe(Ie,i.direction);return nt(At,Ce||0,Ne??$e,function(ut,Dt,yt,ft){var ct=yt=="ltr",lt=rt(ut,ct?"left":"right"),qt=rt(Dt-1,ct?"right":"left"),pn=Ce==null&&ut==0,Sr=Ne==null&&Dt==$e,St=ft==0,rr=!At||ft==At.length-1;if(qt.top-lt.top<=3){var bt=(m?pn:Sr)&&St,Zo=(m?Sr:pn)&&rr,cr=bt?u:(ct?lt:qt).left,Nr=Zo?f:(ct?qt:lt).right;A(cr,lt.top,Nr-cr,lt.bottom)}else{var Or,Lt,hn,Xo;ct?(Or=m&&pn&&St?u:lt.left,Lt=m?f:Ot(ut,yt,"before"),hn=m?u:Ot(Dt,yt,"after"),Xo=m&&Sr&&rr?f:qt.right):(Or=m?Ot(ut,yt,"before"):u,Lt=!m&&pn&&St?f:lt.right,hn=!m&&Sr&&rr?u:qt.left,Xo=m?Ot(Dt,yt,"after"):f),A(Or,lt.top,Lt-Or,lt.bottom),lt.bottom<qt.top&&A(u,lt.bottom,null,qt.top),A(hn,qt.top,Xo-hn,qt.bottom)}(!Ve||pi(lt,Ve)<0)&&(Ve=lt),pi(qt,Ve)<0&&(Ve=qt),(!vt||pi(lt,vt)<0)&&(vt=lt),pi(qt,vt)<0&&(vt=qt)}),{start:Ve,end:vt}}var J=t.from(),Y=t.to();if(J.line==Y.line)P(J.line,J.ch,Y.ch);else{var ie=Ae(i,J.line),ue=Ae(i,Y.line),me=Zt(ie)==Zt(ue),ve=P(J.line,J.ch,me?ie.text.length+1:null).end,_e=P(Y.line,me?0:null,Y.ch).start;me&&(ve.top<_e.top-2?(A(ve.right,ve.top,null,ve.bottom),A(u,_e.top,_e.left,_e.bottom)):A(ve.right,ve.top,_e.left-ve.right,ve.bottom)),ve.bottom<_e.top&&A(u,ve.bottom,null,_e.top)}n.appendChild(a)}function ko(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||en(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||So(e))}function wo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&en(e))},100)}function So(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,le(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e))}function en(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function hi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var u=t.view[l],f=e.options.lineWrapping,m=void 0,A=0;if(!u.hidden){if(i+=u.line.height,s&&h<8){var P=u.node.offsetTop+u.node.offsetHeight;m=P-n,n=P}else{var J=u.node.getBoundingClientRect();m=J.bottom-J.top,!f&&u.text.firstChild&&(A=u.text.firstChild.getBoundingClientRect().right-J.left-1)}var Y=u.line.height-m;if((Y>.005||Y<-.005)&&(i<r&&(a-=Y),jt(u.line,m),Va(u.line),u.rest))for(var ie=0;ie<u.rest.length;ie++)Va(u.rest[ie]);if(A>e.display.sizerWidth){var ue=Math.ceil(A/Jr(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function gi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-ui(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=O(t,r),l=O(t,i);if(n&&n.ensure){var u=n.ensure.from.line,f=n.ensure.to.line;u<a?(a=u,l=O(t,ar(Ae(t,u))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(a=O(t,ar(Ae(t,f))-e.wrapper.clientHeigh
top: `+(t.top-n.viewOffset-ui(e.display))+`px;
height: `+(t.bottom-t.top+er(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function pf(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?ne(t.line,t.ch+1,"before"):t,t=t.ch?ne(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var l=!1,u=Xt(e,t),f=!n||n==t?u:Xt(e,n);i={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-r,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+r};var m=To(e,i),A=e.doc.scrollTop,P=e.doc.scrollLeft;if(m.scrollTop!=null&&(An(e,m.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),m.scrollLeft!=null&&(Dr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-P)>1&&(l=!0)),!l)break}return i}function hf(e,t){var n=To(e,t);n.scrollTop!=null&&An(e,n.scrollTop),n.scrollLeft!=null&&Dr(e,n.scrollLeft)}function To(e,t){var n=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=fo(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var u=e.doc.height+co(n),f=t.top<r,m=t.bottom>u-r;if(t.top<i)l.scrollTop=f?0:t.top;else if(t.bottom>i+a){var A=Math.min(t.top,(m?u:t.bottom)-a);A!=i&&(l.scrollTop=A)}var P=e.options.fixedGutter?0:n.gutters.offsetWidth,J=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-P,Y=Er(e)-n.gutters.offsetWidth,ie=t.right-t.left>Y;return ie&&(t.right=t.left+Y),t.left<10?l.scrollLeft=0:t.left<J?l.scrollLeft=Math.max(0,t.left+P-(ie?0:10)):t.right>Y+J-3&&(l.scrollLeft=t.right+(ie?0:10)-Y),l}function Lo(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function tn(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mn(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gf(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$a(e,t.from),r=$a(e,t.to);Ja(e,n,r,t.margin)}}function Ja(e,t,n,r){var i=To(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mn(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(v||Eo(e,{top:t}),el(e,t,!0),v&&Eo(e),In(e,100))}function el(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ol(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+co(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?n:0,docHeight:r,scrollHeight:r+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Fe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Fe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.s
`},setDirection:mt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Af(this.cm))})}),Mt.prototype.eachLine=Mt.prototype.iter;var Nl=0;function Uf(e){var t=this;if(Ol(t),!(ot(t,e)||lr(t.display,e))){kt(e),s&&(Nl=+new Date);var n=Mr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,u=function(){++l==i&&gt(t,function(){n=Re(t.doc,n);var Y={from:n,to:n,text:t.doc.splitLines(a.filter(function(ie){return ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};an(t.doc,Y),_l(t.doc,yr(Re(t.doc,n),Re(t.doc,xr(Y))))})()},f=function(Y,ie){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,Y.type)==-1){u();return}var ue=new FileReader;ue.onerror=function(){return u()},ue.onload=function(){var me=ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(me)){u();return}a[ie]=me,u()},ue.readAsText(Y)},m=0;m<r.length;m++)f(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var P;if(t.state.draggingText&&!t.state.draggingText.copy&&(P=t.listSelections()),ki(t.doc,yr(n,n)),P)for(var J=0;J<P.length;++J)ln(t.doc,"",P[J].anchor,P[J].head,"drag");t.replaceSelection(A,"around","paste"),t.display.input.focus()}}catch{}}}}function $f(e,t){if(s&&(!e.state.draggingText||+new Date-Nl<100)){dr(t);return}if(!(ot(e,t)||lr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!w)){var n=_("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Kf(e,t){var n=Mr(e,t);if(n){var r=document.createDocumentFragment();_o(e,n,r),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),V(e.display.dragCursor,r)}}function Ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Pl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var jl=!1;function Gf(){jl||(Zf(),jl=!0)}function Zf(){var e;Fe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Pl(Xf)},100))}),Fe(window,"blur",function(){return Pl(en)})}function Xf(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var wr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wn=0;Wn<10;Wn++)wr[Wn+48]=wr[Wn+96]=String(Wn);for(var Ti=65;Ti<=90;Ti++)wr[Ti]=String.fromCharCode(Ti);for(var Un=1;Un<=12;Un++)wr[Un+111]=wr[Un+63235]="F"+Un;var ur={};ur.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ur.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine"
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Wl(e,t){var n=Ae(e.doc,t),r=Zt(n);return r!=n&&(t=k(r)),Ro(!0,e,r,t,1)}function Jf(e,t){var n=Ae(e.doc,t),r=Fc(n);return r!=n&&(t=k(r)),Ro(!0,e,n,t,-1)}function Ul(e,t){var n=Wl(e,t.line),r=Ae(e.doc,n.line),i=Pe(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=a&&t.ch;return ne(n.line,l?0:a,n.sticky)}return n}function Ci(e,t,n){if(typeof t=="string"&&(t=$n[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ze}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ed(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=un(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&un(t,e.options.extraKeys,n,e)||un(t,e.options.keyMap,n,e)}var td=new qe;function Kn(e,t,n,r){var i=e.state.keySeq;if(i){if(Rl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:td.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),$l(e,i+" "+t,n,r))return!0}return $l(e,t,n,r)}function $l(e,t,n,r){var i=ed(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ht(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(kt(n),ko(e)),!!i}function Kl(e,t){var n=Bl(t,!0);return n?t.shiftKey&&!e.state.keySeq?Kn(e,"Shift-"+n,t,function(r){return Ci(e,r,!0)})||Kn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ci(e,r)}):Kn(e,n,t,function(r){return Ci(e,r)}):!1}function rd(e,t,n){return Kn(e,"'"+n+"'",t,function(r){return Ci(e,r,!0)})}var Ho=null;function Gl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=B(de(t)),!ot(t,e))){s&&h<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Kl(t,e);d&&(Ho=r?n:null,!r&&n==88&&!ti&&(H?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),v&&!H&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&nd(t)}}function nd(e){var t=e.display.lineDiv;le(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Q(t,"CodeMirror-crosshair"),_t(document,"keyup",n),_t(document,"mouseover",n))}Fe(document,"keyup",n),Fe(document,"mouseover",n)}function Zl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ot(this,e)}function Xl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(lr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||H&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==Ho){Ho=null,kt(e);return}if(!(d&&(!e.which||e.which<10)&&Kl(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(rd(t,e,i)||t.display.input.onKeyPress(e))}}}var id=400,Bo=function(e,t,n){this.time=e,this.pos=t,this.button=n};Bo.prototype.compare=function(e,t,n){return this.time+id>e&&ye(t,this.pos)==0&&n==this.button};var Gn,Zn;function od(e,t){var n=+new Date;return Zn&&Zn.compare(n,e,t)?(Gn=Zn=null,"triple"):Gn&&Gn.compare(n,e,t)?(Zn=new Bo(n,e,t),Gn=null,"double"):(Gn=new Bo(n,e,t),Zn=null,"single")}function Yl(e){var t=this,n=t.display;if(!(ot(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,lr(n,e)){g||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Wo(t,e)){var r=Mr(t,e),i=Ut(e),a=r?od(r,i):"single";pe(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ad(t,i,r,a,e))&&(i==1?r?sd(t,r,a,e):yn(e)==n.scroller&&kt(e):i==2?(r&&_i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(F?t.display.input.onContextMenu(e):wo(t)))}}}function ad(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,Kn(e,Hl(a,i),i,function(l){if(typeof l=="string"&&(l=$n[l]),!l)return!1;var u=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u=l(e,n)!=Ze}finally{e.state.suppressEdits=!1}return u})}function ld(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==
`)==t){if(r.ranges.length%Qt.text.length==0){m=[];for(var A=0;A<Qt.text.length;A++)m.push(a.splitLines(Qt.text[A]))}}else f.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=Be(f,function(ve){return[ve]}));for(var P=e.curOp.updateInput,J=r.ranges.length-1;J>=0;J--){var Y=r.ranges[J],ie=Y.from(),ue=Y.to();Y.empty()&&(n&&n>0?ie=ne(ie.line,ie.ch-n):e.state.overwrite&&!u?ue=ne(ue.line,Math.min(Ae(a,ue.line).text.length,ue.ch+ce(f).length)):u&&Qt&&Qt.lineWise&&Qt.text.join(`
`)==f.join(`
`)&&(ie=ue=ne(ie.line,0)));var me={from:ie,to:ue,text:m?m[J%m.length]:f,origin:i||(u?"paste":e.state.cutIncoming>l?"cut":"+input")};an(e.doc,me),ht(e,"inputRead",e,me)}t&&!u&&ns(e,t),tn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=P),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Nt(t,function(){return $o(t,n,0,null,"paste")}),!0}function ns(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var u=0;u<a.electricChars.length;u++)if(t.indexOf(a.electricChars.charAt(u))>-1){l=Xn(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xn(e,i.head.line,"smart"));l&&ht(e,"electricInput",e,i.head.line)}}}function is(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:ne(i,0),head:ne(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Ko(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function os(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),t}function vd(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){pe(this).focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,l=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&&gt(this,t[r])(this,i,l),it(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Li(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tt(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,zt(this)}),removeOverlay:Tt(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(a,1),this.state.modeGen++,zt(this);return}}}),indentLine:Tt(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),ae(this.doc,r)&&Xn(this,r,i,a)}),indentSelection:Tt(function(r){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var u=i[l];if(u.empty())u.head.line>a&&(Xn(this,u.head.line,r,!0),a=u.head.line,l==this.doc.sel.primIndex&&tn(this));else{var f=u.from(),m=u.to(),A=Math.max(a,f.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var P=A;P<a;++P)Xn(this,P,r);var J=this.doc.sel.ranges;f.ch==0&&i.length==J.length&&J[l].from().ch>0&&Oo(this.doc,l,new Ye(f,J[l].to()),ke)}}}),getTokenAt:function(r,i){return ga(this,r,i)},getLineTokens:function(r,i){return ga(this,ne(r),i,!0)},getTokenTypeAt:function(r){r=Re(this.doc,r);var i=da(this,Ae(this.doc,r.line)),a=0,l=(i.length-1)/2,u=r.ch,f;if(u==0)f=i[2];else for(;;){var m=a+l>>1;if((m?i[m*2-1]:0)>=u)l=m;else if(i[m*2+1]<u)a=m+1;else{f=i[m*2+2];break}}var A=f?f.indexOf("overlay "):-1;return A<0?f:A==0?null:f.slice(0,A-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var l=n[i],u=this.getModeAt(r);if(typeof u[i]=="string")l[
`,me=Me(ue,Y)?"w":J&&ue==`
`?"n":!J||/\s/.test(ue)?null:"p";if(J&&!ie&&!me&&(me="s"),P&&P!=me){n<0&&(n=1,A(),t.sticky="after");break}if(me&&(P=me),n>0&&!A(!ie))break}var ve=wi(e,t,a,l,!0);return Xe(a,ve)&&(ve.hitSide=!0),ve}function as(e,t,n,r){var i=e.doc,a=t.left,l;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,pe(e).innerHeight||i(e).documentElement.clientHeight),f=Math.max(u-.5*Vr(e.display),3);l=(n>0?t.bottom:t.top)+n*f}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;m=mo(e,a,l),!!m.outside;){if(n<0?l<=0:l>=i.height){m.hitSide=!0;break}l+=n*5}return m}var Qe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new qe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Ko(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(u){for(var f=u.target;f;f=f.parentNode){if(f==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Fe(i,"paste",function(u){!a(u)||ot(r,u)||rs(u,r)||h<=11&&setTimeout(gt(r,function(){return t.updateFromDOM()}),20)}),Fe(i,"compositionstart",function(u){t.composing={data:u.data,done:!1}}),Fe(i,"compositionupdate",function(u){t.composing||(t.composing={data:u.data,done:!1})}),Fe(i,"compositionend",function(u){t.composing&&(u.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Fe(i,"touchstart",function(){return n.forceCompositionEnd()}),Fe(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(u){if(!(!a(u)||ot(r,u))){if(r.somethingSelected())zi({lineWise:!1,text:r.getSelections()}),u.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var f=is(r);zi({lineWise:!0,text:f.text}),u.type=="cut"&&r.operation(function(){r.setSelections(f.ranges,0,ke),r.replaceSelection("",null,"cut")})}else return;if(u.clipboardData){u.clipboardData.clearData();var m=Qt.text.join(`
`);if(u.clipboardData.setData("Text",m),u.clipboardData.getData("Text")==m){u.preventDefault();return}}var A=os(),P=A.firstChild;Ko(P),r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),P.value=Qt.text.join(`
`);var J=B(ze(i));q(P),setTimeout(function(){r.display.lineSpace.removeChild(A),J.focus(),J==i&&n.showPrimarySelection()},50)}}Fe(i,"copy",l),Fe(i,"cut",l)},Qe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qe.prototype.prepareSelection=function(){var e=Ya(this.cm,!1);return e.focus=B(ze(this.div))==this.div,e},Qe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Mi(t,e.anchorNode,e.anchorOffset),l=Mi(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&l&&!l.bad&&ye(Zr(a,l),r)==0&&ye(Et(a,l),i)==0)){var u=t.display.view,f=r.line>=t.display.viewFrom&&ls(t,r)||{node:u[0].measure.map[2],offset:0},m=i.line<t.display.viewTo&&ls(t,i);if(!m){var A=u[u.length-1].measure,P=A.maps?A.maps[A.maps.length-1]:A.map;m={node:P[P.length-1],offset:P[P.length-2]-P[P.length-3]}}if(!f||!m){e.removeAllRanges();return}var J=e.rangeCount&&e.getRangeAt(0),Y;try{Y=X(f.node,f.offset,m.offset,m.node)}catch{}Y&&(!v&&t.state.focused?(e.collapse(f.node,f.offset),Y.collapsed||(e.removeAllRanges(),e.addRange(Y))):(e.removeAllRanges(),e.addRange(Y)),J&&e.anchorNode==null?e.addRange(J):v&&this.startGracePeriod()),this.rememberSelection()}},Qe.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Qe.prototype.showMultipleSelections=function(e){V(this.cm.display.cursorDiv,e.cursors),V(this.cm.display.selectionDiv,e.selection)},Qe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return I(this.div,t)},Qe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||B(ze(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qe.prototype.blur=function(){this.div.blur()},Qe.prototype.getField=function(){return this.div},Qe.prototype.supportsTouch=function(){return!0},Qe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Nt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Qe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(R&&x&&this.cm.display.gutterSpecs.length&&bd(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Mi(t,e.anchorNode,e.anchorOffset),r=Mi(t,e.focusNode,e.focusOffset);n&&r&&Nt(t,function(){wt(t.doc,yr(n,r),ke),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Qe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=ne(r.line-1,Ae(e.doc,r.line-1).length)),i.ch==Ae(e.doc,i.line).
`),q(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Fe(i,"cut",a),Fe(i,"copy",a),Fe(e.scroller,"paste",function(l){if(!(lr(e,l)||ot(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var u=new Event("paste");u.clipboardData=l.clipboardData,i.dispatchEvent(u)}}),Fe(e.lineSpace,"selectstart",function(l){lr(e,l)||kt(l)}),Fe(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Fe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},st.prototype.createField=function(e){this.wrapper=os(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ko(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ya(e);if(e.options.moveInputWithCursor){var i=Xt(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,n=t.display;V(n.cursorDiv,e.cursors),V(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&q(this.textarea),s&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&h>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||B(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},st.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||hr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&h>=9&&this.hasSelection===i||H&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Nt(t,function(){$o(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&&gt(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px;
z-index: 1000; background: `+(s?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var P;g&&(P=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,P),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function J(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&J();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&J(),F){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Fe(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(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 n=B(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Fe,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Bt,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Bl,e.isModifierKey=Rl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Bn,e.TextMarker=kr,e.LineWidget=Hn,e.e_preventDefault=kt,e.e_stopPropagation=Hr,e.e_stop=dr,e.addClass=le,e.contains=I,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.18",tt})});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,C){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),baseP
`}else{var H=z[1],Z=z[5],ee=!(C.test(z[2])||z[2].indexOf(">")>=0),re=ee?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");h[g]=`
`+H+re+Z,ee&&b(S,T)}}S.replaceSelections(h)};function b(S,s){var h=s.line,g=0,T=0,x=p.exec(S.getLine(h)),c=x[1];do{g+=1;var d=h+g,w=S.getLine(d),E=p.exec(w);if(E){var z=E[1],y=parseInt(x[3],10)+g-T,R=parseInt(E[3],10),M=R;if(c===z&&!isNaN(R))y===R&&(M=R+1),y>R&&(M=y+1),S.replaceRange(w.replace(p,z+M+E[4]+E[5]),{line:d,ch:0},{line:d,ch:w.length});else{if(c.length>z.length||c.length<z.length&&g===1)return;T+=1}}}while(E)}})});var ms=Ke((hs,gs)=>{(function(o){typeof hs=="object"&&typeof gs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,g,T){var x=T&&T!=o.Init;if(g&&!x)h.on("blur",b),h.on("change",S),h.on("swapDoc",S),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){C(h)}),S(h);else if(!g&&x){h.off("blur",b),h.off("change",S),h.off("swapDoc",S),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),p(h);var c=h.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}g&&!h.hasFocus()&&b(h)});function p(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function v(h){p(h);var g=h.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=h.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var T=h.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),g.appendChild(T),h.display.lineSpace.insertBefore(g,h.display.lineSpace.firstChild)}function C(h){setTimeout(function(){var g=!1;if(h.lineCount()==1){var T=h.getInputField();g=T.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)}g?v(h):p(h)},20)}function b(h){s(h)&&v(h)}function S(h){var g=h.getWrapperElement(),T=s(h);g.className=g.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?v(h):p(h)}function s(h){return h.lineCount()===1&&h.getLine(0)===""}})});var ys=Ke((vs,bs)=>{(function(o){typeof vs=="object"&&typeof bs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(x,c,d){var w=d&&d!=o.Init;c&&!w?(x.state.markedSelection=[],x.state.markedSelectionStyle=typeof c=="string"?c:"CodeMirror-selectedtext",g(x),x.on("cursorActivity",p),x.on("change",v)):!c&&w&&(x.off("cursorActivity",p),x.off("change",v),h(x),x.state.markedSelection=x.state.markedSelectionStyle=null)});function p(x){x.state.markedSelection&&x.operation(function(){T(x)})}function v(x){x.state.markedSelection&&x.state.markedSelection.length&&x.operation(function(){h(x)})}var C=8,b=o.Pos,S=o.cmpPos;function s(x,c,d,w){if(S(c,d)!=0)for(var E=x.state.markedSelection,z=x.state.markedSelectionStyle,y=c.line;;){var R=y==c.line?c:b(y,0),M=y+C,H=M>=d.line,Z=H?d:b(M,0),ee=x.markText(R,Z,{className:z});if(w==null?E.push(ee):E.splice(w++,0,ee),H)break;y=M}}function h(x){for(var c=x.state.markedSelection,d=0;d<c.length;++d)c[d].clear();c.length=0}function g(x){h(x);for(var c=x.listSelections(),d=0;d<c.length;d++)s(x,c[d].from(),c[d].to())}function T(x){if(!x.somethingSelected())return h(x);if(x.listSelections().length>1)return g(x);var c=x.getCursor("start"),d=x.getCursor("end"),w=x.state.markedSelection;if(!w.length)return s(x,c,d);var E=w[0].find(),z=w[w.length-1].find();if(!E||!z||d.line-c.line<=C||S(c,z.to)>=0||S(d,E.from)<=0)return g(x);for(;S(c,E.from)>0;)w.shift().clear(),E=w[0].find();for(S(c,E.from)<0&&(E.to.line-c.line<C?(w.shift().clear(),s(x,c,E.to,0)):s(x,c,E.from,0));S(d,z.to)<0;)w.pop().clear(),z=w[w.length-1].find();S(d,z.to)>0&&(d.line-z.from.line<C?(w.pop().clear(),s(x,z.from,d)):s(x,z.to,d))}})});var ks=Ke((xs,_s)=>{(function(o){typeof xs=="object"&&typeof _s=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=o.Pos;function v(y){var R=y.flags;return R??(y.ignoreCase?"i":"")+(y.glo
`+F}Z=Z*2,R.lastIndex=M.ch;var D=R.exec(H);if(D){var Q=H.slice(0,D.index).split(`
`),j=D[0].split(`
`),V=M.line+Q.length-1,_=Q[Q.length-1].length;return{from:p(V,_),to:p(V+j.length-1,j.length==1?_+j[0].length:j[j.length-1].length),match:D}}}}function h(y,R,M){for(var H,Z=0;Z<=y.length;){R.lastIndex=Z;var ee=R.exec(y);if(!ee)break;var re=ee.index+ee[0].length;if(re>y.length-M)break;(!H||re>H.index+H[0].length)&&(H=ee),Z=ee.index+1}return H}function g(y,R,M){R=C(R,"g");for(var H=M.line,Z=M.ch,ee=y.firstLine();H>=ee;H--,Z=-1){var re=y.getLine(H),N=h(re,R,Z<0?0:re.length-Z);if(N)return{from:p(H,N.index),to:p(H,N.index+N[0].length),match:N}}}function T(y,R,M){if(!b(R))return g(y,R,M);R=C(R,"gm");for(var H,Z=1,ee=y.getLine(M.line).length-M.ch,re=M.line,N=y.firstLine();re>=N;){for(var F=0;F<Z&&re>=N;F++){var D=y.getLine(re--);H=H==null?D:D+`
`+H}Z*=2;var Q=h(H,R,ee);if(Q){var j=H.slice(0,Q.index).split(`
`),V=Q[0].split(`
`),_=re+j.length,K=j[j.length-1].length;return{from:p(_,K),to:p(_+V.length-1,V.length==1?K+V[0].length:V[V.length-1].length),match:Q}}}}var x,c;String.prototype.normalize?(x=function(y){return y.normalize("NFD").toLowerCase()},c=function(y){return y.normalize("NFD")}):(x=function(y){return y.toLowerCase()},c=function(y){return y});function d(y,R,M,H){if(y.length==R.length)return M;for(var Z=0,ee=M+Math.max(0,y.length-R.length);;){if(Z==ee)return Z;var re=Z+ee>>1,N=H(y.slice(0,re)).length;if(N==M)return re;N>M?ee=re:Z=re+1}}function w(y,R,M,H){if(!R.length)return null;var Z=H?x:c,ee=Z(R).split(/\r|\n\r?/);e:for(var re=M.line,N=M.ch,F=y.lastLine()+1-ee.length;re<=F;re++,N=0){var D=y.getLine(re).slice(N),Q=Z(D);if(ee.length==1){var j=Q.indexOf(ee[0]);if(j==-1)continue e;var M=d(D,Q,j,Z)+N;return{from:p(re,d(D,Q,j,Z)+N),to:p(re,d(D,Q,j+ee[0].length,Z)+N)}}else{var V=Q.length-ee[0].length;if(Q.slice(V)!=ee[0])continue e;for(var _=1;_<ee.length-1;_++)if(Z(y.getLine(re+_))!=ee[_])continue e;var K=y.getLine(re+ee.length-1),X=Z(K),I=ee[ee.length-1];if(X.slice(0,I.length)!=I)continue e;return{from:p(re,d(D,Q,V,Z)+N),to:p(re+ee.length-1,d(K,X,I.length,Z))}}}}function E(y,R,M,H){if(!R.length)return null;var Z=H?x:c,ee=Z(R).split(/\r|\n\r?/);e:for(var re=M.line,N=M.ch,F=y.firstLine()-1+ee.length;re>=F;re--,N=-1){var D=y.getLine(re);N>-1&&(D=D.slice(0,N));var Q=Z(D);if(ee.length==1){var j=Q.lastIndexOf(ee[0]);if(j==-1)continue e;return{from:p(re,d(D,Q,j,Z)),to:p(re,d(D,Q,j+ee[0].length,Z))}}else{var V=ee[ee.length-1];if(Q.slice(0,V.length)!=V)continue e;for(var _=1,M=re-ee.length+1;_<ee.length-1;_++)if(Z(y.getLine(M+_))!=ee[_])continue e;var K=y.getLine(re+1-ee.length),X=Z(K);if(X.slice(X.length-ee[0].length)!=ee[0])continue e;return{from:p(re+1-ee.length,d(K,X,K.length-ee[0].length,Z)),to:p(re,d(D,Q,V.length,Z))}}}}function z(y,R,M,H){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=y,M=M?y.clipPos(M):p(0,0),this.pos={from:M,to:M};var Z;typeof H=="object"?Z=H.caseFold:(Z=H,H=null),typeof R=="string"?(Z==null&&(Z=!1),this.matches=function(ee,re){return(ee?E:w)(y,R,re,Z)}):(R=C(R,"gm"),!H||H.multiline!==!1?this.matches=function(ee,re){return(ee?T:s)(y,R,re)}:this.matches=function(ee,re){return(ee?g:S)(y,R,re)})}z.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(y){var R=this.doc.clipPos(y?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(R=p(R.line,R.ch),y?(R.ch--,R.ch<0&&(R.line--,R.ch=(this.doc.getLine(R.line)||"").length)):(R.ch++,R.ch>(this.doc.getLine(R.line)||"").length&&(R.ch=0,R.line++)),o.cmpPos(R,this.doc.clipPos(R))!=0))return this.atOccurrence=!1;var M=this.matches(y,R);if(this.afterEmptyMatch=M&&o.cmpPos(M.from,M.to)==0,M)return this.pos=M,this.atOccurrence=!0,this.pos.match||!0;var H=p(y?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:H,to:H},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(y,R){if(this.atOccurrence){var M=o.splitLines(y);this.doc.replaceRange(M,this.pos.from,this.pos.to,R),this.pos.to=p(this.pos.from.line+M.length-1,M[M.length-1].length+(M.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(y,R,M){return new z(this.doc,y,R,M)}),o.defineDocExtension("getSearchCursor",function(y,R,M){return new z(this,y,R,M)}),o.defineExtension("selectMatches",function(y,R){for(var M=[],H=this.getSearchCursor(y,this.getCursor("from"),R);H.findNext()&&!(o.cmpPos(H.to(),this.getCursor("to"))>0);)M.push({anchor:H.from(),head:H.to()});M.length&&this.setSelections(M,0)})})});var Vo=Ke((ws,Ss)=>{(function(o){typeof ws=="object"&&typeof Ss=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(I,B,le,xe,q,L){this.indented=I,this.column=B,this.type=le,this.info=xe,this.align=q,this.prev=L}function v(I,B,le,xe){var q=I.indented;return I.context&&I.context.type=="statement"&&le!="statement"&&(q=I.context.ind
`&&(b.innerActive=b.inner=null);else for(var s=0;s<v.length;++s){var h=v[s];h.open===`
`&&(b.innerActive=h,b.inner=o.startState(h.mode,S.indent?S.indent(b.outer,"",""):0))}},electricChars:p.electricChars,innerMode:function(b){return b.inner?{state:b.inner,mode:b.innerActive.mode}:{state:b.outer,mode:p}}}}})});var lc=Ke((oc,ac)=>{(function(o){typeof oc=="object"&&typeof ac=="object"?o(We(),Di(),ic()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple","../../addon/mode/multiplex"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode("handlebars-tags",{start:[{regex:/\{\{\{/,push:"handlebars_raw",token:"tag"},{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars_raw:[{regex:/\}\}\}/,pop:!0,token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),o.defineMode("handlebars",function(p,v){var C=o.getMode(p,"handlebars-tags");return!v||!v.base?C:o.multiplexingMode(o.getMode(p,v.base),{open:"{{",close:/\}\}\}?/,mode:C,parseDelimiters:!0})}),o.defineMIME("text/x-handlebars-template","handlebars")})});var cc=Ke((sc,uc)=>{(function(o){"use strict";typeof sc=="object"&&typeof uc=="object"?o(We(),Yn(),mn(),vn(),Vu(),gn(),ea(),ta(),tc(),lc()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/overlay","../xml/xml","../javascript/javascript","../coffeescript/coffeescript","../css/css","../sass/sass","../stylus/stylus","../pug/pug","../handlebars/handlebars"],o):o(CodeMirror)})(function(o){var p={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};o.defineMode("vue-template",function(v,C){var b={token:function(S){if(S.match(/^\{\{.*?\}\}/))return"meta mustache";for(;S.next()&&!S.match("{{",!1););return null}};return o.overlayMode(o.getMode(v,C.backdrop||"text/html"),b)}),o.defineMode("vue",function(v){return o.getMode(v,{name:"htmlmixed",tags:p})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),o.defineMIME("script/x-vue","vue"),o.defineMIME("text/x-vue","vue")})});var pc=Ke((fc,dc)=>{(function(o){typeof fc=="object"&&typeof dc=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("yaml",function(){var p=["true","false","on","off","yes","no"],v=new RegExp("\\b(("+p.join(")|(")+"))$","i");return{token:function(C,b){var S=C.peek(),s=b.escaped;if(b.escaped=!1,S=="#"&&(C.pos==0||/\s/.test(C.string.charAt(C.pos-1))))return C.skipToEnd(),"comment";if(C.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(b.literal&&C.indentation()>b.keyCol)return C.skipToEnd(),"string";if(b.literal&&(b.literal=!1),C.sol()){if(b.keyCol=0,b.pair=!1,b.pairStart=!1,C.match("---")||C.match("..."))return"def";if(C.match(/\s*-\s+/))return"meta"}if(C.match(/^(\{|\}|\[|\])/))return S=="{"?b.inlinePairs
`,de=`
`+B;q&&xe++,q&&I.ch===0&&(de=B+`
`,xe--),Rr(K,!1,[L,de]),K.setSelection({line:le,ch:0},{line:xe,ch:0})}var s=o.codemirror,h=s.getCursor("start"),g=s.getCursor("end"),T=s.getTokenAt({line:h.line,ch:h.ch||1}),x=s.getLineHandle(h.line),c=b(s,h.line,x,T),d,w,E;if(c==="single"){var z=x.text.slice(0,h.ch).replace("`",""),y=x.text.slice(h.ch).replace("`","");s.replaceRange(z+y,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==g&&g.ch--,s.setSelection(h,g),s.focus()}else if(c==="fenced")if(h.line!==g.line||h.ch!==g.ch){for(d=h.line;d>=0&&(x=s.getLineHandle(d),!v(x));d--);var R=s.getTokenAt({line:d,ch:1}),M=C(R).fencedChars,H,Z,ee,re;v(s.getLineHandle(h.line))?(H="",Z=h.line):v(s.getLineHandle(h.line-1))?(H="",Z=h.line-1):(H=M+`
`,Z=h.line),v(s.getLineHandle(g.line))?(ee="",re=g.line,g.ch===0&&(re+=1)):g.ch!==0&&v(s.getLineHandle(g.line+1))?(ee="",re=g.line+1):(ee=M+`
`,re=g.line+1),g.ch===0&&(re-=1),s.operation(function(){s.replaceRange(ee,{line:re,ch:0},{line:re+(ee?0:1),ch:0}),s.replaceRange(H,{line:Z,ch:0},{line:Z+(H?0:1),ch:0})}),s.setSelection({line:Z+(H?1:0),ch:0},{line:re+(H?1:-1),ch:0}),s.focus()}else{var N=h.line;if(v(s.getLineHandle(h.line))&&(b(s,h.line+1)==="fenced"?(d=h.line,N=h.line+1):(w=h.line,N=h.line-1)),d===void 0)for(d=N;d>=0&&(x=s.getLineHandle(d),!v(x));d--);if(w===void 0)for(E=s.lineCount(),w=N;w<E&&(x=s.getLineHandle(w),!v(x));w++);s.operation(function(){s.replaceRange("",{line:d,ch:0},{line:d+1,ch:0}),s.replaceRange("",{line:w-1,ch:0},{line:w,ch:0})}),s.focus()}else if(c==="indented"){if(h.line!==g.line||h.ch!==g.ch)d=h.line,w=g.line,g.ch===0&&w--;else{for(d=h.line;d>=0;d--)if(x=s.getLineHandle(d),!x.text.match(/^\s*$/)&&b(s,d,x)!=="indented"){d+=1;break}for(E=s.lineCount(),w=h.line;w<E;w++)if(x=s.getLineHandle(w),!x.text.match(/^\s*$/)&&b(s,w,x)!=="indented"){w-=1;break}}var F=s.getLineHandle(w+1),D=F&&s.getTokenAt({line:w+1,ch:F.text.length-1}),Q=D&&C(D).indentedCode;Q&&s.replaceRange(`
`,{line:w+1,ch:0});for(var j=d;j<=w;j++)s.indentLine(j,"subtract");s.focus()}else{var V=h.line===g.line&&h.ch===g.ch&&h.ch===0,_=h.line!==g.line;V||_?S(s,h,g,p):Rr(s,!1,["`","`"])}}function ji(o){la(o.codemirror,"quote")}function Jn(o){Lr(o.codemirror,"smaller")}function Ri(o){Lr(o.codemirror,"bigger")}function Hi(o){Lr(o.codemirror,void 0,1)}function Bi(o){Lr(o.codemirror,void 0,2)}function Wi(o){Lr(o.codemirror,void 0,3)}function na(o){Lr(o.codemirror,void 0,4)}function ia(o){Lr(o.codemirror,void 0,5)}function oa(o){Lr(o.codemirror,void 0,6)}function Ui(o){var p=o.codemirror,v="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(v=o.options.unorderedListStyle),la(p,"unordered-list",v)}function $i(o){la(o.codemirror,"ordered-list")}function Ki(o){Pd(o.codemirror)}function Gi(o){var p=o.options,v="https://";if(p.promptURLs){var C=prompt(p.promptTexts.link,v);if(!C)return!1;v=bc(C)}xc(o,"link",p.insertTexts.link,v)}function Zi(o){var p=o.options,v="https://";if(p.promptURLs){var C=prompt(p.promptTexts.image,v);if(!C)return!1;v=bc(C)}xc(o,"image",p.insertTexts.image,v)}function bc(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function aa(o){o.openBrowseFileWindow()}function yc(o,p){var v=o.codemirror,C=Tr(v),b=o.options,S=p.substr(p.lastIndexOf("/")+1),s=S.substring(S.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(s))Rr(v,C.image,b.insertTexts.uploadedImage,p);else{var h=b.insertTexts.link;h[0]="["+S,Rr(v,C.link,h,p)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",S)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Xi(o){var p=o.codemirror,v=Tr(p),C=o.options;Rr(p,v.table,C.insertTexts.table)}function Yi(o){var p=o.codemirror,v=Tr(p),C=o.options;Rr(p,v.image,C.insertTexts.horizontalRule)}function Qi(o){var p=o.codemirror;p.undo(),p.focus()}function Vi(o){var p=o.codemirror;p.redo(),p.focus()}function bn(o){var p=o.codemirror,v=p.getWrapperElement(),C=v.nextSibling,b=o.toolbarElements&&o.toolbarElements["side-by-side"],S=!1,s=v.parentNode;C.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&s.classList.remove("sided--no-fullscreen"),C.classList.remove("editor-preview-active-side"),b&&b.classList.remove("active"),v.classList.remove("CodeMirror-sided")):(setTimeout(function(){p.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?s.classList.add("sided--no-fullscreen"):jr(o)),C.classList.add("editor-preview-active-side")},1),b&&b.classList.add("active"),v.classList.add("CodeMirror-sided"),S=!0);var h=v.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var g=o.toolbarElements.preview,T=o.toolbar_div;g.classList.remove("active"),T.classList.remove("disabled-for-preview")}var x=function(){var d=o.options.previewRender(o.value(),C);d!=null&&(C.innerHTML=d)};if(p.sideBySideRenderingFunction||(p.sideBySideRenderingFunction=x),S){var c=o.options.previewRender(o.value(),C);c!=null&&(C.innerHTML=c),p.on("update",p.sideBySideRenderingFunction)}else p.off("update",p.sideBySideRenderingFunction);p.refresh()}function Ji(o){var p=o.codemirror,v=p.getWrapperElement(),C=o.toolbar_div,b=o.options.toolbar?o.toolbarElements.preview:!1,S=v.lastChild,s=p.getWrapperElement().nextSibling;if(s.classList.contains("editor-preview-active-side")&&bn(o),!S||!S.classList.contains("editor-preview-full")){if(S=document.createElement("div"),S.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h<o.options.previewClass.length;h++)S.classList.add(o.options.previewClass[h]);else typeof o.options.previewClass=="string"&&S.classList.add(o.options.previewClass);v.appendChild(S)}S.classList.contains("editor-preview-active")?(S.classList.remove("editor-preview-active"),b&&(b.classList.remove("active"),C.classList.remove("disabled-for-preview"))):(setTimeout(function(){S.classList.add("editor-preview-active")},1),b&&(b.classList.add("active
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text | Text | Text |
`],horizontalRule:["",`
-----
`]},Rd={link:"URL for the link:",image:"URL of the image:"},Hd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Bd={bold:"**",code:"```",italic:"*"},Wd={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"},Ud={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#."};Te.prototype.uploadImages=function(o,p,v){if(o.length!==0){for(var C=[],b=0;b<o.length;b++)C.push(o[b].name),this.uploadImage(o[b],p,v);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",C.join(", ")))}};Te.prototype.uploadImagesUsingCustomFunction=function(o,p){if(p.length!==0){for(var v=[],C=0;C<p.length;C++)v.push(p[C].name),this.uploadImageUsingCustomFunction(o,p[C]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",v.join(", ")))}};Te.prototype.updateStatusBar=function(o,p){if(this.gui.statusbar){var v=this.gui.statusbar.getElementsByClassName(o);v.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=p:v.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}};Te.prototype.markdown=function(o){if(marked){var p;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?p=this.options.renderingConfig.markedOptions:p={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?p.breaks=!1:p.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var v=this.options.renderingConfig.hljs||window.hljs;v&&(p.highlight=function(b,S){return S&&v.getLanguage(S)?v.highlight(S,b).value:v.highlightAuto(b).value})}marked.setOptions(p);var C=marked.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(C=this.options.renderingConfig.sanitizerFunction.call(this,C)),C=qd(C),C=Id(C),C}};Te.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var p=this.options,v=this,C={};for(var b in p.shortcuts)p.shortcuts[b]!==null&&Vn[b]!==null&&function(y){C[vc(p.shortcuts[y])]=function(){var R=Vn[y];typeof R=="function"?R(v):typeof R=="string"&&window.open(R,"_blank")}}(b);C.Enter="newlineAndIndentContinueMarkdownList",C.Tab="tabAndIndentMarkdownList",C["Shift-Tab"]="shiftTabAndUnindentMarkdownList",C.Esc=function(y){y.getOption("fullScreen")&&jr(v)},this.documentOnKeyDown=function(y){y=y||window.event,y.keyCode==27&&v.codemirror.getOption("fullScreen")&&jr(v)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var S,s;p.overlayMode?(CodeMirror.defineMode("overlay-mode",function(y){return CodeMirror.overlayMode(CodeMirror.getMode(y,p.spellChecker!==!1?"spell-checker":"gfm"),p.overlayMode.mode,p.overlayMode.combine)}),S="overlay-mode",s=p.parsingConfig,s.gitHubSpice=!1):(S=p.parsingConfig,S.name="gfm",S.gitHubSpice=!1),p.spellChecker!==!1&&(S="spell-checker",s=p.parsingConfig,s.name="gfm",s.gitHubSpice=!1,typeof p.spellChecker=="function"?p.spellChecker({codeMirrorInstance:CodeMirror}):CodeMirrorSpellChecker({codeMirrorInstance:CodeMirror}));function h(y,R,M){return{addNew:!1}}if(CodeMirror.getMode("php").mime="text/x-php",this.codemirror=CodeMirror.fromTextArea(o,{mode:S,backdrop:s,theme:p.theme!=null?p.theme:"easymde",tabSize:p.tabSize!=null?p.tabSize:2,indentUnit:p.tabSize!=null?p.tabSize:2,indentWithTabs:p.indentWithTabs!==!1,lineNumbers:p.lineNumbers===!0,autofocus:p.autofocus===!0,extraKeys:C,direction:p.direction,lineWrapping:p.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:p.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:p.styleSelectedText!=null?p.styleSelectedText:!ra(),scrollbarStyle:p.scrollbarStyle!=null?p.scrollbarStyle:"native",configureMouse:h,inputStyle:p.inputStyle!=null?p.inputStyle:ra()?"contenteditable":"textarea",spellcheck:p.nativeSpellcheck!=null?p.nativeSpellcheck:!0,autoRefresh:p.autoRefresh!=null?p.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=p.minHeight,typeof p.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=p.maxHeight),p.forceSync===!0){var g=t