var ml=Object.defineProperty;var Nt=Object.assign;var mi=(Xe,ye,o)=>(typeof ye!="symbol"&&(ye+=""),ye in Xe?ml(Xe,ye,{enumerable:!0,configurable:!0,writable:!0,value:o}):Xe[ye]=o),_o=(Xe,ye,o)=>{if(!ye.has(Xe))throw TypeError("Cannot "+o)},Qe=(Xe,ye,o)=>(_o(Xe,ye,"read from private field"),o?o.call(Xe):ye.get(Xe)),Cn=(Xe,ye,o,l)=>(_o(Xe,ye,"write to private field"),l?l.call(Xe,o):ye.set(Xe,o),o),yn=(Xe,ye,o)=>(_o(Xe,ye,"access private method"),o),el=(Xe,ye,o)=>new Promise((l,f)=>{var p=S=>{try{a(o.next(S))}catch(m){f(m)}},d=S=>{try{a(o.throw(S))}catch(m){f(m)}},a=S=>S.done?l(S.value):Promise.resolve(S.value).then(p,d);a((o=o.apply(Xe,ye)).next())});(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[69123],{1065:function(Xe,ye,o){"use strict";o.d(ye,{TK:function(){return d},ys:function(){return v},Mb:function(){return m},eC:function(){return V},Gn:function(){return qt}});var l=o(74405),f=o(30111),p=o(16888);class d{constructor(P,Y,he){this.state=P,this.pos=Y,this.explicit=he,this.abortListeners=[]}tokenBefore(P){let Y=(0,p.qz)(this.state).resolveInner(this.pos,-1);for(;Y&&P.indexOf(Y.name)<0;)Y=Y.parent;return Y?{from:Y.from,to:this.pos,text:this.state.sliceDoc(Y.from,this.pos),type:Y.type}:null}matchBefore(P){let Y=this.state.doc.lineAt(this.pos),he=Math.max(Y.from,this.pos-250),le=Y.text.slice(he-Y.from,this.pos-Y.from),je=le.search(w(P,!1));return je<0?null:{from:he+je,to:this.pos,text:le.slice(je)}}get aborted(){return this.abortListeners==null}addEventListener(P,Y){P=="abort"&&this.abortListeners&&this.abortListeners.push(Y)}}function a(F){let P=Object.keys(F).join(""),Y=/\w/.test(P);return Y&&(P=P.replace(/\w/g,"")),`[${Y?"\\w":""}${P.replace(/[^\w\s]/g,"\\$&")}]`}function S(F){let P=Object.create(null),Y=Object.create(null);for(let{label:le}of F){P[le[0]]=!0;for(let je=1;jetypeof le=="string"?{label:le}:le),[Y,he]=P.every(le=>/^\w+$/.test(le.label))?[/\w*$/,/\w+$/]:S(P);return le=>{let je=le.matchBefore(he);return je||le.explicit?{from:je?je.from:le.pos,options:P,validFor:Y}:null}}function x(F,P){return Y=>{for(let he=syntaxTree(Y.state).resolveInner(Y.pos,-1);he;he=he.parent){if(F.indexOf(he.name)>-1)return P(Y);if(he.type.isTop)break}return null}}function V(F,P){return Y=>{for(let he=(0,p.qz)(Y.state).resolveInner(Y.pos,-1);he;he=he.parent){if(F.indexOf(he.name)>-1)return null;if(he.type.isTop)break}return P(Y)}}class U{constructor(P,Y,he,le){this.completion=P,this.source=Y,this.match=he,this.score=le}}function te(F){return F.selection.main.from}function w(F,P){var Y;let{source:he}=F,le=P&&he[0]!="^",je=he[he.length-1]!="$";return!le&&!je?F:new RegExp(`${le?"^":""}(?:${he})${je?"$":""}`,(Y=F.flags)!==null&&Y!==void 0?Y:F.ignoreCase?"i":"")}const ce=l.q6.define();function N(F,P,Y,he){let{main:le}=F.selection,je=Y-le.from,We=he-le.from;return Object.assign(Object.assign({},F.changeByRange(et=>et!=le&&Y!=he&&F.sliceDoc(et.from+je,et.from+We)!=F.sliceDoc(Y,he)?{range:et}:{changes:{from:et.from+je,to:he==le.from?et.to:et.from+We,insert:P},range:l.jT.cursor(et.from+je+P.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const xe=new WeakMap;function be(F){if(!Array.isArray(F))return F;let P=xe.get(F);return P||xe.set(F,P=m(F)),P}const ne=l.Py.define(),me=l.Py.define();class ke{constructor(P){this.pattern=P,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let Y=0;Y=48&&Ft<=57||Ft>=97&&Ft<=122?2:Ft>=65&&Ft<=90?1:0:($n=(0,l.bg)(Ft))!=$n.toLowerCase()?1:$n!=$n.toUpperCase()?2:0;(!kt||Wn==1&&st||un==0&&Wn!=0)&&(Y[C]==Ft||he[C]==Ft&&(j=!0)?We[C++]=kt:We.length&&(ht=!1)),un=Wn,kt+=(0,l.nZ)(Ft)}return C==at&&We[0]==0&&ht?this.result(-100+(j?-200:0),We,P):ee==at&&Ae==0?this.ret(-200-P.length+(_e==P.length?0:-100),[0,_e]):et>-1?this.ret(-700-P.length,[et,et+this.pattern.length]):ee==at?this.ret(-200+-700-P.length,[Ae,_e]):C==at?this.result(-100+(j?-200:0)+-700+(ht?0:-1100),We,P):Y.length==2?!1:this.result((le[0]?-700:0)+-200+-1100,le,P)}result(P,Y,he){let le=[],je=0;for(let We of Y){let et=We+(this.astral?(0,l.nZ)((0,l.gm)(he,We)):1);je&&le[je-1]==We?le[je-1]=et:(le[je++]=We,le[je++]=et)}return this.ret(P-he.length,le)}}const re=l.r$.define({combine(F){return(0,l.BO)(F,{activateOnTyping:!0,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Ce,compareCompletions:(P,Y)=>P.label.localeCompare(Y.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(P,Y)=>P&&Y,closeOnBlur:(P,Y)=>P&&Y,icons:(P,Y)=>P&&Y,tooltipClass:(P,Y)=>he=>ae(P(he),Y(he)),optionClass:(P,Y)=>he=>ae(P(he),Y(he)),addToOptions:(P,Y)=>P.concat(Y)})}});function ae(F,P){return F?P?F+" "+P:F:P}function Ce(F,P,Y,he,le,je){let We=F.textDirection==f.Nm.RTL,et=We,at=!1,O="top",g,C,j=P.left-le.left,ee=le.right-P.right,Ae=he.right-he.left,_e=he.bottom-he.top;if(et&&j=_e||kt>P.top?g=Y.bottom-P.top:(O="bottom",g=P.bottom-Y.top)}let st=(P.bottom-P.top)/je.offsetHeight,ht=(P.right-P.left)/je.offsetWidth;return{style:`${O}: ${g/st}px; max-width: ${C/ht}px`,class:"cm-completionInfo-"+(at?We?"left-narrow":"right-narrow":et?"left":"right")}}function Ee(F){let P=F.addToOptions.slice();return F.icons&&P.push({render(Y){let he=document.createElement("div");return he.classList.add("cm-completionIcon"),Y.type&&he.classList.add(...Y.type.split(/\s+/g).map(le=>"cm-completionIcon-"+le)),he.setAttribute("aria-hidden","true"),he},position:20}),P.push({render(Y,he,le,je){let We=document.createElement("span");We.className="cm-completionLabel";let et=Y.displayLabel||Y.label,at=0;for(let O=0;Oat&&We.appendChild(document.createTextNode(et.slice(at,g)));let j=We.appendChild(document.createElement("span"));j.appendChild(document.createTextNode(et.slice(g,C))),j.className="cm-completionMatchedText",at=C}return atY.position-he.position).map(Y=>Y.render)}function nt(F,P,Y){if(F<=Y)return{from:0,to:F};if(P<0&&(P=0),P<=F>>1){let le=Math.floor(P/Y);return{from:le*Y,to:(le+1)*Y}}let he=Math.floor((F-P)/Y);return{from:F-(he+1)*Y,to:F-he*Y}}class qe{constructor(P,Y,he){this.view=P,this.stateField=Y,this.applyCompletion=he,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:at=>this.placeInfo(at),key:this},this.space=null,this.currentClass="";let le=P.state.field(Y),{options:je,selected:We}=le.open,et=P.state.facet(re);this.optionContent=Ee(et),this.optionClass=et.optionClass,this.tooltipClass=et.tooltipClass,this.range=nt(je.length,We,et.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(P.state),this.dom.addEventListener("mousedown",at=>{let{options:O}=P.state.field(Y).open;for(let g=at.target,C;g&&g!=this.dom;g=g.parentNode)if(g.nodeName=="LI"&&(C=/-(\d+)$/.exec(g.id))&&+C[1]{let O=P.state.field(this.stateField,!1);O&&O.tooltip&&P.state.facet(re).closeOnBlur&&at.relatedTarget!=P.contentDOM&&P.dispatch({effects:me.of(null)})}),this.showOptions(je,le.id)}mount(){this.updateSel()}showOptions(P,Y){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(P,Y,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(P){var Y;let he=P.state.field(this.stateField),le=P.startState.field(this.stateField);if(this.updateTooltipClass(P.state),he!=le){let{options:je,selected:We,disabled:et}=he.open;(!le.open||le.open.options!=je)&&(this.range=nt(je.length,We,P.state.facet(re).maxRenderedOptions),this.showOptions(je,he.id)),this.updateSel(),et!=((Y=le.open)===null||Y===void 0?void 0:Y.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!et)}}updateTooltipClass(P){let Y=this.tooltipClass(P);if(Y!=this.currentClass){for(let he of this.currentClass.split(" "))he&&this.dom.classList.remove(he);for(let he of Y.split(" "))he&&this.dom.classList.add(he);this.currentClass=Y}}positioned(P){this.space=P,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let P=this.view.state.field(this.stateField),Y=P.open;if((Y.selected>-1&&Y.selected=this.range.to)&&(this.range=nt(Y.options.length,Y.selected,this.view.state.facet(re).maxRenderedOptions),this.showOptions(Y.options,P.id)),this.updateSelectedOption(Y.selected)){this.destroyInfo();let{completion:he}=Y.options[Y.selected],{info:le}=he;if(!le)return;let je=typeof le=="string"?document.createTextNode(le):le(he);if(!je)return;"then"in je?je.then(We=>{We&&this.view.state.field(this.stateField,!1)==P&&this.addInfoPane(We,he)}).catch(We=>(0,f.OO)(this.view.state,We,"completion info")):this.addInfoPane(je,he)}}addInfoPane(P,Y){this.destroyInfo();let he=this.info=document.createElement("div");if(he.className="cm-tooltip cm-completionInfo",P.nodeType!=null)he.appendChild(P),this.infoDestroy=null;else{let{dom:le,destroy:je}=P;he.appendChild(le),this.infoDestroy=je||null}this.dom.appendChild(he),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(P){let Y=null;for(let he=this.list.firstChild,le=this.range.from;he;he=he.nextSibling,le++)he.nodeName!="LI"||!he.id?le--:le==P?he.hasAttribute("aria-selected")||(he.setAttribute("aria-selected","true"),Y=he):he.hasAttribute("aria-selected")&&he.removeAttribute("aria-selected");return Y&&Je(this.list,Y),Y}measureInfo(){let P=this.dom.querySelector("[aria-selected]");if(!P||!this.info)return null;let Y=this.dom.getBoundingClientRect(),he=this.info.getBoundingClientRect(),le=P.getBoundingClientRect(),je=this.space;if(!je){let We=this.dom.ownerDocument.defaultView||window;je={left:0,top:0,right:We.innerWidth,bottom:We.innerHeight}}return le.top>Math.min(je.bottom,Y.bottom)-10||le.bottomhe.from||he.from==0))if(je=j,typeof O!="string"&&O.header)le.appendChild(O.header(O));else{let ee=le.appendChild(document.createElement("completion-section"));ee.textContent=j}}const g=le.appendChild(document.createElement("li"));g.id=Y+"-"+We,g.setAttribute("role","option");let C=this.optionClass(et);C&&(g.className=C);for(let j of this.optionContent){let ee=j(et,this.view.state,this.view,at);ee&&g.appendChild(ee)}}return he.from&&le.classList.add("cm-completionListIncompleteTop"),he.tonew qe(Y,F,P)}function Je(F,P){let Y=F.getBoundingClientRect(),he=P.getBoundingClientRect(),le=Y.height/F.offsetHeight;he.topY.bottom&&(F.scrollTop+=(he.bottom-Y.bottom)/le)}function lt(F){return(F.boost||0)*100+(F.apply?10:0)+(F.info?5:0)+(F.type?1:0)}function Rt(F,P){let Y=[],he=null,le=at=>{Y.push(at);let{section:O}=at.completion;if(O){he||(he=[]);let g=typeof O=="string"?O:O.name;he.some(C=>C.name==g)||he.push(typeof O=="string"?{name:g}:O)}};for(let at of F)if(at.hasResult()){let O=at.result.getMatch;if(at.result.filter===!1)for(let g of at.result.options)le(new U(g,at.source,O?O(g):[],1e9-Y.length));else{let g=new ke(P.sliceDoc(at.from,at.to));for(let C of at.result.options)if(g.match(C.label)){let j=C.displayLabel?O?O(C,g.matched):[]:g.matched;le(new U(C,at.source,j,g.score+(C.boost||0)))}}}if(he){let at=Object.create(null),O=0,g=(C,j)=>{var ee,Ae;return((ee=C.rank)!==null&&ee!==void 0?ee:1e9)-((Ae=j.rank)!==null&&Ae!==void 0?Ae:1e9)||(C.nameg.score-O.score||et(O.completion,g.completion))){let O=at.completion;!We||We.label!=O.label||We.detail!=O.detail||We.type!=null&&O.type!=null&&We.type!=O.type||We.apply!=O.apply||We.boost!=O.boost?je.push(at):lt(at.completion)>lt(We)&&(je[je.length-1]=at),We=at.completion}return je}class Re{constructor(P,Y,he,le,je,We){this.options=P,this.attrs=Y,this.tooltip=he,this.timestamp=le,this.selected=je,this.disabled=We}setSelected(P,Y){return P==this.selected||P>=this.options.length?this:new Re(this.options,H(Y,P),this.tooltip,this.timestamp,P,this.disabled)}static build(P,Y,he,le,je){let We=Rt(P,Y);if(!We.length)return le&&P.some(at=>at.state==1)?new Re(le.options,le.attrs,le.tooltip,le.timestamp,le.selected,!0):null;let et=Y.facet(re).selectOnOpen?0:-1;if(le&&le.selected!=et&&le.selected!=-1){let at=le.options[le.selected].completion;for(let O=0;OO.hasResult()?Math.min(at,O.from):at,1e8),create:zt,above:je.aboveCursor},le?le.timestamp:Date.now(),et,!1)}map(P){return new Re(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:P.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Ie{constructor(P,Y,he){this.active=P,this.id=Y,this.open=he}static start(){return new Ie(W,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(P){let{state:Y}=P,he=Y.facet(re),je=(he.override||Y.languageDataAt("autocomplete",te(Y)).map(be)).map(et=>(this.active.find(O=>O.source==et)||new K(et,this.active.some(O=>O.state!=0)?1:0)).update(P,he));je.length==this.active.length&&je.every((et,at)=>et==this.active[at])&&(je=this.active);let We=this.open;We&&P.docChanged&&(We=We.map(P.changes)),P.selection||je.some(et=>et.hasResult()&&P.changes.touchesRange(et.from,et.to))||!$(je,this.active)?We=Re.build(je,Y,this.id,We,he):We&&We.disabled&&!je.some(et=>et.state==1)&&(We=null),!We&&je.every(et=>et.state!=1)&&je.some(et=>et.hasResult())&&(je=je.map(et=>et.hasResult()?new K(et.source,0):et));for(let et of P.effects)et.is(mt)&&(We=We&&We.setSelected(et.value,this.id));return je==this.active&&We==this.open?this:new Ie(je,this.id,We)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:I}}function $(F,P){if(F==P)return!0;for(let Y=0,he=0;;){for(;Y-1&&(Y["aria-activedescendant"]=F+"-"+P),Y}const W=[];function q(F){return F.isUserEvent("input.type")?"input":F.isUserEvent("delete.backward")?"delete":null}class K{constructor(P,Y,he=-1){this.source=P,this.state=Y,this.explicitPos=he}hasResult(){return!1}update(P,Y){let he=q(P),le=this;he?le=le.handleUserEvent(P,he,Y):P.docChanged?le=le.handleChange(P):P.selection&&le.state!=0&&(le=new K(le.source,0));for(let je of P.effects)if(je.is(ne))le=new K(le.source,1,je.value?te(P.state):-1);else if(je.is(me))le=new K(le.source,0);else if(je.is(ot))for(let We of je.value)We.source==le.source&&(le=We);return le}handleUserEvent(P,Y,he){return Y=="delete"||!he.activateOnTyping?this.map(P.changes):new K(this.source,1)}handleChange(P){return P.changes.touchesRange(te(P.startState))?new K(this.source,0):this.map(P.changes)}map(P){return P.empty||this.explicitPos<0?this:new K(this.source,this.state,P.mapPos(this.explicitPos))}}class Se extends K{constructor(P,Y,he,le,je){super(P,2,Y);this.result=he,this.from=le,this.to=je}hasResult(){return!0}handleUserEvent(P,Y,he){var le;let je=P.changes.mapPos(this.from),We=P.changes.mapPos(this.to,1),et=te(P.state);if((this.explicitPos<0?et<=je:etWe||Y=="delete"&&te(P.startState)==this.from)return new K(this.source,Y=="input"&&he.activateOnTyping?1:0);let at=this.explicitPos<0?-1:P.changes.mapPos(this.explicitPos),O;return Ke(this.result.validFor,P.state,je,We)?new Se(this.source,at,this.result,je,We):this.result.update&&(O=this.result.update(this.result,je,We,new d(P.state,et,at>=0)))?new Se(this.source,at,O,O.from,(le=O.to)!==null&&le!==void 0?le:te(P.state)):new K(this.source,1,at)}handleChange(P){return P.changes.touchesRange(this.from,this.to)?new K(this.source,0):this.map(P.changes)}map(P){return P.empty?this:new Se(this.source,this.explicitPos<0?-1:P.mapPos(this.explicitPos),this.result,P.mapPos(this.from),P.mapPos(this.to,1))}}function Ke(F,P,Y,he){if(!F)return!1;let le=P.sliceDoc(Y,he);return typeof F=="function"?F(le,Y,he,P):w(F,!0).test(le)}const ot=l.Py.define({map(F,P){return F.map(Y=>Y.map(P))}}),mt=l.Py.define(),ut=l.QQ.define({create(){return Ie.start()},update(F,P){return F.update(P)},provide:F=>[f.hJ.from(F,P=>P.tooltip),f.tk.contentAttributes.from(F,P=>P.attrs)]});function Vt(F,P){const Y=P.completion.apply||P.completion.label;let he=F.state.field(ut).active.find(le=>le.source==P.source);return he instanceof Se?(typeof Y=="string"?F.dispatch(Object.assign(Object.assign({},N(F.state,Y,he.from,he.to)),{annotations:ce.of(P.completion)})):Y(F,P.completion,he.from,he.to),!0):!1}const zt=dt(ut,Vt);function It(F,P="option"){return Y=>{let he=Y.state.field(ut,!1);if(!he||!he.open||he.open.disabled||Date.now()-he.open.timestamp-1?he.open.selected+le*(F?1:-1):F?0:We-1;return et<0?et=P=="page"?0:We-1:et>=We&&(et=P=="page"?We-1:0),Y.dispatch({effects:mt.of(et)}),!0}}const sn=F=>{let P=F.state.field(ut,!1);return F.state.readOnly||!P||!P.open||P.open.selected<0||P.open.disabled||Date.now()-P.open.timestampF.state.field(ut,!1)?(F.dispatch({effects:ne.of(!0)}),!0):!1,Xt=F=>{let P=F.state.field(ut,!1);return!P||!P.active.some(Y=>Y.state!=0)?!1:(F.dispatch({effects:me.of(null)}),!0)};class $t{constructor(P,Y){this.active=P,this.context=Y,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ve=50,A=1e3,D=f.lg.fromClass(class{constructor(F){this.view=F,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let P of F.state.field(ut).active)P.state==1&&this.startQuery(P)}update(F){let P=F.state.field(ut);if(!F.selectionSet&&!F.docChanged&&F.startState.field(ut)==P)return;let Y=F.transactions.some(le=>(le.selection||le.docChanged)&&!q(le));for(let le=0;leVe&&Date.now()-je.time>A){for(let We of je.context.abortListeners)try{We()}catch(et){(0,f.OO)(this.view.state,et)}je.context.abortListeners=null,this.running.splice(le--,1)}else je.updates.push(...F.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),F.transactions.some(le=>le.effects.some(je=>je.is(ne)))&&(this.pendingStart=!0);let he=this.pendingStart?50:F.state.facet(re).activateOnTypingDelay;if(this.debounceUpdate=P.active.some(le=>le.state==1&&!this.running.some(je=>je.active.source==le.source))?setTimeout(()=>this.startUpdate(),he):-1,this.composing!=0)for(let le of F.transactions)q(le)=="input"?this.composing=2:this.composing==2&&le.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:F}=this.view,P=F.field(ut);for(let Y of P.active)Y.state==1&&!this.running.some(he=>he.active.source==Y.source)&&this.startQuery(Y)}startQuery(F){let{state:P}=this.view,Y=te(P),he=new d(P,Y,F.explicitPos==Y),le=new $t(F,he);this.running.push(le),Promise.resolve(F.source(he)).then(je=>{le.context.aborted||(le.done=je||null,this.scheduleAccept())},je=>{this.view.dispatch({effects:me.of(null)}),(0,f.OO)(this.view.state,je)})}scheduleAccept(){this.running.every(F=>F.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(re).updateSyncTime))}accept(){var F;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let P=[],Y=this.view.state.facet(re);for(let he=0;heWe.source==le.active.source);if(je&&je.state==1)if(le.done==null){let We=new K(le.active.source,0);for(let et of le.updates)We=We.update(et,Y);We.state!=1&&P.push(We)}else this.startQuery(je)}P.length&&this.view.dispatch({effects:ot.of(P)})}},{eventHandlers:{blur(F){let P=this.view.state.field(ut,!1);if(P&&P.tooltip&&this.view.state.facet(re).closeOnBlur){let Y=P.open&&(0,f.gB)(this.view,P.open.tooltip);(!Y||!Y.dom.contains(F.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:me.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ne.of(!1)}),20),this.composing=0}}}),oe=f.tk.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class ge{constructor(P,Y,he,le){this.field=P,this.line=Y,this.from=he,this.to=le}}class Te{constructor(P,Y,he){this.field=P,this.from=Y,this.to=he}map(P){let Y=P.mapPos(this.from,-1,l.gc.TrackDel),he=P.mapPos(this.to,1,l.gc.TrackDel);return Y==null||he==null?null:new Te(this.field,Y,he)}}class Ne{constructor(P,Y){this.lines=P,this.fieldPositions=Y}instantiate(P,Y){let he=[],le=[Y],je=P.doc.lineAt(Y),We=/^\s*/.exec(je.text)[0];for(let at of this.lines){if(he.length){let O=We,g=/^\t*/.exec(at)[0].length;for(let C=0;Cnew Te(at.field,le[at.line]+at.from,le[at.line]+at.to));return{text:he,ranges:et}}static parse(P){let Y=[],he=[],le=[],je;for(let We of P.split(/\r\n?|\n/)){for(;je=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(We);){let et=je[1]?+je[1]:null,at=je[2]||je[3]||"",O=-1;for(let g=0;g=O&&C.field++}le.push(new ge(O,he.length,je.index,je.index+at.length)),We=We.slice(0,je.index)+at+We.slice(je.index+je[0].length)}for(let et;et=/\\([{}])/.exec(We);){We=We.slice(0,et.index)+et[1]+We.slice(et.index+et[0].length);for(let at of le)at.line==he.length&&at.from>et.index&&(at.from--,at.to--)}he.push(We)}return new Ne(he,le)}}let rt=f.p.widget({widget:new class extends f.l9{toDOM(){let F=document.createElement("span");return F.className="cm-snippetFieldPosition",F}ignoreEvent(){return!1}}}),Lt=f.p.mark({class:"cm-snippetField"});class Yt{constructor(P,Y){this.ranges=P,this.active=Y,this.deco=f.p.set(P.map(he=>(he.from==he.to?rt:Lt).range(he.from,he.to)))}map(P){let Y=[];for(let he of this.ranges){let le=he.map(P);if(!le)return null;Y.push(le)}return new Yt(Y,this.active)}selectionInsideField(P){return P.ranges.every(Y=>this.ranges.some(he=>he.field==this.active&&he.from<=Y.from&&he.to>=Y.to))}}const Bt=l.Py.define({map(F,P){return F&&F.map(P)}}),nn=l.Py.define(),hn=l.QQ.define({create(){return null},update(F,P){for(let Y of P.effects){if(Y.is(Bt))return Y.value;if(Y.is(nn)&&F)return new Yt(F.ranges,Y.value)}return F&&P.docChanged&&(F=F.map(P.changes)),F&&P.selection&&!F.selectionInsideField(P.selection)&&(F=null),F},provide:F=>f.tk.decorations.from(F,P=>P?P.deco:f.p.none)});function tn(F,P){return l.jT.create(F.filter(Y=>Y.field==P).map(Y=>l.jT.range(Y.from,Y.to)))}function gn(F){let P=Ne.parse(F);return(Y,he,le,je)=>{let{text:We,ranges:et}=P.instantiate(Y.state,le),at={changes:{from:le,to:je,insert:l.xv.of(We)},scrollIntoView:!0,annotations:he?[ce.of(he),l.YW.userEvent.of("input.complete")]:void 0};if(et.length&&(at.selection=tn(et,0)),et.some(O=>O.field>0)){let O=new Yt(et,0),g=at.effects=[Bt.of(O)];Y.state.field(hn,!1)===void 0&&g.push(l.Py.appendConfig.of([hn,Pt,Tt,oe]))}Y.dispatch(Y.state.update(at))}}function Le(F){return({state:P,dispatch:Y})=>{let he=P.field(hn,!1);if(!he||F<0&&he.active==0)return!1;let le=he.active+F,je=F>0&&!he.ranges.some(We=>We.field==le+F);return Y(P.update({selection:tn(he.ranges,le),effects:Bt.of(je?null:new Yt(he.ranges,le)),scrollIntoView:!0})),!0}}const ze=({state:F,dispatch:P})=>F.field(hn,!1)?(P(F.update({effects:Bt.of(null)})),!0):!1,Ot=Le(1),yt=Le(-1);function Oe(F){let P=F.field(hn,!1);return!!(P&&P.ranges.some(Y=>Y.field==P.active+1))}function Ge(F){let P=F.field(hn,!1);return!!(P&&P.active>0)}const it=[{key:"Tab",run:Ot,shift:yt},{key:"Escape",run:ze}],Ye=l.r$.define({combine(F){return F.length?F[0]:it}}),Pt=l.Wl.highest(f.$f.compute([Ye],F=>F.facet(Ye)));function qt(F,P){return Object.assign(Object.assign({},P),{apply:gn(F)})}const Tt=f.tk.domEventHandlers({mousedown(F,P){let Y=P.state.field(hn,!1),he;if(!Y||(he=P.posAtCoords({x:F.clientX,y:F.clientY}))==null)return!1;let le=Y.ranges.find(je=>je.from<=he&&je.to>=he);return!le||le.field==Y.active?!1:(P.dispatch({selection:tn(Y.ranges,le.field),effects:Bt.of(Y.ranges.some(je=>je.field>le.field)?new Yt(Y.ranges,le.field):null),scrollIntoView:!0}),!0)}});function Ht(F){let P=F.replace(/[\]\-\\]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${P}]+`,"ug")}catch(Y){return new RegExp(`[w${P}]`,"g")}}function Gt(F,P){return new RegExp(P(F.source),F.unicode?"u":"")}const xt=null;function Kt(F){return xt[F]||(xt[F]=new WeakMap)}function Jt(F,P,Y,he,le){for(let je=F.iterLines(),We=0;!je.next().done;){let{value:et}=je,at;for(P.lastIndex=0;at=P.exec(et);)if(!he[at[0]]&&We+at.index!=le&&(Y.push({type:"text",label:at[0]}),he[at[0]]=!0,Y.length>=2e3))return;We+=et.length+1}}function en(F,P,Y,he,le){let je=F.length>=1e3,We=je&&P.get(F);if(We)return We;let et=[],at=Object.create(null);if(F.children){let O=0;for(let g of F.children){if(g.length>=1e3)for(let C of en(g,P,Y,he-O,le-O))at[C.label]||(at[C.label]=!0,et.push(C));else Jt(g,Y,et,at,le-O);O+=g.length+1}}else Jt(F,Y,et,at,le);return je&&et.length<2e3&&P.set(F,et),et}const _t=F=>{let P=F.state.languageDataAt("wordChars",F.pos).join(""),Y=Ht(P),he=F.matchBefore(Gt(Y,We=>We+"$"));if(!he&&!F.explicit)return null;let le=he?he.from:F.pos,je=en(F.state.doc,Kt(P),Y,5e4,le);return{from:le,options:je,validFor:Gt(Y,We=>"^"+We)}},On={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},dn=l.Py.define({map(F,P){let Y=P.mapPos(F,-1,l.gc.TrackAfter);return Y==null?void 0:Y}}),Ln=new class extends l.uU{};Ln.startSide=1,Ln.endSide=-1;const En=l.QQ.define({create(){return l.Xs.empty},update(F,P){if(F=F.map(P.changes),P.selection){let Y=P.state.doc.lineAt(P.selection.main.head);F=F.update({filter:he=>he>=Y.from&&he<=Y.to})}for(let Y of P.effects)Y.is(dn)&&(F=F.update({add:[Ln.range(Y.value,Y.value+1)]}));return F}});function vn(){return[Kn,En]}const In="()[]{}<>";function Dn(F){for(let P=0;P{if(F.readOnly)return!1;let he=Jn(F,F.selection.main.head).brackets||On.brackets,le=null,je=F.changeByRange(We=>{if(We.empty){let et=ci(F.doc,We.head);for(let at of he)if(at==et&&ai(F.doc,We.head)==Dn((0,l.gm)(at,0)))return{changes:{from:We.head-at.length,to:We.head+at.length},range:l.jT.cursor(We.head-at.length)}}return{range:le=We}});return le||P(F.update(je,{scrollIntoView:!0,userEvent:"delete.backward"})),!le}}];function yi(F,P){let Y=Jn(F,F.selection.main.head),he=Y.brackets||On.brackets;for(let le of he){let je=Dn(codePointAt(le,0));if(P==le)return je==le?gi(F,le,he.indexOf(le+le+le)>-1,Y):Un(F,le,je,Y.before||On.before);if(P==je&&di(F,F.selection.main.from))return ui(F,le,je)}return null}function di(F,P){let Y=!1;return F.field(En).between(0,F.doc.length,he=>{he==P&&(Y=!0)}),Y}function ai(F,P){let Y=F.sliceString(P,P+2);return Y.slice(0,(0,l.nZ)((0,l.gm)(Y,0)))}function ci(F,P){let Y=F.sliceString(P-2,P);return(0,l.nZ)((0,l.gm)(Y,0))==Y.length?Y:Y.slice(1)}function Un(F,P,Y,he){let le=null,je=F.changeByRange(We=>{if(!We.empty)return{changes:[{insert:P,from:We.from},{insert:Y,from:We.to}],effects:dn.of(We.to+P.length),range:EditorSelection.range(We.anchor+P.length,We.head+P.length)};let et=ai(F.doc,We.head);return!et||/\s/.test(et)||he.indexOf(et)>-1?{changes:{insert:P+Y,from:We.head},effects:dn.of(We.head+P.length),range:EditorSelection.cursor(We.head+P.length)}:{range:le=We}});return le?null:F.update(je,{scrollIntoView:!0,userEvent:"input.type"})}function ui(F,P,Y){let he=null,le=F.changeByRange(je=>je.empty&&ai(F.doc,je.head)==Y?{changes:{from:je.head,to:je.head+Y.length,insert:Y},range:EditorSelection.cursor(je.head+Y.length)}:he={range:je});return he?null:F.update(le,{scrollIntoView:!0,userEvent:"input.type"})}function gi(F,P,Y,he){let le=he.stringPrefixes||On.stringPrefixes,je=null,We=F.changeByRange(et=>{if(!et.empty)return{changes:[{insert:P,from:et.from},{insert:P,from:et.to}],effects:dn.of(et.to+P.length),range:EditorSelection.range(et.anchor+P.length,et.head+P.length)};let at=et.head,O=ai(F.doc,at),g;if(O==P){if(ue(F,at))return{changes:{insert:P+P,from:at},effects:dn.of(at+P.length),range:EditorSelection.cursor(at+P.length)};if(di(F,at)){let j=Y&&F.sliceDoc(at,at+P.length*3)==P+P+P?P+P+P:P;return{changes:{from:at,to:at+j.length,insert:j},range:EditorSelection.cursor(at+j.length)}}}else{if(Y&&F.sliceDoc(at-2*P.length,at)==P+P&&(g=c(F,at-2*P.length,le))>-1&&ue(F,g))return{changes:{insert:P+P+P+P,from:at},effects:dn.of(at+P.length),range:EditorSelection.cursor(at+P.length)};if(F.charCategorizer(at)(O)!=CharCategory.Word&&c(F,at,le)>-1&&!h(F,at,P,le))return{changes:{insert:P+P,from:at},effects:dn.of(at+P.length),range:EditorSelection.cursor(at+P.length)}}return{range:je=et}});return je?null:F.update(We,{scrollIntoView:!0,userEvent:"input.type"})}function ue(F,P){let Y=syntaxTree(F).resolveInner(P+1);return Y.parent&&Y.from==P}function h(F,P,Y,he){let le=syntaxTree(F).resolveInner(P,-1),je=he.reduce((We,et)=>Math.max(We,et.length),0);for(let We=0;We<5;We++){let et=F.sliceDoc(le.from,Math.min(le.to,le.from+Y.length+je)),at=et.indexOf(Y);if(!at||at>-1&&he.indexOf(et.slice(0,at))>-1){let g=le.firstChild;for(;g&&g.from==le.from&&g.to-g.from>Y.length+at;){if(F.sliceDoc(g.to-Y.length,g.to)==Y)return!1;g=g.firstChild}return!0}let O=le.to==P&&le.parent;if(!O)break;le=O}return!1}function c(F,P,Y){let he=F.charCategorizer(P);if(he(F.sliceDoc(P-1,P))!=CharCategory.Word)return P;for(let le of Y){let je=P-le.length;if(F.sliceDoc(je,P)==le&&he(F.sliceDoc(je-1,je))!=CharCategory.Word)return je}return-1}function v(F={}){return[ut,re.of(F),D,X,oe]}const Q=[{key:"Ctrl-Space",run:on},{key:"Escape",run:Xt},{key:"ArrowDown",run:It(!0)},{key:"ArrowUp",run:It(!1)},{key:"PageDown",run:It(!0,"page")},{key:"PageUp",run:It(!1,"page")},{key:"Enter",run:sn}],X=l.Wl.highest(f.$f.computeN([re],F=>F.facet(re).defaultKeymap?[Q]:[]));function M(F){let P=F.field(ut,!1);return P&&P.active.some(Y=>Y.state==1)?"pending":P&&P.active.some(Y=>Y.state!=0)?"active":null}const fe=new WeakMap;function Pe(F){var P;let Y=(P=F.field(ut,!1))===null||P===void 0?void 0:P.open;if(!Y||Y.disabled)return[];let he=fe.get(Y.options);return he||fe.set(Y.options,he=Y.options.map(le=>le.completion)),he}function Fe(F){var P;let Y=(P=F.field(ut,!1))===null||P===void 0?void 0:P.open;return Y&&!Y.disabled&&Y.selected>=0?Y.options[Y.selected].completion:null}function pt(F){var P;let Y=(P=F.field(ut,!1))===null||P===void 0?void 0:P.open;return Y&&!Y.disabled&&Y.selected>=0?Y.selected:null}function Zt(F){return mt.of(F)}},70399:function(Xe,ye,o){"use strict";o.r(ye),o.d(ye,{css:function(){return on},cssCompletionSource:function(){return It},cssLanguage:function(){return sn},defineCSSCompletionSource:function(){return zt}});var l=o(11705),f=o(79653);const p=99,d=1,a=100,S=101,m=2,x=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],V=58,U=40,te=95,w=91,ce=45,N=46,xe=35,be=37,ne=38,me=92,ke=10;function re(Xt){return Xt>=65&&Xt<=90||Xt>=97&&Xt<=122||Xt>=161}function ae(Xt){return Xt>=48&&Xt<=57}const Ce=new l.Jq((Xt,$t)=>{for(let Ve=!1,A=0,D=0;;D++){let{next:oe}=Xt;if(re(oe)||oe==ce||oe==te||Ve&&ae(oe))!Ve&&(oe!=ce||D>0)&&(Ve=!0),A===D&&oe==ce&&A++,Xt.advance();else if(oe==me&&Xt.peek(1)!=ke)Xt.advance(),Xt.next>-1&&Xt.advance(),Ve=!0;else{Ve&&Xt.acceptToken(oe==U?a:A==2&&$t.canShift(m)?m:S);break}}}),Ee=new l.Jq(Xt=>{if(x.includes(Xt.peek(-1))){let{next:$t}=Xt;(re($t)||$t==te||$t==xe||$t==N||$t==w||$t==V&&re(Xt.peek(1))||$t==ce||$t==ne)&&Xt.acceptToken(p)}}),nt=new l.Jq(Xt=>{if(!x.includes(Xt.peek(-1))){let{next:$t}=Xt;if($t==be&&(Xt.advance(),Xt.acceptToken(d)),re($t)){do Xt.advance();while(re(Xt.next)||ae(Xt.next));Xt.acceptToken(d)}}}),qe=(0,f.Gv)({"AtKeyword import charset namespace keyframes media supports":f.pJ.definitionKeyword,"from to selector":f.pJ.keyword,NamespaceName:f.pJ.namespace,KeyframeName:f.pJ.labelName,KeyframeRangeName:f.pJ.operatorKeyword,TagName:f.pJ.tagName,ClassName:f.pJ.className,PseudoClassName:f.pJ.constant(f.pJ.className),IdName:f.pJ.labelName,"FeatureName PropertyName":f.pJ.propertyName,AttributeName:f.pJ.attributeName,NumberLiteral:f.pJ.number,KeywordQuery:f.pJ.keyword,UnaryQueryOp:f.pJ.operatorKeyword,"CallTag ValueName":f.pJ.atom,VariableName:f.pJ.variableName,Callee:f.pJ.operatorKeyword,Unit:f.pJ.unit,"UniversalSelector NestingSelector":f.pJ.definitionOperator,MatchOp:f.pJ.compareOperator,"ChildOp SiblingOp, LogicOp":f.pJ.logicOperator,BinOp:f.pJ.arithmeticOperator,Important:f.pJ.modifier,Comment:f.pJ.blockComment,ColorLiteral:f.pJ.color,"ParenthesizedContent StringLiteral":f.pJ.string,":":f.pJ.punctuation,"PseudoOp #":f.pJ.derefOperator,"; ,":f.pJ.separator,"( )":f.pJ.paren,"[ ]":f.pJ.squareBracket,"{ }":f.pJ.brace}),dt={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Je={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},lt={__proto__:null,not:132,only:132},Rt=l.WQ.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Ee,nt,Ce,1,2,3,4,new l.RA("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:Xt=>dt[Xt]||-1},{term:58,get:Xt=>Je[Xt]||-1},{term:101,get:Xt=>lt[Xt]||-1}],tokenPrec:1200});var Re=o(16888),Ie=o(72104);let $=null;function I(){if(!$&&typeof document=="object"&&document.body){let{style:Xt}=document.body,$t=[],Ve=new Set;for(let A in Xt)A!="cssText"&&A!="cssFloat"&&typeof Xt[A]=="string"&&(/[A-Z]/.test(A)&&(A=A.replace(/[A-Z]/g,D=>"-"+D.toLowerCase())),Ve.has(A)||($t.push(A),Ve.add(A)));$=$t.sort().map(A=>({type:"property",label:A}))}return $||[]}const H=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(Xt=>({type:"class",label:Xt})),W=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(Xt=>({type:"keyword",label:Xt})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(Xt=>({type:"constant",label:Xt}))),q=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(Xt=>({type:"type",label:Xt})),K=/^(\w[\w-]*|-\w[\w-]*|)$/,Se=/^-(-[\w-]*)?$/;function Ke(Xt,$t){var Ve;if((Xt.name=="("||Xt.type.isError)&&(Xt=Xt.parent||Xt),Xt.name!="ArgList")return!1;let A=(Ve=Xt.parent)===null||Ve===void 0?void 0:Ve.firstChild;return(A==null?void 0:A.name)!="Callee"?!1:$t.sliceString(A.from,A.to)=="var"}const ot=new Ie.hr,mt=["Declaration"];function ut(Xt){for(let $t=Xt;;){if($t.type.isTop)return $t;if(!($t=$t.parent))return Xt}}function Vt(Xt,$t,Ve){if($t.to-$t.from>4096){let A=ot.get($t);if(A)return A;let D=[],oe=new Set,ge=$t.cursor(Ie.vj.IncludeAnonymous);if(ge.firstChild())do for(let Te of Vt(Xt,ge.node,Ve))oe.has(Te.label)||(oe.add(Te.label),D.push(Te));while(ge.nextSibling());return ot.set($t,D),D}else{let A=[],D=new Set;return $t.cursor().iterate(oe=>{var ge;if(Ve(oe)&&oe.matchContext(mt)&&((ge=oe.node.nextSibling)===null||ge===void 0?void 0:ge.name)==":"){let Te=Xt.sliceString(oe.from,oe.to);D.has(Te)||(D.add(Te),A.push({label:Te,type:"variable"}))}}),A}}const zt=Xt=>$t=>{let{state:Ve,pos:A}=$t,D=(0,Re.qz)(Ve).resolveInner(A,-1),oe=D.type.isError&&D.from==D.to-1&&Ve.doc.sliceString(D.from,D.to)=="-";if(D.name=="PropertyName"||(oe||D.name=="TagName")&&/^(Block|Styles)$/.test(D.resolve(D.to).name))return{from:D.from,options:I(),validFor:K};if(D.name=="ValueName")return{from:D.from,options:W,validFor:K};if(D.name=="PseudoClassName")return{from:D.from,options:H,validFor:K};if(Xt(D)||($t.explicit||oe)&&Ke(D,Ve.doc))return{from:Xt(D)||oe?D.from:A,options:Vt(Ve.doc,ut(D),Xt),validFor:Se};if(D.name=="TagName"){for(let{parent:Ne}=D;Ne;Ne=Ne.parent)if(Ne.name=="Block")return{from:D.from,options:I(),validFor:K};return{from:D.from,options:q,validFor:K}}if(!$t.explicit)return null;let ge=D.resolve(A),Te=ge.childBefore(A);return Te&&Te.name==":"&&ge.name=="PseudoClassSelector"?{from:A,options:H,validFor:K}:Te&&Te.name==":"&&ge.name=="Declaration"||ge.name=="ArgList"?{from:A,options:W,validFor:K}:ge.name=="Block"||ge.name=="Styles"?{from:A,options:I(),validFor:K}:null},It=zt(Xt=>Xt.name=="VariableName"),sn=Re.qp.define({name:"css",parser:Rt.configure({props:[Re.uj.add({Declaration:(0,Re.tC)()}),Re.x0.add({"Block KeyframeList":Re.Dv})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function on(){return new Re.ri(sn,sn.data.of({autocomplete:It}))}},82741:function(Xe,ye,o){"use strict";o.r(ye),o.d(ye,{autoCloseTags:function(){return h},html:function(){return gi},htmlCompletionSource:function(){return Rn},htmlCompletionSourceWith:function(){return yi},htmlLanguage:function(){return ui},htmlPlain:function(){return Un}});var l=o(11705),f=o(79653),p=o(72104);const d=54,a=1,S=55,m=2,x=56,V=3,U=4,te=5,w=6,ce=7,N=8,xe=9,be=10,ne=11,me=12,ke=13,re=57,ae=14,Ce=58,Ee=20,nt=22,qe=23,dt=24,Je=26,lt=27,Rt=28,Re=31,Ie=34,$=36,I=37,H=0,W=1,q={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},K={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Se={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}};function Ke(c){return c==45||c==46||c==58||c>=65&&c<=90||c==95||c>=97&&c<=122||c>=161}function ot(c){return c==9||c==10||c==13||c==32}let mt=null,ut=null,Vt=0;function zt(c,v){let Q=c.pos+v;if(Vt==Q&&ut==c)return mt;let X=c.peek(v);for(;ot(X);)X=c.peek(++v);let M="";for(;Ke(X);)M+=String.fromCharCode(X),X=c.peek(++v);return ut=c,Vt=Q,mt=M?M.toLowerCase():X==Xt||X==$t?void 0:null}const It=60,sn=62,on=47,Xt=63,$t=33,Ve=45;function A(c,v){this.name=c,this.parent=v,this.hash=v?v.hash:0;for(let Q=0;Q-1?new A(zt(X,1)||"",c):c},reduce(c,v){return v==Ee&&c?c.parent:c},reuse(c,v,Q,X){let M=v.type.id;return M==w||M==$?new A(zt(X,1)||"",c):c},hash(c){return c?c.hash:0},strict:!1}),ge=new l.Jq((c,v)=>{if(c.next!=It){c.next<0&&v.context&&c.acceptToken(re);return}c.advance();let Q=c.next==on;Q&&c.advance();let X=zt(c,0);if(X===void 0)return;if(!X)return c.acceptToken(Q?ae:w);let M=v.context?v.context.name:null;if(Q){if(X==M)return c.acceptToken(ne);if(M&&K[M])return c.acceptToken(re,-2);if(v.dialectEnabled(H))return c.acceptToken(me);for(let fe=v.context;fe;fe=fe.parent)if(fe.name==X)return;c.acceptToken(ke)}else{if(X=="script")return c.acceptToken(ce);if(X=="style")return c.acceptToken(N);if(X=="textarea")return c.acceptToken(xe);if(q.hasOwnProperty(X))return c.acceptToken(be);M&&Se[M]&&Se[M][X]?c.acceptToken(re,-1):c.acceptToken(w)}},{contextual:!0}),Te=new l.Jq(c=>{for(let v=0,Q=0;;Q++){if(c.next<0){Q&&c.acceptToken(Ce);break}if(c.next==Ve)v++;else if(c.next==sn&&v>=2){Q>=3&&c.acceptToken(Ce,-2);break}else v=0;c.advance()}});function Ne(c){for(;c;c=c.parent)if(c.name=="svg"||c.name=="math")return!0;return!1}const rt=new l.Jq((c,v)=>{if(c.next==on&&c.peek(1)==sn){let Q=v.dialectEnabled(W)||Ne(v.context);c.acceptToken(Q?te:U,2)}else c.next==sn&&c.acceptToken(U,1)});function Lt(c,v,Q){let X=2+c.length;return new l.Jq(M=>{for(let fe=0,Pe=0,Fe=0;;Fe++){if(M.next<0){Fe&&M.acceptToken(v);break}if(fe==0&&M.next==It||fe==1&&M.next==on||fe>=2&&fePe?M.acceptToken(v,-Pe):M.acceptToken(Q,-(Pe-2));break}else if((M.next==10||M.next==13)&&Fe){M.acceptToken(v,1);break}else fe=Pe=0;M.advance()}})}const Yt=Lt("script",d,a),Bt=Lt("style",S,m),nn=Lt("textarea",x,V),hn=(0,f.Gv)({"Text RawText":f.pJ.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":f.pJ.angleBracket,TagName:f.pJ.tagName,"MismatchedCloseTag/TagName":[f.pJ.tagName,f.pJ.invalid],AttributeName:f.pJ.attributeName,"AttributeValue UnquotedAttributeValue":f.pJ.attributeValue,Is:f.pJ.definitionOperator,"EntityReference CharacterReference":f.pJ.character,Comment:f.pJ.blockComment,ProcessingInst:f.pJ.processingInstruction,DoctypeDecl:f.pJ.documentMeta}),tn=l.WQ.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:oe,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[hn],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Zt=Fe.type.id;if(Zt==Rt)return ze(Fe,pt,Q);if(Zt==Re)return ze(Fe,pt,X);if(Zt==Ie)return ze(Fe,pt,M);if(Zt==Ee&&fe.length){let F=Fe.node,P=F.firstChild,Y=P&&Le(P,pt),he;if(Y){for(let le of fe)if(le.tag==Y&&(!le.attrs||le.attrs(he||(he=gn(F,pt))))){let je=F.lastChild,We=je.type.id==I?je.from:F.to;if(We>P.to)return{parser:le.parser,overlay:[{from:P.to,to:We}]}}}}if(Pe&&Zt==qe){let F=Fe.node,P;if(P=F.firstChild){let Y=Pe[pt.read(P.from,P.to)];if(Y)for(let he of Y){if(he.tagName&&he.tagName!=Le(F.parent,pt))continue;let le=F.lastChild;if(le.type.id==Je){let je=le.from+1,We=le.lastChild,et=le.to-(We&&We.isError?0:1);if(et>je)return{parser:he.parser,overlay:[{from:je,to:et}]}}else if(le.type.id==lt)return{parser:he.parser,overlay:[{from:le.from,to:le.to}]}}}}return null})}var yt=o(70399),Oe=o(84421),Ge=o(30111),it=o(74405),Ye=o(16888);const Pt=["_blank","_self","_top","_parent"],qt=["ascii","utf-8","utf-16","latin1","latin1"],Tt=["get","post","put","delete"],Ht=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gt=["true","false"],xt={},Kt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Pt,hreflang:null}},abbr:xt,address:xt,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xt,aside:xt,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xt,base:{attrs:{href:null,target:Pt}},bdi:xt,bdo:xt,blockquote:{attrs:{cite:null}},body:xt,br:xt,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Ht,formmethod:Tt,formnovalidate:["novalidate"],formtarget:Pt,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xt,center:xt,cite:xt,code:xt,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:xt,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xt,div:xt,dl:xt,dt:xt,em:xt,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xt,figure:xt,footer:xt,form:{attrs:{action:null,name:null,"accept-charset":qt,autocomplete:["on","off"],enctype:Ht,method:Tt,novalidate:["novalidate"],target:Pt}},h1:xt,h2:xt,h3:xt,h4:xt,h5:xt,h6:xt,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xt,hgroup:xt,hr:xt,html:{attrs:{manifest:null}},i:xt,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Ht,formmethod:Tt,formnovalidate:["novalidate"],formtarget:Pt,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:xt,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xt,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:xt,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:qt,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:xt,noscript:xt,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:xt,param:{attrs:{name:null,value:null}},pre:xt,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xt,rt:xt,ruby:xt,samp:xt,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:qt}},section:xt,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xt,source:{attrs:{src:null,type:null,media:null}},span:xt,strong:xt,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xt,summary:xt,sup:xt,table:xt,tbody:xt,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xt,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:xt,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xt,time:{attrs:{datetime:null}},title:xt,tr:xt,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xt,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:xt},Jt={accesskey:null,class:null,contenteditable:Gt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Gt,autocorrect:Gt,autocapitalize:Gt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Gt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gt,"aria-hidden":Gt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gt,"aria-multiselectable":Gt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gt,"aria-relevant":null,"aria-required":Gt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},en="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(c=>"on"+c);for(let c of en)Jt[c]=null;class _t{constructor(v,Q){this.tags=Object.assign(Object.assign({},Kt),v),this.globalAttrs=Object.assign(Object.assign({},Jt),Q),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}_t.default=new _t;function On(c,v,Q=c.length){if(!v)return"";let X=v.firstChild,M=X&&X.getChild("TagName");return M?c.sliceString(M.from,Math.min(M.to,Q)):""}function dn(c,v=!1){for(;c;c=c.parent)if(c.name=="Element")if(v)v=!1;else return c;return null}function Ln(c,v,Q){let X=Q.tags[On(c,dn(v))];return(X==null?void 0:X.children)||Q.allTags}function En(c,v){let Q=[];for(let X=dn(v);X&&!X.type.isTop;X=dn(X.parent)){let M=On(c,X);if(M&&X.lastChild.name=="CloseTag")break;M&&Q.indexOf(M)<0&&(v.name=="EndTag"||v.from>=X.firstChild.to)&&Q.push(M)}return Q}const vn=/^[:\-\.\w\u00b7-\uffff]*$/;function In(c,v,Q,X,M){let fe=/\s*>/.test(c.sliceDoc(M,M+5))?"":">",Pe=dn(Q,!0);return{from:X,to:M,options:Ln(c.doc,Pe,v).map(Fe=>({label:Fe,type:"type"})).concat(En(c.doc,Q).map((Fe,pt)=>({label:"/"+Fe,apply:"/"+Fe+fe,type:"type",boost:99-pt}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Dn(c,v,Q,X){let M=/\s*>/.test(c.sliceDoc(X,X+5))?"":">";return{from:Q,to:X,options:En(c.doc,v).map((fe,Pe)=>({label:fe,apply:fe+M,type:"type",boost:99-Pe})),validFor:vn}}function Jn(c,v,Q,X){let M=[],fe=0;for(let Pe of Ln(c.doc,Q,v))M.push({label:"<"+Pe,type:"type"});for(let Pe of En(c.doc,Q))M.push({label:"",type:"type",boost:99-fe++});return{from:X,to:X,options:M,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function li(c,v,Q,X,M){let fe=dn(Q),Pe=fe?v.tags[On(c.doc,fe)]:null,Fe=Pe&&Pe.attrs?Object.keys(Pe.attrs):[],pt=Pe&&Pe.globalAttrs===!1?Fe:Fe.length?Fe.concat(v.globalAttrNames):v.globalAttrNames;return{from:X,to:M,options:pt.map(Zt=>({label:Zt,type:"property"})),validFor:vn}}function Kn(c,v,Q,X,M){var fe;let Pe=(fe=Q.parent)===null||fe===void 0?void 0:fe.getChild("AttributeName"),Fe=[],pt;if(Pe){let Zt=c.sliceDoc(Pe.from,Pe.to),F=v.globalAttrs[Zt];if(!F){let P=dn(Q),Y=P?v.tags[On(c.doc,P)]:null;F=(Y==null?void 0:Y.attrs)&&Y.attrs[Zt]}if(F){let P=c.sliceDoc(X,M).toLowerCase(),Y='"',he='"';/^['"]/.test(P)?(pt=P[0]=='"'?/^[^"]*$/:/^[^']*$/,Y="",he=c.sliceDoc(M,M+1)==P[0]?"":P[0],P=P.slice(1),X++):pt=/^[^\s<>='"]*$/;for(let le of F)Fe.push({label:le,apply:Y+le+he,type:"constant"})}}return{from:X,to:M,options:Fe,validFor:pt}}function bi(c,v){let{state:Q,pos:X}=v,M=(0,Ye.qz)(Q).resolveInner(X,-1),fe=M.resolve(X);for(let Pe=X,Fe;fe==M&&(Fe=M.childBefore(Pe));){let pt=Fe.lastChild;if(!pt||!pt.type.isError||pt.frombi(X,M)}const di=Oe.javascriptLanguage.parser.configure({top:"SingleExpression"}),ai=[{tag:"script",attrs:c=>c.type=="text/typescript"||c.lang=="ts",parser:Oe.typescriptLanguage.parser},{tag:"script",attrs:c=>c.type=="text/babel"||c.type=="text/jsx",parser:Oe.jsxLanguage.parser},{tag:"script",attrs:c=>c.type=="text/typescript-jsx",parser:Oe.tsxLanguage.parser},{tag:"script",attrs(c){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(c.type)},parser:di},{tag:"script",attrs(c){return!c.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(c.type)},parser:Oe.javascriptLanguage.parser},{tag:"style",attrs(c){return(!c.lang||c.lang=="css")&&(!c.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(c.type))},parser:yt.cssLanguage.parser}],ci=[{name:"style",parser:yt.cssLanguage.parser.configure({top:"Styles"})}].concat(en.map(c=>({name:c,parser:Oe.javascriptLanguage.parser}))),Un=Ye.qp.define({name:"html",parser:tn.configure({props:[Ye.uj.add({Element(c){let v=/^(\s*)(<\/)?/.exec(c.textAfter);return c.node.to<=c.pos+v[0].length?c.continue():c.lineIndent(c.node.from)+(v[2]?0:c.unit)},"OpenTag CloseTag SelfClosingTag"(c){return c.column(c.node.from)+c.unit},Document(c){if(c.pos+/\s*/.exec(c.textAfter)[0].lengthc.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ui=Un.configure({wrap:Ot(ai,ci)});function gi(c={}){let v="",Q;c.matchClosingTags===!1&&(v="noMatch"),c.selfClosingTags===!0&&(v=(v?v+" ":"")+"selfClosing"),(c.nestedLanguages&&c.nestedLanguages.length||c.nestedAttributes&&c.nestedAttributes.length)&&(Q=Ot((c.nestedLanguages||[]).concat(ai),(c.nestedAttributes||[]).concat(ci)));let X=Q?Un.configure({wrap:Q,dialect:v}):v?ui.configure({dialect:v}):ui;return new Ye.ri(X,[ui.data.of({autocomplete:yi(c)}),c.autoCloseTags!==!1?h:[],(0,Oe.javascript)().support,(0,yt.css)().support])}const ue=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),h=Ge.tk.inputHandler.of((c,v,Q,X,M)=>{if(c.composing||c.state.readOnly||v!=Q||X!=">"&&X!="/"||!ui.isActiveAt(c.state,v,-1))return!1;let fe=M(),{state:Pe}=fe,Fe=Pe.changeByRange(pt=>{var Zt,F,P;let Y=Pe.doc.sliceString(pt.from-1,pt.to)==X,{head:he}=pt,le=(0,Ye.qz)(Pe).resolveInner(he-1,-1),je;if((le.name=="TagName"||le.name=="StartTag")&&(le=le.parent),Y&&X==">"&&le.name=="OpenTag"){if(((F=(Zt=le.parent)===null||Zt===void 0?void 0:Zt.lastChild)===null||F===void 0?void 0:F.name)!="CloseTag"&&(je=On(Pe.doc,le.parent,he))&&!ue.has(je)){let We=he+(Pe.doc.sliceString(he,he+1)===">"?1:0),et=``;return{range:pt,changes:{from:he,to:We,insert:et}}}}else if(Y&&X=="/"&&le.name=="IncompleteCloseTag"){let We=le.parent;if(le.from==he-2&&((P=We.lastChild)===null||P===void 0?void 0:P.name)!="CloseTag"&&(je=On(Pe.doc,We,he))&&!ue.has(je)){let et=he+(Pe.doc.sliceString(he,he+1)===">"?1:0),at=`${je}>`;return{range:it.jT.cursor(he+at.length,-1),changes:{from:he,to:et,insert:at}}}}return{range:pt}});return Fe.changes.empty?!1:(c.dispatch([fe,Pe.update(Fe,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})},84421:function(Xe,ye,o){"use strict";o.r(ye),o.d(ye,{autoCloseTags:function(){return Le},completionPath:function(){return Ve},esLint:function(){return ze},javascript:function(){return nn},javascriptLanguage:function(){return oe},jsxLanguage:function(){return Ne},localCompletionSource:function(){return Xt},scopeCompletionSource:function(){return D},snippets:function(){return Se},tsxLanguage:function(){return rt},typescriptLanguage:function(){return Te},typescriptSnippets:function(){return Ke}});var l=o(11705),f=o(79653);const p=309,d=1,a=2,S=3,m=310,x=312,V=313,U=4,te=5,w=0,ce=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],N=125,xe=59,be=47,ne=42,me=43,ke=45,re=60,ae=44,Ce=new l.IK({start:!1,shift(Oe,Ge){return Ge==U||Ge==te||Ge==x?Oe:Ge==V},strict:!1}),Ee=new l.Jq((Oe,Ge)=>{let{next:it}=Oe;(it==N||it==-1||Ge.context)&&Oe.acceptToken(m)},{contextual:!0,fallback:!0}),nt=new l.Jq((Oe,Ge)=>{let{next:it}=Oe,Ye;ce.indexOf(it)>-1||it==be&&((Ye=Oe.peek(1))==be||Ye==ne)||it!=N&&it!=xe&&it!=-1&&!Ge.context&&Oe.acceptToken(p)},{contextual:!0}),qe=new l.Jq((Oe,Ge)=>{let{next:it}=Oe;if((it==me||it==ke)&&(Oe.advance(),it==Oe.next)){Oe.advance();let Ye=!Ge.context&&Ge.canShift(d);Oe.acceptToken(Ye?d:a)}},{contextual:!0});function dt(Oe,Ge){return Oe>=65&&Oe<=90||Oe>=97&&Oe<=122||Oe==95||Oe>=192||!Ge&&Oe>=48&&Oe<=57}const Je=new l.Jq((Oe,Ge)=>{if(Oe.next!=re||!Ge.dialectEnabled(w)||(Oe.advance(),Oe.next==be))return;let it=0;for(;ce.indexOf(Oe.next)>-1;)Oe.advance(),it++;if(dt(Oe.next,!0)){for(Oe.advance(),it++;dt(Oe.next,!1);)Oe.advance(),it++;for(;ce.indexOf(Oe.next)>-1;)Oe.advance(),it++;if(Oe.next==ae)return;for(let Ye=0;;Ye++){if(Ye==7){if(!dt(Oe.next,!0))return;break}if(Oe.next!="extends".charCodeAt(Ye))break;Oe.advance(),it++}}Oe.acceptToken(S,-it)}),lt=(0,f.Gv)({"get set async static":f.pJ.modifier,"for while do if else switch try catch finally return throw break continue default case":f.pJ.controlKeyword,"in of await yield void typeof delete instanceof":f.pJ.operatorKeyword,"let var const using function class extends":f.pJ.definitionKeyword,"import export from":f.pJ.moduleKeyword,"with debugger as new":f.pJ.keyword,TemplateString:f.pJ.special(f.pJ.string),super:f.pJ.atom,BooleanLiteral:f.pJ.bool,this:f.pJ.self,null:f.pJ.null,Star:f.pJ.modifier,VariableName:f.pJ.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":f.pJ.function(f.pJ.variableName),VariableDefinition:f.pJ.definition(f.pJ.variableName),Label:f.pJ.labelName,PropertyName:f.pJ.propertyName,PrivatePropertyName:f.pJ.special(f.pJ.propertyName),"CallExpression/MemberExpression/PropertyName":f.pJ.function(f.pJ.propertyName),"FunctionDeclaration/VariableDefinition":f.pJ.function(f.pJ.definition(f.pJ.variableName)),"ClassDeclaration/VariableDefinition":f.pJ.definition(f.pJ.className),PropertyDefinition:f.pJ.definition(f.pJ.propertyName),PrivatePropertyDefinition:f.pJ.definition(f.pJ.special(f.pJ.propertyName)),UpdateOp:f.pJ.updateOperator,"LineComment Hashbang":f.pJ.lineComment,BlockComment:f.pJ.blockComment,Number:f.pJ.number,String:f.pJ.string,Escape:f.pJ.escape,ArithOp:f.pJ.arithmeticOperator,LogicOp:f.pJ.logicOperator,BitOp:f.pJ.bitwiseOperator,CompareOp:f.pJ.compareOperator,RegExp:f.pJ.regexp,Equals:f.pJ.definitionOperator,Arrow:f.pJ.function(f.pJ.punctuation),": Spread":f.pJ.punctuation,"( )":f.pJ.paren,"[ ]":f.pJ.squareBracket,"{ }":f.pJ.brace,"InterpolationStart InterpolationEnd":f.pJ.special(f.pJ.brace),".":f.pJ.derefOperator,", ;":f.pJ.separator,"@":f.pJ.meta,TypeName:f.pJ.typeName,TypeDefinition:f.pJ.definition(f.pJ.typeName),"type enum interface implements namespace module declare":f.pJ.definitionKeyword,"abstract global Privacy readonly override":f.pJ.modifier,"is keyof unique infer":f.pJ.operatorKeyword,JSXAttributeValue:f.pJ.attributeValue,JSXText:f.pJ.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":f.pJ.angleBracket,"JSXIdentifier JSXNameSpacedName":f.pJ.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":f.pJ.attributeName,"JSXBuiltin/JSXIdentifier":f.pJ.standard(f.pJ.tagName)}),Rt={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Re={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Ie={__proto__:null,"<":143},$=l.WQ.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EjQ08SO1G0{O#>wQ08SO1G0{O#@uQ08SO1G0{O#CuQ(CYO'#ChO#EsQ(CYO1G1^O#EzQ(CYO'#JjO!,lQWO1G1dO#F[Q08SO,5?TOOQ07`-EkQWO1G3lO$2dQ^O1G3nO$6hQ^O'#HmOOQU1G3q1G3qO$6uQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6}Q^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;UQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;ZQ(CYO,5:UOOQO,5;[,5;[O$;eQ`O'#I^O$;{QWO,5@WOOQ07b1G/o1G/oO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$PQrO1G4cOOQO1G4i1G4iO%[Q^O,5>wO$>ZQWO1G5qO$>cQWO1G6OO$>kQrO1G6PO9ZQWO,5>}O$>uQ08SO1G5|O%[Q^O1G5|O$?VQ07hO1G5|O$?hQWO1G5{O$?hQWO1G5{O9ZQWO1G5{O$?pQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@UQWO,5?QO$'ZQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7dQWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7iQ`O1G5sO%7}Q(CYO1G0vO%8XQWO1G0vOOQO1G/p1G/pO%8dQ(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=mQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8nQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8yQ07hO7+&TO%9XQ08SO7++hO%[Q^O7++hO%9iQWO7++gO%9iQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9qQWO1G4lOOQO7+%|7+%|O#%sQWO<zQ08SO1G2ZO%A]Q08SO1G2mO%ChQ08SO1G2oO%EsQ7[O,5>yOOQO-E<]-E<]O%E}QrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FXQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5oQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5tQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&sQWO<}AN>}O%[Q^OAN?ZOOQO<qQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@gQrO'#JiO!*fQ^O'#DqO'@nQ^O'#D}O'@uQrO'#ChO'C]QrO'#ChO!*fQ^O'#EPO'CmQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EpQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Ce,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[lt],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Rt[Oe]||-1},{term:334,get:Oe=>Re[Oe]||-1},{term:70,get:Oe=>Ie[Oe]||-1}],tokenPrec:14638});var I=o(16888),H=o(74405),W=o(30111),q=o(1065),K=o(72104);const Se=[(0,q.Gn)("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),(0,q.Gn)("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),(0,q.Gn)("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),(0,q.Gn)("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),(0,q.Gn)("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),(0,q.Gn)(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),(0,q.Gn)("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),(0,q.Gn)(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),(0,q.Gn)(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),(0,q.Gn)('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),(0,q.Gn)('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Ke=Se.concat([(0,q.Gn)("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),(0,q.Gn)("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),(0,q.Gn)("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),ot=new K.hr,mt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function ut(Oe){return(Ge,it)=>{let Ye=Ge.node.getChild("VariableDefinition");return Ye&&it(Ye,Oe),!0}}const Vt=["FunctionDeclaration"],zt={FunctionDeclaration:ut("function"),ClassDeclaration:ut("class"),ClassExpression:()=>!0,EnumDeclaration:ut("constant"),TypeAliasDeclaration:ut("type"),NamespaceDeclaration:ut("namespace"),VariableDefinition(Oe,Ge){Oe.matchContext(Vt)||Ge(Oe,"variable")},TypeDefinition(Oe,Ge){Ge(Oe,"type")},__proto__:null};function It(Oe,Ge){let it=ot.get(Ge);if(it)return it;let Ye=[],Pt=!0;function qt(Tt,Ht){let Gt=Oe.sliceString(Tt.from,Tt.to);Ye.push({label:Gt,type:Ht})}return Ge.cursor(K.vj.IncludeAnonymous).iterate(Tt=>{if(Pt)Pt=!1;else if(Tt.name){let Ht=zt[Tt.name];if(Ht&&Ht(Tt,qt)||mt.has(Tt.name))return!1}else if(Tt.to-Tt.from>8192){for(let Ht of It(Oe,Tt.node))Ye.push(Ht);return!1}}),ot.set(Ge,Ye),Ye}const sn=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,on=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Xt(Oe){let Ge=(0,I.qz)(Oe.state).resolveInner(Oe.pos,-1);if(on.indexOf(Ge.name)>-1)return null;let it=Ge.name=="VariableName"||Ge.to-Ge.from<20&&sn.test(Oe.state.sliceDoc(Ge.from,Ge.to));if(!it&&!Oe.explicit)return null;let Ye=[];for(let Pt=Ge;Pt;Pt=Pt.parent)mt.has(Pt.name)&&(Ye=Ye.concat(It(Oe.state.doc,Pt)));return{options:Ye,from:it?Ge.from:Oe.pos,validFor:sn}}function $t(Oe,Ge,it){var Ye;let Pt=[];for(;;){let qt=Ge.firstChild,Tt;if((qt==null?void 0:qt.name)=="VariableName")return Pt.push(Oe(qt)),{path:Pt.reverse(),name:it};if((qt==null?void 0:qt.name)=="MemberExpression"&&((Ye=Tt=qt.lastChild)===null||Ye===void 0?void 0:Ye.name)=="PropertyName")Pt.push(Oe(Tt)),Ge=qt;else return null}}function Ve(Oe){let Ge=Ye=>Oe.state.doc.sliceString(Ye.from,Ye.to),it=(0,I.qz)(Oe.state).resolveInner(Oe.pos,-1);return it.name=="PropertyName"?$t(Ge,it.parent,Ge(it)):(it.name=="."||it.name=="?.")&&it.parent.name=="MemberExpression"?$t(Ge,it.parent,""):on.indexOf(it.name)>-1?null:it.name=="VariableName"||it.to-it.from<20&&sn.test(Ge(it))?{path:[],name:Ge(it)}:it.name=="MemberExpression"?$t(Ge,it,""):Oe.explicit?{path:[],name:""}:null}function A(Oe,Ge){let it=[],Ye=new Set;for(let Pt=0;;Pt++){for(let Tt of(Object.getOwnPropertyNames||Object.keys)(Oe)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(Tt)||Ye.has(Tt))continue;Ye.add(Tt);let Ht;try{Ht=Oe[Tt]}catch(Gt){continue}it.push({label:Tt,type:typeof Ht=="function"?/^[A-Z]/.test(Tt)?"class":Ge?"function":"method":Ge?"variable":"property",boost:-Pt})}let qt=Object.getPrototypeOf(Oe);if(!qt)return it;Oe=qt}}function D(Oe){let Ge=new Map;return it=>{let Ye=Ve(it);if(!Ye)return null;let Pt=Oe;for(let Tt of Ye.path)if(Pt=Pt[Tt],!Pt)return null;let qt=Ge.get(Pt);return qt||Ge.set(Pt,qt=A(Pt,!Ye.path.length)),{from:it.pos-Ye.name.length,options:qt,validFor:sn}}}const oe=I.qp.define({name:"javascript",parser:$.configure({props:[I.uj.add({IfStatement:(0,I.tC)({except:/^\s*({|else\b)/}),TryStatement:(0,I.tC)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:I.ze,SwitchBody:Oe=>{let Ge=Oe.textAfter,it=/^\s*\}/.test(Ge),Ye=/^\s*(case|default)\b/.test(Ge);return Oe.baseIndent+(it?0:Ye?1:2)*Oe.unit},Block:(0,I.vw)({closing:"}"}),ArrowFunction:Oe=>Oe.baseIndent+Oe.unit,"TemplateString BlockComment":()=>null,"Statement Property":(0,I.tC)({except:/^{/}),JSXElement(Oe){let Ge=/^\s*<\//.test(Oe.textAfter);return Oe.lineIndent(Oe.node.from)+(Ge?0:Oe.unit)},JSXEscape(Oe){let Ge=/\s*\}/.test(Oe.textAfter);return Oe.lineIndent(Oe.node.from)+(Ge?0:Oe.unit)},"JSXOpenTag JSXSelfClosingTag"(Oe){return Oe.column(Oe.node.from)+Oe.unit}}),I.x0.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":I.Dv,BlockComment(Oe){return{from:Oe.from+2,to:Oe.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ge={test:Oe=>/^JSX/.test(Oe.name),facet:(0,I.kU)({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Te=oe.configure({dialect:"ts"},"typescript"),Ne=oe.configure({dialect:"jsx",props:[I.KC.add(Oe=>Oe.isTop?[ge]:void 0)]}),rt=oe.configure({dialect:"jsx ts",props:[I.KC.add(Oe=>Oe.isTop?[ge]:void 0)]},"typescript");let Lt=Oe=>({label:Oe,type:"keyword"});const Yt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Lt),Bt=Yt.concat(["declare","implements","private","protected","public"].map(Lt));function nn(Oe={}){let Ge=Oe.jsx?Oe.typescript?rt:Ne:Oe.typescript?Te:oe,it=Oe.typescript?Ke.concat(Bt):Se.concat(Yt);return new I.ri(Ge,[oe.data.of({autocomplete:(0,q.eC)(on,(0,q.Mb)(it))}),oe.data.of({autocomplete:Xt}),Oe.jsx?Le:[]])}function hn(Oe){for(;;){if(Oe.name=="JSXOpenTag"||Oe.name=="JSXSelfClosingTag"||Oe.name=="JSXFragmentTag")return Oe;if(Oe.name=="JSXEscape"||!Oe.parent)return null;Oe=Oe.parent}}function tn(Oe,Ge,it=Oe.length){for(let Ye=Ge==null?void 0:Ge.firstChild;Ye;Ye=Ye.nextSibling)if(Ye.name=="JSXIdentifier"||Ye.name=="JSXBuiltin"||Ye.name=="JSXNamespacedName"||Ye.name=="JSXMemberExpression")return Oe.sliceString(Ye.from,Math.min(Ye.to,it));return""}const gn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Le=W.tk.inputHandler.of((Oe,Ge,it,Ye,Pt)=>{if((gn?Oe.composing:Oe.compositionStarted)||Oe.state.readOnly||Ge!=it||Ye!=">"&&Ye!="/"||!oe.isActiveAt(Oe.state,Ge,-1))return!1;let qt=Pt(),{state:Tt}=qt,Ht=Tt.changeByRange(Gt=>{var xt;let{head:Kt}=Gt,Jt=(0,I.qz)(Tt).resolveInner(Kt-1,-1),en;if(Jt.name=="JSXStartTag"&&(Jt=Jt.parent),!(Tt.doc.sliceString(Kt-1,Kt)!=Ye||Jt.name=="JSXAttributeValue"&&Jt.to>Kt)){if(Ye==">"&&Jt.name=="JSXFragmentTag")return{range:Gt,changes:{from:Kt,insert:""}};if(Ye=="/"&&Jt.name=="JSXStartCloseTag"){let _t=Jt.parent,On=_t.parent;if(On&&_t.from==Kt-2&&((en=tn(Tt.doc,On.firstChild,Kt))||((xt=On.firstChild)===null||xt===void 0?void 0:xt.name)=="JSXFragmentTag")){let dn=`${en}>`;return{range:H.jT.cursor(Kt+dn.length,-1),changes:{from:Kt,insert:dn}}}}else if(Ye==">"){let _t=hn(Jt);if(_t&&_t.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(Tt.doc.sliceString(Kt,Kt+2))&&(en=tn(Tt.doc,_t,Kt)))return{range:Gt,changes:{from:Kt,insert:``}}}}return{range:Gt}});return Ht.changes.empty?!1:(Oe.dispatch([qt,Tt.update(Ht,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function ze(Oe,Ge){return Ge||(Ge={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},Oe.getRules().forEach((it,Ye)=>{it.meta.docs.recommended&&(Ge.rules[Ye]=2)})),it=>{let{state:Ye}=it,Pt=[];for(let{from:qt,to:Tt}of oe.findRegions(Ye)){let Ht=Ye.doc.lineAt(qt),Gt={line:Ht.number-1,col:qt-Ht.from,pos:qt};for(let xt of Oe.verify(Ye.sliceDoc(qt,Tt),Ge))Pt.push(yt(xt,Ye.doc,Gt))}return Pt}}function Ot(Oe,Ge,it,Ye){return it.line(Oe+Ye.line).from+Ge+(Oe==1?Ye.col-1:-1)}function yt(Oe,Ge,it){let Ye=Ot(Oe.line,Oe.column,Ge,it),Pt={from:Ye,to:Oe.endLine!=null&&Oe.endColumn!=1?Ot(Oe.endLine,Oe.endColumn,Ge,it):Ye,message:Oe.message,source:Oe.ruleId?"eslint:"+Oe.ruleId:"eslint",severity:Oe.severity==1?"warning":"error"};if(Oe.fix){let{range:qt,text:Tt}=Oe.fix,Ht=qt[0]+it.pos-Ye,Gt=qt[1]+it.pos-Ye;Pt.actions=[{name:"fix",apply(xt,Kt){xt.dispatch({changes:{from:Kt+Ht,to:Kt+Gt,insert:Tt},scrollIntoView:!0})}}]}return Pt}},67958:function(Xe,ye,o){"use strict";o.r(ye),o.d(ye,{commonmarkLanguage:function(){return ue},deleteMarkupBackward:function(){return Y},insertNewlineContinueMarkup:function(){return Fe},markdown:function(){return je},markdownKeymap:function(){return he},markdownLanguage:function(){return c}});var l=o(74405),f=o(30111),p=o(16888),d=o(1065),a=o(72104),S=o(79653);class m{static create(g,C,j,ee,Ae){let _e=ee+(ee<<8)+g+(C<<4)|0;return new m(g,C,j,_e,Ae,[],[])}constructor(g,C,j,ee,Ae,_e,st){this.type=g,this.value=C,this.from=j,this.hash=ee,this.end=Ae,this.children=_e,this.positions=st,this.hashProp=[[a.md.contextHash,ee]]}addChild(g,C){g.prop(a.md.contextHash)!=this.hash&&(g=new a.mp(g.type,g.children,g.positions,g.length,this.hashProp)),this.children.push(g),this.positions.push(C)}toTree(g,C=this.end){let j=this.children.length-1;return j>=0&&(C=Math.max(C,this.positions[j]+this.children[j].length+this.from)),new a.mp(g.types[this.type],this.children,this.positions,C-this.from).balance({makeTree:(ee,Ae,_e)=>new a.mp(a.Jq.none,ee,Ae,_e,this.hashProp)})}}var x;(function(O){O[O.Document=1]="Document",O[O.CodeBlock=2]="CodeBlock",O[O.FencedCode=3]="FencedCode",O[O.Blockquote=4]="Blockquote",O[O.HorizontalRule=5]="HorizontalRule",O[O.BulletList=6]="BulletList",O[O.OrderedList=7]="OrderedList",O[O.ListItem=8]="ListItem",O[O.ATXHeading1=9]="ATXHeading1",O[O.ATXHeading2=10]="ATXHeading2",O[O.ATXHeading3=11]="ATXHeading3",O[O.ATXHeading4=12]="ATXHeading4",O[O.ATXHeading5=13]="ATXHeading5",O[O.ATXHeading6=14]="ATXHeading6",O[O.SetextHeading1=15]="SetextHeading1",O[O.SetextHeading2=16]="SetextHeading2",O[O.HTMLBlock=17]="HTMLBlock",O[O.LinkReference=18]="LinkReference",O[O.Paragraph=19]="Paragraph",O[O.CommentBlock=20]="CommentBlock",O[O.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",O[O.Escape=22]="Escape",O[O.Entity=23]="Entity",O[O.HardBreak=24]="HardBreak",O[O.Emphasis=25]="Emphasis",O[O.StrongEmphasis=26]="StrongEmphasis",O[O.Link=27]="Link",O[O.Image=28]="Image",O[O.InlineCode=29]="InlineCode",O[O.HTMLTag=30]="HTMLTag",O[O.Comment=31]="Comment",O[O.ProcessingInstruction=32]="ProcessingInstruction",O[O.Autolink=33]="Autolink",O[O.HeaderMark=34]="HeaderMark",O[O.QuoteMark=35]="QuoteMark",O[O.ListMark=36]="ListMark",O[O.LinkMark=37]="LinkMark",O[O.EmphasisMark=38]="EmphasisMark",O[O.CodeMark=39]="CodeMark",O[O.CodeText=40]="CodeText",O[O.CodeInfo=41]="CodeInfo",O[O.LinkTitle=42]="LinkTitle",O[O.LinkLabel=43]="LinkLabel",O[O.URL=44]="URL"})(x||(x={}));class V{constructor(g,C){this.start=g,this.content=C,this.marks=[],this.parsers=[]}}class U{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let g=this.skipSpace(this.basePos);this.indent=this.countIndent(g,this.pos,this.indent),this.pos=g,this.next=g==this.text.length?-1:this.text.charCodeAt(g)}skipSpace(g){return N(this.text,g)}reset(g){for(this.text=g,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(g){this.basePos=g,this.baseIndent=this.countIndent(g,this.pos,this.indent)}moveBaseColumn(g){this.baseIndent=g,this.basePos=this.findColumn(g)}addMarker(g){this.markers.push(g)}countIndent(g,C=0,j=0){for(let ee=C;ee=g.stack[C.depth+1].value+C.baseIndent)return!0;if(C.indent>=C.baseIndent+4)return!1;let j=(O.type==x.OrderedList?ae:re)(C,g,!1);return j>0&&(O.type!=x.BulletList||me(C,g,!1)<0)&&C.text.charCodeAt(C.pos+j-1)==O.value}const w={[x.Blockquote](O,g,C){return C.next!=62?!1:(C.markers.push($t(x.QuoteMark,g.lineStart+C.pos,g.lineStart+C.pos+1)),C.moveBase(C.pos+(ce(C.text.charCodeAt(C.pos+1))?2:1)),O.end=g.lineStart+C.text.length,!0)},[x.ListItem](O,g,C){return C.indent-1?!1:(C.moveBaseColumn(C.baseIndent+O.value),!0)},[x.OrderedList]:te,[x.BulletList]:te,[x.Document](){return!0}};function ce(O){return O==32||O==9||O==10||O==13}function N(O,g=0){for(;gC&&ce(O.charCodeAt(g-1));)g--;return g}function be(O){if(O.next!=96&&O.next!=126)return-1;let g=O.pos+1;for(;g-1&&O.depth==g.stack.length||j<3?-1:1}function ke(O,g){for(let C=O.stack.length-1;C>=0;C--)if(O.stack[C].type==g)return!0;return!1}function re(O,g,C){return(O.next==45||O.next==43||O.next==42)&&(O.pos==O.text.length-1||ce(O.text.charCodeAt(O.pos+1)))&&(!C||ke(g,x.BulletList)||O.skipSpace(O.pos+2)=48&&ee<=57;){j++;if(j==O.text.length)return-1;ee=O.text.charCodeAt(j)}return j==O.pos||j>O.pos+9||ee!=46&&ee!=41||jO.pos+1||O.next!=49)?-1:j+1-O.pos}function Ce(O){if(O.next!=35)return-1;let g=O.pos+1;for(;g6?-1:C}function Ee(O){if(O.next!=45&&O.next!=61||O.indent>=O.baseIndent+4)return-1;let g=O.pos+1;for(;g/,dt=/\?>/,Je=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(j);if(Ae)return O.append($t(x.Comment,C,C+1+Ae[0].length));let _e=/^\?[^]*?\?>/.exec(j);if(_e)return O.append($t(x.ProcessingInstruction,C,C+1+_e[0].length));let st=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(j);return st?O.append($t(x.HTMLTag,C,C+1+st[0].length)):-1},Emphasis(O,g,C){if(g!=95&&g!=42)return-1;let j=C+1;for(;O.char(j)==g;)j++;let ee=O.slice(C-1,C),Ae=O.slice(j,j+1),_e=Ne.test(ee),st=Ne.test(Ae),ht=/\s|^$/.test(ee),kt=/\s|^$/.test(Ae),Dt=!kt&&(!st||ht||_e),un=!ht&&(!_e||kt||st),Ft=Dt&&(g==42||!un||_e),$n=un&&(g==42||!Dt||st);return O.append(new ge(g==95?Ve:A,C,j,(Ft?1:0)|($n?2:0)))},HardBreak(O,g,C){if(g==92&&O.char(C+1)==10)return O.append($t(x.HardBreak,C,C+2));if(g==32){let j=C+1;for(;O.char(j)==32;)j++;if(O.char(j)==10&&j>=C+2)return O.append($t(x.HardBreak,C,j+1))}return-1},Link(O,g,C){return g==91?O.append(new ge(D,C,C+1,1)):-1},Image(O,g,C){return g==33&&O.char(C+1)==91?O.append(new ge(oe,C,C+2,1)):-1},LinkEnd(O,g,C){if(g!=93)return-1;for(let j=O.parts.length-1;j>=0;j--){let ee=O.parts[j];if(ee instanceof ge&&(ee.type==D||ee.type==oe)){if(!ee.side||O.skipSpace(ee.to)==C&&!/[(\[]/.test(O.slice(C+1,C+2)))return O.parts[j]=null,-1;let Ae=O.takeContent(j),_e=O.parts[j]=Lt(O,Ae,ee.type==D?x.Link:x.Image,ee.from,C+1);if(ee.type==D)for(let st=0;stg?$t(x.URL,g+C,Ae+C):Ae==O.length?null:!1}}function Bt(O,g,C){let j=O.charCodeAt(g);if(j!=39&&j!=34&&j!=40)return!1;let ee=j==40?41:j;for(let Ae=g+1,_e=!1;Ae=this.end?-1:this.text.charCodeAt(g-this.offset)}get end(){return this.offset+this.text.length}slice(g,C){return this.text.slice(g-this.offset,C-this.offset)}append(g){return this.parts.push(g),g.to}addDelimiter(g,C,j,ee,Ae){return this.append(new ge(g,C,j,(ee?1:0)|(Ae?2:0)))}addElement(g){return this.append(g)}resolveMarkers(g){for(let j=g;j=g;ht--){let Mn=this.parts[ht];if(Mn instanceof ge&&Mn.side&1&&Mn.type==ee.type&&!(Ae&&(ee.side&1||Mn.side&2)&&(Mn.to-Mn.from+_e)%3==0&&((Mn.to-Mn.from)%3||_e%3))){st=Mn;break}}if(!st)continue;let kt=ee.type.resolve,Dt=[],un=st.from,Ft=ee.to;if(Ae){let Mn=Math.min(2,st.to-st.from,_e);un=st.to-Mn,Ft=ee.from+Mn,kt=Mn==1?"Emphasis":"StrongEmphasis"}st.type.mark&&Dt.push(this.elt(st.type.mark,un,st.to));for(let Mn=ht+1;Mn=0;C--){let j=this.parts[C];if(j instanceof ge&&j.type==g)return C}return null}takeContent(g){let C=this.resolveMarkers(g);return this.parts.length=g,C}skipSpace(g){return N(this.text,g-this.offset)+this.offset}elt(g,C,j,ee){return typeof g=="string"?$t(this.parser.getNodeType(g),C,j,ee):new Xt(g,C)}}function tn(O,g){if(!g.length)return O;if(!O.length)return g;let C=O.slice(),j=0;for(let ee of g){for(;j(g?g-1:0))return!1;if(this.fragmentEnd<0){let Ae=this.fragment.to;for(;Ae>0&&this.input.read(Ae-1,Ae)!=` `;)Ae--;this.fragmentEnd=Ae?Ae-1:0}let j=this.cursor;j||(j=this.cursor=this.fragment.tree.cursor(),j.firstChild());let ee=g+this.fragment.offset;for(;j.to<=ee;)if(!j.parent())return!1;for(;;){if(j.from>=ee)return this.fragment.from<=C;if(!j.childAfter(ee))return!1}}matches(g){let C=this.cursor.tree;return C&&C.prop(a.md.contextHash)==g}takeNodes(g){let C=this.cursor,j=this.fragment.offset,ee=this.fragmentEnd-(this.fragment.openEnd?1:0),Ae=g.absoluteLineStart,_e=Ae,st=g.block.children.length,ht=_e,kt=st;for(;;){if(C.to-j>ee){if(C.type.isAnonymous&&C.firstChild())continue;break}let Dt=ze(C.from-j,g.ranges);if(C.to-j<=g.ranges[g.rangeI].to)g.addNode(C.tree,Dt);else{let un=new a.mp(g.parser.nodeSet.types[x.Paragraph],[],[],0,g.block.hashProp);g.reusePlaceholders.set(un,C.tree),g.addNode(un,Dt)}if(C.type.is("Block")&&(gn.indexOf(C.type.id)<0?(_e=C.to-j,st=g.block.children.length):(_e=ht,st=kt,ht=C.to-j,kt=g.block.children.length)),!C.nextSibling())break}for(;g.block.children.length>st;)g.block.children.pop(),g.block.positions.pop();return _e-Ae}}function ze(O,g){let C=O;for(let j=1;jIe[O]),Object.keys(Ie).map(O=>W[O]),Object.keys(Ie),q,w,Object.keys(rt).map(O=>rt[O]),Object.keys(rt),[]);function Oe(O,g,C){let j=[];for(let ee=O.firstChild,Ae=g;;ee=ee.nextSibling){let _e=ee?ee.from:C;if(_e>Ae&&j.push({from:Ae,to:_e}),!ee)break;Ae=ee.to}return j}function Ge(O){let{codeParser:g,htmlParser:C}=O;return{wrap:(0,a.FE)((ee,Ae)=>{let _e=ee.type.id;if(g&&(_e==x.CodeBlock||_e==x.FencedCode)){let st="";if(_e==x.FencedCode){let kt=ee.node.getChild(x.CodeInfo);kt&&(st=Ae.read(kt.from,kt.to))}let ht=g(st);if(ht)return{parser:ht,overlay:kt=>kt.type.id==x.CodeText}}else if(C&&(_e==x.HTMLBlock||_e==x.HTMLTag))return{parser:C,overlay:Oe(ee.node,ee.from,ee.to)};return null})}}const it={resolve:"Strikethrough",mark:"StrikethroughMark"},Ye={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":S.pJ.strikethrough}},{name:"StrikethroughMark",style:S.pJ.processingInstruction}],parseInline:[{name:"Strikethrough",parse(O,g,C){if(g!=126||O.char(C+1)!=126||O.char(C+2)==126)return-1;let j=O.slice(C-1,C),ee=O.slice(C+2,C+3),Ae=/\s|^$/.test(j),_e=/\s|^$/.test(ee),st=Ne.test(j),ht=Ne.test(ee);return O.addDelimiter(it,C,C+2,!_e&&(!ht||Ae||st),!Ae&&(!st||_e||ht))},after:"Emphasis"}]};function Pt(O,g,C=0,j,ee=0){let Ae=0,_e=!0,st=-1,ht=-1,kt=!1,Dt=()=>{j.push(O.elt("TableCell",ee+st,ee+ht,O.parser.parseInline(g.slice(st,ht),ee+st)))};for(let un=C;un-1)&&Ae++,_e=!1,j&&(st>-1&&Dt(),j.push(O.elt("TableDelimiter",un+ee,un+ee+1))),st=ht=-1):(kt||Ft!=32&&Ft!=9)&&(st<0&&(st=un),ht=un+1),kt=!kt&&Ft==92}return st>-1&&(Ae++,j&&Dt()),Ae}function qt(O,g){for(let C=g;Cee instanceof Ht)||!qt(g.text,g.basePos))return!1;let j=O.scanLine(O.absoluteLineEnd+1).text;return Tt.test(j)&&Pt(O,g.text,g.basePos)==Pt(O,j,g.basePos)},before:"SetextHeading"}]};class xt{nextLine(){return!1}finish(g,C){return g.addLeafElement(C,g.elt("Task",C.start,C.start+C.content.length,[g.elt("TaskMarker",C.start,C.start+3),...g.parser.parseInline(C.content.slice(3),C.start+3)])),!0}}const Kt={defineNodes:[{name:"Task",block:!0,style:S.pJ.list},{name:"TaskMarker",style:S.pJ.atom}],parseBlock:[{name:"TaskList",leaf(O,g){return/^\[[ xX]\][ \t]/.test(g.content)&&O.parentType().name=="ListItem"?new xt:null},after:"SetextHeading"}]},Jt=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,en=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,_t=/[\w-]+\.[\w-]+($|\/)/,On=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,dn=/\/[a-zA-Z\d@.]+/gy;function Ln(O,g,C,j){let ee=0;for(let Ae=g;Ae-1)return-1;let j=g+C[0].length;for(;;){let ee=O[j-1],Ae;if(/[?!.,:*_~]/.test(ee)||ee==")"&&Ln(O,g,j,")")>Ln(O,g,j,"("))j--;else if(ee==";"&&(Ae=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(O.slice(g,j))))j=g+Ae.index;else break}return j}function vn(O,g){On.lastIndex=g;let C=On.exec(O);if(!C)return-1;let j=C[0][C[0].length-1];return j=="_"||j=="-"?-1:g+C[0].length-(j=="."?1:0)}const Dn=[Gt,Kt,Ye,{parseInline:[{name:"Autolink",parse(O,g,C){let j=C-O.offset;Jt.lastIndex=j;let ee=Jt.exec(O.text),Ae=-1;return!ee||(ee[1]||ee[2]?Ae=En(O.text,j+ee[0].length):ee[3]?Ae=vn(O.text,j):(Ae=vn(O.text,j+ee[0].length),Ae>-1&&ee[0]=="xmpp:"&&(dn.lastIndex=Ae,ee=dn.exec(O.text),ee&&(Ae=ee.index+ee[0].length))),Ae<0)?-1:(O.addElement(O.elt("URL",C,Ae+O.offset)),Ae+O.offset)}}]}];function Jn(O,g,C){return(j,ee,Ae)=>{if(ee!=O||j.char(Ae+1)==O)return-1;let _e=[j.elt(C,Ae,Ae+1)];for(let st=Ae+1;st"}}}),di=new a.md,ai=yt.configure({props:[p.x0.add(O=>!O.is("Block")||O.is("Document")||ci(O)!=null?void 0:(g,C)=>({from:C.doc.lineAt(g.from).to,to:g.to})),di.add(ci),p.uj.add({Document:()=>null}),p.pp.add({Document:yi})]});function ci(O){let g=/^(?:ATX|Setext)Heading(\d)$/.exec(O.name);return g?+g[1]:void 0}function Un(O,g){let C=O;for(;;){let j=C.nextSibling,ee;if(!j||(ee=ci(j.type))!=null&&ee<=g)break;C=j}return C.to}const ui=p.rs.of((O,g,C)=>{for(let j=(0,p.qz)(O).resolveInner(C,-1);j&&!(j.fromC)return{from:C,to:Ae}}return null});function gi(O){return new p.SQ(yi,O,[ui],"markdown")}const ue=gi(ai),c=gi(ai.configure([Dn,Kn,li,bi,{props:[p.x0.add({Table:(O,g)=>({from:g.doc.lineAt(O.from).to,to:O.to})})]}]));function v(O,g){return C=>{if(C&&O){let j=null;if(C=/\S*/.exec(C)[0],typeof O=="function"?j=O(C):j=p.c6.matchLanguageName(O,C,!0),j instanceof p.c6)return j.support?j.support.language.parser:p.Be.getSkippingParser(j.load());if(j)return j.parser}return g?g.parser:null}}class Q{constructor(g,C,j,ee,Ae,_e,st){this.node=g,this.from=C,this.to=j,this.spaceBefore=ee,this.spaceAfter=Ae,this.type=_e,this.item=st}blank(g,C=!0){let j=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(g!=null){for(;j.length0;ee--)j+=" ";return j+(C?this.spaceAfter:"")}}marker(g,C){let j=this.node.name=="OrderedList"?String(+M(this.item,g)[2]+C):"";return this.spaceBefore+j+this.type+this.spaceAfter}}function X(O,g){let C=[];for(let ee=O;ee&&ee.name!="Document";ee=ee.parent)(ee.name=="ListItem"||ee.name=="Blockquote"||ee.name=="FencedCode")&&C.push(ee);let j=[];for(let ee=C.length-1;ee>=0;ee--){let Ae=C[ee],_e,st=g.lineAt(Ae.from),ht=Ae.from-st.from;if(Ae.name=="FencedCode")j.push(new Q(Ae,ht,ht,"","","",null));else if(Ae.name=="Blockquote"&&(_e=/^ *>( ?)/.exec(st.text.slice(ht))))j.push(new Q(Ae,ht,ht+_e[0].length,"",_e[1],">",null));else if(Ae.name=="ListItem"&&Ae.parent.name=="OrderedList"&&(_e=/^( *)\d+([.)])( *)/.exec(st.text.slice(ht)))){let kt=_e[3],Dt=_e[0].length;kt.length>=4&&(kt=kt.slice(0,kt.length-4),Dt-=4),j.push(new Q(Ae.parent,ht,ht+Dt,_e[1],kt,_e[2],Ae))}else if(Ae.name=="ListItem"&&Ae.parent.name=="BulletList"&&(_e=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(st.text.slice(ht)))){let kt=_e[4],Dt=_e[0].length;kt.length>4&&(kt=kt.slice(0,kt.length-4),Dt-=4);let un=_e[2];_e[3]&&(un+=_e[3].replace(/[xX]/," ")),j.push(new Q(Ae.parent,ht,ht+Dt,_e[1],kt,un,Ae))}}return j}function M(O,g){return/^(\s*)(\d+)(?=[.)])/.exec(g.sliceString(O.from,O.from+10))}function fe(O,g,C,j=0){for(let ee=-1,Ae=O;;){if(Ae.name=="ListItem"){let st=M(Ae,g),ht=+st[2];if(ee>=0){if(ht!=ee+1)return;C.push({from:Ae.from+st[1].length,to:Ae.from+st[0].length,insert:String(ee+2+j)})}ee=ht}let _e=Ae.nextSibling;if(!_e)break;Ae=_e}}function Pe(O,g){let C=/^[ \t]*/.exec(O)[0].length;if(!C||g.facet(p.c)!=" ")return O;let j=(0,l.IS)(O,4,C),ee="";for(let Ae=j;Ae>0;)Ae>=4?(ee+=" ",Ae-=4):(ee+=" ",Ae--);return ee+O.slice(C)}const Fe=({state:O,dispatch:g})=>{let C=(0,p.qz)(O),{doc:j}=O,ee=null,Ae=O.changeByRange(_e=>{if(!_e.empty||!c.isActiveAt(O,_e.from))return ee={range:_e};let st=_e.from,ht=j.lineAt(st),kt=X(C.resolveInner(st,-1),j);for(;kt.length&&kt[kt.length-1].from>st-ht.from;)kt.pop();if(!kt.length)return ee={range:_e};let Dt=kt[kt.length-1];if(Dt.to-Dt.spaceAfter.length>st-ht.from)return ee={range:_e};let un=st>=Dt.to-Dt.spaceAfter.length&&!/\S/.test(ht.text.slice(Dt.to));if(Dt.item&&un){let ti=Dt.node.firstChild,J=Dt.node.getChild("ListItem","ListItem");if(ti.to>=st||J&&J.to0&&!/[^\s>]/.test(j.lineAt(ht.from-1).text)){let k=kt.length>1?kt[kt.length-2]:null,L,se="";k&&k.item?(L=ht.from+k.from,se=k.marker(j,1)):L=ht.from+(k?k.to:0);let ve=[{from:L,to:st,insert:se}];return Dt.node.name=="OrderedList"&&fe(Dt.item,j,ve,-2),k&&k.node.name=="OrderedList"&&fe(k.item,j,ve),{range:l.jT.cursor(L+se.length),changes:ve}}else{let k=F(kt,O,ht);return{range:l.jT.cursor(st+k.length+1),changes:{from:ht.from,insert:k+O.lineBreak}}}}if(Dt.node.name=="Blockquote"&&un&&ht.from){let ti=j.lineAt(ht.from-1),J=/>\s*$/.exec(ti.text);if(J&&J.index==Dt.from){let k=O.changes([{from:ti.from+J.index,to:ti.to},{from:ht.from+Dt.from,to:ht.to}]);return{range:_e.map(k),changes:k}}}let Ft=[];Dt.node.name=="OrderedList"&&fe(Dt.item,j,Ft);let $n=Dt.item&&Dt.item.from]*/.exec(ht.text)[0].length>=Dt.to)for(let ti=0,J=kt.length-1;ti<=J;ti++)Wn+=ti==J&&!$n?kt[ti].marker(j,1):kt[ti].blank(tiht.from&&/\s/.test(ht.text.charAt(Mn-ht.from-1));)Mn--;return Wn=Pe(Wn,O),Zt(Dt.node,O.doc)&&(Wn=F(kt,O,ht)+O.lineBreak+Wn),Ft.push({from:Mn,to:st,insert:O.lineBreak+Wn}),{range:l.jT.cursor(Mn+Wn.length+1),changes:Ft}});return ee?!1:(g(O.update(Ae,{scrollIntoView:!0,userEvent:"input"})),!0)};function pt(O){return O.name=="QuoteMark"||O.name=="ListMark"}function Zt(O,g){if(O.name!="OrderedList"&&O.name!="BulletList")return!1;let C=O.firstChild,j=O.getChild("ListItem","ListItem");if(!j)return!1;let ee=g.lineAt(C.to),Ae=g.lineAt(j.from),_e=/^[\s>]*$/.test(ee.text);return ee.number+(_e?0:1){let C=(0,p.qz)(O),j=null,ee=O.changeByRange(Ae=>{let _e=Ae.from,{doc:st}=O;if(Ae.empty&&c.isActiveAt(O,Ae.from)){let ht=st.lineAt(_e),kt=X(P(C,_e),st);if(kt.length){let Dt=kt[kt.length-1],un=Dt.to-Dt.spaceAfter.length+(Dt.spaceAfter?1:0);if(_e-ht.from>un&&!/\S/.test(ht.text.slice(un,_e-ht.from)))return{range:l.jT.cursor(ht.from+un),changes:{from:ht.from+un,to:_e}};if(_e-ht.from==un&&(!Dt.item||ht.from<=Dt.item.from||!/\S/.test(ht.text.slice(0,Dt.to)))){let Ft=ht.from+Dt.from;if(Dt.item&&Dt.node.fromk.concat(J):void 0})}const V=new l.md;class U{constructor(k,L,se=[],ve=""){this.data=k,this.name=ve,f.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(f.yy.prototype,"tree",{get(){return ce(this)}}),this.parser=L,this.extension=[dt.of(this),f.yy.languageData.of((Me,Be,Ct)=>{let St=te(Me,Be,Ct),rn=St.type.prop(m);if(!rn)return[];let cn=Me.facet(rn),Xn=St.type.prop(V);if(Xn){let pi=St.resolve(Be-St.from,Ct);for(let fi of Xn)if(fi.test(pi,Me)){let vi=Me.facet(fi.facet);return fi.type=="replace"?vi:vi.concat(cn)}}return cn})].concat(se)}isActiveAt(k,L,se=-1){return te(k,L,se).type.prop(m)==this.data}findRegions(k){let L=k.facet(dt);if((L==null?void 0:L.data)==this.data)return[{from:0,to:k.doc.length}];if(!L||!L.allowsNesting)return[];let se=[],ve=(Me,Be)=>{if(Me.prop(m)==this.data){se.push({from:Be,to:Be+Me.length});return}let Ct=Me.prop(l.md.mounted);if(Ct){if(Ct.tree.prop(m)==this.data){if(Ct.overlay)for(let St of Ct.overlay)se.push({from:St.from+Be,to:St.to+Be});else se.push({from:Be,to:Be+Me.length});return}else if(Ct.overlay){let St=se.length;if(ve(Ct.tree,Ct.overlay[0].from+Be),se.length>St)return}}for(let St=0;Stse.isTop?L:void 0)]}),k.name)}configure(k,L){return new w(this.data,this.parser.configure(k),L||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ce(J){let k=J.field(U.state,!1);return k?k.tree:l.mp.empty}function N(J,k,L=50){var se;let ve=(se=J.field(U.state,!1))===null||se===void 0?void 0:se.context;if(!ve)return null;let Me=ve.viewport;ve.updateViewport({from:0,to:k});let Be=ve.isDone(k)||ve.work(L,k)?ve.tree:null;return ve.updateViewport(Me),Be}function xe(J,k=J.doc.length){var L;return((L=J.field(U.state,!1))===null||L===void 0?void 0:L.context.isDone(k))||!1}function be(J,k=J.viewport.to,L=100){let se=N(J.state,k,L);return se!=ce(J.state)&&J.dispatch({}),!!se}function ne(J){var k;return((k=J.plugin(qe))===null||k===void 0?void 0:k.isWorking())||!1}class me{constructor(k){this.doc=k,this.cursorPos=0,this.string="",this.cursor=k.iter()}get length(){return this.doc.length}syncTo(k){return this.string=this.cursor.next(k-this.cursorPos).value,this.cursorPos=k+this.string.length,this.cursorPos-this.string.length}chunk(k){return this.syncTo(k),this.string}get lineChunks(){return!0}read(k,L){let se=this.cursorPos-this.string.length;return k=this.cursorPos?this.doc.sliceString(k,L):this.string.slice(k-se,L-se)}}let ke=null;class re{constructor(k,L,se=[],ve,Me,Be,Ct,St){this.parser=k,this.state=L,this.fragments=se,this.tree=ve,this.treeLen=Me,this.viewport=Be,this.skipped=Ct,this.scheduleOn=St,this.parse=null,this.tempSkipped=[]}static create(k,L,se){return new re(k,L,[],l.mp.empty,0,se,[],null)}startParse(){return this.parser.startParse(new me(this.state.doc),this.fragments)}work(k,L){return L!=null&&L>=this.state.doc.length&&(L=void 0),this.tree!=l.mp.empty&&this.isDone(L!=null?L:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var se;if(typeof k=="number"){let ve=Date.now()+k;k=()=>Date.now()>ve}for(this.parse||(this.parse=this.startParse()),L!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>L)&&L=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>k)&&this.parse.stopAt(k),this.withContext(()=>{for(;!(L=this.parse.advance()););}),this.treeLen=k,this.tree=L,this.fragments=this.withoutTempSkipped(l.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(k){let L=ke;ke=this;try{return k()}finally{ke=L}}withoutTempSkipped(k){for(let L;L=this.tempSkipped.pop();)k=ae(k,L.from,L.to);return k}changes(k,L){let{fragments:se,tree:ve,treeLen:Me,viewport:Be,skipped:Ct}=this;if(this.takeTree(),!k.empty){let St=[];if(k.iterChangedRanges((rn,cn,Xn,pi)=>St.push({fromA:rn,toA:cn,fromB:Xn,toB:pi})),se=l.i9.applyChanges(se,St),ve=l.mp.empty,Me=0,Be={from:k.mapPos(Be.from,-1),to:k.mapPos(Be.to,1)},this.skipped.length){Ct=[];for(let rn of this.skipped){let cn=k.mapPos(rn.from,1),Xn=k.mapPos(rn.to,-1);cnk.from&&(this.fragments=ae(this.fragments,ve,Me),this.skipped.splice(se--,1))}return this.skipped.length>=L?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(k,L){this.skipped.push({from:k,to:L})}static getSkippingParser(k){return new class extends l._b{createParse(L,se,ve){let Me=ve[0].from,Be=ve[ve.length-1].to;return{parsedPos:Me,advance(){let St=ke;if(St){for(let rn of ve)St.tempSkipped.push(rn);k&&(St.scheduleOn=St.scheduleOn?Promise.all([St.scheduleOn,k]):k)}return this.parsedPos=Be,new l.mp(l.Jq.none,[],[],Be-Me)},stoppedAt:null,stopAt(){}}}}}isDone(k){k=Math.min(k,this.state.doc.length);let L=this.fragments;return this.treeLen>=k&&L.length&&L[0].from==0&&L[0].to>=k}static get(){return ke}}function ae(J,k,L){return l.i9.applyChanges(J,[{fromA:k,toA:L,fromB:k,toB:L}])}class Ce{constructor(k){this.context=k,this.tree=k.tree}apply(k){if(!k.docChanged&&this.tree==this.context.tree)return this;let L=this.context.changes(k.changes,k.state),se=this.context.treeLen==k.startState.doc.length?void 0:Math.max(k.changes.mapPos(this.context.treeLen),L.viewport.to);return L.work(20,se)||L.takeTree(),new Ce(L)}static init(k){let L=Math.min(3e3,k.doc.length),se=re.create(k.facet(dt).parser,k,{from:0,to:L});return se.work(20,L)||se.takeTree(),new Ce(se)}}U.state=f.QQ.define({create:Ce.init,update(J,k){for(let L of k.effects)if(L.is(U.setState))return L.value;return k.startState.facet(dt)!=k.state.facet(dt)?Ce.init(k.state):J.apply(k)}});let Ee=J=>{let k=setTimeout(()=>J(),500);return()=>clearTimeout(k)};typeof requestIdleCallback!="undefined"&&(Ee=J=>{let k=-1,L=setTimeout(()=>{k=requestIdleCallback(J,{timeout:500-100})},100);return()=>k<0?clearTimeout(L):cancelIdleCallback(k)});const nt=typeof navigator!="undefined"&&((S=navigator.scheduling)===null||S===void 0?void 0:S.isInputPending)?()=>navigator.scheduling.isInputPending():null,qe=p.lg.fromClass(class{constructor(k){this.view=k,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(k){let L=this.view.state.field(U.state).context;(L.updateViewport(k.view.viewport)||this.view.viewport.to>L.treeLen)&&this.scheduleWork(),(k.docChanged||k.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(L)}scheduleWork(){if(this.working)return;let{state:k}=this.view,L=k.field(U.state);(L.tree!=L.context.tree||!L.context.isDone(k.doc.length))&&(this.working=Ee(this.work))}work(k){this.working=null;let L=Date.now();if(this.chunkEndve+1e3,St=Me.context.work(()=>nt&&nt()||Date.now()>Be,ve+(Ct?0:1e5));this.chunkBudget-=Date.now()-L,(St||this.chunkBudget<=0)&&(Me.context.takeTree(),this.view.dispatch({effects:U.setState.of(new Ce(Me.context))})),this.chunkBudget>0&&!(St&&!Ct)&&this.scheduleWork(),this.checkAsyncSchedule(Me.context)}checkAsyncSchedule(k){k.scheduleOn&&(this.workScheduled++,k.scheduleOn.then(()=>this.scheduleWork()).catch(L=>(0,p.OO)(this.view.state,L)).then(()=>this.workScheduled--),k.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),dt=f.r$.define({combine(J){return J.length?J[0]:null},enables:J=>[U.state,qe,p.tk.contentAttributes.compute([J],k=>{let L=k.facet(J);return L&&L.name?{"data-language":L.name}:{}})]});class Je{constructor(k,L=[]){this.language=k,this.support=L,this.extension=[k,L]}}class lt{constructor(k,L,se,ve,Me,Be=void 0){this.name=k,this.alias=L,this.extensions=se,this.filename=ve,this.loadFunc=Me,this.support=Be,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(k=>this.support=k,k=>{throw this.loading=null,k}))}static of(k){let{load:L,support:se}=k;if(!L){if(!se)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");L=()=>Promise.resolve(se)}return new lt(k.name,(k.alias||[]).concat(k.name).map(ve=>ve.toLowerCase()),k.extensions||[],k.filename,L,se)}static matchFilename(k,L){for(let ve of k)if(ve.filename&&ve.filename.test(L))return ve;let se=/\.([^.]+)$/.exec(L);if(se){for(let ve of k)if(ve.extensions.indexOf(se[1])>-1)return ve}return null}static matchLanguageName(k,L,se=!0){L=L.toLowerCase();for(let ve of k)if(ve.alias.some(Me=>Me==L))return ve;if(se)for(let ve of k)for(let Me of ve.alias){let Be=L.indexOf(Me);if(Be>-1&&(Me.length>2||!/\w/.test(L[Be-1])&&!/\w/.test(L[Be+Me.length])))return ve}return null}}const Rt=f.r$.define(),Re=f.r$.define({combine:J=>{if(!J.length)return" ";let k=J[0];if(!k||/\S/.test(k)||Array.from(k).some(L=>L!=k[0]))throw new Error("Invalid indent unit: "+JSON.stringify(J[0]));return k}});function Ie(J){let k=J.facet(Re);return k.charCodeAt(0)==9?J.tabSize*k.length:k.length}function $(J,k){let L="",se=J.tabSize,ve=J.facet(Re)[0];if(ve==" "){for(;k>=se;)L+=" ",k-=se;ve=" "}for(let Me=0;Me=k?K(J,L,k):null}function H(J,k,L){let se=Object.create(null),ve=new W(J,{overrideIndentation:Be=>{var Ct;return(Ct=se[Be])!==null&&Ct!==void 0?Ct:-1}}),Me=[];for(let Be=k;Be<=L;){let Ct=J.doc.lineAt(Be);Be=Ct.to+1;let St=I(ve,Ct.from);if(St==null)continue;/\S/.test(Ct.text)||(St=0);let rn=/^\s*/.exec(Ct.text)[0],cn=$(J,St);rn!=cn&&(se[Ct.from]=St,Me.push({from:Ct.from,to:Ct.from+rn.length,insert:cn}))}return J.changes(Me)}class W{constructor(k,L={}){this.state=k,this.options=L,this.unit=Ie(k)}lineAt(k,L=1){let se=this.state.doc.lineAt(k),{simulateBreak:ve,simulateDoubleBreak:Me}=this.options;return ve!=null&&ve>=se.from&&ve<=se.to?Me&&ve==k?{text:"",from:k}:(L<0?ve-1&&(Me+=Be-this.countColumn(se,se.search(/\S|$/))),Me}countColumn(k,L=k.length){return(0,f.IS)(k,this.state.tabSize,L)}lineIndent(k,L=1){let{text:se,from:ve}=this.lineAt(k,L),Me=this.options.overrideIndentation;if(Me){let Be=Me(ve);if(Be>-1)return Be}return this.countColumn(se,se.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const q=new l.md;function K(J,k,L){let se=k.resolveStack(L),ve=se.node.enterUnfinishedNodesBefore(L);if(ve!=se.node){let Me=[];for(let Be=ve;Be!=se.node;Be=Be.parent)Me.push(Be);for(let Be=Me.length-1;Be>=0;Be--)se={node:Me[Be],next:se}}return Se(se,J,L)}function Se(J,k,L){for(let se=J;se;se=se.next){let ve=ot(se.node);if(ve)return ve(ut.create(k,L,se))}return 0}function Ke(J){return J.pos==J.options.simulateBreak&&J.options.simulateDoubleBreak}function ot(J){let k=J.type.prop(q);if(k)return k;let L=J.firstChild,se;if(L&&(se=L.type.prop(l.md.closedBy))){let ve=J.lastChild,Me=ve&&se.indexOf(ve.name)>-1;return Be=>sn(Be,!0,1,void 0,Me&&!Ke(Be)?ve.from:void 0)}return J.parent==null?mt:null}function mt(){return 0}class ut extends W{constructor(k,L,se){super(k.state,k.options);this.base=k,this.pos=L,this.context=se}get node(){return this.context.node}static create(k,L,se){return new ut(k,L,se)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(k){let L=this.state.doc.lineAt(k.from);for(;;){let se=k.resolve(L.from);for(;se.parent&&se.parent.from==se.from;)se=se.parent;if(Vt(se,k))break;L=this.state.doc.lineAt(se.from)}return this.lineIndent(L.from)}continue(){return Se(this.context.next,this.base,this.pos)}}function Vt(J,k){for(let L=k;L;L=L.parent)if(J==L)return!0;return!1}function zt(J){let k=J.node,L=k.childAfter(k.from),se=k.lastChild;if(!L)return null;let ve=J.options.simulateBreak,Me=J.state.doc.lineAt(L.from),Be=ve==null||ve<=Me.from?Me.to:Math.min(Me.to,ve);for(let Ct=L.to;;){let St=k.childAfter(Ct);if(!St||St==se)return null;if(!St.type.isSkipped)return St.fromsn(se,k,L,J)}function sn(J,k,L,se,ve){let Me=J.textAfter,Be=Me.match(/^\s*/)[0].length,Ct=se&&Me.slice(Be,Be+se.length)==se||ve==J.pos+Be,St=k?zt(J):null;return St?Ct?J.column(St.from):J.column(St.to):J.baseIndent+(Ct?0:J.unit*L)}const on=J=>J.baseIndent;function Xt({except:J,units:k=1}={}){return L=>{let se=J&&J.test(L.textAfter);return L.baseIndent+(se?0:k*L.unit)}}const $t=200;function Ve(){return EditorState.transactionFilter.of(J=>{if(!J.docChanged||!J.isUserEvent("input.type")&&!J.isUserEvent("input.complete"))return J;let k=J.startState.languageDataAt("indentOnInput",J.startState.selection.main.head);if(!k.length)return J;let L=J.newDoc,{head:se}=J.newSelection.main,ve=L.lineAt(se);if(se>ve.from+$t)return J;let Me=L.sliceString(ve.from,se);if(!k.some(rn=>rn.test(Me)))return J;let{state:Be}=J,Ct=-1,St=[];for(let{head:rn}of Be.selection.ranges){let cn=Be.doc.lineAt(rn);if(cn.from==Ct)continue;Ct=cn.from;let Xn=I(Be,cn.from);if(Xn==null)continue;let pi=/^\s*/.exec(cn.text)[0],fi=$(Be,Xn);pi!=fi&&St.push({from:cn.from,to:cn.from+pi.length,insert:fi})}return St.length?[J,{changes:St,sequential:!0}]:J})}const A=f.r$.define(),D=new l.md;function oe(J){let k=J.firstChild,L=J.lastChild;return k&&k.toL)continue;if(Me&&Ct.from=k&&rn.to>L&&(Me=rn)}}return Me}function Te(J){let k=J.lastChild;return k&&k.to==J.to&&k.type.isError}function Ne(J,k,L){for(let se of J.facet(A)){let ve=se(J,k,L);if(ve)return ve}return ge(J,k,L)}function rt(J,k){let L=k.mapPos(J.from,1),se=k.mapPos(J.to,-1);return L>=se?void 0:{from:L,to:se}}const Lt=f.Py.define({map:rt}),Yt=f.Py.define({map:rt});function Bt(J){let k=[];for(let{head:L}of J.state.selection.ranges)k.some(se=>se.from<=L&&se.to>=L)||k.push(J.lineBlockAt(L));return k}const nn=f.QQ.define({create(){return p.p.none},update(J,k){J=J.map(k.changes);for(let L of k.effects)if(L.is(Lt)&&!gn(J,L.value.from,L.value.to)){let{preparePlaceholder:se}=k.state.facet(Tt),ve=se?p.p.replace({widget:new Kt(se(k.state,L.value))}):xt;J=J.update({add:[ve.range(L.value.from,L.value.to)]})}else L.is(Yt)&&(J=J.update({filter:(se,ve)=>L.value.from!=se||L.value.to!=ve,filterFrom:L.value.from,filterTo:L.value.to}));if(k.selection){let L=!1,{head:se}=k.selection.main;J.between(se,se,(ve,Me)=>{vese&&(L=!0)}),L&&(J=J.update({filterFrom:se,filterTo:se,filter:(ve,Me)=>Me<=se||ve>=se}))}return J},provide:J=>p.tk.decorations.from(J),toJSON(J,k){let L=[];return J.between(0,k.doc.length,(se,ve)=>{L.push(se,ve)}),L},fromJSON(J){if(!Array.isArray(J)||J.length%2)throw new RangeError("Invalid JSON for fold state");let k=[];for(let L=0;L{(!ve||ve.from>Me)&&(ve={from:Me,to:Be})}),ve}function gn(J,k,L){let se=!1;return J.between(k,k,(ve,Me)=>{ve==k&&Me==L&&(se=!0)}),se}function Le(J,k){return J.field(nn,!1)?k:k.concat(f.Py.appendConfig.of(Ht()))}const ze=J=>{for(let k of Bt(J)){let L=Ne(J.state,k.from,k.to);if(L)return J.dispatch({effects:Le(J.state,[Lt.of(L),yt(J,L)])}),!0}return!1},Ot=J=>{if(!J.state.field(nn,!1))return!1;let k=[];for(let L of Bt(J)){let se=tn(J.state,L.from,L.to);se&&k.push(Yt.of(se),yt(J,se,!1))}return k.length&&J.dispatch({effects:k}),k.length>0};function yt(J,k,L=!0){let se=J.state.doc.lineAt(k.from).number,ve=J.state.doc.lineAt(k.to).number;return p.tk.announce.of(`${J.state.phrase(L?"Folded lines":"Unfolded lines")} ${se} ${J.state.phrase("to")} ${ve}.`)}const Oe=J=>{let{state:k}=J,L=[];for(let se=0;se{let k=J.state.field(nn,!1);if(!k||!k.size)return!1;let L=[];return k.between(0,J.state.doc.length,(se,ve)=>{L.push(Yt.of({from:se,to:ve}))}),J.dispatch({effects:L}),!0};function it(J,k){for(let L=k;;){let se=Ne(J.state,L.from,L.to);if(se&&se.to>k.from)return se;if(!L.from)return null;L=J.lineBlockAt(L.from-1)}}const Ye=J=>{let k=[];for(let L of Bt(J)){let se=tn(J.state,L.from,L.to);if(se)k.push(Yt.of(se),yt(J,se,!1));else{let ve=it(J,L);ve&&k.push(Lt.of(ve),yt(J,ve))}}return k.length>0&&J.dispatch({effects:Le(J.state,k)}),!!k.length},Pt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ze},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ot},{key:"Ctrl-Alt-[",run:Oe},{key:"Ctrl-Alt-]",run:Ge}],qt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Tt=f.r$.define({combine(J){return(0,f.BO)(J,qt)}});function Ht(J){let k=[nn,On];return J&&k.push(Tt.of(J)),k}function Gt(J,k){let{state:L}=J,se=L.facet(Tt),ve=Be=>{let Ct=J.lineBlockAt(J.posAtDOM(Be.target)),St=tn(J.state,Ct.from,Ct.to);St&&J.dispatch({effects:Yt.of(St)}),Be.preventDefault()};if(se.placeholderDOM)return se.placeholderDOM(J,ve,k);let Me=document.createElement("span");return Me.textContent=se.placeholderText,Me.setAttribute("aria-label",L.phrase("folded code")),Me.title=L.phrase("unfold"),Me.className="cm-foldPlaceholder",Me.onclick=ve,Me}const xt=p.p.replace({widget:new class extends p.l9{toDOM(J){return Gt(J,null)}}});class Kt extends p.l9{constructor(k){super();this.value=k}eq(k){return this.value==k.value}toDOM(k){return Gt(k,this.value)}}const Jt={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class en extends null{constructor(k,L){super();this.config=k,this.open=L}eq(k){return this.config==k.config&&this.open==k.open}toDOM(k){if(this.config.markerDOM)return this.config.markerDOM(this.open);let L=document.createElement("span");return L.textContent=this.open?this.config.openText:this.config.closedText,L.title=k.state.phrase(this.open?"Fold line":"Unfold line"),L}}function _t(J={}){let k=Object.assign(Object.assign({},Jt),J),L=new en(k,!0),se=new en(k,!1),ve=ViewPlugin.fromClass(class{constructor(Be){this.from=Be.viewport.from,this.markers=this.buildMarkers(Be)}update(Be){(Be.docChanged||Be.viewportChanged||Be.startState.facet(dt)!=Be.state.facet(dt)||Be.startState.field(nn,!1)!=Be.state.field(nn,!1)||ce(Be.startState)!=ce(Be.state)||k.foldingChanged(Be))&&(this.markers=this.buildMarkers(Be.view))}buildMarkers(Be){let Ct=new RangeSetBuilder;for(let St of Be.viewportLineBlocks){let rn=tn(Be.state,St.from,St.to)?se:Ne(Be.state,St.from,St.to)?L:null;rn&&Ct.add(St.from,St.from,rn)}return Ct.finish()}}),{domEventHandlers:Me}=k;return[ve,gutter({class:"cm-foldGutter",markers(Be){var Ct;return((Ct=Be.plugin(ve))===null||Ct===void 0?void 0:Ct.markers)||RangeSet.empty},initialSpacer(){return new en(k,!1)},domEventHandlers:Object.assign(Object.assign({},Me),{click:(Be,Ct,St)=>{if(Me.click&&Me.click(Be,Ct,St))return!0;let rn=tn(Be.state,Ct.from,Ct.to);if(rn)return Be.dispatch({effects:Yt.of(rn)}),!0;let cn=Ne(Be.state,Ct.from,Ct.to);return cn?(Be.dispatch({effects:Lt.of(cn)}),!0):!1}})}),Ht()]}const On=p.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class dn{constructor(k,L){this.specs=k;let se;function ve(Ct){let St=a.V.newName();return(se||(se=Object.create(null)))["."+St]=Ct,St}const Me=typeof L.all=="string"?L.all:L.all?ve(L.all):void 0,Be=L.scope;this.scope=Be instanceof U?Ct=>Ct.prop(m)==Be.data:Be?Ct=>Ct==Be:void 0,this.style=(0,d.QR)(k.map(Ct=>({tag:Ct.tag,class:Ct.class||ve(Object.assign({},Ct,{tag:null}))})),{all:Me}).style,this.module=se?new a.V(se):null,this.themeType=L.themeType}static define(k,L){return new dn(k,L||{})}}const Ln=f.r$.define(),En=f.r$.define({combine(J){return J.length?[J[0]]:null}});function vn(J){let k=J.facet(Ln);return k.length?k:J.facet(En)}function In(J,k){let L=[li],se;return J instanceof dn&&(J.module&&L.push(p.tk.styleModule.of(J.module)),se=J.themeType),(k==null?void 0:k.fallback)?L.push(En.of(J)):se?L.push(Ln.computeN([p.tk.darkTheme],ve=>ve.facet(p.tk.darkTheme)==(se=="dark")?[J]:[])):L.push(Ln.of(J)),L}function Dn(J,k,L){let se=vn(J),ve=null;if(se){for(let Me of se)if(!Me.scope||L&&Me.scope(L)){let Be=Me.style(k);Be&&(ve=ve?ve+" "+Be:Be)}}return ve}class Jn{constructor(k){this.markCache=Object.create(null),this.tree=ce(k.state),this.decorations=this.buildDeco(k,vn(k.state)),this.decoratedTo=k.viewport.to}update(k){let L=ce(k.state),se=vn(k.state),ve=se!=vn(k.startState),{viewport:Me}=k.view,Be=k.changes.mapPos(this.decoratedTo,1);L.length=Me.to?(this.decorations=this.decorations.map(k.changes),this.decoratedTo=Be):(L!=this.tree||k.viewportChanged||ve)&&(this.tree=L,this.decorations=this.buildDeco(k.view,se),this.decoratedTo=Me.to)}buildDeco(k,L){if(!L||!this.tree.length)return p.p.none;let se=new f.f_;for(let{from:ve,to:Me}of k.visibleRanges)(0,d.bW)(this.tree,L,(Be,Ct,St)=>{se.add(Be,Ct,this.markCache[St]||(this.markCache[St]=p.p.mark({class:St})))},ve,Me);return se.finish()}}const li=f.Wl.high(p.lg.fromClass(Jn,{decorations:J=>J.decorations})),Kn=dn.define([{tag:d.pJ.meta,color:"#404740"},{tag:d.pJ.link,textDecoration:"underline"},{tag:d.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:d.pJ.emphasis,fontStyle:"italic"},{tag:d.pJ.strong,fontWeight:"bold"},{tag:d.pJ.strikethrough,textDecoration:"line-through"},{tag:d.pJ.keyword,color:"#708"},{tag:[d.pJ.atom,d.pJ.bool,d.pJ.url,d.pJ.contentSeparator,d.pJ.labelName],color:"#219"},{tag:[d.pJ.literal,d.pJ.inserted],color:"#164"},{tag:[d.pJ.string,d.pJ.deleted],color:"#a11"},{tag:[d.pJ.regexp,d.pJ.escape,d.pJ.special(d.pJ.string)],color:"#e40"},{tag:d.pJ.definition(d.pJ.variableName),color:"#00f"},{tag:d.pJ.local(d.pJ.variableName),color:"#30a"},{tag:[d.pJ.typeName,d.pJ.namespace],color:"#085"},{tag:d.pJ.className,color:"#167"},{tag:[d.pJ.special(d.pJ.variableName),d.pJ.macroName],color:"#256"},{tag:d.pJ.definition(d.pJ.propertyName),color:"#00c"},{tag:d.pJ.comment,color:"#940"},{tag:d.pJ.invalid,color:"#f00"}]),bi=p.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Rn=1e4,yi="()[]{}",di=f.r$.define({combine(J){return(0,f.BO)(J,{afterCursor:!0,brackets:yi,maxScanDistance:Rn,renderMatch:Un})}}),ai=p.p.mark({class:"cm-matchingBracket"}),ci=p.p.mark({class:"cm-nonmatchingBracket"});function Un(J){let k=[],L=J.matched?ai:ci;return k.push(L.range(J.start.from,J.start.to)),J.end&&k.push(L.range(J.end.from,J.end.to)),k}const gi=[f.QQ.define({create(){return p.p.none},update(J,k){if(!k.docChanged&&!k.selection)return J;let L=[],se=k.state.facet(di);for(let ve of k.state.selection.ranges){if(!ve.empty)continue;let Me=Q(k.state,ve.head,-1,se)||ve.head>0&&Q(k.state,ve.head-1,1,se)||se.afterCursor&&(Q(k.state,ve.head,1,se)||ve.headp.tk.decorations.from(J)}),bi];function ue(J={}){return[di.of(J),gi]}const h=new l.md;function c(J,k,L){let se=J.prop(k<0?l.md.openedBy:l.md.closedBy);if(se)return se;if(J.name.length==1){let ve=L.indexOf(J.name);if(ve>-1&&ve%2==(k<0?1:0))return[L[ve+k]]}return null}function v(J){let k=J.type.prop(h);return k?k(J.node):J}function Q(J,k,L,se={}){let ve=se.maxScanDistance||Rn,Me=se.brackets||yi,Be=ce(J),Ct=Be.resolveInner(k,L);for(let St=Ct;St;St=St.parent){let rn=c(St.type,L,Me);if(rn&&St.from0?k>=cn.from&&kcn.from&&k<=cn.to))return X(J,k,L,St,cn,rn,Me)}}return M(J,k,L,Be,Ct.type,ve,Me)}function X(J,k,L,se,ve,Me,Be){let Ct=se.parent,St={from:ve.from,to:ve.to},rn=0,cn=Ct==null?void 0:Ct.cursor();if(cn&&(L<0?cn.childBefore(se.from):cn.childAfter(se.to)))do if(L<0?cn.to<=se.from:cn.from>=se.to){if(rn==0&&Me.indexOf(cn.type.name)>-1&&cn.from0)return null;let rn={from:L<0?k-1:k,to:L>0?k+1:k},cn=J.doc.iterRange(k,L>0?J.doc.length:0),Xn=0;for(let pi=0;!cn.next().done&&pi<=Me;){let fi=cn.value;L<0&&(pi+=fi.length);let vi=k+pi*L;for(let Ri=L>0?0:fi.length-1,Qr=L>0?fi.length:-1;Ri!=Qr;Ri+=L){let Di=Be.indexOf(fi[Ri]);if(!(Di<0||se.resolveInner(vi+Ri,1).type!=ve))if(Di%2==0==L>0)Xn++;else{if(Xn==1)return{start:rn,end:{from:vi+Ri,to:vi+Ri+1},matched:Di>>1==St>>1};Xn--}}L>0&&(pi+=fi.length)}return cn.done?{start:rn,matched:!1}:null}function fe(J,k,L,se=0,ve=0){k==null&&(k=J.search(/[^\s\u00a0]/),k==-1&&(k=J.length));let Me=ve;for(let Be=se;Be=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posL}eatSpace(){let k=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>k}skipToEnd(){this.pos=this.string.length}skipTo(k){let L=this.string.indexOf(k,this.pos);if(L>-1)return this.pos=L,!0}backUp(k){this.pos-=k}column(){return this.lastColumnPosse?Be.toLowerCase():Be,Me=this.string.substr(this.pos,k.length);return ve(Me)==ve(k)?(L!==!1&&(this.pos+=k.length),!0):null}else{let ve=this.string.slice(this.pos).match(k);return ve&&ve.index>0?null:(ve&&L!==!1&&(this.pos+=ve[0].length),ve)}}current(){return this.string.slice(this.start,this.pos)}}function Fe(J){return{name:J.name||"",token:J.token,blankLine:J.blankLine||(()=>{}),startState:J.startState||(()=>!0),copyState:J.copyState||pt,indent:J.indent||(()=>null),languageData:J.languageData||{},tokenTable:J.tokenTable||We}}function pt(J){if(typeof J!="object")return J;let k={};for(let L in J){let se=J[L];k[L]=se instanceof Array?se.slice():se}return k}const Zt=new WeakMap;class F extends U{constructor(k){let L=x(k.languageData),se=Fe(k),ve,Me=new class extends l._b{createParse(Be,Ct,St){return new le(ve,Be,Ct,St)}};super(L,Me,[Rt.of((Be,Ct)=>this.getIndent(Be,Ct))],k.name);this.topNode=st(L),ve=this,this.streamParser=se,this.stateAfter=new l.md({perNode:!0}),this.tokenTable=k.tokenTable?new j(se.tokenTable):ee}static define(k){return new F(k)}getIndent(k,L){let se=ce(k.state),ve=se.resolve(L);for(;ve&&ve.type!=this.topNode;)ve=ve.parent;if(!ve)return null;let Me,{overrideIndentation:Be}=k.options;Be&&(Me=Zt.get(k.state),Me!=null&&Me1e4)return null;for(;St=se&&L+k.length<=ve&&k.prop(J.stateAfter);if(Me)return{state:J.streamParser.copyState(Me),pos:L+k.length};for(let Be=k.children.length-1;Be>=0;Be--){let Ct=k.children[Be],St=L+k.positions[Be],rn=Ct instanceof l.mp&&St=k.length)return k;!ve&&k.type==J.topNode&&(ve=!0);for(let Me=k.children.length-1;Me>=0;Me--){let Be=k.positions[Me],Ct=k.children[Me],St;if(BeL&&P(J,ve.tree,0-ve.offset,L,Be),St;if(Ct&&(St=Y(J,ve.tree,L+ve.offset,Ct.pos+ve.offset,!1)))return{state:Ct.state,tree:St}}return{state:J.streamParser.startState(se?Ie(se):4),tree:l.mp.empty}}class le{constructor(k,L,se,ve){this.lang=k,this.input=L,this.fragments=se,this.ranges=ve,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=ve[ve.length-1].to;let Me=re.get(),Be=ve[0].from,{state:Ct,tree:St}=he(k,se,Be,Me==null?void 0:Me.state);this.state=Ct,this.parsedPos=this.chunkStart=Be+St.length;for(let rn=0;rn=L?this.finish():k&&this.parsedPos>=k.viewport.to?(k.skipUntilInView(this.parsedPos,L),this.finish()):null}stopAt(k){this.stoppedAt=k}lineAfter(k){let L=this.input.chunk(k);if(this.input.lineChunks)L==` `&&(L="");else{let se=L.indexOf(` `);se>-1&&(L=L.slice(0,se))}return k+L.length<=this.to?L:L.slice(0,this.to-k)}nextLine(){let k=this.parsedPos,L=this.lineAfter(k),se=k+L.length;for(let ve=this.rangeIndex;;){let Me=this.ranges[ve].to;if(Me>=se||(L=L.slice(0,Me-(se-L.length)),ve++,ve==this.ranges.length))break;let Be=this.ranges[ve].from,Ct=this.lineAfter(Be);L+=Ct,se=Be+Ct.length}return{line:L,end:se}}skipGapsTo(k,L,se){for(;;){let ve=this.ranges[this.rangeIndex].to,Me=k+L;if(se>0?ve>Me:ve>=Me)break;L+=this.ranges[++this.rangeIndex].from-ve}return L}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){Me=this.skipGapsTo(L,Me,1),L+=Me;let Be=this.chunk.length;Me=this.skipGapsTo(se,Me,-1),se+=Me,ve+=this.chunk.length-Be}return this.chunk.push(k,L,se,ve),Me}parseLine(k){let{line:L,end:se}=this.nextLine(),ve=0,{streamParser:Me}=this.lang,Be=new Pe(L,k?k.state.tabSize:4,k?Ie(k.state):2);if(Be.eol())Me.blankLine(this.state,Be.indentUnit);else for(;!Be.eol();){let Ct=je(Me.token,Be,this.state);if(Ct&&(ve=this.emitToken(this.lang.tokenTable.resolve(Ct),this.parsedPos+Be.start,this.parsedPos+Be.pos,4,ve)),Be.start>1e4)break}this.parsedPos=se,this.moveRangeIndex(),this.parsedPosk.start)return ve}throw new Error("Stream parser failed to advance stream.")}const We=Object.create(null),et=[l.Jq.none],at=new l.Lj(et),O=[],g=Object.create(null),C=Object.create(null);for(let[J,k]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])C[J]=_e(We,k);class j{constructor(k){this.extra=k,this.table=Object.assign(Object.create(null),C)}resolve(k){return k?this.table[k]||(this.table[k]=_e(this.extra,k)):0}}const ee=new j(We);function Ae(J,k){O.indexOf(J)>-1||(O.push(J),console.warn(k))}function _e(J,k){let L=[];for(let Ct of k.split(" ")){let St=[];for(let rn of Ct.split(".")){let cn=J[rn]||d.pJ[rn];cn?typeof cn=="function"?St.length?St=St.map(cn):Ae(rn,`Modifier ${rn} used at start of tag`):St.length?Ae(rn,`Tag ${rn} used as modifier`):St=Array.isArray(cn)?cn:[cn]:Ae(rn,`Unknown highlighting tag ${rn}`)}for(let rn of St)L.push(rn)}if(!L.length)return 0;let se=k.replace(/ /g,"_"),ve=se+" "+L.map(Ct=>Ct.id),Me=g[ve];if(Me)return Me.id;let Be=g[ve]=l.Jq.define({id:et.length,name:se,props:[(0,d.Gv)({[se]:L})]});return et.push(Be),Be.id}function st(J){let k=l.Jq.define({id:et.length,name:"Document",props:[m.add(()=>J)],top:!0});return et.push(k),k}function ht(J){return J.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(J)}function kt(J){for(let k=J.iter();!k.next().done;)if(ht(k.value))return!0;return!1}function Dt(J){let k=!1;return J.iterChanges((L,se,ve,Me,Be)=>{!k&&kt(Be)&&(k=!0)}),k}const un=f.r$.define({combine:J=>J.some(k=>k)});function Ft(J={}){let k=[$n];return J.alwaysIsolate&&k.push(un.of(!0)),k}const $n=p.lg.fromClass(class{constructor(J){this.always=J.state.facet(un)||J.textDirection!=p.Nm.LTR||J.state.facet(p.tk.perLineTextDirection),this.hasRTL=!this.always&&kt(J.state.doc),this.tree=ce(J.state),this.decorations=this.always||this.hasRTL?Wn(J,this.tree,this.always):p.p.none}update(J){let k=J.state.facet(un)||J.view.textDirection!=p.Nm.LTR||J.state.facet(p.tk.perLineTextDirection);if(!k&&!this.hasRTL&&Dt(J.changes)&&(this.hasRTL=!0),!k&&!this.hasRTL)return;let L=ce(J.state);(k!=this.always||L!=this.tree||J.docChanged||J.viewportChanged)&&(this.tree=L,this.always=k,this.decorations=Wn(J.view,L,k))}},{provide:J=>{function k(L){var se,ve;return(ve=(se=L.plugin(J))===null||se===void 0?void 0:se.decorations)!==null&&ve!==void 0?ve:p.p.none}return[p.tk.outerDecorations.of(k),f.Wl.lowest(p.tk.bidiIsolatedRanges.of(k))]}});function Wn(J,k,L){let se=new f.f_,ve=J.visibleRanges;L||(ve=Mn(ve,J.state.doc));for(let{from:Me,to:Be}of ve)k.iterate({enter:Ct=>{let St=Ct.type.prop(l.md.isolate);St&&se.add(Ct.from,Ct.to,ti[St])},from:Me,to:Be});return se.finish()}function Mn(J,k){let L=k.iter(),se=0,ve=[],Me=null;for(let{from:Be,to:Ct}of J)for(Be!=se&&(seSt-10?Me.to=Math.min(Ct,rn):ve.push(Me={from:St,to:Math.min(Ct,rn)})),se>=Ct)break;se=rn,L.next()}return ve}const ti={rtl:p.p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:p.Nm.RTL}),ltr:p.p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:p.Nm.LTR}),auto:p.p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},74405:function(Xe,ye,o){"use strict";o.d(ye,{q6:function(){return tn},n0:function(){return dt},as:function(){return Je},D0:function(){return Ht},F6:function(){return Ve},jT:function(){return W},yy:function(){return en},r$:function(){return Se},gc:function(){return qe},Wl:function(){return Xt},Xs:function(){return vn},f_:function(){return Dn},uU:function(){return On},Py:function(){return ze},QQ:function(){return It},xv:function(){return l},YW:function(){return Ot},gm:function(){return ae},nZ:function(){return Ee},BO:function(){return _t},IS:function(){return ui},cp:function(){return be},Gz:function(){return gi},bg:function(){return Ce}});class l{lineAt(h){if(h<0||h>this.length)throw new RangeError(`Invalid position ${h} in document of length ${this.length}`);return this.lineInner(h,!1,1,0)}line(h){if(h<1||h>this.lines)throw new RangeError(`Invalid line number ${h} in ${this.lines}-line document`);return this.lineInner(h,!0,1,0)}replace(h,c,v){[h,c]=te(this,h,c);let Q=[];return this.decompose(0,h,Q,2),v.length&&v.decompose(0,v.length,Q,1|2),this.decompose(c,this.length,Q,1),p.from(Q,this.length-(c-h)+v.length)}append(h){return this.replace(this.length,this.length,h)}slice(h,c=this.length){[h,c]=te(this,h,c);let v=[];return this.decompose(h,c,v,0),p.from(v,c-h)}eq(h){if(h==this)return!0;if(h.length!=this.length||h.lines!=this.lines)return!1;let c=this.scanIdentical(h,1),v=this.length-this.scanIdentical(h,-1),Q=new m(this),X=new m(h);for(let M=c,fe=c;;){if(Q.next(M),X.next(M),M=0,Q.lineBreak!=X.lineBreak||Q.done!=X.done||Q.value!=X.value)return!1;if(fe+=Q.value.length,Q.done||fe>=v)return!0}}iter(h=1){return new m(this,h)}iterRange(h,c=this.length){return new x(this,h,c)}iterLines(h,c){let v;if(h==null)v=this.iter();else{c==null&&(c=this.lines+1);let Q=this.line(h).from;v=this.iterRange(Q,Math.max(Q,c==this.lines+1?this.length:c<=1?0:this.line(c-1).to))}return new V(v)}toString(){return this.sliceString(0)}toJSON(){let h=[];return this.flatten(h),h}constructor(){}static of(h){if(h.length==0)throw new RangeError("A document must have at least one line");return h.length==1&&!h[0]?l.empty:h.length<=32?new f(h):p.from(f.split(h,[]))}}class f extends l{constructor(h,c=d(h)){super();this.text=h,this.length=c}get lines(){return this.text.length}get children(){return null}lineInner(h,c,v,Q){for(let X=0;;X++){let M=this.text[X],fe=Q+M.length;if((c?v:fe)>=h)return new U(Q,fe,v,M);Q=fe+1,v++}}decompose(h,c,v,Q){let X=h<=0&&c>=this.length?this:new f(S(this.text,h,c),Math.min(c,this.length)-Math.max(0,h));if(Q&1){let M=v.pop(),fe=a(X.text,M.text.slice(),0,X.length);if(fe.length<=32)v.push(new f(fe,M.length+X.length));else{let Pe=fe.length>>1;v.push(new f(fe.slice(0,Pe)),new f(fe.slice(Pe)))}}else v.push(X)}replace(h,c,v){if(!(v instanceof f))return super.replace(h,c,v);[h,c]=te(this,h,c);let Q=a(this.text,a(v.text,S(this.text,0,h)),c),X=this.length+v.length-(c-h);return Q.length<=32?new f(Q,X):p.from(f.split(Q,[]),X)}sliceString(h,c=this.length,v=` `){[h,c]=te(this,h,c);let Q="";for(let X=0,M=0;X<=c&&Mh&&M&&(Q+=v),hX&&(Q+=fe.slice(Math.max(0,h-X),c-X)),X=Pe+1}return Q}flatten(h){for(let c of this.text)h.push(c)}scanIdentical(){return 0}static split(h,c){let v=[],Q=-1;for(let X of h)v.push(X),Q+=X.length+1,v.length==32&&(c.push(new f(v,Q)),v=[],Q=-1);return Q>-1&&c.push(new f(v,Q)),c}}class p extends l{constructor(h,c){super();this.children=h,this.length=c,this.lines=0;for(let v of h)this.lines+=v.lines}lineInner(h,c,v,Q){for(let X=0;;X++){let M=this.children[X],fe=Q+M.length,Pe=v+M.lines-1;if((c?Pe:fe)>=h)return M.lineInner(h,c,v,Q);Q=fe+1,v=Pe+1}}decompose(h,c,v,Q){for(let X=0,M=0;M<=c&&X=M){let Fe=Q&((M<=h?1:0)|(Pe>=c?2:0));M>=h&&Pe<=c&&!Fe?v.push(fe):fe.decompose(h-M,c-M,v,Fe)}M=Pe+1}}replace(h,c,v){if([h,c]=te(this,h,c),v.lines=X&&c<=fe){let Pe=M.replace(h-X,c-X,v),Fe=this.lines-M.lines+Pe.lines;if(Pe.lines>5-1&&Pe.lines>Fe>>5+1){let pt=this.children.slice();return pt[Q]=Pe,new p(pt,this.length-(c-h)+v.length)}return super.replace(X,fe,Pe)}X=fe+1}return super.replace(h,c,v)}sliceString(h,c=this.length,v=` `){[h,c]=te(this,h,c);let Q="";for(let X=0,M=0;Xh&&X&&(Q+=v),hM&&(Q+=fe.sliceString(h-M,c-M,v)),M=Pe+1}return Q}flatten(h){for(let c of this.children)c.flatten(h)}scanIdentical(h,c){if(!(h instanceof p))return 0;let v=0,[Q,X,M,fe]=c>0?[0,0,this.children.length,h.children.length]:[this.children.length-1,h.children.length-1,-1,-1];for(;;Q+=c,X+=c){if(Q==M||X==fe)return v;let Pe=this.children[Q],Fe=h.children[X];if(Pe!=Fe)return v+Pe.scanIdentical(Fe,c);v+=Pe.length+1}}static from(h,c=h.reduce((v,Q)=>v+Q.length+1,-1)){let v=0;for(let P of h)v+=P.lines;if(v<32){let P=[];for(let Y of h)Y.flatten(P);return new f(P,c)}let Q=Math.max(32,v>>5),X=Q<<1,M=Q>>1,fe=[],Pe=0,Fe=-1,pt=[];function Zt(P){let Y;if(P.lines>X&&P instanceof p)for(let he of P.children)Zt(he);else P.lines>M&&(Pe>M||!Pe)?(F(),fe.push(P)):P instanceof f&&Pe&&(Y=pt[pt.length-1])instanceof f&&P.lines+Y.lines<=32?(Pe+=P.lines,Fe+=P.length+1,pt[pt.length-1]=new f(Y.text.concat(P.text),Y.length+1+P.length)):(Pe+P.lines>Q&&F(),Pe+=P.lines,Fe+=P.length+1,pt.push(P))}function F(){Pe!=0&&(fe.push(pt.length==1?pt[0]:p.from(pt,Fe)),Fe=-1,Pe=pt.length=0)}for(let P of h)Zt(P);return F(),fe.length==1?fe[0]:new p(fe,c)}}l.empty=new f([""],0);function d(ue){let h=-1;for(let c of ue)h+=c.length+1;return h}function a(ue,h,c=0,v=1e9){for(let Q=0,X=0,M=!0;X=c&&(Pe>v&&(fe=fe.slice(0,v-Q)),Q0?1:(h instanceof f?h.text.length:h.children.length)<<1]}nextInner(h,c){for(this.done=this.lineBreak=!1;;){let v=this.nodes.length-1,Q=this.nodes[v],X=this.offsets[v],M=X>>1,fe=Q instanceof f?Q.text.length:Q.children.length;if(M==(c>0?fe:0)){if(v==0)return this.done=!0,this.value="",this;c>0&&this.offsets[v-1]++,this.nodes.pop(),this.offsets.pop()}else if((X&1)==(c>0?0:1)){if(this.offsets[v]+=c,h==0)return this.lineBreak=!0,this.value=` `,this;h--}else if(Q instanceof f){let Pe=Q.text[M+(c<0?-1:0)];if(this.offsets[v]+=c,Pe.length>Math.max(0,h))return this.value=h==0?Pe:c>0?Pe.slice(h):Pe.slice(0,Pe.length-h),this;h-=Pe.length}else{let Pe=Q.children[M+(c<0?-1:0)];h>Pe.length?(h-=Pe.length,this.offsets[v]+=c):(c<0&&this.offsets[v]--,this.nodes.push(Pe),this.offsets.push(c>0?1:(Pe instanceof f?Pe.text.length:Pe.children.length)<<1))}}}next(h=0){return h<0&&(this.nextInner(-h,-this.dir),h=this.value.length),this.nextInner(h,this.dir)}}class x{constructor(h,c,v){this.value="",this.done=!1,this.cursor=new m(h,c>v?-1:1),this.pos=c>v?h.length:0,this.from=Math.min(c,v),this.to=Math.max(c,v)}nextInner(h,c){if(c<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;h+=Math.max(0,c<0?this.pos-this.to:this.from-this.pos);let v=c<0?this.pos-this.from:this.to-this.pos;h>v&&(h=v),v-=h;let{value:Q}=this.cursor.next(h);return this.pos+=(Q.length+h)*c,this.value=Q.length<=v?Q:c<0?Q.slice(Q.length-v):Q.slice(0,v),this.done=!this.value,this}next(h=0){return h<0?h=Math.max(h,this.from-this.pos):h>0&&(h=Math.min(h,this.to-this.pos)),this.nextInner(h,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class V{constructor(h){this.inner=h,this.afterBreak=!0,this.value="",this.done=!1}next(h=0){let{done:c,lineBreak:v,value:Q}=this.inner.next(h);return c&&this.afterBreak?(this.value="",this.afterBreak=!1):c?(this.done=!0,this.value=""):v?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=Q,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol!="undefined"&&(l.prototype[Symbol.iterator]=function(){return this.iter()},m.prototype[Symbol.iterator]=x.prototype[Symbol.iterator]=V.prototype[Symbol.iterator]=function(){return this});class U{constructor(h,c,v,Q){this.from=h,this.to=c,this.number=v,this.text=Q}get length(){return this.to-this.from}}function te(ue,h,c){return h=Math.max(0,Math.min(ue.length,h)),[h,Math.max(h,Math.min(ue.length,c))]}let w="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(ue=>ue?parseInt(ue,36):1);for(let ue=1;ueue)return w[h-1]<=ue;return!1}function N(ue){return ue>=127462&&ue<=127487}const xe=8205;function be(ue,h,c=!0,v=!0){return(c?ne:me)(ue,h,v)}function ne(ue,h,c){if(h==ue.length)return h;h&&ke(ue.charCodeAt(h))&&re(ue.charCodeAt(h-1))&&h--;let v=ae(ue,h);for(h+=Ee(v);h=0&&N(ae(ue,M));)X++,M-=2;if(X%2==0)break;h+=2}else break}return h}function me(ue,h,c){for(;h>0;){let v=ne(ue,h-2,c);if(v=56320&&ue<57344}function re(ue){return ue>=55296&&ue<56320}function ae(ue,h){let c=ue.charCodeAt(h);if(!re(c)||h+1==ue.length)return c;let v=ue.charCodeAt(h+1);return ke(v)?(c-55296<<10)+(v-56320)+65536:c}function Ce(ue){return ue<=65535?String.fromCharCode(ue):(ue-=65536,String.fromCharCode((ue>>10)+55296,(ue&1023)+56320))}function Ee(ue){return ue<65536?1:2}const nt=/\r\n?|\n/;var qe=function(ue){return ue[ue.Simple=0]="Simple",ue[ue.TrackDel=1]="TrackDel",ue[ue.TrackBefore=2]="TrackBefore",ue[ue.TrackAfter=3]="TrackAfter",ue}(qe||(qe={}));class dt{constructor(h){this.sections=h}get length(){let h=0;for(let c=0;ch)return X+(h-Q);X+=fe}else{if(v!=qe.Simple&&Fe>=h&&(v==qe.TrackDel&&Qh||v==qe.TrackBefore&&Qh))return null;if(Fe>h||Fe==h&&c<0&&!fe)return h==Q||c<0?X:X+Pe;X+=Pe}Q=Fe}if(h>Q)throw new RangeError(`Position ${h} is out of range for changeset of length ${Q}`);return X}touchesRange(h,c=h){for(let v=0,Q=0;v=0&&Q<=c&&fe>=h)return Qc?"cover":!0;Q=fe}return!1}toString(){let h="";for(let c=0;c=0?":"+Q:"")}return h}toJSON(){return this.sections}static fromJSON(h){if(!Array.isArray(h)||h.length%2||h.some(c=>typeof c!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new dt(h)}static create(h){return new dt(h)}}class Je extends dt{constructor(h,c){super(h);this.inserted=c}apply(h){if(this.length!=h.length)throw new RangeError("Applying change set to a document with the wrong length");return Re(this,(c,v,Q,X,M)=>h=h.replace(Q,Q+(v-c),M),!1),h}mapDesc(h,c=!1){return Ie(this,h,c,!0)}invert(h){let c=this.sections.slice(),v=[];for(let Q=0,X=0;Q=0){c[Q]=fe,c[Q+1]=M;let Pe=Q>>1;for(;v.length0&&Rt(v,c,X.text),X.forward(pt),fe+=pt}let Fe=h[M++];for(;fe>1].toJSON()))}return h}static of(h,c,v){let Q=[],X=[],M=0,fe=null;function Pe(pt=!1){if(!pt&&!Q.length)return;MF||Zt<0||F>c)throw new RangeError(`Invalid change range ${Zt} to ${F} (in doc of length ${c})`);let Y=P?typeof P=="string"?l.of(P.split(v||nt)):P:l.empty,he=Y.length;if(Zt==F&&he==0)return;ZtM&<(Q,Zt-M,-1),lt(Q,F-Zt,he),Rt(X,Q,Y),M=F}}return Fe(h),Pe(!fe),fe}static empty(h){return new Je(h?[h,-1]:[],[])}static fromJSON(h){if(!Array.isArray(h))throw new RangeError("Invalid JSON representation of ChangeSet");let c=[],v=[];for(let Q=0;Qfe&&typeof M!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(X.length==1)c.push(X[0],0);else{for(;v.length=0&&c<=0&&c==ue[Q+1]?ue[Q]+=h:h==0&&ue[Q]==0?ue[Q+1]+=c:v?(ue[Q]+=h,ue[Q+1]+=c):ue.push(h,c)}function Rt(ue,h,c){if(c.length==0)return;let v=h.length-2>>1;if(v>1])),!(c||M==ue.sections.length||ue.sections[M+1]<0);)fe=ue.sections[M++],Pe=ue.sections[M++];h(Q,Fe,X,pt,Zt),Q=Fe,X=pt}}}function Ie(ue,h,c,v=!1){let Q=[],X=v?[]:null,M=new I(ue),fe=new I(h);for(let Pe=-1;;)if(M.ins==-1&&fe.ins==-1){let Fe=Math.min(M.len,fe.len);lt(Q,Fe,-1),M.forward(Fe),fe.forward(Fe)}else if(fe.ins>=0&&(M.ins<0||Pe==M.i||M.off==0&&(fe.len=0&&Pe=0){let Fe=0,pt=M.len;for(;pt;)if(fe.ins==-1){let Zt=Math.min(pt,fe.len);Fe+=Zt,pt-=Zt,fe.forward(Zt)}else if(fe.ins==0&&fe.lenPe||M.ins>=0&&M.len>Pe)&&(fe||v.length>Fe),X.forward2(Pe),M.forward(Pe)}}}}class I{constructor(h){this.set=h,this.i=0,this.next()}next(){let{sections:h}=this.set;this.i>1;return c>=h.length?l.empty:h[c]}textBit(h){let{inserted:c}=this.set,v=this.i-2>>1;return v>=c.length&&!h?l.empty:c[v].slice(this.off,h==null?void 0:this.off+h)}forward(h){h==this.len?this.next():(this.len-=h,this.off+=h)}forward2(h){this.ins==-1?this.forward(h):h==this.ins?this.next():(this.ins-=h,this.off+=h)}}class H{constructor(h,c,v){this.from=h,this.to=c,this.flags=v}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let h=this.flags&7;return h==7?null:h}get goalColumn(){let h=this.flags>>6;return h==16777215?void 0:h}map(h,c=-1){let v,Q;return this.empty?v=Q=h.mapPos(this.from,c):(v=h.mapPos(this.from,1),Q=h.mapPos(this.to,-1)),v==this.from&&Q==this.to?this:new H(v,Q,this.flags)}extend(h,c=h){if(h<=this.anchor&&c>=this.anchor)return W.range(h,c);let v=Math.abs(h-this.anchor)>Math.abs(c-this.anchor)?h:c;return W.range(this.anchor,v)}eq(h,c=!1){return this.anchor==h.anchor&&this.head==h.head&&(!c||!this.empty||this.assoc==h.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(h){if(!h||typeof h.anchor!="number"||typeof h.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return W.range(h.anchor,h.head)}static create(h,c,v){return new H(h,c,v)}}class W{constructor(h,c){this.ranges=h,this.mainIndex=c}map(h,c=-1){return h.empty?this:W.create(this.ranges.map(v=>v.map(h,c)),this.mainIndex)}eq(h,c=!1){if(this.ranges.length!=h.ranges.length||this.mainIndex!=h.mainIndex)return!1;for(let v=0;vh.toJSON()),main:this.mainIndex}}static fromJSON(h){if(!h||!Array.isArray(h.ranges)||typeof h.main!="number"||h.main>=h.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new W(h.ranges.map(c=>H.fromJSON(c)),h.main)}static single(h,c=h){return new W([W.range(h,c)],0)}static create(h,c=0){if(h.length==0)throw new RangeError("A selection needs at least one range");for(let v=0,Q=0;Qh?8:0)|X)}static normalized(h,c=0){let v=h[c];h.sort((Q,X)=>Q.from-X.from),c=h.indexOf(v);for(let Q=1;QX.head?W.range(Pe,fe):W.range(fe,Pe))}}return new W(h,c)}}function q(ue,h){for(let c of ue.ranges)if(c.to>h)throw new RangeError("Selection points outside of document")}let K=0;class Se{constructor(h,c,v,Q,X){this.combine=h,this.compareInput=c,this.compare=v,this.isStatic=Q,this.id=K++,this.default=h([]),this.extensions=typeof X=="function"?X(this):X}get reader(){return this}static define(h={}){return new Se(h.combine||(c=>c),h.compareInput||((c,v)=>c===v),h.compare||(h.combine?(c,v)=>c===v:Ke),!!h.static,h.enables)}of(h){return new ot([],this,0,h)}compute(h,c){if(this.isStatic)throw new Error("Can't compute a static facet");return new ot(h,this,1,c)}computeN(h,c){if(this.isStatic)throw new Error("Can't compute a static facet");return new ot(h,this,2,c)}from(h,c){return c||(c=v=>v),this.compute([h],v=>c(v.field(h)))}}function Ke(ue,h){return ue==h||ue.length==h.length&&ue.every((c,v)=>c===h[v])}class ot{constructor(h,c,v,Q){this.dependencies=h,this.facet=c,this.type=v,this.value=Q,this.id=K++}dynamicSlot(h){var c;let v=this.value,Q=this.facet.compareInput,X=this.id,M=h[X]>>1,fe=this.type==2,Pe=!1,Fe=!1,pt=[];for(let Zt of this.dependencies)Zt=="doc"?Pe=!0:Zt=="selection"?Fe=!0:(((c=h[Zt.id])!==null&&c!==void 0?c:1)&1)==0&&pt.push(h[Zt.id]);return{create(Zt){return Zt.values[M]=v(Zt),1},update(Zt,F){if(Pe&&F.docChanged||Fe&&(F.docChanged||F.selection)||ut(Zt,pt)){let P=v(Zt);if(fe?!mt(P,Zt.values[M],Q):!Q(P,Zt.values[M]))return Zt.values[M]=P,1}return 0},reconfigure:(Zt,F)=>{let P,Y=F.config.address[X];if(Y!=null){let he=Te(F,Y);if(this.dependencies.every(le=>le instanceof Se?F.facet(le)===Zt.facet(le):le instanceof It?F.field(le,!1)==Zt.field(le,!1):!0)||(fe?mt(P=v(Zt),he,Q):Q(P=v(Zt),he)))return Zt.values[M]=he,0}else P=v(Zt);return Zt.values[M]=P,1}}}}function mt(ue,h,c){if(ue.length!=h.length)return!1;for(let v=0;vue[Pe.id]),Q=c.map(Pe=>Pe.type),X=v.filter(Pe=>!(Pe&1)),M=ue[h.id]>>1;function fe(Pe){let Fe=[];for(let pt=0;ptv===Q),h);return h.provide&&(c.provides=h.provide(c)),c}create(h){let c=h.facet(zt).find(v=>v.field==this);return((c==null?void 0:c.create)||this.createF)(h)}slot(h){let c=h[this.id]>>1;return{create:v=>(v.values[c]=this.create(v),1),update:(v,Q)=>{let X=v.values[c],M=this.updateF(X,Q);return this.compareF(X,M)?0:(v.values[c]=M,1)},reconfigure:(v,Q)=>Q.config.address[this.id]!=null?(v.values[c]=Q.field(this),0):(v.values[c]=this.create(v),1)}}init(h){return[this,zt.of({field:this,create:h})]}get extension(){return this}}const sn={lowest:4,low:3,default:2,high:1,highest:0};function on(ue){return h=>new $t(h,ue)}const Xt={highest:on(sn.highest),high:on(sn.high),default:on(sn.default),low:on(sn.low),lowest:on(sn.lowest)};class $t{constructor(h,c){this.inner=h,this.prec=c}}class Ve{of(h){return new A(this,h)}reconfigure(h){return Ve.reconfigure.of({compartment:this,extension:h})}get(h){return h.config.compartments.get(this)}}class A{constructor(h,c){this.compartment=h,this.inner=c}}class D{constructor(h,c,v,Q,X,M){for(this.base=h,this.compartments=c,this.dynamicSlots=v,this.address=Q,this.staticValues=X,this.facets=M,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(h,c,v){let Q=[],X=Object.create(null),M=new Map;for(let F of oe(h,c,M))F instanceof It?Q.push(F):(X[F.facet.id]||(X[F.facet.id]=[])).push(F);let fe=Object.create(null),Pe=[],Fe=[];for(let F of Q)fe[F.id]=Fe.length<<1,Fe.push(P=>F.slot(P));let pt=v==null?void 0:v.config.facets;for(let F in X){let P=X[F],Y=P[0].facet,he=pt&&pt[F]||[];if(P.every(le=>le.type==0))if(fe[Y.id]=Pe.length<<1|1,Ke(he,P))Pe.push(v.facet(Y));else{let le=Y.combine(P.map(je=>je.value));Pe.push(v&&Y.compare(le,v.facet(Y))?v.facet(Y):le)}else{for(let le of P)le.type==0?(fe[le.id]=Pe.length<<1|1,Pe.push(le.value)):(fe[le.id]=Fe.length<<1,Fe.push(je=>le.dynamicSlot(je)));fe[Y.id]=Fe.length<<1,Fe.push(le=>Vt(le,Y,P))}}let Zt=Fe.map(F=>F(fe));return new D(h,M,Zt,fe,Pe,X)}}function oe(ue,h,c){let v=[[],[],[],[],[]],Q=new Map;function X(M,fe){let Pe=Q.get(M);if(Pe!=null){if(Pe<=fe)return;let Fe=v[Pe].indexOf(M);Fe>-1&&v[Pe].splice(Fe,1),M instanceof A&&c.delete(M.compartment)}if(Q.set(M,fe),Array.isArray(M))for(let Fe of M)X(Fe,fe);else if(M instanceof A){if(c.has(M.compartment))throw new RangeError("Duplicate use of compartment in extensions");let Fe=h.get(M.compartment)||M.inner;c.set(M.compartment,Fe),X(Fe,fe)}else if(M instanceof $t)X(M.inner,M.prec);else if(M instanceof It)v[fe].push(M),M.provides&&X(M.provides,fe);else if(M instanceof ot)v[fe].push(M),M.facet.extensions&&X(M.facet.extensions,sn.default);else{let Fe=M.extension;if(!Fe)throw new Error(`Unrecognized extension value in extension set (${M}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);X(Fe,fe)}}return X(ue,sn.default),v.reduce((M,fe)=>M.concat(fe))}function ge(ue,h){if(h&1)return 2;let c=h>>1,v=ue.status[c];if(v==4)throw new Error("Cyclic dependency between fields and/or facets");if(v&2)return v;ue.status[c]=4;let Q=ue.computeSlot(ue,ue.config.dynamicSlots[c]);return ue.status[c]=2|Q}function Te(ue,h){return h&1?ue.config.staticValues[h>>1]:ue.values[h>>1]}const Ne=Se.define(),rt=Se.define({combine:ue=>ue.some(h=>h),static:!0}),Lt=Se.define({combine:ue=>ue.length?ue[0]:void 0,static:!0}),Yt=Se.define(),Bt=Se.define(),nn=Se.define(),hn=Se.define({combine:ue=>ue.length?ue[0]:!1});class tn{constructor(h,c){this.type=h,this.value=c}static define(){return new gn}}class gn{of(h){return new tn(this,h)}}class Le{constructor(h){this.map=h}of(h){return new ze(this,h)}}class ze{constructor(h,c){this.type=h,this.value=c}map(h){let c=this.type.map(this.value,h);return c===void 0?void 0:c==this.value?this:new ze(this.type,c)}is(h){return this.type==h}static define(h={}){return new Le(h.map||(c=>c))}static mapEffects(h,c){if(!h.length)return h;let v=[];for(let Q of h){let X=Q.map(c);X&&v.push(X)}return v}}ze.reconfigure=ze.define(),ze.appendConfig=ze.define();class Ot{constructor(h,c,v,Q,X,M){this.startState=h,this.changes=c,this.selection=v,this.effects=Q,this.annotations=X,this.scrollIntoView=M,this._doc=null,this._state=null,v&&q(v,c.newLength),X.some(fe=>fe.type==Ot.time)||(this.annotations=X.concat(Ot.time.of(Date.now())))}static create(h,c,v,Q,X,M){return new Ot(h,c,v,Q,X,M)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(h){for(let c of this.annotations)if(c.type==h)return c.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(h){let c=this.annotation(Ot.userEvent);return!!(c&&(c==h||c.length>h.length&&c.slice(0,h.length)==h&&c[h.length]=="."))}}Ot.time=tn.define(),Ot.userEvent=tn.define(),Ot.addToHistory=tn.define(),Ot.remote=tn.define();function yt(ue,h){let c=[];for(let v=0,Q=0;;){let X,M;if(v=ue[v]))X=ue[v++],M=ue[v++];else if(Q=0;Q--){let X=v[Q](ue);X instanceof Ot?ue=X:Array.isArray(X)&&X.length==1&&X[0]instanceof Ot?ue=X[0]:ue=it(h,Tt(X),!1)}return ue}function Pt(ue){let h=ue.startState,c=h.facet(nn),v=ue;for(let Q=c.length-1;Q>=0;Q--){let X=c[Q](ue);X&&Object.keys(X).length&&(v=Oe(v,Ge(h,X,ue.changes.newLength),!0))}return v==ue?ue:Ot.create(h,ue.changes,ue.selection,v.effects,v.annotations,v.scrollIntoView)}const qt=[];function Tt(ue){return ue==null?qt:Array.isArray(ue)?ue:[ue]}var Ht=function(ue){return ue[ue.Word=0]="Word",ue[ue.Space=1]="Space",ue[ue.Other=2]="Other",ue}(Ht||(Ht={}));const Gt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let xt;try{xt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(ue){}function Kt(ue){if(xt)return xt.test(ue);for(let h=0;h"\x80"&&(c.toUpperCase()!=c.toLowerCase()||Gt.test(c)))return!0}return!1}function Jt(ue){return h=>{if(!/\S/.test(h))return Ht.Space;if(Kt(h))return Ht.Word;for(let c=0;c-1)return Ht.Word;return Ht.Other}}class en{constructor(h,c,v,Q,X,M){this.config=h,this.doc=c,this.selection=v,this.values=Q,this.status=h.statusTemplate.slice(),this.computeSlot=X,M&&(M._state=this);for(let fe=0;feQ.set(Fe,Pe)),c=null),Q.set(fe.value.compartment,fe.value.extension)):fe.is(ze.reconfigure)?(c=null,v=fe.value):fe.is(ze.appendConfig)&&(c=null,v=Tt(v).concat(fe.value));let X;c?X=h.startState.values.slice():(c=D.resolve(v,Q,this),X=new en(c,this.doc,this.selection,c.dynamicSlots.map(()=>null),(Pe,Fe)=>Fe.reconfigure(Pe,this),null).values);let M=h.startState.facet(rt)?h.newSelection:h.newSelection.asSingle();new en(c,h.newDoc,M,X,(fe,Pe)=>Pe.update(fe,h),h)}replaceSelection(h){return typeof h=="string"&&(h=this.toText(h)),this.changeByRange(c=>({changes:{from:c.from,to:c.to,insert:h},range:W.cursor(c.from+h.length)}))}changeByRange(h){let c=this.selection,v=h(c.ranges[0]),Q=this.changes(v.changes),X=[v.range],M=Tt(v.effects);for(let fe=1;feM.spec.fromJSON(fe,Pe)))}}return en.create({doc:h.doc,selection:W.fromJSON(h.selection),extensions:c.extensions?Q.concat([c.extensions]):Q})}static create(h={}){let c=D.resolve(h.extensions||[],new Map),v=h.doc instanceof l?h.doc:l.of((h.doc||"").split(c.staticFacet(en.lineSeparator)||nt)),Q=h.selection?h.selection instanceof W?h.selection:W.single(h.selection.anchor,h.selection.head):W.single(0);return q(Q,v.length),c.staticFacet(rt)||(Q=Q.asSingle()),new en(c,v,Q,c.dynamicSlots.map(()=>null),(X,M)=>M.create(X),null)}get tabSize(){return this.facet(en.tabSize)}get lineBreak(){return this.facet(en.lineSeparator)||` `}get readOnly(){return this.facet(hn)}phrase(h,...c){for(let v of this.facet(en.phrases))if(Object.prototype.hasOwnProperty.call(v,h)){h=v[h];break}return c.length&&(h=h.replace(/\$(\$|\d*)/g,(v,Q)=>{if(Q=="$")return"$";let X=+(Q||1);return!X||X>c.length?v:c[X-1]})),h}languageDataAt(h,c,v=-1){let Q=[];for(let X of this.facet(Ne))for(let M of X(this,c,v))Object.prototype.hasOwnProperty.call(M,h)&&Q.push(M[h]);return Q}charCategorizer(h){return Jt(this.languageDataAt("wordChars",h).join(""))}wordAt(h){let{text:c,from:v,length:Q}=this.doc.lineAt(h),X=this.charCategorizer(h),M=h-v,fe=h-v;for(;M>0;){let Pe=be(c,M,!1);if(X(c.slice(Pe,M))!=Ht.Word)break;M=Pe}for(;feue.length?ue[0]:4}),en.lineSeparator=Lt,en.readOnly=hn,en.phrases=Se.define({compare(ue,h){let c=Object.keys(ue),v=Object.keys(h);return c.length==v.length&&c.every(Q=>ue[Q]==h[Q])}}),en.languageData=Ne,en.changeFilter=Yt,en.transactionFilter=Bt,en.transactionExtender=nn,Ve.reconfigure=ze.define();function _t(ue,h,c={}){let v={};for(let Q of ue)for(let X of Object.keys(Q)){let M=Q[X],fe=v[X];if(fe===void 0)v[X]=M;else if(!(fe===M||M===void 0))if(Object.hasOwnProperty.call(c,X))v[X]=c[X](fe,M);else throw new Error("Config merge conflict for field "+X)}for(let Q in h)v[Q]===void 0&&(v[Q]=h[Q]);return v}class On{eq(h){return this==h}range(h,c=h){return dn.create(h,c,this)}}On.prototype.startSide=On.prototype.endSide=0,On.prototype.point=!1,On.prototype.mapMode=qe.TrackDel;class dn{constructor(h,c,v){this.from=h,this.to=c,this.value=v}static create(h,c,v){return new dn(h,c,v)}}function Ln(ue,h){return ue.from-h.from||ue.value.startSide-h.value.startSide}class En{constructor(h,c,v,Q){this.from=h,this.to=c,this.value=v,this.maxPoint=Q}get length(){return this.to[this.to.length-1]}findIndex(h,c,v,Q=0){let X=v?this.to:this.from;for(let M=Q,fe=X.length;;){if(M==fe)return M;let Pe=M+fe>>1,Fe=X[Pe]-h||(v?this.value[Pe].endSide:this.value[Pe].startSide)-c;if(Pe==M)return Fe>=0?M:fe;Fe>=0?fe=Pe:M=Pe+1}}between(h,c,v,Q){for(let X=this.findIndex(c,-1e9,!0),M=this.findIndex(v,1e9,!1,X);XP||F==P&&Fe.startSide>0&&Fe.endSide<=0)continue;(P-F||Fe.endSide-Fe.startSide)<0||(M<0&&(M=F),Fe.point&&(fe=Math.max(fe,P-F)),v.push(Fe),Q.push(F-M),X.push(P-M))}return{mapped:v.length?new En(Q,X,v,fe):null,pos:M}}}class vn{constructor(h,c,v,Q){this.chunkPos=h,this.chunk=c,this.nextLayer=v,this.maxPoint=Q}static create(h,c,v,Q){return new vn(h,c,v,Q)}get length(){let h=this.chunk.length-1;return h<0?0:Math.max(this.chunkEnd(h),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let h=this.nextLayer.size;for(let c of this.chunk)h+=c.value.length;return h}chunkEnd(h){return this.chunkPos[h]+this.chunk[h].length}update(h){let{add:c=[],sort:v=!1,filterFrom:Q=0,filterTo:X=this.length}=h,M=h.filter;if(c.length==0&&!M)return this;if(v&&(c=c.slice().sort(Ln)),this.isEmpty)return c.length?vn.of(c):this;let fe=new li(this,null,-1).goto(0),Pe=0,Fe=[],pt=new Dn;for(;fe.value||Pe=0){let Zt=c[Pe++];pt.addInner(Zt.from,Zt.to,Zt.value)||Fe.push(Zt)}else fe.rangeIndex==1&&fe.chunkIndexthis.chunkEnd(fe.chunkIndex)||Xfe.to||X=X&&h<=X+M.length&&M.between(X,h-X,c-X,v)===!1)return}this.nextLayer.between(h,c,v)}}iter(h=0){return Kn.from([this]).goto(h)}get isEmpty(){return this.nextLayer==this}static iter(h,c=0){return Kn.from(h).goto(c)}static compare(h,c,v,Q,X=-1){let M=h.filter(Zt=>Zt.maxPoint>0||!Zt.isEmpty&&Zt.maxPoint>=X),fe=c.filter(Zt=>Zt.maxPoint>0||!Zt.isEmpty&&Zt.maxPoint>=X),Pe=Jn(M,fe,v),Fe=new Rn(M,Pe,X),pt=new Rn(fe,Pe,X);v.iterGaps((Zt,F,P)=>yi(Fe,Zt,pt,F,P,Q)),v.empty&&v.length==0&&yi(Fe,0,pt,0,0,Q)}static eq(h,c,v=0,Q){Q==null&&(Q=1e9-1);let X=h.filter(pt=>!pt.isEmpty&&c.indexOf(pt)<0),M=c.filter(pt=>!pt.isEmpty&&h.indexOf(pt)<0);if(X.length!=M.length)return!1;if(!X.length)return!0;let fe=Jn(X,M),Pe=new Rn(X,fe,0).goto(v),Fe=new Rn(M,fe,0).goto(v);for(;;){if(Pe.to!=Fe.to||!di(Pe.active,Fe.active)||Pe.point&&(!Fe.point||!Pe.point.eq(Fe.point)))return!1;if(Pe.to>Q)return!0;Pe.next(),Fe.next()}}static spans(h,c,v,Q,X=-1){let M=new Rn(h,null,X).goto(c),fe=c,Pe=M.openStart;for(;;){let Fe=Math.min(M.to,v);if(M.point){let pt=M.activeForPoint(M.to),Zt=M.pointFromfe&&(Q.span(fe,Fe,M.active,Pe),Pe=M.openEnd(Fe));if(M.to>v)return Pe+(M.point&&M.to>v?1:0);fe=M.to,M.next()}}static of(h,c=!1){let v=new Dn;for(let Q of h instanceof dn?[h]:c?In(h):h)v.add(Q.from,Q.to,Q.value);return v.finish()}static join(h){if(!h.length)return vn.empty;let c=h[h.length-1];for(let v=h.length-2;v>=0;v--)for(let Q=h[v];Q!=vn.empty;Q=Q.nextLayer)c=new vn(Q.chunkPos,Q.chunk,c,Math.max(Q.maxPoint,c.maxPoint));return c}}vn.empty=new vn([],[],null,-1);function In(ue){if(ue.length>1)for(let h=ue[0],c=1;c0)return ue.slice().sort(Ln);h=v}return ue}vn.empty.nextLayer=vn.empty;class Dn{finishChunk(h){this.chunks.push(new En(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,h&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(h,c,v){this.addInner(h,c,v)||(this.nextLayer||(this.nextLayer=new Dn)).add(h,c,v)}addInner(h,c,v){let Q=h-this.lastTo||v.startSide-this.last.endSide;if(Q<=0&&(h-this.lastFrom||v.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return Q<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=h),this.from.push(h-this.chunkStart),this.to.push(c-this.chunkStart),this.last=v,this.lastFrom=h,this.lastTo=c,this.value.push(v),v.point&&(this.maxPoint=Math.max(this.maxPoint,c-h)),!0)}addChunk(h,c){if((h-this.lastTo||c.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,c.maxPoint),this.chunks.push(c),this.chunkPos.push(h);let v=c.value.length-1;return this.last=c.value[v],this.lastFrom=c.from[v]+h,this.lastTo=c.to[v]+h,!0}finish(){return this.finishInner(vn.empty)}finishInner(h){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return h;let c=vn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(h):h,this.setMaxPoint);return this.from=null,c}}function Jn(ue,h,c){let v=new Map;for(let X of ue)for(let M=0;M=this.minPoint)break}}setRangeIndex(h){if(h==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=v&&Q.push(new li(M,c,v,X));return Q.length==1?Q[0]:new Kn(Q)}get startSide(){return this.value?this.value.startSide:0}goto(h,c=-1e9){for(let v of this.heap)v.goto(h,c);for(let v=this.heap.length>>1;v>=0;v--)bi(this.heap,v);return this.next(),this}forward(h,c){for(let v of this.heap)v.forward(h,c);for(let v=this.heap.length>>1;v>=0;v--)bi(this.heap,v);(this.to-h||this.value.endSide-c)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let h=this.heap[0];this.from=h.from,this.to=h.to,this.value=h.value,this.rank=h.rank,h.value&&h.next(),bi(this.heap,0)}}}function bi(ue,h){for(let c=ue[h];;){let v=(h<<1)+1;if(v>=ue.length)break;let Q=ue[v];if(v+1=0&&(Q=ue[v+1],v++),c.compare(Q)<0)break;ue[v]=c,ue[h]=Q,h=v}}class Rn{constructor(h,c,v){this.minPoint=v,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Kn.from(h,c,v)}goto(h,c=-1e9){return this.cursor.goto(h,c),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=h,this.endSide=c,this.openStart=-1,this.next(),this}forward(h,c){for(;this.minActive>-1&&(this.activeTo[this.minActive]-h||this.active[this.minActive].endSide-c)<0;)this.removeActive(this.minActive);this.cursor.forward(h,c)}removeActive(h){ai(this.active,h),ai(this.activeTo,h),ai(this.activeRank,h),this.minActive=Un(this.active,this.activeTo)}addActive(h){let c=0,{value:v,to:Q,rank:X}=this.cursor;for(;c0;)c++;ci(this.active,c,v),ci(this.activeTo,c,Q),ci(this.activeRank,c,X),h&&ci(h,c,this.cursor.from),this.minActive=Un(this.active,this.activeTo)}next(){let h=this.to,c=this.point;this.point=null;let v=this.openStart<0?[]:null;for(;;){let Q=this.minActive;if(Q>-1&&(this.activeTo[Q]-this.cursor.from||this.active[Q].endSide-this.cursor.startSide)<0){if(this.activeTo[Q]>h){this.to=this.activeTo[Q],this.endSide=this.active[Q].endSide;break}this.removeActive(Q),v&&ai(v,Q)}else if(this.cursor.value)if(this.cursor.from>h){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let X=this.cursor.value;if(!X.point)this.addActive(v),this.cursor.next();else if(c&&this.cursor.to==this.to&&this.cursor.from=0&&v[Q]=0&&!(this.activeRank[v]h||this.activeTo[v]==h&&this.active[v].endSide>=this.point.endSide)&&c.push(this.active[v]);return c.reverse()}openEnd(h){let c=0;for(let v=this.activeTo.length-1;v>=0&&this.activeTo[v]>h;v--)c++;return c}}function yi(ue,h,c,v,Q,X){ue.goto(h),c.goto(v);let M=v+Q,fe=v,Pe=v-h;for(;;){let Fe=ue.to+Pe-c.to||ue.endSide-c.endSide,pt=Fe<0?ue.to+Pe:c.to,Zt=Math.min(pt,M);if(ue.point||c.point?ue.point&&c.point&&(ue.point==c.point||ue.point.eq(c.point))&&di(ue.activeForPoint(ue.to),c.activeForPoint(c.to))||X.comparePoint(fe,Zt,ue.point,c.point):Zt>fe&&!di(ue.active,c.active)&&X.compareRange(fe,Zt,ue.active,c.active),pt>M)break;fe=pt,Fe<=0&&ue.next(),Fe>=0&&c.next()}}function di(ue,h){if(ue.length!=h.length)return!1;for(let c=0;c=h;v--)ue[v+1]=ue[v];ue[h]=c}function Un(ue,h){let c=-1,v=1e9;for(let Q=0;Q=h)return Q;if(Q==ue.length)break;X+=ue.charCodeAt(Q)==9?c-X%c:1,Q=be(ue,Q)}return v===!0?-1:ue.length}},30111:function(Xe,ye,o){"use strict";o.d(ye,{p:function(){return Ye},Nm:function(){return _t},tk:function(){return zn},lg:function(){return We},l9:function(){return Ge},gB:function(){return pn},$f:function(){return Ps},OO:function(){return Y},W$:function(){return No},hJ:function(){return ft}});for(var l=o(74405),f=o(14043),p={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),S=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),m=0;m<10;m++)p[48+m]=p[96+m]=String(m);for(var m=1;m<=24;m++)p[m+111]="F"+m;for(var m=65;m<=90;m++)p[m]=String.fromCharCode(m+32),d[m]=String.fromCharCode(m);for(var x in p)d.hasOwnProperty(x)||(d[x]=p[x]);function V(s){var e=a&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||S&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?d:p)[s.keyCode]||s.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function U(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function te(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function w(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ce(s,e){if(!e.anchorNode)return!1;try{return te(s,e.anchorNode)}catch(t){return!1}}function N(s){return s.nodeType==3?lt(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function xe(s,e,t,n){return t?ne(s,e,t,n,-1)||ne(s,e,t,n,1):!1}function be(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function ne(s,e,t,n,r){for(;;){if(s==t&&e==n)return!0;if(e==(r<0?0:me(s))){if(s.nodeName=="DIV")return!1;let u=s.parentNode;if(!u||u.nodeType!=1)return!1;e=be(s)+(r<0?0:1),s=u}else if(s.nodeType==1){if(s=s.childNodes[e+(r<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=r<0?me(s):0}else return!1}}function me(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function ke(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function re(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function ae(s,e){let t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-s.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Ce(s,e,t,n,r,u,y,T){let R=s.ownerDocument,_=R.defaultView||window;for(let G=s,we=!1;G&&!we;)if(G.nodeType==1){let Ze,Ue=G==R.body,tt=1,wt=1;if(Ue)Ze=re(_);else{if(/^(fixed|sticky)$/.test(getComputedStyle(G).position)&&(we=!0),G.scrollHeight<=G.clientHeight&&G.scrollWidth<=G.clientWidth){G=G.assignedSlot||G.parentNode;continue}let mn=G.getBoundingClientRect();({scaleX:tt,scaleY:wt}=ae(G,mn)),Ze={left:mn.left,right:mn.left+G.clientWidth*tt,top:mn.top,bottom:mn.top+G.clientHeight*wt}}let gt=0,Et=0;if(r=="nearest")e.top0&&e.bottom>Ze.bottom+Et&&(Et=e.bottom-Ze.bottom+Et+y)):e.bottom>Ze.bottom&&(Et=e.bottom-Ze.bottom+y,t<0&&e.top-Et0&&e.right>Ze.right+gt&&(gt=e.right-Ze.right+gt+u)):e.right>Ze.right&&(gt=e.right-Ze.right+u,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class nt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?me(t):0),n,Math.min(e.focusOffset,n?me(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let qe=null;function dt(s){if(s.setActive)return s.setActive();if(qe)return s.focus(qe);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(qe==null?{get preventScroll(){return qe={preventScroll:!0},!0}}:void 0),!qe){qe=!1;for(let t=0;tMath.max(1,s.scrollHeight-s.clientHeight-4)}class H{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new H(e.parentNode,be(e),t)}static after(e,t){return new H(e.parentNode,be(e)+1,t)}}const W=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,r=null,u;for(let y of this.children){if(y.flags&7){if(!y.dom&&(u=r?r.nextSibling:n.firstChild)){let T=q.get(u);(!T||!T.parent&&T.canReuseDOM(y))&&y.reuseDOM(u)}y.sync(e,t),y.flags&=~7}if(u=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&u!=y.dom&&(t.written=!0),y.dom.parentNode==n)for(;u&&u!=y.dom;)u=K(u);else n.insertBefore(y.dom,u);r=y.dom}for(u=r?r.nextSibling:n.firstChild,u&&t&&t.node==n&&(t.written=!0);u;)u=K(u)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=~7)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=me(e)==0?0:t==0?-1:1;for(;;){let u=e.parentNode;if(u==this.dom)break;r==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?r=-1:r=1),e=u}r<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!q.get(n);)n=n.nextSibling;if(!n)return this.length;for(let r=0,u=0;;r++){let y=this.children[r];if(y.dom==n)return u;u+=y.length+y.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,u=-1,y=-1,T=-1;for(let R=0,_=n,G=n;Rt)return we.domBoundsAround(e,t,_);if(Ze>=e&&r==-1&&(r=R,u=_),_>t&&we.dom.parentNode==this.dom){y=R,T=G;break}G=Ze,_=Ze+we.breakAfter}return{from:u,to:T<0?n+this.length:T,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:y=0?this.children[y].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=W){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Ke(s,e,t,n,r,u,y,T,R){let{children:_}=s,G=_.length?_[e]:null,we=u.length?u[u.length-1]:null,Ze=we?we.breakAfter:y;if(!(e==n&&G&&!y&&!Ze&&u.length<2&&G.merge(t,r,u.length?we:null,t==0,T,R))){if(n<_.length){let Ue=_[n];Ue&&(r0&&(!y&&u.length&&G.merge(t,G.length,u[0],!1,T,0)?G.breakAfter=u.shift().breakAfter:(t2);var D={mac:A||/Mac/.test(mt.platform),windows:/Win/.test(mt.platform),linux:/Linux|X11/.test(mt.platform),ie:sn,ie_version:zt?ut.documentMode||6:It?+It[1]:Vt?+Vt[1]:0,gecko:on,gecko_version:on?+(/Firefox\/(\d+)/.exec(mt.userAgent)||[0,0])[1]:0,chrome:!!Xt,chrome_version:Xt?+Xt[1]:0,ios:A,android:/Android\b/.test(mt.userAgent),webkit:$t,safari:Ve,webkit_version:$t?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ut.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const oe=256;class ge extends q{constructor(e){super();this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof ge)||this.length-(t-e)+n.length>oe||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ge(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new H(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Ne(this.dom,e,t)}}class Te extends q{constructor(e,t=[],n=0){super();this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Ie(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=4|2)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,u,y){return n&&(!(n instanceof Te&&n.mark.eq(this.mark))||e&&u<=0||te&&t.push(n=e&&(r=u),n=R,u++}let y=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new Te(this.mark,t,y)}domAtPos(e){return Yt(this,e)}coordsAt(e,t){return nn(this,e,t)}}function Ne(s,e,t){let n=s.nodeValue.length;e>n&&(e=n);let r=e,u=e,y=0;e==0&&t<0||e==n&&t>=0?D.chrome||D.gecko||(e?(r--,y=1):u=0)?0:T.length-1];return D.safari&&!y&&R.width==0&&(R=Array.prototype.find.call(T,_=>_.width)||R),y?ke(R,y<0):R||null}class rt extends q{static create(e,t,n){return new rt(e,t,n)}constructor(e,t,n){super();this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=rt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,u,y){return n&&(!(n instanceof rt)||!this.widget.compare(n.widget)||e>0&&u<=0||t0)?H.before(this.dom):H.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),u=null;if(!r.length)return null;let y=this.side?this.side<0:e>0;for(let T=y?r.length-1:0;u=r[T],!(e>0?T==0:T==r.length-1||u.top0?H.before(this.dom):H.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return l.xv.empty}get isHidden(){return!0}}ge.prototype.children=rt.prototype.children=Lt.prototype.children=W;function Yt(s,e){let t=s.dom,{children:n}=s,r=0;for(let u=0;ru&&e0;u--){let y=n[u-1];if(y.dom.parentNode==t)return y.domAtPos(y.length)}for(let u=r;u0&&e instanceof Te&&r.length&&(n=r[r.length-1])instanceof Te&&n.mark.eq(e.mark)?Bt(n,e.children[0],t-1):(r.push(e),e.setParent(s)),s.length+=e.length}function nn(s,e,t){let n=null,r=-1,u=null,y=-1;function T(_,G){for(let we=0,Ze=0;we<_.children.length&&Ze<=G;we++){let Ue=_.children[we],tt=Ze+Ue.length;tt>=G&&(Ue.children.length?T(Ue,G-Ze):(!u||u.isHidden&&t>0)&&(tt>G||Ze==tt&&Ue.getSide()>0)?(u=Ue,y=G-Ze):(Ze-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let u of n)if(u!=t&&(r.indexOf(u)==-1||s[u]!==e[u]))return!1;return!0}function ze(s,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?s.style.cssText="":s.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?s.style.cssText=t[r]:s.setAttribute(r,t[r]));return n}function Ot(s){let e=Object.create(null);for(let t=0;t0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Le(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Bt(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=tn(t,this.attrs||{})),n&&(this.attrs=tn({class:n},this.attrs||{}))}domAtPos(e){return Yt(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=4|2)}sync(e,t){var n;this.dom?this.flags&4&&(Ie(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(ze(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&q.get(r)instanceof Te;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=q.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!D.ios||!this.children.some(u=>u instanceof ge))){let u=document.createElement("BR");u.cmIgnore=!0,this.dom.appendChild(u)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof ge)||/[^ -~]/.test(n.text))return null;let r=N(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=nn(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,u=n.bottom-n.top;if(Math.abs(u-r.lineHeight)<2&&r.textHeight=t){if(u instanceof yt)return u;if(y>t)break}r=y+u.breakAfter}return null}}class Oe extends q{constructor(e,t,n){super();this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,u,y){return n&&(!(n instanceof Oe)||!this.widget.compare(n.widget)||e>0&&u<=0||t0}}class Ge{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var it=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(it||(it={}));class Ye extends l.uU{constructor(e,t,n,r){super();this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Pt(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Tt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:u,end:y}=Ht(e,t);n=(u?t?-3e8:-1:5e8)-1,r=(y?t?2e8:1:-6e8)+1}return new Tt(e,n,r,t,e.widget||null,!0)}static line(e){return new qt(e)}static set(e,t=!1){return l.Xs.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ye.none=l.Xs.empty;class Pt extends Ye{constructor(e){let{start:t,end:n}=Ht(e);super(t?-1:5e8,n?1:-6e8,null,e);this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Pt&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Le(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Pt.prototype.point=!1;class qt extends Ye{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof qt&&this.spec.class==e.spec.class&&Le(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}qt.prototype.mapMode=l.gc.TrackBefore,qt.prototype.point=!0;class Tt extends Ye{constructor(e,t,n,r,u,y){super(t,n,u,e);this.block=r,this.isReplace=y,this.mapMode=r?t<=0?l.gc.TrackBefore:l.gc.TrackAfter:l.gc.TrackDel}get type(){return this.startSide!=this.endSide?it.WidgetRange:this.startSide<=0?it.WidgetBefore:it.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Tt&&Gt(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Tt.prototype.point=!0;function Ht(s,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=s;return t==null&&(t=s.inclusive),n==null&&(n=s.inclusive),{start:t!=null?t:e,end:n!=null?n:e}}function Gt(s,e){return s==e||!!(s&&e&&s.compare(e))}function xt(s,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=s?t[r]=Math.max(t[r],e):t.push(s,e)}class Kt{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Oe&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new yt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Jt(new Lt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Oe)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:u,lineBreak:y,done:T}=this.cursor.next(this.skip);if(this.skip=0,T)throw new Error("Ran out of text content when drawing inline views");if(y){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=u,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Jt(new ge(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,u,y){if(this.disallowBlockEffectsFor[y]&&n instanceof Tt){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let T=t-e;if(n instanceof Tt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Oe(n.widget||new en("div"),T,n));else{let R=rt.create(n.widget||new en("span"),T,T?0:n.startSide),_=this.atCursorPos&&!R.isEditable&&u<=r.length&&(e0),G=!R.isEditable&&(er.length||n.startSide<=0),we=this.getLine();this.pendingBuffer==2&&!_&&!R.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),_&&(we.append(Jt(new Lt(1),r),u),u=r.length+Math.max(0,u-r.length)),we.append(Jt(R,r),u),this.atCursorPos=G,this.pendingBuffer=G?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);T&&(this.textOff+T<=this.text.length?this.textOff+=T:(this.skip+=T-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=u)}static build(e,t,n,r,u){let y=new Kt(e,t,n,u);return y.openEnd=l.Xs.spans(r,t,n,y),y.openStart<0&&(y.openStart=y.openEnd),y.finish(y.openEnd),y}}function Jt(s,e){for(let t of e)s=new Te(t,[s],s.length);return s}class en extends Ge{constructor(e){super();this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var _t=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(_t||(_t={}));const On=_t.LTR,dn=_t.RTL;function Ln(s){let e=[];for(let t=0;t=t){if(T.level==n)return y;(u<0||(r!=0?r<0?T.fromt:e[u].level>T.level))&&(u=y)}}if(u<0)throw new RangeError("Index out of range");return u}}function bi(s,e){if(s.length!=e.length)return!1;for(let t=0;t=0;wt-=3)if(Dn[wt+1]==-Ue){let gt=Dn[wt+2],Et=gt&2?r:gt&4?gt&1?u:r:0;Et&&(Rn[we]=Rn[Dn[wt]]=Et),T=wt;break}}else{if(Dn.length==189)break;Dn[T++]=we,Dn[T++]=Ze,Dn[T++]=R}else if((tt=Rn[we])==2||tt==1){let wt=tt==r;R=wt?0:1;for(let gt=T-3;gt>=0;gt-=3){let Et=Dn[gt+2];if(Et&2)break;if(wt)Dn[gt+2]|=2;else{if(Et&4)break;Dn[gt+2]|=4}}}}}function ai(s,e,t,n){for(let r=0,u=n;r<=t.length;r++){let y=r?t[r-1].to:s,T=rR;)tt==gt&&(tt=t[--wt].from,gt=wt?t[wt-1].to:s),Rn[--tt]=Ue;R=G}else u=_,R++}}}function ci(s,e,t,n,r,u,y){let T=n%2?2:1;if(n%2==r%2)for(let R=e,_=0;RR&&y.push(new Kn(R,wt.from,Ue));let gt=wt.direction==On!=!(Ue%2);Un(s,gt?n+1:n,r,wt.inner,wt.from,wt.to,y),R=wt.to}tt=wt.to}else{if(tt==t||(G?Rn[tt]!=T:Rn[tt]==T))break;tt++}Ze?ci(s,R,tt,n+1,r,Ze,y):Re;){let G=!0,we=!1;if(!_||R>u[_-1].to){let wt=Rn[R-1];wt!=T&&(G=!1,we=wt==16)}let Ze=!G&&T==1?[]:null,Ue=G?n:n+1,tt=R;e:for(;;)if(_&&tt==u[_-1].to){if(we)break e;let wt=u[--_];if(!G)for(let gt=wt.from,Et=_;;){if(gt==e)break e;if(Et&&u[Et-1].to==gt)gt=u[--Et].from;else{if(Rn[gt-1]==T)break e;break}}if(Ze)Ze.push(wt);else{wt.toRn.length;)Rn[Rn.length]=256;let n=[],r=e==On?0:1;return Un(s,r,r,t,0,s.length,n),n}function gi(s){return[new Kn(0,s,0)]}let ue="";function h(s,e,t,n,r){var u;let y=n.head-s.from,T=Kn.find(e,y,(u=n.bidiLevel)!==null&&u!==void 0?u:-1,n.assoc),R=e[T],_=R.side(r,t);if(y==_){let Ze=T+=r?1:-1;if(Ze<0||Ze>=e.length)return null;R=e[T=Ze],y=R.side(!r,t),_=R.side(r,t)}let G=(0,l.cp)(s.text,y,R.forward(r,t));(GR.to)&&(G=_),ue=s.text.slice(Math.min(y,G),Math.max(y,G));let we=T==(r?e.length-1:0)?null:e[T+(r?1:-1)];return we&&G==_&&we.level+(r?0:1)s.some(e=>e)}),Zt=l.r$.define({combine:s=>s.some(e=>e)});class F{constructor(e,t="nearest",n="nearest",r=5,u=5,y=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=u,this.isSnapshot=y}map(e){return e.empty?this:new F(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new F(l.jT.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const P=l.Py.define({map:(s,e)=>s.map(e)});function Y(s,e,t){let n=s.facet(M);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const he=l.r$.define({combine:s=>s.length?s[0]:!0});let le=0;const je=l.r$.define();class We{constructor(e,t,n,r,u){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=u(this)}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:u,decorations:y}=t||{};return new We(le++,e,n,r,T=>{let R=[je.of(T)];return y&&R.push(g.of(_=>{let G=_.plugin(T);return G?y(G):Ye.none})),u&&R.push(u(T)),R})}static fromClass(e,t){return We.define(n=>new e(n),t)}}class et{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Y(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(r){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Y(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if((t=this.value)===null||t===void 0?void 0:t.destroy)try{this.value.destroy()}catch(n){Y(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const at=l.r$.define(),O=l.r$.define(),g=l.r$.define(),C=l.r$.define(),j=l.r$.define(),ee=l.r$.define();function Ae(s,e){let t=s.state.facet(ee);if(!t.length)return t;let n=t.map(u=>u instanceof Function?u(s):u),r=[];return l.Xs.spans(n,e.from,e.to,{point(){},span(u,y,T,R){let _=u-e.from,G=y-e.from,we=r;for(let Ze=T.length-1;Ze>=0;Ze--,R--){let Ue=T[Ze].spec.bidiIsolate,tt;if(Ue==null&&(Ue=c(e.text,_,G)),R>0&&we.length&&(tt=we[we.length-1]).to==_&&tt.direction==Ue)tt.to=G,we=tt.inner;else{let wt={from:_,to:G,direction:Ue,inner:[]};we.push(wt),we=wt.inner}}}}),r}const _e=l.r$.define();function st(s){let e=0,t=0,n=0,r=0;for(let u of s.state.facet(_e)){let y=u(s);y&&(y.left!=null&&(e=Math.max(e,y.left)),y.right!=null&&(t=Math.max(t,y.right)),y.top!=null&&(n=Math.max(n,y.top)),y.bottom!=null&&(r=Math.max(r,y.bottom)))}return{left:e,right:t,top:n,bottom:r}}const ht=l.r$.define();class kt{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new kt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAG)break;u+=2}if(!R)return n;new kt(R.fromA,R.toA,R.fromB,R.toB).addToSet(n),y=R.toA,T=R.toB}}}class Dt{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=l.as.empty(this.startState.doc.length);for(let u of n)this.changes=this.changes.compose(u.changes);let r=[];this.changes.iterChangedRanges((u,y,T,R)=>r.push(new kt(u,y,T,R))),this.changedRanges=r}static create(e,t,n){return new Dt(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&(8|2))>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class un extends q{get length(){return this.view.state.doc.length}constructor(e){super();this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new yt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new kt(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:_,toA:G})=>Gthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let r=-1;this.view.inputState.composing>=0&&(((t=this.domChanged)===null||t===void 0?void 0:t.newSel)?r=this.domChanged.newSel.head:!ve(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let u=r>-1?Mn(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:_,to:G}=this.hasComposition;n=new kt(_,G,e.changes.mapPos(_,-1),e.changes.mapPos(G,1)).addToSet(n.slice())}this.hasComposition=u?{from:u.range.fromB,to:u.range.toB}:null,(D.ie||D.chrome)&&!u&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let y=this.decorations,T=this.updateDeco(),R=L(y,T,e.changes);return n=kt.extendWithRanges(n,R),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,u),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let y=D.chrome||D.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,y),this.flags&=~7,y&&(y.written||r.selectionRange.focusNode!=y.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(y=>y.flags&=~8);let u=[];if(this.view.viewport.from||this.view.viewport.to=0?r[y]:null;if(!T)break;let{fromA:R,toA:_,fromB:G,toB:we}=T,Ze,Ue,tt,wt;if(n&&n.range.fromBG){let bn=Kt.build(this.view.state.doc,G,n.range.fromB,this.decorations,this.dynamicDecorationMap),wn=Kt.build(this.view.state.doc,n.range.toB,we,this.decorations,this.dynamicDecorationMap);Ue=bn.breakAtStart,tt=bn.openStart,wt=wn.openEnd;let jn=this.compositionView(n);wn.breakAtStart?jn.breakAfter=1:wn.content.length&&jn.merge(jn.length,jn.length,wn.content[0],!1,wn.openStart,0)&&(jn.breakAfter=wn.content[0].breakAfter,wn.content.shift()),bn.content.length&&jn.merge(0,0,bn.content[bn.content.length-1],!0,0,bn.openEnd)&&bn.content.pop(),Ze=bn.content.concat(jn).concat(wn.content)}else({content:Ze,breakAtStart:Ue,openStart:tt,openEnd:wt}=Kt.build(this.view.state.doc,G,we,this.decorations,this.dynamicDecorationMap));let{i:gt,off:Et}=u.findPos(_,1),{i:mn,off:An}=u.findPos(R,-1);Ke(this,mn,An,gt,Et,Ze,Ue,tt,wt)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new ge(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Te(r,[t],t.length);let n=new yt;return n.append(t,0),n}fixCompositionDOM(e){let t=(u,y)=>{y.flags|=8|(y.children.some(R=>R.flags&7)?1:0),this.markedForComposition.add(y);let T=q.get(u);T&&T!=y&&(T.dom=null),y.setDOM(u)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let u=e.marks.length-1;u>=-1;u--)n=r.childPos(n.off,1),r=r.children[n.i],t(u>=0?e.marks[u].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,u=!r&&ce(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||u))return;let y=this.forceSelection;this.forceSelection=!1;let T=this.view.state.selection.main,R=this.moveToLine(this.domAtPos(T.anchor)),_=T.empty?R:this.moveToLine(this.domAtPos(T.head));if(D.gecko&&T.empty&&!this.hasComposition&&Ft(R)){let we=document.createTextNode("");this.view.observer.ignore(()=>R.node.insertBefore(we,R.node.childNodes[R.offset]||null)),R=_=new H(we,0),y=!0}let G=this.view.observer.selectionRange;(y||!G.focusNode||(!xe(R.node,R.offset,G.anchorNode,G.anchorOffset)||!xe(_.node,_.offset,G.focusNode,G.focusOffset))&&!this.suppressWidgetCursorChange(G,T))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(G.focusNode)&&se(G.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let we=U(this.view.root);if(we)if(T.empty){if(D.gecko){let Ze=J(R.node,R.offset);if(Ze&&Ze!=(1|2)){let Ue=ti(R.node,R.offset,Ze==1?1:-1);Ue&&(R=new H(Ue.node,Ue.offset))}}we.collapse(R.node,R.offset),T.bidiLevel!=null&&we.caretBidiLevel!==void 0&&(we.caretBidiLevel=T.bidiLevel)}else if(we.extend){we.collapse(R.node,R.offset);try{we.extend(_.node,_.offset)}catch(Ze){}}else{let Ze=document.createRange();T.anchor>T.head&&([R,_]=[_,R]),Ze.setEnd(_.node,_.offset),Ze.setStart(R.node,R.offset),we.removeAllRanges(),we.addRange(Ze)}u&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(R,_)),this.impreciseAnchor=R.precise?null:new H(G.anchorNode,G.anchorOffset),this.impreciseHead=_.precise?null:new H(G.focusNode,G.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&xe(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=U(e.root),{anchorNode:r,anchorOffset:u}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let y=yt.find(this,t.head);if(!y)return;let T=y.posAtStart;if(t.head==T||t.head==T+y.length)return;let R=this.coordsAt(t.head,-1),_=this.coordsAt(t.head,1);if(!R||!_||R.bottom>_.top)return;let G=this.domAtPos(t.head+t.assoc);n.collapse(G.node,G.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let we=e.observer.selectionRange;e.docView.posFromDOM(we.anchorNode,we.anchorOffset)!=t.from&&n.collapse(r,u)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let u=q.get(t.childNodes[r]);u instanceof yt&&(n=u.domAtPos(u.length))}return n?new H(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=q.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;y--){let T=this.children[y],R=u-T.breakAfter,_=R-T.length;if(Re||T.covers(1))&&(!n||T instanceof yt&&!(n instanceof yt&&t>=0))&&(n=T,r=_),u=_}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof yt))return null;for(;r.children.length;){let{i:T,off:R}=r.childPos(n,1);for(;;T++){if(T==r.children.length)return null;if((r=r.children[T]).length)break}n=R}if(!(r instanceof ge))return null;let u=(0,l.cp)(r.text,n);if(u==n)return null;let y=lt(r.dom,n,u).getClientRects();for(let T=0;TMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,T=-1,R=this.view.textDirection==_t.LTR;for(let _=0,G=0;Gr)break;if(_>=n){let Ue=we.dom.getBoundingClientRect();if(t.push(Ue.height),y){let tt=we.dom.lastChild,wt=tt?N(tt):[];if(wt.length){let gt=wt[wt.length-1],Et=R?gt.right-Ue.left:Ue.right-gt.left;Et>T&&(T=Et,this.minWidth=u,this.minWidthFrom=_,this.minWidthTo=Ze)}}}_=Ze+we.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?_t.RTL:_t.LTR}measureTextSize(){for(let u of this.children)if(u instanceof yt){let y=u.measureTextSize();if(y)return y}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let u=N(e.firstChild)[0];t=e.getBoundingClientRect().height,n=u?u.width/27:7,r=u?u.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Se(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let u=r==t.viewports.length?null:t.viewports[r],y=u?u.from-1:this.length;if(y>n){let T=(t.lineBlockAt(y).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Ye.replace({widget:new $n(T),block:!0,inclusive:!0,isBlockGap:!0}).range(n,y))}if(!u)break;n=u.to+1}return Ye.set(e)}updateDeco(){let e=this.view.state.facet(g).map((r,u)=>(this.dynamicDecorationMap[u]=typeof r=="function")?r(this.view):r),t=!1,n=this.view.state.facet(C).map((r,u)=>{let y=typeof r=="function";return y&&(t=!0),y?r(this.view):r});n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(l.Xs.join(n)));for(let r=e.length;rt.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let u=st(this.view),y={left:n.left-u.left,top:n.top-u.top,right:n.right+u.right,bottom:n.bottom+u.bottom},{offsetWidth:T,offsetHeight:R}=this.view.scrollDOM;Ce(this.view.scrollDOM,y,t.head0)n=n.childNodes[r-1],r=me(n);else break}if(t>=0)for(let n=s,r=e;;){if(n.nodeType==3)return{node:n,offset:r};if(n.nodeType==1&&r=0)n=n.childNodes[r],r=0;else break}return null}function J(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(t=!0)}),t}function Me(s,e,t=1){let n=s.charCategorizer(e),r=s.doc.lineAt(e),u=e-r.from;if(r.length==0)return l.jT.cursor(e);u==0?t=1:u==r.length&&(t=-1);let y=u,T=u;t<0?y=(0,l.cp)(r.text,u,!1):T=(0,l.cp)(r.text,u);let R=n(r.text.slice(y,T));for(;y>0;){let _=(0,l.cp)(r.text,y,!1);if(n(r.text.slice(_,y))!=R)break;y=_}for(;Ts?e.left-s:Math.max(0,s-e.right)}function Ct(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function St(s,e){return s.tope.top+1}function rn(s,e){return es.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function Xn(s,e,t){let n,r,u,y,T=!1,R,_,G,we;for(let tt=s.firstChild;tt;tt=tt.nextSibling){let wt=N(tt);for(let gt=0;gtAn||y==An&&u>mn){n=tt,r=Et,u=mn,y=An;let bn=An?t0?gt0)}mn==0?t>Et.bottom&&(!G||G.bottomEt.top)&&(_=tt,we=Et):G&&St(G,Et)?G=cn(G,Et.bottom):we&&St(we,Et)&&(we=rn(we,Et.top))}}if(G&&G.bottom>=t?(n=R,r=G):we&&we.top<=t&&(n=_,r=we),!n)return{node:s,offset:0};let Ze=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return pi(n,Ze,t);if(T&&n.contentEditable!="false")return Xn(n,Ze,t);let Ue=Array.prototype.indexOf.call(s.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:s,offset:Ue}}function pi(s,e,t){let n=s.nodeValue.length,r=-1,u=1e9,y=0;for(let T=0;Tt?G.top-t:t-G.bottom)-1;if(G.left-1<=e&&G.right+1>=e&&we=(G.left+G.right)/2,Ue=Ze;if((D.chrome||D.gecko)&<(s,T).getBoundingClientRect().left==G.right&&(Ue=!Ze),we<=0)return{node:s,offset:T+(Ue?1:0)};r=T+(Ue?1:0),u=we}}}return{node:s,offset:r>-1?r:y>0?s.nodeValue.length:0}}function fi(s,e,t,n=-1){var r,u;let y=s.contentDOM.getBoundingClientRect(),T=y.top+s.viewState.paddingTop,R,{docHeight:_}=s.viewState,{x:G,y:we}=e,Ze=we-T;if(Ze<0)return 0;if(Ze>_)return s.state.doc.length;for(let bn=s.viewState.heightOracle.textHeight/2,wn=!1;R=s.elementAtHeight(Ze),R.type!=it.Text;)for(;Ze=n>0?R.bottom+bn:R.top-bn,!(Ze>=0&&Ze<=_);){if(wn)return t?null:0;wn=!0,n=-n}we=T+Ze;let Ue=R.from;if(Ues.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:vi(s,y,R,G,we);let tt=s.dom.ownerDocument,wt=s.root.elementFromPoint?s.root:tt,gt=wt.elementFromPoint(G,we);gt&&!s.contentDOM.contains(gt)&&(gt=null),gt||(G=Math.max(y.left+1,Math.min(y.right-1,G)),gt=wt.elementFromPoint(G,we),gt&&!s.contentDOM.contains(gt)&&(gt=null));let Et,mn=-1;if(gt&&((r=s.docView.nearest(gt))===null||r===void 0?void 0:r.isEditable)!=!1){if(tt.caretPositionFromPoint){let bn=tt.caretPositionFromPoint(G,we);bn&&({offsetNode:Et,offset:mn}=bn)}else if(tt.caretRangeFromPoint){let bn=tt.caretRangeFromPoint(G,we);bn&&({startContainer:Et,startOffset:mn}=bn,(!s.contentDOM.contains(Et)||D.safari&&Ri(Et,mn,G)||D.chrome&&Qr(Et,mn,G))&&(Et=void 0))}}if(!Et||!s.docView.dom.contains(Et)){let bn=yt.find(s.docView,Ue);if(!bn)return Ze>R.top+R.height/2?R.to:R.from;({node:Et,offset:mn}=Xn(bn.dom,G,we))}let An=s.docView.nearest(Et);if(!An)return null;if(An.isWidget&&((u=An.dom)===null||u===void 0?void 0:u.nodeType)==1){let bn=An.dom.getBoundingClientRect();return e.ys.defaultLineHeight*1.5){let T=s.viewState.heightOracle.textHeight;u+=Math.floor((r-t.top-(s.defaultLineHeight-T)*.5)/T)*s.viewState.heightOracle.lineLength}let y=s.state.sliceDoc(t.from,t.to);return t.from+(0,l.Gz)(y,u,s.state.tabSize)}function Ri(s,e,t){let n;if(s.nodeType!=3||e!=(n=s.nodeValue.length))return!1;for(let r=s.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return lt(s,n-1,n).getBoundingClientRect().left>t}function Qr(s,e,t){if(e!=0)return!1;for(let r=s;;){let u=r.parentNode;if(!u||u.nodeType!=1||u.firstChild!=r)return!1;if(u.classList.contains("cm-line"))break;r=u}let n=s.nodeType==1?s.getBoundingClientRect():lt(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Di(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==it.Text))return n}return t}function il(s,e,t,n){let r=Di(s,e.head),u=!n||r.type!=it.Text||!(s.lineWrapping||r.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(u){let y=s.dom.getBoundingClientRect(),T=s.textDirectionAt(r.from),R=s.posAtCoords({x:t==(T==_t.LTR)?y.right-1:y.left+1,y:(u.top+u.bottom)/2});if(R!=null)return l.jT.cursor(R,t?-1:1)}return l.jT.cursor(t?r.to:r.from,t?-1:1)}function Nr(s,e,t,n){let r=s.state.doc.lineAt(e.head),u=s.bidiSpans(r),y=s.textDirectionAt(r.from);for(let T=e,R=null;;){let _=h(r,u,y,T,t),G=ue;if(!_){if(r.number==(t?s.state.doc.lines:1))return T;G=` `,r=s.state.doc.line(r.number+(t?1:-1)),u=s.bidiSpans(r),_=s.visualLineSide(r,!t)}if(R){if(!R(G))return T}else{if(!n)return _;R=n(G)}T=_}}function Js(s,e,t){let n=s.state.charCategorizer(e),r=n(t);return u=>{let y=n(u);return r==l.D0.Space&&(r=y),r==y}}function Ks(s,e,t,n){let r=e.head,u=t?1:-1;if(r==(t?s.state.doc.length:0))return l.jT.cursor(r,e.assoc);let y=e.goalColumn,T,R=s.contentDOM.getBoundingClientRect(),_=s.coordsAtPos(r,e.assoc||-1),G=s.documentTop;if(_)y==null&&(y=_.left-R.left),T=u<0?_.top:_.bottom;else{let Ue=s.viewState.lineBlockAt(r);y==null&&(y=Math.min(R.right-R.left,s.defaultCharacterWidth*(r-Ue.from))),T=(u<0?Ue.top:Ue.bottom)+G}let we=R.left+y,Ze=n!=null?n:s.viewState.heightOracle.textHeight>>1;for(let Ue=0;;Ue+=10){let tt=T+(Ze+Ue)*u,wt=fi(s,{x:we,y:tt},!1,u);if(ttR.bottom||(u<0?wtr)){let gt=s.docView.coordsForChar(wt),Et=!gt||tt{if(e>u&&er(s)),t.from,e.head>t.from?-1:1);return n==t.from?t:l.jT.cursor(n,nnull),D.gecko&&co(e.contentDOM.ownerDocument)}handleEvent(e){!dr(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Fr(e),n=this.handlers,r=this.view.contentDOM;for(let u in t)if(u!="scroll"){let y=!t[u].handlers.length,T=n[u];T&&y!=!T.handlers.length&&(r.removeEventListener(u,this.handleEvent),T=null),T||r.addEventListener(u,this.handleEvent,{passive:y})}for(let u in n)u!="scroll"&&!t[u]&&r.removeEventListener(u,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()n.keyCode==e.keyCode))&&!e.ctrlKey||to.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Rt(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function hr(s,e){return(t,n)=>{try{return e.call(s,n,t)}catch(r){Y(t.state,r)}}}function Fr(s){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of s){let r=n.spec;if(r&&r.domEventHandlers)for(let u in r.domEventHandlers){let y=r.domEventHandlers[u];y&&t(u).handlers.push(hr(n.value,y))}if(r&&r.domEventObservers)for(let u in r.domEventObservers){let y=r.domEventObservers[u];y&&t(u).observers.push(hr(n.value,y))}}for(let n in ki)t(n).handlers.push(ki[n]);for(let n in wi)t(n).observers.push(wi[n]);return e}const eo=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],to="dthko",Ur=[16,17,18,20,91,92,224,225],cr=6;function ur(s){return Math.max(0,s)*.7+8}function Mt(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class no{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Ee(e.contentDOM),this.atoms=e.state.facet(j).map(y=>y(e));let u=e.contentDOM.ownerDocument;u.addEventListener("mousemove",this.move=this.move.bind(this)),u.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(l.yy.allowMultipleSelections)&&Li(e,t),this.dragging=io(e,t)&&ns(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Mt(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,u=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},y=st(this.view);e.clientX-y.left<=u.left+cr?n=-ur(u.left-e.clientX):e.clientX+y.right>=u.right-cr&&(n=ur(e.clientX-u.right)),e.clientY-y.top<=u.top+cr?r=-ur(u.top-e.clientY):e.clientY+y.bottom>=u.bottom-cr&&(r=ur(e.clientY-u.bottom)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent),20)}}function Li(s,e){let t=s.state.facet(v);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function fr(s,e){let t=s.state.facet(Q);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function io(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let n=U(s.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let u=0;u=e.clientX&&y.top<=e.clientY&&y.bottom>=e.clientY)return!0}return!1}function dr(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=q.get(t))&&n.ignoreEvent(e))return!1;return!0}const ki=Object.create(null),wi=Object.create(null),Gr=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function ro(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Xi(s,t.value)},50)}function Xi(s,e){let{state:t}=s,n,r=1,u=t.toText(e),y=u.lines==t.selection.ranges.length;if(Tr!=null&&t.selection.ranges.every(R=>R.empty)&&Tr==u.toString()){let R=-1;n=t.changeByRange(_=>{let G=t.doc.lineAt(_.from);if(G.from==R)return{range:_};R=G.from;let we=t.toText((y?u.line(r++).text:e)+t.lineBreak);return{changes:{from:G.from,insert:we},range:l.jT.cursor(_.from+we.length)}})}else y?n=t.changeByRange(R=>{let _=u.line(r++);return{changes:{from:R.from,to:R.to,insert:_.text},range:l.jT.cursor(R.from+_.length)}}):n=t.replaceSelection(u);s.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}wi.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft},ki.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1),wi.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")},wi.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")},ki.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of s.state.facet(X))if(t=n(s,e),t)break;if(!t&&e.button==0&&(t=lo(s,e)),t){let n=!s.hasFocus;s.inputState.startMouseSelection(new no(s,e,t,n)),n&&s.observer.ignore(()=>dt(s.contentDOM));let r=s.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function qr(s,e,t,n){if(n==1)return l.jT.cursor(e,t);if(n==2)return Me(s.state,e,t);{let r=yt.find(s.docView,e),u=s.state.doc.lineAt(r?r.posAtEnd:e),y=r?r.posAtStart:u.from,T=r?r.posAtEnd:u.to;return Ts>=e.top&&s<=e.bottom,Jr=(s,e,t)=>Hr(e,t)&&s>=t.left&&s<=t.right;function so(s,e,t,n){let r=yt.find(s.docView,e);if(!r)return 1;let u=e-r.posAtStart;if(u==0)return 1;if(u==r.length)return-1;let y=r.coordsAt(u,-1);if(y&&Jr(t,n,y))return-1;let T=r.coordsAt(u,1);return T&&Jr(t,n,T)?1:y&&Hr(n,y)?-1:1}function Kr(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:so(s,t,e.clientX,e.clientY)}}const oo=D.ie&&D.ie_version<=11;let _r=null,es=0,ts=0;function ns(s){if(!oo)return s.detail;let e=_r,t=ts;return _r=s,ts=Date.now(),es=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(es+1)%3:1}function lo(s,e){let t=Kr(s,e),n=ns(e),r=s.state.selection;return{update(u){u.docChanged&&(t.pos=u.changes.mapPos(t.pos),r=r.map(u.changes))},get(u,y,T){let R=Kr(s,u),_,G=qr(s,R.pos,R.bias,n);if(t.pos!=R.pos&&!y){let we=qr(s,t.pos,t.bias,n),Ze=Math.min(we.from,G.from),Ue=Math.max(we.to,G.to);G=Ze1&&(_=ao(r,R.pos))?_:T?r.addRange(G):l.jT.create([G])}}}function ao(s,e){for(let t=0;t=e)return l.jT.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}ki.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let r=s.docView.nearest(e.target);if(r&&r.isWidget){let u=r.posAtStart,y=u+r.length;(u>=t.to||y<=t.from)&&(t=l.jT.range(u,y))}}let{inputState:n}=s;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1},ki.dragend=s=>(s.inputState.draggedContent=null,!1);function Ei(s,e,t,n){if(!t)return;let r=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:u}=s.inputState,y=n&&u&&fr(s,e)?{from:u.from,to:u.to}:null,T={from:r,insert:t},R=s.state.changes(y?[y,T]:T);s.focus(),s.dispatch({changes:R,selection:{anchor:R.mapPos(r,-1),head:R.mapPos(r,1)},userEvent:y?"move.drop":"input.drop"}),s.inputState.draggedContent=null}ki.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,u=()=>{++r==t.length&&Ei(s,e,n.filter(y=>y!=null).join(s.state.lineBreak),!1)};for(let y=0;y{/[\x00-\x08\x0e-\x1f]{2}/.test(T.result)||(n[y]=T.result),u()},T.readAsText(t[y])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return Ei(s,e,n,!0),!0}return!1},ki.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Gr?null:e.clipboardData;return t?(Xi(s,t.getData("text/plain")||t.getData("text/uri-text")),!0):(ro(s),!1)};function ho(s,e){let t=s.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),s.focus()},50)}function Ci(s){let e=[],t=[],n=!1;for(let r of s.selection.ranges)r.empty||(e.push(s.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:u}of s.selection.ranges){let y=s.doc.lineAt(u);y.number>r&&(e.push(y.text),t.push({from:y.from,to:Math.min(s.doc.length,y.to+1)})),r=y.number}n=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:n}}let Tr=null;ki.copy=ki.cut=(s,e)=>{let{text:t,ranges:n,linewise:r}=Ci(s.state);if(!t&&!r)return!1;Tr=r?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let u=Gr?null:e.clipboardData;return u?(u.clearData(),u.setData("text/plain",t),!0):(ho(s,t),!1)};const is=l.q6.define();function rs(s,e){let t=[];for(let n of s.facet(Fe)){let r=n(s,e);r&&t.push(r)}return t?s.update({effects:t,annotations:is.of(!0)}):null}function Ar(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=rs(s.state,e);t?s.dispatch(t):s.update([])}},10)}wi.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),Ar(s)},wi.blur=s=>{s.observer.clearSelectionRange(),Ar(s)},wi.compositionstart=wi.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)},wi.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,D.chrome&&D.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)},wi.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()},ki.beforeinput=(s,e)=>{var t;let n;if(D.chrome&&D.android&&(n=eo.find(r=>r.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var u;(((u=window.visualViewport)===null||u===void 0?void 0:u.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const ss=new Set;function co(s){ss.has(s)||(ss.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const os=["pre-wrap","normal","pre-line","break-spaces"];class Zr{constructor(e){this.lineWrapping=e,this.doc=l.xv.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return os.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,R=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=T;if(this.lineWrapping=T,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=u,R){this.heightSamples={};for(let _=0;_0}set outdated(e){this.flags=(e?2:0)|this.flags&~2}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>qi&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return ri.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let u=this,y=n.doc;for(let T=r.length-1;T>=0;T--){let{fromA:R,toA:_,fromB:G,toB:we}=r[T],Ze=u.lineAt(R,Gn.ByPosNoHeight,n.setDoc(t),0,0),Ue=Ze.to>=_?Ze:u.lineAt(_,Gn.ByPosNoHeight,n,0,0);for(we+=Ue.to-_,_=Ue.to;T>0&&Ze.from<=r[T-1].toA;)R=r[T-1].fromA,G=r[T-1].fromB,T--,Ru*2){let T=e[t-1];T.break?e.splice(--t,1,T.left,null,T.right):e.splice(--t,1,T.left,T.right),n+=1+T.break,r-=T.size}else if(u>r*2){let T=e[n];T.break?e.splice(n,1,T.left,null,T.right):e.splice(n,1,T.left,T.right),n+=2+T.break,u-=T.size}else break;else if(r=u&&y(this.blockAt(0,n,r,u))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class xi extends ls{constructor(e,t){super(e,t,null);this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new Ai(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof xi||r instanceof Pn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Pn?r=new xi(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):ri.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Pn extends ri{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,u=r-n+1,y,T=0;if(e.lineWrapping){let R=Math.min(this.height,e.lineHeight*u);y=R/u,this.length>u+1&&(T=(this.height-R)/(this.length-u-1))}else y=this.height/u;return{firstLine:n,lastLine:r,perLine:y,perChar:T}}blockAt(e,t,n,r){let{firstLine:u,lastLine:y,perLine:T,perChar:R}=this.heightMetrics(t,r);if(t.lineWrapping){let _=r+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),G=t.doc.lineAt(_),we=T+G.length*R,Ze=Math.max(n,e-we/2);return new Ai(G.from,G.length,Ze,we,0)}else{let _=Math.max(0,Math.min(y-u,Math.floor((e-n)/T))),{from:G,length:we}=t.doc.line(u+_);return new Ai(G,we,n+T*_,T,0)}}lineAt(e,t,n,r,u){if(t==Gn.ByHeight)return this.blockAt(e,n,r,u);if(t==Gn.ByPosNoHeight){let{from:Ue,to:tt}=n.doc.lineAt(e);return new Ai(Ue,tt-Ue,0,0,0)}let{firstLine:y,perLine:T,perChar:R}=this.heightMetrics(n,u),_=n.doc.lineAt(e),G=T+_.length*R,we=_.number-y,Ze=r+T*we+R*(_.from-u-we);return new Ai(_.from,_.length,Math.max(r,Math.min(Ze,r+this.height-G)),G,0)}forEachLine(e,t,n,r,u,y){e=Math.max(e,u),t=Math.min(t,u+this.length);let{firstLine:T,perLine:R,perChar:_}=this.heightMetrics(n,u);for(let G=e,we=r;G<=t;){let Ze=n.doc.lineAt(G);if(G==e){let tt=Ze.number-T;we+=R*tt+_*(e-u-tt)}let Ue=R+_*Ze.length;y(new Ai(Ze.from,Ze.length,we,Ue,0)),we+=Ue,G=Ze.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let u=n[n.length-1];u instanceof Pn?n[n.length-1]=new Pn(u.length+r):n.push(null,new Pn(r-1))}if(e>0){let u=n[0];u instanceof Pn?n[0]=new Pn(e+u.length):n.unshift(new Pn(e-1),null)}return ri.of(n)}decomposeLeft(e,t){t.push(new Pn(e-1),null)}decomposeRight(e,t){t.push(null,new Pn(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let u=t+this.length;if(r&&r.from<=t+this.length&&r.more){let y=[],T=Math.max(t,r.from),R=-1;for(r.from>t&&y.push(new Pn(r.from-t-1).updateHeight(e,t));T<=u&&r.more;){let G=e.doc.lineAt(T).length;y.length&&y.push(null);let we=r.heights[r.index++];R==-1?R=we:Math.abs(we-R)>=qi&&(R=-2);let Ze=new xi(G,we);Ze.outdated=!1,y.push(Ze),T+=G+1}T<=u&&y.push(null,new Pn(u-T).updateHeight(e,T));let _=ri.of(y);return(R<0||Math.abs(_.height-this.height)>=qi||Math.abs(R-this.heightMetrics(e,t).perLine)>=qi)&&(e.heightChanged=!0),_}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class as extends ri{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0));this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let u=n+this.left.height;return eT))return _;let G=t==Gn.ByPosNoHeight?Gn.ByPosNoHeight:Gn.ByPos;return R?_.join(this.right.lineAt(T,G,n,y,T)):this.left.lineAt(T,G,n,r,u).join(_)}forEachLine(e,t,n,r,u,y){let T=r+this.left.height,R=u+this.left.length+this.break;if(this.break)e=R&&this.right.forEachLine(e,t,n,T,R,y);else{let _=this.lineAt(R,Gn.ByPos,n,r,u);e<_.from&&this.left.forEachLine(e,_.from-1,n,r,u,y),_.to>=e&&_.from<=t&&y(_),t>_.to&&this.right.forEachLine(_.to+1,t,n,T,R,y)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let u=[];e>0&&this.decomposeLeft(e,u);let y=u.length;for(let T of n)u.push(T);if(e>0&&hs(u,y-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?ri.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:u,right:y}=this,T=t+u.length+this.break,R=null;return r&&r.from<=t+u.length&&r.more?R=u=u.updateHeight(e,t,n,r):u.updateHeight(e,t,n),r&&r.from<=T+y.length&&r.more?R=y=y.updateHeight(e,T,n,r):y.updateHeight(e,T,n),R?this.balanced(u,y):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hs(s,e){let t,n;s[e]==null&&(t=s[e-1])instanceof Pn&&(n=s[e+1])instanceof Pn&&s.splice(e-1,3,new Pn(t.length+1+n.length))}const uo=5;class $i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof xi?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new xi(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=uo)&&this.addLineDeco(r,u,y)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new xi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Pn(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof xi)return e;let t=new xi(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof xi)&&!this.isCovered?this.nodes.push(new xi(0,-1)):(this.writtenToG.clientHeight||G.scrollWidth>G.clientWidth)&&we.overflow!="visible"){let Ze=G.getBoundingClientRect();u=Math.max(u,Ze.left),y=Math.min(y,Ze.right),T=Math.max(T,Ze.top),R=_==s.parentNode?Ze.bottom:Math.min(R,Ze.bottom)}_=we.position=="absolute"||we.position=="fixed"?G.offsetParent:G.parentNode}else if(_.nodeType==11)_=_.host;else break;return{left:u-t.left,right:Math.max(u,y)-t.left,top:T-(t.top+e),bottom:Math.max(T,R)-(t.top+e)}}function go(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Rr{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Zr(t),this.stateDeco=e.facet(g).filter(n=>typeof n!="function"),this.heightMap=ri.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle.setDoc(e.doc),[new kt(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ye.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:u,to:y})=>r>=u&&r<=y)){let{from:u,to:y}=this.lineBlockAt(r);e.push(new pr(u,y))}}this.viewports=e.sort((n,r)=>n.from-r.from),this.scaler=this.heightMap.height<=7e6?us:new vo(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Hi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(g).filter(G=>typeof G!="function");let r=e.changedRanges,u=kt.extendWithRanges(r,fo(n,this.stateDeco,e?e.changes:l.as.empty(this.state.doc.length))),y=this.heightMap.height,T=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),u),this.heightMap.height!=y&&(e.flags|=2),T?(this.scrollAnchorPos=e.changes.mapPos(T.from,-1),this.scrollAnchorHeight=T.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let R=u.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headR.to)||!this.viewportIsAppropriate(R))&&(R=this.getViewport(0,t));let _=!e.changes.empty||e.flags&2||R.from!=this.viewport.from||R.to!=this.viewport.to;this.viewport=R,this.updateForViewport(),_&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Zt)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,u=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?_t.RTL:_t.LTR;let y=this.heightOracle.mustRefreshForWrapping(u),T=t.getBoundingClientRect(),R=y||this.mustMeasureContent||this.contentDOMHeight!=T.height;this.contentDOMHeight=T.height,this.mustMeasureContent=!1;let _=0,G=0;if(T.width&&T.height){let{scaleX:bn,scaleY:wn}=ae(t,T);(this.scaleX!=bn||this.scaleY!=wn)&&(this.scaleX=bn,this.scaleY=wn,_|=8,y=R=!0)}let we=(parseInt(n.paddingTop)||0)*this.scaleY,Ze=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=we||this.paddingBottom!=Ze)&&(this.paddingTop=we,this.paddingBottom=Ze,_|=8|2),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(R=!0),this.editorWidth=e.scrollDOM.clientWidth,_|=8);let Ue=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=Ue&&(this.scrollAnchorHeight=-1,this.scrollTop=Ue),this.scrolledToBottom=I(e.scrollDOM);let tt=(this.printing?go:mo)(t,this.paddingTop),wt=tt.top-this.pixelViewport.top,gt=tt.bottom-this.pixelViewport.bottom;this.pixelViewport=tt;let Et=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Et!=this.inView&&(this.inView=Et,Et&&(R=!0)),!this.inView&&!this.scrollTarget)return 0;let mn=T.width;if((this.contentDOMWidth!=mn||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=T.width,this.editorHeight=e.scrollDOM.clientHeight,_|=8),R){let bn=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(bn)&&(y=!0),y||r.lineWrapping&&Math.abs(mn-this.contentDOMWidth)>r.charWidth){let{lineHeight:wn,charWidth:jn,textHeight:hi}=e.docView.measureTextSize();y=wn>0&&r.refresh(u,wn,jn,hi,mn/jn,bn),y&&(e.docView.minWidth=0,_|=8)}wt>0&>>0?G=Math.max(wt,gt):wt<0&><0&&(G=Math.min(wt,gt)),r.heightChanged=!1;for(let wn of this.viewports){let jn=wn.from==this.viewport.from?bn:e.docView.measureVisibleLineHeights(wn);this.heightMap=(y?ri.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle,[new kt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,y,new Er(wn.from,jn))}r.heightChanged&&(_|=2)}let An=!this.viewportIsAppropriate(this.viewport,G)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return An&&(this.viewport=this.getViewport(G,this.scrollTarget)),this.updateForViewport(),(_&2||An)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(y?[]:this.lineGaps,e)),_|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),_}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,u=this.heightOracle,{visibleTop:y,visibleBottom:T}=this,R=new pr(r.lineAt(y-n*1e3,Gn.ByHeight,u,0,0).from,r.lineAt(T+(1-n)*1e3,Gn.ByHeight,u,0,0).to);if(t){let{head:_}=t.range;if(_R.to){let G=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),we=r.lineAt(_,Gn.ByPos,u,0,0),Ze;t.y=="center"?Ze=(we.top+we.bottom)/2-G/2:t.y=="start"||t.y=="nearest"&&_=T+Math.max(10,Math.min(n,250)))&&r>y-2*1e3&&u>1,y=r<<1;if(this.defaultTextDirection!=_t.LTR&&!n)return[];let T=[],R=(_,G,we,Ze)=>{if(G-__&>gt.from>=we.from&>.to<=we.to&&Math.abs(gt.from-_)gt.fromEt));if(!wt){if(Ggt.from<=G&>.to>=G)){let gt=t.moveToLineBoundary(l.jT.cursor(G),!1,!0).head;gt>_&&(G=gt)}wt=new Rr(_,G,this.gapSize(we,_,G,Ze))}T.push(wt)};for(let _ of this.viewportLines){if(_.length_.from&&R(_.from,Ze,_,G),Ue<_.to&&R(Ue,_.to,_,G)}return T}gapSize(e,t,n,r){let u=gr(r,n)-gr(r,t);return this.heightOracle.lineWrapping?e.height*u:r.total*this.heightOracle.charWidth*u}updateLineGaps(e){Rr.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ye.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];l.Xs.spans(e,this.viewport.from,this.viewport.to,{span(r,u){t.push({from:r,to:u})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,u)=>r.from!=t[u].from||r.to!=t[u].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Hi(this.heightMap.lineAt(e,Gn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Hi(this.heightMap.lineAt(this.scaler.fromDOM(e),Gn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Hi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class pr{constructor(e,t){this.from=e,this.to=t}}function bo(s,e,t){let n=[],r=s,u=0;return l.Xs.spans(t,s,e,{span(){},point(y,T){y>r&&(n.push({from:r,to:y}),u+=y-r),r=T}},20),r=1)return e[e.length-1].to;let n=Math.floor(s*t);for(let r=0;;r++){let{from:u,to:y}=e[r],T=y-u;if(n<=T)return u+n;n-=T}}function gr(s,e){let t=0;for(let{from:n,to:r}of s.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/s.total}function yo(s,e){for(let t of s)if(e(t))return t}const us={toDOM(s){return s},fromDOM(s){return s},scale:1};class vo{constructor(e,t,n){let r=0,u=0,y=0;this.viewports=n.map(({from:T,to:R})=>{let _=t.lineAt(T,Gn.ByPos,e,0,0).top,G=t.lineAt(R,Gn.ByPos,e,0,0).bottom;return r+=G-_,{from:T,to:R,top:_,bottom:G,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let T of this.viewports)T.domTop=y+(T.top-u)*this.scale,y=T.domBottom=T.domTop+(T.bottom-T.top),u=T.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let u=tHi(r,e)):s._content)}const Or=l.r$.define({combine:s=>s.join(" ")}),Dr=l.r$.define({combine:s=>s.indexOf(!0)>-1}),jr=f.V.newName(),Mi=f.V.newName(),fs=f.V.newName(),ds={"&light":"."+Mi,"&dark":"."+fs};function br(s,e,t){return new f.V(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return s;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):s+" "+n}})}const xo=br("."+jr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ds),Ji="\uFFFF";class Ki{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(l.yy.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ji}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let u=this.text.length;this.readNode(r);let y=r.nextSibling;if(y==t)break;let T=q.get(r),R=q.get(y);(T&&R?T.breakAfter:(T?T.breakAfter:ms(r))||ms(y)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>u)&&this.lineBreak(),r=y}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let u=-1,y=1,T;if(this.lineSeparator?(u=t.indexOf(this.lineSeparator,n),y=this.lineSeparator.length):(T=r.exec(t))&&(u=T.index,y=T[0].length),this.append(t.slice(n,u<0?t.length:u)),u<0)break;if(this.lineBreak(),y>1)for(let R of this.points)R.node==e&&R.pos>this.text.length&&(R.pos-=y-1);n=u+y}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(ps(e,n.node,n.offset)?t:0))}}function ps(s,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let T=u||y?[]:ys(e),R=new Ki(T,e.state);R.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=R.text,this.newSel=Lr(T,this.bounds.from)}else{let T=e.observer.selectionRange,R=u&&u.node==T.focusNode&&u.offset==T.focusOffset||!te(e.contentDOM,T.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(T.focusNode,T.focusOffset),_=y&&y.node==T.anchorNode&&y.offset==T.anchorOffset||!te(e.contentDOM,T.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(T.anchorNode,T.anchorOffset),G=e.viewport;if((D.ios||D.chrome)&&e.state.selection.main.empty&&R!=_&&(G.from>0||G.toDate.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:y,to:T}=e.bounds,R=r.from,_=null;(u===8||D.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:s.state.doc.slice(r.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,r.to))}:(D.mac||D.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=l.jT.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:l.xv.of([" "])}):D.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` `&&s.lineWrapping&&(n&&(n=l.jT.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:l.xv.of([" "])}),t){if(D.ios&&s.inputState.flushIOSKey()||D.android&&(t.from==r.from&&t.to==r.to&&t.insert.length==1&&t.insert.lines==2&&Rt(s.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||u==8&&t.insert.lengthr.head)&&Rt(s.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&Rt(s.contentDOM,"Delete",46)))return!0;let y=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let T,R=()=>T||(T=So(s,t,n));return s.state.facet(Pe).some(_=>_(s,t.from,t.to,y,R))||s.dispatch(R()),!0}else if(n&&!n.main.eq(r)){let y=!1,T="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(y=!0),T=s.inputState.lastSelectionOrigin),s.dispatch({selection:n,scrollIntoView:y,userEvent:T}),!0}else return!1}function So(s,e,t){let n,r=s.state,u=r.selection.main;if(e.from>=u.from&&e.to<=u.to&&e.to-e.from>=(u.to-u.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let T=u.frome.to?r.sliceDoc(e.to,u.to):"";n=r.replaceSelection(s.state.toText(T+e.insert.sliceString(0,void 0,s.state.lineBreak)+R))}else{let T=r.changes(e),R=t&&t.main.to<=T.newLength?t.main:void 0;if(r.selection.ranges.length>1&&s.inputState.composing>=0&&e.to<=u.to&&e.to>=u.to-10){let _=s.state.sliceDoc(e.from,e.to),G,we=t&&Wn(s,t.main.head);if(we){let tt=e.insert.length-(e.to-e.from);G={from:we.from,to:we.to-tt}}else G=s.state.doc.lineAt(u.head);let Ze=u.to-e.to,Ue=u.to-u.from;n=r.changeByRange(tt=>{if(tt.from==u.from&&tt.to==u.to)return{changes:T,range:R||tt.map(T)};let wt=tt.to-Ze,gt=wt-_.length;if(tt.to-tt.from!=Ue||s.state.sliceDoc(gt,wt)!=_||tt.to>=G.from&&tt.from<=G.to)return{range:tt};let Et=r.changes({from:gt,to:wt,insert:e.insert}),mn=tt.to-u.to;return{changes:Et,range:R?l.jT.range(Math.max(0,R.anchor+mn),Math.max(0,R.head+mn)):tt.map(Et)}})}else n={changes:T,selection:R&&r.selection.replaceRange(R)}}let y="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,y+=".compose",s.inputState.compositionFirstChange&&(y+=".start",s.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:y,scrollIntoView:!0})}function ko(s,e,t,n){let r=Math.min(s.length,e.length),u=0;for(;u0&&T>0&&s.charCodeAt(y-1)==e.charCodeAt(T-1);)y--,T--;if(n=="end"){let R=Math.max(0,u-Math.min(y,T));t-=y+R-u}return y=y?u-t:0,T=u+(T-y),y=u):T=T?u-t:0,y=u+(y-T),T=u),{from:u,toA:y,toB:T}}function ys(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:u}=s.observer.selectionRange;return t&&(e.push(new gs(t,n)),(r!=t||u!=n)&&e.push(new gs(r,u))),e}function Lr(s,e){if(s.length==0)return null;let t=s[0].pos,n=s.length==2?s[1].pos:t;return t>-1&&n>-1?l.jT.single(t+e,n+e):null}const wo={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yr=D.ie&&D.ie_version<=11;class Co{constructor(e){this.view=e,this.active=!1,this.selectionRange=new nt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),yr&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(he)?n.root.activeElement!=this.dom:!ce(n.dom,r))return;let u=r.anchorNode&&n.docView.nearest(r.anchorNode);if(u&&u.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!n.state.selection.main.empty&&r.focusNode&&xe(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=D.safari&&e.root.nodeType==11&&w(this.dom.ownerDocument)==this.dom&&xs(this.view)||U(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=ce(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let u=this.delayedAndroidKey;u&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=u.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&u.force&&Rt(this.dom,u.key,u.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let u of e){let y=this.readMutation(u);!y||(y.typeOver&&(r=!0),t==-1?{from:t,to:n}=y:(t=Math.min(y.from,t),n=Math.max(y.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&ce(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let u=new Os(this.view,e,t,n);return this.view.docView.domChanged={newSel:u.newSel?u.newSel.main:null},u}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=bs(this.view,t);return this.view.state==n&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=vs(t,e.previousSibling||e.target.previousSibling,-1),r=vs(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function vs(s,e,t){for(;e;){let n=q.get(e);if(n&&n.parent==s)return n;let r=e.parentNode;e=r!=s.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function xs(s){let e=null;function t(R){R.preventDefault(),R.stopImmediatePropagation(),e=R.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let n=e.startContainer,r=e.startOffset,u=e.endContainer,y=e.endOffset,T=s.docView.domAtPos(s.state.selection.main.anchor);return xe(T.node,T.offset,u,y)&&([n,r,u,y]=[u,y,n,r]),{anchorNode:n,anchorOffset:r,focusNode:u,focusOffset:y}}class zn{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(r=>t(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Re(e.parent)||document,this.viewState=new cs(e.state||l.yy.create(e)),e.scrollTo&&e.scrollTo.is(P)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(je).map(n=>new et(n));for(let n of this.plugins)n.update(this);this.observer=new Co(this),this.inputState=new _s(this),this.inputState.ensureHandlers(this.plugins),this.docView=new un(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof l.YW?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,u=this.state;for(let Ze of e){if(Ze.startState!=u)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");u=Ze.state}if(this.destroyed){this.viewState.state=u;return}let y=this.hasFocus,T=0,R=null;e.some(Ze=>Ze.annotation(is))?(this.inputState.notifiedFocused=y,T=1):y!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=y,R=rs(u,y),R||(T=1));let _=this.observer.delayedAndroidKey,G=null;if(_?(this.observer.clearDelayedAndroidKey(),G=this.observer.readChange(),(G&&!this.state.doc.eq(u.doc)||!this.state.selection.eq(u.selection))&&(G=null)):this.observer.clear(),u.facet(l.yy.phrases)!=this.state.facet(l.yy.phrases))return this.setState(u);r=Dt.create(this,u,e),r.flags|=T;let we=this.viewState.scrollTarget;try{this.updateState=2;for(let Ze of e){if(we&&(we=we.map(Ze.changes)),Ze.scrollIntoView){let{main:Ue}=Ze.state.selection;we=new F(Ue.empty?Ue:l.jT.cursor(Ue.head,Ue.head>Ue.anchor?-1:1))}for(let Ue of Ze.effects)Ue.is(P)&&(we=Ue.value.clip(this.state))}this.viewState.update(r,we),this.bidiCache=vr.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ht)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(Ze=>Ze.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Or)!=r.state.facet(Or)&&(this.viewState.mustMeasureContent=!0),(t||n||we||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!r.empty)for(let Ze of this.state.facet(fe))try{Ze(r)}catch(Ue){Y(this.state,Ue,"update listener")}(R||G)&&Promise.resolve().then(()=>{R&&this.state==R.startState&&this.dispatch(R),G&&!bs(this,G)&&_.force&&Rt(this.contentDOM,_.key,_.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new cs(e),this.plugins=e.facet(je).map(n=>new et(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new un(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(je),n=e.state.facet(je);if(t!=n){let r=[];for(let u of n){let y=t.indexOf(u);if(y<0)r.push(new et(u));else{let T=this.plugins[y];T.mustUpdate=e,r.push(T)}}for(let u of this.plugins)u.mustUpdate!=e&&u.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:u,scrollAnchorHeight:y}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(y=-1),this.viewState.scrollAnchorHeight=-1;try{for(let T=0;;T++){if(y<0)if(I(n))u=-1,y=this.viewState.heightMap.height;else{let Ue=this.viewState.scrollAnchorAt(r);u=Ue.from,y=Ue.top}this.updateState=1;let R=this.viewState.measure(this);if(!R&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(T>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let _=[];R&4||([this.measureRequests,_]=[_,this.measureRequests]);let G=_.map(Ue=>{try{return Ue.read(this)}catch(tt){return Y(this.state,tt),ks}}),we=Dt.create(this,this.state,[]),Ze=!1;we.flags|=R,t?t.flags|=R:t=we,this.updateState=2,we.empty||(this.updatePlugins(we),this.inputState.update(we),this.updateAttrs(),Ze=this.docView.update(we));for(let Ue=0;Ue<_.length;Ue++)if(G[Ue]!=ks)try{let tt=_[Ue];tt.write&&tt.write(G[Ue],this)}catch(tt){Y(this.state,tt)}if(Ze&&this.docView.updateSelection(!0),!we.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,y=-1;continue}else{let tt=(u<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(u).top)-y;if(tt>1||tt<-1){r=r+tt,n.scrollTop=r/this.scaleY,y=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let T of this.state.facet(fe))T(t)}get themeClasses(){return jr+" "+(this.state.facet(Dr)?fs:Mi)+" "+this.state.facet(Or)}updateAttrs(){let e=Yi(this,at,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(he)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Yi(this,O,t);let n=this.observer.ignore(()=>{let r=ze(this.contentDOM,this.contentAttrs,t),u=ze(this.dom,this.editorAttrs,e);return r||u});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(zn.announce)){t&&(this.announceDOM.textContent=""),t=!1;let u=this.announceDOM.appendChild(document.createElement("div"));u.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ht);let e=this.state.facet(zn.cspNonce);f.V.mount(this.root,this.styleModules.concat(xo).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Gi(this,e,Nr(this,e,t,n))}moveByGroup(e,t){return Gi(this,e,Nr(this,e,t,n=>Js(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),u=n[t?n.length-1:0];return l.jT.cursor(u.side(t,r)+e.from,u.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return il(this,e,t,n)}moveVertically(e,t,n){return Gi(this,e,Ks(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),fi(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),u=this.bidiSpans(r),y=u[Kn.find(u,e-r.from,-1,t)];return ke(n,y.dir==_t.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(pt)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ss)return gi(e.length);let t=this.textDirectionAt(e.from),n;for(let u of this.bidiCache)if(u.from==e.from&&u.dir==t&&(u.fresh||bi(u.isolates,n=Ae(this,e))))return u.order;n||(n=Ae(this,e));let r=ui(e.text,t,n);return this.bidiCache.push(new vr(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{dt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return P.of(new F(typeof e=="number"?l.jT.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return P.of(new F(l.jT.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return We.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return We.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=f.V.newName(),r=[Or.of(n),ht.of(br(`.${n}`,e))];return t&&t.dark&&r.push(Dr.of(!0)),r}static baseTheme(e){return l.Wl.lowest(ht.of(br("."+jr,e,ds)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&q.get(n)||q.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}zn.styleModule=ht,zn.inputHandler=Pe,zn.focusChangeEffect=Fe,zn.perLineTextDirection=pt,zn.exceptionSink=M,zn.updateListener=fe,zn.editable=he,zn.mouseSelectionStyle=X,zn.dragMovesSelection=Q,zn.clickAddsSelectionRange=v,zn.decorations=g,zn.outerDecorations=C,zn.atomicRanges=j,zn.bidiIsolatedRanges=ee,zn.scrollMargins=_e,zn.darkTheme=Dr,zn.cspNonce=l.r$.define({combine:s=>s.length?s[0]:""}),zn.contentAttributes=O,zn.editorAttributes=at,zn.lineWrapping=zn.contentAttributes.of({class:"cm-lineWrapping"}),zn.announce=l.Py.define();const Ss=4096,ks={};class vr{constructor(e,t,n,r,u,y){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=u,this.order=y}static update(e,t){if(t.empty&&!e.some(u=>u.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:_t.LTR;for(let u=Math.max(0,e.length-10);u=0;r--){let u=n[r],y=typeof u=="function"?u(s):u;y&&tn(y,t)}return t}const ws=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function Po(s,e){const t=s.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let r,u,y,T;for(let R=0;Rn.concat(r),[]))),t}function $o(s,e,t){return As(Qs(s.state),e,s,t)}let Zi=null;const Qo=4e3;function Ts(s,e=ws){let t=Object.create(null),n=Object.create(null),r=(y,T)=>{let R=n[y];if(R==null)n[y]=T;else if(R!=T)throw new Error("Key binding "+y+" is used both as a regular binding and as a multi-stroke prefix")},u=(y,T,R,_,G)=>{var we,Ze;let Ue=t[y]||(t[y]=Object.create(null)),tt=T.split(/ (?!$)/).map(Et=>Po(Et,e));for(let Et=1;Et{let bn=Zi={view:An,prefix:mn,scope:y};return setTimeout(()=>{Zi==bn&&(Zi=null)},Qo),!0}]})}let wt=tt.join(" ");r(wt,!1);let gt=Ue[wt]||(Ue[wt]={preventDefault:!1,stopPropagation:!1,run:((Ze=(we=Ue._any)===null||we===void 0?void 0:we.run)===null||Ze===void 0?void 0:Ze.slice())||[]});R&>.run.push(R),_&&(gt.preventDefault=!0),G&&(gt.stopPropagation=!0)};for(let y of s){let T=y.scope?y.scope.split(" "):["editor"];if(y.any)for(let _ of T){let G=t[_]||(t[_]=Object.create(null));G._any||(G._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let we in G)G[we].run.push(y.any)}let R=y[e]||y.key;if(!!R)for(let _ of T)u(_,R,y.run,y.preventDefault,y.stopPropagation),y.shift&&u(_,"Shift-"+R,y.shift,y.preventDefault,y.stopPropagation)}return t}function As(s,e,t,n){let r=V(e),u=(0,l.gm)(r,0),y=(0,l.nZ)(u)==r.length&&r!=" ",T="",R=!1,_=!1,G=!1;Zi&&Zi.view==t&&Zi.scope==n&&(T=Zi.prefix+" ",Ur.indexOf(e.keyCode)<0&&(_=!0,Zi=null));let we=new Set,Ze=gt=>{if(gt){for(let Et of gt.run)if(!we.has(Et)&&(we.add(Et),Et(t,e)))return gt.stopPropagation&&(G=!0),!0;gt.preventDefault&&(gt.stopPropagation&&(G=!0),_=!0)}return!1},Ue=s[n],tt,wt;return Ue&&(Ze(Ue[T+xr(r,e,!y)])?R=!0:y&&(e.altKey||e.metaKey||e.ctrlKey)&&!(D.windows&&e.ctrlKey&&e.altKey)&&(tt=p[e.keyCode])&&tt!=r?(Ze(Ue[T+xr(tt,e,!0)])||e.shiftKey&&(wt=d[e.keyCode])!=r&&wt!=tt&&Ze(Ue[T+xr(wt,e,!1)]))&&(R=!0):y&&e.shiftKey&&Ze(Ue[T+xr(r,e,!0)])&&(R=!0),!R&&Ze(Ue._any)&&(R=!0)),_&&(R=!0),R&&G&&e.stopPropagation(),R}class _i{constructor(e,t,n,r,u){this.className=e,this.left=t,this.top=n,this.width=r,this.height=u}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let u=Xr(e);return[new _i(t,r.left-u.left,r.top-u.top,null,r.bottom-r.top)]}else return Zs(e,t,n)}}function Xr(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==_t.LTR?e.left:e.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:e.top-s.scrollDOM.scrollTop*s.scaleY}}function er(s,e,t){let n=l.jT.cursor(e);return{from:Math.max(t.from,s.moveToLineBoundary(n,!1,!0).from),to:Math.min(t.to,s.moveToLineBoundary(n,!0,!0).from),type:it.Text}}function Zs(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let n=Math.max(t.from,s.viewport.from),r=Math.min(t.to,s.viewport.to),u=s.textDirection==_t.LTR,y=s.contentDOM,T=y.getBoundingClientRect(),R=Xr(s),_=y.querySelector(".cm-line"),G=_&&window.getComputedStyle(_),we=T.left+(G?parseInt(G.paddingLeft)+Math.min(0,parseInt(G.textIndent)):0),Ze=T.right-(G?parseInt(G.paddingRight):0),Ue=Di(s,n),tt=Di(s,r),wt=Ue.type==it.Text?Ue:null,gt=tt.type==it.Text?tt:null;if(wt&&(s.lineWrapping||Ue.widgetLineBreaks)&&(wt=er(s,n,wt)),gt&&(s.lineWrapping||tt.widgetLineBreaks)&&(gt=er(s,r,gt)),wt&>&&wt.from==gt.from)return mn(An(t.from,t.to,wt));{let wn=wt?An(t.from,null,wt):bn(Ue,!1),jn=gt?An(null,t.to,gt):bn(tt,!0),hi=[];return(wt||Ue).to<(gt||tt).from-(wt&>?1:0)||Ue.widgetLineBreaks>1&&wn.bottom+s.defaultLineHeight/2Gs&&sr.from=$r)break;zi>Fi&&ul(Math.max(Wi,Fi),wn==null&&Wi<=Gs,Math.min(zi,$r),jn==null&&zi>=qs,Vr.dir)}if(Fi=or.to+1,Fi>=$r)break}return Us.length==0&&ul(Gs,wn==null,qs,jn==null,s.textDirection),{top:Oi,bottom:Ni,horizontal:Us}}function bn(wn,jn){let hi=T.top+(jn?wn.top:wn.bottom);return{top:hi,bottom:hi,horizontal:[]}}}function To(s,e){return s.constructor==e.constructor&&s.eq(e)}class Es{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Sr)!=e.state.facet(Sr)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(Sr);for(;t!To(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Sr=l.r$.define();function Rs(s){return[We.define(e=>new Es(e,s)),Sr.of(s)]}const Ds=!D.ios,Bi=l.r$.define({combine(s){return(0,l.BO)(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function rl(s={}){return[Bi.of(s),Ao,Zo,Eo,Zt.of(!0)]}function sl(s){return s.facet(Bi)}function js(s){return s.startState.facet(Bi)!=s.state.facet(Bi)}const Ao=Rs({above:!0,markers(s){let{state:e}=s,t=e.facet(Bi),n=[];for(let r of e.selection.ranges){let u=r==e.selection.main;if(r.empty?!u||Ds:t.drawRangeCursor){let y=u?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",T=r.empty?r:l.jT.cursor(r.head,r.head>r.anchor?-1:1);for(let R of _i.forRange(s,y,T))n.push(R)}}return n},update(s,e){s.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=js(s);return t&&Ls(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){Ls(e.state,s)},class:"cm-cursorLayer"});function Ls(s,e){e.style.animationDuration=s.facet(Bi).cursorBlinkRate+"ms"}const Zo=Rs({above:!1,markers(s){return s.state.selection.ranges.map(e=>e.empty?[]:_i.forRange(s,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(s,e){return s.docChanged||s.selectionSet||s.viewportChanged||js(s)},class:"cm-selectionLayer"}),Xs={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Ds&&(Xs[".cm-line"].caretColor="transparent !important",Xs[".cm-content"]={caretColor:"transparent !important"});const Eo=null,Ms=l.Py.define({map(s,e){return s==null?null:e.mapPos(s)}}),tr=l.QQ.define({create(){return null},update(s,e){return s!=null&&(s=e.changes.mapPos(s)),e.effects.reduce((t,n)=>n.is(Ms)?n.value:t,s)}}),Ro=We.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(tr);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(tr)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,e=s.state.field(tr),t=e!=null&&s.coordsAtPos(e);if(!t)return null;let n=s.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+s.scrollDOM.scrollLeft*s.scaleX,top:t.top-n.top+s.scrollDOM.scrollTop*s.scaleY,height:t.bottom-t.top}}drawCursor(s){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;s?(this.cursor.style.left=s.left/e+"px",this.cursor.style.top=s.top/t+"px",this.cursor.style.height=s.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(tr)!=s&&this.view.dispatch({effects:Ms.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ol(){return[tr,Ro]}function Is(s,e,t,n,r){e.lastIndex=0;for(let u=s.iterRange(t,n),y=t,T;!u.next().done;y+=u.value.length)if(!u.lineBreak)for(;T=e.exec(u.value);)r(y+T.index,T)}function Do(s,e){let t=s.visibleRanges;if(t.length==1&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let n=[];for(let{from:r,to:u}of t)r=Math.max(s.state.doc.lineAt(r).from,r-e),u=Math.min(s.state.doc.lineAt(u).to,u+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=u:n.push({from:r,to:u});return n}class Mr{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:u,maxLength:y=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(T,R,_,G)=>r(G,_,_+T[0].length,T,R);else if(typeof n=="function")this.addMatch=(T,R,_,G)=>{let we=n(T,R,_);we&&G(_,_+T[0].length,we)};else if(n)this.addMatch=(T,R,_,G)=>G(_,_+T[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=u,this.maxLength=y}createDeco(e){let t=new l.f_,n=t.add.bind(t);for(let{from:r,to:u}of Do(e,this.maxLength))Is(e.state.doc,this.regexp,r,u,(y,T)=>this.addMatch(T,e,y,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((u,y,T,R)=>{R>e.view.viewport.from&&T1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let u of e.visibleRanges){let y=Math.max(u.from,n),T=Math.min(u.to,r);if(T>y){let R=e.state.doc.lineAt(y),_=R.toR.from;y--)if(this.boundary.test(R.text[y-1-R.from])){G=y;break}for(;T<_.to;T++)if(this.boundary.test(_.text[T-_.from])){we=T;break}}let Ze=[],Ue,tt=(wt,gt,Et)=>Ze.push(Et.range(wt,gt));if(R==_)for(this.regexp.lastIndex=G-R.from;(Ue=this.regexp.exec(R.text))&&Ue.indexthis.addMatch(gt,e,wt,tt));t=t.update({filterFrom:G,filterTo:we,filter:(wt,gt)=>wtwe,add:Ze})}}return t}}const kr=/x/.unicode!=null?"gu":"g",jo=new RegExp(`[\0-\b -\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,kr),Lo={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ir=null;function Xo(){var s;if(Ir==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Ir=((s=e.tabSize)!==null&&s!==void 0?s:e.MozTabSize)!=null}return Ir||!1}const wr=l.r$.define({combine(s){let e=(0,l.BO)(s,{render:null,specialChars:jo,addSpecialChars:null});return(e.replaceTabs=!Xo())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,kr)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,kr)),e}});function ll(s={}){return[wr.of(s),Mo()]}let Ws=null;function Mo(){return Ws||(Ws=We.fromClass(class{constructor(s){this.view=s,this.decorations=Ye.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(wr)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new Mr({regexp:s.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,u=codePointAt(e[0],0);if(u==9){let y=r.lineAt(n),T=t.state.tabSize,R=countColumn(y.text,T,n-y.from);return Ye.replace({widget:new Yo((T-R%T)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[u]||(this.decorationCache[u]=Ye.replace({widget:new zo(s,u)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(wr);s.startState.facet(wr)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const Io="\u2022";function Wo(s){return s>=32?Io:s==10?"\u2424":String.fromCharCode(9216+s)}class zo extends null{constructor(e,t){super();this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Wo(this.code),n=e.state.phrase("Control character")+" "+(Lo[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let u=document.createElement("span");return u.textContent=t,u.title=n,u.setAttribute("aria-label",n),u.className="cm-specialChar",u}ignoreEvent(){return!1}}class Yo extends null{constructor(e){super();this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const zs=null;function al(){return[zs,O.of(s=>{var e;return((e=s.plugin(zs))===null||e===void 0?void 0:e.attrs)||null})]}function hl(){return Bo}const Ys=Ye.line({class:"cm-activeLine"}),Bo=We.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let r=s.lineBlockAt(n.head);r.from>e&&(t.push(Ys.range(r.from)),e=r.from)}return Ye.set(t)}},{decorations:s=>s.decorations});class Vo extends Ge{constructor(e){super();this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?N(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=ke(t[0],n.direction!="rtl"),u=parseInt(n.lineHeight);return r.bottom-r.top>u*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+u}:r}ignoreEvent(){return!1}}function No(s){return We.fromClass(class{constructor(e){this.view=e,this.placeholder=s?Ye.set([Ye.widget({widget:new Vo(s),side:1}).range(0)]):Ye.none}get decorations(){return this.view.state.doc.length?Ye.none:this.placeholder}},{decorations:e=>e.decorations})}const Wr=2e3;function Fo(s,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),u=[];if(e.off>Wr||t.off>Wr||e.col<0||t.col<0){let y=Math.min(e.off,t.off),T=Math.max(e.off,t.off);for(let R=n;R<=r;R++){let _=s.doc.line(R);_.length<=T&&u.push(EditorSelection.range(_.from+y,_.to+T))}}else{let y=Math.min(e.col,t.col),T=Math.max(e.col,t.col);for(let R=n;R<=r;R++){let _=s.doc.line(R),G=findColumn(_.text,y,s.tabSize,!0);if(G<0)u.push(EditorSelection.cursor(_.to));else{let we=findColumn(_.text,T,s.tabSize);u.push(EditorSelection.range(_.from+G,_.from+we))}}}return u}function Uo(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function Bs(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),r=t-n.from,u=r>Wr?-1:r==n.length?Uo(s,e.clientX):countColumn(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:u,off:r}}function si(s,e){let t=Bs(s,e),n=s.state.selection;return t?{update(r){if(r.docChanged){let u=r.changes.mapPos(r.startState.doc.line(t.line).from),y=r.state.doc.lineAt(u);t={line:y.number,col:t.col,off:Math.min(t.off,y.length)},n=n.map(r.changes)}},get(r,u,y){let T=Bs(s,r);if(!T)return n;let R=Fo(s.state,t,T);return R.length?y?EditorSelection.create(R.concat(n.ranges)):EditorSelection.create(R):n}}:null}function cl(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return zn.mouseSelectionStyle.of((t,n)=>e(n)?si(t,n):null)}const Go={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},i={style:"cursor: crosshair"};function b(s={}){let[e,t]=Go[s.key||"Alt"],n=We.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,zn.contentAttributes.of(r=>{var u;return((u=r.plugin(n))===null||u===void 0?void 0:u.isDown)?i:null})]}const E="-10000px";class Z{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(y=>y);let u=null;this.tooltipViews=this.tooltips.map(y=>u=n(y,u))}update(e,t){var n;let r=e.state.facet(this.facet),u=r.filter(R=>R);if(r===this.input){for(let R of this.tooltipViews)R.update&&R.update(e);return!1}let y=[],T=t?[]:null;for(let R=0;Rt[_]=R),t.length=T.length),this.input=r,this.tooltips=u,this.tooltipViews=y,!0}}function z(s={}){return ie.of(s)}function B(s){let{win:e}=s;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const ie=l.r$.define({combine:s=>{var e,t,n;return{position:D.ios?"absolute":((e=s.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||B}}}),de=new WeakMap,pe=We.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(ie);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Z(s,ft,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s,this.above);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(ie);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s,e){let t=s.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),s.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.insertBefore(r,n)}return t.dom.style.position=this.position,t.dom.style.top=E,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var s,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(s=n.destroy)===null||s===void 0||s.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(D.gecko)n=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==E&&r.style.left=="0px"){let u=r.getBoundingClientRect();n=Math.abs(u.top+1e4)>1||Math.abs(u.left)>1}}if(n||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((r,u)=>{let y=this.manager.tooltipViews[u];return y.getCoords?y.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(ie).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let T of this.manager.tooltipViews)T.dom.style.position="absolute"}let{editor:t,space:n,scaleX:r,scaleY:u}=s,y=[];for(let T=0;T=Math.min(t.bottom,n.bottom)||we.rightMath.min(t.right,n.right)+.1){G.style.top=E;continue}let Ue=R.arrow?_.dom.querySelector(".cm-tooltip-arrow"):null,tt=Ue?7:0,wt=Ze.right-Ze.left,gt=(e=de.get(_))!==null&&e!==void 0?e:Ze.bottom-Ze.top,Et=_.offset||De,mn=this.view.textDirection==_t.LTR,An=Ze.width>n.right-n.left?mn?n.left:n.right-Ze.width:mn?Math.min(we.left-(Ue?14:0)+Et.x,n.right-wt):Math.max(n.left,we.left-wt+(Ue?14:0)-Et.x),bn=this.above[T];!R.strictSide&&(bn?we.top-(Ze.bottom-Ze.top)-Et.yn.bottom)&&bn==n.bottom-we.bottom>we.top-n.top&&(bn=this.above[T]=!bn);let wn=(bn?we.top-n.top:n.bottom-we.bottom)-tt;if(wnAn&&Oi.topjn&&(jn=bn?Oi.top-gt-2-tt:Oi.bottom+tt+2);if(this.position=="absolute"?(G.style.top=(jn-s.parent.top)/u+"px",G.style.left=(An-s.parent.left)/r+"px"):(G.style.top=jn/u+"px",G.style.left=An/r+"px"),Ue){let Oi=we.left+(mn?Et.x:-Et.x)-(An+14-7);Ue.style.left=Oi/r+"px"}_.overlap!==!0&&y.push({left:An,top:jn,right:hi,bottom:jn+gt}),G.classList.toggle("cm-tooltip-above",bn),G.classList.toggle("cm-tooltip-below",!bn),_.positioned&&_.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=E}},{eventObservers:{scroll(){this.maybeMeasure()}}}),$e=zn.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),De={x:0,y:0},ft=l.r$.define({enables:[pe,$e]}),He=l.r$.define({combine:s=>s.reduce((e,t)=>e.concat(t),[])});class vt{static create(e){return new vt(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Z(e,He,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ct=ft.compute([He],s=>{let e=s.facet(He);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:vt.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class bt{constructor(e,t,n,r,u){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=u,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;eT.bottom||t.xT.right+e.defaultCharacterWidth)return;let R=e.bidiSpans(e.state.doc.lineAt(r)).find(G=>G.from<=r&&G.to>=r),_=R&&R.dir==_t.RTL?-1:1;u=t.x{this.pending==T&&(this.pending=null,R&&!(Array.isArray(R)&&!R.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(R)?R:[R])}))},R=>Y(e.state,R,"hover tooltip"))}else y&&!(Array.isArray(y)&&!y.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(y)?y:[y])})}get tooltip(){let e=this.view.plugin(pe),t=e?e.manager.tooltips.findIndex(n=>n.create==vt.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:u}=this;if(r.length&&u&&!jt(u.dom,e)||this.pending){let{pos:y}=r[0]||this.pending,T=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:y;(y==T?this.view.posAtCoords(this.lastMove)!=y:!Qt(this.view,y,T,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const At=4;function jt(s,e){let t=s.getBoundingClientRect();return e.clientX>=t.left-At&&e.clientX<=t.right+At&&e.clientY>=t.top-At&&e.clientY<=t.bottom+At}function Qt(s,e,t,n,r,u){let y=s.scrollDOM.getBoundingClientRect(),T=s.documentTop+s.documentPadding.top+s.contentHeight;if(y.left>n||y.rightr||Math.min(y.bottom,T)=e&&R<=t}function Ut(s,e={}){let t=StateEffect.define(),n=StateField.define({create(){return[]},update(r,u){if(r.length&&(e.hideOnChange&&(u.docChanged||u.selection)?r=[]:e.hideOn&&(r=r.filter(y=>!e.hideOn(u,y))),u.docChanged)){let y=[];for(let T of r){let R=u.changes.mapPos(T.pos,-1,MapMode.TrackDel);if(R!=null){let _=Object.assign(Object.create(null),T);_.pos=R,_.end!=null&&(_.end=u.changes.mapPos(_.end)),y.push(_)}}r=y}for(let y of u.effects)y.is(t)&&(r=y.value),y.is(Fn)&&(r=[]);return r},provide:r=>He.from(r)});return[n,We.define(r=>new bt(r,s,n,t,e.hoverTime||300)),ct]}function pn(s,e){let t=s.plugin(pe);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}function Qn(s){return s.facet(He).some(e=>e)}const Fn=null,xn=null;function Wt(s){let e=s.plugin(pe);e&&e.maybeMeasure()}const Nn=l.r$.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Sn(s){return s?[Nn.of(s)]:[]}function Bn(s,e){let t=s.plugin(fn),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const fn=We.fromClass(class{constructor(s){this.input=s.state.facet(Yn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Nn);this.top=new an(s,!0,e.topContainer),this.bottom=new an(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Nn);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new an(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new an(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Yn);if(t!=this.input){let n=t.filter(R=>R),r=[],u=[],y=[],T=[];for(let R of n){let _=this.specs.indexOf(R),G;_<0?(G=R(s.view),T.push(G)):(G=this.panels[_],G.update&&G.update(s)),r.push(G),(G.top?u:y).push(G)}this.specs=n,this.panels=r,this.top.sync(u),this.bottom.sync(y);for(let R of T)R.dom.classList.add("cm-panel"),R.mount&&R.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>zn.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class an{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Zn(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Zn(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Zn(s){let e=s.nextSibling;return s.remove(),e}const Yn=l.r$.define({enables:fn});class ln extends l.uU{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ln.prototype.elementClass="",ln.prototype.toDOM=void 0,ln.prototype.mapMode=l.gc.TrackBefore,ln.prototype.startSide=ln.prototype.endSide=-1,ln.prototype.point=!0;const Vn=l.r$.define(),qn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>l.Xs.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ei=l.r$.define();function kn(s){return[ni(),ei.of(Object.assign(Object.assign({},qn),s))]}const Tn=l.r$.define({combine:s=>s.some(e=>e)});function ni(s){let e=[oi];return s&&s.fixed===!1&&e.push(Tn.of(!0)),e}const oi=We.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(ei).map(e=>new Si(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(Tn),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Tn)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=l.Xs.iter(this.view.state.facet(Vn),this.view.viewport.from),n=[],r=this.gutters.map(u=>new Pi(u,this.view.viewport,-this.view.documentPadding.top));for(let u of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(u.type)){let y=!0;for(let T of u.type)if(T.type==it.Text&&y){_n(t,n,T.from);for(let R of r)R.line(this.view,T,n);y=!1}else if(T.widget)for(let R of r)R.widget(this.view,T)}else if(u.type==it.Text){_n(t,n,u.from);for(let y of r)y.line(this.view,u,n)}else if(u.widget)for(let y of r)y.widget(this.view,u);for(let u of r)u.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(ei),t=s.state.facet(ei),n=s.docChanged||s.heightChanged||s.viewportChanged||!l.Xs.eq(s.startState.facet(Vn),s.state.facet(Vn),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(s)&&(n=!0);else{n=!0;let r=[];for(let u of t){let y=e.indexOf(u);y<0?r.push(new Si(this.view,u)):(this.gutters[y].update(s),r.push(this.gutters[y]))}for(let u of this.gutters)u.dom.remove(),r.indexOf(u)<0&&u.destroy();for(let u of r)this.dom.appendChild(u.dom);this.gutters=r}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>zn.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==_t.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Hn(s){return Array.isArray(s)?s:[s]}function _n(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Pi{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=l.Xs.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,u=(t.top-this.height)/e.scaleY,y=t.height/e.scaleY;if(this.i==r.elements.length){let T=new Qi(e,y,u,n);r.elements.push(T),r.dom.appendChild(T.dom)}else r.elements[this.i].update(e,y,u,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];_n(this.cursor,r,t.from),n.length&&(r=r.concat(n));let u=this.gutter.config.lineMarker(e,t,r);u&&r.unshift(u);let y=this.gutter;r.length==0&&!y.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Si{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let u=r.target,y;if(u!=this.dom&&this.dom.contains(u)){for(;u.parentNode!=this.dom;)u=u.parentNode;let R=u.getBoundingClientRect();y=(R.top+R.bottom)/2}else y=r.clientY;let T=e.lineBlockAtHeight(y-e.documentTop);t.domEventHandlers[n](e,T,r)&&r.preventDefault()});this.markers=Hn(t.markers(e)),t.initialSpacer&&(this.spacer=new Qi(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Hn(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!l.Xs.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Qi{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Ii(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let u=0,y=0;;){let T=y,R=uu(T,R,_)||y(T,R,_):y}return n}})}});class ji extends ln{constructor(e){super();this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Vi(s,e){return s.state.facet(Ti).formatNumber(e,s.state)}const Pr=ei.compute([Ti],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Cr)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new ji(Vi(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Ti)!=e.state.facet(Ti),initialSpacer(e){return new ji(Vi(e,ir(e.state.doc.lines)))},updateSpacer(e,t){let n=Vi(t.view,ir(t.view.state.doc.lines));return n==e.number?e:new ji(n)},domEventHandlers:s.facet(Ti).domEventHandlers}));function nr(s={}){return[Ti.of(s),ni(),Pr]}function ir(s){let e=9;for(;e({decorations:s.createDeco(e),update(t){this.decorations=s.updateDeco(t,this.decorations)}}),{decorations:e=>e.decorations})}const Ns=Br(new Mr({regexp:/\t| +/g,decoration:s=>Vs(s[0]),boundary:/\S/}));function Ho(){return Ns}const Fs=Br(new Mr({regexp:/\s+$/g,decoration:Ye.mark({class:"cm-trailingSpace"}),boundary:/\S/}));function Jo(){return Fs}const Ko={HeightMap:ri,HeightOracle:Zr,MeasuredHeights:Er,QueryType:Gn,ChangedRange:kt,computeOrder:ui,moveVisually:h}},72104:function(Xe,ye,o){"use strict";o.d(ye,{L3:function(){return l},vj:function(){return te},md:function(){return d},Lj:function(){return x},Jq:function(){return m},hr:function(){return $},_b:function(){return H},mp:function(){return w},i9:function(){return I},FE:function(){return q}});const l=1024;let f=0;class p{constructor(A,D){this.from=A,this.to=D}}class d{constructor(A={}){this.id=f++,this.perNode=!!A.perNode,this.deserialize=A.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(A){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof A!="function"&&(A=m.match(A)),D=>{let oe=A(D);return oe===void 0?null:[this,oe]}}}d.closedBy=new d({deserialize:Ve=>Ve.split(" ")}),d.openedBy=new d({deserialize:Ve=>Ve.split(" ")}),d.group=new d({deserialize:Ve=>Ve.split(" ")}),d.isolate=new d({deserialize:Ve=>{if(Ve&&Ve!="rtl"&&Ve!="ltr"&&Ve!="auto")throw new RangeError("Invalid value for isolate: "+Ve);return Ve||"auto"}}),d.contextHash=new d({perNode:!0}),d.lookAhead=new d({perNode:!0}),d.mounted=new d({perNode:!0});class a{constructor(A,D,oe){this.tree=A,this.overlay=D,this.parser=oe}static get(A){return A&&A.props&&A.props[d.mounted.id]}}const S=Object.create(null);class m{constructor(A,D,oe,ge=0){this.name=A,this.props=D,this.id=oe,this.flags=ge}static define(A){let D=A.props&&A.props.length?Object.create(null):S,oe=(A.top?1:0)|(A.skipped?2:0)|(A.error?4:0)|(A.name==null?8:0),ge=new m(A.name||"",D,A.id,oe);if(A.props){for(let Te of A.props)if(Array.isArray(Te)||(Te=Te(ge)),Te){if(Te[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");D[Te[0].id]=Te[1]}}return ge}prop(A){return this.props[A.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(A){if(typeof A=="string"){if(this.name==A)return!0;let D=this.prop(d.group);return D?D.indexOf(A)>-1:!1}return this.id==A}static match(A){let D=Object.create(null);for(let oe in A)for(let ge of oe.split(" "))D[ge]=A[oe];return oe=>{for(let ge=oe.prop(d.group),Te=-1;Te<(ge?ge.length:0);Te++){let Ne=D[Te<0?oe.name:ge[Te]];if(Ne)return Ne}}}}m.none=new m("",Object.create(null),0,8);class x{constructor(A){this.types=A;for(let D=0;D0;for(let Lt=this.cursor(Ne|te.IncludeAnonymous);;){let Yt=!1;if(Lt.from<=Te&&Lt.to>=ge&&(!rt&&Lt.type.isAnonymous||D(Lt)!==!1)){if(Lt.firstChild())continue;Yt=!0}for(;Yt&&oe&&(rt||!Lt.type.isAnonymous)&&oe(Lt),!Lt.nextSibling();){if(!Lt.parent())return;Yt=!0}}}prop(A){return A.perNode?this.props?this.props[A.id]:void 0:this.type.prop(A)}get propValues(){let A=[];if(this.props)for(let D in this.props)A.push([+D,this.props[D]]);return A}balance(A={}){return this.children.length<=8?this:Ie(m.none,this.children,this.positions,0,this.children.length,0,this.length,(D,oe,ge)=>new w(this.type,D,oe,ge,this.propValues),A.makeTree||((D,oe,ge)=>new w(m.none,D,oe,ge)))}static build(A){return lt(A)}}w.empty=new w(m.none,[],[],0);class ce{constructor(A,D){this.buffer=A,this.index=D}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ce(this.buffer,this.index)}}class N{constructor(A,D,oe){this.buffer=A,this.length=D,this.set=oe}get type(){return m.none}toString(){let A=[];for(let D=0;D0));Lt=Ne[Lt+3]);return rt}slice(A,D,oe){let ge=this.buffer,Te=new Uint16Array(D-A),Ne=0;for(let rt=A,Lt=0;rt=A&&DA;case 1:return D<=A&&oe>A;case 2:return oe>A;case 4:return!0}}function be(Ve,A,D,oe){for(var ge;Ve.from==Ve.to||(D<1?Ve.from>=A:Ve.from>A)||(D>-1?Ve.to<=A:Ve.to0?rt.length:-1;A!=Yt;A+=D){let Bt=rt[A],nn=Lt[A]+Ne.from;if(!!xe(ge,oe,nn,nn+Bt.length)){if(Bt instanceof N){if(Te&te.ExcludeBuffers)continue;let hn=Bt.findChild(0,Bt.buffer.length,D,oe-nn,ge);if(hn>-1)return new Ce(new ae(Ne,Bt,A,nn),null,hn)}else if(Te&te.IncludeAnonymous||!Bt.type.isAnonymous||Je(Bt)){let hn;if(!(Te&te.IgnoreMounts)&&(hn=a.get(Bt))&&!hn.overlay)return new me(hn.tree,nn,A,Ne);let tn=new me(Bt,nn,A,Ne);return Te&te.IncludeAnonymous||!tn.type.isAnonymous?tn:tn.nextChild(D<0?Bt.children.length-1:0,D,oe,ge)}}}if(Te&te.IncludeAnonymous||!Ne.type.isAnonymous||(Ne.index>=0?A=Ne.index+D:A=D<0?-1:Ne._parent._tree.children.length,Ne=Ne._parent,!Ne))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(A){return this.nextChild(0,1,A,2)}childBefore(A){return this.nextChild(this._tree.children.length-1,-1,A,-2)}enter(A,D,oe=0){let ge;if(!(oe&te.IgnoreOverlays)&&(ge=a.get(this._tree))&&ge.overlay){let Te=A-this.from;for(let{from:Ne,to:rt}of ge.overlay)if((D>0?Ne<=Te:Ne=Te:rt>Te))return new me(ge.tree,ge.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,A,D,oe)}nextSignificantParent(){let A=this;for(;A.type.isAnonymous&&A._parent;)A=A._parent;return A}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ke(Ve,A,D,oe){let ge=Ve.cursor(),Te=[];if(!ge.firstChild())return Te;if(D!=null){for(let Ne=!1;!Ne;)if(Ne=ge.type.is(D),!ge.nextSibling())return Te}for(;;){if(oe!=null&&ge.type.is(oe))return Te;if(ge.type.is(A)&&Te.push(ge.node),!ge.nextSibling())return oe==null?Te:[]}}function re(Ve,A,D=A.length-1){for(let oe=Ve.parent;D>=0;oe=oe.parent){if(!oe)return!1;if(!oe.type.isAnonymous){if(A[D]&&A[D]!=oe.name)return!1;D--}}return!0}class ae{constructor(A,D,oe,ge){this.parent=A,this.buffer=D,this.index=oe,this.start=ge}}class Ce extends ne{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(A,D,oe){super();this.context=A,this._parent=D,this.index=oe,this.type=A.buffer.set.types[A.buffer.buffer[oe]]}child(A,D,oe){let{buffer:ge}=this.context,Te=ge.findChild(this.index+4,ge.buffer[this.index+3],A,D-this.context.start,oe);return Te<0?null:new Ce(this.context,this,Te)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(A){return this.child(1,A,2)}childBefore(A){return this.child(-1,A,-2)}enter(A,D,oe=0){if(oe&te.ExcludeBuffers)return null;let{buffer:ge}=this.context,Te=ge.findChild(this.index+4,ge.buffer[this.index+3],D>0?1:-1,A-this.context.start,D);return Te<0?null:new Ce(this.context,this,Te)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(A){return this._parent?null:this.context.parent.nextChild(this.context.index+A,A,0,4)}get nextSibling(){let{buffer:A}=this.context,D=A.buffer[this.index+3];return D<(this._parent?A.buffer[this._parent.index+3]:A.buffer.length)?new Ce(this.context,this._parent,D):this.externalSibling(1)}get prevSibling(){let{buffer:A}=this.context,D=this._parent?this._parent.index+4:0;return this.index==D?this.externalSibling(-1):new Ce(this.context,this._parent,A.findChild(D,this.index,-1,0,4))}get tree(){return null}toTree(){let A=[],D=[],{buffer:oe}=this.context,ge=this.index+4,Te=oe.buffer[this.index+3];if(Te>ge){let Ne=oe.buffer[this.index+1];A.push(oe.slice(ge,Te,Ne)),D.push(0)}return new w(this.type,A,D,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ee(Ve){if(!Ve.length)return null;let A=0,D=Ve[0];for(let Te=1;TeD.from||Ne.to=A){let rt=new me(Ne.tree,Ne.overlay[0].from+Te.from,-1,Te);(ge||(ge=[oe])).push(be(rt,A,D,!1))}}return ge?Ee(ge):oe}class dt{get name(){return this.type.name}constructor(A,D=0){if(this.mode=D,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,A instanceof me)this.yieldNode(A);else{this._tree=A.context.parent,this.buffer=A.context;for(let oe=A._parent;oe;oe=oe._parent)this.stack.unshift(oe.index);this.bufferNode=A,this.yieldBuf(A.index)}}yieldNode(A){return A?(this._tree=A,this.type=A.type,this.from=A.from,this.to=A.to,!0):!1}yieldBuf(A,D){this.index=A;let{start:oe,buffer:ge}=this.buffer;return this.type=D||ge.set.types[ge.buffer[A]],this.from=oe+ge.buffer[A+1],this.to=oe+ge.buffer[A+2],!0}yield(A){return A?A instanceof me?(this.buffer=null,this.yieldNode(A)):(this.buffer=A.context,this.yieldBuf(A.index,A.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(A,D,oe){if(!this.buffer)return this.yield(this._tree.nextChild(A<0?this._tree._tree.children.length-1:0,A,D,oe,this.mode));let{buffer:ge}=this.buffer,Te=ge.findChild(this.index+4,ge.buffer[this.index+3],A,D-this.buffer.start,oe);return Te<0?!1:(this.stack.push(this.index),this.yieldBuf(Te))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(A){return this.enterChild(1,A,2)}childBefore(A){return this.enterChild(-1,A,-2)}enter(A,D,oe=this.mode){return this.buffer?oe&te.ExcludeBuffers?!1:this.enterChild(1,A,D):this.yield(this._tree.enter(A,D,oe))}parent(){if(!this.buffer)return this.yieldNode(this.mode&te.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let A=this.mode&te.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(A)}sibling(A){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+A,A,0,4,this.mode)):!1;let{buffer:D}=this.buffer,oe=this.stack.length-1;if(A<0){let ge=oe<0?0:this.stack[oe]+4;if(this.index!=ge)return this.yieldBuf(D.findChild(ge,this.index,-1,0,4))}else{let ge=D.buffer[this.index+3];if(ge<(oe<0?D.buffer.length:D.buffer[this.stack[oe]+3]))return this.yieldBuf(ge)}return oe<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+A,A,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(A){let D,oe,{buffer:ge}=this;if(ge){if(A>0){if(this.index-1)for(let Te=D+A,Ne=A<0?-1:oe._tree.children.length;Te!=Ne;Te+=A){let rt=oe._tree.children[Te];if(this.mode&te.IncludeAnonymous||rt instanceof N||!rt.type.isAnonymous||Je(rt))return!1}return!0}move(A,D){if(D&&this.enterChild(A,0,4))return!0;for(;;){if(this.sibling(A))return!0;if(this.atLastNode(A)||!this.parent())return!1}}next(A=!0){return this.move(1,A)}prev(A=!0){return this.move(-1,A)}moveTo(A,D=0){for(;(this.from==this.to||(D<1?this.from>=A:this.from>A)||(D>-1?this.to<=A:this.to=0;){for(let Ne=A;Ne;Ne=Ne._parent)if(Ne.index==ge){if(ge==this.index)return Ne;D=Ne,oe=Te+1;break e}ge=this.stack[--Te]}}for(let ge=oe;ge=0;Te--){if(Te<0)return re(this.node,A,ge);let Ne=oe[D.buffer[this.stack[Te]]];if(!Ne.isAnonymous){if(A[ge]&&A[ge]!=Ne.name)return!1;ge--}}return!0}}function Je(Ve){return Ve.children.some(A=>A instanceof N||!A.type.isAnonymous||Je(A))}function lt(Ve){var A;let{buffer:D,nodeSet:oe,maxBufferLength:ge=l,reused:Te=[],minRepeatType:Ne=oe.types.length}=Ve,rt=Array.isArray(D)?new ce(D,D.length):D,Lt=oe.types,Yt=0,Bt=0;function nn(it,Ye,Pt,qt,Tt,Ht){let{id:Gt,start:xt,end:Kt,size:Jt}=rt,en=Bt;for(;Jt<0;)if(rt.next(),Jt==-1){let En=Te[Gt];Pt.push(En),qt.push(xt-it);return}else if(Jt==-3){Yt=Gt;return}else if(Jt==-4){Bt=Gt;return}else throw new RangeError(`Unrecognized record size: ${Jt}`);let _t=Lt[Gt],On,dn,Ln=xt-it;if(Kt-xt<=ge&&(dn=ze(rt.pos-Ye,Tt))){let En=new Uint16Array(dn.size-dn.skip),vn=rt.pos-dn.size,In=En.length;for(;rt.pos>vn;)In=Ot(dn.start,En,In);On=new N(En,Kt-dn.start,oe),Ln=dn.start-it}else{let En=rt.pos-Jt;rt.next();let vn=[],In=[],Dn=Gt>=Ne?Gt:-1,Jn=0,li=Kt;for(;rt.pos>En;)Dn>=0&&rt.id==Dn&&rt.size>=0?(rt.end<=li-ge&&(gn(vn,In,xt,Jn,rt.end,li,Dn,en),Jn=vn.length,li=rt.end),rt.next()):Ht>2500?hn(xt,En,vn,In):nn(xt,En,vn,In,Dn,Ht+1);if(Dn>=0&&Jn>0&&Jn-1&&Jn>0){let Kn=tn(_t);On=Ie(_t,vn,In,0,vn.length,0,Kt-xt,Kn,Kn)}else On=Le(_t,vn,In,Kt-xt,en-Kt)}Pt.push(On),qt.push(Ln)}function hn(it,Ye,Pt,qt){let Tt=[],Ht=0,Gt=-1;for(;rt.pos>Ye;){let{id:xt,start:Kt,end:Jt,size:en}=rt;if(en>4)rt.next();else{if(Gt>-1&&Kt=0;Jt-=3)xt[en++]=Tt[Jt],xt[en++]=Tt[Jt+1]-Kt,xt[en++]=Tt[Jt+2]-Kt,xt[en++]=en;Pt.push(new N(xt,Tt[2]-Kt,oe)),qt.push(Kt-it)}}function tn(it){return(Ye,Pt,qt)=>{let Tt=0,Ht=Ye.length-1,Gt,xt;if(Ht>=0&&(Gt=Ye[Ht])instanceof w){if(!Ht&&Gt.type==it&&Gt.length==qt)return Gt;(xt=Gt.prop(d.lookAhead))&&(Tt=Pt[Ht]+Gt.length+xt)}return Le(it,Ye,Pt,qt,Tt)}}function gn(it,Ye,Pt,qt,Tt,Ht,Gt,xt){let Kt=[],Jt=[];for(;it.length>qt;)Kt.push(it.pop()),Jt.push(Ye.pop()+Pt-Tt);it.push(Le(oe.types[Gt],Kt,Jt,Ht-Tt,xt-Ht)),Ye.push(Tt-Pt)}function Le(it,Ye,Pt,qt,Tt=0,Ht){if(Yt){let Gt=[d.contextHash,Yt];Ht=Ht?[Gt].concat(Ht):[Gt]}if(Tt>25){let Gt=[d.lookAhead,Tt];Ht=Ht?[Gt].concat(Ht):[Gt]}return new w(it,Ye,Pt,qt,Ht)}function ze(it,Ye){let Pt=rt.fork(),qt=0,Tt=0,Ht=0,Gt=Pt.end-ge,xt={size:0,start:0,skip:0};e:for(let Kt=Pt.pos-it;Pt.pos>Kt;){let Jt=Pt.size;if(Pt.id==Ye&&Jt>=0){xt.size=qt,xt.start=Tt,xt.skip=Ht,Ht+=4,qt+=4,Pt.next();continue}let en=Pt.pos-Jt;if(Jt<0||en=Ne?4:0,On=Pt.start;for(Pt.next();Pt.pos>en;){if(Pt.size<0)if(Pt.size==-3)_t+=4;else break e;else Pt.id>=Ne&&(_t+=4);Pt.next()}Tt=On,qt+=Jt,Ht+=_t}return(Ye<0||qt==it)&&(xt.size=qt,xt.start=Tt,xt.skip=Ht),xt.size>4?xt:void 0}function Ot(it,Ye,Pt){let{id:qt,start:Tt,end:Ht,size:Gt}=rt;if(rt.next(),Gt>=0&&qt4){let Kt=rt.pos-(Gt-4);for(;rt.pos>Kt;)Pt=Ot(it,Ye,Pt)}Ye[--Pt]=xt,Ye[--Pt]=Ht-it,Ye[--Pt]=Tt-it,Ye[--Pt]=qt}else Gt==-3?Yt=qt:Gt==-4&&(Bt=qt);return Pt}let yt=[],Oe=[];for(;rt.pos>0;)nn(Ve.start||0,Ve.bufferStart||0,yt,Oe,-1,0);let Ge=(A=Ve.length)!==null&&A!==void 0?A:yt.length?Oe[0]+yt[0].length:0;return new w(Lt[Ve.topID],yt.reverse(),Oe.reverse(),Ge)}const Rt=new WeakMap;function Re(Ve,A){if(!Ve.isAnonymous||A instanceof N||A.type!=Ve)return 1;let D=Rt.get(A);if(D==null){D=1;for(let oe of A.children){if(oe.type!=Ve||!(oe instanceof w)){D=1;break}D+=Re(Ve,oe)}Rt.set(A,D)}return D}function Ie(Ve,A,D,oe,ge,Te,Ne,rt,Lt){let Yt=0;for(let gn=oe;gn=Bt)break;Ye+=Pt}if(Oe==Ge+1){if(Ye>Bt){let Pt=gn[Ge];tn(Pt.children,Pt.positions,0,Pt.children.length,Le[Ge]+yt);continue}nn.push(gn[Ge])}else{let Pt=Le[Oe-1]+gn[Oe-1].length-it;nn.push(Ie(Ve,gn,Le,Ge,Oe,it,Pt,null,Lt))}hn.push(it+yt-Te)}}return tn(A,D,oe,ge,0),(rt||Lt)(nn,hn,Ne)}class ${constructor(){this.map=new WeakMap}setBuffer(A,D,oe){let ge=this.map.get(A);ge||this.map.set(A,ge=new Map),ge.set(D,oe)}getBuffer(A,D){let oe=this.map.get(A);return oe&&oe.get(D)}set(A,D){A instanceof Ce?this.setBuffer(A.context.buffer,A.index,D):A instanceof me&&this.map.set(A.tree,D)}get(A){return A instanceof Ce?this.getBuffer(A.context.buffer,A.index):A instanceof me?this.map.get(A.tree):void 0}cursorSet(A,D){A.buffer?this.setBuffer(A.buffer.buffer,A.index,D):this.map.set(A.tree,D)}cursorGet(A){return A.buffer?this.getBuffer(A.buffer.buffer,A.index):this.map.get(A.tree)}}class I{constructor(A,D,oe,ge,Te=!1,Ne=!1){this.from=A,this.to=D,this.tree=oe,this.offset=ge,this.open=(Te?1:0)|(Ne?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(A,D=[],oe=!1){let ge=[new I(0,A.length,A,0,!1,oe)];for(let Te of D)Te.to>A.length&&ge.push(Te);return ge}static applyChanges(A,D,oe=128){if(!D.length)return A;let ge=[],Te=1,Ne=A.length?A[0]:null;for(let rt=0,Lt=0,Yt=0;;rt++){let Bt=rt=oe)for(;Ne&&Ne.from=hn.from||nn<=hn.to||Yt){let tn=Math.max(hn.from,Lt)-Yt,gn=Math.min(hn.to,nn)-Yt;hn=tn>=gn?null:new I(tn,gn,hn.tree,hn.offset+Yt,rt>0,!!Bt)}if(hn&&ge.push(hn),Ne.to>nn)break;Ne=Tenew p(ge.from,ge.to)):[new p(0,0)]:[new p(0,A.length)],this.createParse(A,D||[],oe)}parse(A,D,oe){let ge=this.startParse(A,D,oe);for(;;){let Te=ge.advance();if(Te)return Te}}}class W{constructor(A){this.string=A}get length(){return this.string.length}chunk(A){return this.string.slice(A)}get lineChunks(){return!1}read(A,D){return this.string.slice(A,D)}}function q(Ve){return(A,D,oe,ge)=>new mt(A,Ve,D,oe,ge)}class K{constructor(A,D,oe,ge,Te){this.parser=A,this.parse=D,this.overlay=oe,this.target=ge,this.from=Te}}function Se(Ve){if(!Ve.length||Ve.some(A=>A.from>=A.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(Ve))}class Ke{constructor(A,D,oe,ge,Te,Ne,rt){this.parser=A,this.predicate=D,this.mounts=oe,this.index=ge,this.start=Te,this.target=Ne,this.prev=rt,this.depth=0,this.ranges=[]}}const ot=new d({perNode:!0});class mt{constructor(A,D,oe,ge,Te){this.nest=D,this.input=oe,this.fragments=ge,this.ranges=Te,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=A}advance(){if(this.baseParse){let oe=this.baseParse.advance();if(!oe)return null;if(this.baseParse=null,this.baseTree=oe,this.startInner(),this.stoppedAt!=null)for(let ge of this.inner)ge.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let oe=this.baseTree;return this.stoppedAt!=null&&(oe=new w(oe.type,oe.children,oe.positions,oe.length,oe.propValues.concat([[ot,this.stoppedAt]]))),oe}let A=this.inner[this.innerDone],D=A.parse.advance();if(D){this.innerDone++;let oe=Object.assign(Object.create(null),A.target.props);oe[d.mounted.id]=new a(D,A.overlay,A.parser),A.target.props=oe}return null}get parsedPos(){if(this.baseParse)return 0;let A=this.input.length;for(let D=this.innerDone;D=this.stoppedAt)rt=!1;else if(A.hasNode(ge)){if(D){let Yt=D.mounts.find(Bt=>Bt.frag.from<=ge.from&&Bt.frag.to>=ge.to&&Bt.mount.overlay);if(Yt)for(let Bt of Yt.mount.overlay){let nn=Bt.from+Yt.pos,hn=Bt.to+Yt.pos;nn>=ge.from&&hn<=ge.to&&!D.ranges.some(tn=>tn.fromnn)&&D.ranges.push({from:nn,to:hn})}}rt=!1}else if(oe&&(Ne=ut(oe.ranges,ge.from,ge.to)))rt=Ne!=2;else if(!ge.type.isAnonymous&&(Te=this.nest(ge,this.input))&&(ge.fromnew p(nn.from-ge.from,nn.to-ge.from)):null,ge.tree,Bt.length?Bt[0].from:ge.from)),Te.overlay?Bt.length&&(oe={ranges:Bt,depth:0,prev:oe}):rt=!1}}else D&&(Lt=D.predicate(ge))&&(Lt===!0&&(Lt=new p(ge.from,ge.to)),Lt.fromnew p(Bt.from-D.start,Bt.to-D.start)),D.target,Yt[0].from))),D=D.prev}oe&&!--oe.depth&&(oe=oe.prev)}}}}function ut(Ve,A,D){for(let oe of Ve){if(oe.from>=D)break;if(oe.to>A)return oe.from<=A&&oe.to>=D?2:1}return 0}function Vt(Ve,A,D,oe,ge,Te){if(A=A&&D.enter(oe,1,te.IgnoreOverlays|te.ExcludeBuffers)||D.next(!1)||(this.done=!0)}hasNode(A){if(this.moveTo(A.from),!this.done&&this.cursor.from+this.offset==A.from&&this.cursor.tree)for(let D=this.cursor.tree;;){if(D==A.tree)return!0;if(D.children.length&&D.positions[0]==0&&D.children[0]instanceof w)D=D.children[0];else break}return!1}}class sn{constructor(A){var D;if(this.fragments=A,this.curTo=0,this.fragI=0,A.length){let oe=this.curFrag=A[0];this.curTo=(D=oe.tree.prop(ot))!==null&&D!==void 0?D:oe.to,this.inner=new It(oe.tree,-oe.offset)}else this.curFrag=this.inner=null}hasNode(A){for(;this.curFrag&&A.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=A.from&&this.curTo>=A.to&&this.inner.hasNode(A)}nextFrag(){var A;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let D=this.curFrag=this.fragments[this.fragI];this.curTo=(A=D.tree.prop(ot))!==null&&A!==void 0?A:D.to,this.inner=new It(D.tree,-D.offset)}}findMounts(A,D){var oe;let ge=[];if(this.inner){this.inner.cursor.moveTo(A,1);for(let Te=this.inner.cursor.node;Te;Te=Te.parent){let Ne=(oe=Te.tree)===null||oe===void 0?void 0:oe.prop(d.mounted);if(Ne&&Ne.parser==D)for(let rt=this.fragI;rt=Te.to)break;Lt.tree==this.curFrag.tree&&ge.push({frag:Lt,pos:Te.from-Lt.offset,mount:Ne})}}}return ge}}function on(Ve,A){let D=null,oe=A;for(let ge=1,Te=0;ge=rt)break;Lt.to<=Ne||(D||(oe=D=A.slice()),Lt.fromrt&&D.splice(Te+1,0,new p(rt,Lt.to))):Lt.to>rt?D[Te--]=new p(rt,Lt.to):D.splice(Te--,1))}}return oe}function Xt(Ve,A,D,oe){let ge=0,Te=0,Ne=!1,rt=!1,Lt=-1e9,Yt=[];for(;;){let Bt=ge==Ve.length?1e9:Ne?Ve[ge].to:Ve[ge].from,nn=Te==A.length?1e9:rt?A[Te].to:A[Te].from;if(Ne!=rt){let hn=Math.max(Lt,D),tn=Math.min(Bt,nn,oe);hnnew p(hn.from+oe,hn.to+oe)),nn=Xt(A,Bt,Lt,Yt);for(let hn=0,tn=Lt;;hn++){let gn=hn==nn.length,Le=gn?Yt:nn[hn].from;if(Le>tn&&D.push(new I(tn,Le,ge.tree,-Ne,Te.from>=tn||Te.openStart,Te.to<=Le||Te.openEnd)),gn)break;tn=nn[hn].to}}else D.push(new I(Lt,Yt,ge.tree,-Ne,Te.from>=Ne||Te.openStart,Te.to<=rt||Te.openEnd))}return D}},79653:function(Xe,ye,o){"use strict";o.d(ye,{Vp:function(){return p},bW:function(){return ce},Gv:function(){return x},QR:function(){return te},pJ:function(){return $}});var l=o(72104);let f=0;class p{constructor(W,q,K){this.set=W,this.base=q,this.modified=K,this.id=f++}static define(W){if(W==null?void 0:W.base)throw new Error("Can not derive from a modified tag");let q=new p([],null,[]);if(q.set.push(q),W)for(let K of W.set)q.set.push(K);return q}static defineModifier(){let W=new a;return q=>q.modified.indexOf(W)>-1?q:a.get(q.base||q,q.modified.concat(W).sort((K,Se)=>K.id-Se.id))}}let d=0;class a{constructor(){this.instances=[],this.id=d++}static get(W,q){if(!q.length)return W;let K=q[0].instances.find(mt=>mt.base==W&&S(q,mt.modified));if(K)return K;let Se=[],Ke=new p(Se,W,q);for(let mt of q)mt.instances.push(Ke);let ot=m(q);for(let mt of W.set)if(!mt.modified.length)for(let ut of ot)Se.push(a.get(mt,ut));return Ke}}function S(H,W){return H.length==W.length&&H.every((q,K)=>q==W[K])}function m(H){let W=[[]];for(let q=0;qK.length-q.length)}function x(H){let W=Object.create(null);for(let q in H){let K=H[q];Array.isArray(K)||(K=[K]);for(let Se of q.split(" "))if(Se){let Ke=[],ot=2,mt=Se;for(let It=0;;){if(mt=="..."&&It>0&&It+3==Se.length){ot=1;break}let sn=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(mt);if(!sn)throw new RangeError("Invalid path: "+Se);if(Ke.push(sn[0]=="*"?"":sn[0][0]=='"'?JSON.parse(sn[0]):sn[0]),It+=sn[0].length,It==Se.length)break;let on=Se[It++];if(It==Se.length&&on=="!"){ot=0;break}if(on!="/")throw new RangeError("Invalid path: "+Se);mt=Se.slice(It)}let ut=Ke.length-1,Vt=Ke[ut];if(!Vt)throw new RangeError("Invalid path: "+Se);let zt=new U(K,ot,ut>0?Ke.slice(0,ut):null);W[Vt]=zt.sort(W[Vt])}}return V.add(W)}const V=new l.md;class U{constructor(W,q,K,Se){this.tags=W,this.mode=q,this.context=K,this.next=Se}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(W){return!W||W.depth{let ot=Se;for(let mt of Ke)for(let ut of mt.set){let Vt=q[ut.id];if(Vt){ot=ot?ot+" "+Vt:Vt;break}}return ot},scope:K}}function w(H,W){let q=null;for(let K of H){let Se=K.style(W);Se&&(q=q?q+" "+Se:Se)}return q}function ce(H,W,q,K=0,Se=H.length){let Ke=new xe(K,Array.isArray(W)?W:[W],q);Ke.highlightRange(H.cursor(),K,Se,"",Ke.highlighters),Ke.flush(Se)}function N(H,W,q,K,Se,Ke=0,ot=H.length){let mt=Ke;function ut(Vt,zt){if(!(Vt<=mt)){for(let It=H.slice(mt,Vt),sn=0;;){let on=It.indexOf(` `,sn),Xt=on<0?It.length:on;if(Xt>sn&&K(It.slice(sn,Xt),zt),on<0)break;Se(),sn=on+1}mt=Vt}}ce(W,q,(Vt,zt,It)=>{ut(Vt,""),ut(zt,It)},Ke,ot),ut(ot,"")}class xe{constructor(W,q,K){this.at=W,this.highlighters=q,this.span=K,this.class=""}startSpan(W,q){q!=this.class&&(this.flush(W),W>this.at&&(this.at=W),this.class=q)}flush(W){W>this.at&&this.class&&this.span(this.at,W,this.class)}highlightRange(W,q,K,Se,Ke){let{type:ot,from:mt,to:ut}=W;if(mt>=K||ut<=q)return;ot.isTop&&(Ke=this.highlighters.filter(on=>!on.scope||on.scope(ot)));let Vt=Se,zt=be(W)||U.empty,It=w(Ke,zt.tags);if(It&&(Vt&&(Vt+=" "),Vt+=It,zt.mode==1&&(Se+=(Se?" ":"")+It)),this.startSpan(Math.max(q,mt),Vt),zt.opaque)return;let sn=W.tree&&W.tree.prop(l.md.mounted);if(sn&&sn.overlay){let on=W.node.enter(sn.overlay[0].from+mt,1),Xt=this.highlighters.filter(Ve=>!Ve.scope||Ve.scope(sn.tree.type)),$t=W.firstChild();for(let Ve=0,A=mt;;Ve++){let D=Ve=oe||!W.nextSibling())););if(!D||oe>K)break;A=D.to+mt,A>q&&(this.highlightRange(on.cursor(),Math.max(q,D.from+mt),Math.min(K,A),"",Xt),this.startSpan(Math.min(K,A),Vt))}$t&&W.parent()}else if(W.firstChild()){sn&&(Se="");do if(!(W.to<=q)){if(W.from>=K)break;this.highlightRange(W,q,K,Se,Ke),this.startSpan(Math.min(K,W.to),Vt)}while(W.nextSibling());W.parent()}}}function be(H){let W=H.type.prop(V);for(;W&&W.context&&!H.matchContext(W.context);)W=W.next;return W||null}const ne=p.define,me=ne(),ke=ne(),re=ne(ke),ae=ne(ke),Ce=ne(),Ee=ne(Ce),nt=ne(Ce),qe=ne(),dt=ne(qe),Je=ne(),lt=ne(),Rt=ne(),Re=ne(Rt),Ie=ne(),$={comment:me,lineComment:ne(me),blockComment:ne(me),docComment:ne(me),name:ke,variableName:ne(ke),typeName:re,tagName:ne(re),propertyName:ae,attributeName:ne(ae),className:ne(ke),labelName:ne(ke),namespace:ne(ke),macroName:ne(ke),literal:Ce,string:Ee,docString:ne(Ee),character:ne(Ee),attributeValue:ne(Ee),number:nt,integer:ne(nt),float:ne(nt),bool:ne(Ce),regexp:ne(Ce),escape:ne(Ce),color:ne(Ce),url:ne(Ce),keyword:Je,self:ne(Je),null:ne(Je),atom:ne(Je),unit:ne(Je),modifier:ne(Je),operatorKeyword:ne(Je),controlKeyword:ne(Je),definitionKeyword:ne(Je),moduleKeyword:ne(Je),operator:lt,derefOperator:ne(lt),arithmeticOperator:ne(lt),logicOperator:ne(lt),bitwiseOperator:ne(lt),compareOperator:ne(lt),updateOperator:ne(lt),definitionOperator:ne(lt),typeOperator:ne(lt),controlOperator:ne(lt),punctuation:Rt,separator:ne(Rt),bracket:Re,angleBracket:ne(Re),squareBracket:ne(Re),paren:ne(Re),brace:ne(Re),content:qe,heading:dt,heading1:ne(dt),heading2:ne(dt),heading3:ne(dt),heading4:ne(dt),heading5:ne(dt),heading6:ne(dt),contentSeparator:ne(qe),list:ne(qe),quote:ne(qe),emphasis:ne(qe),strong:ne(qe),link:ne(qe),monospace:ne(qe),strikethrough:ne(qe),inserted:ne(),deleted:ne(),changed:ne(),invalid:ne(),meta:Ie,documentMeta:ne(Ie),annotation:ne(Ie),processingInstruction:ne(Ie),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()},I=te([{tag:$.link,class:"tok-link"},{tag:$.heading,class:"tok-heading"},{tag:$.emphasis,class:"tok-emphasis"},{tag:$.strong,class:"tok-strong"},{tag:$.keyword,class:"tok-keyword"},{tag:$.atom,class:"tok-atom"},{tag:$.bool,class:"tok-bool"},{tag:$.url,class:"tok-url"},{tag:$.labelName,class:"tok-labelName"},{tag:$.inserted,class:"tok-inserted"},{tag:$.deleted,class:"tok-deleted"},{tag:$.literal,class:"tok-literal"},{tag:$.string,class:"tok-string"},{tag:$.number,class:"tok-number"},{tag:[$.regexp,$.escape,$.special($.string)],class:"tok-string2"},{tag:$.variableName,class:"tok-variableName"},{tag:$.local($.variableName),class:"tok-variableName tok-local"},{tag:$.definition($.variableName),class:"tok-variableName tok-definition"},{tag:$.special($.variableName),class:"tok-variableName2"},{tag:$.definition($.propertyName),class:"tok-propertyName tok-definition"},{tag:$.typeName,class:"tok-typeName"},{tag:$.namespace,class:"tok-namespace"},{tag:$.className,class:"tok-className"},{tag:$.macroName,class:"tok-macroName"},{tag:$.propertyName,class:"tok-propertyName"},{tag:$.operator,class:"tok-operator"},{tag:$.comment,class:"tok-comment"},{tag:$.meta,class:"tok-meta"},{tag:$.invalid,class:"tok-invalid"},{tag:$.punctuation,class:"tok-punctuation"}])},11705:function(Xe,ye,o){"use strict";o.d(ye,{IK:function(){return dt},Jq:function(){return ce},WQ:function(){return Je},RA:function(){return w}});var l=o(72104),f=o(34155);class p{constructor($,I,H,W,q,K,Se,Ke,ot,mt=0,ut){this.p=$,this.stack=I,this.state=H,this.reducePos=W,this.pos=q,this.score=K,this.buffer=Se,this.bufferBase=Ke,this.curContext=ot,this.lookAhead=mt,this.parent=ut}toString(){return`[${this.stack.filter(($,I)=>I%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start($,I,H=0){let W=$.parser.context;return new p($,[],I,H,H,0,[],0,W?new d(W,W.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState($,I){this.stack.push(this.state,I,this.bufferBase+this.buffer.length),this.state=$}reduce($){var I;let H=$>>19,W=$&65535,{parser:q}=this.p,K=q.dynamicPrecedence(W);if(K&&(this.score+=K),H==0){this.pushState(q.getGoto(this.state,W,!0),this.reducePos),W=2e3&&!((I=this.p.parser.nodeSet.types[W])===null||I===void 0?void 0:I.isAnonymous)&&(Ke==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=ot):this.p.lastBigReductionSizeSe;)this.stack.pop();this.reduceContext(W,Ke)}storeNode($,I,H,W=4,q=!1){if($==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&K.buffer[Se-4]==0&&K.buffer[Se-1]>-1){if(I==H)return;if(K.buffer[Se-2]>=I){K.buffer[Se-2]=H;return}}}if(!q||this.pos==H)this.buffer.push($,I,H,W);else{let K=this.buffer.length;if(K>0&&this.buffer[K-4]!=0)for(;K>0&&this.buffer[K-2]>H;)this.buffer[K]=this.buffer[K-4],this.buffer[K+1]=this.buffer[K-3],this.buffer[K+2]=this.buffer[K-2],this.buffer[K+3]=this.buffer[K-1],K-=4,W>4&&(W-=4);this.buffer[K]=$,this.buffer[K+1]=I,this.buffer[K+2]=H,this.buffer[K+3]=W}}shift($,I,H,W){if($&131072)this.pushState($&65535,this.pos);else if(($&262144)==0){let q=$,{parser:K}=this.p;(W>this.pos||I<=K.maxNode)&&(this.pos=W,K.stateFlag(q,1)||(this.reducePos=W)),this.pushState(q,H),this.shiftContext(I,H),I<=K.maxNode&&this.buffer.push(I,H,W,4)}else this.pos=W,this.shiftContext(I,H),I<=this.p.parser.maxNode&&this.buffer.push(I,H,W,4)}apply($,I,H,W){$&65536?this.reduce($):this.shift($,I,H,W)}useNode($,I){let H=this.p.reused.length-1;(H<0||this.p.reused[H]!=$)&&(this.p.reused.push($),H++);let W=this.pos;this.reducePos=this.pos=W+$.length,this.pushState(I,W),this.buffer.push(H,W,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,$,this,this.p.stream.reset(this.pos-$.length)))}split(){let $=this,I=$.buffer.length;for(;I>0&&$.buffer[I-2]>$.reducePos;)I-=4;let H=$.buffer.slice(I),W=$.bufferBase+I;for(;$&&W==$.bufferBase;)$=$.parent;return new p(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,H,W,this.curContext,this.lookAhead,$)}recoverByDelete($,I){let H=$<=this.p.parser.maxNode;H&&this.storeNode($,this.pos,I,4),this.storeNode(0,this.pos,I,H?8:4),this.pos=this.reducePos=I,this.score-=190}canShift($){for(let I=new a(this);;){let H=this.p.parser.stateSlot(I.state,4)||this.p.parser.hasAction(I.state,$);if(H==0)return!1;if((H&65536)==0)return!0;I.reduce(H)}}recoverByInsert($){if(this.stack.length>=300)return[];let I=this.p.parser.nextStates(this.state);if(I.length>4<<1||this.stack.length>=120){let W=[];for(let q=0,K;qKe&1&&Se==K)||W.push(I[q],K)}I=W}let H=[];for(let W=0;W>19,W=I&65535,q=this.stack.length-H*3;if(q<0||$.getGoto(this.stack[q],W,!1)<0){let K=this.findForcedReduction();if(K==null)return!1;I=K}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(I),!0}findForcedReduction(){let{parser:$}=this.p,I=[],H=(W,q)=>{if(!I.includes(W))return I.push(W),$.allActions(W,K=>{if(!(K&(262144|131072)))if(K&65536){let Se=(K>>19)-q;if(Se>1){let Ke=K&65535,ot=this.stack.length-Se*3;if(ot>=0&&$.getGoto(this.stack[ot],Ke,!1)>=0)return Se<<19|65536|Ke}}else{let Se=H(K,q+1);if(Se!=null)return Se}})};return H(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:$}=this.p;return $.data[$.stateSlot(this.state,1)]==65535&&!$.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState($){if(this.state!=$.state||this.stack.length!=$.stack.length)return!1;for(let I=0;Ithis.lookAhead&&(this.emitLookAhead(),this.lookAhead=$)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class d{constructor($,I){this.tracker=$,this.context=I,this.hash=$.strict?$.hash(I):0}}class a{constructor($){this.start=$,this.state=$.state,this.stack=$.stack,this.base=this.stack.length}reduce($){let I=$&65535,H=$>>19;H==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(H-1)*3;let W=this.start.p.parser.getGoto(this.stack[this.base-3],I,!0);this.state=W}}class S{constructor($,I,H){this.stack=$,this.pos=I,this.index=H,this.buffer=$.buffer,this.index==0&&this.maybeNext()}static create($,I=$.bufferBase+$.buffer.length){return new S($,I,I-$.bufferBase)}maybeNext(){let $=this.stack.parent;$!=null&&(this.index=this.stack.bufferBase-$.bufferBase,this.stack=$,this.buffer=$.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new S(this.stack,this.pos,this.index)}}function m(Ie,$=Uint16Array){if(typeof Ie!="string")return Ie;let I=null;for(let H=0,W=0;H=92&&K--,K>=34&&K--;let Ke=K-32;if(Ke>=46&&(Ke-=46,Se=!0),q+=Ke,Se)break;q*=46}I?I[W++]=q:I=new $(q)}return I}class x{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const V=new x;class U{constructor($,I){this.input=$,this.ranges=I,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=V,this.rangeIndex=0,this.pos=this.chunkPos=I[0].from,this.range=I[0],this.end=I[I.length-1].to,this.readNext()}resolveOffset($,I){let H=this.range,W=this.rangeIndex,q=this.pos+$;for(;qH.to:q>=H.to;){if(W==this.ranges.length-1)return null;let K=this.ranges[++W];q+=K.from-H.to,H=K}return q}clipPos($){if($>=this.range.from&&$$)return Math.max($,I.from);return this.end}peek($){let I=this.chunkOff+$,H,W;if(I>=0&&I=this.chunk2Pos&&HSe.to&&(this.chunk2=this.chunk2.slice(0,Se.to-H)),W=this.chunk2.charCodeAt(0)}}return H>=this.token.lookAhead&&(this.token.lookAhead=H+1),W}acceptToken($,I=0){let H=I?this.resolveOffset(I,-1):this.pos;if(H==null||H=this.chunk2Pos&&this.posthis.range.to?$.slice(0,this.range.to-this.pos):$,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance($=1){for(this.chunkOff+=$;this.pos+$>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();$-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=$,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset($,I){if(I?(this.token=I,I.start=$,I.lookAhead=$+1,I.value=I.extended=-1):this.token=V,this.pos!=$){if(this.pos=$,$==this.end)return this.setDone(),this;for(;$=this.range.to;)this.range=this.ranges[++this.rangeIndex];$>=this.chunkPos&&$=this.chunkPos&&I<=this.chunkPos+this.chunk.length)return this.chunk.slice($-this.chunkPos,I-this.chunkPos);if($>=this.chunk2Pos&&I<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice($-this.chunk2Pos,I-this.chunk2Pos);if($>=this.range.from&&I<=this.range.to)return this.input.read($,I);let H="";for(let W of this.ranges){if(W.from>=I)break;W.to>$&&(H+=this.input.read(Math.max(W.from,$),Math.min(W.to,I)))}return H}}class te{constructor($,I){this.data=$,this.id=I}token($,I){let{parser:H}=I.p;N(this.data,$,I,this.id,H.data,H.tokenPrecTable)}}te.prototype.contextual=te.prototype.fallback=te.prototype.extend=!1;class w{constructor($,I,H){this.precTable=I,this.elseToken=H,this.data=typeof $=="string"?m($):$}token($,I){let H=$.pos,W=0;for(;;){let q=$.next<0,K=$.resolveOffset(1,1);if(N(this.data,$,I,0,this.data,this.precTable),$.token.value>-1)break;if(this.elseToken==null)return;if(q||W++,K==null)break;$.reset(K,$.token)}W&&($.reset(H,$.token),$.acceptToken(this.elseToken,W))}}w.prototype.contextual=te.prototype.fallback=te.prototype.extend=!1;class ce{constructor($,I={}){this.token=$,this.contextual=!!I.contextual,this.fallback=!!I.fallback,this.extend=!!I.extend}}function N(Ie,$,I,H,W,q){let K=0,Se=1<0){let It=Ie[zt];if(Ke.allows(It)&&($.token.value==-1||$.token.value==It||be(It,$.token.value,W,q))){$.acceptToken(It);break}}let mt=$.next,ut=0,Vt=Ie[K+2];if($.next<0&&Vt>ut&&Ie[ot+Vt*3-3]==65535){K=Ie[ot+Vt*3-1];continue e}for(;ut>1,It=ot+zt+(zt<<1),sn=Ie[It],on=Ie[It+1]||65536;if(mt=on)ut=zt+1;else{K=Ie[It+2],$.advance();continue e}}break}}function xe(Ie,$,I){for(let H=$,W;(W=Ie[H])!=65535;H++)if(W==I)return H-$;return-1}function be(Ie,$,I,H){let W=xe(I,H,$);return W<0||xe(I,H,Ie)$)&&!H.type.isError)return I<0?Math.max(0,Math.min(H.to-1,$-25)):Math.min(Ie.length,Math.max(H.from+1,$+25));if(I<0?H.prevSibling():H.nextSibling())break;if(!H.parent())return I<0?0:Ie.length}}class re{constructor($,I){this.fragments=$,this.nodeSet=I,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let $=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if($){for(this.safeFrom=$.openStart?ke($.tree,$.from+$.offset,1)-$.offset:$.from,this.safeTo=$.openEnd?ke($.tree,$.to+$.offset,-1)-$.offset:$.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push($.tree),this.start.push(-$.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt($){if($$)return this.nextStart=K,null;if(q instanceof l.mp){if(K==$){if(K=Math.max(this.safeFrom,$)&&(this.trees.push(q),this.start.push(K),this.index.push(0))}else this.index[I]++,this.nextStart=K+q.length}}}class ae{constructor($,I){this.stream=I,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=$.tokenizers.map(H=>new x)}getActions($){let I=0,H=null,{parser:W}=$.p,{tokenizers:q}=W,K=W.stateSlot($.state,3),Se=$.curContext?$.curContext.hash:0,Ke=0;for(let ot=0;otut.end+25&&(Ke=Math.max(ut.lookAhead,Ke)),ut.value!=0)){let Vt=I;if(ut.extended>-1&&(I=this.addActions($,ut.extended,ut.end,I)),I=this.addActions($,ut.value,ut.end,I),!mt.extend&&(H=ut,I>Vt))break}}for(;this.actions.length>I;)this.actions.pop();return Ke&&$.setLookAhead(Ke),!H&&$.pos==this.stream.end&&(H=new x,H.value=$.p.parser.eofTerm,H.start=H.end=$.pos,I=this.addActions($,H.value,H.end,I)),this.mainToken=H,this.actions}getMainToken($){if(this.mainToken)return this.mainToken;let I=new x,{pos:H,p:W}=$;return I.start=H,I.end=Math.min(H+1,W.stream.end),I.value=H==W.stream.end?W.parser.eofTerm:0,I}updateCachedToken($,I,H){let W=this.stream.clipPos(H.pos);if(I.token(this.stream.reset(W,$),H),$.value>-1){let{parser:q}=H.p;for(let K=0;K=0&&H.p.parser.dialect.allows(Se>>1)){(Se&1)==0?$.value=Se>>1:$.extended=Se>>1;break}}}else $.value=0,$.end=this.stream.clipPos(W+1)}putAction($,I,H,W){for(let q=0;q$.bufferLength*4?new re(H,$.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let $=this.stacks,I=this.minStackPos,H=this.stacks=[],W,q;if(this.bigReductionCount>300&&$.length==1){let[K]=$;for(;K.forceReduce()&&K.stack.length&&K.stack[K.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let K=0;K<$.length;K++){let Se=$[K];for(;;){if(this.tokens.mainToken=null,Se.pos>I)H.push(Se);else{if(this.advanceStack(Se,H,$))continue;{W||(W=[],q=[]),W.push(Se);let Ke=this.tokens.getMainToken(Se);q.push(Ke.value,Ke.end)}}break}}if(!H.length){let K=W&&Rt(W);if(K)return ne&&console.log("Finish with "+this.stackID(K)),this.stackToTree(K);if(this.parser.strict)throw ne&&W&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+I);this.recovering||(this.recovering=5)}if(this.recovering&&W){let K=this.stoppedAt!=null&&W[0].pos>this.stoppedAt?W[0]:this.runRecovery(W,q,H);if(K)return ne&&console.log("Force-finish "+this.stackID(K)),this.stackToTree(K.forceAll())}if(this.recovering){let K=this.recovering==1?1:this.recovering*3;if(H.length>K)for(H.sort((Se,Ke)=>Ke.score-Se.score);H.length>K;)H.pop();H.some(Se=>Se.reducePos>I)&&this.recovering--}else if(H.length>1){e:for(let K=0;K500&&ot.buffer.length>500)if((Se.score-ot.score||Se.buffer.length-ot.buffer.length)>0)H.splice(Ke--,1);else{H.splice(K--,1);continue e}}}H.length>12&&H.splice(12,H.length-12)}this.minStackPos=H[0].pos;for(let K=1;K ":"";if(this.stoppedAt!=null&&W>this.stoppedAt)return $.forceReduce()?$:null;if(this.fragments){let ot=$.curContext&&$.curContext.tracker.strict,mt=ot?$.curContext.hash:0;for(let ut=this.fragments.nodeAt(W);ut;){let Vt=this.parser.nodeSet.types[ut.type.id]==ut.type?q.getGoto($.state,ut.type.id):-1;if(Vt>-1&&ut.length&&(!ot||(ut.prop(l.md.contextHash)||0)==mt))return $.useNode(ut,Vt),ne&&console.log(K+this.stackID($)+` (via reuse of ${q.getName(ut.type.id)})`),!0;if(!(ut instanceof l.mp)||ut.children.length==0||ut.positions[0]>0)break;let zt=ut.children[0];if(zt instanceof l.mp&&ut.positions[0]==0)ut=zt;else break}}let Se=q.stateSlot($.state,4);if(Se>0)return $.reduce(Se),ne&&console.log(K+this.stackID($)+` (via always-reduce ${q.getName(Se&65535)})`),!0;if($.stack.length>=8400)for(;$.stack.length>6e3&&$.forceReduce(););let Ke=this.tokens.getActions($);for(let ot=0;otW?I.push(It):H.push(It)}return!1}advanceFully($,I){let H=$.pos;for(;;){if(!this.advanceStack($,null,null))return!1;if($.pos>H)return Ee($,I),!0}}runRecovery($,I,H){let W=null,q=!1;for(let K=0;K<$.length;K++){let Se=$[K],Ke=I[K<<1],ot=I[(K<<1)+1],mt=ne?this.stackID(Se)+" -> ":"";if(Se.deadEnd&&(q||(q=!0,Se.restart(),ne&&console.log(mt+this.stackID(Se)+" (restarted)"),this.advanceFully(Se,H))))continue;let ut=Se.split(),Vt=mt;for(let zt=0;ut.forceReduce()&&zt<10&&(ne&&console.log(Vt+this.stackID(ut)+" (via force-reduce)"),!this.advanceFully(ut,H));zt++)ne&&(Vt=this.stackID(ut)+" -> ");for(let zt of Se.recoverByInsert(Ke))ne&&console.log(mt+this.stackID(zt)+" (via recover-insert)"),this.advanceFully(zt,H);this.stream.end>Se.pos?(ot==Se.pos&&(ot++,Ke=0),Se.recoverByDelete(Ke,ot),ne&&console.log(mt+this.stackID(Se)+` (via recover-delete ${this.parser.getName(Ke)})`),Ee(Se,H)):(!W||W.scoreIe;class dt{constructor($){this.start=$.start,this.shift=$.shift||qe,this.reduce=$.reduce||qe,this.reuse=$.reuse||qe,this.hash=$.hash||(()=>0),this.strict=$.strict!==!1}}class Je extends l._b{constructor($){super();if(this.wrappers=[],$.version!=14)throw new RangeError(`Parser version (${$.version}) doesn't match runtime version (${14})`);let I=$.nodeNames.split(" ");this.minRepeatTerm=I.length;for(let Se=0;Se<$.repeatNodeCount;Se++)I.push("");let H=Object.keys($.topRules).map(Se=>$.topRules[Se][1]),W=[];for(let Se=0;Se=0)q(mt,Ke,Se[ot++]);else{let ut=Se[ot+-mt];for(let Vt=-mt;Vt>0;Vt--)q(Se[ot++],Ke,ut);ot++}}}this.nodeSet=new l.Lj(I.map((Se,Ke)=>l.Jq.define({name:Ke>=this.minRepeatTerm?void 0:Se,id:Ke,props:W[Ke],top:H.indexOf(Ke)>-1,error:Ke==0,skipped:$.skippedNodes&&$.skippedNodes.indexOf(Ke)>-1}))),$.propSources&&(this.nodeSet=this.nodeSet.extend(...$.propSources)),this.strict=!1,this.bufferLength=l.L3;let K=m($.tokenData);this.context=$.context,this.specializerSpecs=$.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let Se=0;Setypeof Se=="number"?new te(K,Se):Se),this.topRules=$.topRules,this.dialects=$.dialects||{},this.dynamicPrecedences=$.dynamicPrecedences||null,this.tokenPrecTable=$.tokenPrec,this.termNames=$.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse($,I,H){let W=new Ce(this,$,I,H);for(let q of this.wrappers)W=q(W,$,I,H);return W}getGoto($,I,H=!1){let W=this.goto;if(I>=W[0])return-1;for(let q=W[I+1];;){let K=W[q++],Se=K&1,Ke=W[q++];if(Se&&H)return Ke;for(let ot=q+(K>>1);q0}validAction($,I){return!!this.allActions($,H=>H==I?!0:null)}allActions($,I){let H=this.stateSlot($,4),W=H?I(H):void 0;for(let q=this.stateSlot($,1);W==null;q+=3){if(this.data[q]==65535)if(this.data[q+1]==1)q=lt(this.data,q+2);else break;W=I(lt(this.data,q+1))}return W}nextStates($){let I=[];for(let H=this.stateSlot($,1);;H+=3){if(this.data[H]==65535)if(this.data[H+1]==1)H=lt(this.data,H+2);else break;if((this.data[H+2]&65536>>16)==0){let W=this.data[H+1];I.some((q,K)=>K&1&&q==W)||I.push(this.data[H],W)}}return I}configure($){let I=Object.assign(Object.create(Je.prototype),this);if($.props&&(I.nodeSet=this.nodeSet.extend(...$.props)),$.top){let H=this.topRules[$.top];if(!H)throw new RangeError(`Invalid top rule name ${$.top}`);I.top=H}return $.tokenizers&&(I.tokenizers=this.tokenizers.map(H=>{let W=$.tokenizers.find(q=>q.from==H);return W?W.to:H})),$.specializers&&(I.specializers=this.specializers.slice(),I.specializerSpecs=this.specializerSpecs.map((H,W)=>{let q=$.specializers.find(Se=>Se.from==H.external);if(!q)return H;let K=Object.assign(Object.assign({},H),{external:q.to});return I.specializers[W]=Re(K),K})),$.contextTracker&&(I.context=$.contextTracker),$.dialect&&(I.dialect=this.parseDialect($.dialect)),$.strict!=null&&(I.strict=$.strict),$.wrap&&(I.wrappers=I.wrappers.concat($.wrap)),$.bufferLength!=null&&(I.bufferLength=$.bufferLength),I}hasWrappers(){return this.wrappers.length>0}getName($){return this.termNames?this.termNames[$]:String($<=this.maxNode&&this.nodeSet.types[$].name||$)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence($){let I=this.dynamicPrecedences;return I==null?0:I[$]||0}parseDialect($){let I=Object.keys(this.dialects),H=I.map(()=>!1);if($)for(let q of $.split(" ")){let K=I.indexOf(q);K>=0&&(H[K]=!0)}let W=null;for(let q=0;qH)&&I.p.parser.stateFlag(I.state,2)&&(!$||$.scoreIe.external(I,H)<<1|$}return Ie.get}},96132:function(){},61979:function(Xe,ye,o){"use strict";o.d(ye,{qA:function(){return m},Ds:function(){return d},bv:function(){return ce},kZ:function(){return a},P2:function(){return V},Vj:function(){return N}});const l=be=>{const ne=typeof be;return ne!=="function"&&ne!=="object"||be===null},f=be=>{const ne=be.flags===""?void 0:be.flags;return new RegExp(be.source,ne)},p=(be,ne=new WeakMap)=>{if(be===null||l(be))return be;if(ne.has(be))return ne.get(be);if(be instanceof RegExp)return f(be);if(be instanceof Date)return new Date(be.getTime());if(be instanceof Function)return be;if(be instanceof Map){const ke=new Map;return ne.set(be,ke),be.forEach((re,ae)=>{ke.set(ae,p(re,ne))}),ke}if(be instanceof Set){const ke=new Set;ne.set(be,ke);for(const re of be)ke.add(p(re,ne));return ke}if(Array.isArray(be)){const ke=[];return ne.set(be,ke),be.forEach(re=>{ke.push(p(re,ne))}),ke}const me={};ne.set(be,me);for(const ke in be)Object.prototype.hasOwnProperty.call(be,ke)&&(me[ke]=p(be[ke],ne));return me},d=(be,ne=200)=>{let me=0;return(...ke)=>new Promise(re=>{me&&(clearTimeout(me),re("cancel")),me=window.setTimeout(()=>{be.apply(void 0,ke),me=0,re("done")},ne)})},a=(be,ne={_blank:!0,nofollow:!0})=>{const me=document.createElement("a");me.href=be,ne._blank&&(me.target="_blank"),ne.nofollow&&(me.rel="noopener noreferrer"),me.click()},S=(be,ne="")=>{const me=document.createElement("a");me.setAttribute("href",be),me.setAttribute("download",ne),me.click()},m=()=>{let be=-1;return(ne,me,ke,re=100)=>{const ae=()=>{ke&&(typeof re=="number"?setTimeout(ke,re):ke())};be!==-1&&(cancelAnimationFrame(be),ae());let Ce=ne.scrollTop;const Ee=()=>{be=-1;const nt=me-Ce;Ce=Ce+nt/5,Math.abs(nt)<1?(ne.scrollTo(0,me),ae()):(ne.scrollTo(0,Ce),be=requestAnimationFrame(Ee))};be=requestAnimationFrame(Ee)}},x=m(),V=(be,ne=200)=>{let me=0,ke=null;return(...re)=>{const ae=Ce=>{me===0&&(me=Ce),Ce-me>=ne?(be.apply(void 0,ke),ke=null,me=0):window.requestAnimationFrame(ae)};ke===null&&window.requestAnimationFrame(ae),ke=re}},U=(be,ne=!0)=>{if(!be)return{};const me={};return be.replace(/^\?/,"").split("&").forEach(ke=>{const[re,ae]=ke.split("=");if(re){const Ce=ne?decodeURIComponent(re):re,Ee=ne?decodeURIComponent(ae):ae;me[Ce]!==void 0?(Array.isArray(me[Ce])||(me[Ce]=[me[Ce]]),me[Ce].push(Ee)):me[Ce]=Ee}}),me},te=(be,ne=!0)=>be?Object.keys(be).map(me=>{const ke=ne?encodeURIComponent(me):me;if(Array.isArray(be[me]))return be[me].map(re=>{const ae=ne?encodeURIComponent(re):re;return`${ke}=${ae}`}).join("&");{const re=ne?encodeURIComponent(be[me]):be[me];return`${ke}=${re}`}}).join("&"):"",w=(be,ne,me="asc")=>be.sort((ke,re)=>{const ae=ne(ke),Ce=ne(re);return ae===void 0&&Ce!==void 0||ae===null&&Ce!==void 0?me==="asc"?-1:1:ae==null&&Ce===void 0||Ce==null?me==="asc"?1:-1:xe(ae)&&xe(Ce)?me=="asc"?ae-Ce:Ce-ae:me=="asc"?String(ae).localeCompare(String(Ce),void 0,{numeric:!0}):String(Ce).localeCompare(String(ae),void 0,{numeric:!0})}),ce=be=>{const ne=me=>{const{scrollHeight:ke,scrollWidth:re,offsetHeight:ae,offsetWidth:Ce,scrollLeft:Ee,scrollTop:nt}=be,qe=me.x,dt=me.y,Je=Rt=>{const Re=nt+dt-Rt.y,Ie=Ee+qe-Rt.x,$=ke-ae,I=re-Ce,H={};Ie>=0&&Ie<=I&&(H.left=Ie),Re>=0&&Re<=$&&(H.top=Re),be.scroll(H)};document.addEventListener("mousemove",Je);const lt=()=>{document.removeEventListener("mousemove",Je),document.removeEventListener("mouseup",lt)};document.addEventListener("mouseup",lt)};return be.addEventListener("mousedown",ne),()=>{be.removeEventListener("mousedown",ne)}},N=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,xe=be=>!isNaN(Number(be))},20640:function(Xe,ye,o){"use strict";var l=o(11742),f={"text/plain":"Text","text/html":"Url",default:"Text"},p="Copy to clipboard: #{key}, Enter";function d(S){var m=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return S.replace(/#{\s*key\s*}/g,m)}function a(S,m){var x,V,U,te,w,ce,N=!1;m||(m={}),x=m.debug||!1;try{U=l(),te=document.createRange(),w=document.getSelection(),ce=document.createElement("span"),ce.textContent=S,ce.ariaHidden="true",ce.style.all="unset",ce.style.position="fixed",ce.style.top=0,ce.style.clip="rect(0, 0, 0, 0)",ce.style.whiteSpace="pre",ce.style.webkitUserSelect="text",ce.style.MozUserSelect="text",ce.style.msUserSelect="text",ce.style.userSelect="text",ce.addEventListener("copy",function(be){if(be.stopPropagation(),m.format)if(be.preventDefault(),typeof be.clipboardData=="undefined"){x&&console.warn("unable to use e.clipboardData"),x&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var ne=f[m.format]||f.default;window.clipboardData.setData(ne,S)}else be.clipboardData.clearData(),be.clipboardData.setData(m.format,S);m.onCopy&&(be.preventDefault(),m.onCopy(be.clipboardData))}),document.body.appendChild(ce),te.selectNodeContents(ce),w.addRange(te);var xe=document.execCommand("copy");if(!xe)throw new Error("copy command was unsuccessful");N=!0}catch(be){x&&console.error("unable to copy using execCommand: ",be),x&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(m.format||"text",S),m.onCopy&&m.onCopy(window.clipboardData),N=!0}catch(ne){x&&console.error("unable to copy using clipboardData: ",ne),x&&console.error("falling back to prompt"),V=d("message"in m?m.message:p),window.prompt(V,S)}}finally{w&&(typeof w.removeRange=="function"?w.removeRange(te):w.removeAllRanges()),ce&&document.body.removeChild(ce),U()}return N}Xe.exports=a},32667:function(Xe,ye,o){var l=o(9950),f=o(25419),p=o(17381);function d(m){return m==null}function a(m){var x={};for(var V in m)x[V]=m[V];return x}function S(m){m=a(m||{}),m.whiteList=m.whiteList||l.whiteList,m.onAttr=m.onAttr||l.onAttr,m.onIgnoreAttr=m.onIgnoreAttr||l.onIgnoreAttr,m.safeAttrValue=m.safeAttrValue||l.safeAttrValue,this.options=m}S.prototype.process=function(m){if(m=m||"",m=m.toString(),!m)return"";var x=this,V=x.options,U=V.whiteList,te=V.onAttr,w=V.onIgnoreAttr,ce=V.safeAttrValue,N=f(m,function(xe,be,ne,me,ke){var re=U[ne],ae=!1;if(re===!0?ae=re:typeof re=="function"?ae=re(me):re instanceof RegExp&&(ae=re.test(me)),ae!==!0&&(ae=!1),me=ce(ne,me),!!me){var Ce={position:be,sourcePosition:xe,source:ke,isWhite:ae};if(ae){var Ee=te(ne,me,Ce);return d(Ee)?ne+":"+me:Ee}else{var Ee=w(ne,me,Ce);if(!d(Ee))return Ee}}});return N},Xe.exports=S},9950:function(Xe,ye){function o(){var a={};return a["align-content"]=!1,a["align-items"]=!1,a["align-self"]=!1,a["alignment-adjust"]=!1,a["alignment-baseline"]=!1,a.all=!1,a["anchor-point"]=!1,a.animation=!1,a["animation-delay"]=!1,a["animation-direction"]=!1,a["animation-duration"]=!1,a["animation-fill-mode"]=!1,a["animation-iteration-count"]=!1,a["animation-name"]=!1,a["animation-play-state"]=!1,a["animation-timing-function"]=!1,a.azimuth=!1,a["backface-visibility"]=!1,a.background=!0,a["background-attachment"]=!0,a["background-clip"]=!0,a["background-color"]=!0,a["background-image"]=!0,a["background-origin"]=!0,a["background-position"]=!0,a["background-repeat"]=!0,a["background-size"]=!0,a["baseline-shift"]=!1,a.binding=!1,a.bleed=!1,a["bookmark-label"]=!1,a["bookmark-level"]=!1,a["bookmark-state"]=!1,a.border=!0,a["border-bottom"]=!0,a["border-bottom-color"]=!0,a["border-bottom-left-radius"]=!0,a["border-bottom-right-radius"]=!0,a["border-bottom-style"]=!0,a["border-bottom-width"]=!0,a["border-collapse"]=!0,a["border-color"]=!0,a["border-image"]=!0,a["border-image-outset"]=!0,a["border-image-repeat"]=!0,a["border-image-slice"]=!0,a["border-image-source"]=!0,a["border-image-width"]=!0,a["border-left"]=!0,a["border-left-color"]=!0,a["border-left-style"]=!0,a["border-left-width"]=!0,a["border-radius"]=!0,a["border-right"]=!0,a["border-right-color"]=!0,a["border-right-style"]=!0,a["border-right-width"]=!0,a["border-spacing"]=!0,a["border-style"]=!0,a["border-top"]=!0,a["border-top-color"]=!0,a["border-top-left-radius"]=!0,a["border-top-right-radius"]=!0,a["border-top-style"]=!0,a["border-top-width"]=!0,a["border-width"]=!0,a.bottom=!1,a["box-decoration-break"]=!0,a["box-shadow"]=!0,a["box-sizing"]=!0,a["box-snap"]=!0,a["box-suppress"]=!0,a["break-after"]=!0,a["break-before"]=!0,a["break-inside"]=!0,a["caption-side"]=!1,a.chains=!1,a.clear=!0,a.clip=!1,a["clip-path"]=!1,a["clip-rule"]=!1,a.color=!0,a["color-interpolation-filters"]=!0,a["column-count"]=!1,a["column-fill"]=!1,a["column-gap"]=!1,a["column-rule"]=!1,a["column-rule-color"]=!1,a["column-rule-style"]=!1,a["column-rule-width"]=!1,a["column-span"]=!1,a["column-width"]=!1,a.columns=!1,a.contain=!1,a.content=!1,a["counter-increment"]=!1,a["counter-reset"]=!1,a["counter-set"]=!1,a.crop=!1,a.cue=!1,a["cue-after"]=!1,a["cue-before"]=!1,a.cursor=!1,a.direction=!1,a.display=!0,a["display-inside"]=!0,a["display-list"]=!0,a["display-outside"]=!0,a["dominant-baseline"]=!1,a.elevation=!1,a["empty-cells"]=!1,a.filter=!1,a.flex=!1,a["flex-basis"]=!1,a["flex-direction"]=!1,a["flex-flow"]=!1,a["flex-grow"]=!1,a["flex-shrink"]=!1,a["flex-wrap"]=!1,a.float=!1,a["float-offset"]=!1,a["flood-color"]=!1,a["flood-opacity"]=!1,a["flow-from"]=!1,a["flow-into"]=!1,a.font=!0,a["font-family"]=!0,a["font-feature-settings"]=!0,a["font-kerning"]=!0,a["font-language-override"]=!0,a["font-size"]=!0,a["font-size-adjust"]=!0,a["font-stretch"]=!0,a["font-style"]=!0,a["font-synthesis"]=!0,a["font-variant"]=!0,a["font-variant-alternates"]=!0,a["font-variant-caps"]=!0,a["font-variant-east-asian"]=!0,a["font-variant-ligatures"]=!0,a["font-variant-numeric"]=!0,a["font-variant-position"]=!0,a["font-weight"]=!0,a.grid=!1,a["grid-area"]=!1,a["grid-auto-columns"]=!1,a["grid-auto-flow"]=!1,a["grid-auto-rows"]=!1,a["grid-column"]=!1,a["grid-column-end"]=!1,a["grid-column-start"]=!1,a["grid-row"]=!1,a["grid-row-end"]=!1,a["grid-row-start"]=!1,a["grid-template"]=!1,a["grid-template-areas"]=!1,a["grid-template-columns"]=!1,a["grid-template-rows"]=!1,a["hanging-punctuation"]=!1,a.height=!0,a.hyphens=!1,a.icon=!1,a["image-orientation"]=!1,a["image-resolution"]=!1,a["ime-mode"]=!1,a["initial-letters"]=!1,a["inline-box-align"]=!1,a["justify-content"]=!1,a["justify-items"]=!1,a["justify-self"]=!1,a.left=!1,a["letter-spacing"]=!0,a["lighting-color"]=!0,a["line-box-contain"]=!1,a["line-break"]=!1,a["line-grid"]=!1,a["line-height"]=!1,a["line-snap"]=!1,a["line-stacking"]=!1,a["line-stacking-ruby"]=!1,a["line-stacking-shift"]=!1,a["line-stacking-strategy"]=!1,a["list-style"]=!0,a["list-style-image"]=!0,a["list-style-position"]=!0,a["list-style-type"]=!0,a.margin=!0,a["margin-bottom"]=!0,a["margin-left"]=!0,a["margin-right"]=!0,a["margin-top"]=!0,a["marker-offset"]=!1,a["marker-side"]=!1,a.marks=!1,a.mask=!1,a["mask-box"]=!1,a["mask-box-outset"]=!1,a["mask-box-repeat"]=!1,a["mask-box-slice"]=!1,a["mask-box-source"]=!1,a["mask-box-width"]=!1,a["mask-clip"]=!1,a["mask-image"]=!1,a["mask-origin"]=!1,a["mask-position"]=!1,a["mask-repeat"]=!1,a["mask-size"]=!1,a["mask-source-type"]=!1,a["mask-type"]=!1,a["max-height"]=!0,a["max-lines"]=!1,a["max-width"]=!0,a["min-height"]=!0,a["min-width"]=!0,a["move-to"]=!1,a["nav-down"]=!1,a["nav-index"]=!1,a["nav-left"]=!1,a["nav-right"]=!1,a["nav-up"]=!1,a["object-fit"]=!1,a["object-position"]=!1,a.opacity=!1,a.order=!1,a.orphans=!1,a.outline=!1,a["outline-color"]=!1,a["outline-offset"]=!1,a["outline-style"]=!1,a["outline-width"]=!1,a.overflow=!1,a["overflow-wrap"]=!1,a["overflow-x"]=!1,a["overflow-y"]=!1,a.padding=!0,a["padding-bottom"]=!0,a["padding-left"]=!0,a["padding-right"]=!0,a["padding-top"]=!0,a.page=!1,a["page-break-after"]=!1,a["page-break-before"]=!1,a["page-break-inside"]=!1,a["page-policy"]=!1,a.pause=!1,a["pause-after"]=!1,a["pause-before"]=!1,a.perspective=!1,a["perspective-origin"]=!1,a.pitch=!1,a["pitch-range"]=!1,a["play-during"]=!1,a.position=!1,a["presentation-level"]=!1,a.quotes=!1,a["region-fragment"]=!1,a.resize=!1,a.rest=!1,a["rest-after"]=!1,a["rest-before"]=!1,a.richness=!1,a.right=!1,a.rotation=!1,a["rotation-point"]=!1,a["ruby-align"]=!1,a["ruby-merge"]=!1,a["ruby-position"]=!1,a["shape-image-threshold"]=!1,a["shape-outside"]=!1,a["shape-margin"]=!1,a.size=!1,a.speak=!1,a["speak-as"]=!1,a["speak-header"]=!1,a["speak-numeral"]=!1,a["speak-punctuation"]=!1,a["speech-rate"]=!1,a.stress=!1,a["string-set"]=!1,a["tab-size"]=!1,a["table-layout"]=!1,a["text-align"]=!0,a["text-align-last"]=!0,a["text-combine-upright"]=!0,a["text-decoration"]=!0,a["text-decoration-color"]=!0,a["text-decoration-line"]=!0,a["text-decoration-skip"]=!0,a["text-decoration-style"]=!0,a["text-emphasis"]=!0,a["text-emphasis-color"]=!0,a["text-emphasis-position"]=!0,a["text-emphasis-style"]=!0,a["text-height"]=!0,a["text-indent"]=!0,a["text-justify"]=!0,a["text-orientation"]=!0,a["text-overflow"]=!0,a["text-shadow"]=!0,a["text-space-collapse"]=!0,a["text-transform"]=!0,a["text-underline-position"]=!0,a["text-wrap"]=!0,a.top=!1,a.transform=!1,a["transform-origin"]=!1,a["transform-style"]=!1,a.transition=!1,a["transition-delay"]=!1,a["transition-duration"]=!1,a["transition-property"]=!1,a["transition-timing-function"]=!1,a["unicode-bidi"]=!1,a["vertical-align"]=!1,a.visibility=!1,a["voice-balance"]=!1,a["voice-duration"]=!1,a["voice-family"]=!1,a["voice-pitch"]=!1,a["voice-range"]=!1,a["voice-rate"]=!1,a["voice-stress"]=!1,a["voice-volume"]=!1,a.volume=!1,a["white-space"]=!1,a.widows=!1,a.width=!0,a["will-change"]=!1,a["word-break"]=!0,a["word-spacing"]=!0,a["word-wrap"]=!0,a["wrap-flow"]=!1,a["wrap-through"]=!1,a["writing-mode"]=!1,a["z-index"]=!1,a}function l(a,S,m){}function f(a,S,m){}var p=/javascript\s*\:/img;function d(a,S){return p.test(S)?"":S}ye.whiteList=o(),ye.getDefaultWhiteList=o,ye.onAttr=l,ye.onIgnoreAttr=f,ye.safeAttrValue=d},29970:function(Xe,ye,o){var l=o(9950),f=o(32667);function p(a,S){var m=new f(S);return m.process(a)}ye=Xe.exports=p,ye.FilterCSS=f;for(var d in l)ye[d]=l[d];typeof window!="undefined"&&(window.filterCSS=Xe.exports)},25419:function(Xe,ye,o){var l=o(17381);function f(p,d){p=l.trimRight(p),p[p.length-1]!==";"&&(p+=";");var a=p.length,S=!1,m=0,x=0,V="";function U(){if(!S){var ce=l.trim(p.slice(m,x)),N=ce.indexOf(":");if(N!==-1){var xe=l.trim(ce.slice(0,N)),be=l.trim(ce.slice(N+1));if(xe){var ne=d(m,V.length,xe,be,ce);ne&&(V+=ne+"; ")}}}m=x+1}for(;x","GT":">","Gt":"\u226B","gtdot":"\u22D7","gtlPar":"\u2995","gtquest":"\u2A7C","gtrapprox":"\u2A86","gtrarr":"\u2978","gtrdot":"\u22D7","gtreqless":"\u22DB","gtreqqless":"\u2A8C","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\uFE00","gvnE":"\u2269\uFE00","Hacek":"\u02C7","hairsp":"\u200A","half":"\xBD","hamilt":"\u210B","HARDcy":"\u042A","hardcy":"\u044A","harrcir":"\u2948","harr":"\u2194","hArr":"\u21D4","harrw":"\u21AD","Hat":"^","hbar":"\u210F","Hcirc":"\u0124","hcirc":"\u0125","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22B9","hfr":"\u{1D525}","Hfr":"\u210C","HilbertSpace":"\u210B","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21FF","homtht":"\u223B","hookleftarrow":"\u21A9","hookrightarrow":"\u21AA","hopf":"\u{1D559}","Hopf":"\u210D","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\u{1D4BD}","Hscr":"\u210B","hslash":"\u210F","Hstrok":"\u0126","hstrok":"\u0127","HumpDownHump":"\u224E","HumpEqual":"\u224F","hybull":"\u2043","hyphen":"\u2010","Iacute":"\xCD","iacute":"\xED","ic":"\u2063","Icirc":"\xCE","icirc":"\xEE","Icy":"\u0418","icy":"\u0438","Idot":"\u0130","IEcy":"\u0415","iecy":"\u0435","iexcl":"\xA1","iff":"\u21D4","ifr":"\u{1D526}","Ifr":"\u2111","Igrave":"\xCC","igrave":"\xEC","ii":"\u2148","iiiint":"\u2A0C","iiint":"\u222D","iinfin":"\u29DC","iiota":"\u2129","IJlig":"\u0132","ijlig":"\u0133","Imacr":"\u012A","imacr":"\u012B","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","Im":"\u2111","imof":"\u22B7","imped":"\u01B5","Implies":"\u21D2","incare":"\u2105","in":"\u2208","infin":"\u221E","infintie":"\u29DD","inodot":"\u0131","intcal":"\u22BA","int":"\u222B","Int":"\u222C","integers":"\u2124","Integral":"\u222B","intercal":"\u22BA","Intersection":"\u22C2","intlarhk":"\u2A17","intprod":"\u2A3C","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","IOcy":"\u0401","iocy":"\u0451","Iogon":"\u012E","iogon":"\u012F","Iopf":"\u{1D540}","iopf":"\u{1D55A}","Iota":"\u0399","iota":"\u03B9","iprod":"\u2A3C","iquest":"\xBF","iscr":"\u{1D4BE}","Iscr":"\u2110","isin":"\u2208","isindot":"\u22F5","isinE":"\u22F9","isins":"\u22F4","isinsv":"\u22F3","isinv":"\u2208","it":"\u2062","Itilde":"\u0128","itilde":"\u0129","Iukcy":"\u0406","iukcy":"\u0456","Iuml":"\xCF","iuml":"\xEF","Jcirc":"\u0134","jcirc":"\u0135","Jcy":"\u0419","jcy":"\u0439","Jfr":"\u{1D50D}","jfr":"\u{1D527}","jmath":"\u0237","Jopf":"\u{1D541}","jopf":"\u{1D55B}","Jscr":"\u{1D4A5}","jscr":"\u{1D4BF}","Jsercy":"\u0408","jsercy":"\u0458","Jukcy":"\u0404","jukcy":"\u0454","Kappa":"\u039A","kappa":"\u03BA","kappav":"\u03F0","Kcedil":"\u0136","kcedil":"\u0137","Kcy":"\u041A","kcy":"\u043A","Kfr":"\u{1D50E}","kfr":"\u{1D528}","kgreen":"\u0138","KHcy":"\u0425","khcy":"\u0445","KJcy":"\u040C","kjcy":"\u045C","Kopf":"\u{1D542}","kopf":"\u{1D55C}","Kscr":"\u{1D4A6}","kscr":"\u{1D4C0}","lAarr":"\u21DA","Lacute":"\u0139","lacute":"\u013A","laemptyv":"\u29B4","lagran":"\u2112","Lambda":"\u039B","lambda":"\u03BB","lang":"\u27E8","Lang":"\u27EA","langd":"\u2991","langle":"\u27E8","lap":"\u2A85","Laplacetrf":"\u2112","laquo":"\xAB","larrb":"\u21E4","larrbfs":"\u291F","larr":"\u2190","Larr":"\u219E","lArr":"\u21D0","larrfs":"\u291D","larrhk":"\u21A9","larrlp":"\u21AB","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21A2","latail":"\u2919","lAtail":"\u291B","lat":"\u2AAB","late":"\u2AAD","lates":"\u2AAD\uFE00","lbarr":"\u290C","lBarr":"\u290E","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298B","lbrksld":"\u298F","lbrkslu":"\u298D","Lcaron":"\u013D","lcaron":"\u013E","Lcedil":"\u013B","lcedil":"\u013C","lceil":"\u2308","lcub":"{","Lcy":"\u041B","lcy":"\u043B","ldca":"\u2936","ldquo":"\u201C","ldquor":"\u201E","ldrdhar":"\u2967","ldrushar":"\u294B","ldsh":"\u21B2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27E8","LeftArrowBar":"\u21E4","leftarrow":"\u2190","LeftArrow":"\u2190","Leftarrow":"\u21D0","LeftArrowRightArrow":"\u21C6","leftarrowtail":"\u21A2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27E6","LeftDownTeeVector":"\u2961","LeftDownVectorBar":"\u2959","LeftDownVector":"\u21C3","LeftFloor":"\u230A","leftharpoondown":"\u21BD","leftharpoonup":"\u21BC","leftleftarrows":"\u21C7","leftrightarrow":"\u2194","LeftRightArrow":"\u2194","Leftrightarrow":"\u21D4","leftrightarrows":"\u21C6","leftrightharpoons":"\u21CB","leftrightsquigarrow":"\u21AD","LeftRightVector":"\u294E","LeftTeeArrow":"\u21A4","LeftTee":"\u22A3","LeftTeeVector":"\u295A","leftthreetimes":"\u22CB","LeftTriangleBar":"\u29CF","LeftTriangle":"\u22B2","LeftTriangleEqual":"\u22B4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVectorBar":"\u2958","LeftUpVector":"\u21BF","LeftVectorBar":"\u2952","LeftVector":"\u21BC","lEg":"\u2A8B","leg":"\u22DA","leq":"\u2264","leqq":"\u2266","leqslant":"\u2A7D","lescc":"\u2AA8","les":"\u2A7D","lesdot":"\u2A7F","lesdoto":"\u2A81","lesdotor":"\u2A83","lesg":"\u22DA\uFE00","lesges":"\u2A93","lessapprox":"\u2A85","lessdot":"\u22D6","lesseqgtr":"\u22DA","lesseqqgtr":"\u2A8B","LessEqualGreater":"\u22DA","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2AA1","lesssim":"\u2272","LessSlantEqual":"\u2A7D","LessTilde":"\u2272","lfisht":"\u297C","lfloor":"\u230A","Lfr":"\u{1D50F}","lfr":"\u{1D529}","lg":"\u2276","lgE":"\u2A91","lHar":"\u2962","lhard":"\u21BD","lharu":"\u21BC","lharul":"\u296A","lhblk":"\u2584","LJcy":"\u0409","ljcy":"\u0459","llarr":"\u21C7","ll":"\u226A","Ll":"\u22D8","llcorner":"\u231E","Lleftarrow":"\u21DA","llhard":"\u296B","lltri":"\u25FA","Lmidot":"\u013F","lmidot":"\u0140","lmoustache":"\u23B0","lmoust":"\u23B0","lnap":"\u2A89","lnapprox":"\u2A89","lne":"\u2A87","lnE":"\u2268","lneq":"\u2A87","lneqq":"\u2268","lnsim":"\u22E6","loang":"\u27EC","loarr":"\u21FD","lobrk":"\u27E6","longleftarrow":"\u27F5","LongLeftArrow":"\u27F5","Longleftarrow":"\u27F8","longleftrightarrow":"\u27F7","LongLeftRightArrow":"\u27F7","Longleftrightarrow":"\u27FA","longmapsto":"\u27FC","longrightarrow":"\u27F6","LongRightArrow":"\u27F6","Longrightarrow":"\u27F9","looparrowleft":"\u21AB","looparrowright":"\u21AC","lopar":"\u2985","Lopf":"\u{1D543}","lopf":"\u{1D55D}","loplus":"\u2A2D","lotimes":"\u2A34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25CA","lozenge":"\u25CA","lozf":"\u29EB","lpar":"(","lparlt":"\u2993","lrarr":"\u21C6","lrcorner":"\u231F","lrhar":"\u21CB","lrhard":"\u296D","lrm":"\u200E","lrtri":"\u22BF","lsaquo":"\u2039","lscr":"\u{1D4C1}","Lscr":"\u2112","lsh":"\u21B0","Lsh":"\u21B0","lsim":"\u2272","lsime":"\u2A8D","lsimg":"\u2A8F","lsqb":"[","lsquo":"\u2018","lsquor":"\u201A","Lstrok":"\u0141","lstrok":"\u0142","ltcc":"\u2AA6","ltcir":"\u2A79","lt":"<","LT":"<","Lt":"\u226A","ltdot":"\u22D6","lthree":"\u22CB","ltimes":"\u22C9","ltlarr":"\u2976","ltquest":"\u2A7B","ltri":"\u25C3","ltrie":"\u22B4","ltrif":"\u25C2","ltrPar":"\u2996","lurdshar":"\u294A","luruhar":"\u2966","lvertneqq":"\u2268\uFE00","lvnE":"\u2268\uFE00","macr":"\xAF","male":"\u2642","malt":"\u2720","maltese":"\u2720","Map":"\u2905","map":"\u21A6","mapsto":"\u21A6","mapstodown":"\u21A7","mapstoleft":"\u21A4","mapstoup":"\u21A5","marker":"\u25AE","mcomma":"\u2A29","Mcy":"\u041C","mcy":"\u043C","mdash":"\u2014","mDDot":"\u223A","measuredangle":"\u2221","MediumSpace":"\u205F","Mellintrf":"\u2133","Mfr":"\u{1D510}","mfr":"\u{1D52A}","mho":"\u2127","micro":"\xB5","midast":"*","midcir":"\u2AF0","mid":"\u2223","middot":"\xB7","minusb":"\u229F","minus":"\u2212","minusd":"\u2238","minusdu":"\u2A2A","MinusPlus":"\u2213","mlcp":"\u2ADB","mldr":"\u2026","mnplus":"\u2213","models":"\u22A7","Mopf":"\u{1D544}","mopf":"\u{1D55E}","mp":"\u2213","mscr":"\u{1D4C2}","Mscr":"\u2133","mstpos":"\u223E","Mu":"\u039C","mu":"\u03BC","multimap":"\u22B8","mumap":"\u22B8","nabla":"\u2207","Nacute":"\u0143","nacute":"\u0144","nang":"\u2220\u20D2","nap":"\u2249","napE":"\u2A70\u0338","napid":"\u224B\u0338","napos":"\u0149","napprox":"\u2249","natural":"\u266E","naturals":"\u2115","natur":"\u266E","nbsp":"\xA0","nbump":"\u224E\u0338","nbumpe":"\u224F\u0338","ncap":"\u2A43","Ncaron":"\u0147","ncaron":"\u0148","Ncedil":"\u0145","ncedil":"\u0146","ncong":"\u2247","ncongdot":"\u2A6D\u0338","ncup":"\u2A42","Ncy":"\u041D","ncy":"\u043D","ndash":"\u2013","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21D7","nearrow":"\u2197","ne":"\u2260","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200B","NegativeThickSpace":"\u200B","NegativeThinSpace":"\u200B","NegativeVeryThinSpace":"\u200B","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226B","NestedLessLess":"\u226A","NewLine":"\\n","nexist":"\u2204","nexists":"\u2204","Nfr":"\u{1D511}","nfr":"\u{1D52B}","ngE":"\u2267\u0338","nge":"\u2271","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2A7E\u0338","nges":"\u2A7E\u0338","nGg":"\u22D9\u0338","ngsim":"\u2275","nGt":"\u226B\u20D2","ngt":"\u226F","ngtr":"\u226F","nGtv":"\u226B\u0338","nharr":"\u21AE","nhArr":"\u21CE","nhpar":"\u2AF2","ni":"\u220B","nis":"\u22FC","nisd":"\u22FA","niv":"\u220B","NJcy":"\u040A","njcy":"\u045A","nlarr":"\u219A","nlArr":"\u21CD","nldr":"\u2025","nlE":"\u2266\u0338","nle":"\u2270","nleftarrow":"\u219A","nLeftarrow":"\u21CD","nleftrightarrow":"\u21AE","nLeftrightarrow":"\u21CE","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2A7D\u0338","nles":"\u2A7D\u0338","nless":"\u226E","nLl":"\u22D8\u0338","nlsim":"\u2274","nLt":"\u226A\u20D2","nlt":"\u226E","nltri":"\u22EA","nltrie":"\u22EC","nLtv":"\u226A\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\xA0","nopf":"\u{1D55F}","Nopf":"\u2115","Not":"\u2AEC","not":"\xAC","NotCongruent":"\u2262","NotCupCap":"\u226D","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226F","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226B\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2A7E\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224E\u0338","NotHumpEqual":"\u224F\u0338","notin":"\u2209","notindot":"\u22F5\u0338","notinE":"\u22F9\u0338","notinva":"\u2209","notinvb":"\u22F7","notinvc":"\u22F6","NotLeftTriangleBar":"\u29CF\u0338","NotLeftTriangle":"\u22EA","NotLeftTriangleEqual":"\u22EC","NotLess":"\u226E","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226A\u0338","NotLessSlantEqual":"\u2A7D\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2AA2\u0338","NotNestedLessLess":"\u2AA1\u0338","notni":"\u220C","notniva":"\u220C","notnivb":"\u22FE","notnivc":"\u22FD","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2AAF\u0338","NotPrecedesSlantEqual":"\u22E0","NotReverseElement":"\u220C","NotRightTriangleBar":"\u29D0\u0338","NotRightTriangle":"\u22EB","NotRightTriangleEqual":"\u22ED","NotSquareSubset":"\u228F\u0338","NotSquareSubsetEqual":"\u22E2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22E3","NotSubset":"\u2282\u20D2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2AB0\u0338","NotSucceedsSlantEqual":"\u22E1","NotSucceedsTilde":"\u227F\u0338","NotSuperset":"\u2283\u20D2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","nparallel":"\u2226","npar":"\u2226","nparsl":"\u2AFD\u20E5","npart":"\u2202\u0338","npolint":"\u2A14","npr":"\u2280","nprcue":"\u22E0","nprec":"\u2280","npreceq":"\u2AAF\u0338","npre":"\u2AAF\u0338","nrarrc":"\u2933\u0338","nrarr":"\u219B","nrArr":"\u21CF","nrarrw":"\u219D\u0338","nrightarrow":"\u219B","nRightarrow":"\u21CF","nrtri":"\u22EB","nrtrie":"\u22ED","nsc":"\u2281","nsccue":"\u22E1","nsce":"\u2AB0\u0338","Nscr":"\u{1D4A9}","nscr":"\u{1D4C3}","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22E2","nsqsupe":"\u22E3","nsub":"\u2284","nsubE":"\u2AC5\u0338","nsube":"\u2288","nsubset":"\u2282\u20D2","nsubseteq":"\u2288","nsubseteqq":"\u2AC5\u0338","nsucc":"\u2281","nsucceq":"\u2AB0\u0338","nsup":"\u2285","nsupE":"\u2AC6\u0338","nsupe":"\u2289","nsupset":"\u2283\u20D2","nsupseteq":"\u2289","nsupseteqq":"\u2AC6\u0338","ntgl":"\u2279","Ntilde":"\xD1","ntilde":"\xF1","ntlg":"\u2278","ntriangleleft":"\u22EA","ntrianglelefteq":"\u22EC","ntriangleright":"\u22EB","ntrianglerighteq":"\u22ED","Nu":"\u039D","nu":"\u03BD","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224D\u20D2","nvdash":"\u22AC","nvDash":"\u22AD","nVdash":"\u22AE","nVDash":"\u22AF","nvge":"\u2265\u20D2","nvgt":">\u20D2","nvHarr":"\u2904","nvinfin":"\u29DE","nvlArr":"\u2902","nvle":"\u2264\u20D2","nvlt":"<\u20D2","nvltrie":"\u22B4\u20D2","nvrArr":"\u2903","nvrtrie":"\u22B5\u20D2","nvsim":"\u223C\u20D2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21D6","nwarrow":"\u2196","nwnear":"\u2927","Oacute":"\xD3","oacute":"\xF3","oast":"\u229B","Ocirc":"\xD4","ocirc":"\xF4","ocir":"\u229A","Ocy":"\u041E","ocy":"\u043E","odash":"\u229D","Odblac":"\u0150","odblac":"\u0151","odiv":"\u2A38","odot":"\u2299","odsold":"\u29BC","OElig":"\u0152","oelig":"\u0153","ofcir":"\u29BF","Ofr":"\u{1D512}","ofr":"\u{1D52C}","ogon":"\u02DB","Ograve":"\xD2","ograve":"\xF2","ogt":"\u29C1","ohbar":"\u29B5","ohm":"\u03A9","oint":"\u222E","olarr":"\u21BA","olcir":"\u29BE","olcross":"\u29BB","oline":"\u203E","olt":"\u29C0","Omacr":"\u014C","omacr":"\u014D","Omega":"\u03A9","omega":"\u03C9","Omicron":"\u039F","omicron":"\u03BF","omid":"\u29B6","ominus":"\u2296","Oopf":"\u{1D546}","oopf":"\u{1D560}","opar":"\u29B7","OpenCurlyDoubleQuote":"\u201C","OpenCurlyQuote":"\u2018","operp":"\u29B9","oplus":"\u2295","orarr":"\u21BB","Or":"\u2A54","or":"\u2228","ord":"\u2A5D","order":"\u2134","orderof":"\u2134","ordf":"\xAA","ordm":"\xBA","origof":"\u22B6","oror":"\u2A56","orslope":"\u2A57","orv":"\u2A5B","oS":"\u24C8","Oscr":"\u{1D4AA}","oscr":"\u2134","Oslash":"\xD8","oslash":"\xF8","osol":"\u2298","Otilde":"\xD5","otilde":"\xF5","otimesas":"\u2A36","Otimes":"\u2A37","otimes":"\u2297","Ouml":"\xD6","ouml":"\xF6","ovbar":"\u233D","OverBar":"\u203E","OverBrace":"\u23DE","OverBracket":"\u23B4","OverParenthesis":"\u23DC","para":"\xB6","parallel":"\u2225","par":"\u2225","parsim":"\u2AF3","parsl":"\u2AFD","part":"\u2202","PartialD":"\u2202","Pcy":"\u041F","pcy":"\u043F","percnt":"%","period":".","permil":"\u2030","perp":"\u22A5","pertenk":"\u2031","Pfr":"\u{1D513}","pfr":"\u{1D52D}","Phi":"\u03A6","phi":"\u03C6","phiv":"\u03D5","phmmat":"\u2133","phone":"\u260E","Pi":"\u03A0","pi":"\u03C0","pitchfork":"\u22D4","piv":"\u03D6","planck":"\u210F","planckh":"\u210E","plankv":"\u210F","plusacir":"\u2A23","plusb":"\u229E","pluscir":"\u2A22","plus":"+","plusdo":"\u2214","plusdu":"\u2A25","pluse":"\u2A72","PlusMinus":"\xB1","plusmn":"\xB1","plussim":"\u2A26","plustwo":"\u2A27","pm":"\xB1","Poincareplane":"\u210C","pointint":"\u2A15","popf":"\u{1D561}","Popf":"\u2119","pound":"\xA3","prap":"\u2AB7","Pr":"\u2ABB","pr":"\u227A","prcue":"\u227C","precapprox":"\u2AB7","prec":"\u227A","preccurlyeq":"\u227C","Precedes":"\u227A","PrecedesEqual":"\u2AAF","PrecedesSlantEqual":"\u227C","PrecedesTilde":"\u227E","preceq":"\u2AAF","precnapprox":"\u2AB9","precneqq":"\u2AB5","precnsim":"\u22E8","pre":"\u2AAF","prE":"\u2AB3","precsim":"\u227E","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2AB9","prnE":"\u2AB5","prnsim":"\u22E8","prod":"\u220F","Product":"\u220F","profalar":"\u232E","profline":"\u2312","profsurf":"\u2313","prop":"\u221D","Proportional":"\u221D","Proportion":"\u2237","propto":"\u221D","prsim":"\u227E","prurel":"\u22B0","Pscr":"\u{1D4AB}","pscr":"\u{1D4C5}","Psi":"\u03A8","psi":"\u03C8","puncsp":"\u2008","Qfr":"\u{1D514}","qfr":"\u{1D52E}","qint":"\u2A0C","qopf":"\u{1D562}","Qopf":"\u211A","qprime":"\u2057","Qscr":"\u{1D4AC}","qscr":"\u{1D4C6}","quaternions":"\u210D","quatint":"\u2A16","quest":"?","questeq":"\u225F","quot":"\\"","QUOT":"\\"","rAarr":"\u21DB","race":"\u223D\u0331","Racute":"\u0154","racute":"\u0155","radic":"\u221A","raemptyv":"\u29B3","rang":"\u27E9","Rang":"\u27EB","rangd":"\u2992","range":"\u29A5","rangle":"\u27E9","raquo":"\xBB","rarrap":"\u2975","rarrb":"\u21E5","rarrbfs":"\u2920","rarrc":"\u2933","rarr":"\u2192","Rarr":"\u21A0","rArr":"\u21D2","rarrfs":"\u291E","rarrhk":"\u21AA","rarrlp":"\u21AC","rarrpl":"\u2945","rarrsim":"\u2974","Rarrtl":"\u2916","rarrtl":"\u21A3","rarrw":"\u219D","ratail":"\u291A","rAtail":"\u291C","ratio":"\u2236","rationals":"\u211A","rbarr":"\u290D","rBarr":"\u290F","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298C","rbrksld":"\u298E","rbrkslu":"\u2990","Rcaron":"\u0158","rcaron":"\u0159","Rcedil":"\u0156","rcedil":"\u0157","rceil":"\u2309","rcub":"}","Rcy":"\u0420","rcy":"\u0440","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201D","rdquor":"\u201D","rdsh":"\u21B3","real":"\u211C","realine":"\u211B","realpart":"\u211C","reals":"\u211D","Re":"\u211C","rect":"\u25AD","reg":"\xAE","REG":"\xAE","ReverseElement":"\u220B","ReverseEquilibrium":"\u21CB","ReverseUpEquilibrium":"\u296F","rfisht":"\u297D","rfloor":"\u230B","rfr":"\u{1D52F}","Rfr":"\u211C","rHar":"\u2964","rhard":"\u21C1","rharu":"\u21C0","rharul":"\u296C","Rho":"\u03A1","rho":"\u03C1","rhov":"\u03F1","RightAngleBracket":"\u27E9","RightArrowBar":"\u21E5","rightarrow":"\u2192","RightArrow":"\u2192","Rightarrow":"\u21D2","RightArrowLeftArrow":"\u21C4","rightarrowtail":"\u21A3","RightCeiling":"\u2309","RightDoubleBracket":"\u27E7","RightDownTeeVector":"\u295D","RightDownVectorBar":"\u2955","RightDownVector":"\u21C2","RightFloor":"\u230B","rightharpoondown":"\u21C1","rightharpoonup":"\u21C0","rightleftarrows":"\u21C4","rightleftharpoons":"\u21CC","rightrightarrows":"\u21C9","rightsquigarrow":"\u219D","RightTeeArrow":"\u21A6","RightTee":"\u22A2","RightTeeVector":"\u295B","rightthreetimes":"\u22CC","RightTriangleBar":"\u29D0","RightTriangle":"\u22B3","RightTriangleEqual":"\u22B5","RightUpDownVector":"\u294F","RightUpTeeVector":"\u295C","RightUpVectorBar":"\u2954","RightUpVector":"\u21BE","RightVectorBar":"\u2953","RightVector":"\u21C0","ring":"\u02DA","risingdotseq":"\u2253","rlarr":"\u21C4","rlhar":"\u21CC","rlm":"\u200F","rmoustache":"\u23B1","rmoust":"\u23B1","rnmid":"\u2AEE","roang":"\u27ED","roarr":"\u21FE","robrk":"\u27E7","ropar":"\u2986","ropf":"\u{1D563}","Ropf":"\u211D","roplus":"\u2A2E","rotimes":"\u2A35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2A12","rrarr":"\u21C9","Rrightarrow":"\u21DB","rsaquo":"\u203A","rscr":"\u{1D4C7}","Rscr":"\u211B","rsh":"\u21B1","Rsh":"\u21B1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22CC","rtimes":"\u22CA","rtri":"\u25B9","rtrie":"\u22B5","rtrif":"\u25B8","rtriltri":"\u29CE","RuleDelayed":"\u29F4","ruluhar":"\u2968","rx":"\u211E","Sacute":"\u015A","sacute":"\u015B","sbquo":"\u201A","scap":"\u2AB8","Scaron":"\u0160","scaron":"\u0161","Sc":"\u2ABC","sc":"\u227B","sccue":"\u227D","sce":"\u2AB0","scE":"\u2AB4","Scedil":"\u015E","scedil":"\u015F","Scirc":"\u015C","scirc":"\u015D","scnap":"\u2ABA","scnE":"\u2AB6","scnsim":"\u22E9","scpolint":"\u2A13","scsim":"\u227F","Scy":"\u0421","scy":"\u0441","sdotb":"\u22A1","sdot":"\u22C5","sdote":"\u2A66","searhk":"\u2925","searr":"\u2198","seArr":"\u21D8","searrow":"\u2198","sect":"\xA7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","Sfr":"\u{1D516}","sfr":"\u{1D530}","sfrown":"\u2322","sharp":"\u266F","SHCHcy":"\u0429","shchcy":"\u0449","SHcy":"\u0428","shcy":"\u0448","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\xAD","Sigma":"\u03A3","sigma":"\u03C3","sigmaf":"\u03C2","sigmav":"\u03C2","sim":"\u223C","simdot":"\u2A6A","sime":"\u2243","simeq":"\u2243","simg":"\u2A9E","simgE":"\u2AA0","siml":"\u2A9D","simlE":"\u2A9F","simne":"\u2246","simplus":"\u2A24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2A33","smeparsl":"\u29E4","smid":"\u2223","smile":"\u2323","smt":"\u2AAA","smte":"\u2AAC","smtes":"\u2AAC\uFE00","SOFTcy":"\u042C","softcy":"\u044C","solbar":"\u233F","solb":"\u29C4","sol":"/","Sopf":"\u{1D54A}","sopf":"\u{1D564}","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\uFE00","sqcup":"\u2294","sqcups":"\u2294\uFE00","Sqrt":"\u221A","sqsub":"\u228F","sqsube":"\u2291","sqsubset":"\u228F","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","square":"\u25A1","Square":"\u25A1","SquareIntersection":"\u2293","SquareSubset":"\u228F","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25AA","squ":"\u25A1","squf":"\u25AA","srarr":"\u2192","Sscr":"\u{1D4AE}","sscr":"\u{1D4C8}","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22C6","Star":"\u22C6","star":"\u2606","starf":"\u2605","straightepsilon":"\u03F5","straightphi":"\u03D5","strns":"\xAF","sub":"\u2282","Sub":"\u22D0","subdot":"\u2ABD","subE":"\u2AC5","sube":"\u2286","subedot":"\u2AC3","submult":"\u2AC1","subnE":"\u2ACB","subne":"\u228A","subplus":"\u2ABF","subrarr":"\u2979","subset":"\u2282","Subset":"\u22D0","subseteq":"\u2286","subseteqq":"\u2AC5","SubsetEqual":"\u2286","subsetneq":"\u228A","subsetneqq":"\u2ACB","subsim":"\u2AC7","subsub":"\u2AD5","subsup":"\u2AD3","succapprox":"\u2AB8","succ":"\u227B","succcurlyeq":"\u227D","Succeeds":"\u227B","SucceedsEqual":"\u2AB0","SucceedsSlantEqual":"\u227D","SucceedsTilde":"\u227F","succeq":"\u2AB0","succnapprox":"\u2ABA","succneqq":"\u2AB6","succnsim":"\u22E9","succsim":"\u227F","SuchThat":"\u220B","sum":"\u2211","Sum":"\u2211","sung":"\u266A","sup1":"\xB9","sup2":"\xB2","sup3":"\xB3","sup":"\u2283","Sup":"\u22D1","supdot":"\u2ABE","supdsub":"\u2AD8","supE":"\u2AC6","supe":"\u2287","supedot":"\u2AC4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27C9","suphsub":"\u2AD7","suplarr":"\u297B","supmult":"\u2AC2","supnE":"\u2ACC","supne":"\u228B","supplus":"\u2AC0","supset":"\u2283","Supset":"\u22D1","supseteq":"\u2287","supseteqq":"\u2AC6","supsetneq":"\u228B","supsetneqq":"\u2ACC","supsim":"\u2AC8","supsub":"\u2AD4","supsup":"\u2AD6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21D9","swarrow":"\u2199","swnwar":"\u292A","szlig":"\xDF","Tab":"\\t","target":"\u2316","Tau":"\u03A4","tau":"\u03C4","tbrk":"\u23B4","Tcaron":"\u0164","tcaron":"\u0165","Tcedil":"\u0162","tcedil":"\u0163","Tcy":"\u0422","tcy":"\u0442","tdot":"\u20DB","telrec":"\u2315","Tfr":"\u{1D517}","tfr":"\u{1D531}","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","Theta":"\u0398","theta":"\u03B8","thetasym":"\u03D1","thetav":"\u03D1","thickapprox":"\u2248","thicksim":"\u223C","ThickSpace":"\u205F\u200A","ThinSpace":"\u2009","thinsp":"\u2009","thkap":"\u2248","thksim":"\u223C","THORN":"\xDE","thorn":"\xFE","tilde":"\u02DC","Tilde":"\u223C","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","timesbar":"\u2A31","timesb":"\u22A0","times":"\xD7","timesd":"\u2A30","tint":"\u222D","toea":"\u2928","topbot":"\u2336","topcir":"\u2AF1","top":"\u22A4","Topf":"\u{1D54B}","topf":"\u{1D565}","topfork":"\u2ADA","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25B5","triangledown":"\u25BF","triangleleft":"\u25C3","trianglelefteq":"\u22B4","triangleq":"\u225C","triangleright":"\u25B9","trianglerighteq":"\u22B5","tridot":"\u25EC","trie":"\u225C","triminus":"\u2A3A","TripleDot":"\u20DB","triplus":"\u2A39","trisb":"\u29CD","tritime":"\u2A3B","trpezium":"\u23E2","Tscr":"\u{1D4AF}","tscr":"\u{1D4C9}","TScy":"\u0426","tscy":"\u0446","TSHcy":"\u040B","tshcy":"\u045B","Tstrok":"\u0166","tstrok":"\u0167","twixt":"\u226C","twoheadleftarrow":"\u219E","twoheadrightarrow":"\u21A0","Uacute":"\xDA","uacute":"\xFA","uarr":"\u2191","Uarr":"\u219F","uArr":"\u21D1","Uarrocir":"\u2949","Ubrcy":"\u040E","ubrcy":"\u045E","Ubreve":"\u016C","ubreve":"\u016D","Ucirc":"\xDB","ucirc":"\xFB","Ucy":"\u0423","ucy":"\u0443","udarr":"\u21C5","Udblac":"\u0170","udblac":"\u0171","udhar":"\u296E","ufisht":"\u297E","Ufr":"\u{1D518}","ufr":"\u{1D532}","Ugrave":"\xD9","ugrave":"\xF9","uHar":"\u2963","uharl":"\u21BF","uharr":"\u21BE","uhblk":"\u2580","ulcorn":"\u231C","ulcorner":"\u231C","ulcrop":"\u230F","ultri":"\u25F8","Umacr":"\u016A","umacr":"\u016B","uml":"\xA8","UnderBar":"_","UnderBrace":"\u23DF","UnderBracket":"\u23B5","UnderParenthesis":"\u23DD","Union":"\u22C3","UnionPlus":"\u228E","Uogon":"\u0172","uogon":"\u0173","Uopf":"\u{1D54C}","uopf":"\u{1D566}","UpArrowBar":"\u2912","uparrow":"\u2191","UpArrow":"\u2191","Uparrow":"\u21D1","UpArrowDownArrow":"\u21C5","updownarrow":"\u2195","UpDownArrow":"\u2195","Updownarrow":"\u21D5","UpEquilibrium":"\u296E","upharpoonleft":"\u21BF","upharpoonright":"\u21BE","uplus":"\u228E","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03C5","Upsi":"\u03D2","upsih":"\u03D2","Upsilon":"\u03A5","upsilon":"\u03C5","UpTeeArrow":"\u21A5","UpTee":"\u22A5","upuparrows":"\u21C8","urcorn":"\u231D","urcorner":"\u231D","urcrop":"\u230E","Uring":"\u016E","uring":"\u016F","urtri":"\u25F9","Uscr":"\u{1D4B0}","uscr":"\u{1D4CA}","utdot":"\u22F0","Utilde":"\u0168","utilde":"\u0169","utri":"\u25B5","utrif":"\u25B4","uuarr":"\u21C8","Uuml":"\xDC","uuml":"\xFC","uwangle":"\u29A7","vangrt":"\u299C","varepsilon":"\u03F5","varkappa":"\u03F0","varnothing":"\u2205","varphi":"\u03D5","varpi":"\u03D6","varpropto":"\u221D","varr":"\u2195","vArr":"\u21D5","varrho":"\u03F1","varsigma":"\u03C2","varsubsetneq":"\u228A\uFE00","varsubsetneqq":"\u2ACB\uFE00","varsupsetneq":"\u228B\uFE00","varsupsetneqq":"\u2ACC\uFE00","vartheta":"\u03D1","vartriangleleft":"\u22B2","vartriangleright":"\u22B3","vBar":"\u2AE8","Vbar":"\u2AEB","vBarv":"\u2AE9","Vcy":"\u0412","vcy":"\u0432","vdash":"\u22A2","vDash":"\u22A8","Vdash":"\u22A9","VDash":"\u22AB","Vdashl":"\u2AE6","veebar":"\u22BB","vee":"\u2228","Vee":"\u22C1","veeeq":"\u225A","vellip":"\u22EE","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200A","Vfr":"\u{1D519}","vfr":"\u{1D533}","vltri":"\u22B2","vnsub":"\u2282\u20D2","vnsup":"\u2283\u20D2","Vopf":"\u{1D54D}","vopf":"\u{1D567}","vprop":"\u221D","vrtri":"\u22B3","Vscr":"\u{1D4B1}","vscr":"\u{1D4CB}","vsubnE":"\u2ACB\uFE00","vsubne":"\u228A\uFE00","vsupnE":"\u2ACC\uFE00","vsupne":"\u228B\uFE00","Vvdash":"\u22AA","vzigzag":"\u299A","Wcirc":"\u0174","wcirc":"\u0175","wedbar":"\u2A5F","wedge":"\u2227","Wedge":"\u22C0","wedgeq":"\u2259","weierp":"\u2118","Wfr":"\u{1D51A}","wfr":"\u{1D534}","Wopf":"\u{1D54E}","wopf":"\u{1D568}","wp":"\u2118","wr":"\u2240","wreath":"\u2240","Wscr":"\u{1D4B2}","wscr":"\u{1D4CC}","xcap":"\u22C2","xcirc":"\u25EF","xcup":"\u22C3","xdtri":"\u25BD","Xfr":"\u{1D51B}","xfr":"\u{1D535}","xharr":"\u27F7","xhArr":"\u27FA","Xi":"\u039E","xi":"\u03BE","xlarr":"\u27F5","xlArr":"\u27F8","xmap":"\u27FC","xnis":"\u22FB","xodot":"\u2A00","Xopf":"\u{1D54F}","xopf":"\u{1D569}","xoplus":"\u2A01","xotime":"\u2A02","xrarr":"\u27F6","xrArr":"\u27F9","Xscr":"\u{1D4B3}","xscr":"\u{1D4CD}","xsqcup":"\u2A06","xuplus":"\u2A04","xutri":"\u25B3","xvee":"\u22C1","xwedge":"\u22C0","Yacute":"\xDD","yacute":"\xFD","YAcy":"\u042F","yacy":"\u044F","Ycirc":"\u0176","ycirc":"\u0177","Ycy":"\u042B","ycy":"\u044B","yen":"\xA5","Yfr":"\u{1D51C}","yfr":"\u{1D536}","YIcy":"\u0407","yicy":"\u0457","Yopf":"\u{1D550}","yopf":"\u{1D56A}","Yscr":"\u{1D4B4}","yscr":"\u{1D4CE}","YUcy":"\u042E","yucy":"\u044E","yuml":"\xFF","Yuml":"\u0178","Zacute":"\u0179","zacute":"\u017A","Zcaron":"\u017D","zcaron":"\u017E","Zcy":"\u0417","zcy":"\u0437","Zdot":"\u017B","zdot":"\u017C","zeetrf":"\u2128","ZeroWidthSpace":"\u200B","Zeta":"\u0396","zeta":"\u03B6","zfr":"\u{1D537}","Zfr":"\u2128","ZHcy":"\u0416","zhcy":"\u0436","zigrarr":"\u21DD","zopf":"\u{1D56B}","Zopf":"\u2124","Zscr":"\u{1D4B5}","zscr":"\u{1D4CF}","zwj":"\u200D","zwnj":"\u200C"}')},68337:function(Xe,ye,o){"use strict";function l(re){var ae=Array.prototype.slice.call(arguments,1);return ae.forEach(function(Ce){!Ce||Object.keys(Ce).forEach(function(Ee){re[Ee]=Ce[Ee]})}),re}function f(re){return Object.prototype.toString.call(re)}function p(re){return f(re)==="[object String]"}function d(re){return f(re)==="[object Object]"}function a(re){return f(re)==="[object RegExp]"}function S(re){return f(re)==="[object Function]"}function m(re){return re.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var x={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function V(re){return Object.keys(re||{}).reduce(function(ae,Ce){return ae||x.hasOwnProperty(Ce)},!1)}var U={"http:":{validate:function(re,ae,Ce){var Ee=re.slice(ae);return Ce.re.http||(Ce.re.http=new RegExp("^\\/\\/"+Ce.re.src_auth+Ce.re.src_host_port_strict+Ce.re.src_path,"i")),Ce.re.http.test(Ee)?Ee.match(Ce.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(re,ae,Ce){var Ee=re.slice(ae);return Ce.re.no_http||(Ce.re.no_http=new RegExp("^"+Ce.re.src_auth+"(?:localhost|(?:(?:"+Ce.re.src_domain+")\\.)+"+Ce.re.src_domain_root+")"+Ce.re.src_port+Ce.re.src_host_terminator+Ce.re.src_path,"i")),Ce.re.no_http.test(Ee)?ae>=3&&re[ae-3]===":"||ae>=3&&re[ae-3]==="/"?0:Ee.match(Ce.re.no_http)[0].length:0}},"mailto:":{validate:function(re,ae,Ce){var Ee=re.slice(ae);return Ce.re.mailto||(Ce.re.mailto=new RegExp("^"+Ce.re.src_email_name+"@"+Ce.re.src_host_strict,"i")),Ce.re.mailto.test(Ee)?Ee.match(Ce.re.mailto)[0].length:0}}},te="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",w="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function ce(re){re.__index__=-1,re.__text_cache__=""}function N(re){return function(ae,Ce){var Ee=ae.slice(Ce);return re.test(Ee)?Ee.match(re)[0].length:0}}function xe(){return function(re,ae){ae.normalize(re)}}function be(re){var ae=re.re=o(36066)(re.__opts__),Ce=re.__tlds__.slice();re.onCompile(),re.__tlds_replaced__||Ce.push(te),Ce.push(ae.src_xn),ae.src_tlds=Ce.join("|");function Ee(Je){return Je.replace("%TLDS%",ae.src_tlds)}ae.email_fuzzy=RegExp(Ee(ae.tpl_email_fuzzy),"i"),ae.link_fuzzy=RegExp(Ee(ae.tpl_link_fuzzy),"i"),ae.link_no_ip_fuzzy=RegExp(Ee(ae.tpl_link_no_ip_fuzzy),"i"),ae.host_fuzzy_test=RegExp(Ee(ae.tpl_host_fuzzy_test),"i");var nt=[];re.__compiled__={};function qe(Je,lt){throw new Error('(LinkifyIt) Invalid schema "'+Je+'": '+lt)}Object.keys(re.__schemas__).forEach(function(Je){var lt=re.__schemas__[Je];if(lt!==null){var Rt={validate:null,link:null};if(re.__compiled__[Je]=Rt,d(lt)){a(lt.validate)?Rt.validate=N(lt.validate):S(lt.validate)?Rt.validate=lt.validate:qe(Je,lt),S(lt.normalize)?Rt.normalize=lt.normalize:lt.normalize?qe(Je,lt):Rt.normalize=xe();return}if(p(lt)){nt.push(Je);return}qe(Je,lt)}}),nt.forEach(function(Je){!re.__compiled__[re.__schemas__[Je]]||(re.__compiled__[Je].validate=re.__compiled__[re.__schemas__[Je]].validate,re.__compiled__[Je].normalize=re.__compiled__[re.__schemas__[Je]].normalize)}),re.__compiled__[""]={validate:null,normalize:xe()};var dt=Object.keys(re.__compiled__).filter(function(Je){return Je.length>0&&re.__compiled__[Je]}).map(m).join("|");re.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+ae.src_ZPCc+"))("+dt+")","i"),re.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+ae.src_ZPCc+"))("+dt+")","ig"),re.re.schema_at_start=RegExp("^"+re.re.schema_search.source,"i"),re.re.pretest=RegExp("("+re.re.schema_test.source+")|("+re.re.host_fuzzy_test.source+")|@","i"),ce(re)}function ne(re,ae){var Ce=re.__index__,Ee=re.__last_index__,nt=re.__text_cache__.slice(Ce,Ee);this.schema=re.__schema__.toLowerCase(),this.index=Ce+ae,this.lastIndex=Ee+ae,this.raw=nt,this.text=nt,this.url=nt}function me(re,ae){var Ce=new ne(re,ae);return re.__compiled__[Ce.schema].normalize(Ce,re),Ce}function ke(re,ae){if(!(this instanceof ke))return new ke(re,ae);ae||V(re)&&(ae=re,re={}),this.__opts__=l({},x,ae),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=l({},U,re),this.__compiled__={},this.__tlds__=w,this.__tlds_replaced__=!1,this.re={},be(this)}ke.prototype.add=function(ae,Ce){return this.__schemas__[ae]=Ce,be(this),this},ke.prototype.set=function(ae){return this.__opts__=l(this.__opts__,ae),this},ke.prototype.test=function(ae){if(this.__text_cache__=ae,this.__index__=-1,!ae.length)return!1;var Ce,Ee,nt,qe,dt,Je,lt,Rt,Re;if(this.re.schema_test.test(ae)){for(lt=this.re.schema_search,lt.lastIndex=0;(Ce=lt.exec(ae))!==null;)if(qe=this.testSchemaAt(ae,Ce[2],lt.lastIndex),qe){this.__schema__=Ce[2],this.__index__=Ce.index+Ce[1].length,this.__last_index__=Ce.index+Ce[0].length+qe;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(Rt=ae.search(this.re.host_fuzzy_test),Rt>=0&&(this.__index__<0||Rt=0&&(nt=ae.match(this.re.email_fuzzy))!==null&&(dt=nt.index+nt[1].length,Je=nt.index+nt[0].length,(this.__index__<0||dtthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=dt,this.__last_index__=Je))),this.__index__>=0},ke.prototype.pretest=function(ae){return this.re.pretest.test(ae)},ke.prototype.testSchemaAt=function(ae,Ce,Ee){return this.__compiled__[Ce.toLowerCase()]?this.__compiled__[Ce.toLowerCase()].validate(ae,Ee,this):0},ke.prototype.match=function(ae){var Ce=0,Ee=[];this.__index__>=0&&this.__text_cache__===ae&&(Ee.push(me(this,Ce)),Ce=this.__last_index__);for(var nt=Ce?ae.slice(Ce):ae;this.test(nt);)Ee.push(me(this,Ce)),nt=nt.slice(this.__last_index__),Ce+=this.__last_index__;return Ee.length?Ee:null},ke.prototype.matchAtStart=function(ae){if(this.__text_cache__=ae,this.__index__=-1,!ae.length)return null;var Ce=this.re.schema_at_start.exec(ae);if(!Ce)return null;var Ee=this.testSchemaAt(ae,Ce[2],Ce[0].length);return Ee?(this.__schema__=Ce[2],this.__index__=Ce.index+Ce[1].length,this.__last_index__=Ce.index+Ce[0].length+Ee,me(this,0)):null},ke.prototype.tlds=function(ae,Ce){return ae=Array.isArray(ae)?ae:[ae],Ce?(this.__tlds__=this.__tlds__.concat(ae).sort().filter(function(Ee,nt,qe){return Ee!==qe[nt-1]}).reverse(),be(this),this):(this.__tlds__=ae.slice(),this.__tlds_replaced__=!0,be(this),this)},ke.prototype.normalize=function(ae){ae.schema||(ae.url="http://"+ae.url),ae.schema==="mailto:"&&!/^mailto:/i.test(ae.url)&&(ae.url="mailto:"+ae.url)},ke.prototype.onCompile=function(){},Xe.exports=ke},36066:function(Xe,ye,o){"use strict";Xe.exports=function(l){var f={};l=l||{},f.src_Any=o(29369).source,f.src_Cc=o(99413).source,f.src_Z=o(35045).source,f.src_P=o(73189).source,f.src_ZPCc=[f.src_Z,f.src_P,f.src_Cc].join("|"),f.src_ZCc=[f.src_Z,f.src_Cc].join("|");var p="[><\uFF5C]";return f.src_pseudo_letter="(?:(?!"+p+"|"+f.src_ZPCc+")"+f.src_Any+")",f.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",f.src_auth="(?:(?:(?!"+f.src_ZCc+"|[@/\\[\\]()]).)+@)?",f.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",f.src_host_terminator="(?=$|"+p+"|"+f.src_ZPCc+")(?!"+(l["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+f.src_ZPCc+"))",f.src_path="(?:[/?#](?:(?!"+f.src_ZCc+"|"+p+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+f.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+f.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+f.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+f.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+f.src_ZCc+"|[']).)+\\'|\\'(?="+f.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+f.src_ZCc+"|[.]|$)|"+(l["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+f.src_ZCc+"|$)|;(?!"+f.src_ZCc+"|$)|\\!+(?!"+f.src_ZCc+"|[!]|$)|\\?(?!"+f.src_ZCc+"|[?]|$))+|\\/)?",f.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',f.src_xn="xn--[a-z0-9\\-]{1,59}",f.src_domain_root="(?:"+f.src_xn+"|"+f.src_pseudo_letter+"{1,63})",f.src_domain="(?:"+f.src_xn+"|(?:"+f.src_pseudo_letter+")|(?:"+f.src_pseudo_letter+"(?:-|"+f.src_pseudo_letter+"){0,61}"+f.src_pseudo_letter+"))",f.src_host="(?:(?:(?:(?:"+f.src_domain+")\\.)*"+f.src_domain+"))",f.tpl_host_fuzzy="(?:"+f.src_ip4+"|(?:(?:(?:"+f.src_domain+")\\.)+(?:%TLDS%)))",f.tpl_host_no_ip_fuzzy="(?:(?:(?:"+f.src_domain+")\\.)+(?:%TLDS%))",f.src_host_strict=f.src_host+f.src_host_terminator,f.tpl_host_fuzzy_strict=f.tpl_host_fuzzy+f.src_host_terminator,f.src_host_port_strict=f.src_host+f.src_port+f.src_host_terminator,f.tpl_host_port_fuzzy_strict=f.tpl_host_fuzzy+f.src_port+f.src_host_terminator,f.tpl_host_port_no_ip_fuzzy_strict=f.tpl_host_no_ip_fuzzy+f.src_port+f.src_host_terminator,f.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+f.src_ZPCc+"|>|$))",f.tpl_email_fuzzy="(^|"+p+'|"|\\(|'+f.src_ZCc+")("+f.src_email_name+"@"+f.tpl_host_fuzzy_strict+")",f.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+f.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+f.tpl_host_port_fuzzy_strict+f.src_path+")",f.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+f.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+f.tpl_host_port_no_ip_fuzzy_strict+f.src_path+")",f}},40617:function(Xe,ye,o){"use strict";o.d(ye,{Z:function(){return a}});const l=new Set([!0,!1,"alt","title"]);function f(S,m){return(Array.isArray(S)?S:[]).filter(([x])=>x!==m)}function p(S,m){S&&S.attrs&&(S.attrs=f(S.attrs,m))}function d(S,m){if(!l.has(S))throw new TypeError(`figcaption must be one of: ${[...l]}.`);if(S==="alt")return m.content;const x=m.attrs.find(([V])=>V==="title");return Array.isArray(x)&&x[1]?(p(m,"title"),x[1]):void 0}function a(S,m){m=m||{},S.core.ruler.before("linkify","image_figures",function(x){let V=1;for(let U=1,te=x.tokens.length;Ube.match(xe)).map(be=>Array.from(be))}if(m.tabindex&&(x.tokens[U-1].attrPush(["tabindex",V]),V++),m.lazy&&(N.attrs.some(([xe])=>xe==="loading")||N.attrs.push(["loading","lazy"])),m.async&&(N.attrs.some(([xe])=>xe==="decoding")||N.attrs.push(["decoding","async"])),m.classes&&typeof m.classes=="string"){let xe=!1;for(let be=0,ne=N.attrs.length;bebe==="src");N.attrs.push(["data-src",xe[1]]),p(N,"src")}}})}},84651:function(Xe){var ye=!0,o=!1,l=!1;Xe.exports=function(N,xe){xe&&(ye=!xe.enabled,o=!!xe.label,l=!!xe.labelAfter),N.core.ruler.after("inline","github-task-lists",function(be){for(var ne=be.tokens,me=2;me=0;ne--)if(N[ne].level===be)return ne;return-1}function d(N,xe){return U(N[xe])&&te(N[xe-1])&&w(N[xe-2])&&ce(N[xe])}function a(N,xe){if(N.children.unshift(S(N,xe)),N.children[1].content=N.children[1].content.slice(3),N.content=N.content.slice(3),o)if(l){N.children.pop();var be="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);N.children[0].content=N.children[0].content.slice(0,-1)+' id="'+be+'">',N.children.push(V(N.content,be,xe))}else N.children.unshift(m(xe)),N.children.push(x(xe))}function S(N,xe){var be=new xe("html_inline","",0),ne=ye?' disabled="" ':"";return N.content.indexOf("[ ] ")===0?be.content='':(N.content.indexOf("[x] ")===0||N.content.indexOf("[X] ")===0)&&(be.content=''),be}function m(N){var xe=new N("html_inline","",0);return xe.content="",xe}function V(N,xe,be){var ne=new be("html_inline","",0);return ne.content='",ne.attrs=[{for:xe}],ne}function U(N){return N.type==="inline"}function te(N){return N.type==="paragraph_open"}function w(N){return N.type==="list_item_open"}function ce(N){return N.content.indexOf("[ ] ")===0||N.content.indexOf("[x] ")===0||N.content.indexOf("[X] ")===0}},67754:function(Xe,ye,o){const l=o(68924);Xe.exports=function(p,{xss:d}={}){const a=new l.FilterXSS(typeof d=="function"?d(l):d);function S(x){return x=a.process(x),x}function m(x){for(let V=0;V`\\x00-\\x20]+",l="'[^']*'",f='"[^"]*"',p="(?:"+o+"|"+l+"|"+f+")",d="(?:\\s+"+ye+"(?:\\s*=\\s*"+p+")?)",a="<[A-Za-z][A-Za-z0-9\\-]*"+d+"*\\s*\\/?>",S="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",m="|",x="<[?][\\s\\S]*?[?]>",V="]*>",U="",te=new RegExp("^(?:"+a+"|"+S+"|"+m+"|"+x+"|"+V+"|"+U+")"),w=new RegExp("^(?:"+a+"|"+S+")");Xe.exports.n=te,Xe.exports.q=w},67022:function(Xe,ye,o){"use strict";function l(Re){return Object.prototype.toString.call(Re)}function f(Re){return l(Re)==="[object String]"}var p=Object.prototype.hasOwnProperty;function d(Re,Ie){return p.call(Re,Ie)}function a(Re){var Ie=Array.prototype.slice.call(arguments,1);return Ie.forEach(function($){if(!!$){if(typeof $!="object")throw new TypeError($+"must be object");Object.keys($).forEach(function(I){Re[I]=$[I]})}}),Re}function S(Re,Ie,$){return[].concat(Re.slice(0,Ie),$,Re.slice(Ie+1))}function m(Re){return!(Re>=55296&&Re<=57343||Re>=64976&&Re<=65007||(Re&65535)==65535||(Re&65535)==65534||Re>=0&&Re<=8||Re===11||Re>=14&&Re<=31||Re>=127&&Re<=159||Re>1114111)}function x(Re){if(Re>65535){Re-=65536;var Ie=55296+(Re>>10),$=56320+(Re&1023);return String.fromCharCode(Ie,$)}return String.fromCharCode(Re)}var V=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,U=/&([a-z#][a-z0-9]{1,31});/gi,te=new RegExp(V.source+"|"+U.source,"gi"),w=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i,ce=o(26233);function N(Re,Ie){var $;return d(ce,Ie)?ce[Ie]:Ie.charCodeAt(0)===35&&w.test(Ie)&&($=Ie[1].toLowerCase()==="x"?parseInt(Ie.slice(2),16):parseInt(Ie.slice(1),10),m($))?x($):Re}function xe(Re){return Re.indexOf("\\")<0?Re:Re.replace(V,"$1")}function be(Re){return Re.indexOf("\\")<0&&Re.indexOf("&")<0?Re:Re.replace(te,function(Ie,$,I){return $||N(Ie,I)})}var ne=/[&<>"]/,me=/[&<>"]/g,ke={"&":"&","<":"<",">":">",'"':"""};function re(Re){return ke[Re]}function ae(Re){return ne.test(Re)?Re.replace(me,re):Re}var Ce=/[.?*+^$[\]\\(){}|-]/g;function Ee(Re){return Re.replace(Ce,"\\$&")}function nt(Re){switch(Re){case 9:case 32:return!0}return!1}function qe(Re){if(Re>=8192&&Re<=8202)return!0;switch(Re){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var dt=o(73189);function Je(Re){return dt.test(Re)}function lt(Re){switch(Re){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Rt(Re){return Re=Re.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(Re=Re.replace(/ẞ/g,"\xDF")),Re.toLowerCase().toUpperCase()}ye.lib={},ye.lib.mdurl=o(48765),ye.lib.ucmicro=o(84205),ye.assign=a,ye.isString=f,ye.has=d,ye.unescapeMd=xe,ye.unescapeAll=be,ye.isValidEntityCode=m,ye.fromCodePoint=x,ye.escapeHtml=ae,ye.arrayReplaceAt=S,ye.isSpace=nt,ye.isWhiteSpace=qe,ye.isMdAsciiPunct=lt,ye.isPunctChar=Je,ye.escapeRE=Ee,ye.normalizeReference=Rt},51685:function(Xe,ye,o){"use strict";ye.parseLinkLabel=o(33595),ye.parseLinkDestination=o(12548),ye.parseLinkTitle=o(88040)},12548:function(Xe,ye,o){"use strict";var l=o(67022).unescapeAll;Xe.exports=function(p,d,a){var S,m,x=d,V={ok:!1,pos:0,lines:0,str:""};if(p.charCodeAt(x)===60){for(x++;x32))return V;if(S===41){if(m===0)break;m--}x++}return d===x||m!==0||(V.str=l(p.slice(d,x)),V.pos=x,V.ok=!0),V}},33595:function(Xe){"use strict";Xe.exports=function(o,l,f){var p,d,a,S,m=-1,x=o.posMax,V=o.pos;for(o.pos=l+1,p=1;o.pos=a||(m=p.charCodeAt(V),m!==34&&m!==39&&m!==40))return U;for(V++,m===40&&(m=41);V=0))try{ke.hostname=V.toASCII(ke.hostname)}catch(re){}return x.encode(x.format(ke))}function be(me){var ke=x.parse(me,!0);if(ke.hostname&&(!ke.protocol||N.indexOf(ke.protocol)>=0))try{ke.hostname=V.toUnicode(ke.hostname)}catch(re){}return x.decode(x.format(ke),x.decode.defaultChars+"%")}function ne(me,ke){if(!(this instanceof ne))return new ne(me,ke);ke||l.isString(me)||(ke=me||{},me="default"),this.inline=new S,this.block=new a,this.core=new d,this.renderer=new p,this.linkify=new m,this.validateLink=ce,this.normalizeLink=xe,this.normalizeLinkText=be,this.utils=l,this.helpers=l.assign({},f),this.options={},this.configure(me),ke&&this.set(ke)}ne.prototype.set=function(me){return l.assign(this.options,me),this},ne.prototype.configure=function(me){var ke=this,re;if(l.isString(me)&&(re=me,me=U[re],!me))throw new Error('Wrong `markdown-it` preset "'+re+'", check name');if(!me)throw new Error("Wrong `markdown-it` preset, can't be empty");return me.options&&ke.set(me.options),me.components&&Object.keys(me.components).forEach(function(ae){me.components[ae].rules&&ke[ae].ruler.enableOnly(me.components[ae].rules),me.components[ae].rules2&&ke[ae].ruler2.enableOnly(me.components[ae].rules2)}),this},ne.prototype.enable=function(me,ke){var re=[];Array.isArray(me)||(me=[me]),["core","block","inline"].forEach(function(Ce){re=re.concat(this[Ce].ruler.enable(me,!0))},this),re=re.concat(this.inline.ruler2.enable(me,!0));var ae=me.filter(function(Ce){return re.indexOf(Ce)<0});if(ae.length&&!ke)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+ae);return this},ne.prototype.disable=function(me,ke){var re=[];Array.isArray(me)||(me=[me]),["core","block","inline"].forEach(function(Ce){re=re.concat(this[Ce].ruler.disable(me,!0))},this),re=re.concat(this.inline.ruler2.disable(me,!0));var ae=me.filter(function(Ce){return re.indexOf(Ce)<0});if(ae.length&&!ke)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+ae);return this},ne.prototype.use=function(me){var ke=[this].concat(Array.prototype.slice.call(arguments,1));return me.apply(me,ke),this},ne.prototype.parse=function(me,ke){if(typeof me!="string")throw new Error("Input data should be a String");var re=new this.core.State(me,this,ke);return this.core.process(re),re.tokens},ne.prototype.render=function(me,ke){return ke=ke||{},this.renderer.render(this.parse(me,ke),this.options,ke)},ne.prototype.parseInline=function(me,ke){var re=new this.core.State(me,this,ke);return re.inlineMode=!0,this.core.process(re),re.tokens},ne.prototype.renderInline=function(me,ke){return ke=ke||{},this.renderer.render(this.parseInline(me,ke),this.options,ke)},Xe.exports=ne},82471:function(Xe,ye,o){"use strict";var l=o(79580),f=[["table",o(91785),["paragraph","reference"]],["code",o(38768)],["fence",o(13542),["paragraph","reference","blockquote","list"]],["blockquote",o(45258),["paragraph","reference","blockquote","list"]],["hr",o(35634),["paragraph","reference","blockquote","list"]],["list",o(18532),["paragraph","reference","blockquote"]],["reference",o(43804)],["html_block",o(76329),["paragraph","reference","blockquote"]],["heading",o(61630),["paragraph","reference","blockquote"]],["lheading",o(56850)],["paragraph",o(96864)]];function p(){this.ruler=new l;for(var d=0;d=S||d.sCount[w]=N){d.line=S;break}for(V=d.line,x=0;x=d.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");d.tight=!ce,d.isEmpty(d.line-1)&&(ce=!0),w=d.line,w=a.pos)throw new Error("inline rule didn't increment state.pos");break}}else a.pos=a.posMax;S||a.pos++,w[x]=a.pos},d.prototype.tokenize=function(a){for(var S,m,x,V=this.ruler.getRules(""),U=V.length,te=a.posMax,w=a.md.options.maxNesting;a.pos=a.pos)throw new Error("inline rule didn't increment state.pos");break}}if(S){if(a.pos>=te)break;continue}a.pending+=a.src[a.pos++]}a.pending&&a.pushPending()},d.prototype.parse=function(a,S,m,x){var V,U,te,w=new this.State(a,S,m,x);for(this.tokenize(w),U=this.ruler2.getRules(""),te=U.length,V=0;V"+p(te.content)+""},d.code_block=function(S,m,x,V,U){var te=S[m];return""+p(S[m].content)+` `},d.fence=function(S,m,x,V,U){var te=S[m],w=te.info?f(te.info).trim():"",ce="",N="",xe,be,ne,me,ke;return w&&(ne=w.split(/(\s+)/g),ce=ne[0],N=ne.slice(2).join("")),x.highlight?xe=x.highlight(te.content,ce,N)||p(te.content):xe=p(te.content),xe.indexOf(""+xe+` `):"
"+xe+`
`},d.image=function(S,m,x,V,U){var te=S[m];return te.attrs[te.attrIndex("alt")][1]=U.renderInlineAsText(te.children,x,V),U.renderToken(S,m,x)},d.hardbreak=function(S,m,x){return x.xhtmlOut?`
`:`
`},d.softbreak=function(S,m,x){return x.breaks?x.xhtmlOut?`
`:`
`:` `},d.text=function(S,m){return p(S[m].content)},d.html_block=function(S,m){return S[m].content},d.html_inline=function(S,m){return S[m].content};function a(){this.rules=l({},d)}a.prototype.renderAttrs=function(m){var x,V,U;if(!m.attrs)return"";for(U="",x=0,V=m.attrs.length;x `:">",te)},a.prototype.renderInline=function(S,m,x){for(var V,U="",te=this.rules,w=0,ce=S.length;w=4||p.src.charCodeAt(lt)!==62)return!1;if(S)return!0;for(be=[],ne=[],re=[],ae=[],nt=p.md.block.ruler.getRules("blockquote"),ke=p.parentType,p.parentType="blockquote",N=d;N=Rt));N++){if(p.src.charCodeAt(lt++)===62&&!dt){for(U=p.sCount[N]+1,p.src.charCodeAt(lt)===32?(lt++,U++,m=!1,Ce=!0):p.src.charCodeAt(lt)===9?(Ce=!0,(p.bsCount[N]+U)%4==3?(lt++,U++,m=!1):m=!0):Ce=!1,xe=U,be.push(p.bMarks[N]),p.bMarks[N]=lt;lt=Rt,ne.push(p.bsCount[N]),p.bsCount[N]=p.sCount[N]+1+(Ce?1:0),re.push(p.sCount[N]),p.sCount[N]=xe-U,ae.push(p.tShift[N]),p.tShift[N]=lt-p.bMarks[N];continue}if(w)break;for(Ee=!1,V=0,te=nt.length;V",qe.map=ce=[d,0],p.md.block.tokenize(p,d,N),qe=p.push("blockquote_close","blockquote",-1),qe.markup=">",p.lineMax=Je,p.parentType=ke,ce[1]=p.line,V=0;V=4){p++,d=p;continue}break}return o.line=d,a=o.push("code_block","code",0),a.content=o.getLines(l,d,4+o.blkIndent,!1)+` `,a.map=[l,o.line],!0}},13542:function(Xe){"use strict";Xe.exports=function(o,l,f,p){var d,a,S,m,x,V,U,te=!1,w=o.bMarks[l]+o.tShift[l],ce=o.eMarks[l];if(o.sCount[l]-o.blkIndent>=4||w+3>ce||(d=o.src.charCodeAt(w),d!==126&&d!==96)||(x=w,w=o.skipChars(w,d),a=w-x,a<3)||(U=o.src.slice(x,w),S=o.src.slice(w,ce),d===96&&S.indexOf(String.fromCharCode(d))>=0))return!1;if(p)return!0;for(m=l;m++,!(m>=f||(w=x=o.bMarks[m]+o.tShift[m],ce=o.eMarks[m],w=4)&&(w=o.skipChars(w,d),!(w-x=4||(m=p.src.charCodeAt(te),m!==35||te>=w))return!1;for(x=1,m=p.src.charCodeAt(++te);m===35&&te6||tete&&l(p.src.charCodeAt(V-1))&&(w=V),p.line=d+1,U=p.push("heading_open","h"+String(x),1),U.markup="########".slice(0,x),U.map=[d,p.line],U=p.push("inline","",0),U.content=p.src.slice(te,w).trim(),U.map=[d,p.line],U.children=[],U=p.push("heading_close","h"+String(x),-1),U.markup="########".slice(0,x)),!0)}},35634:function(Xe,ye,o){"use strict";var l=o(67022).isSpace;Xe.exports=function(p,d,a,S){var m,x,V,U,te=p.bMarks[d]+p.tShift[d],w=p.eMarks[d];if(p.sCount[d]-p.blkIndent>=4||(m=p.src.charCodeAt(te++),m!==42&&m!==45&&m!==95))return!1;for(x=1;te|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(f.source+"\\s*$"),/^$/,!1]];Xe.exports=function(a,S,m,x){var V,U,te,w,ce=a.bMarks[S]+a.tShift[S],N=a.eMarks[S];if(a.sCount[S]-a.blkIndent>=4||!a.md.options.html||a.src.charCodeAt(ce)!==60)return!1;for(w=a.src.slice(ce,N),V=0;V=4)return!1;for(ce=o.parentType,o.parentType="paragraph";w3)){if(o.sCount[w]>=o.blkIndent&&(x=o.bMarks[w]+o.tShift[w],V=o.eMarks[w],x=V)))){U=te===61?1:2;break}if(!(o.sCount[w]<0)){for(d=!1,a=0,S=N.length;a=U||(m=a.src.charCodeAt(V++),m<48||m>57))return-1;for(;;){if(V>=U)return-1;if(m=a.src.charCodeAt(V++),m>=48&&m<=57){if(V-x>=10)return-1;continue}if(m===41||m===46)break;return-1}return V=4||S.listIndent>=0&&S.sCount[K]-S.listIndent>=4&&S.sCount[K]=S.blkIndent&&(Se=!0),(Ie=p(S,K))>=0){if(be=!0,I=S.bMarks[K]+S.tShift[K],Ce=Number(S.src.slice(I,Ie-1)),Se&&Ce!==1)return!1}else if((Ie=f(S,K))>=0)be=!1;else return!1;if(Se&&S.skipSpaces(Ie)>=S.eMarks[K])return!1;if(V)return!0;for(ae=S.src.charCodeAt(Ie-1),re=S.tokens.length,be?(q=S.push("ordered_list_open","ol",1),Ce!==1&&(q.attrs=[["start",Ce]])):q=S.push("bullet_list_open","ul",1),q.map=ke=[K,0],q.markup=String.fromCharCode(ae),$=!1,W=S.md.block.ruler.getRules("list"),dt=S.parentType,S.parentType="list";K=Ee?N=1:N=nt-xe,N>4&&(N=1),ce=xe+N,q=S.push("list_item_open","li",1),q.markup=String.fromCharCode(ae),q.map=ne=[K,0],be&&(q.info=S.src.slice(I,Ie-1)),Rt=S.tight,lt=S.tShift[K],Je=S.sCount[K],qe=S.listIndent,S.listIndent=S.blkIndent,S.blkIndent=ce,S.tight=!0,S.tShift[K]=te-S.bMarks[K],S.sCount[K]=nt,te>=Ee&&S.isEmpty(K+1)?S.line=Math.min(S.line+2,x):S.md.block.tokenize(S,K,x,!0),(!S.tight||$)&&(Ke=!1),$=S.line-K>1&&S.isEmpty(S.line-1),S.blkIndent=S.listIndent,S.listIndent=qe,S.tShift[K]=lt,S.sCount[K]=Je,S.tight=Rt,q=S.push("list_item_close","li",-1),q.markup=String.fromCharCode(ae),K=S.line,ne[1]=K,K>=x||S.sCount[K]=4)break;for(H=!1,w=0,me=W.length;w3)&&!(o.sCount[V]<0)){for(d=!1,a=0,S=U.length;a=4||d.src.charCodeAt(qe)!==91)return!1;for(;++qe3)&&!(d.sCount[Je]<0)){for(ae=!1,ce=0,N=Ce.length;ce0&&this.level++,this.tokens.push(m),m},p.prototype.isEmpty=function(a){return this.bMarks[a]+this.tShift[a]>=this.eMarks[a]},p.prototype.skipEmptyLines=function(a){for(var S=this.lineMax;aS;)if(!f(this.src.charCodeAt(--a)))return a+1;return a},p.prototype.skipChars=function(a,S){for(var m=this.src.length;am;)if(S!==this.src.charCodeAt(--a))return a+1;return a},p.prototype.getLines=function(a,S,m,x){var V,U,te,w,ce,N,xe,be=a;if(a>=S)return"";for(N=new Array(S-a),V=0;bem?N[V]=new Array(U-m+1).join(" ")+this.src.slice(w,ce):N[V]=this.src.slice(w,ce)}return N.join("")},p.prototype.Token=l,Xe.exports=p},91785:function(Xe,ye,o){"use strict";var l=o(67022).isSpace;function f(d,a){var S=d.bMarks[a]+d.tShift[a],m=d.eMarks[a];return d.src.slice(S,m)}function p(d){var a=[],S=0,m=d.length,x,V=!1,U=0,te="";for(x=d.charCodeAt(S);Sm||(N=S+1,a.sCount[N]=4||(te=a.bMarks[N]+a.tShift[N],te>=a.eMarks[N])||(qe=a.src.charCodeAt(te++),qe!==124&&qe!==45&&qe!==58)||te>=a.eMarks[N]||(dt=a.src.charCodeAt(te++),dt!==124&&dt!==45&&dt!==58&&!l(dt))||qe===45&&l(dt))return!1;for(;te=4||(xe=p(U),xe.length&&xe[0]===""&&xe.shift(),xe.length&&xe[xe.length-1]===""&&xe.pop(),be=xe.length,be===0||be!==me.length))return!1;if(x)return!0;for(Ce=a.parentType,a.parentType="table",nt=a.md.block.ruler.getRules("blockquote"),ne=a.push("table_open","table",1),ne.map=re=[S,0],ne=a.push("thead_open","thead",1),ne.map=[S,S+1],ne=a.push("tr_open","tr",1),ne.map=[S,S+1],w=0;w=4)break;for(xe=p(U),xe.length&&xe[0]===""&&xe.shift(),xe.length&&xe[xe.length-1]===""&&xe.pop(),N===S+2&&(ne=a.push("tbody_open","tbody",1),ne.map=ae=[S+2,0]),ne=a.push("tr_open","tr",1),ne.map=[N,N+1],w=0;w\s]/i.test(d)}function p(d){return/^<\/a\s*>/i.test(d)}Xe.exports=function(a){var S,m,x,V,U,te,w,ce,N,xe,be,ne,me,ke,re,ae,Ce=a.tokens,Ee;if(!!a.md.options.linkify){for(m=0,x=Ce.length;m=0;S--){if(te=V[S],te.type==="link_close"){for(S--;V[S].level!==te.level&&V[S].type!=="link_open";)S--;continue}if(te.type==="html_inline"&&(f(te.content)&&me>0&&me--,p(te.content)&&me++),!(me>0)&&te.type==="text"&&a.md.linkify.test(te.content)){for(N=te.content,Ee=a.md.linkify.match(N),w=[],ne=te.level,be=0,Ee.length>0&&Ee[0].index===0&&S>0&&V[S-1].type==="text_special"&&(Ee=Ee.slice(1)),ce=0;cebe&&(U=new a.Token("text","",0),U.content=N.slice(be,xe),U.level=ne,w.push(U)),U=new a.Token("link_open","a",1),U.attrs=[["href",re]],U.level=ne++,U.markup="linkify",U.info="auto",w.push(U),U=new a.Token("text","",0),U.content=ae,U.level=ne,w.push(U),U=new a.Token("link_close","a",-1),U.level=--ne,U.markup="linkify",U.info="auto",w.push(U),be=Ee[ce].lastIndex);be=0;m--)x=S[m],x.type==="text"&&!V&&(x.content=x.content.replace(l,p)),x.type==="link_open"&&x.info==="auto"&&V--,x.type==="link_close"&&x.info==="auto"&&V++}function a(S){var m,x,V=0;for(m=S.length-1;m>=0;m--)x=S[m],x.type==="text"&&!V&&ye.test(x.content)&&(x.content=x.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),x.type==="link_open"&&x.info==="auto"&&V--,x.type==="link_close"&&x.info==="auto"&&V++}Xe.exports=function(m){var x;if(!!m.md.options.typographer)for(x=m.tokens.length-1;x>=0;x--)m.tokens[x].type==="inline"&&(o.test(m.tokens[x].content)&&d(m.tokens[x].children),ye.test(m.tokens[x].content)&&a(m.tokens[x].children))}},58450:function(Xe,ye,o){"use strict";var l=o(67022).isWhiteSpace,f=o(67022).isPunctChar,p=o(67022).isMdAsciiPunct,d=/['"]/,a=/['"]/g,S="\u2019";function m(V,U,te){return V.slice(0,U)+te+V.slice(U+1)}function x(V,U){var te,w,ce,N,xe,be,ne,me,ke,re,ae,Ce,Ee,nt,qe,dt,Je,lt,Rt,Re,Ie;for(Rt=[],te=0;te=0&&!(Rt[Je].level<=ne);Je--);if(Rt.length=Je+1,w.type!=="text")continue;ce=w.content,xe=0,be=ce.length;e:for(;xe=0)ke=ce.charCodeAt(N.index-1);else for(Je=te-1;Je>=0&&!(V[Je].type==="softbreak"||V[Je].type==="hardbreak");Je--)if(!!V[Je].content){ke=V[Je].content.charCodeAt(V[Je].content.length-1);break}if(re=32,xe=48&&ke<=57&&(dt=qe=!1),qe&&dt&&(qe=ae,dt=Ce),!qe&&!dt){lt&&(w.content=m(w.content,N.index,S));continue}if(dt){for(Je=Rt.length-1;Je>=0&&(me=Rt[Je],!(Rt[Je].level=0;te--)U.tokens[te].type!=="inline"||!d.test(U.tokens[te].content)||x(U.tokens[te].children,U)}},16480:function(Xe,ye,o){"use strict";var l=o(75872);function f(p,d,a){this.src=p,this.env=a,this.tokens=[],this.inlineMode=!1,this.md=d}f.prototype.Token=l,Xe.exports=f},46633:function(Xe){"use strict";Xe.exports=function(o){var l,f,p,d,a,S,m=o.tokens;for(l=0,f=m.length;l\x00-\x20]*)$/;Xe.exports=function(f,p){var d,a,S,m,x,V,U=f.pos;if(f.src.charCodeAt(U)!==60)return!1;for(x=f.pos,V=f.posMax;;){if(++U>=V||(m=f.src.charCodeAt(U),m===60))return!1;if(m===62)break}return d=f.src.slice(x+1,U),o.test(d)?(a=f.md.normalizeLink(d),f.md.validateLink(a)?(p||(S=f.push("link_open","a",1),S.attrs=[["href",a]],S.markup="autolink",S.info="auto",S=f.push("text","",0),S.content=f.md.normalizeLinkText(d),S=f.push("link_close","a",-1),S.markup="autolink",S.info="auto"),f.pos+=d.length+2,!0):!1):ye.test(d)?(a=f.md.normalizeLink("mailto:"+d),f.md.validateLink(a)?(p||(S=f.push("link_open","a",1),S.attrs=[["href",a]],S.markup="autolink",S.info="auto",S=f.push("text","",0),S.content=f.md.normalizeLinkText(d),S=f.push("link_close","a",-1),S.markup="autolink",S.info="auto"),f.pos+=d.length+2,!0):!1):!1}},79755:function(Xe){"use strict";Xe.exports=function(o,l){var f,p,d,a,S,m,x,V,U=o.pos,te=o.src.charCodeAt(U);if(te!==96)return!1;for(f=U,U++,p=o.posMax;Ua;f-=ce[f]+1)if(d=o[f],d.marker===p.marker&&d.open&&d.end<0&&(m=!1,(d.close||p.open)&&(d.length+p.length)%3==0&&(d.length%3!=0||p.length%3!=0)&&(m=!0),!m)){x=f>0&&!o[f-1].open?ce[f-1]+1:0,ce[l]=l-f+x,ce[f]=x,p.open=!1,d.end=l,d.close=!1,S=-1,w=-2;break}S!==-1&&(V[p.marker][(p.open?3:0)+(p.length||0)%3]=S)}}}Xe.exports=function(l){var f,p=l.tokens_meta,d=l.tokens_meta.length;for(ye(l.delimiters),f=0;f=0;f--)p=l[f],!(p.marker!==95&&p.marker!==42)&&p.end!==-1&&(d=l[p.end],m=f>0&&l[f-1].end===p.end+1&&l[f-1].marker===p.marker&&l[f-1].token===p.token-1&&l[p.end+1].token===d.token+1,S=String.fromCharCode(p.marker),a=o.tokens[p.token],a.type=m?"strong_open":"em_open",a.tag=m?"strong":"em",a.nesting=1,a.markup=m?S+S:S,a.content="",a=o.tokens[d.token],a.type=m?"strong_close":"em_close",a.tag=m?"strong":"em",a.nesting=-1,a.markup=m?S+S:S,a.content="",m&&(o.tokens[l[f-1].token].content="",o.tokens[l[p.end+1].token].content="",f--))}Xe.exports.g=function(l){var f,p=l.tokens_meta,d=l.tokens_meta.length;for(ye(l,l.delimiters),f=0;f=xe)return!1;if(U=x.src.charCodeAt(N+1),U===35){if(w=x.src.slice(N).match(a),w)return V||(te=w[1][0].toLowerCase()==="x"?parseInt(w[1].slice(1),16):parseInt(w[1],10),ce=x.push("text_special","",0),ce.content=p(te)?d(te):d(65533),ce.markup=w[0],ce.info="entity"),x.pos+=w[0].length,!0}else if(w=x.src.slice(N).match(S),w&&f(l,w[1]))return V||(ce=x.push("text_special","",0),ce.content=l[w[1]],ce.markup=w[0],ce.info="entity"),x.pos+=w[0].length,!0;return!1}},1917:function(Xe,ye,o){"use strict";for(var l=o(67022).isSpace,f=[],p=0;p<256;p++)f.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(d){f[d.charCodeAt(0)]=1}),Xe.exports=function(a,S){var m,x,V,U,te,w=a.pos,ce=a.posMax;if(a.src.charCodeAt(w)!==92||(w++,w>=ce))return!1;if(m=a.src.charCodeAt(w),m===10){for(S||a.push("hardbreak","br",0),w++;w=55296&&m<=56319&&w+1=56320&&x<=57343&&(U+=a.src[w+1],w++)),V="\\"+U,S||(te=a.push("text_special","",0),m<256&&f[m]!==0?te.content=U:te.content=V,te.markup=V,te.info="escape"),a.pos=w+1,!0}},69969:function(Xe){"use strict";Xe.exports=function(o){var l,f,p=0,d=o.tokens,a=o.tokens.length;for(l=f=0;l0&&p++,d[l].type==="text"&&l+1\s]/i.test(a)}function p(a){return/^<\/a\s*>/i.test(a)}function d(a){var S=a|32;return S>=97&&S<=122}Xe.exports=function(S,m){var x,V,U,te,w=S.pos;return!S.md.options.html||(U=S.posMax,S.src.charCodeAt(w)!==60||w+2>=U)||(x=S.src.charCodeAt(w+1),x!==33&&x!==63&&x!==47&&!d(x))||(V=S.src.slice(w).match(l),!V)?!1:(m||(te=S.push("html_inline","",0),te.content=V[0],f(te.content)&&S.linkLevel++,p(te.content)&&S.linkLevel--),S.pos+=V[0].length,!0)}},83006:function(Xe,ye,o){"use strict";var l=o(67022).normalizeReference,f=o(67022).isSpace;Xe.exports=function(d,a){var S,m,x,V,U,te,w,ce,N,xe,be,ne,me,ke="",re=d.pos,ae=d.posMax;if(d.src.charCodeAt(d.pos)!==33||d.src.charCodeAt(d.pos+1)!==91||(te=d.pos+2,U=d.md.helpers.parseLinkLabel(d,d.pos+1,!1),U<0))return!1;if(w=U+1,w=ae)return!1;for(me=w,N=d.md.helpers.parseLinkDestination(d.src,w,d.posMax),N.ok&&(ke=d.md.normalizeLink(N.str),d.md.validateLink(ke)?w=N.pos:ke=""),me=w;w=ae||d.src.charCodeAt(w)!==41)return d.pos=re,!1;w++}else{if(typeof d.env.references=="undefined")return!1;if(w=0?V=d.src.slice(me,w++):w=U+1):w=U+1,V||(V=d.src.slice(te,U)),ce=d.env.references[l(V)],!ce)return d.pos=re,!1;ke=ce.href,xe=ce.title}return a||(x=d.src.slice(te,U),d.md.inline.parse(x,d.md,d.env,ne=[]),be=d.push("image","img",0),be.attrs=S=[["src",ke],["alt",""]],be.children=ne,be.content=x,xe&&S.push(["title",xe])),d.pos=w,d.posMax=ae,!0}},81727:function(Xe,ye,o){"use strict";var l=o(67022).normalizeReference,f=o(67022).isSpace;Xe.exports=function(d,a){var S,m,x,V,U,te,w,ce,N,xe="",be="",ne=d.pos,me=d.posMax,ke=d.pos,re=!0;if(d.src.charCodeAt(d.pos)!==91||(U=d.pos+1,V=d.md.helpers.parseLinkLabel(d,d.pos,!0),V<0))return!1;if(te=V+1,te=me)return!1;if(ke=te,w=d.md.helpers.parseLinkDestination(d.src,te,d.posMax),w.ok){for(xe=d.md.normalizeLink(w.str),d.md.validateLink(xe)?te=w.pos:xe="",ke=te;te=me||d.src.charCodeAt(te)!==41)&&(re=!0),te++}if(re){if(typeof d.env.references=="undefined")return!1;if(te=0?x=d.src.slice(ke,te++):te=V+1):te=V+1,x||(x=d.src.slice(U,V)),ce=d.env.references[l(x)],!ce)return d.pos=ne,!1;xe=ce.href,be=ce.title}return a||(d.pos=U,d.posMax=V,N=d.push("link_open","a",1),N.attrs=S=[["href",xe]],be&&S.push(["title",be]),d.linkLevel++,d.md.inline.tokenize(d),d.linkLevel--,N=d.push("link_close","a",-1)),d.pos=te,d.posMax=me,!0}},12906:function(Xe){"use strict";var ye=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;Xe.exports=function(l,f){var p,d,a,S,m,x,V,U;return!l.md.options.linkify||l.linkLevel>0||(p=l.pos,d=l.posMax,p+3>d)||l.src.charCodeAt(p)!==58||l.src.charCodeAt(p+1)!==47||l.src.charCodeAt(p+2)!==47||(a=l.pending.match(ye),!a)||(S=a[1],m=l.md.linkify.matchAtStart(l.src.slice(p-S.length)),!m)||(x=m.url,x.length<=S.length)||(x=x.replace(/\*+$/,""),V=l.md.normalizeLink(x),!l.md.validateLink(V))?!1:(f||(l.pending=l.pending.slice(0,-S.length),U=l.push("link_open","a",1),U.attrs=[["href",V]],U.markup="linkify",U.info="auto",U=l.push("text","",0),U.content=l.md.normalizeLinkText(x),U=l.push("link_close","a",-1),U.markup="linkify",U.info="auto"),l.pos+=x.length-S.length,!0)}},43905:function(Xe,ye,o){"use strict";var l=o(67022).isSpace;Xe.exports=function(p,d){var a,S,m,x=p.pos;if(p.src.charCodeAt(x)!==10)return!1;if(a=p.pending.length-1,S=p.posMax,!d)if(a>=0&&p.pending.charCodeAt(a)===32)if(a>=1&&p.pending.charCodeAt(a-1)===32){for(m=a-1;m>=1&&p.pending.charCodeAt(m-1)===32;)m--;p.pending=p.pending.slice(0,m),p.push("hardbreak","br",0)}else p.pending=p.pending.slice(0,-1),p.push("softbreak","br",0);else p.push("softbreak","br",0);for(x++;x0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],U={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(V),this.tokens_meta.push(U),V},a.prototype.scanDelims=function(S,m){var x=S,V,U,te,w,ce,N,xe,be,ne,me=!0,ke=!0,re=this.posMax,ae=this.src.charCodeAt(S);for(V=S>0?this.src.charCodeAt(S-1):32;x=0&&(p=this.attrs[f][1]),p},ye.prototype.attrJoin=function(l,f){var p=this.attrIndex(l);p<0?this.attrPush([l,f]):this.attrs[p][1]=this.attrs[p][1]+" "+f},Xe.exports=ye},90505:function(Xe,ye,o){"use strict";o.d(ye,{C:function(){return Ys},E:function(){return Go},a:function(){return si},b:function(){return Er},u:function(){return Ar}});var l=o(14405),f=o(67294),p=o(12541),d=o(93713),a=o(61979),S=o(30111),m=o(16888);function x(i){return new m.ri(m.il.define(i))}function V(i){return o.e(28771).then(o.bind(o,28771)).then(b=>b.sql({dialect:b[i]}))}const U=[m.c6.of({name:"C",extensions:["c","h","ino"],load(){return o.e(95805).then(o.bind(o,95805)).then(i=>i.cpp())}}),m.c6.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return o.e(95805).then(o.bind(o,95805)).then(i=>i.cpp())}}),m.c6.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return V("Cassandra")}}),m.c6.of({name:"CSS",extensions:["css"],load(){return Promise.resolve().then(o.bind(o,70399)).then(i=>i.css())}}),m.c6.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Promise.resolve().then(o.bind(o,82741)).then(i=>i.html())}}),m.c6.of({name:"Java",extensions:["java"],load(){return o.e(27331).then(o.bind(o,27331)).then(i=>i.java())}}),m.c6.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Promise.resolve().then(o.bind(o,84421)).then(i=>i.javascript())}}),m.c6.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return o.e(66464).then(o.bind(o,66464)).then(i=>i.json())}}),m.c6.of({name:"JSX",extensions:["jsx"],load(){return Promise.resolve().then(o.bind(o,84421)).then(i=>i.javascript({jsx:!0}))}}),m.c6.of({name:"LESS",extensions:["less"],load(){return o.e(39286).then(o.bind(o,39286)).then(i=>i.less())}}),m.c6.of({name:"Liquid",extensions:["liquid"],load(){return o.e(30903).then(o.bind(o,30903)).then(i=>i.liquid())}}),m.c6.of({name:"MariaDB SQL",load(){return V("MariaSQL")}}),m.c6.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Promise.resolve().then(o.bind(o,67958)).then(i=>i.markdown())}}),m.c6.of({name:"MS SQL",load(){return V("MSSQL")}}),m.c6.of({name:"MySQL",load(){return V("MySQL")}}),m.c6.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return o.e(12676).then(o.bind(o,12676)).then(i=>i.php())}}),m.c6.of({name:"PLSQL",extensions:["pls"],load(){return V("PLSQL")}}),m.c6.of({name:"PostgreSQL",load(){return V("PostgreSQL")}}),m.c6.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return o.e(68710).then(o.bind(o,68710)).then(i=>i.python())}}),m.c6.of({name:"Rust",extensions:["rs"],load(){return o.e(72704).then(o.bind(o,72704)).then(i=>i.rust())}}),m.c6.of({name:"Sass",extensions:["sass"],load(){return o.e(85516).then(o.bind(o,85516)).then(i=>i.sass({indented:!0}))}}),m.c6.of({name:"SCSS",extensions:["scss"],load(){return o.e(85516).then(o.bind(o,85516)).then(i=>i.sass())}}),m.c6.of({name:"SQL",extensions:["sql"],load(){return V("StandardSQL")}}),m.c6.of({name:"SQLite",load(){return V("SQLite")}}),m.c6.of({name:"TSX",extensions:["tsx"],load(){return Promise.resolve().then(o.bind(o,84421)).then(i=>i.javascript({jsx:!0,typescript:!0}))}}),m.c6.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Promise.resolve().then(o.bind(o,84421)).then(i=>i.javascript({typescript:!0}))}}),m.c6.of({name:"WebAssembly",extensions:["wat","wast"],load(){return o.e(51410).then(o.bind(o,51410)).then(i=>i.wast())}}),m.c6.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return o.e(64068).then(o.bind(o,64068)).then(i=>i.xml())}}),m.c6.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return o.e(41503).then(o.bind(o,41503)).then(i=>i.yaml())}}),m.c6.of({name:"APL",extensions:["dyalog","apl"],load(){return o.e(93601).then(o.bind(o,93601)).then(i=>x(i.apl))}}),m.c6.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return o.e(34283).then(o.bind(o,34283)).then(i=>x(i.asciiArmor))}}),m.c6.of({name:"ASN.1",extensions:["asn","asn1"],load(){return o.e(54743).then(o.bind(o,54743)).then(i=>x(i.asn1({})))}}),m.c6.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return o.e(17827).then(o.bind(o,17827)).then(i=>x(i.asterisk))}}),m.c6.of({name:"Brainfuck",extensions:["b","bf"],load(){return o.e(38347).then(o.bind(o,38347)).then(i=>x(i.brainfuck))}}),m.c6.of({name:"Cobol",extensions:["cob","cpy"],load(){return o.e(10378).then(o.bind(o,10378)).then(i=>x(i.cobol))}}),m.c6.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.csharp))}}),m.c6.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return o.e(1861).then(o.bind(o,1861)).then(i=>x(i.clojure))}}),m.c6.of({name:"ClojureScript",extensions:["cljs"],load(){return o.e(1861).then(o.bind(o,1861)).then(i=>x(i.clojure))}}),m.c6.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return o.e(63923).then(o.bind(o,63923)).then(i=>x(i.gss))}}),m.c6.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return o.e(54419).then(o.bind(o,54419)).then(i=>x(i.cmake))}}),m.c6.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return o.e(22646).then(o.bind(o,22646)).then(i=>x(i.coffeeScript))}}),m.c6.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return o.e(61420).then(o.bind(o,61420)).then(i=>x(i.commonLisp))}}),m.c6.of({name:"Cypher",extensions:["cyp","cypher"],load(){return o.e(74878).then(o.bind(o,74878)).then(i=>x(i.cypher))}}),m.c6.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return o.e(16532).then(o.bind(o,16532)).then(i=>x(i.cython))}}),m.c6.of({name:"Crystal",extensions:["cr"],load(){return o.e(11945).then(o.bind(o,11945)).then(i=>x(i.crystal))}}),m.c6.of({name:"D",extensions:["d"],load(){return o.e(95041).then(o.bind(o,95041)).then(i=>x(i.d))}}),m.c6.of({name:"Dart",extensions:["dart"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.dart))}}),m.c6.of({name:"diff",extensions:["diff","patch"],load(){return o.e(41776).then(o.bind(o,41776)).then(i=>x(i.diff))}}),m.c6.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return o.e(92485).then(o.bind(o,92485)).then(i=>x(i.dockerFile))}}),m.c6.of({name:"DTD",extensions:["dtd"],load(){return o.e(68493).then(o.bind(o,68493)).then(i=>x(i.dtd))}}),m.c6.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return o.e(89409).then(o.bind(o,89409)).then(i=>x(i.dylan))}}),m.c6.of({name:"EBNF",load(){return o.e(75203).then(o.bind(o,75203)).then(i=>x(i.ebnf))}}),m.c6.of({name:"ECL",extensions:["ecl"],load(){return o.e(91903).then(o.bind(o,91903)).then(i=>x(i.ecl))}}),m.c6.of({name:"edn",extensions:["edn"],load(){return o.e(1861).then(o.bind(o,1861)).then(i=>x(i.clojure))}}),m.c6.of({name:"Eiffel",extensions:["e"],load(){return o.e(41467).then(o.bind(o,41467)).then(i=>x(i.eiffel))}}),m.c6.of({name:"Elm",extensions:["elm"],load(){return o.e(39738).then(o.bind(o,39738)).then(i=>x(i.elm))}}),m.c6.of({name:"Erlang",extensions:["erl"],load(){return o.e(34519).then(o.bind(o,34519)).then(i=>x(i.erlang))}}),m.c6.of({name:"Esper",load(){return o.e(34591).then(o.bind(o,34591)).then(i=>x(i.esper))}}),m.c6.of({name:"Factor",extensions:["factor"],load(){return o.e(4017).then(o.bind(o,4017)).then(i=>x(i.factor))}}),m.c6.of({name:"FCL",load(){return o.e(8002).then(o.bind(o,8002)).then(i=>x(i.fcl))}}),m.c6.of({name:"Forth",extensions:["forth","fth","4th"],load(){return o.e(7317).then(o.bind(o,7317)).then(i=>x(i.forth))}}),m.c6.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return o.e(94452).then(o.bind(o,94452)).then(i=>x(i.fortran))}}),m.c6.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return o.e(2909).then(o.bind(o,2909)).then(i=>x(i.fSharp))}}),m.c6.of({name:"Gas",extensions:["s"],load(){return o.e(23549).then(o.bind(o,23549)).then(i=>x(i.gas))}}),m.c6.of({name:"Gherkin",extensions:["feature"],load(){return o.e(95881).then(o.bind(o,95881)).then(i=>x(i.gherkin))}}),m.c6.of({name:"Go",extensions:["go"],load(){return o.e(93528).then(o.bind(o,93528)).then(i=>x(i.go))}}),m.c6.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return o.e(41085).then(o.bind(o,41085)).then(i=>x(i.groovy))}}),m.c6.of({name:"Haskell",extensions:["hs"],load(){return o.e(21294).then(o.bind(o,21294)).then(i=>x(i.haskell))}}),m.c6.of({name:"Haxe",extensions:["hx"],load(){return o.e(59055).then(o.bind(o,53604)).then(i=>x(i.haxe))}}),m.c6.of({name:"HXML",extensions:["hxml"],load(){return o.e(59055).then(o.bind(o,53604)).then(i=>x(i.hxml))}}),m.c6.of({name:"HTTP",load(){return o.e(71550).then(o.bind(o,71550)).then(i=>x(i.http))}}),m.c6.of({name:"IDL",extensions:["pro"],load(){return o.e(2857).then(o.bind(o,2857)).then(i=>x(i.idl))}}),m.c6.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return o.e(27318).then(o.bind(o,27318)).then(i=>x(i.jsonld))}}),m.c6.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return o.e(7848).then(o.bind(o,7848)).then(i=>x(i.jinja2))}}),m.c6.of({name:"Julia",extensions:["jl"],load(){return o.e(4139).then(o.bind(o,4139)).then(i=>x(i.julia))}}),m.c6.of({name:"Kotlin",extensions:["kt","kts"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.kotlin))}}),m.c6.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return o.e(9445).then(o.bind(o,9445)).then(i=>x(i.liveScript))}}),m.c6.of({name:"Lua",extensions:["lua"],load(){return o.e(6595).then(o.bind(o,6595)).then(i=>x(i.lua))}}),m.c6.of({name:"mIRC",extensions:["mrc"],load(){return o.e(69192).then(o.bind(o,69192)).then(i=>x(i.mirc))}}),m.c6.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return o.e(8405).then(o.bind(o,8405)).then(i=>x(i.mathematica))}}),m.c6.of({name:"Modelica",extensions:["mo"],load(){return o.e(14562).then(o.bind(o,14562)).then(i=>x(i.modelica))}}),m.c6.of({name:"MUMPS",extensions:["mps"],load(){return o.e(77112).then(o.bind(o,77112)).then(i=>x(i.mumps))}}),m.c6.of({name:"Mbox",extensions:["mbox"],load(){return o.e(47731).then(o.bind(o,47731)).then(i=>x(i.mbox))}}),m.c6.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return o.e(38319).then(o.bind(o,38319)).then(i=>x(i.nginx))}}),m.c6.of({name:"NSIS",extensions:["nsh","nsi"],load(){return o.e(27823).then(o.bind(o,27823)).then(i=>x(i.nsis))}}),m.c6.of({name:"NTriples",extensions:["nt","nq"],load(){return o.e(87390).then(o.bind(o,87390)).then(i=>x(i.ntriples))}}),m.c6.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.objectiveC))}}),m.c6.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.objectiveCpp))}}),m.c6.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return o.e(2909).then(o.bind(o,2909)).then(i=>x(i.oCaml))}}),m.c6.of({name:"Octave",extensions:["m"],load(){return o.e(21954).then(o.bind(o,21954)).then(i=>x(i.octave))}}),m.c6.of({name:"Oz",extensions:["oz"],load(){return o.e(97080).then(o.bind(o,97080)).then(i=>x(i.oz))}}),m.c6.of({name:"Pascal",extensions:["p","pas"],load(){return o.e(91452).then(o.bind(o,91452)).then(i=>x(i.pascal))}}),m.c6.of({name:"Perl",extensions:["pl","pm"],load(){return o.e(5521).then(o.bind(o,5521)).then(i=>x(i.perl))}}),m.c6.of({name:"Pig",extensions:["pig"],load(){return o.e(86243).then(o.bind(o,86243)).then(i=>x(i.pig))}}),m.c6.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return o.e(92145).then(o.bind(o,92145)).then(i=>x(i.powerShell))}}),m.c6.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return o.e(93306).then(o.bind(o,93306)).then(i=>x(i.properties))}}),m.c6.of({name:"ProtoBuf",extensions:["proto"],load(){return o.e(15959).then(o.bind(o,15959)).then(i=>x(i.protobuf))}}),m.c6.of({name:"Puppet",extensions:["pp"],load(){return o.e(58710).then(o.bind(o,58710)).then(i=>x(i.puppet))}}),m.c6.of({name:"Q",extensions:["q"],load(){return o.e(12459).then(o.bind(o,12459)).then(i=>x(i.q))}}),m.c6.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return o.e(67887).then(o.bind(o,67887)).then(i=>x(i.r))}}),m.c6.of({name:"RPM Changes",load(){return o.e(98285).then(o.bind(o,98285)).then(i=>x(i.rpmChanges))}}),m.c6.of({name:"RPM Spec",extensions:["spec"],load(){return o.e(98285).then(o.bind(o,98285)).then(i=>x(i.rpmSpec))}}),m.c6.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return o.e(42929).then(o.bind(o,42929)).then(i=>x(i.ruby))}}),m.c6.of({name:"SAS",extensions:["sas"],load(){return o.e(18498).then(o.bind(o,18498)).then(i=>x(i.sas))}}),m.c6.of({name:"Scala",extensions:["scala"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.scala))}}),m.c6.of({name:"Scheme",extensions:["scm","ss"],load(){return o.e(91993).then(o.bind(o,91993)).then(i=>x(i.scheme))}}),m.c6.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return o.e(80795).then(o.bind(o,80795)).then(i=>x(i.shell))}}),m.c6.of({name:"Sieve",extensions:["siv","sieve"],load(){return o.e(46163).then(o.bind(o,60618)).then(i=>x(i.sieve))}}),m.c6.of({name:"Smalltalk",extensions:["st"],load(){return o.e(28012).then(o.bind(o,28012)).then(i=>x(i.smalltalk))}}),m.c6.of({name:"Solr",load(){return o.e(17669).then(o.bind(o,17669)).then(i=>x(i.solr))}}),m.c6.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return o.e(2909).then(o.bind(o,2909)).then(i=>x(i.sml))}}),m.c6.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return o.e(2995).then(o.bind(o,2995)).then(i=>x(i.sparql))}}),m.c6.of({name:"Spreadsheet",alias:["excel","formula"],load(){return o.e(57702).then(o.bind(o,57702)).then(i=>x(i.spreadsheet))}}),m.c6.of({name:"Squirrel",extensions:["nut"],load(){return o.e(60942).then(o.bind(o,60942)).then(i=>x(i.squirrel))}}),m.c6.of({name:"Stylus",extensions:["styl"],load(){return o.e(89222).then(o.bind(o,89222)).then(i=>x(i.stylus))}}),m.c6.of({name:"Swift",extensions:["swift"],load(){return o.e(32363).then(o.bind(o,32363)).then(i=>x(i.swift))}}),m.c6.of({name:"sTeX",load(){return o.e(38010).then(o.bind(o,38010)).then(i=>x(i.stex))}}),m.c6.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return o.e(38010).then(o.bind(o,38010)).then(i=>x(i.stex))}}),m.c6.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return o.e(59747).then(o.bind(o,59747)).then(i=>x(i.verilog))}}),m.c6.of({name:"Tcl",extensions:["tcl"],load(){return o.e(73807).then(o.bind(o,47434)).then(i=>x(i.tcl))}}),m.c6.of({name:"Textile",extensions:["textile"],load(){return o.e(72039).then(o.bind(o,72039)).then(i=>x(i.textile))}}),m.c6.of({name:"TiddlyWiki",load(){return o.e(21716).then(o.bind(o,21716)).then(i=>x(i.tiddlyWiki))}}),m.c6.of({name:"Tiki wiki",load(){return o.e(19362).then(o.bind(o,19362)).then(i=>x(i.tiki))}}),m.c6.of({name:"TOML",extensions:["toml"],load(){return o.e(50046).then(o.bind(o,50046)).then(i=>x(i.toml))}}),m.c6.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return o.e(45331).then(o.bind(o,45331)).then(i=>x(i.troff))}}),m.c6.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return o.e(30581).then(o.bind(o,30581)).then(i=>x(i.ttcn))}}),m.c6.of({name:"TTCN_CFG",extensions:["cfg"],load(){return o.e(93962).then(o.bind(o,93962)).then(i=>x(i.ttcnCfg))}}),m.c6.of({name:"Turtle",extensions:["ttl"],load(){return o.e(78805).then(o.bind(o,78805)).then(i=>x(i.turtle))}}),m.c6.of({name:"Web IDL",extensions:["webidl"],load(){return o.e(39109).then(o.bind(o,39109)).then(i=>x(i.webIDL))}}),m.c6.of({name:"VB.NET",extensions:["vb"],load(){return o.e(67173).then(o.bind(o,67173)).then(i=>x(i.vb))}}),m.c6.of({name:"VBScript",extensions:["vbs"],load(){return o.e(68787).then(o.bind(o,68787)).then(i=>x(i.vbScript))}}),m.c6.of({name:"Velocity",extensions:["vtl"],load(){return o.e(57363).then(o.bind(o,57363)).then(i=>x(i.velocity))}}),m.c6.of({name:"Verilog",extensions:["v"],load(){return o.e(59747).then(o.bind(o,59747)).then(i=>x(i.verilog))}}),m.c6.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return o.e(6359).then(o.bind(o,6359)).then(i=>x(i.vhdl))}}),m.c6.of({name:"XQuery",extensions:["xy","xquery"],load(){return o.e(96815).then(o.bind(o,96815)).then(i=>x(i.xQuery))}}),m.c6.of({name:"Yacas",extensions:["ys"],load(){return o.e(76267).then(o.bind(o,76267)).then(i=>x(i.yacas))}}),m.c6.of({name:"Z80",extensions:["z80"],load(){return o.e(22295).then(o.bind(o,22295)).then(i=>x(i.z80))}}),m.c6.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return o.e(31608).then(o.bind(o,31608)).then(i=>x(i.mscgen))}}),m.c6.of({name:"X\xF9",extensions:["xu"],load(){return o.e(31608).then(o.bind(o,31608)).then(i=>x(i.xu))}}),m.c6.of({name:"MsGenny",extensions:["msgenny"],load(){return o.e(31608).then(o.bind(o,31608)).then(i=>x(i.msgenny))}}),m.c6.of({name:"Vue",extensions:["vue"],load(){return o.e(53963).then(o.bind(o,53963)).then(i=>i.vue())}}),m.c6.of({name:"Angular Template",load(){return o.e(79187).then(o.bind(o,79187)).then(i=>i.angular())}})];var te=o(67958),w=o(74405),ce=o(72104);const N=i=>{let{state:b}=i,E=b.doc.lineAt(b.selection.main.from),Z=Ee(i.state,E.from);return Z.line?be(i):Z.block?Ce(i):!1};function xe(i,b){return({state:E,dispatch:Z})=>{if(E.readOnly)return!1;let z=i(b,E);return z?(Z(E.update(z)),!0):!1}}const be=xe(lt,0),ne=null,me=null,ke=xe(Je,0),re=null,ae=null,Ce=xe((i,b)=>Je(i,b,dt(b)),0);function Ee(i,b){let E=i.languageDataAt("commentTokens",b);return E.length?E[0]:{}}const nt=50;function qe(i,{open:b,close:E},Z,z){let B=i.sliceDoc(Z-nt,Z),ie=i.sliceDoc(z,z+nt),de=/\s*$/.exec(B)[0].length,pe=/^\s*/.exec(ie)[0].length,$e=B.length-de;if(B.slice($e-b.length,$e)==b&&ie.slice(pe,pe+E.length)==E)return{open:{pos:Z-de,margin:de&&1},close:{pos:z+pe,margin:pe&&1}};let De,ft;z-Z<=2*nt?De=ft=i.sliceDoc(Z,z):(De=i.sliceDoc(Z,Z+nt),ft=i.sliceDoc(z-nt,z));let He=/^\s*/.exec(De)[0].length,vt=/\s*$/.exec(ft)[0].length,ct=ft.length-vt-E.length;return De.slice(He,He+b.length)==b&&ft.slice(ct,ct+E.length)==E?{open:{pos:Z+He+b.length,margin:/\s/.test(De.charAt(He+b.length))?1:0},close:{pos:z-vt-E.length,margin:/\s/.test(ft.charAt(ct-1))?1:0}}:null}function dt(i){let b=[];for(let E of i.selection.ranges){let Z=i.doc.lineAt(E.from),z=E.to<=Z.to?Z:i.doc.lineAt(E.to),B=b.length-1;B>=0&&b[B].to>Z.from?b[B].to=z.to:b.push({from:Z.from+/^\s*/.exec(Z.text)[0].length,to:z.to})}return b}function Je(i,b,E=b.selection.ranges){let Z=E.map(B=>Ee(b,B.from).block);if(!Z.every(B=>B))return null;let z=E.map((B,ie)=>qe(b,Z[ie],B.from,B.to));if(i!=2&&!z.every(B=>B))return{changes:b.changes(E.map((B,ie)=>z[ie]?[]:[{from:B.from,insert:Z[ie].open+" "},{from:B.to,insert:" "+Z[ie].close}]))};if(i!=1&&z.some(B=>B)){let B=[];for(let ie=0,de;iez&&(B==ie||ie>ft.from)){z=ft.from;let He=/^\s*/.exec(ft.text)[0].length,vt=He==ft.length,ct=ft.text.slice(He,He+$e.length)==$e?He:-1;HeB.comment<0&&(!B.empty||B.single))){let B=[];for(let{line:de,token:pe,indent:$e,empty:De,single:ft}of Z)(ft||!De)&&B.push({from:de.from+$e,insert:pe+" "});let ie=b.changes(B);return{changes:ie,selection:b.selection.map(ie,1)}}else if(i!=1&&Z.some(B=>B.comment>=0)){let B=[];for(let{line:ie,comment:de,token:pe}of Z)if(de>=0){let $e=ie.from+de,De=$e+pe.length;ie.text[De-ie.from]==" "&&De++,B.push({from:$e,to:De})}return{changes:B}}return null}const Rt=w.q6.define(),Re=w.q6.define(),Ie=w.r$.define(),$=w.r$.define({combine(i){return(0,w.BO)(i,{minDepth:100,newGroupDelay:500,joinToEvent:(b,E)=>E},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(b,E)=>(Z,z)=>b(Z,z)||E(Z,z)})}}),I=w.QQ.define({create(){return Ne.empty},update(i,b){let E=b.state.facet($),Z=b.annotation(Rt);if(Z){let pe=zt.fromTransaction(b,Z.selection),$e=Z.side,De=$e==0?i.undone:i.done;return pe?De=It(De,De.length,E.minDepth,pe):De=A(De,b.startState.selection),new Ne($e==0?Z.rest:De,$e==0?De:Z.rest)}let z=b.annotation(Re);if((z=="full"||z=="before")&&(i=i.isolate()),b.annotation(w.YW.addToHistory)===!1)return b.changes.empty?i:i.addMapping(b.changes.desc);let B=zt.fromTransaction(b),ie=b.annotation(w.YW.time),de=b.annotation(w.YW.userEvent);return B?i=i.addChanges(B,ie,de,E,b):b.selection&&(i=i.addSelection(b.startState.selection,ie,de,E.newGroupDelay)),(z=="full"||z=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(b=>b.toJSON()),undone:i.undone.map(b=>b.toJSON())}},fromJSON(i){return new Ne(i.done.map(zt.fromJSON),i.undone.map(zt.fromJSON))}});function H(i={}){return[I,$.of(i),S.tk.domEventHandlers({beforeinput(b,E){let Z=b.inputType=="historyUndo"?K:b.inputType=="historyRedo"?Se:null;return Z?(b.preventDefault(),Z(E)):!1}})]}const W=null;function q(i,b){return function({state:E,dispatch:Z}){if(!b&&E.readOnly)return!1;let z=E.field(I,!1);if(!z)return!1;let B=z.pop(i,E,b);return B?(Z(B),!0):!1}}const K=q(0,!1),Se=q(1,!1),Ke=q(0,!0),ot=q(1,!0);function mt(i){return function(b){let E=b.field(I,!1);if(!E)return 0;let Z=i==0?E.done:E.undone;return Z.length-(Z.length&&!Z[0].changes?1:0)}}const ut=null,Vt=null;class zt{constructor(b,E,Z,z,B){this.changes=b,this.effects=E,this.mapped=Z,this.startSelection=z,this.selectionsAfter=B}setSelAfter(b){return new zt(this.changes,this.effects,this.mapped,this.startSelection,b)}toJSON(){var b,E,Z;return{changes:(b=this.changes)===null||b===void 0?void 0:b.toJSON(),mapped:(E=this.mapped)===null||E===void 0?void 0:E.toJSON(),startSelection:(Z=this.startSelection)===null||Z===void 0?void 0:Z.toJSON(),selectionsAfter:this.selectionsAfter.map(z=>z.toJSON())}}static fromJSON(b){return new zt(b.changes&&w.as.fromJSON(b.changes),[],b.mapped&&w.n0.fromJSON(b.mapped),b.startSelection&&w.jT.fromJSON(b.startSelection),b.selectionsAfter.map(w.jT.fromJSON))}static fromTransaction(b,E){let Z=$t;for(let z of b.startState.facet(Ie)){let B=z(b);B.length&&(Z=Z.concat(B))}return!Z.length&&b.changes.empty?null:new zt(b.changes.invert(b.startState.doc),Z,void 0,E||b.startState.selection,$t)}static selection(b){return new zt(void 0,$t,void 0,void 0,b)}}function It(i,b,E,Z){let z=b+1>E+20?b-E-1:0,B=i.slice(z,b);return B.push(Z),B}function sn(i,b){let E=[],Z=!1;return i.iterChangedRanges((z,B)=>E.push(z,B)),b.iterChangedRanges((z,B,ie,de)=>{for(let pe=0;pe=$e&&ie<=De&&(Z=!0)}}),Z}function on(i,b){return i.ranges.length==b.ranges.length&&i.ranges.filter((E,Z)=>E.empty!=b.ranges[Z].empty).length===0}function Xt(i,b){return i.length?b.length?i.concat(b):i:b}const $t=[],Ve=200;function A(i,b){if(i.length){let E=i[i.length-1],Z=E.selectionsAfter.slice(Math.max(0,E.selectionsAfter.length-Ve));return Z.length&&Z[Z.length-1].eq(b)?i:(Z.push(b),It(i,i.length-1,1e9,E.setSelAfter(Z)))}else return[zt.selection([b])]}function D(i){let b=i[i.length-1],E=i.slice();return E[i.length-1]=b.setSelAfter(b.selectionsAfter.slice(0,b.selectionsAfter.length-1)),E}function oe(i,b){if(!i.length)return i;let E=i.length,Z=$t;for(;E;){let z=ge(i[E-1],b,Z);if(z.changes&&!z.changes.empty||z.effects.length){let B=i.slice(0,E);return B[E-1]=z,B}else b=z.mapped,E--,Z=z.selectionsAfter}return Z.length?[zt.selection(Z)]:$t}function ge(i,b,E){let Z=Xt(i.selectionsAfter.length?i.selectionsAfter.map(de=>de.map(b)):$t,E);if(!i.changes)return zt.selection(Z);let z=i.changes.map(b),B=b.mapDesc(i.changes,!0),ie=i.mapped?i.mapped.composeDesc(B):B;return new zt(z,w.Py.mapEffects(i.effects,b),ie,i.startSelection.map(B),Z)}const Te=/^(input\.type|delete)($|\.)/;class Ne{constructor(b,E,Z=0,z=void 0){this.done=b,this.undone=E,this.prevTime=Z,this.prevUserEvent=z}isolate(){return this.prevTime?new Ne(this.done,this.undone):this}addChanges(b,E,Z,z,B){let ie=this.done,de=ie[ie.length-1];return de&&de.changes&&!de.changes.empty&&b.changes&&(!Z||Te.test(Z))&&(!de.selectionsAfter.length&&E-this.prevTime0&&E-this.prevTimeE.empty?i.moveByChar(E,b):nn(E,b))}function tn(i){return i.textDirectionAt(i.state.selection.main.head)==S.Nm.LTR}const gn=i=>hn(i,!tn(i)),Le=i=>hn(i,tn(i)),ze=i=>hn(i,!0),Ot=i=>hn(i,!1);function yt(i,b){return Bt(i,E=>E.empty?i.moveByGroup(E,b):nn(E,b))}const Oe=i=>yt(i,!tn(i)),Ge=i=>yt(i,tn(i)),it=i=>yt(i,!0),Ye=i=>yt(i,!1),Pt=typeof Intl!="undefined"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function qt(i,b,E){let Z=i.state.charCategorizer(b.from),z=CharCategory.Space,B=b.from,ie=0,de=!1,pe=!1,$e=!1,De=He=>{if(de)return!1;B+=E?He.length:-He.length;let vt=Z(He),ct;if(vt==CharCategory.Word&&He.charCodeAt(0)<128&&/[\W_]/.test(He)&&(vt=-1),z==CharCategory.Space&&(z=vt),z!=vt)return!1;if(z==CharCategory.Word)if(He.toLowerCase()==He){if(!E&&pe)return!1;$e=!0}else if($e){if(E)return!1;de=!0}else{if(pe&&E&&Z(ct=i.state.sliceDoc(B,B+1))==CharCategory.Word&&ct.toLowerCase()==ct)return!1;pe=!0}return ie++,!0},ft=i.moveByChar(b,E,He=>(De(He),De));if(Pt&&z==CharCategory.Word&&ft.from==b.from+ie*(E?1:-1)){let He=Math.min(b.head,ft.head),vt=Math.max(b.head,ft.head),ct=i.state.sliceDoc(He,vt);if(ct.length>1&&/[\u4E00-\uffff]/.test(ct)){let bt=Array.from(Pt.segment(ct));if(bt.length>1)return E?EditorSelection.cursor(b.head+bt[1].index,-1):EditorSelection.cursor(ft.head+bt[bt.length-1].index,1)}}return ft}function Tt(i,b){return Bt(i,E=>E.empty?qt(i,E,b):nn(E,b))}const Ht=i=>Tt(i,!0),Gt=i=>Tt(i,!1);function xt(i,b,E){if(b.type.prop(E))return!0;let Z=b.to-b.from;return Z&&(Z>2||/[^\s,.;:]/.test(i.sliceDoc(b.from,b.to)))||b.firstChild}function Kt(i,b,E){let Z=(0,m.qz)(i).resolveInner(b.head),z=E?ce.md.closedBy:ce.md.openedBy;for(let pe=b.head;;){let $e=E?Z.childAfter(pe):Z.childBefore(pe);if(!$e)break;xt(i,$e,z)?Z=$e:pe=E?$e.to:$e.from}let B=Z.type.prop(z),ie,de;return B&&(ie=E?(0,m.Um)(i,Z.from,1):(0,m.Um)(i,Z.to,-1))&&ie.matched?de=E?ie.end.to:ie.end.from:de=E?Z.to:Z.from,w.jT.cursor(de,E?-1:1)}const Jt=i=>Bt(i,b=>Kt(i.state,b,!tn(i))),en=i=>Bt(i,b=>Kt(i.state,b,tn(i)));function _t(i,b){return Bt(i,E=>{if(!E.empty)return nn(E,b);let Z=i.moveVertically(E,b);return Z.head!=E.head?Z:i.moveToLineBoundary(E,b)})}const On=i=>_t(i,!1),dn=i=>_t(i,!0);function Ln(i){let b=i.scrollDOM.clientHeightie.empty?i.moveVertically(ie,b,E.height):nn(ie,b));if(z.eq(Z.selection))return!1;let B;if(E.selfScroll){let ie=i.coordsAtPos(Z.selection.main.head),de=i.scrollDOM.getBoundingClientRect(),pe=de.top+E.marginTop,$e=de.bottom-E.marginBottom;ie&&ie.top>pe&&ie.bottom<$e&&(B=S.tk.scrollIntoView(z.main.head,{y:"start",yMargin:ie.top-pe}))}return i.dispatch(Yt(Z,z),{effects:B}),!0}const vn=i=>En(i,!1),In=i=>En(i,!0);function Dn(i,b,E){let Z=i.lineBlockAt(b.head),z=i.moveToLineBoundary(b,E);if(z.head==b.head&&z.head!=(E?Z.to:Z.from)&&(z=i.moveToLineBoundary(b,E,!1)),!E&&z.head==Z.from&&Z.length){let B=/^\s*/.exec(i.state.sliceDoc(Z.from,Math.min(Z.from+100,Z.to)))[0].length;B&&b.head!=Z.from+B&&(z=w.jT.cursor(Z.from+B))}return z}const Jn=i=>Bt(i,b=>Dn(i,b,!0)),li=i=>Bt(i,b=>Dn(i,b,!1)),Kn=i=>Bt(i,b=>Dn(i,b,!tn(i))),bi=i=>Bt(i,b=>Dn(i,b,tn(i))),Rn=i=>Bt(i,b=>w.jT.cursor(i.lineBlockAt(b.head).from,1)),yi=i=>Bt(i,b=>w.jT.cursor(i.lineBlockAt(b.head).to,-1));function di(i,b,E){let Z=!1,z=Lt(i.selection,B=>{let ie=(0,m.Um)(i,B.head,-1)||(0,m.Um)(i,B.head,1)||B.head>0&&(0,m.Um)(i,B.head-1,1)||B.headdi(i,b,!1),ci=({state:i,dispatch:b})=>di(i,b,!0);function Un(i,b){let E=Lt(i.state.selection,Z=>{let z=b(Z);return w.jT.range(Z.anchor,z.head,z.goalColumn,z.bidiLevel||void 0)});return E.eq(i.state.selection)?!1:(i.dispatch(Yt(i.state,E)),!0)}function ui(i,b){return Un(i,E=>i.moveByChar(E,b))}const gi=i=>ui(i,!tn(i)),ue=i=>ui(i,tn(i)),h=i=>ui(i,!0),c=i=>ui(i,!1);function v(i,b){return Un(i,E=>i.moveByGroup(E,b))}const Q=i=>v(i,!tn(i)),X=i=>v(i,tn(i)),M=i=>v(i,!0),fe=i=>v(i,!1);function Pe(i,b){return Un(i,E=>qt(i,E,b))}const Fe=i=>Pe(i,!0),pt=i=>Pe(i,!1),Zt=i=>Un(i,b=>Kt(i.state,b,!tn(i))),F=i=>Un(i,b=>Kt(i.state,b,tn(i)));function P(i,b){return Un(i,E=>i.moveVertically(E,b))}const Y=i=>P(i,!1),he=i=>P(i,!0);function le(i,b){return Un(i,E=>i.moveVertically(E,b,Ln(i).height))}const je=i=>le(i,!1),We=i=>le(i,!0),et=i=>Un(i,b=>Dn(i,b,!0)),at=i=>Un(i,b=>Dn(i,b,!1)),O=i=>Un(i,b=>Dn(i,b,!tn(i))),g=i=>Un(i,b=>Dn(i,b,tn(i))),C=i=>Un(i,b=>w.jT.cursor(i.lineBlockAt(b.head).from)),j=i=>Un(i,b=>w.jT.cursor(i.lineBlockAt(b.head).to)),ee=({state:i,dispatch:b})=>(b(Yt(i,{anchor:0})),!0),Ae=({state:i,dispatch:b})=>(b(Yt(i,{anchor:i.doc.length})),!0),_e=({state:i,dispatch:b})=>(b(Yt(i,{anchor:i.selection.main.anchor,head:0})),!0),st=({state:i,dispatch:b})=>(b(Yt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),ht=({state:i,dispatch:b})=>(b(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),kt=({state:i,dispatch:b})=>{let E=cn(i).map(({from:Z,to:z})=>w.jT.range(Z,Math.min(z+1,i.doc.length)));return b(i.update({selection:w.jT.create(E),userEvent:"select"})),!0},Dt=({state:i,dispatch:b})=>{let E=Lt(i.selection,Z=>{var z;let B=(0,m.qz)(i).resolveStack(Z.from,1);for(let ie=B;ie;ie=ie.next){let{node:de}=ie;if((de.from=Z.to||de.to>Z.to&&de.from<=Z.from)&&((z=de.parent)===null||z===void 0?void 0:z.parent))return w.jT.range(de.to,de.from)}return Z});return b(Yt(i,E)),!0},un=({state:i,dispatch:b})=>{let E=i.selection,Z=null;return E.ranges.length>1?Z=w.jT.create([E.main]):E.main.empty||(Z=w.jT.create([w.jT.cursor(E.main.head)])),Z?(b(Yt(i,Z)),!0):!1};function Ft(i,b){if(i.state.readOnly)return!1;let E="delete.selection",{state:Z}=i,z=Z.changeByRange(B=>{let{from:ie,to:de}=B;if(ie==de){let pe=b(B);peie&&(E="delete.forward",pe=$n(i,pe,!0)),ie=Math.min(ie,pe),de=Math.max(de,pe)}else ie=$n(i,ie,!1),de=$n(i,de,!0);return ie==de?{range:B}:{changes:{from:ie,to:de},range:w.jT.cursor(ie,iez(i)))Z.between(b,b,(z,B)=>{zb&&(b=E?B:z)});return b}const Wn=(i,b)=>Ft(i,E=>{let Z=E.from,{state:z}=i,B=z.doc.lineAt(Z),ie,de;if(!b&&Z>B.from&&ZWn(i,!1),ti=i=>Wn(i,!0),J=(i,b)=>Ft(i,E=>{let Z=E.head,{state:z}=i,B=z.doc.lineAt(Z),ie=z.charCategorizer(Z);for(let de=null;;){if(Z==(b?B.to:B.from)){Z==E.head&&B.number!=(b?z.doc.lines:1)&&(Z+=b?1:-1);break}let pe=(0,w.cp)(B.text,Z-B.from,b)+B.from,$e=B.text.slice(Math.min(Z,pe)-B.from,Math.max(Z,pe)-B.from),De=ie($e);if(de!=null&&De!=de)break;($e!=" "||Z!=E.head)&&(de=De),Z=pe}return Z}),k=i=>J(i,!1),L=i=>J(i,!0),se=i=>Ft(i,b=>{let E=i.lineBlockAt(b.head).to;return b.headFt(i,b=>{let E=i.lineBlockAt(b.head).from;return b.head>E?E:Math.max(0,b.head-1)}),Me=i=>Ft(i,b=>{let E=i.moveToLineBoundary(b,!1).head;return b.head>E?E:Math.max(0,b.head-1)}),Be=i=>Ft(i,b=>{let E=i.moveToLineBoundary(b,!0).head;return b.head{if(i.readOnly)return!1;let E=[];for(let Z=0,z="",B=i.doc.iter();;){if(B.next(),B.lineBreak||B.done){let ie=z.search(/\s+$/);if(ie>-1&&E.push({from:Z-(z.length-ie),to:Z}),B.done)break;z=""}else z=B.value;Z+=B.value.length}return E.length?(b(i.update({changes:E,userEvent:"delete"})),!0):!1},St=({state:i,dispatch:b})=>{if(i.readOnly)return!1;let E=i.changeByRange(Z=>({changes:{from:Z.from,to:Z.to,insert:w.xv.of(["",""])},range:w.jT.cursor(Z.from)}));return b(i.update(E,{scrollIntoView:!0,userEvent:"input"})),!0},rn=({state:i,dispatch:b})=>{if(i.readOnly)return!1;let E=i.changeByRange(Z=>{if(!Z.empty||Z.from==0||Z.from==i.doc.length)return{range:Z};let z=Z.from,B=i.doc.lineAt(z),ie=z==B.from?z-1:(0,w.cp)(B.text,z-B.from,!1)+B.from,de=z==B.to?z+1:(0,w.cp)(B.text,z-B.from,!0)+B.from;return{changes:{from:ie,to:de,insert:i.doc.slice(z,de).append(i.doc.slice(ie,z))},range:w.jT.cursor(de)}});return E.changes.empty?!1:(b(i.update(E,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cn(i){let b=[],E=-1;for(let Z of i.selection.ranges){let z=i.doc.lineAt(Z.from),B=i.doc.lineAt(Z.to);if(!Z.empty&&Z.to==B.from&&(B=i.doc.lineAt(Z.to-1)),E>=z.number){let ie=b[b.length-1];ie.to=B.to,ie.ranges.push(Z)}else b.push({from:z.from,to:B.to,ranges:[Z]});E=B.number+1}return b}function Xn(i,b,E){if(i.readOnly)return!1;let Z=[],z=[];for(let B of cn(i)){if(E?B.to==i.doc.length:B.from==0)continue;let ie=i.doc.lineAt(E?B.to+1:B.from-1),de=ie.length+1;if(E){Z.push({from:B.to,to:ie.to},{from:B.from,insert:ie.text+i.lineBreak});for(let pe of B.ranges)z.push(w.jT.range(Math.min(i.doc.length,pe.anchor+de),Math.min(i.doc.length,pe.head+de)))}else{Z.push({from:ie.from,to:B.from},{from:B.to,insert:i.lineBreak+ie.text});for(let pe of B.ranges)z.push(w.jT.range(pe.anchor-de,pe.head-de))}}return Z.length?(b(i.update({changes:Z,scrollIntoView:!0,selection:w.jT.create(z,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}const pi=({state:i,dispatch:b})=>Xn(i,b,!1),fi=({state:i,dispatch:b})=>Xn(i,b,!0);function vi(i,b,E){if(i.readOnly)return!1;let Z=[];for(let z of cn(i))E?Z.push({from:z.from,insert:i.doc.slice(z.from,z.to)+i.lineBreak}):Z.push({from:z.to,insert:i.lineBreak+i.doc.slice(z.from,z.to)});return b(i.update({changes:Z,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ri=({state:i,dispatch:b})=>vi(i,b,!1),Qr=({state:i,dispatch:b})=>vi(i,b,!0),Di=i=>{if(i.state.readOnly)return!1;let{state:b}=i,E=b.changes(cn(b).map(({from:z,to:B})=>(z>0?z--:Bi.moveVertically(z,!0)).map(E);return i.dispatch({changes:E,selection:Z,scrollIntoView:!0,userEvent:"delete.line"}),!0},il=({state:i,dispatch:b})=>(b(i.update(i.replaceSelection(i.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0);function Nr(i,b){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(b-1,b+1)))return{from:b,to:b};let E=(0,m.qz)(i).resolveInner(b),Z=E.childBefore(b),z=E.childAfter(b),B;return Z&&z&&Z.to<=b&&z.from>=b&&(B=Z.type.prop(ce.md.closedBy))&&B.indexOf(z.name)>-1&&i.doc.lineAt(Z.to).from==i.doc.lineAt(z.from).from&&!/\S/.test(i.sliceDoc(Z.to,z.from))?{from:Z.to,to:z.from}:null}const Js=Ui(!1),Ks=Ui(!0);function Ui(i){return({state:b,dispatch:E})=>{if(b.readOnly)return!1;let Z=b.changeByRange(z=>{let{from:B,to:ie}=z,de=b.doc.lineAt(B),pe=!i&&B==ie&&Nr(b,B);i&&(B=ie=(ie<=de.to?de:b.doc.lineAt(ie)).to);let $e=new m.Gn(b,{simulateBreak:B,simulateDoubleBreak:!!pe}),De=(0,m.K0)($e,B);for(De==null&&(De=(0,w.IS)(/^\s*/.exec(b.doc.lineAt(B).text)[0],b.tabSize));iede.from&&B{let z=[];for(let ie=Z.from;ie<=Z.to;){let de=i.doc.lineAt(ie);de.number>E&&(Z.empty||Z.to>de.from)&&(b(de,z,Z),E=de.number),ie=de.to+1}let B=i.changes(z);return{changes:z,range:w.jT.range(B.mapPos(Z.anchor,1),B.mapPos(Z.head,1))}})}const _s=({state:i,dispatch:b})=>{if(i.readOnly)return!1;let E=Object.create(null),Z=new m.Gn(i,{overrideIndentation:B=>{let ie=E[B];return ie==null?-1:ie}}),z=Gi(i,(B,ie,de)=>{let pe=(0,m.K0)(Z,B.from);if(pe==null)return;/\S/.test(B.text)||(pe=0);let $e=/^\s*/.exec(B.text)[0],De=(0,m.SS)(i,pe);($e!=De||de.fromi.readOnly?!1:(b(i.update(Gi(i,(E,Z)=>{Z.push({from:E.from,insert:i.facet(m.c)})}),{userEvent:"input.indent"})),!0),Fr=({state:i,dispatch:b})=>i.readOnly?!1:(b(i.update(Gi(i,(E,Z)=>{let z=/^\s*/.exec(E.text)[0];if(!z)return;let B=(0,w.IS)(z,i.tabSize),ie=0,de=(0,m.SS)(i,Math.max(0,B-(0,m.y1)(i)));for(;iei.selection.ranges.some(E=>!E.empty)?hr({state:i,dispatch:b}):(b(i.update(i.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),to=[{key:"Ctrl-b",run:gn,shift:gi,preventDefault:!0},{key:"Ctrl-f",run:Le,shift:ue},{key:"Ctrl-p",run:On,shift:Y},{key:"Ctrl-n",run:dn,shift:he},{key:"Ctrl-a",run:Rn,shift:C},{key:"Ctrl-e",run:yi,shift:j},{key:"Ctrl-d",run:ti},{key:"Ctrl-h",run:Mn},{key:"Ctrl-k",run:se},{key:"Ctrl-Alt-h",run:k},{key:"Ctrl-o",run:St},{key:"Ctrl-t",run:rn},{key:"Ctrl-v",run:In}],Ur=[{key:"ArrowLeft",run:gn,shift:gi,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Oe,shift:Q,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Kn,shift:O,preventDefault:!0},{key:"ArrowRight",run:Le,shift:ue,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Ge,shift:X,preventDefault:!0},{mac:"Cmd-ArrowRight",run:bi,shift:g,preventDefault:!0},{key:"ArrowUp",run:On,shift:Y,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ee,shift:_e},{mac:"Ctrl-ArrowUp",run:vn,shift:je},{key:"ArrowDown",run:dn,shift:he,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ae,shift:st},{mac:"Ctrl-ArrowDown",run:In,shift:We},{key:"PageUp",run:vn,shift:je},{key:"PageDown",run:In,shift:We},{key:"Home",run:li,shift:at,preventDefault:!0},{key:"Mod-Home",run:ee,shift:_e},{key:"End",run:Jn,shift:et,preventDefault:!0},{key:"Mod-End",run:Ae,shift:st},{key:"Enter",run:Js},{key:"Mod-a",run:ht},{key:"Backspace",run:Mn,shift:Mn},{key:"Delete",run:ti},{key:"Mod-Backspace",mac:"Alt-Backspace",run:k},{key:"Mod-Delete",mac:"Alt-Delete",run:L},{mac:"Mod-Backspace",run:Me},{mac:"Mod-Delete",run:Be}].concat(to.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),cr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Jt,shift:Zt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:en,shift:F},{key:"Alt-ArrowUp",run:pi},{key:"Shift-Alt-ArrowUp",run:Ri},{key:"Alt-ArrowDown",run:fi},{key:"Shift-Alt-ArrowDown",run:Qr},{key:"Escape",run:un},{key:"Mod-Enter",run:Ks},{key:"Alt-l",mac:"Ctrl-l",run:kt},{key:"Mod-i",run:Dt,preventDefault:!0},{key:"Mod-[",run:Fr},{key:"Mod-]",run:hr},{key:"Mod-Alt-\\",run:_s},{key:"Shift-Mod-k",run:Di},{key:"Shift-Mod-\\",run:ai},{key:"Mod-/",run:N},{key:"Alt-A",run:ke}].concat(Ur),ur={key:"Tab",run:hr,shift:Fr};var Mt=o(79653),no=o(1065);/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */var Li=Object.assign||function(i){for(var b=1;b1&&arguments[1]!==void 0?arguments[1]:{},Z=window.Promise||function(fn){function an(){}fn(an,an)},z=function(fn){var an=fn.target;if(an===Nn){ct();return}Ut.indexOf(an)!==-1&&bt({target:an})},B=function(){if(!(Qn||!Wt.original)){var fn=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(Fn-fn)>xn.scrollOffset&&setTimeout(ct,150)}},ie=function(fn){var an=fn.key||fn.keyCode;(an==="Escape"||an==="Esc"||an===27)&&ct()},de=function(){var fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},an=fn;if(fn.background&&(Nn.style.background=fn.background),fn.container&&fn.container instanceof Object&&(an.container=Li({},xn.container,fn.container)),fn.template){var Zn=dr(fn.template)?fn.template:document.querySelector(fn.template);an.template=Zn}return xn=Li({},xn,an),Ut.forEach(function(Yn){Yn.dispatchEvent(Xi("medium-zoom:update",{detail:{zoom:Sn}}))}),Sn},pe=function(){var fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i(Li({},xn,fn))},$e=function(){for(var fn=arguments.length,an=Array(fn),Zn=0;Zn0?an.reduce(function(ln,Vn){return[].concat(ln,wi(Vn))},[]):Ut;return Yn.forEach(function(ln){ln.classList.remove("medium-zoom-image"),ln.dispatchEvent(Xi("medium-zoom:detach",{detail:{zoom:Sn}}))}),Ut=Ut.filter(function(ln){return Yn.indexOf(ln)===-1}),Sn},ft=function(fn,an){var Zn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ut.forEach(function(Yn){Yn.addEventListener("medium-zoom:"+fn,an,Zn)}),pn.push({type:"medium-zoom:"+fn,listener:an,options:Zn}),Sn},He=function(fn,an){var Zn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ut.forEach(function(Yn){Yn.removeEventListener("medium-zoom:"+fn,an,Zn)}),pn=pn.filter(function(Yn){return!(Yn.type==="medium-zoom:"+fn&&Yn.listener.toString()===an.toString())}),Sn},vt=function(){var fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},an=fn.target,Zn=function(){var ln={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},Vn=void 0,qn=void 0;if(xn.container)if(xn.container instanceof Object)ln=Li({},ln,xn.container),Vn=ln.width-ln.left-ln.right-xn.margin*2,qn=ln.height-ln.top-ln.bottom-xn.margin*2;else{var ei=dr(xn.container)?xn.container:document.querySelector(xn.container),kn=ei.getBoundingClientRect(),Tn=kn.width,ni=kn.height,oi=kn.left,Hn=kn.top;ln=Li({},ln,{width:Tn,height:ni,left:oi,top:Hn})}Vn=Vn||ln.width-xn.margin*2,qn=qn||ln.height-xn.margin*2;var _n=Wt.zoomedHd||Wt.original,Pi=ki(_n)?Vn:_n.naturalWidth||Vn,Si=ki(_n)?qn:_n.naturalHeight||qn,Qi=_n.getBoundingClientRect(),Ii=Qi.top,Cr=Qi.left,Ti=Qi.width,ji=Qi.height,Vi=Math.min(Math.max(Ti,Pi),Vn)/Ti,Pr=Math.min(Math.max(ji,Si),qn)/ji,nr=Math.min(Vi,Pr),ir=(-Cr+(Vn-Ti)/2+xn.margin+ln.left)/nr,zr=(-Ii+(qn-ji)/2+xn.margin+ln.top)/nr,rr="scale("+nr+") translate3d("+ir+"px, "+zr+"px, 0)";Wt.zoomed.style.transform=rr,Wt.zoomedHd&&(Wt.zoomedHd.style.transform=rr)};return new Z(function(Yn){if(an&&Ut.indexOf(an)===-1){Yn(Sn);return}var ln=function Tn(){Qn=!1,Wt.zoomed.removeEventListener("transitionend",Tn),Wt.original.dispatchEvent(Xi("medium-zoom:opened",{detail:{zoom:Sn}})),Yn(Sn)};if(Wt.zoomed){Yn(Sn);return}if(an)Wt.original=an;else if(Ut.length>0){var Vn=Ut;Wt.original=Vn[0]}else{Yn(Sn);return}if(Wt.original.dispatchEvent(Xi("medium-zoom:open",{detail:{zoom:Sn}})),Fn=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,Qn=!0,Wt.zoomed=ro(Wt.original),document.body.appendChild(Nn),xn.template){var qn=dr(xn.template)?xn.template:document.querySelector(xn.template);Wt.template=document.createElement("div"),Wt.template.appendChild(qn.content.cloneNode(!0)),document.body.appendChild(Wt.template)}if(Wt.original.parentElement&&Wt.original.parentElement.tagName==="PICTURE"&&Wt.original.currentSrc&&(Wt.zoomed.src=Wt.original.currentSrc),document.body.appendChild(Wt.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),Wt.original.classList.add("medium-zoom-image--hidden"),Wt.zoomed.classList.add("medium-zoom-image--opened"),Wt.zoomed.addEventListener("click",ct),Wt.zoomed.addEventListener("transitionend",ln),Wt.original.getAttribute("data-zoom-src")){Wt.zoomedHd=Wt.zoomed.cloneNode(),Wt.zoomedHd.removeAttribute("srcset"),Wt.zoomedHd.removeAttribute("sizes"),Wt.zoomedHd.removeAttribute("loading"),Wt.zoomedHd.src=Wt.zoomed.getAttribute("data-zoom-src"),Wt.zoomedHd.onerror=function(){clearInterval(ei),console.warn("Unable to reach the zoom image target "+Wt.zoomedHd.src),Wt.zoomedHd=null,Zn()};var ei=setInterval(function(){Wt.zoomedHd.complete&&(clearInterval(ei),Wt.zoomedHd.classList.add("medium-zoom-image--opened"),Wt.zoomedHd.addEventListener("click",ct),document.body.appendChild(Wt.zoomedHd),Zn())},10)}else if(Wt.original.hasAttribute("srcset")){Wt.zoomedHd=Wt.zoomed.cloneNode(),Wt.zoomedHd.removeAttribute("sizes"),Wt.zoomedHd.removeAttribute("loading");var kn=Wt.zoomedHd.addEventListener("load",function(){Wt.zoomedHd.removeEventListener("load",kn),Wt.zoomedHd.classList.add("medium-zoom-image--opened"),Wt.zoomedHd.addEventListener("click",ct),document.body.appendChild(Wt.zoomedHd),Zn()})}else Zn()})},ct=function(){return new Z(function(fn){if(Qn||!Wt.original){fn(Sn);return}var an=function Zn(){Wt.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(Wt.zoomed),Wt.zoomedHd&&document.body.removeChild(Wt.zoomedHd),document.body.removeChild(Nn),Wt.zoomed.classList.remove("medium-zoom-image--opened"),Wt.template&&document.body.removeChild(Wt.template),Qn=!1,Wt.zoomed.removeEventListener("transitionend",Zn),Wt.original.dispatchEvent(Xi("medium-zoom:closed",{detail:{zoom:Sn}})),Wt.original=null,Wt.zoomed=null,Wt.zoomedHd=null,Wt.template=null,fn(Sn)};Qn=!0,document.body.classList.remove("medium-zoom--opened"),Wt.zoomed.style.transform="",Wt.zoomedHd&&(Wt.zoomedHd.style.transform=""),Wt.template&&(Wt.template.style.transition="opacity 150ms",Wt.template.style.opacity=0),Wt.original.dispatchEvent(Xi("medium-zoom:close",{detail:{zoom:Sn}})),Wt.zoomed.addEventListener("transitionend",an)})},bt=function(){var fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},an=fn.target;return Wt.original?ct():vt({target:an})},At=function(){return xn},jt=function(){return Ut},Qt=function(){return Wt.original},Ut=[],pn=[],Qn=!1,Fn=0,xn=E,Wt={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(b)==="[object Object]"?xn=b:(b||typeof b=="string")&&$e(b),xn=Li({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},xn);var Nn=Gr(xn.background);document.addEventListener("click",z),document.addEventListener("keyup",ie),document.addEventListener("scroll",B),window.addEventListener("resize",ct);var Sn={open:vt,close:ct,toggle:bt,update:de,clone:pe,attach:$e,detach:De,on:ft,off:He,getOptions:At,getImages:jt,getZoomedImage:Qt};return Sn};function Hr(i,b){b===void 0&&(b={});var E=b.insertAt;if(!(!i||typeof document=="undefined")){var Z=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css",E==="top"&&Z.firstChild?Z.insertBefore(z,Z.firstChild):Z.appendChild(z),z.styleSheet?z.styleSheet.cssText=i:z.appendChild(document.createTextNode(i))}}var Jr=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Hr(Jr);var so=qr,Kr=o(20640),oo=o(9980),_r=o(40617),es=o(84651),ts=o(67754),ns=o(97337),lo=Object.defineProperty,ao=(i,b,E)=>b in i?lo(i,b,{enumerable:!0,configurable:!0,writable:!0,value:E}):i[b]=E,Ei=(i,b,E)=>(ao(i,typeof b!="symbol"?b+"":b,E),E);const ho=(i,b)=>{const E=Z=>{const z=i.parentElement||document.body,B=z.offsetWidth,ie=z.offsetHeight,de=document.documentElement.clientWidth,pe=document.documentElement.clientHeight,$e=Z.offsetX,De=Z.offsetY,ft=vt=>{let ct=vt.x+document.body.scrollLeft-document.body.clientLeft-$e,bt=vt.y+document.body.scrollTop-document.body.clientTop-De;ct=ct<1?1:ct{document.removeEventListener("mousemove",ft),document.removeEventListener("mouseup",He)};document.addEventListener("mouseup",He)};return i.addEventListener("mousedown",E),()=>{i.removeEventListener("mousedown",E)}},Ci=(i,b="")=>{const E=document.getElementById(i.id),Z=i.onload;i.onload=null;const z=function(B){typeof Z=="function"&&Z.bind(this)(B),i.removeEventListener("load",z)};E?b!==""&&(E.addEventListener("load",z),Reflect.get(window,b)&&E.dispatchEvent(new Event("load"))):(i.addEventListener("load",z),document.head.appendChild(i))},Tr=(0,a.Ds)((i,b,E)=>{const Z=document.getElementById(i);Z&&Z.setAttribute(b,E)},10),is=(i,b)=>{const{modelValue:E}=i,{editorId:Z}=b,[z,B]=(0,f.useState)({buildFinished:!1,html:""});(0,f.useEffect)(()=>{const ie=de=>{B(()=>({buildFinished:!0,html:de}))};return p.b.on(Z,{name:p.B,callback:ie}),()=>{p.b.remove(Z,p.B,ie)}},[]),(0,f.useEffect)(()=>{const ie=()=>{if(i.onSave){const de=new Promise(pe=>{if(z.buildFinished)pe(z.html);else{const $e=De=>{pe(De),p.b.remove(Z,p.B,$e)};p.b.on(Z,{name:p.B,callback:$e})}});i.onSave(i.modelValue,de)}};return p.b.on(Z,{name:p.O,callback:ie}),()=>{p.b.remove(Z,p.O,ie)}},[E,i,z.buildFinished,z.html]),(0,f.useEffect)(()=>{B(ie=>Nt(Nt({},ie),{buildFinished:!1}))},[E])},rs=i=>{var b,E,Z,z,B,ie;const{noPrettier:de,noUploadImg:pe}=i,{editorExtensions:$e}=d.f,De=de||!!((E=(b=d.f.editorExtensions)==null?void 0:b.prettier)!=null&&E.prettierInstance),ft=de||!!((z=(Z=d.f.editorExtensions)==null?void 0:Z.prettier)!=null&&z.parserMarkdownInstance),He=pe||!!((ie=(B=d.f.editorExtensions)==null?void 0:B.cropper)!=null&&ie.instance);(0,f.useEffect)(()=>{var vt,ct,bt,At;const jt=document.createElement("script"),Qt=document.createElement("script");jt.src=((vt=$e==null?void 0:$e.prettier)==null?void 0:vt.standaloneJs)||d.j.main,jt.id=`${d.p}-prettier`,Qt.src=((ct=$e==null?void 0:$e.prettier)==null?void 0:ct.parserMarkdownJs)||d.j.markdown,Qt.id=`${d.p}-prettierMD`;const Ut=document.createElement("link");Ut.rel="stylesheet",Ut.href=((bt=$e==null?void 0:$e.cropper)==null?void 0:bt.css)||d.k.css,Ut.id=`${d.p}-cropperCss`;const pn=document.createElement("script");pn.src=((At=$e==null?void 0:$e.cropper)==null?void 0:At.js)||d.k.js,pn.id=`${d.p}-cropper`,He||(Ci(Ut),Ci(pn)),De||Ci(jt),ft||Ci(Qt)},[]),Ar(i)},Ar=({noIconfont:i})=>{(0,f.useEffect)(()=>{var b,E;if(!i)if(d.f.iconfontType==="svg"){const Z=document.createElement("script");Z.src=((b=d.f.editorExtensions)==null?void 0:b.iconfont)||d.a,Z.id=`${d.p}-icon`,Ci(Z)}else{const Z=document.createElement("link");Z.rel="stylesheet",Z.href=((E=d.f.editorExtensions)==null?void 0:E.iconfontClass)||d.i,Z.id=`${d.p}-icon-class`,Ci(Z)}},[])},ss=(i,b)=>{(0,f.useEffect)(()=>(p.b.on(i,{name:p.E,callback:b}),()=>{p.b.remove(i,p.E,b)}),[b])},co=(i,b)=>{const{editorId:E}=b;(0,f.useEffect)(()=>{const Z=(z,B)=>{const ie=de=>{p.b.emit(E,p.f,"image",{desc:"",urls:de}),B&&B()};i.onUploadImg&&i.onUploadImg(z,ie)};return p.b.on(E,{name:p.U,callback:Z}),()=>{p.b.remove(E,p.U,Z)}},[i.onUploadImg])},os=(i,b)=>{const{toolbars:E=d.b,toolbarsExclude:Z=[]}=i,{editorId:z}=b,[B,ie]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{p.b.on(z,{name:p.C,callback:de=>{ie(de===void 0?pe=>!pe:de)}})},[]),(0,f.useMemo)(()=>!Z.includes("catalog")&&E.includes("catalog")&&B,[B,E,Z])};let Zr="";const Er=i=>{const{theme:b=d.e.theme,preview:E=d.e.preview,htmlPreview:Z=d.e.htmlPreview,pageFullscreen:z=d.e.pageFullscreen,previewTheme:B=d.e.previewTheme,codeTheme:ie=d.e.codeTheme,language:de=d.e.language,codeStyleReverse:pe=d.e.codeStyleReverse,codeStyleReverseList:$e=d.e.codeStyleReverseList}=i,De=(0,f.useMemo)(()=>{var bt,At;const jt=(At=(bt=d.f)==null?void 0:bt.editorExtensions)==null?void 0:At.highlight,Qt=Nt(Nt({},d.g),jt==null?void 0:jt.css),Ut=pe&&$e.includes(B)?"dark":b;return{js:(jt==null?void 0:jt.js)||d.h,css:Qt[ie]?Qt[ie][Ut]:d.g.atom[Ut]}},[pe,$e,B,b,ie]),ft=(0,f.useMemo)(()=>{var bt,At;const jt=Nt(Nt({},d.s),(At=(bt=d.f)==null?void 0:bt.editorConfig)==null?void 0:At.languageUserDefined);return jt[de]?jt[de]:d.s["zh-CN"]},[de]),[He,vt]=(0,f.useState)({pageFullscreen:z,fullscreen:!1,preview:E,htmlPreview:E?!1:Z}),ct=(0,f.useCallback)((bt,At)=>{vt(jt=>{const Qt=Nt(Nt({},jt),{[bt]:At===void 0?!jt[bt]:At});return bt==="preview"&&Qt.preview?Qt.htmlPreview=!1:bt==="htmlPreview"&&Qt.htmlPreview&&(Qt.preview=!1),Qt})},[]);return(0,f.useEffect)(()=>{Zr=document.body.style.overflow},[]),(0,f.useEffect)(()=>{He.pageFullscreen||He.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=Zr},[He.pageFullscreen,He.fullscreen]),[De,ft,He,ct]},Ai=(i,b,E,Z,z,B)=>{const{editorId:ie}=b;(0,f.useEffect)(()=>{p.b.emit(ie,p.P,Z.pageFullscreen)},[Z.pageFullscreen]),(0,f.useEffect)(()=>{p.b.emit(ie,p.F,Z.fullscreen)},[Z.fullscreen]),(0,f.useEffect)(()=>{p.b.emit(ie,p.a,Z.preview)},[Z.preview]),(0,f.useEffect)(()=>{p.b.emit(ie,p.H,Z.htmlPreview)},[Z.htmlPreview]),(0,f.useEffect)(()=>{p.b.emit(ie,p.d,E)},[E]),(0,f.useImperativeHandle)(i,()=>({on(de,pe){switch(de){case"pageFullscreen":{p.b.on(ie,{name:p.P,callback($e){pe($e)}});break}case"fullscreen":{p.b.on(ie,{name:p.F,callback($e){pe($e)}});break}case"preview":{p.b.on(ie,{name:p.a,callback($e){pe($e)}});break}case"htmlPreview":{p.b.on(ie,{name:p.H,callback($e){pe($e)}});break}case"catalog":{p.b.on(ie,{name:p.d,callback($e){pe($e)}});break}}},togglePageFullscreen(de){z("pageFullscreen",de)},toggleFullscreen(de){p.b.emit(ie,p.e,de)},togglePreview(de){z("preview",de)},toggleHtmlPreview(de){z("htmlPreview",de)},toggleCatalog(de){p.b.emit(ie,p.C,de)},triggerSave(){p.b.emit(ie,p.O)},insert(de){p.b.emit(ie,p.f,"universal",{generate:de})},focus(de){var pe;(pe=B.current)==null||pe.focus(de)},rerender(){p.b.emit(ie,p.R)},getSelectedText(){var de;return(de=B.current)==null?void 0:de.getSelectedText()},resetHistory(){var de;(de=B.current)==null||de.resetHistory()}}),[z])},Gn=()=>(0,l.j)("div",{className:`${d.p}-divider`}),qi=`${d.p}-dropdown-hidden`,ri=i=>{const{relative:b="html"}=i,[E,Z]=(0,f.useState)({overlayClass:qi,overlayStyle:{}}),z=(0,f.useRef)({triggerHover:!1,overlayHover:!1}),B=(0,f.useRef)(null),ie=(0,f.useRef)(null),de=(0,f.useCallback)(()=>{var bt;z.current.triggerHover=!0;const At=B.current,jt=ie.current;if(!At||!jt)return;const Qt=At.getBoundingClientRect(),Ut=At.offsetTop,pn=At.offsetLeft,Qn=Qt.height,Fn=Qt.width,xn=((bt=document.querySelector(b))==null?void 0:bt.scrollLeft)||0;Z(Wt=>Nt(Nt({},Wt),{overlayStyle:{top:Ut+Qn+"px",left:pn-jt.offsetWidth/2+Fn/2-xn+"px"}})),i.onChange(!0)},[i,b]),pe=()=>{z.current.overlayHover=!0};(0,f.useEffect)(()=>{i.visible?Z(bt=>Nt(Nt({},bt),{overlayClass:""})):Z(bt=>Nt(Nt({},bt),{overlayClass:qi}))},[i.visible]);const $e=(0,f.useRef)(-1),De=(0,f.useCallback)(bt=>{B.current===bt.target?z.current.triggerHover=!1:z.current.overlayHover=!1,clearTimeout($e.current),$e.current=window.setTimeout(()=>{!z.current.overlayHover&&!z.current.triggerHover&&i.onChange(!1)},10)},[i]);(0,f.useEffect)(()=>{var bt,At,jt,Qt;return(bt=B.current)==null||bt.addEventListener("mouseenter",de),(At=B.current)==null||At.addEventListener("mouseleave",De),(jt=ie.current)==null||jt.addEventListener("mouseenter",pe),(Qt=ie.current)==null||Qt.addEventListener("mouseleave",De),()=>{var Ut,pn,Qn,Fn;(Ut=B.current)==null||Ut.removeEventListener("mouseenter",de),(pn=B.current)==null||pn.removeEventListener("mouseleave",De),(Qn=ie.current)==null||Qn.removeEventListener("mouseenter",pe),(Fn=ie.current)==null||Fn.removeEventListener("mouseleave",De)}},[De,de]);const ft=i.children,He=i.overlay,vt=(0,f.cloneElement)(ft,{ref:B}),ct=(0,l.j)("div",{className:`${d.p}-dropdown ${E.overlayClass}`,style:E.overlayStyle,ref:ie,children:(0,l.j)("div",{className:`${d.p}-dropdown-overlay`,children:He instanceof Array?He[0]:He})});return(0,l.a)(l.F,{children:[vt,ct]})},ls=i=>d.f.iconfontType==="svg"?(0,l.j)("svg",{className:`${d.p}-icon`,"aria-hidden":"true",children:(0,l.j)("use",{xlinkHref:`#${d.p}-icon-${i.name}`})}):(0,l.j)("i",{className:`${d.p}-iconfont ${d.p}-icon-${i.name}`}),xi=ls,Pn=i=>{const{customIcon:b}=(0,f.useContext)(si),E=b[i.name];if(typeof E=="object"){const Z=E.component;return typeof Z=="function"?(0,l.j)(Z,Nt({},E.props)):(0,l.j)("span",{dangerouslySetInnerHTML:{__html:E.component}})}return(0,l.j)(xi,{name:i.name})},as=i=>{const{onClose:b=()=>{},onAdjust:E=()=>{},style:Z={}}=i,[z,B]=(0,f.useState)(i.visible),[ie,de]=(0,f.useState)([`${d.p}-modal`]),pe=(0,f.useRef)(null),$e=(0,f.useRef)(null),[De,ft]=(0,f.useState)({initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),He=(0,f.useMemo)(()=>i.isFullscreen?{width:"100%",height:"100%"}:{width:i.width,height:i.height},[i.height,i.isFullscreen,i.width]),[vt,ct]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let bt=()=>{};return i.isFullscreen||(bt=ho($e.current,(At,jt)=>{ft(Qt=>Nt(Nt({},Qt),{initPos:{left:At+"px",top:jt+"px"}}))})),bt},[vt,i.isFullscreen]),(0,f.useEffect)(()=>{if(z){const bt=pe.current.offsetWidth/2,At=pe.current.offsetHeight/2,jt=document.documentElement.clientWidth/2,Qt=document.documentElement.clientHeight/2;ft(Ut=>Nt(Nt({},Ut),{initPos:{left:jt-bt+"px",top:Qt-At+"px"}})),!vt&&ct(!0)}},[vt,z]),(0,f.useEffect)(()=>{const bt=i.visible;bt?(de(()=>[`${d.p}-modal`,"zoom-in"]),B(bt)):vt&&(de(()=>[`${d.p}-modal`,"zoom-out"]),setTimeout(()=>{B(bt)},150))},[vt,i.visible]),(0,l.a)("div",{className:i.className,style:Nt({display:z?"block":"none"},Z),children:[(0,l.j)("div",{className:`${d.p}-modal-mask`,onClick:b}),(0,l.a)("div",{className:ie.join(" "),style:Nt(Nt({},De.initPos),He),ref:pe,children:[(0,l.j)("div",{className:`${d.p}-modal-header`,ref:$e,children:i.title||""}),(0,l.a)("div",{className:`${d.p}-modal-func`,children:[i.showAdjust&&(0,l.j)("div",{className:`${d.p}-modal-adjust`,onClick:bt=>{bt.stopPropagation(),i.isFullscreen?ft(At=>Nt(Nt({},At),{initPos:At.historyPos})):ft(At=>({historyPos:At.initPos,initPos:{left:"0",top:"0"}})),E instanceof Function&&E(!i.isFullscreen)},children:(0,l.j)(Pn,{name:i.isFullscreen?"suoxiao":"fangda"})}),(0,l.j)("div",{className:`${d.p}-modal-close`,onClick:bt=>{bt.stopPropagation(),i.onClose&&i.onClose()},children:(0,l.j)(Pn,{name:"close"})})]}),(0,l.j)("div",{className:`${d.p}-modal-body`,children:i.children})]})]})},hs=i=>{var b,E,Z,z,B;const{editorId:ie,usedLanguageText:de}=(0,f.useContext)(si),pe=(0,f.useMemo)(()=>{var ft,He;switch(i.type){case"link":return(ft=de.linkModalTips)==null?void 0:ft.linkTitle;case"image":return(He=de.linkModalTips)==null?void 0:He.imageTitle;default:return""}},[i.type,de]),[$e,De]=(0,f.useState)({desc:"",url:""});return(0,f.useEffect)(()=>{i.visible||setTimeout(()=>{De({desc:"",url:""})},200)},[i.visible]),(0,f.useMemo)(()=>{var ft,He,vt,ct,bt;return(0,l.a)(as,{title:pe,visible:i.visible,onClose:i.onCancel,children:[(0,l.a)("div",{className:`${d.p}-form-item`,children:[(0,l.j)("label",{className:`${d.p}-label`,htmlFor:`link-desc-${ie}`,children:(ft=de.linkModalTips)==null?void 0:ft.descLabel}),(0,l.j)("input",{placeholder:(He=de.linkModalTips)==null?void 0:He.descLabelPlaceHolder,className:`${d.p}-input`,id:`link-desc-${ie}`,type:"text",value:$e.desc,onChange:At=>{De(jt=>Nt(Nt({},jt),{desc:At.target.value}))}})]}),(0,l.a)("div",{className:`${d.p}-form-item`,children:[(0,l.j)("label",{className:`${d.p}-label`,htmlFor:`link-url-${ie}`,children:(vt=de.linkModalTips)==null?void 0:vt.urlLabel}),(0,l.j)("input",{placeholder:(ct=de.linkModalTips)==null?void 0:ct.urlLabelPlaceHolder,className:`${d.p}-input`,id:`link-url-${ie}`,type:"text",value:$e.url,onChange:At=>{De(jt=>Nt(Nt({},jt),{url:At.target.value}))}})]}),(0,l.j)("div",{className:`${d.p}-form-item`,children:(0,l.j)("button",{className:`${d.p}-btn ${d.p}-btn-row`,type:"button",onClick:()=>{i.onOk($e),De(At=>Nt(Nt({},At),{desc:"",url:""}))},children:(bt=de.linkModalTips)==null?void 0:bt.buttonOK})})]})},[pe,i,(b=de.linkModalTips)==null?void 0:b.descLabel,(E=de.linkModalTips)==null?void 0:E.descLabelPlaceHolder,(Z=de.linkModalTips)==null?void 0:Z.urlLabel,(z=de.linkModalTips)==null?void 0:z.urlLabelPlaceHolder,(B=de.linkModalTips)==null?void 0:B.buttonOK,$e])},uo=hs;let $i=null;const fo=i=>{var b,E,Z,z;const B=(0,f.useContext)(si),{editorId:ie,usedLanguageText:de}=B,pe=(E=(b=d.f.editorExtensions)==null?void 0:b.cropper)==null?void 0:E.instance,$e=(0,f.useRef)(null),De=(0,f.useRef)(null),ft=(0,f.useRef)(null),[He,vt]=(0,f.useState)({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});(0,f.useEffect)(()=>{i.visible&&!He.cropperInited&&(window.Cropper=pe||window.Cropper,$e.current.onchange=()=>{if(!window.Cropper){p.b.emit(ie,p.E,{name:"Cropper",message:"Cropper is undefined"});return}const jt=$e.current.files||[];if((jt==null?void 0:jt.length)>0){const Qt=new FileReader;Qt.onload=Ut=>{vt(pn=>Nt(Nt({},pn),{imgSelected:!0,imgSrc:Ut.target.result}))},Qt.readAsDataURL(jt[0])}})},[i.visible,He.cropperInited]),(0,f.useEffect)(()=>{He.imgSrc&&($i=new window.Cropper(De.current,{viewMode:2,preview:`.${d.p}-clip-preview-target`}))},[He.imgSrc]),(0,f.useEffect)(()=>{var jt;(jt=ft.current)==null||jt.setAttribute("style","")},[He.imgSelected]),(0,f.useEffect)(()=>{var jt;$i==null||$i.destroy(),(jt=ft.current)==null||jt.setAttribute("style",""),De.current&&($i=new window.Cropper(De.current,{viewMode:2,preview:`.${d.p}-clip-preview-target`}))},[He.isFullscreen]);const ct=(0,f.useMemo)(()=>He.isFullscreen?{width:"100%",height:"100%"}:{width:"668px",height:"392px"},[He.isFullscreen]),bt=()=>{$i.clear(),$i.destroy(),$i=null,$e.current.value="",vt(jt=>Nt(Nt({},jt),{imgSrc:"",imgSelected:!1}))},At=(0,f.useCallback)(jt=>{vt(Qt=>Nt(Nt({},Qt),{isFullscreen:jt}))},[]);return(0,f.useMemo)(()=>{var jt,Qt;return(0,l.a)(as,Nt(Nt({className:`${d.p}-modal-clip`,title:(jt=de.clipModalTips)==null?void 0:jt.title,visible:i.visible,onClose:i.onCancel,showAdjust:!0,isFullscreen:He.isFullscreen,onAdjust:At},ct),{children:[(0,l.a)("div",{className:`${d.p}-form-item ${d.p}-clip`,children:[(0,l.j)("div",{className:`${d.p}-clip-main`,children:He.imgSelected?(0,l.a)("div",{className:`${d.p}-clip-cropper`,children:[(0,l.j)("img",{src:He.imgSrc,ref:De,style:{display:"none"},alt:""}),(0,l.j)("div",{className:`${d.p}-clip-delete`,onClick:bt,children:(0,l.j)(Pn,{name:"delete"})})]}):(0,l.j)("div",{className:`${d.p}-clip-upload`,onClick:()=>{$e.current.click()},children:(0,l.j)(Pn,{name:"upload"})})}),(0,l.j)("div",{className:`${d.p}-clip-preview`,children:(0,l.j)("div",{className:`${d.p}-clip-preview-target`,ref:ft})})]}),(0,l.j)("div",{className:`${d.p}-form-item`,children:(0,l.j)("button",{className:`${d.p}-btn`,type:"button",onClick:()=>{if($i){const Ut=$i.getCroppedCanvas();p.b.emit(ie,p.U,[(0,p.g)(Ut.toDataURL("image/png"))],i.onOk),bt()}},children:(Qt=de.linkModalTips)==null?void 0:Qt.buttonOK})}),(0,l.j)("input",{ref:$e,accept:"image/*",type:"file",multiple:!1,style:{display:"none"}})]}))},[(Z=de.clipModalTips)==null?void 0:Z.title,(z=de.linkModalTips)==null?void 0:z.buttonOK,i.visible,i.onCancel,i.onOk,He.isFullscreen,He.imgSelected,He.imgSrc,At,ct])},po=fo,mo=i=>(0,l.a)(l.F,{children:[(0,l.j)(uo,{type:i.type,visible:i.linkVisible,onOk:i.onOk,onCancel:i.onCancel}),(0,l.j)(po,{visible:i.clipVisible,onOk:i.onOk,onCancel:i.onCancel})]}),go=mo,Rr=i=>{const[b,E]=(0,f.useState)({x:-1,y:-1});return(0,l.j)("div",{className:`${d.p}-table-shape`,onMouseLeave:()=>{E({x:-1,y:-1})},children:new Array(i.tableShape[1]).fill("").map((Z,z)=>(0,l.j)("div",{className:`${d.p}-table-shape-row`,children:new Array(i.tableShape[0]).fill("").map((B,ie)=>(0,l.j)("div",{className:`${d.p}-table-shape-col`,onMouseEnter:()=>{E({x:z,y:ie})},onClick:()=>{i.onSelected(b)},children:(0,l.j)("div",{className:[`${d.p}-table-shape-col-default`,z<=b.x&&ie<=b.y&&`${d.p}-table-shape-col-include`].filter(de=>!!de).join(" ")})},`table-shape-col-${ie}`))},`table-shape-row-${z}`))})},Oo=Rr,cs=i=>{var b;const{editorId:E}=(0,f.useContext)(si),Z=(b=d.f.editorExtensions)==null?void 0:b.screenfull;let z=Z==null?void 0:Z.instance;const B=(0,f.useRef)(!1),ie=(0,f.useCallback)(de=>{if(!z){p.b.emit(E,p.E,{name:"fullscreen",message:"fullscreen is undefined"});return}z.isEnabled?(B.current=!B.current,(de===void 0?!z.isFullscreen:de)?z.request():z.exit()):console.error("browser does not support screenfull!")},[]);return(0,f.useEffect)(()=>{let de;const pe=()=>{i.updateSetting("fullscreen",B.current)};let $e=-1;return z||(de=document.createElement("script"),de.src=(Z==null?void 0:Z.js)||d.l,de.onload=()=>{z=window.screenfull,z&&z.isEnabled&&z.on("change",pe)},de.id=`${d.p}-screenfull`,$e=requestAnimationFrame(()=>{Ci(de,"screenfull")})),z&&z.isEnabled&&z.on("change",pe),()=>{z||cancelAnimationFrame($e),z&&z.isEnabled&&z.off("change",pe)}},[]),(0,f.useEffect)(()=>{p.b.on(E,{name:p.e,callback:ie})},[]),{fullscreenHandler:ie}},pr=(i,b)=>{const{editorId:E}=(0,f.useContext)(si),[Z,z]=(0,f.useState)({type:"link",linkVisible:!1,clipVisible:!1}),B=(0,f.useCallback)(()=>{z(de=>Nt(Nt({},de),{linkVisible:!1,clipVisible:!1}))},[]),ie=(0,f.useCallback)(de=>{de&&b(Z.type,{desc:de.desc,url:de.url}),B()},[b,Z.type,B]);return(0,f.useEffect)(()=>{p.b.on(E,{name:p.h,callback(pe){z($e=>Nt(Nt({},$e),{type:pe,linkVisible:!0}))}});const de=()=>{p.b.emit(E,p.U,Array.from(i.current.files||[])),i.current.value=""};i.current.addEventListener("change",de)},[]),{modalData:Z,setModalData:z,onCancel:B,onOk:ie}},bo=i=>{const[b,E]=(0,f.useState)({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),Z=(0,f.useCallback)(vt=>{E(ct=>Nt(Nt({},ct),{title:vt}))},[]),z=(0,f.useCallback)(()=>{E(vt=>Nt(Nt({},vt),{title:!1}))},[]),B=(0,f.useCallback)(vt=>{E(ct=>Nt(Nt({},ct),{image:vt}))},[]),ie=(0,f.useCallback)(()=>{E(vt=>Nt(Nt({},vt),{image:!1}))},[]),de=(0,f.useCallback)(vt=>{E(ct=>Nt(Nt({},ct),{table:vt}))},[]),pe=(0,f.useCallback)(vt=>{i("table",{selectedShape:vt})},[i]),$e=(0,f.useCallback)(vt=>{E(ct=>Nt(Nt({},ct),{mermaid:vt}))},[]),De=(0,f.useCallback)(()=>{E(vt=>Nt(Nt({},vt),{mermaid:!1}))},[]),ft=(0,f.useCallback)(vt=>{E(ct=>Nt(Nt({},ct),{katex:vt}))},[]),He=(0,f.useCallback)(()=>{E(vt=>Nt(Nt({},vt),{katex:!1}))},[]);return{visible:b,onTitleChange:Z,onTitleClose:z,onImageChange:B,onImageClose:ie,onTableChange:de,onTableSelected:pe,onMermaidChange:$e,onMermaidClose:De,onKatexChange:ft,onKatexClose:He}};let mr=0;const gr=i=>{const{toolbars:b,toolbarsExclude:E,updateSetting:Z}=i,{editorId:z,usedLanguageText:B,theme:ie,language:de}=(0,f.useContext)(si),pe=B,[$e]=(0,f.useState)(()=>`${z}-toolbar-wrapper`),De=(0,f.useRef)(null),ft=(0,f.useRef)(null),He=(0,f.useCallback)((kn,Tn)=>{p.b.emit(z,p.f,kn,Tn)},[]),{fullscreenHandler:vt}=cs(i),{modalData:ct,setModalData:bt,onCancel:At,onOk:jt}=pr(ft,He),{visible:Qt,onTitleChange:Ut,onTitleClose:pn,onImageChange:Qn,onImageClose:Fn,onTableChange:xn,onTableSelected:Wt,onMermaidChange:Nn,onMermaidClose:Sn,onKatexChange:Bn,onKatexClose:fn}=bo(He),an=(0,f.useMemo)(()=>{var kn,Tn,ni,oi,Hn,_n,Pi,Si;return(0,l.j)(ri,{relative:`#${$e}`,visible:Qt.title,onChange:Ut,overlay:(0,l.a)("ul",{className:`${d.p}-menu`,onClick:pn,children:[(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h1")},children:(kn=pe.titleItem)==null?void 0:kn.h1}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h2")},children:(Tn=pe.titleItem)==null?void 0:Tn.h2}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h3")},children:(ni=pe.titleItem)==null?void 0:ni.h3}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h4")},children:(oi=pe.titleItem)==null?void 0:oi.h4}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h5")},children:(Hn=pe.titleItem)==null?void 0:Hn.h5}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-title`,onClick:()=>{He("h6")},children:(_n=pe.titleItem)==null?void 0:_n.h6})]}),children:(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Pi=pe.toolbarTips)==null?void 0:Pi.title,children:[(0,l.j)(Pn,{name:"title"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Si=pe.toolbarTips)==null?void 0:Si.title})]})},"bar-title")},[$e,Qt.title,Ut,pn,pe.titleItem,pe.toolbarTips,i.showToolbarName,He]),Zn=(0,f.useMemo)(()=>{var kn,Tn,ni,oi,Hn;return(0,l.j)(ri,{relative:`#${$e}`,visible:Qt.image,onChange:Qn,overlay:(0,l.a)("ul",{className:`${d.p}-menu`,onClick:Fn,children:[(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-image`,onClick:()=>{bt(_n=>Nt(Nt({},_n),{type:"image",linkVisible:!0}))},children:(kn=pe.imgTitleItem)==null?void 0:kn.link}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-image`,onClick:()=>{ft.current.click()},children:(Tn=pe.imgTitleItem)==null?void 0:Tn.upload}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-image`,onClick:()=>{bt(_n=>Nt(Nt({},_n),{type:"image",clipVisible:!0}))},children:(ni=pe.imgTitleItem)==null?void 0:ni.clip2upload})]}),children:(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(oi=pe.toolbarTips)==null?void 0:oi.image,children:[(0,l.j)(Pn,{name:"image"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Hn=pe.toolbarTips)==null?void 0:Hn.image})]})},"bar-image")},[$e,Qt.image,Qn,Fn,pe.imgTitleItem,pe.toolbarTips,i.showToolbarName,bt]),Yn=(0,f.useMemo)(()=>{var kn,Tn;return(0,l.j)(ri,{relative:`#${$e}`,visible:Qt.table,onChange:xn,overlay:(0,l.j)(Oo,{tableShape:i.tableShape,onSelected:Wt}),children:(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(kn=pe.toolbarTips)==null?void 0:kn.table,children:[(0,l.j)(Pn,{name:"table"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Tn=pe.toolbarTips)==null?void 0:Tn.table})]})},"bar-table")},[$e,Qt.table,xn,i.tableShape,i.showToolbarName,Wt,pe.toolbarTips]),ln=(0,f.useMemo)(()=>{var kn,Tn,ni,oi,Hn,_n,Pi,Si,Qi,Ii;return(0,l.j)(ri,{relative:`#${$e}`,visible:Qt.mermaid,onChange:Nn,overlay:(0,l.a)("ul",{className:`${d.p}-menu`,onClick:Sn,children:[(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("flow")},children:(kn=pe.mermaid)==null?void 0:kn.flow}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("sequence")},children:(Tn=pe.mermaid)==null?void 0:Tn.sequence}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("gantt")},children:(ni=pe.mermaid)==null?void 0:ni.gantt}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("class")},children:(oi=pe.mermaid)==null?void 0:oi.class}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("state")},children:(Hn=pe.mermaid)==null?void 0:Hn.state}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("pie")},children:(_n=pe.mermaid)==null?void 0:_n.pie}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("relationship")},children:(Pi=pe.mermaid)==null?void 0:Pi.relationship}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-mermaid`,onClick:()=>{He("journey")},children:(Si=pe.mermaid)==null?void 0:Si.journey})]}),children:(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Qi=pe.toolbarTips)==null?void 0:Qi.mermaid,children:[(0,l.j)(Pn,{name:"mermaid"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Ii=pe.toolbarTips)==null?void 0:Ii.mermaid})]})},"bar-mermaid")},[$e,Qt.mermaid,Nn,Sn,pe.mermaid,pe.toolbarTips,i.showToolbarName,He]),Vn=(0,f.useMemo)(()=>{var kn,Tn,ni,oi;return(0,l.j)(ri,{relative:`#${$e}`,visible:Qt.katex,onChange:Bn,overlay:(0,l.a)("ul",{className:`${d.p}-menu`,onClick:fn,children:[(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-katex`,onClick:()=>{He("katexInline")},children:(kn=pe.katex)==null?void 0:kn.inline}),(0,l.j)("li",{className:`${d.p}-menu-item ${d.p}-menu-item-katex`,onClick:()=>{He("katexBlock")},children:(Tn=pe.katex)==null?void 0:Tn.block})]}),children:(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(ni=pe.toolbarTips)==null?void 0:ni.katex,children:[(0,l.j)(Pn,{name:"formula"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(oi=pe.toolbarTips)==null?void 0:oi.katex})]})},"bar-katex")},[$e,Qt.katex,Bn,fn,pe.katex,pe.toolbarTips,i.showToolbarName,He]),qn=(0,f.useCallback)(kn=>{var Tn,ni,oi,Hn,_n,Pi,Si,Qi,Ii,Cr,Ti,ji,Vi,Pr,nr,ir,zr,rr,qo,Yr,Vs,Br,Ns,Ho,Fs,Jo,Ko,s,e,t,n,r,u,y,T,R,_,G,we,Ze,Ue,tt,wt,gt,Et,mn,An,bn;if(d.b.includes(kn))switch(kn){case"-":return(0,l.j)(Gn,{},`bar-${mr++}`);case"bold":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Tn=pe.toolbarTips)==null?void 0:Tn.bold,onClick:()=>{He("bold")},children:[(0,l.j)(Pn,{name:"bold"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(ni=pe.toolbarTips)==null?void 0:ni.bold})]},"bar-bold");case"underline":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(oi=pe.toolbarTips)==null?void 0:oi.underline,onClick:()=>{He("underline")},children:[(0,l.j)(Pn,{name:"underline"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Hn=pe.toolbarTips)==null?void 0:Hn.underline})]},"bar-underline");case"italic":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(_n=pe.toolbarTips)==null?void 0:_n.italic,onClick:()=>{He("italic")},children:[(0,l.j)(Pn,{name:"italic"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Pi=pe.toolbarTips)==null?void 0:Pi.italic})]},"bar-italic");case"strikeThrough":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Si=pe.toolbarTips)==null?void 0:Si.strikeThrough,onClick:()=>{He("strikeThrough")},children:[(0,l.j)(Pn,{name:"strike-through"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Qi=pe.toolbarTips)==null?void 0:Qi.strikeThrough})]},"bar-strikeThrough");case"title":return an;case"sub":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Ii=pe.toolbarTips)==null?void 0:Ii.sub,onClick:()=>{He("sub")},children:[(0,l.j)(Pn,{name:"sub"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Cr=pe.toolbarTips)==null?void 0:Cr.sub})]},"bar-sub");case"sup":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Ti=pe.toolbarTips)==null?void 0:Ti.sup,onClick:()=>{He("sup")},children:[(0,l.j)(Pn,{name:"sup"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(ji=pe.toolbarTips)==null?void 0:ji.sup})]},"bar-sup");case"quote":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Vi=pe.toolbarTips)==null?void 0:Vi.quote,onClick:()=>{He("quote")},children:[(0,l.j)(Pn,{name:"quote"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Pr=pe.toolbarTips)==null?void 0:Pr.quote})]},"bar-quote");case"unorderedList":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(nr=pe.toolbarTips)==null?void 0:nr.unorderedList,onClick:()=>{He("unorderedList")},children:[(0,l.j)(Pn,{name:"unordered-list"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(ir=pe.toolbarTips)==null?void 0:ir.unorderedList})]},"bar-unorderedList");case"orderedList":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(zr=pe.toolbarTips)==null?void 0:zr.orderedList,onClick:()=>{He("orderedList")},children:[(0,l.j)(Pn,{name:"ordered-list"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(rr=pe.toolbarTips)==null?void 0:rr.orderedList})]},"bar-orderedList");case"task":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(qo=pe.toolbarTips)==null?void 0:qo.task,onClick:()=>{He("task")},children:[(0,l.j)(Pn,{name:"task"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Yr=pe.toolbarTips)==null?void 0:Yr.task})]},"bar-task");case"codeRow":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Vs=pe.toolbarTips)==null?void 0:Vs.codeRow,onClick:()=>{He("codeRow")},children:[(0,l.j)(Pn,{name:"code-row"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Br=pe.toolbarTips)==null?void 0:Br.codeRow})]},"bar-codeRow");case"code":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Ns=pe.toolbarTips)==null?void 0:Ns.code,onClick:()=>{He("code")},children:[(0,l.j)(Pn,{name:"code"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Ho=pe.toolbarTips)==null?void 0:Ho.code})]},"bar-code");case"link":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Fs=pe.toolbarTips)==null?void 0:Fs.link,onClick:()=>{bt(Nt(Nt({},ct),{type:"link",linkVisible:!0}))},children:[(0,l.j)(Pn,{name:"link"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Jo=pe.toolbarTips)==null?void 0:Jo.link})]},"bar-link");case"image":return i.noUploadImg?(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Ko=pe.toolbarTips)==null?void 0:Ko.image,onClick:()=>{bt(wn=>Nt(Nt({},wn),{type:"image",linkVisible:!0}))},children:[(0,l.j)(Pn,{name:"image"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(s=pe.toolbarTips)==null?void 0:s.image})]},"bar-image-no-upload"):Zn;case"table":return Yn;case"revoke":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(e=pe.toolbarTips)==null?void 0:e.revoke,onClick:()=>{p.b.emit(z,p.j)},children:[(0,l.j)(Pn,{name:"revoke"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(t=pe.toolbarTips)==null?void 0:t.revoke})]},"bar-revoke");case"next":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(n=pe.toolbarTips)==null?void 0:n.next,onClick:()=>{p.b.emit(z,p.i)},children:[(0,l.j)(Pn,{name:"next"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(r=pe.toolbarTips)==null?void 0:r.next})]},"bar-next");case"save":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(u=pe.toolbarTips)==null?void 0:u.save,onClick:()=>{p.b.emit(z,p.O)},children:[(0,l.j)(Pn,{name:"baocun"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(y=pe.toolbarTips)==null?void 0:y.save})]},"bar-save");case"prettier":return i.noPrettier?"":(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(T=pe.toolbarTips)==null?void 0:T.prettier,onClick:()=>{He("prettier")},children:[(0,l.j)(Pn,{name:"prettier"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(R=pe.toolbarTips)==null?void 0:R.prettier})]},"bar-prettier");case"pageFullscreen":return!i.setting.fullscreen&&(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(_=pe.toolbarTips)==null?void 0:_.pageFullscreen,onClick:()=>{Z("pageFullscreen")},children:[(0,l.j)(Pn,{name:i.setting.pageFullscreen?"suoxiao":"fangda"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(G=pe.toolbarTips)==null?void 0:G.pageFullscreen})]},"bar-pageFullscreen");case"fullscreen":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(we=pe.toolbarTips)==null?void 0:we.fullscreen,onClick:()=>{vt()},children:[(0,l.j)(Pn,{name:i.setting.fullscreen?"fullscreen-exit":"fullscreen"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(Ze=pe.toolbarTips)==null?void 0:Ze.fullscreen})]},"bar-fullscreen");case"catalog":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Ue=pe.toolbarTips)==null?void 0:Ue.catalog,onClick:()=>{p.b.emit(z,p.C)},children:[(0,l.j)(Pn,{name:"catalog"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(tt=pe.toolbarTips)==null?void 0:tt.catalog})]},"bar-catalog");case"preview":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(wt=pe.toolbarTips)==null?void 0:wt.preview,onClick:()=>{Z("preview")},children:[(0,l.j)(Pn,{name:"preview"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(gt=pe.toolbarTips)==null?void 0:gt.preview})]},"bar-preview");case"htmlPreview":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(Et=pe.toolbarTips)==null?void 0:Et.htmlPreview,onClick:()=>{Z("htmlPreview")},children:[(0,l.j)(Pn,{name:"coding"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(mn=pe.toolbarTips)==null?void 0:mn.htmlPreview})]},"bar-htmlPreview");case"github":return(0,l.a)("div",{className:`${d.p}-toolbar-item`,title:(An=pe.toolbarTips)==null?void 0:An.github,onClick:()=>(0,a.kZ)("https://github.com/imzbf/md-editor-rt"),children:[(0,l.j)(Pn,{name:"github"}),i.showToolbarName&&(0,l.j)("div",{className:`${d.p}-toolbar-item-name`,children:(bn=pe.toolbarTips)==null?void 0:bn.github})]},"bar-github");case"mermaid":return ln;case"katex":return Vn}else if(i.defToolbars){const wn=i.defToolbars[kn];return wn?(0,f.cloneElement)(wn,{theme:ie,language:de,insert(jn){p.b.emit(z,p.f,"universal",{generate:jn})}}):""}else return""},[Zn,Vn,ln,Yn,an,z,He,vt,ct,i.defToolbars,i.noPrettier,i.noUploadImg,i.setting.fullscreen,i.setting.pageFullscreen,i.showToolbarName,bt,pe.toolbarTips,Z,ie,de]),ei=(0,f.useMemo)(()=>{const kn=b.filter(Hn=>!E.includes(Hn)),Tn=kn.indexOf("="),ni=Tn===-1?kn:kn.slice(0,Tn+1),oi=Tn===-1?[]:kn.slice(Tn,Number.MAX_SAFE_INTEGER);return[ni.map(Hn=>qn(Hn)),oi.map(Hn=>qn(Hn))]},[b,E,qn]);return(0,f.useEffect)(()=>{let kn=()=>{};return De.current&&(kn=(0,a.bv)(De.current)),()=>{kn()}},[b]),(0,l.a)(l.F,{children:[b.length>0&&(0,l.j)("div",{className:`${d.p}-toolbar-wrapper`,ref:De,id:$e,children:(0,l.a)("div",{className:(0,p.c)([`${d.p}-toolbar`,i.showToolbarName&&`${d.p}-stn`]),children:[(0,l.j)("div",{className:`${d.p}-toolbar-left`,children:ei[0]}),(0,l.j)("div",{className:`${d.p}-toolbar-right`,children:ei[1]})]})}),(0,l.j)("input",{ref:ft,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}}),(0,l.j)(go,{linkVisible:ct.linkVisible,clipVisible:ct.clipVisible,type:ct.type,onCancel:At,onOk:jt})]})},yo=f.memo(gr),us=`.${d.p}-preview > [data-line]`,vo=(i,b)=>{const E=(0,a.Ds)(()=>{i.removeEventListener("scroll",Z),i.addEventListener("scroll",Z),b.removeEventListener("scroll",Z),b.addEventListener("scroll",Z)},50),Z=z=>{const B=i.clientHeight,ie=b.clientHeight,de=i.scrollHeight,pe=b.scrollHeight,$e=(de-B)/(pe-ie);z.target===i?(b.removeEventListener("scroll",Z),b.scrollTo({top:i.scrollTop/$e}),E()):(i.removeEventListener("scroll",Z),i.scrollTo({top:b.scrollTop*$e}),E())};return[()=>{E().finally(()=>{i.dispatchEvent(new Event("scroll"))})},()=>{i.removeEventListener("scroll",Z),b.removeEventListener("scroll",Z)}]},Hi=(i,b,E)=>{const{view:Z}=E,z=(0,a.qA)(),B=At=>Z.lineBlockAt(Z.state.doc.line(At).from).top,ie=At=>Z.lineBlockAt(Z.state.doc.line(At).from).height;let de=[],pe=[],$e=[];const De=()=>{var pn;de=[],pe=[],$e=[],pe=pe.concat(Array.from(b.querySelectorAll(us)));const At=pe.map(Qn=>Number(Qn.dataset.line)+1);$e=$e.concat(At);const{lines:jt}=Z.state.doc;let Qt=1,Ut=(pn=At.shift())!=null?pn:jt;for(let Qn=1;Qn<=jt;Qn++)Qn===Ut&&(Qt=Qn,Ut=At.shift()||jt+1),de.push({start:Qt,end:Ut-1})};let ft=0,He=0;const vt=()=>{var At,jt;if(He!==0)return!1;ft++;const{scrollDOM:Qt,contentHeight:Ut}=Z;let pn=+getComputedStyle(b).paddingTop.replace("px","");const Qn=Z.lineBlockAtHeight(Qt.scrollTop),{number:Fn}=Z.state.doc.lineAt(Qn.from),xn=de[Fn-1];if(!xn)return!1;let Wt=B(xn.end)+ie(xn.end),Nn=0;const Sn=B(xn.start),Bn=b.querySelector(`[data-line="${xn.start-1}"]`)||((At=b.firstElementChild)==null?void 0:At.firstElementChild),fn=b.querySelector(`[data-line="${xn.end}"]`)||((jt=b.lastElementChild)==null?void 0:jt.lastElementChild);let an=0,Zn=0;Sn===0?(Nn=Qt.scrollTop/Wt,Bn===fn?(pn=0,Wt=Ut-Qt.offsetHeight,an=fn.offsetTop+fn.offsetHeight-b.clientHeight):an=fn.offsetTop):(Nn=(Qt.scrollTop-Sn)/(Wt-Sn),Zn=Bn.offsetTop,an=fn.offsetTop-Zn),Wt>Qt.scrollHeight-Qt.clientHeight&&(Nn=(Qt.scrollTop-Sn)/(Qt.scrollHeight-Qt.clientHeight-Sn),Zn=Bn.offsetTop,an=b.scrollHeight-b.clientHeight-Zn+10);const Yn=Zn-pn+an*Nn;z(b,Yn,()=>{ft--})},ct=()=>{var At,jt,Qt,Ut,pn,Qn;if(ft!==0)return;He++;const{scrollDOM:Fn}=Z,xn=b.scrollTop,Wt=b.scrollHeight;let Nn=(At=b.firstElementChild)==null?void 0:At.firstElementChild,Sn=(jt=b.firstElementChild)==null?void 0:jt.lastElementChild;if($e.length>0){let ei=Math.ceil(Number($e[$e.length-1])*(xn/Wt)),kn=$e.findLastIndex(Tn=>Tn<=ei);kn=kn===-1?0:kn,ei=$e[kn];for(let Tn=kn;Tn>=0&&Tn<$e.length;)if(pe[Tn].offsetTop>xn){if(Tn-1>=0){Tn--;continue}ei=-1,kn=Tn;break}else{if(Tn+1<=$e.length&&pe[Tn+1].offsetTopFn.scrollHeight-Fn.clientHeight||Sn.scrollTop>b.scrollHeight-b.clientHeight?(an=Math.max((xn-Bn)/(b.scrollHeight-Bn-b.clientHeight),0),Vn=B(Z.state.doc.lines)+ie(Z.state.doc.lines),qn=8+Vn-ln-i.clientHeight):Nn===((Qn=b.firstElementChild)==null?void 0:Qn.firstElementChild)?(Nn===Sn&&(fn=Sn.offsetTop+Sn.offsetHeight+ +getComputedStyle(Sn).marginBottom.replace("px","")),qn=Vn,an=Math.max(xn/fn,0)):(an=Math.max((xn-Bn)/(fn-Bn),0),qn=Vn-ln),z(i,ln+qn*an,()=>{He--})},bt=(0,a.P2)(At=>{var jt;const{scrollDOM:Qt,contentHeight:Ut}=Z,pn=Qt.clientHeight;if(Ut<=pn||b.firstElementChild.clientHeight<=b.clientHeight||Z.state.doc.lines<((jt=de[de.length-1])==null?void 0:jt.end))return!1;At.target===i?vt():ct()},8);return[()=>{De(),i.addEventListener("scroll",bt),b.addEventListener("scroll",bt),i.dispatchEvent(new Event("scroll"))},()=>{i.removeEventListener("scroll",bt),b.removeEventListener("scroll",bt)}]},Or=(i,b,E)=>{const{editorId:Z}=(0,f.useContext)(si),[z,B]=(0,f.useState)({clear(){},init(){}});(0,f.useEffect)(()=>{z.clear();const ie=document.querySelector(`#${Z} .cm-scroller`),de=document.querySelector(`[id="${Z}-preview-wrapper"][data-show="true"]`),pe=document.querySelector(`[id="${Z}-html-wrapper"][data-show="true"]`);if(de||pe){const $e=de?Hi:vo,De=de||pe,[ft,He]=$e(ie,De,E.current);B({init:ft,clear:He})}},[b,i.setting.fullscreen,i.setting.pageFullscreen,i.setting.preview,i.setting.htmlPreview]),(0,f.useEffect)(()=>(i.scrollAuto?z.init():z.clear(),()=>{z.clear()}),[z,i.scrollAuto])},Dr=Or,jr=(i,b,E)=>{var At;var Z,z,B,ie,de,pe;let $e="",De=0,ft=0,He=!0,vt=!1;const ct=b.getSelectedText(),bt=(Z=d.f.editorConfig)==null?void 0:Z.mermaidTemplate;if(/^h[1-6]{1}$/.test(i)){const jt=i.replace(/^h(\d)/,(Qt,Ut)=>new Array(Number(Ut)).fill("#",0,Ut).join(""));$e=`${jt} ${ct}`,De=jt.length+1}else if(i==="prettier"){const jt=window.prettier||((B=(z=d.f.editorExtensions)==null?void 0:z.prettier)==null?void 0:B.prettierInstance),Qt=[((ie=window.prettierPlugins)==null?void 0:ie.markdown)||((pe=(de=d.f.editorExtensions)==null?void 0:de.prettier)==null?void 0:pe.parserMarkdownInstance)];!jt||Qt[0]===void 0?(p.b.emit(E.editorId,p.E,{name:"prettier",message:"prettier is undefined"}),$e=b.getValue()):$e=jt.format(b.getValue(),{parser:"markdown",plugins:Qt}),He=!1,vt=!0}else switch(i){case"bold":{$e=`**${ct}**`,De=2,ft=-2;break}case"underline":{$e=`${ct}`,De=3,ft=-4;break}case"italic":{$e=`*${ct}*`,De=1,ft=-1;break}case"strikeThrough":{$e=`~~${ct}~~`,De=2,ft=-2;break}case"sub":{$e=`${ct}`,De=5,ft=-6;break}case"sup":{$e=`${ct}`,De=5,ft=-6;break}case"codeRow":{$e="`"+ct+"`",De=1,ft=-1;break}case"quote":{$e=`> ${ct}`,De=2;break}case"orderedList":{$e=`1. ${ct}`,De=3;break}case"unorderedList":{$e=`- ${ct}`,De=2;break}case"task":{$e=`- [ ] ${ct}`,De=6;break}case"code":{const jt=E.text||ct||"",Qt=E.mode||"language";$e=`\`\`\`${Qt} ${jt} \`\`\` `,De=3,ft=3+Qt.length-$e.length;break}case"table":{$e="|";const{selectedShape:jt={x:1,y:1}}=E,{x:Qt,y:Ut}=jt;for(let pn=0;pn<=Ut;pn++)$e+=" col |";$e+=` |`;for(let pn=0;pn<=Ut;pn++)$e+=" - |";for(let pn=0;pn<=Qt;pn++){$e+=` |`;for(let Qn=0;Qn<=Ut;Qn++)$e+=" content |"}De=2,ft=5-$e.length;break}case"link":{const{desc:jt,url:Qt}=E;$e=`[${jt}](${Qt})`,He=!1;break}case"image":{const{desc:jt,url:Qt,urls:Ut}=E;Ut instanceof Array?$e=Ut.reduce((pn,Qn)=>pn+`![${jt}](${Qn}) `,""):$e=`![${jt}](${Qt}) `,He=!1;break}case"flow":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.flow)||`flowchart TD Start --> Stop`} \`\`\` `,De=3,ft=10-$e.length;break}case"sequence":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.sequence)||`sequenceDiagram A->>B: hello! B-->>A: hi! A-)B: bye!`} \`\`\` `,De=3,ft=10-$e.length;break}case"gantt":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.gantt)||`gantt title A Gantt Diagram dateFormat YYYY-MM-DD section Section A task :a1, 2014-01-01, 30d Another task :after a1, 20d`} \`\`\` `,De=3,ft=10-$e.length;break}case"class":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.class)||`classDiagram class Animal Vehicle <|-- Car`} \`\`\` `,De=3,ft=10-$e.length;break}case"state":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.state)||`stateDiagram-v2 s1 --> s2`} \`\`\` `,De=3,ft=10-$e.length;break}case"pie":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.pie)||`pie title Pets adopted by volunteers "Dogs" : 386 "Cats" : 85 "Rats" : 15`} \`\`\` `,De=3,ft=10-$e.length;break}case"relationship":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.relationship)||`erDiagram CAR ||--o{ NAMED-DRIVER : allows PERSON ||--o{ NAMED-DRIVER : is`} \`\`\` `,De=3,ft=10-$e.length;break}case"journey":{$e=`\`\`\`mermaid ${(bt==null?void 0:bt.journey)||`journey title My working day section Go to work Make tea: 5: Me Go upstairs: 3: Me Do work: 1: Me, Cat section Go home Go downstairs: 5: Me Sit down: 5: Me`} \`\`\` `,De=3,ft=10-$e.length;break}case"katexInline":{$e="$$",De=1,ft=-1;break}case"katexBlock":{$e=`$$ $$ `,De=3,ft=-4;break}case"universal":{const{generate:jt}=E,Qt=jt(ct);$e=Qt.targetValue,He=(At=Qt.select)!=null?At:!0,De=Qt.deviationStart||0,ft=Qt.deviationEnd||0}}return{text:$e,options:{select:He,deviationStart:De,deviationEnd:ft,replaceAll:vt}}},Mi=i=>{const b=new w.F6;return E=>(b.get(i.state)?i.dispatch({effects:b.reconfigure(E)}):i.dispatch({effects:w.Py.appendConfig.of(b.of(E))}),!0)};class fs{constructor(b){Ei(this,"view"),Ei(this,"maxLength",Number.MAX_SAFE_INTEGER),Ei(this,"toggleTabSize"),Ei(this,"togglePlaceholder"),Ei(this,"setExtensions"),Ei(this,"toggleDisabled"),Ei(this,"toggleReadOnly"),Ei(this,"toggleMaxlength"),this.view=b,this.toggleTabSize=Mi(this.view),this.togglePlaceholder=Mi(this.view),this.setExtensions=Mi(this.view),this.toggleDisabled=Mi(this.view),this.toggleReadOnly=Mi(this.view),this.toggleMaxlength=Mi(this.view)}getValue(){return this.view.state.doc.toString()}setValue(b,E=0,Z=this.view.state.doc.length){this.view.dispatch({changes:{from:E,to:Z,insert:b}})}getSelectedText(){const{from:b,to:E}=this.view.state.selection.main;return this.view.state.sliceDoc(b,E)}replaceSelectedText(b,E={select:!0,deviationStart:0,deviationEnd:0,replaceAll:!1},Z){try{if(E.replaceAll){if(this.setValue(b),b.length>this.maxLength)throw new Error("The input text is too long");return}if(this.view.state.doc.length-this.getSelectedText().length+b.length>this.maxLength)throw new Error("The input text is too long");const{from:z}=this.view.state.selection.main;if(this.view.dispatch(this.view.state.replaceSelection(b)),E.select){const B=z+b.length+E.deviationEnd;this.view.dispatch({selection:w.jT.create([w.jT.range(z+E.deviationStart,B),w.jT.cursor(B)],1)})}this.view.focus()}catch(z){if(z.message==="The input text is too long")p.b.emit(Z,p.E,{name:"overlength",message:z.message,data:b});else throw z}}setTabSize(b){this.toggleTabSize([w.yy.tabSize.of(b),m.c.of(" ".repeat(b))])}setPlaceholder(b){this.togglePlaceholder((0,S.W$)(b))}focus(b){if(this.view.focus(),!b)return;let E=0,Z=0,z=0;switch(b){case"start":break;case"end":{E=Z=z=this.getValue().length;break}default:E=b.rangeAnchor||b.cursorPos,Z=b.rangeHead||b.cursorPos,z=b.cursorPos}this.view.dispatch({scrollIntoView:!0,selection:w.jT.create([w.jT.range(E,Z),w.jT.cursor(z)],1)})}setDisabled(b){this.toggleDisabled([S.tk.editable.of(!b)])}setReadOnly(b){this.toggleReadOnly([w.yy.readOnly.of(b)])}setMaxLength(b){this.maxLength=b,this.toggleMaxlength([w.yy.changeFilter.of(E=>E.newDoc.length<=b)])}}const ds="#e5c07b",br="var(--md-color)",xo="#56b6c2",Ji="#ffffff",Ki="var(--md-color)",ps="#e5c07b",ms="#e5c07b",gs="var(--md-color)",Os="#d19a66",bs="#c678dd",So="#21252b",ko="#2c313a",ys="var(--md-bk-color)",Lr="var(--md-bk-color)",wo="#ceedfa33",yr="#528bff",Co=S.tk.theme({"&":{color:Ki,backgroundColor:ys},".cm-content":{caretColor:yr},".cm-cursor, .cm-dropCursor":{borderLeftColor:yr},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wo},".cm-panels":{backgroundColor:So,color:Ki},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:ys,color:Ki,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:ko},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Lr},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Lr,borderBottomColor:Lr},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Ki}}},{dark:!0}),vs=m.Qf.define([{tag:Mt.pJ.keyword,color:bs},{tag:[Mt.pJ.name,Mt.pJ.deleted,Mt.pJ.character,Mt.pJ.propertyName,Mt.pJ.macroName],color:br},{tag:[Mt.pJ.function(Mt.pJ.variableName),Mt.pJ.labelName],color:ms},{tag:[Mt.pJ.color,Mt.pJ.constant(Mt.pJ.name),Mt.pJ.standard(Mt.pJ.name)],color:Os},{tag:[Mt.pJ.definition(Mt.pJ.name),Mt.pJ.separator],color:Ki},{tag:[Mt.pJ.typeName,Mt.pJ.className,Mt.pJ.number,Mt.pJ.changed,Mt.pJ.annotation,Mt.pJ.modifier,Mt.pJ.self,Mt.pJ.namespace],color:ds},{tag:[Mt.pJ.operator,Mt.pJ.operatorKeyword,Mt.pJ.url,Mt.pJ.escape,Mt.pJ.regexp,Mt.pJ.link,Mt.pJ.special(Mt.pJ.string)],color:xo},{tag:[Mt.pJ.meta,Mt.pJ.comment],color:ps},{tag:Mt.pJ.strong,fontWeight:"bold"},{tag:Mt.pJ.emphasis,fontStyle:"italic"},{tag:Mt.pJ.strikethrough,textDecoration:"line-through"},{tag:Mt.pJ.link,color:ps,textDecoration:"underline"},{tag:Mt.pJ.heading,fontWeight:"bold",color:br},{tag:[Mt.pJ.atom,Mt.pJ.bool,Mt.pJ.special(Mt.pJ.variableName)],color:Os},{tag:[Mt.pJ.processingInstruction,Mt.pJ.string,Mt.pJ.inserted],color:gs},{tag:Mt.pJ.invalid,color:Ji}]),xs=[Co,(0,m.nF)(vs)],zn="#e5c07b",Ss="#3f4a54",ks="#56b6c2",vr="#fff",Yi="#3f4a54",ws="#2d8cf0",Po="#2d8cf0",xr="#3f4a54",Cs="#d19a66",Ps="#c678dd",$s="#21252b",Qs="#ceedfa33",$o="var(--md-bk-color)",Zi="var(--md-bk-color)",Qo="#bad5fa",Ts="#3f4a54",As=S.tk.theme({"&":{color:Yi,backgroundColor:$o},".cm-content":{caretColor:Ts},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ts},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Qo},".cm-panels":{backgroundColor:$s,color:Yi},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:$o,color:Yi,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:Qs},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Zi},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Zi,borderBottomColor:Zi},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Yi}}}),_i=m.Qf.define([{tag:Mt.pJ.keyword,color:Ps},{tag:[Mt.pJ.name,Mt.pJ.deleted,Mt.pJ.character,Mt.pJ.propertyName,Mt.pJ.macroName],color:Ss},{tag:[Mt.pJ.function(Mt.pJ.variableName),Mt.pJ.labelName],color:Po},{tag:[Mt.pJ.color,Mt.pJ.constant(Mt.pJ.name),Mt.pJ.standard(Mt.pJ.name)],color:Cs},{tag:[Mt.pJ.definition(Mt.pJ.name),Mt.pJ.separator],color:Yi},{tag:[Mt.pJ.typeName,Mt.pJ.className,Mt.pJ.number,Mt.pJ.changed,Mt.pJ.annotation,Mt.pJ.modifier,Mt.pJ.self,Mt.pJ.namespace],color:zn},{tag:[Mt.pJ.operator,Mt.pJ.operatorKeyword,Mt.pJ.url,Mt.pJ.escape,Mt.pJ.regexp,Mt.pJ.link,Mt.pJ.special(Mt.pJ.string)],color:ks},{tag:[Mt.pJ.meta,Mt.pJ.comment],color:ws},{tag:Mt.pJ.strong,fontWeight:"bold"},{tag:Mt.pJ.emphasis,fontStyle:"italic"},{tag:Mt.pJ.strikethrough,textDecoration:"line-through"},{tag:Mt.pJ.link,color:ws,textDecoration:"underline"},{tag:Mt.pJ.heading,fontWeight:"bold",color:Ss},{tag:[Mt.pJ.atom,Mt.pJ.bool,Mt.pJ.special(Mt.pJ.variableName)],color:Cs},{tag:[Mt.pJ.processingInstruction,Mt.pJ.string,Mt.pJ.inserted],color:xr},{tag:Mt.pJ.invalid,color:vr}]),Xr=[As,(0,m.nF)(_i)],er=(i,b,E,Z,z)=>(B,ie,de,pe)=>{const $e=`${i}${b}`.slice(pe-de);B.dispatch(B.state.replaceSelection(`${$e}${E}${Z}`));const De=de+ie.label.length+(z==="title"?E.length:0);B.dispatch({selection:w.jT.create([w.jT.range(de+ie.label.length+(z==="title"?1:-b.length),De),w.jT.cursor(De)],1)}),B.focus()},Zs=i=>(b,E,Z,z)=>{const B=i.slice(z-Z);b.dispatch(b.state.replaceSelection(`${B} `))},To=i=>{const b=E=>{const Z=E.matchBefore(/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/);return Z===null||Z.from==Z.to&&E.explicit?null:{from:Z.from,options:[...["h1","h2","h3","h4","h5","h6"].map((z,B)=>{const ie=new Array(B+1).fill("#").join("");return{label:ie,type:"text",apply:Zs(ie)}}),...["unchecked","checked"].map(z=>{const B=z==="checked"?"- [x]":"- [ ]";return{label:B,type:"text",apply:Zs(B)}}),...[["`",""],["```","language"],["```mermaid\n",""]].map(z=>({label:`${z[0]}${z[1]}`,type:"text",apply:er(z[0],z[1],"",z[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col | | - | - | - | | content | content | content | | content | content | content |`},{label:"$",type:"text",apply:er("$","","","$","type")},{label:"$$",type:"text",apply:er("$$","",` `,` $$`,"title")},...["note","abstract","info","tip","success","question","warning","failure","danger","bug","example","quote","hint","caution","error","attention"].map(z=>({label:`!!! ${z}`,type:"text",apply:er("!!!",` ${z}`," Title",` !!!`,"title")}))]}};return(0,no.ys)({override:i?[b,...i]:[b]})},Es=To,Sr=(i,b)=>[{key:"Ctrl-b",mac:"Cmd-b",run:()=>(p.b.emit(i,p.f,"bold"),!0)},{key:"Ctrl-d",mac:"Cmd-d",run:Di,preventDefault:!0},{key:"Ctrl-s",mac:"Cmd-s",run:E=>(p.b.emit(i,p.O,E.state.doc.toString()),!0),shift:()=>(p.b.emit(i,p.f,"strikeThrough"),!0)},{key:"Ctrl-u",mac:"Cmd-u",run:()=>(p.b.emit(i,p.f,"underline"),!0),shift:()=>(p.b.emit(i,p.f,"unorderedList"),!0)},{key:"Ctrl-i",mac:"Cmd-i",run:()=>(p.b.emit(i,p.f,"italic"),!0),shift:()=>(p.b.emit(i,p.h,"image"),!0)},{key:"Ctrl-1",mac:"Cmd-1",run:()=>(p.b.emit(i,p.f,"h1"),!0)},{key:"Ctrl-2",mac:"Cmd-2",run:()=>(p.b.emit(i,p.f,"h2"),!0)},{key:"Ctrl-3",mac:"Cmd-3",run:()=>(p.b.emit(i,p.f,"h3"),!0)},{key:"Ctrl-4",mac:"Cmd-4",run:()=>(p.b.emit(i,p.f,"h4"),!0)},{key:"Ctrl-5",mac:"Cmd-5",run:()=>(p.b.emit(i,p.f,"h5"),!0)},{key:"Ctrl-6",mac:"Cmd-6",run:()=>(p.b.emit(i,p.f,"h6"),!0)},{key:"Ctrl-ArrowUp",mac:"Cmd-ArrowUp",run:()=>(p.b.emit(i,p.f,"sup"),!0)},{key:"Ctrl-ArrowDown",mac:"Cmd-ArrowDown",run:()=>(p.b.emit(i,p.f,"sub"),!0)},{key:"Ctrl-o",mac:"Cmd-o",run:()=>(p.b.emit(i,p.f,"orderedList"),!0)},{key:"Ctrl-c",mac:"Cmd-c",shift:()=>(p.b.emit(i,p.f,"code"),!0),any(E,Z){return(Z.ctrlKey||Z.metaKey)&&Z.altKey&&Z.code==="KeyC"?(p.b.emit(i,p.f,"codeRow"),!0):!1}},{key:"Ctrl-l",mac:"Cmd-l",run:()=>(p.b.emit(i,p.h,"link"),!0)},{key:"Ctrl-f",mac:"Cmd-f",shift:()=>b.noPrettier?!1:(p.b.emit(i,p.f,"prettier"),!0)},{any:(E,Z)=>(Z.ctrlKey||Z.metaKey)&&Z.altKey&&Z.shiftKey&&Z.code==="KeyT"?(p.b.emit(i,p.f,"table"),!0):!1}],Rs=Sr,Ds=i=>{const{editorId:b}=(0,f.useContext)(si);return(0,f.useCallback)(E=>{if(!E.clipboardData)return;if(E.clipboardData.files.length>0){const{files:z}=E.clipboardData;p.b.emit(b,p.U,Array.from(z).filter(B=>/image\/.*/.test(B.type))),E.preventDefault();return}if(i.autoDetectCode&&E.clipboardData.types.includes("vscode-editor-data")){const z=JSON.parse(E.clipboardData.getData("vscode-editor-data"));p.b.emit(b,p.f,"code",{mode:z.mode,text:E.clipboardData.getData("text/plain")}),E.preventDefault();return}const Z=E.clipboardData.getData("text/plain");i.maxLength&&Z.length+i.modelValue.length>i.maxLength&&p.b.emit(b,p.E,{name:"overlength",message:"The input text is too long",data:Z})},[i.autoDetectCode,i.maxLength,i.modelValue])},Bi=Ds,rl=i=>{const{tabWidth:b,editorId:E,theme:Z}=(0,f.useContext)(si),z=(0,f.useRef)(null),B=(0,f.useRef)(),[ie]=(0,f.useState)(()=>({language:new w.F6,theme:new w.F6,autocompletion:new w.F6,update:new w.F6,domEvent:new w.F6,history:new w.F6})),[de]=(0,f.useState)(()=>Rs(E,i)),pe=(0,f.useRef)(!0),$e=Bi(i),[De]=(0,f.useState)(()=>[S.$f.of([...cr,...rt,...de,ur]),ie.history.of(H()),ie.language.of((0,te.markdown)({codeLanguages:U})),S.tk.lineWrapping,ie.update.of(S.tk.updateListener.of(vt=>{vt.docChanged&&i.onChange(vt.state.doc.toString())})),ie.domEvent.of(S.tk.domEventHandlers({paste:$e,blur:i.onBlur,focus:i.onFocus,drop:i.onDrop,input:vt=>{i.onInput&&i.onInput(vt);const{data:ct}=vt;i.maxLength&&i.modelValue.length+ct.length>i.maxLength&&p.b.emit(E,p.E,{name:"overlength",message:"The input text is too long",data:ct})}}))]),[ft]=(0,f.useState)(()=>d.f.codeMirrorExtensions(Z,[...De,ie.theme.of(Z==="light"?Xr:xs),ie.autocompletion.of(Es(i.completions))],[...de])),He=(0,f.useCallback)(()=>{var vt,ct;(vt=B.current)==null||vt.view.dispatch({effects:ie.history.reconfigure([])}),(ct=B.current)==null||ct.view.dispatch({effects:ie.history.reconfigure(H())})},[ie.history]);return(0,f.useEffect)(()=>{const vt=new S.tk({doc:i.modelValue,parent:z.current,extensions:ft}),ct=new fs(vt);return B.current=ct,setTimeout(()=>{ct.setTabSize(b),ct.setDisabled(i.disabled),ct.setReadOnly(i.readOnly),i.placeholder&&ct.setPlaceholder(i.placeholder),typeof i.maxLength=="number"&&ct.setMaxLength(i.maxLength),i.autoFocus&&vt.focus(),pe.current=!1},0),p.b.on(E,{name:p.j,callback(){K(vt)}}),p.b.on(E,{name:p.i,callback(){Se(vt)}}),p.b.on(E,{name:p.f,callback(bt,At={}){var jt;const{text:Qt,options:Ut}=jr(bt,B.current,At);(jt=B.current)==null||jt.replaceSelectedText(Qt,Ut,E)}}),()=>{vt.destroy(),pe.current=!0}},[]),(0,f.useEffect)(()=>{setTimeout(()=>{var vt;(vt=B.current)==null||vt.view.dispatch({effects:ie.theme.reconfigure(Z==="light"?Xr:xs)})},0)},[ie.theme,Z]),(0,f.useEffect)(()=>{setTimeout(()=>{var vt;(vt=B.current)==null||vt.view.dispatch({effects:[ie.update.reconfigure(S.tk.updateListener.of(ct=>{ct.docChanged&&i.onChange(ct.state.doc.toString())})),ie.domEvent.reconfigure(S.tk.domEventHandlers({paste:$e,blur:i.onBlur,focus:i.onFocus,drop:i.onDrop,input:ct=>{i.onInput&&i.onInput(ct);const{data:bt}=ct;i.maxLength&&i.modelValue.length+bt.length>i.maxLength&&p.b.emit(E,p.E,{name:"overlength",message:"The input text is too long",data:bt})}})),ie.autocompletion.reconfigure(Es(i.completions))]})},0)},[ie.domEvent,ie.update,$e,i]),(0,f.useEffect)(()=>{var vt,ct;((vt=B.current)==null?void 0:vt.getValue())!==i.modelValue&&((ct=B.current)==null||ct.setValue(i.modelValue))},[i.modelValue]),(0,f.useEffect)(()=>{var vt;pe.current||(vt=B.current)==null||vt.setTabSize(b)},[b]),(0,f.useEffect)(()=>{var vt;pe.current||(vt=B.current)==null||vt.setPlaceholder(i.placeholder)},[i.placeholder]),(0,f.useEffect)(()=>{var vt;pe.current||(vt=B.current)==null||vt.setDisabled(i.disabled)},[i.disabled]),(0,f.useEffect)(()=>{var vt;pe.current||(vt=B.current)==null||vt.setDisabled(i.readOnly)},[i.readOnly]),(0,f.useEffect)(()=>{var vt;pe.current||typeof i.maxLength=="number"&&((vt=B.current)==null||vt.setMaxLength(i.maxLength))},[i.maxLength]),{inputWrapperRef:z,codeMirrorUt:B,resetHistory:He}},sl=rl,js=(i,b)=>{const{editorId:E}=(0,f.useContext)(si);(0,f.useEffect)(()=>i.noImgZoomIn?void 0:(()=>{const Z=document.querySelectorAll(`#${E}-preview img`),z=so(Z,{background:"#00000073"});return()=>{z.detach()}})(),[b,i.setting])},Ao=js,Ls=(i,b)=>{if(typeof b[i]=="string")return b[i];const E=``;switch(d.f.iconfontType){case"svg":return``;default:return E}},Zo=(i,b,E)=>{var Z,z,B;const{editorId:ie,usedLanguageText:de,customIcon:pe}=(0,f.useContext)(si),{formatCopiedText:$e=De=>De}=i;(0,f.useEffect)(()=>{i.setting.preview&&document.querySelectorAll(`#${ie} .${d.p}-preview pre`).forEach(De=>{var ft,He;let vt=-1;(ft=De.querySelector(".copy-button"))==null||ft.remove();const ct=((He=de.copyCode)==null?void 0:He.text)||"\u590D\u5236\u4EE3\u7801",bt=document.createElement("span");bt.setAttribute("class","copy-button"),bt.dataset.tips=ct,bt.innerHTML=Ls("copy",pe),bt.addEventListener("click",()=>{var At,jt;clearTimeout(vt);const Qt=De.querySelector("code").innerText,Ut=Kr($e(Qt)),pn=((At=de.copyCode)==null?void 0:At.successTips)||"\u5DF2\u590D\u5236\uFF01",Qn=((jt=de.copyCode)==null?void 0:jt.failTips)||"\u5DF2\u590D\u5236\uFF01";bt.dataset.tips=Ut?pn:Qn,vt=window.setTimeout(()=>{bt.dataset.tips=ct},1500)}),De.appendChild(bt)})},[$e,b,E,i.setting.preview,(Z=de.copyCode)==null?void 0:Z.failTips,(z=de.copyCode)==null?void 0:z.successTips,(B=de.copyCode)==null?void 0:B.text])},Xs=Zo,Eo=i=>{var b;const E=(b=d.f.editorExtensions)==null?void 0:b.highlight,Z=E==null?void 0:E.instance,{highlight:z}=(0,f.useContext)(si),B=(0,f.useRef)(Z),[ie,de]=(0,f.useState)(!!Z);return(0,f.useEffect)(()=>{Tr(`${d.p}-hlCss`,"href",z.css)},[z.css]),(0,f.useEffect)(()=>{if(!i.noHighlight&&!B.current){const pe=document.createElement("script");pe.src=z.js,pe.onload=()=>{B.current=window.hljs,de(!0)},pe.id=`${d.p}-hljs`,Ci(pe,"hljs");const $e=document.createElement("link");$e.rel="stylesheet",$e.href=z.css,$e.id=`${d.p}-hlCss`,Ci($e)}},[]),{hljsRef:B,hljsInited:ie}},Ms=Eo,tr=i=>{const{theme:b}=(0,f.useContext)(si),{editorExtensions:E,mermaidConfig:Z}=d.f,z=E==null?void 0:E.mermaid,B=(0,f.useRef)(z==null?void 0:z.instance),[ie,de]=(0,f.useState)(-1),[pe]=(0,f.useState)(()=>new ns.Z({max:1e3,ttl:6e5})),$e=(0,f.useCallback)(()=>{pe.clear();const ft=B.current;!i.noMermaid&&ft&&(ft.initialize(Z({startOnLoad:!1,theme:b==="dark"?"dark":"default"})),de(He=>He+1))},[b]);(0,f.useEffect)($e,[$e]),(0,f.useEffect)(()=>{if(!i.noMermaid&&!(z!=null&&z.instance)){const ft=(z==null?void 0:z.js)||d.m;if(/\.mjs/.test(ft))import(ft).then(He=>{B.current=He.default,$e()});else{const He=document.createElement("script");He.id=`${d.p}-mermaid`,He.src=ft,He.onload=()=>{B.current=window.mermaid,$e()},Ci(He,"mermaid")}}},[]);const De=(0,f.useCallback)(()=>{if(!i.noMermaid&&B.current){const ft=document.querySelectorAll(`div.${d.p}-mermaid`),He=document.createElement("div");He.style.width=document.body.offsetWidth+"px",He.style.height=document.body.offsetHeight+"px",He.style.position="fixed",He.style.zIndex="-10000",He.style.top="-10000";let vt=ft.length;vt>0&&document.body.appendChild(He),ft.forEach(ct=>el(this,null,function*(){let bt=pe.get(ct.innerText);if(!bt){const jt=(0,a.Vj)(),Qt=B.current.renderAsync||B.current.render;let Ut="";try{Ut=yield Qt(jt,ct.innerText,He)}catch(pn){}bt=yield i.sanitizeMermaid(typeof Ut=="string"?Ut:Ut.svg),pe.set(ct.innerText,bt)}const At=document.createElement("p");At.className=`${d.p}-mermaid`,At.setAttribute("data-processed",""),At.innerHTML=bt,ct.dataset.line!==void 0&&(At.dataset.line=ct.dataset.line),ct.replaceWith(At),--vt==0&&He.remove()}))}},[]);return{mermaidRef:B,reRender:ie,replaceMermaid:De}},Ro=tr,ol=i=>{var b;const E=(b=d.f.editorExtensions)==null?void 0:b.katex,Z=E==null?void 0:E.instance,z=(0,f.useRef)(Z),[B,ie]=(0,f.useState)(!!Z);return(0,f.useEffect)(()=>{if(!i.noKatex&&!z.current){const de=document.createElement("script");de.src=(E==null?void 0:E.js)||d.n.js,de.onload=()=>{z.current=window.katex,ie(!0)},de.id=`${d.p}-katex`;const pe=document.createElement("link");pe.rel="stylesheet",pe.href=(E==null?void 0:E.css)||d.n.css,pe.id=`${d.p}-katexCss`,Ci(de,"katex"),Ci(pe)}},[]),{katexRef:z,katexInited:B}},Is=ol,Do=(i,b)=>{const E=i.renderer.rules.fence.bind(i.renderer.rules);i.renderer.rules.fence=(Z,z,B,ie,de)=>{const pe=Z[z],$e=pe.content.trim();if(pe.info==="mermaid"){let De;return Z[z].map&&Z[z].level===0&&(De=Z[z].map[0],Z[z].attrSet("data-line",String(De))),`
${$e}
`}return E(Z,z,B,ie,de)}},Mr=Do,kr=(i,b)=>{let E=!0,Z=!0;const z=i.posMax,B=b>0?i.src.charCodeAt(b-1):-1,ie=b+1<=z?i.src.charCodeAt(b+1):-1;return(B===32||B===9||ie>=48&&ie<=57)&&(Z=!1),(ie===32||ie===9)&&(E=!1),{can_open:E,can_close:Z}},jo=(i,b)=>{let E,Z,z,B;if(i.src[i.pos]!=="$")return!1;if(z=kr(i,i.pos),!z.can_open)return b||(i.pending+="$"),i.pos+=1,!0;const ie=i.pos+1;for(E=ie;(E=i.src.indexOf("$",E))!==-1;){for(B=E-1;i.src[B]==="\\";)B-=1;if((E-B)%2==1)break;E+=1}return E===-1?(b||(i.pending+="$"),i.pos=ie,!0):E-ie==0?(b||(i.pending+="$$"),i.pos=ie+1,!0):(z=kr(i,E),z.can_close?(b||(Z=i.push("math_inline","math",0),Z.markup="$",Z.content=i.src.slice(ie,E)),i.pos=E+1,!0):(b||(i.pending+="$"),i.pos=ie,!0))},Lo=(i,b,E,Z)=>{let z,B,ie,de,pe=!1,$e=i.bMarks[b]+i.tShift[b],De=i.eMarks[b];if($e+2>De||i.src.slice($e,$e+2)!=="$$")return!1;if($e+=2,z=i.src.slice($e,De),Z)return!0;for(z.trim().slice(-2)==="$$"&&(z=z.trim().slice(0,-2),pe=!0),ie=b;!pe&&(ie++,!(ie>=E||($e=i.bMarks[ie]+i.tShift[ie],De=i.eMarks[ie],$e{const E=z=>{if(b.katexRef.current){const B=b.katexRef.current.renderToString(z,{throwOnError:!1});return`${B}`}else return`${z}`},Z=(z,B)=>{if(b.katexRef.current){const ie=b.katexRef.current.renderToString(z,{throwOnError:!1,displayMode:!0});return`

${ie}

`}else return`

${z}

`};i.inline.ruler.after("escape","math_inline",jo),i.block.ruler.after("blockquote","math_block",Lo,{alt:["paragraph","reference","blockquote","list"]}),i.renderer.rules.math_inline=(z,B)=>E(z[B].content),i.renderer.rules.math_block=(z,B)=>Z(z[B].content,z[B].map[0])+` `},Xo=Ir,wr=(i,b)=>{b=b||{};const E=3,Z=b.marker||"!",z=Z.charCodeAt(0),B=Z.length;let ie="",de="";const pe=(De,ft,He,vt,ct)=>{const bt=De[ft];return bt.type==="admonition_open"?(De[ft].attrPush(["class",`${d.p}-admonition ${d.p}-admonition-${bt.info}`]),De[ft].attrSet("data-line",String(De[ft].map[0]))):bt.type==="admonition_title_open"&&De[ft].attrPush(["class",`${d.p}-admonition-title`]),ct.renderToken(De,ft,He)},$e=De=>{const ft=De.trim().split(" ",2);de="",ie=ft[0],ft.length>1&&(de=De.substring(ie.length+2)),(de===""||!de)&&(de=ie)};i.block.ruler.before("code","admonition",(De,ft,He,vt)=>{let ct,bt,At,jt=!1,Qt=De.bMarks[ft]+De.tShift[ft],Ut=De.eMarks[ft];if(z!==De.src.charCodeAt(Qt))return!1;for(ct=Qt+1;ct<=Ut&&Z[(ct-Qt)%B]===De.src[ct];ct++);const pn=Math.floor((ct-Qt)/B);if(pn!==E)return!1;ct-=(ct-Qt)%B;const Qn=De.src.slice(Qt,ct),Fn=De.src.slice(ct,Ut);if($e(Fn),vt)return!0;for(bt=ft;bt++,!(bt>=He||(Qt=De.bMarks[bt]+De.tShift[bt],Ut=De.eMarks[bt],Qt=4)){for(ct=Qt+1;ct<=Ut&&Z[(ct-Qt)%B]===De.src[ct];ct++);if(!(Math.floor((ct-Qt)/B){i.renderer.rules.heading_open=(E,Z)=>{var z;const B=E[Z],ie=((z=E[Z+1].children)==null?void 0:z.reduce((pe,$e)=>pe+($e.content||""),""))||"",de=B.markup.length;return b.headsRef.current.push({text:ie,level:de}),B.map&&B.level===0&&(B.attrSet("data-line",String(B.map[0])),B.attrSet("id",b.mdHeadingId(ie,de,b.headsRef.current.length))),i.renderer.renderToken(E,Z,b)},i.renderer.rules.heading_close=(E,Z,z,B,ie)=>ie.renderToken(E,Z,z)},Mo=Ws,Io=(i,b)=>{const E=i.renderer.rules.fence,Z=i.utils.unescapeAll,z=/\[(\w*)(?::([\w ]*))?\]/;function B($e){return $e.info?Z($e.info).trim():""}function ie($e){const De=B($e),[ft=null,He=""]=(z.exec(De)||[]).slice(1);return[ft,He]}function de($e){const De=B($e);return De?De.split(/(\s+)/g)[0]:""}const pe=($e,De,ft,He,vt)=>{if($e[De].hidden)return"";const[ct,bt]=ie($e[De]);if(ct===null)return E($e,De,ft,He,vt);let At,jt,Qt,Ut,pn="",Qn="";for(let Fn=De;Fn<$e.length&&(At=$e[Fn],[jt,Qt]=ie(At),jt===ct);Fn++)At.info=At.info.replace(z,""),At.hidden=!0,Ut=Fn-De>0?"":" checked",pn+=`
  • `,Qn+=` `+E($e,Fn,ft,He,vt);return`
      `+pn+`
    `+Qn+"
    "};i.renderer.rules.fence=pe},Wo=Io,zo=i=>{["paragraph_open","table_open","ordered_list_open","bullet_list_open","blockquote_open","hr","html_block","fence"].forEach(b=>{const E=i.renderer.rules[b];E?i.renderer.rules[b]=(Z,z,B,ie,de)=>{let pe;const $e=E(Z,z,B,ie,de);return Z[z].map&&Z[z].level===0&&!/^",q);if(K===-1)break;W=K+3}return H}function $(I){var H=I.split("");return H=H.filter(function(W){var q=W.charCodeAt(0);return q===127?!1:q<=31?q===10||q===13:!0}),H.join("")}ye.whiteList=d(),ye.getDefaultWhiteList=d,ye.onTag=S,ye.onIgnoreTag=m,ye.onTagAttr=x,ye.onIgnoreTagAttr=V,ye.safeAttrValue=te,ye.escapeHtml=U,ye.escapeQuote=Ce,ye.unescapeQuote=Ee,ye.escapeHtmlEntities=nt,ye.escapeDangerHtml5Entities=qe,ye.clearNonPrintableCharacter=dt,ye.friendlyAttrValue=Je,ye.escapeAttrValue=lt,ye.onIgnoreTagStripAll=Rt,ye.StripTagBody=Re,ye.stripCommentTag=Ie,ye.stripBlankChar=$,ye.cssFilter=a,ye.getDefaultCSSWhiteList=f},68924:function(Xe,ye,o){var l=o(82302),f=o(73268),p=o(82973);function d(S,m){var x=new p(m);return x.process(S)}ye=Xe.exports=d,ye.filterXSS=d,ye.FilterXSS=p,function(){for(var S in l)ye[S]=l[S];for(var m in f)ye[m]=f[m]}(),typeof window!="undefined"&&(window.filterXSS=Xe.exports);function a(){return typeof self!="undefined"&&typeof DedicatedWorkerGlobalScope!="undefined"&&self instanceof DedicatedWorkerGlobalScope}a()&&(self.filterXSS=Xe.exports)},73268:function(Xe,ye,o){var l=o(75938);function f(w){var ce=l.spaceIndex(w),N;return ce===-1?N=w.slice(1,-1):N=w.slice(1,ce+1),N=l.trim(N).toLowerCase(),N.slice(0,1)==="/"&&(N=N.slice(1)),N.slice(-1)==="/"&&(N=N.slice(0,-1)),N}function p(w){return w.slice(0,2)===""||ke===re-1){xe+=N(w.slice(be,ne)),Ce=w.slice(ne,ke+1),ae=f(Ce),xe+=ce(ne,xe.length,ae,Ce,p(Ce)),be=ke+1,ne=!1;continue}if(Ee==='"'||Ee==="'")for(var nt=1,qe=w.charAt(ke-nt);qe.trim()===""||qe==="=";){if(qe==="="){me=Ee;continue e}qe=w.charAt(ke-++nt)}}else if(Ee===me){me=!1;continue}}return be0;ce--){var N=w[ce];if(N!==" ")return N==="="?ce:-1}}function U(w){return w[0]==='"'&&w[w.length-1]==='"'||w[0]==="'"&&w[w.length-1]==="'"}function te(w){return U(w)?w.substr(1,w.length-2):w}ye.parseTag=d,ye.parseAttr=S},75938:function(Xe){Xe.exports={indexOf:function(ye,o){var l,f;if(Array.prototype.indexOf)return ye.indexOf(o);for(l=0,f=ye.length;l";var $=x(lt),I=xe[Je],H=a($.html,function(W,q){var K=S.indexOf(I,W)!==-1,Se=me(Je,W,q,K);return m(Se)?K?(q=re(Je,W,q,Ce),q?W+'="'+q+'"':W):(Se=ke(Je,W,q,K),m(Se)?void 0:Se):Se});return lt="<"+Je,H&&(lt+=" "+H),$.closing&&(lt+=" /"),lt+=">",lt}else return Ie=ne(Je,lt,Re),m(Ie)?ae(lt):Ie},ae);return Ee&&(nt=Ee.remove(nt)),nt},Xe.exports=te}}]);