TYPO3 v15 dev-main snapshot ()

This commit is contained in:
wappler committed 2026-08-10 22:31:00 +02:00
commit f9941541b7
1178 files changed
+135377

No files matched your search

@@ -0,0 +1 @@
import{Annotation as Qe,StateEffect as I,EditorSelection as v,codePointAt as C,codePointSize as O,fromCodePoint as ce,Facet as fe,combineConfig as Xe,StateField as X,Prec as Y,Text as Ye,Transaction as Ge,MapMode as G,RangeValue as Je,RangeSet as Ze,CharCategory as J}from"@codemirror/state";import{Direction as _e,logException as Z,showTooltip as et,EditorView as R,ViewPlugin as tt,getTooltip as he,Decoration as U,WidgetType as it,keymap as pe}from"@codemirror/view";import{syntaxTree as B,indentUnit as nt}from"@codemirror/language";class _{constructor(e,t,n,o){this.state=e,this.pos=t,this.explicit=n,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=B(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),s=o.search(ge(e,!1));return s<0?null:{from:n+s,to:this.pos,text:o.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function ue(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function ot(i){let e=Object.create(null),t=Object.create(null);for(let{label:o}of i){e[o[0]]=!0;for(let s=1;s<o.length;s++)t[o[s]]=!0}let n=ue(e)+ue(t)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function de(i){let e=i.map(o=>typeof o=="string"?{label:o}:o),[t,n]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:ot(e);return o=>{let s=o.matchBefore(n);return s||o.explicit?{from:s?s.from:o.pos,options:e,validFor:t}:null}}function st(i,e){return t=>{for(let n=B(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return e(t);if(n.type.isTop)break}return null}}function lt(i,e){return t=>{for(let n=B(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}class me{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function T(i){return i.selection.main.from}function ge(i,e){var t;let{source:n}=i,o=e&&n[0]!="^",s=n[n.length-1]!="$";return!o&&!s?i:new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}const V=Qe.define();function ye(i,e,t,n){let{main:o}=i.selection,s=t-o.from,l=n-o.from;return Object.assign(Object.assign({},i.changeByRange(r=>r!=o&&t!=n&&i.sliceDoc(r.from+s,r.from+l)!=i.sliceDoc(t,n)?{range:r}:{changes:{from:r.from+s,to:n==o.from?r.to:r.from+l,insert:e},range:v.cursor(r.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const be=new WeakMap;function rt(i){if(!Array.isArray(i))return i;let e=be.get(i);return e||be.set(i,e=de(i)),e}const H=I.define(),F=I.define();class at{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=C(e,t),o=O(n);this.chars.push(n);let s=e.slice(t,t+o),l=s.toUpperCase();this.folded.push(C(l==s?s.toLowerCase():l,0)),t+=o}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:o,precise:s,byWord:l}=this;if(t.length==1){let d=C(e,0),A=O(d),S=A==e.length?0:-100;if(d!=t[0])if(d==n[0])S+=-200;else return null;return this.ret(S,[0,A])}let r=e.indexOf(this.pattern);if(r==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,c=0;if(r<0){for(let d=0,A=Math.min(e.length,200);d<A&&c<a;){let S=C(e,d);(S==t[c]||S==n[c])&&(o[c++]=d),d+=O(S)}if(c<a)return null}let f=0,h=0,p=!1,u=0,g=-1,x=-1,K=/[a-z]/.test(e),k=!0;for(let d=0,A=Math.min(e.length,200),S=0;d<A&&h<a;){let b=C(e,d);r<0&&(f<a&&b==t[f]&&(s[f++]=d),u<a&&(b==t[u]||b==n[u]?(u==0&&(g=d),x=d+1,u++):u=0));let N,Q=b<255?b>=48&&b<=57||b>=97&&b<=122?2:b>=65&&b<=90?1:0:(N=ce(b))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!d||Q==1&&K||S==0&&Q!=0)&&(t[h]==b||n[h]==b&&(p=!0)?l[h++]=d:l.length&&(k=!1)),S=Q,d+=O(b)}return h==a&&l[0]==0&&k?this.result(-100+(p?-200:0),l,e):u==a&&g==0?this.ret(-200-e.length+(x==e.length?0:-100),[0,x]):r>-1?this.ret(-700-e.length,[r,r+this.pattern.length]):u==a?this.ret(-900-e.length,[g,x]):h==a?this.result(-100+(p?-200:0)+-700+(k?0:-1100),l,e):t.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,t,n){let o=[],s=0;for(let l of t){let r=l+(this.astral?O(C(n,l)):1);s&&o[s-1]==l?o[s-1]=r:(o[s++]=l,o[s++]=r)}return this.ret(e-n.length,o)}}class ct{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:Line truncated
@@ -0,0 +1 @@
import{Annotation as Me,Facet as be,combineConfig as qt,StateField as Kt,Transaction as X,ChangeSet as $t,ChangeDesc as _t,EditorSelection as h,StateEffect as Qt,Text as Ee,findClusterBreak as O,countColumn as Y,CharCategory as L}from"@codemirror/state";import{EditorView as M,Direction as Xt}from"@codemirror/view";import{IndentContext as Te,getIndentation as Oe,indentString as U,matchBrackets as b,syntaxTree as Z,getIndentUnit as j,indentUnit as Yt}from"@codemirror/language";import{NodeProp as ee}from"@lezer/common";const Ie=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=te(e.state,r.from);return n.line?Re(e):n.block?Ue(e):!1};function D(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let l=e(t,r);return l?(n(r.update(l)),!0):!1}}const Re=D(ne,0),Zt=D(ne,1),jt=D(ne,2),ve=D(N,0),en=D(N,1),tn=D(N,2),Ue=D((e,t)=>N(e,t,rn(t)),0);function te(e,t){let r=e.languageDataAt("commentTokens",t);return r.length?r[0]:{}}const I=50;function nn(e,{open:t,close:r},n,l){let o=e.sliceDoc(n-I,n),c=e.sliceDoc(l,l+I),s=/\s*$/.exec(o)[0].length,i=/^\s*/.exec(c)[0].length,f=o.length-s;if(o.slice(f-t.length,f)==t&&c.slice(i,i+r.length)==r)return{open:{pos:n-s,margin:s&&1},close:{pos:l+i,margin:i&&1}};let u,a;l-n<=2*I?u=a=e.sliceDoc(n,l):(u=e.sliceDoc(n,n+I),a=e.sliceDoc(l-I,l));let d=/^\s*/.exec(u)[0].length,B=/\s*$/.exec(a)[0].length,g=a.length-B-r.length;return u.slice(d,d+t.length)==t&&a.slice(g,g+r.length)==r?{open:{pos:n+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:l-B-r.length,margin:/\s/.test(a.charAt(g-1))?1:0}}:null}function rn(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),l=r.to<=n.to?n:e.doc.lineAt(r.to),o=t.length-1;o>=0&&t[o].to>n.from?t[o].to=l.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:l.to})}return t}function N(e,t,r=t.selection.ranges){let n=r.map(o=>te(t,o.from).block);if(!n.every(o=>o))return null;let l=r.map((o,c)=>nn(t,n[c],o.from,o.to));if(e!=2&&!l.every(o=>o))return{changes:t.changes(r.map((o,c)=>l[c]?[]:[{from:o.from,insert:n[c].open+" "},{from:o.to,insert:" "+n[c].close}]))};if(e!=1&&l.some(o=>o)){let o=[];for(let c=0,s;c<l.length;c++)if(s=l[c]){let i=n[c],{open:f,close:u}=s;o.push({from:f.pos-i.open.length,to:f.pos+f.margin},{from:u.pos-u.margin,to:u.pos+i.close.length})}return{changes:o}}return null}function ne(e,t,r=t.selection.ranges){let n=[],l=-1;for(let{from:o,to:c}of r){let s=n.length,i=1e9,f=te(t,o).line;if(f){for(let u=o;u<=c;){let a=t.doc.lineAt(u);if(a.from>l&&(o==c||c>a.from)){l=a.from;let d=/^\s*/.exec(a.text)[0].length,B=d==a.length,g=a.text.slice(d,d+f.length)==f?d:-1;d<a.text.length&&d<i&&(i=d),n.push({line:a,comment:g,token:f,indent:d,empty:B,single:!1})}u=a.to+1}if(i<1e9)for(let u=s;u<n.length;u++)n[u].indent<n[u].line.text.length&&(n[u].indent=i);n.length==s+1&&(n[s].single=!0)}}if(e!=2&&n.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:s,token:i,indent:f,empty:u,single:a}of n)(a||!u)&&o.push({from:s.from+f,insert:i+" "});let c=t.changes(o);return{changes:c,selection:t.selection.map(c,1)}}else if(e!=1&&n.some(o=>o.comment>=0)){let o=[];for(let{line:c,comment:s,token:i}of n)if(s>=0){let f=c.from+s,u=f+i.length;c.text[u-c.from]==" "&&u++,o.push({from:f,to:u})}return{changes:o}}return null}const re=Me.define(),Ne=Me.define(),Ve=be.define(),Fe=be.define({combine(e){return qt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,l)=>t(n,l)||r(n,l)})}}),V=Kt.define({create(){return C.empty},update(e,t){let r=t.state.facet(Fe),n=t.annotation(re);if(n){let i=p.fromTransaction(t,n.selection),f=n.side,u=f==0?e.undone:e.done;return i?u=P(u,u.length,r.minDepth,i):u=ze(u,t.startState.selection),new C(f==0?n.rest:u,f==0?u:n.rest)}let l=t.annotation(Ne);if((l=="full"||l=="before")&&(e=e.isolate()),t.annotation(X.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=p.fromTransaction(t),c=t.annotation(X.time),s=t.annotation(X.userEvent);return o?e=e.addChanges(o,c,s,r,t):t.selection&&(e=e.addSelection(t.startState.selection,c,s,r.newGroupDelay)),(l=="full"||l=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new C(e.done.map(p.fromJSON),e.undone.map(p.fromJSON))}});function on(e={}){return[V,Fe.of(e),M.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?oe:t.inputType=="historyRedo"?G:null;return n?(t.preventDefault(),n(r)):!1}})]}const ln=V;function F(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let l=r.field(V,!1);if(!l)return!1;let o=l.pop(e,r,t);return o?(n(o),!0):!1}}const oe=F(0,!1),G=F(1,!1),Ge=F(0,!0),Pe=F(1,!0);function Je(e){return function(t){let r=t.field(V,!1);if(!r)return 0;let n=e==0?r.done:r.undone;return n.length-(n.length&&!n[0].changes?1:0)}}const cn=Je(0),sn=Je(1);class p{constructor(t,r,n,l,o){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=l,this.selectiLine truncated
@@ -0,0 +1 @@
import{parser as v}from"@lezer/css";import{syntaxTree as y,LRLanguage as k,indentNodeProp as x,continuedIndent as z,foldNodeProp as S,foldInside as q,LanguageSupport as C}from"@codemirror/language";import{NodeWeakMap as F,IterMode as N}from"@lezer/common";let c=null;function u(){if(!c&&typeof document=="object"&&document.body){let{style:r}=document.body,a=[],o=new Set;for(let t in r)t!="cssText"&&t!="cssFloat"&&typeof r[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),o.has(t)||(a.push(t),o.add(t)));c=a.sort().map(t=>({type:"property",label:t}))}return c||[]}const m=["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(r=>({type:"class",label:r})),h=["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","skeLine truncated
@@ -0,0 +1 @@
import{parser as W,configureNesting as L}from"@lezer/html";import{cssLanguage as I,css as J}from"@codemirror/lang-css";import{javascriptLanguage as S,typescriptLanguage as K,jsxLanguage as Q,tsxLanguage as X,javascript as Y}from"@codemirror/lang-javascript";import{EditorView as Z}from"@codemirror/view";import{EditorSelection as ee}from"@codemirror/state";import{syntaxTree as q,LRLanguage as te,indentNodeProp as le,foldNodeProp as ae,bracketMatchingHandle as ne,LanguageSupport as re}from"@codemirror/language";const T=["_blank","_self","_top","_parent"],N=["ascii","utf-8","utf-16","latin1","latin1"],j=["get","post","put","delete"],E=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],p=["true","false"],l={},se={a:{attrs:{href:null,ping:null,type:null,media:null,target:T,hreflang:null}},abbr:l,address:l,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:l,aside:l,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:l,base:{attrs:{href:null,target:T}},bdi:l,bdo:l,blockquote:{attrs:{cite:null}},body:l,br:l,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:E,formmethod:j,formnovalidate:["novalidate"],formtarget:T,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:l,center:l,cite:l,code:l,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:l,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:l,div:l,dl:l,dt:l,em:l,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:l,figure:l,footer:l,form:{attrs:{action:null,name:null,"accept-charset":N,autocomplete:["on","off"],enctype:E,method:j,novalidate:["novalidate"],target:T}},h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:l,hgroup:l,hr:l,html:{attrs:{manifest:null}},i:l,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:E,formmethod:j,formnovalidate:["novalidate"],formtarget:T,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:l,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:l,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:l,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:N,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:l,noscript:l,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:l,param:{attrs:{name:null,value:null}},pre:l,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:l,rt:l,ruby:l,samp:l,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:N}},section:l,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:l,source:{attrs:{srcLine truncated
@@ -0,0 +1,13 @@
import{parser as M}from"@lezer/javascript";import{syntaxTree as S,LRLanguage as _,indentNodeProp as R,continuedIndent as $,flatIndent as W,delimitedIndent as Z,foldNodeProp as z,foldInside as H,defineLanguageFacet as K,sublanguageProp as T,LanguageSupport as q}from"@codemirror/language";import{EditorSelection as G}from"@codemirror/state";import{EditorView as Q}from"@codemirror/view";import{snippetCompletion as p,ifNotIn as U,completeFromList as Y}from"@codemirror/autocomplete";import{NodeWeakMap as ee,IterMode as te}from"@lezer/common";const w=[p("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),p("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),p("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),p("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),p("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),p(`try {
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),p("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),p(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),p(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),p('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),p('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],I=w.concat([p("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),p("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),p("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),x=new ee,D=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function y(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const ne=["FunctionDeclaration"],re={FunctionDeclaration:y("function"),ClassDeclaration:y("class"),ClassExpression:()=>!0,EnumDeclaration:y("constant"),TypeAliasDeclaration:y("type"),NamespaceDeclaration:y("namespace"),VariableDefinition(e,t){e.matchContext(ne)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function J(e,t){let r=x.get(t);if(r)return r;let n=[],a=!0;function i(o,l){let c=e.sliceString(o.from,o.to);n.push({label:c,type:l})}return t.cursor(te.IncludeAnonymous).iterate(o=>{if(a)a=!1;else if(o.name){let l=re[o.name];if(l&&l(o,i)||D.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of J(e,o.node))n.push(l);return!1}}),x.set(t,n),n}const h=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,k=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function X(e){let t=S(e.state).resolveInner(e.pos,-1);if(k.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&h.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let a=t;a;a=a.parent)D.has(a.name)&&(n=n.concat(J(e.state.doc,a)));return{options:n,from:r?t.from:e.pos,validFor:h}}function v(e,t,r){var n;let a=[];for(;;){let i=t.firstChild,o;if(i?.name=="VariableName")return a.push(e(i)),{path:a.reverse(),name:r};if(i?.name=="MemberExpression"&&((n=o=i.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")a.push(e(o)),t=i;else return null}}function E(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=S(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?v(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?v(t,r.parent,""):k.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&h.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?v(t,r,""):e.explicit?{path:[],name:""}:null}function oe(e,t){let r=[],n=new Set;for(let a=0;;a++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||n.has(o))continue;n.add(o);let l;try{l=e[o]}catch{continue}r.push({label:o,type:typeof l=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function ae(e){let t=new Map;return r=>{let n=E(r);if(!n)return null;let a=e;for(let o of n.path)if(a=a[o],!a)return null;let i=t.get(a);return i||t.set(a,i=oe(a,!n.path.length)),{from:r.pos-n.name.length,options:i,validFor:h}}}const m=_.define({name:"javascript",parser:M.configure({props:[R.add({IfStatement:$({except:/^\s*({|else\b)/}),TryStatement:$({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:W,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:Z({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":$({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),z.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":H,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),N={test:e=>/^JSX/.test(e.name),facet:K({commentTokens:{block:{open:"{/*",close:"*/}"}}})},P=m.configure({dialect:"ts"},"typescript"),A=m.configure({dialect:"jsx",props:[T.add(e=>e.isTop?[N]:void 0)]}),L=m.configure({dialect:"jsx ts",props:[T.add(e=>e.isTop?[N]:void 0)]},"typescript");let O=e=>({label:e,type:"keyword"});const F="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(O),ie=F.concat(["declare","implements","private","protected","public"].map(O));function le(e={}){let t=e.jsx?e.typescript?L:A:e.typescript?P:m,r=e.typescript?I.concat(ie):w.co Line truncated
@@ -0,0 +1 @@
import{parser as a}from"@lezer/json";import{LRLanguage as s,indentNodeProp as i,continuedIndent as r,foldNodeProp as c,foldInside as d,LanguageSupport as g}from"@codemirror/language";const m=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=p(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function p(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const o=s.define({name:"json",parser:a.configure({props:[i.add({Object:r({except:/^\s*\}/}),Array:r({except:/^\s*\]/})}),c.add({"Object Array":d})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function u(){return new g(o)}export{u as json,o as jsonLanguage,m as jsonParseLinter};
@@ -0,0 +1 @@
import{parser as l}from"@lezer/php";import{parseMixed as i}from"@lezer/common";import{html as p}from"@codemirror/lang-html";import{LRLanguage as u,indentNodeProp as d,continuedIndent as r,delimitedIndent as m,foldNodeProp as f,foldInside as c,LanguageSupport as g}from"@codemirror/language";const a=u.define({name:"php",parser:l.configure({props:[d.add({IfStatement:r({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:r({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:e=>{let o=e.textAfter,t=/^\s*\}/.test(o),n=/^\s*(case|default)\b/.test(o);return e.baseIndent+(t?0:n?1:2)*e.unit},ColonBlock:e=>e.baseIndent+e.unit,"Block EnumBody DeclarationList":m({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:r({except:/^({|end(for|foreach|switch|while)\b)/})}),f.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":c,ColonBlock(e){return{from:e.from+1,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function h(e={}){let o=[],t;if(e.baseLanguage!==null)if(e.baseLanguage)t=e.baseLanguage;else{let n=p({matchClosingTags:!1});o.push(n.support),t=n.language}return new g(a.configure({wrap:t&&i(n=>n.type.isTop?{parser:t.parser,overlay:s=>s.name=="Text"}:null),top:e.plain?"Program":"Template"}),o)}export{h as php,a as phpLanguage};
@@ -0,0 +1,2 @@
import{syntaxTree as ie,indentNodeProp as se,continuedIndent as oe,foldNodeProp as le,LRLanguage as ce,LanguageSupport as de}from"@codemirror/language";import{styleTags as me,tags as i}from"@lezer/highlight";import{ExternalTokenizer as ue,LRParser as fe}from"@lezer/lr";import{ifNotIn as pe,completeFromList as ge}from"@codemirror/autocomplete";const he=36,X=1,_e=2,b=3,S=4,be=5,ve=6,ye=7,ke=8,xe=9,Oe=10,we=11,Qe=12,Ce=13,Se=14,Pe=15,qe=16,Te=17,I=18,Ue=19,R=20,j=21,D=22,ze=23,Be=24;function P(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function Le(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function p(t,e,r){for(let a=!1;;){if(t.next<0)return;if(t.next==e&&!a){t.advance();return}a=r&&!a&&t.next==92,t.advance()}}function Xe(t,e){e:for(;;){if(t.next<0)return console.log("exit at end",t.pos);if(t.next==36){t.advance();for(let r=0;r<e.length;r++){if(t.next!=e.charCodeAt(r))continue e;t.advance()}if(t.next==36){t.advance();return}}else t.advance()}}function Ie(t,e){let r="[{<(".indexOf(String.fromCharCode(e)),a=r<0?e:"]}>)".charCodeAt(r);for(;;){if(t.next<0)return;if(t.next==a&&t.peek(1)==39){t.advance(2);return}t.advance()}}function q(t,e){for(;!(t.next!=95&&!P(t.next));)e!=null&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Re(t){if(t.next==39||t.next==34||t.next==96){let e=t.next;t.advance(),p(t,e,!1)}else q(t)}function Z(t,e){for(;t.next==48||t.next==49;)t.advance();e&&t.next==e&&t.advance()}function N(t,e){for(;;){if(t.next==46){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(t.next==69||t.next==101)for(t.advance(),(t.next==43||t.next==45)&&t.advance();t.next>=48&&t.next<=57;)t.advance()}function V(t){for(;!(t.next<0||t.next==10);)t.advance()}function g(t,e){for(let r=0;r<e.length;r++)if(e.charCodeAt(r)==t)return!0;return!1}const T=` \r
`;function $(t,e,r){let a=Object.create(null);a.true=a.false=be,a.null=a.unknown=ve;for(let n of t.split(" "))n&&(a[n]=R);for(let n of e.split(" "))n&&(a[n]=j);for(let n of(r||"").split(" "))n&&(a[n]=Be);return a}const h="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",_="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",U={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:$(_,h)};function je(t,e,r,a){let n={};for(let s in U)n[s]=(t.hasOwnProperty(s)?t:U)[s];return e&&(n.words=$(e,r||"",a)),n}function A(t){return new ue(e=>{var r;let{next:a}=e;if(e.advance(),g(a,T)){for(;g(e.next,T);)e.advance();e.acceptToken(he)}else if(a==36&&t.doubleDollarQuotedStrings){let n=q(e,"");e.next==36&&(e.advance(),Xe(e,n),e.acceptToken(b))}else if(a==39||a==34&&t.doubleQuotedStrings)p(e,a,t.backslashEscapes),e.acceptToken(b);else if(a==35&&t.hashComments||a==47&&e.next==47&&t.slashComments)V(e),e.acceptToken(X);else if(a==45&&e.next==45&&(!t.spaceAfterDashes||e.peek(1)==32))V(e),e.acceptToken(X);else if(a==47&&e.next==42){e.advance();for(let n=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(n--,e.advance(),!n)break}else s==47&&e.next==42&&(n++,e.advance())}e.acceptToken(_e)}else if((a==101||a==69)&&e.next==39)e.advance(),p(e,39,!0),e.acceptToken(b);else if((a==110||a==78)&&e.next==39&&t.charSetCasts)e.advance(),p(e,39,t.backslashEscapes),e.acceptToken(b);else if(a==95&&t.charSetCasts)for(let n=0;;n++){if(e.next==39&&n>1){e.advance(),p(e,39,t.backslashEscapes),e.acceptToken(b);break}if(!P(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(a==113||a==81)&&e.next==39&&e.peek(1)>0&&!g(e.peek(1),T)){let n=e.peek(1);e.advance(2),Ie(e,n),e.acceptToken(b)}else if(a==40)e.acceptToken(ye);else if(a==41)e.acceptToken(ke);else if(a==123)e.acceptToken(xe);else if(a==125)e.acceptToken(Oe);else if(a==91)e.acceptToken(we);else if(a==93)e.acceptToken(Qe);else if(a==59)e.acceptToken(Ce);else if(t.unquotedBitLiterals&&a==48&&e.next==98)e.advance(),Z(e),e.acceptToken(D);else if((a==98||a==66)&&(e.next==39||e.next==34)){const n=e.next;e.advance(),t.treatBitsAsBytes?(p(e,n,t.backslashEscapes),e.acceptToken(ze)):(Z(e,n),e.acceptToken(D))}else if(a==48&&(e.next==120||e.next==88)||(a==120||a==88)&&e.next==39){let n=e.next==39;for(e.advance();Le(e.next);)e.advance();n&&e.next==39&&e.advance(),e.acceptToken(S)}else if(a==46&&e.next>=48&&e.next<=57)N(e,!0),e.acceptToken(S);else if(a==46)e.acceptToken(Se);else if(a>=48&&a<=57)N(e,!1),e.acceptToken(S);else if(g(a,t.operatorChars)){for(;g(e.next,t.operatorChars);)e.advance();e.acceptToken(Pe)}else if(g(a,t.specialVar))e.next==a&&e.advance(),Re(e),e.acceptToken(Te);else if(g(a,t.identifierQuotes))p(e,a,!1),e.acc Line truncated
@@ -0,0 +1 @@
import{parser as L}from"@lezer/xml";import{syntaxTree as E,LRLanguage as _,indentNodeProp as w,foldNodeProp as x,bracketMatchingHandle as M,LanguageSupport as k}from"@codemirror/language";import{EditorSelection as D}from"@codemirror/state";import{EditorView as P}from"@codemirror/view";function v(e,t){let i=t&&t.getChild("TagName");return i?e.sliceString(i.from,i.to):""}function N(e,t){let i=t&&t.firstChild;return!i||i.name!="OpenTag"?"":v(e,i)}function B(e,t,i){let n=t&&t.getChildren("Attribute").find(o=>o.from<=i&&o.to>=i),a=n&&n.getChild("AttributeName");return a?e.sliceString(a.from,a.to):""}function S(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function H(e,t){var i;let n=E(e).resolveInner(t,-1),a=null;for(let o=n;!a&&o.parent;o=o.parent)(o.name=="OpenTag"||o.name=="CloseTag"||o.name=="SelfClosingTag"||o.name=="MismatchedCloseTag")&&(a=o);if(a&&(a.to>t||a.lastChild.type.isError)){let o=a.parent;if(n.name=="TagName")return a.name=="CloseTag"||a.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:o}:{type:"openTag",from:n.from,context:S(o)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:a};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:a};let s=n==a||n.name=="Attribute"?n.childBefore(t):n;return s?.name=="StartTag"?{type:"openTag",from:t,context:S(o)}:s?.name=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:o}:s?.name=="Is"?{type:"attrValue",from:t,context:a}:s?{type:"attrName",from:t,context:a}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:t,context:n.parent};for(;n.parent&&n.to==t&&!(!((i=n.lastChild)===null||i===void 0)&&i.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:t,context:n.name=="Element"?n:S(n)}:null}class R{constructor(t,i,n){this.attrs=i,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(a=>({label:a,type:"text"})):[]}}const j=/^[:\-\.\w\u00b7-\uffff]*$/;function A(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function V(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function $(e,t){let i=[],n=[],a=Object.create(null);for(let l of t){let p=A(l);i.push(p),l.global&&n.push(p),l.values&&(a[l.name]=l.values.map(V))}let o=[],s=[],h=Object.create(null);for(let l of e){let p=n,u=a;l.attributes&&(p=p.concat(l.attributes.map(r=>typeof r=="string"?i.find(b=>b.label==r)||{label:r,type:"property"}:(r.values&&(u==a&&(u=Object.create(u)),u[r.name]=r.values.map(V)),A(r)))));let d=new R(l,p,u);h[d.name]=d,o.push(d),l.top&&s.push(d)}s.length||(s=o);for(let l=0;l<o.length;l++){let p=e[l],u=o[l];if(p.children)for(let d of p.children)h[d]&&u.children.push(h[d]);else u.children=o}return l=>{var p;let{doc:u}=l.state,d=H(l.state,l.pos);if(!d||d.type=="tag"&&!l.explicit)return null;let{type:r,from:b,context:c}=d;if(r=="openTag"){let m=s,f=N(u,c);if(f){let g=h[f];m=g?.children||o}return{from:b,options:m.map(g=>g.completion),validFor:j}}else if(r=="closeTag"){let m=N(u,c);return m?{from:b,to:l.pos+(u.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((p=h[m])===null||p===void 0?void 0:p.closeNameCompletion)||{label:m+">",type:"type"}],validFor:j}:null}else if(r=="attrName"){let m=h[v(u,c)];return{from:b,options:m?.attrs||n,validFor:j}}else if(r=="attrValue"){let m=B(u,c,b);if(!m)return null;let f=h[v(u,c)],g=(f?.attrValues||a)[m];return!g||!g.length?null:{from:b,to:l.pos+(u.sliceString(l.pos,l.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(r=="tag"){let m=N(u,c),f=h[m],g=[],C=c&&c.lastChild;m&&(!C||C.name!="CloseTag"||v(u,C)!=m)&&g.push(f?f.closeCompletion:{label:"</"+m+">",type:"type",boost:2});let O=g.concat((f?.children||(c?o:s)).map(T=>T.openCompletion));if(c&&f?.text.length){let T=c.firstChild;T.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(T.to,l.pos))&&(O=O.concat(f.text))}return{from:b,options:O,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const y=_.define({name:"xml",parser:L.configure({props:[w.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),x.add({Element(e){let t=e.firstChild,i=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:i.name=="CloseTag"?i.from:e.to}}}),M.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function q(e={}){Line truncated
@@ -0,0 +1,3 @@
import{NodeProp as y,IterMode as he,Tree as b,TreeFragment as H,Parser as yt,NodeType as U,NodeSet as fe}from"@lezer/common";import{StateEffect as j,StateField as Q,Facet as v,EditorState as L,countColumn as ue,combineConfig as vt,RangeSet as xt,RangeSetBuilder as X,Prec as St}from"@codemirror/state";import{ViewPlugin as V,logException as ce,EditorView as w,Decoration as p,WidgetType as Tt,gutter as de,GutterMarker as pe,Direction as $}from"@codemirror/view";import{tags as u,tagHighlighter as ge,highlightTree as me,styleTags as ke}from"@lezer/highlight";import{StyleModule as Pt}from"style-mod";var Y;const P=new y;function Z(n){return v.define({combine:n?t=>t.concat(n):void 0})}const At=new y;class g{constructor(t,e,r=[],i=""){this.data=t,this.name=i,L.prototype.hasOwnProperty("tree")||Object.defineProperty(L.prototype,"tree",{get(){return m(this)}}),this.parser=e,this.extension=[S.of(this),L.languageData.of((s,o,l)=>{let a=Ct(s,o,l),h=a.type.prop(P);if(!h)return[];let f=s.facet(h),c=a.type.prop(At);if(c){let k=a.resolve(o-a.from,l);for(let d of c)if(d.test(k,s)){let x=s.facet(d.facet);return d.type=="replace"?x:x.concat(f)}}return f})].concat(r)}isActiveAt(t,e,r=-1){return Ct(t,e,r).type.prop(P)==this.data}findRegions(t){let e=t.facet(S);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(P)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(y.mounted);if(l){if(l.tree.prop(P)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let h=s.children[a];h instanceof b&&i(h,s.positions[a]+o)}};return i(m(t),0),r}get allowsNesting(){return!0}}g.setState=j.define();function Ct(n,t,e){let r=n.facet(S),i=m(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(t,e,he.ExcludeBuffers))s.type.isTop&&(i=s);return i}class J extends g{constructor(t,e,r){super(t,e,[],r),this.parser=e}static define(t){let e=Z(t.languageData);return new J(e,t.parser.configure({props:[P.add(r=>r.isTop?e:void 0)]}),t.name)}configure(t,e){return new J(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function m(n){let t=n.field(g.state,!1);return t?t.tree:b.empty}function It(n,t,e=50){var r;let i=(r=n.field(g.state,!1))===null||r===void 0?void 0:r.context;if(!i)return null;let s=i.viewport;i.updateViewport({from:0,to:t});let o=i.isDone(t)||i.work(e,t)?i.tree:null;return i.updateViewport(s),o}function be(n,t=n.doc.length){var e;return((e=n.field(g.state,!1))===null||e===void 0?void 0:e.context.isDone(t))||!1}function we(n,t=n.viewport.to,e=100){let r=It(n.state,t,e);return r!=m(n.state)&&n.dispatch({}),!!r}function ye(n){var t;return((t=n.plugin(Lt))===null||t===void 0?void 0:t.isWorking())||!1}class Dt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let r=this.cursorPos-this.string.length;return t<r||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-r,e-r)}}let N=null;class C{constructor(t,e,r=[],i,s,o,l,a){this.parser=t,this.state=e,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,r){return new C(t,e,[],b.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Dt(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=b.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(H.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(H.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=N;N=this;try{return t()}finally{N=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ot(t,e.from,e.to);return t}changes(t,e){let{fragments:r,tree:i,treeLen:s,viLine truncated
`&&(e="");else{let r=e.indexOf(`
`);r>-1&&(e=e.slice(0,r))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),r=t+e.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(e=e.slice(0,s-(r-e.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,l=this.lineAfter(o);e+=l,r=o+l.length}return{line:e,end:r}}skipGapsTo(t,e,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=t+e;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;e+=o-i}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,r,i,s){if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let o=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-o}return this.chunk.push(t,e,r,i),s}parseLine(t){let{line:e,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new dt(e,t?t.state.tabSize:4,t?B(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Zt(s.token,o,this.state);if(l&&(i=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=b.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:cn,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new b(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new b(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Zt(n,t,e){t.start=t.pos;for(let r=0;r<10;r++){let i=n(t,e);if(t.pos>t.start)return i}throw new Error("Stream parser failed to advance stream.")}const gt=Object.create(null),E=[U.none],cn=new fe(E),te=[],ee=Object.create(null),ne=Object.create(null);for(let[n,t]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"]])ne[n]=ie(gt,t);class re{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ne)}resolve(t){return t?this.table[t]||(this.table[t]=ie(this.extra,t)):0}}const dn=new re(gt);function mt(n,t){te.indexOf(n)>-1||(te.push(n),console.warn(t))}function ie(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let f=n[h]||u[h];f?typeof f=="function"?a.length?a=a.map(f):mt(h,`Modifier ${h} used at start of tag`):a.length?mt(h,`Tag ${h} used as modifier`):a=Array.isArray(f)?f:[f]:mt(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+e.map(l=>l.id),s=ee[i];if(s)return s.id;let o=ee[i]=U.define({id:E.length,name:r,props:[ke({[r]:e})]});return E.push(o),o.id}function pn(n){let t=U.define({id:E.length,name:"Document",props:[P.add(()=>n)],top:!0});return E.push(t),t}function se(n){return n.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(n)}function oe(n){for(let t=n.iter();!t.next().done;)if(se(t.value))return!0;return!1}function gn(n){let t=!1;return n.iterChanges((e,r,i,s,o)=>{!t&&oe(o)&&(t=!0)}),t}const kt=v.define({combine:n=>n.some(t=>t)});function mn(n={}){let t=[kn];return n.alwaysIsolate&&t.push(kt.of(!0)),t}const kn=V.fromClass(class{constructor(n){this.always=n.state.facet(kt)||n.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection),this.hasRTL=!this.always&&oe(n.state.doc),this.tree=m(n.state),this.decorations=this.always||this.hasRTL?le(n,this.tree,this.always):p.none}update(n){let t=n.state.facet(kt)||n.view.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection);if(!t&&!this.hasRTL&&gn(n.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let e=m(n.state);(t!=this.always||e!=this.tree||n.docChanged||n.viewportChanged)&&(this.tree=e,this.always=t,this.decorations=le(n.view,e,t))}},{provide:n=>{function t(e){var r,i;return(i=(r=e.plugin(n))===null||r===void 0?void 0:r.decorations)!==null&&i!==void 0?i:p.none}return[w.outerDecorations.of(t),St.lowest(w.bidiIsolatedRanges.of(t))]}});function le(n,t,e){let r=new X,i=n.visibleRanges;e||(i=bn(i,n.state.doc));for(let{from:s,to:o}of i)t.iterate({enter:l=>{let a=l.type.prop(y.isolate);a&&r.add(l.from,l.to,wn[a])},from:s,to:o});return r.finish()}function bn(n,t){let e=t.iter(),r=0,i=[],s=null;for(let{from:o,to:l}of n)if(!(s&&s.to>o&&(o=s.to,o>=l)))for(r+e.value.length<o&&(e.next(o-(r+e.value.length)),r=o);;){let a=r,h=r+e.value.length;if(!e.lineBreak&&se(e.value)&&(s&&s.to>a-10?s.to=Math.min(l,h):i.push(s={from:a,to:Math.min(l,h)})),h>=l)break;r=h,e.next()}return i}const wn={rtl:p.mark({class:"cm-iso",inclusive:!0,att Line truncated
@@ -0,0 +1 @@
import{Decoration as h,showPanel as K,EditorView as y,ViewPlugin as U,logException as X,gutter as J,showTooltip as Q,hoverTooltip as ee,getPanel as te,WidgetType as ie,GutterMarker as ne}from"@codemirror/view";import{StateEffect as k,StateField as S,Facet as M,combineConfig as A,RangeSet as R}from"@codemirror/state";import u from"crelt";class se{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}}class g{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let s=e,o=i.facet(m).markerFilter;o&&(s=o(s,i));let l=h.set(s.map(r=>r.from==r.to||r.from==r.to-1&&i.doc.lineAt(r.from).to==r.from?h.widget({widget:new ue(r),diagnostic:r}).range(r.from):h.mark({attributes:{class:"cm-lintRange cm-lintRange-"+r.severity+(r.markClass?" "+r.markClass:"")},diagnostic:r}).range(r.from,r.to)),!0);return new g(l,n,b(l))}}function b(t,e=null,n=0){let i=null;return t.between(n,1e9,(s,o,{spec:l})=>{if(!(e&&l.diagnostic!=e))return i=new se(s,o,l.diagnostic),!1}),i}function F(t,e){let n=e.pos,i=e.end||n,s=t.state.facet(m).hideOn(t,n,i);if(s!=null)return s;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(l=>l.is(w))||t.changes.touchesRange(o.from,Math.max(o.to,i)))}function E(t,e){return t.field(f,!1)?e:e.concat(k.appendConfig.of(W))}function B(t,e){return{effects:E(t,[w.of(e)])}}const w=k.define(),D=k.define(),O=k.define(),f=S.define({create(){return new g(h.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,s=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);i=b(n,t.selected.diagnostic,o)||b(n,null,o)}!n.size&&s&&e.state.facet(m).autoPanel&&(s=null),t=new g(n,s,i)}for(let n of e.effects)if(n.is(w)){let i=e.state.facet(m).autoPanel?n.value.length?x.open:null:t.panel;t=g.init(n.value,i,e.state)}else n.is(D)?t=new g(t.diagnostics,n.value?x.open:null,t.selected):n.is(O)&&(t=new g(t.diagnostics,t.panel,n.value));return t},provide:t=>[K.from(t,e=>e.panel),y.decorations.from(t,e=>e.diagnostics)]});function oe(t){let e=t.field(f,!1);return e?e.diagnostics.size:0}const le=h.mark({class:"cm-lintRange cm-lintRange-active"});function re(t,e,n){let{diagnostics:i}=t.state.field(f),s=[],o=2e8,l=0;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:d})=>{e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0))&&(s.push(d.diagnostic),o=Math.min(a,o),l=Math.max(c,l))});let r=t.state.facet(m).tooltipFilter;return r&&(s=r(s,t.state)),s.length?{pos:o,end:l,above:t.state.doc.lineAt(o).to<l,create(){return{dom:G(t,s)}}}:null}function G(t,e){return u("ul",{class:"cm-tooltip-lint"},e.map(n=>V(t,n,!1)))}const j=t=>{let e=t.state.field(f,!1);(!e||!e.panel)&&t.dispatch({effects:E(t.state,[D.of(!0)])});let n=te(t,x.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},L=t=>{let e=t.state.field(f,!1);return!e||!e.panel?!1:(t.dispatch({effects:D.of(!1)}),!0)},z=t=>{let e=t.state.field(f,!1);if(!e)return!1;let n=t.state.selection.main,i=e.diagnostics.iter(n.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==n.from&&i.to==n.to)?!1:(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},ae=t=>{let{state:e}=t,n=e.field(f,!1);if(!n)return!1;let i=e.selection.main,s,o,l,r;return n.diagnostics.between(0,e.doc.length,(a,c)=>{c<i.to&&(s==null||s<a)&&(s=a,o=c),(l==null||a>l)&&(l=a,r=c)}),l==null||s==null&&l==i.from?!1:(t.dispatch({selection:{anchor:s??l,head:o??r},scrollIntoView:!0}),!0)},ce=[{key:"Mod-Shift-m",run:j,preventDefault:!0},{key:"F8",run:z}],H=U.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(m);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let t=Date.now();if(t<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-t);else{this.set=!1;let{state:e}=this.view,{sources:n}=e.facet(m);n.length&&Promise.all(n.map(i=>Promise.resolve(i(this.view)))).then(i=>{let s=i.reduce((o,l)=>o.concat(l));this.view.state.doc==e.doc&&this.view.dispatch(B(this.view.state,s))},i=>{X(this.view.state,i)})}}update(t){let e=t.state.facet(m);(t.docChanged||e!=t.startState.facet(m)||e.needsRefresh&&e.needsRefresh(t))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),m=M.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},A(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n}))}});function de(t,e={}){return[m.of({source:t,config:e}),H,W]}function fe(t){let e=t.plugin(H);e&&e.force()}function $(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let s=n[i];if(/[a-zA-Z]/.test(s)&&!e.some(o=>o.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function V(t,e,n){var i;let s=n?$(e.actions):[];return Line truncated
@@ -0,0 +1,2 @@
import{showPanel as te,EditorView as S,getPanel as R,Decoration as f,ViewPlugin as re,runScopeHandlers as ve}from"@codemirror/view";import{codePointAt as be,fromCodePoint as Ce,codePointSize as ke,StateEffect as W,StateField as ne,EditorSelection as p,Facet as ie,combineConfig as se,CharCategory as m,RangeSetBuilder as Le,Prec as We,EditorState as Fe,findClusterBreak as le}from"@codemirror/state";import h from"crelt";const oe=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class y{constructor(e,r,n=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=s?l=>s(oe(l)):oe,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return be(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=Ce(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ke(e);let i=this.normalize(r);for(let s=0,o=n;;s++){let l=i.charCodeAt(s),c=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(c)return this.value=c,this;break}o==n&&s<r.length&&r.charCodeAt(s)==l&&o++}}}match(e,r,n){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:n}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:r,to:n}:this.matches.push(1,r)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(y.prototype[Symbol.iterator]=function(){return this});const ce={from:-1,to:-1,match:/.*/.exec("")},_="gm"+(/x/.unicode==null?"":"u");class z{constructor(e,r,n,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=ce,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new ae(e,r,n,i,s);this.re=new RegExp(r,_+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=q(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=q(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const B=new WeakMap;class k{constructor(e,r){this.from=e,this.text=r}get to(){return this.from+this.text.length}static get(e,r,n){let i=B.get(e);if(!i||i.from>=n||i.to<=r){let l=new k(r,e.sliceString(r,n));return B.set(e,l),l}if(i.from==r&&i.to==n)return i;let{text:s,from:o}=i;return o>r&&(s=e.sliceString(r,o)+s,o=r),i.to<n&&(s+=e.sliceString(i.to,n)),B.set(e,new k(o,s)),new k(r,s.slice(r-o,n-o))}}class ae{constructor(e,r,n,i,s){this.text=e,this.to=s,this.done=!1,this.value=ce,this.matchPos=q(e,i),this.re=new RegExp(r,_+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=k.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,match:r},this.matchPos=q(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=k.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=ae.prototype[Symbol.iterator]=function(){return this});function Ae(t){try{return new RegExp(t,_),!0}catch{return!1}}function q(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e<r.to&&(n=r.text.charCodeAt(e-r.from))>=56320&&n<57344;)e++;return e}function N(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),r=h("input",{class:"cm-textfield",name:"line",value:e}),n=h("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:P.of(!1)}),t.focus()):s.keyCodLine truncated
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Ne(this):new ze(this)}getCursor(e,r=0,n){let i=e.doc?e:Fe.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?b(this,i,r,n):v(this,i,r,n)}}class pe{constructor(e){this.spec=e}}function v(t,e,r,n){return new y(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?_e(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function _e(t,e){return(r,n,i,s)=>((s>r||s+i.length<n)&&(s=Math.max(0,r-2),i=t.sliceString(s,Math.min(t.length,n+2))),(e(T(i,r-s))!=m.Word||e(I(i,r-s))!=m.Word)&&(e(I(i,n-s))!=m.Word||e(T(i,n-s))!=m.Word))}class ze extends pe{constructor(e){super(e)}nextMatch(e,r,n){let i=v(this.spec,e,n,e.doc.length).nextOverlapping();return i.done&&(i=v(this.spec,e,0,r).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=n;;){let s=Math.max(r,i-1e4-this.spec.unquoted.length),o=v(this.spec,e,s,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==r)return null;i-=1e4}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,r){let n=v(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=v(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function b(t,e,r,n){return new z(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Be(e.charCategorizer(e.selection.main.head)):void 0},r,n)}function T(t,e){return t.slice(le(t,e,!1),e)}function I(t,e){return t.slice(e,le(t,e))}function Be(t){return(e,r,n)=>!n[0].length||(t(T(n.input,n.index))!=m.Word||t(I(n.input,n.index))!=m.Word)&&(t(I(n.input,n.index+n[0].length))!=m.Word||t(T(n.input,n.index+n[0].length))!=m.Word)}class Ne extends pe{nextMatch(e,r,n){let i=b(this.spec,e,n,e.doc.length).next();return i.done&&(i=b(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let s=Math.max(r,n-i*1e4),o=b(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==r||l.from>s+10))return l;if(s==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(r,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n<e.match.length?e.match[n]:r)}matchAll(e,r){let n=b(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=b(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const C=W.define(),H=W.define(),g=ne.define({create(t){return new K(w(t).create(),null)},update(t,e){for(let r of e.effects)r.is(C)?t=new K(r.value.create(),t.panel):r.is(H)&&(t=new K(t.query,r.value?j:null));return t},provide:t=>te.from(t,e=>e.panel)});function Ve(t){let e=t.field(g,!1);return e?e.query.spec:w(t)}function He(t){var e;return((e=t.field(g,!1))===null||e===void 0?void 0:e.panel)!=null}class K{constructor(e,r){this.query=e,this.panel=r}}const Ke=f.mark({class:"cm-searchMatch"}),Ge=f.mark({class:"cm-searchMatch cm-searchMatch-selected"}),je=re.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(g))}update(t){let e=t.state.field(g);(e!=t.startState.field(g)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return f.none;let{view:r}=this,n=new Le;for(let i=0,s=r.visibleRanges,o=s.length;i<o;i++){let{from:l,to:c}=s[i];for(;i<o-1&&c>s[i+1].from-2*250;)c=s[++i].to;t.highlight(r.state,l,c,(a,u)=>{let x=r.state.selection.ranges.some(E=>E.from==a&&E.to==u);n.add(a,u,x?Ge:Ke)})}return n.finish()}},{decorations:t=>t.decorations});function F(t){return e=>{let r=e.state.field(g,!1);return r&&r.query.spec.valid?t(e,r):J(e)}}const A=F((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=p.single(n.from,n.to),s=t.state.facet(M);return t.dispatch({selection:i,effects:[X(t,n),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),Me(t),!0}),D=F((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let s=p.single(i.from,i.to),o=t.state.facet(M);return t.dispatch({selection:s,effects:[X(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),Me(t),!0}),ge=F((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:p.create(r.map(n=>p.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),xe=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:i}=r.main,s=[],o=0;fo Line truncated
@@ -0,0 +1,5 @@
class v{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=J(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),E.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=J(this,e,t);let n=[];return this.decompose(e,t,n,0),E.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new q(this),s=new q(e);for(let r=t,h=t;;){if(i.next(r),s.next(r),r=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(h+=i.value.length,i.done||h>=n)return!0}}iter(e=1){return new q(this,e)}iterRange(e,t=this.length){return new ke(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ye(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?v.empty:e.length<=32?new m(e):E.from(m.split(e,[]))}}class m extends v{constructor(e,t=He(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((t?n:h)>=e)return new Se(i,h,n,r);i=h+1,n++}}decompose(e,t,n,i){let s=e<=0&&t>=this.length?this:new m(xe(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let r=n.pop(),h=Q(s.text,r.text.slice(),0,s.length);if(h.length<=32)n.push(new m(h,r.length+s.length));else{let a=h.length>>1;n.push(new m(h.slice(0,a)),new m(h.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof m))return super.replace(e,t,n);[e,t]=J(this,e,t);let i=Q(this.text,Q(n.text,xe(this.text,0,e)),t),s=this.length+n.length-(t-e);return i.length<=32?new m(i,s):E.from(m.split(i,[]),s)}sliceString(e,t=this.length,n=`
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<=t&&r<this.text.length;r++){let h=this.text[r],a=s+h.length;s>e&&r&&(i+=n),e<a&&t>s&&(i+=h.slice(Math.max(0,e-s),t-s)),s=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(t.push(new m(n,i)),n=[],i=-1);return i>-1&&t.push(new m(n,i)),t}}class E extends v{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,a=n+r.lines-1;if((t?a:h)>=e)return r.lineInner(e,t,n,i);i=h+1,n=a+1}}decompose(e,t,n,i){for(let s=0,r=0;r<=t&&s<this.children.length;s++){let h=this.children[s],a=r+h.length;if(e<=a&&t>=r){let o=i&((r<=e?1:0)|(a>=t?2:0));r>=e&&a<=t&&!o?n.push(h):h.decompose(e-r,t-r,n,o)}r=a+1}}replace(e,t,n){if([e,t]=J(this,e,t),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let r=this.children[i],h=s+r.length;if(e>=s&&t<=h){let a=r.replace(e-s,t-s,n),o=this.lines-r.lines+a.lines;if(a.lines<o>>4&&a.lines>o>>6){let f=this.children.slice();return f[i]=a,new E(f,this.length-(t-e)+n.length)}return super.replace(s,h,a)}s=h+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<this.children.length&&r<=t;s++){let h=this.children[s],a=r+h.length;r>e&&s&&(i+=n),e<a&&t>r&&(i+=h.sliceString(e-r,t-r,n)),r=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof E))return 0;let n=0,[i,s,r,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==r||s==h)return n;let a=this.children[i],o=e.children[s];if(a!=o)return n+a.scanIdentical(o,t);n+=a.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let c of e)n+=c.lines;if(n<32){let c=[];for(let p of e)p.flatten(c);return new m(c,t)}let i=Math.max(32,n>>5),s=i<<1,r=i>>1,h=[],a=0,o=-1,f=[];function u(c){let p;if(c.lines>s&&c instanceof E)for(let b of c.children)u(b);else c.lines>r&&(a>r||!a)?(d(),h.push(c)):c instanceof m&&a&&(p=f[f.length-1])instanceof m&&c.lines+p.lines<=32?(a+=c.lines,o+=c.length+1,f[f.length-1]=new m(p.text.concat(c.text),p.length+1+c.length)):(a+c.lines>i&&d(),a+=c.lines,o+=c.length+1,f.push(c))}function d(){a!=0&&(h.push(f.length==1?f[0]:E.from(f,o)),o=-1,a=f.length=0)}for(let c of e)u(c);return d(),h.length==1?h[0]:new E(h,t)}}v.empty=new m([""],0);function He(l){let e=-1;for(let t of l)e+=t.length+1;return e}function Q(l,e,t=0,n=1e9){for(let i=0,s=0,r=!0;s<l.length&&i<=n;s++){let h=l[s],a=i+h.length;a>=t&&(a>n&&(h=h.slice(0,n-i)),i<t&&(h=h.slice(t-i)),r?(e[e.length-1]+=h,r=!1):e.push(h)),i=a+1}return e}function xe(l,e,t){return Q(l,[""],e,t)}class q{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],r=s>>1,h=i instanceof m?i.text.length:i.children.length;if(r==(t>0?h:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(i instanceof m){let a=i.text[r+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[r+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof m?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ke{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new q(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ye{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(v.prototype[Symbol.iterator]=function(){return this.iter()},q.prototype[Symbol.iterator]=ke.prototype[Symbol.iterator]=ye.prototype[Symbol.iterator]=function(){return this});class Se{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function J(l,e,t){return e=Math.max(0,Math.min(l.length,e)),[e,Math.max(e,Math.min(l.length,t))]}let L="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(l=>l?parseInt(l,36):1);for(let l=1;l<L.length;l++)L[l]+=L[l-1];function Ze(l){for(let e=1;e<L.length;e+=2)if(L[e]>l)return L[e-1]<=l;return!1}function Ie(l){return l>=127462&&l<=127487}const Pe=8205;function $(l,e,t=!0,n=!0){return(t?Ae:Ke)(l,e,n)}function Ae(l,e,t){if(e==l.length)return e;e&&be(l.charCodeAt(e))&&Oe(l.charCodeAt(e-1))&&e--;let n=X(l,e);for(e+=se(n);e<l.length;){let i=X(l,e);if(n==Pe||i==Pe||t&&Ze(i))e+=se(i),n=i;else if(Ie(i)){let s=0,r=e-2;for(;r>=0&&Ie(X(l,r));)s++,r-=2;if(s%2==0)break;e+=2}else break}return e}function Ke(l,e,t){for(;e>0;){let n=Ae(l,e-2,t);if(n<e)return n;e--}return 0}function be(l){return l>=56320&&l<57344}function Oe(l){return l>=55296&&l<56320}function X(l,e){let t=l.charCodeAt(e);if(!Oe(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return be(n)?(t-55296<<10)+(n-56320)+65536:t}function Qe(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}function se(l){return l<65536?1:2}const re=/\r\n?|\n/;var C=function(l){return l[l.Simple=0]="Simple",l[l.TrackDel=1]="TrackDel",l[l.TrackBefore=2]="TrackBefore",l[l.TrackAfter=3]="TrackAfter",l}(C||(C={}));class O{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let s=this.sections[t++],r=this.sections[t++];r<0?(e(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(e,t=!1){le(this,e,t)}ge Line truncated
`}get readOnly(){return this.facet(Ne)}phrase(e,...t){for(let n of this.facet(w.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let s of this.facet(Be))for(let r of s(this,t,n))Object.prototype.hasOwnProperty.call(r,e)&&i.push(r[e]);return i}charCategorizer(e){return lt(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),r=e-n,h=e-n;for(;r>0;){let a=$(t,r,!1);if(s(t.slice(a,r))!=M.Word)break;r=a}for(;h<i;){let a=$(t,h);if(s(t.slice(h,a))!=M.Word)break;h=a}return r==h?null:g.range(r+n,h+n)}}w.allowMultipleSelections=ce,w.tabSize=A.define({combine:l=>l.length?l[0]:4}),w.lineSeparator=Fe,w.readOnly=Ne,w.phrases=A.define({compare(l,e){let t=Object.keys(l),n=Object.keys(e);return t.length==n.length&&t.every(i=>l[i]==e[i])}}),w.languageData=Be,w.changeFilter=Je,w.transactionFilter=Le,w.transactionExtender=Ve,H.reconfigure=S.define();function ht(l,e,t={}){let n={};for(let i of l)for(let s of Object.keys(i)){let r=i[s],h=n[s];if(h===void 0)n[s]=r;else if(!(h===r||r===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](h,r);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class j{eq(e){return this==e}range(e,t=e){return D.create(e,t,this)}}j.prototype.startSide=j.prototype.endSide=0,j.prototype.point=!1,j.prototype.mapMode=C.TrackDel;class D{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new D(e,t,n)}}function pe(l,e){return l.from-e.from||l.value.startSide-e.value.startSide}class ve{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let a=r+h>>1,o=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==r)return o>=0?r:h;o>=0?h=a:r=a+1}}between(e,t,n,i){for(let s=this.findIndex(t,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],i=[],s=[],r=-1,h=-1;for(let a=0;a<this.value.length;a++){let o=this.value[a],f=this.from[a]+e,u=this.to[a]+e,d,c;if(f==u){let p=t.mapPos(f,o.startSide,o.mapMode);if(p==null||(d=c=p,o.startSide!=o.endSide&&(c=t.mapPos(f,o.endSide),c<d)))continue}else if(d=t.mapPos(f,o.startSide),c=t.mapPos(u,o.endSide),d>c||d==c&&o.startSide>0&&o.endSide<=0)continue;(c-d||o.endSide-o.startSide)<0||(r<0&&(r=d),o.point&&(h=Math.max(h,c-d)),n.push(o),i.push(d-r),s.push(c-r))}return{mapped:n.length?new ve(i,s,n,h):null,pos:r}}}class P{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new P(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(n&&(t=t.slice().sort(pe)),this.isEmpty)return t.length?P.of(t):this;let h=new Ue(this,null,-1).goto(0),a=0,o=[],f=new Z;for(;h.value||a<t.length;)if(a<t.length&&(h.from-t[a].from||h.startSide-t[a].value.startSide)>=0){let u=t[a++];f.addInner(u.from,u.to,u.value)||o.push(u)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(h.chunkIndex)<t[a].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&f.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(f.addInner(h.from,h.to,h.value)||o.push(D.create(h.from,h.to,h.value))),h.next());return f.finishInner(this.nextLayer.isEmpty&&!o.length?P.empty:this.nextLayer.update({add:o,filter:r,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let h=this.chunkPos[r],a=this.chunk[r],o=e.touchesRange(h,h+a.length);if(o===!1)i=Math.max(i,a.maxPoint),t.push(a),n.push(e.mapPos(h));else if(o===!0){let{mapped:f,pos:u}=a.map(h,e);f&&(i=Math.max(i,f.maxPoint),t.push(f),n.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new P(n,t,s||P.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(t>=s&&e<=s+r.length&&r.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return K.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return K.from(e).goto(t)}static compare(e,t,n,i,s=-1){let r=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),h=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=We(r,h,n),o=new G(r,a,s),f=new G(h,a,s);n.iterGaps((u, Line truncated
@@ -0,0 +1 @@
import{EditorView as C}from"@codemirror/view";import{HighlightStyle as y,syntaxHighlighting as B}from"@codemirror/language";import{tags as o}from"@lezer/highlight";const d="#e5c07b",c="#e06c75",m="#56b6c2",g="#ffffff",r="#abb2bf",e="#7d8799",s="#61afef",b="#98c379",a="#d19a66",p="#c678dd",f="#21252b",l="#2c313a",n="#282c34",t="#353a42",u="#3E4451",i="#528bff",v={chalky:d,coral:c,cyan:m,invalid:g,ivory:r,stone:e,malibu:s,sage:b,whiskey:a,violet:p,darkBackground:f,highlightBackground:l,background:n,tooltipBackground:t,selection:u,cursor:i},k=C.theme({"&":{color:r,backgroundColor:n},".cm-content":{caretColor:i},".cm-cursor, .cm-dropCursor":{borderLeftColor:i},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:u},".cm-panels":{backgroundColor:f,color:r},".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:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:n,color:e,border:"none"},".cm-activeLineGutter":{backgroundColor:l},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:t},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:t,borderBottomColor:t},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:l,color:r}}},{dark:!0}),h=y.define([{tag:o.keyword,color:p},{tag:[o.name,o.deleted,o.character,o.propertyName,o.macroName],color:c},{tag:[o.function(o.variableName),o.labelName],color:s},{tag:[o.color,o.constant(o.name),o.standard(o.name)],color:a},{tag:[o.definition(o.name),o.separator],color:r},{tag:[o.typeName,o.className,o.number,o.changed,o.annotation,o.modifier,o.self,o.namespace],color:d},{tag:[o.operator,o.operatorKeyword,o.url,o.escape,o.regexp,o.link,o.special(o.string)],color:m},{tag:[o.meta,o.comment],color:e},{tag:o.strong,fontWeight:"bold"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:e,textDecoration:"underline"},{tag:o.heading,fontWeight:"bold",color:c},{tag:[o.atom,o.bool,o.special(o.variableName)],color:a},{tag:[o.processingInstruction,o.string,o.inserted],color:b},{tag:o.invalid,color:g}]),x=[k,B(h)];export{v as color,x as oneDark,h as oneDarkHighlightStyle,k as oneDarkTheme};
@@ -0,0 +1,5 @@
import{Text as Y,RangeSet as V,MapMode as yt,RangeValue as xi,findClusterBreak as wt,EditorSelection as M,Facet as k,StateEffect as xt,ChangeSet as vi,findColumn as ke,CharCategory as Ln,EditorState as Lt,Annotation as Bn,Transaction as Pn,Prec as Ae,codePointAt as Si,codePointSize as Hn,combineConfig as De,StateField as Ci,RangeSetBuilder as Nn,countColumn as Mi}from"@codemirror/state";import{StyleModule as vt}from"style-mod";import{keyName as Vn,base as Fn,shift as Wn}from"w3c-keyname";function Bt(n){let t;return n.nodeType==11?t=n.getSelection?n:n.ownerDocument:t=n,t.getSelection()}function Oe(n,t){return t?n==t||n.contains(t.nodeType!=1?t.parentNode:t):!1}function zn(n){let t=n.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Zt(n,t){if(!t.anchorNode)return!1;try{return Oe(n,t.anchorNode)}catch{return!1}}function St(n){return n.nodeType==3?ut(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Pt(n,t,e,i){return e?ki(n,t,e,i,-1)||ki(n,t,e,i,1):!1}function dt(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t}function te(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function ki(n,t,e,i,s){for(;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Z(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;t=dt(n)+(s<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[t+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;t=s<0?Z(n):0}else return!1}}function Z(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ht(n,t){let e=t?n.left:n.right;return{left:e,right:e,top:n.top,bottom:n.bottom}}function In(n){let t=n.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Ai(n,t){let e=t.width/n.offsetWidth,i=t.height/n.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-n.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-n.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Kn(n,t,e,i,s,o,r,l){let h=n.ownerDocument,c=h.defaultView||window;for(let a=n,f=!1;a&&!f;)if(a.nodeType==1){let d,u=a==h.body,g=1,p=1;if(u)d=In(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(a).position)&&(f=!0),a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth){a=a.assignedSlot||a.parentNode;continue}let w=a.getBoundingClientRect();({scaleX:g,scaleY:p}=Ai(a,w)),d={left:w.left,right:w.left+a.clientWidth*g,top:w.top,bottom:w.top+a.clientHeight*p}}let b=0,m=0;if(s=="nearest")t.top<d.top?(m=-(d.top-t.top+r),e>0&&t.bottom>d.bottom+m&&(m=t.bottom-d.bottom+m+r)):t.bottom>d.bottom&&(m=t.bottom-d.bottom+r,e<0&&t.top-m<d.top&&(m=-(d.top+m-t.top+r)));else{let w=t.bottom-t.top,v=d.bottom-d.top;m=(s=="center"&&w<=v?t.top+w/2-v/2:s=="start"||s=="center"&&e<0?t.top-r:t.bottom-v+r)-d.top}if(i=="nearest"?t.left<d.left?(b=-(d.left-t.left+o),e>0&&t.right>d.right+b&&(b=t.right-d.right+b+o)):t.right>d.right&&(b=t.right-d.right+o,e<0&&t.left<d.left+b&&(b=-(d.left+b-t.left+o))):b=(i=="center"?t.left+(t.right-t.left)/2-(d.right-d.left)/2:i=="start"==l?t.left-o:t.right-(d.right-d.left)+o)-d.left,b||m)if(u)c.scrollBy(b,m);else{let w=0,v=0;if(m){let x=a.scrollTop;a.scrollTop+=m/p,v=(a.scrollTop-x)*p}if(b){let x=a.scrollLeft;a.scrollLeft+=b/g,w=(a.scrollLeft-x)*g}t={left:t.left-w,top:t.top-v,right:t.right-w,bottom:t.bottom-v},w&&Math.abs(w-b)<1&&(i="nearest"),v&&Math.abs(v-m)<1&&(s="nearest")}if(u)break;a=a.assignedSlot||a.parentNode}else if(a.nodeType==11)a=a.host;else break}function qn(n){let t=n.ownerDocument,e,i;for(let s=n.parentNode;s&&!(s==t.body||e&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!e&&s.scrollWidth>s.clientWidth&&(e=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:e,y:i}}class jn{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Z(e):0),i,Math.min(t.focusOffset,i?Z(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Ct=null;function Di(n){if(n.setActive)return n.setActive();if(Ct)return n.focus(Ct);let t=[];for(let e=n;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(n.focus(Ct==null?{get preventScroll(){return Ct={preventScroll:!0},!0}}:void 0),!Ct){Ct=!1;for(let e=0;e<t.length;){let i=t[e++],s=t[e++],o=t[e++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let Oi;function ut(n,t,e=t){let i=Oi||(Oi=document.createRange());return i.setEnd(n,e),i.setStart(n,t),i}function Mt(n,t,e,i){let s={key:t,code:t,keyCode:e,which:e,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let o=new KeyboardEvent("keydown",Line truncated
`,s=n.state.doc.line(s.number+(e?1:-1)),o=n.bidiSpans(s),c=n.visualLineSide(s,!e)}if(h){if(!h(a))return l}else{if(!i)return c;h=i(a)}l=c}}function xo(n,t,e){let i=n.state.charCategorizer(t),s=i(e);return o=>{let r=i(o);return s==Ln.Space&&(s=r),s==r}}function vo(n,t,e,i){let s=t.head,o=e?1:-1;if(s==(e?n.state.doc.length:0))return M.cursor(s,t.assoc);let r=t.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,t.assoc||-1),a=n.documentTop;if(c)r==null&&(r=c.left-h.left),l=o<0?c.top:c.bottom;else{let u=n.viewState.lineBlockAt(s);r==null&&(r=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-u.from))),l=(o<0?u.top:u.bottom)+a}let f=h.left+r,d=i??n.viewState.heightOracle.textHeight>>1;for(let u=0;;u+=10){let g=l+(d+u)*o,p=vs(n,{x:f,y:g},!1,o);if(g<h.top||g>h.bottom||(o<0?p<s:p>s)){let b=n.docView.coordsForChar(p),m=!b||g<b.top?-1:1;return M.cursor(p,m,void 0,r)}}}function re(n,t,e){for(;;){let i=0;for(let s of n)s.between(t-1,t+1,(o,r,l)=>{if(t>o&&t<r){let h=i||e||(t-o<r-t?-1:1);t=h<0?o:r,i=h}});if(!i)return t}}function Ge(n,t,e){let i=re(n.state.facet(je).map(s=>s(n)),e.from,t.head>e.from?-1:1);return i==e.from?e:M.cursor(i,i<e.from?1:-1)}const Wt="\uFFFF";class So{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(Lt.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=Wt}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let o=this.text.length;this.readNode(s);let r=s.nextSibling;if(r==e)break;let l=O.get(s),h=O.get(r);(l&&h?l.breakAfter:(l?l.breakAfter:te(s))||te(r)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>o)&&this.lineBreak(),s=r}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,r=1,l;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(l=s.exec(e))&&(o=l.index,r=l[0].length),this.append(e.slice(i,o<0?e.length:o)),o<0)break;if(this.lineBreak(),r>1)for(let h of this.points)h.node==t&&h.pos>this.text.length&&(h.pos-=r-1);i=o+r}}readNode(t){if(t.cmIgnore)return;let e=O.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Co(t,i.node,i.offset)?e:0))}}function Co(n,t,e){for(;;){if(!t||e<Z(t))return!1;if(t==n)return!0;e=dt(t)+1,t=t.parentNode}}class Ms{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class Mo{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:o,impreciseAnchor:r}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=o||r?[]:Do(t),h=new So(l,t.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Oo(l,this.bounds.from)}else{let l=t.observer.selectionRange,h=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!Oe(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=r&&r.node==l.anchorNode&&r.offset==l.anchorOffset||!Oe(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),a=t.viewport;if((y.ios||y.chrome)&&t.state.selection.main.empty&&h!=c&&(a.from>0||a.to<t.state.doc.length)){let f=Math.min(h,c),d=Math.max(h,c),u=a.from-f,g=a.to-d;(u==0||u==1||f==0)&&(g==0||g==-1||d==t.state.doc.length)&&(h=0,c=t.state.doc.length)}this.newSel=M.single(c,h)}}}function ks(n,t){let e,{newSel:i}=t,s=n.state.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:l}=t.bounds,h=s.from,c=null;(o===8||y.android&&t.text.length<l-r)&&(h=s.to,c="end");let a=Ao(n.state.doc.sliceString(r,l,Wt),t.text,h-r,c);a&&(y.chrome&&o==13&&a.toB==a.from+2&&t.text.slice(a.from,a.toB)==Wt+Wt&&a.toB--,e={from:r+a.from,to:r+a.toA,insert:Y.of(t.text.slice(a.from,a.toB).split(Wt))})}else i&&(!n.hasFocus&&n.state.facet(rt)||i.main.eq(s))&&(i=null);if(!e&&!i)return!1;if(!e&&t.typeOver&&!s.empty&&i&&i.main.empty?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:e&&e.from>=s.from&&e.to<=s.to&&(e.from!=s.from||e.to!=s.to)&&s.to-s.from-(e.to-e.from)<=4?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,e.from).append(e.insert).append(n.state.doc.slice(e.to,s.to))}:(y.mac||y.android)&&e&&e.from==e.to&&e.from==s.head-1&&/^\. ?$/.test(e.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=M.single(i.main.anchor-1,i.main Line truncated
`&&n.lineWrapping&&(i&&(i=M.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:Y.of([" "])}),e)return $e(n,e,i,o);if(i&&!i.main.eq(s)){let r=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:l}),!0}else return!1}function $e(n,t,e,i=-1){if(y.ios&&n.inputState.flushIOSKey(t))return!0;let s=n.state.selection.main;if(y.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&n.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Mt(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.length<t.to-t.from&&t.to>s.head)&&Mt(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Mt(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let r,l=()=>r||(r=ko(n,t,e));return n.state.facet(ns).some(h=>h(n,t.from,t.to,o,l))||n.dispatch(l()),!0}function ko(n,t,e){let i,s=n.state,o=s.selection.main;if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let l=o.from<t.from?s.sliceDoc(o.from,t.from):"",h=o.to>t.to?s.sliceDoc(t.to,o.to):"";i=s.replaceSelection(n.state.toText(l+t.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let l=s.changes(t),h=e&&e.main.to<=l.newLength?e.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=o.to&&t.to>=o.to-10){let c=n.state.sliceDoc(t.from,t.to),a,f=e&&bs(n,e.main.head);if(f){let g=t.insert.length-(t.to-t.from);a={from:f.from,to:f.to-g}}else a=n.state.doc.lineAt(o.head);let d=o.to-t.to,u=o.to-o.from;i=s.changeByRange(g=>{if(g.from==o.from&&g.to==o.to)return{changes:l,range:h||g.map(l)};let p=g.to-d,b=p-c.length;if(g.to-g.from!=u||n.state.sliceDoc(b,p)!=c||g.to>=a.from&&g.from<=a.to)return{range:g};let m=s.changes({from:b,to:p,insert:t.insert}),w=g.to-o.to;return{changes:m,range:h?M.range(Math.max(0,h.anchor+w),Math.max(0,h.head+w)):g.map(m)}})}else i={changes:l,selection:h&&s.selection.replaceRange(h)}}let r="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,r+=".compose",n.inputState.compositionFirstChange&&(r+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:r,scrollIntoView:!0})}function Ao(n,t,e,i){let s=Math.min(n.length,t.length),o=0;for(;o<s&&n.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==s&&n.length==t.length)return null;let r=n.length,l=t.length;for(;r>0&&l>0&&n.charCodeAt(r-1)==t.charCodeAt(l-1);)r--,l--;if(i=="end"){let h=Math.max(0,o-Math.min(r,l));e-=r+h-o}if(r<o&&n.length<t.length){let h=e<=o&&e>=r?o-e:0;o-=h,l=o+(l-r),r=o}else if(l<o){let h=e<=o&&e>=l?o-e:0;o-=h,r=o+(r-l),l=o}return{from:o,toA:r,toB:l}}function Do(n){let t=[];if(n.root.activeElement!=n.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:o}=n.observer.selectionRange;return e&&(t.push(new Ms(e,i)),(s!=e||o!=i)&&t.push(new Ms(s,o))),t}function Oo(n,t){if(n.length==0)return null;let e=n[0].pos,i=n.length==2?n[1].pos:e;return e>-1&&i>-1?M.single(e+t,i+t):null}class To{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,y.safari&&t.contentDOM.addEventListener("input",()=>null),y.gecko&&Yo(t.contentDOM.ownerDocument)}handleEvent(t){!Vo(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let s of i.observers)s(this.view,e);for(let s of i.handlers){if(e.defaultPrevented)break;if(s(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Ro(t),i=this.handlers,s=this.view.contentDOM;for(let o in e)if(o!="scroll"){let r=!e[o].handlers.length,l=i[o];l&&r!=!l.handlers.length&&(s.removeEventListener(o,this.handleEvent),l=null),l||s.addEventListener(o,this.handleEvent,{passive:r})}for(let o in i)o!="scroll"&&!e[o]&&s.removeEventListener(o,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Os.indexOf(t.keyCode)<0&&(this.tab Line truncated
`))};o.from==this.from&&s<this.from?o.from=s:o.to==this.to&&s>this.to&&(o.to=s),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,t.state.readOnly||$e(t,o,M.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)))},this.handlers.characterboundsupdate=i=>{let s=[],o=null;for(let r=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);r<l;r++){let h=t.coordsForChar(r);o=h&&new DOMRect(h.left,h.top,h.right-h.left,h.bottom-h.top)||o||new DOMRect,s.push(o)}e.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let o of i.getTextFormats()){let r=o.underlineStyle,l=o.underlineThickness;if(r!="None"&&l!="None"){let h=`text-decoration: underline ${r=="Dashed"?"dashed ":r=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(R.mark({attributes:{style:h}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}t.dispatch({effects:as.of(R.set(s))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{t.inputState.composing=-1,t.inputState.compositionFirstChange=null};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Bt(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((o,r,l,h,c)=>{if(i)return;let a=c.length-(r-o);if(s&&r>=s.to)if(s.from==o&&s.to==r&&s.insert.eq(c)){s=this.pendingContextChange=null,e+=a,this.to+=a;return}else s=null,this.revertPending(t.state);if(o+=e,r+=e,r<=this.from)this.from+=a,this.to+=a;else if(o<this.to){if(o<this.from||r>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(r),c.toString()),this.to+=a}e+=a}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.resetRange(t.state),this.editContext.updateText(0,this.editContext.text.length,t.state.doc.sliceString(this.from,this.to)),this.setSelection(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t){return t+this.from}toContextPos(t){return t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class A{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(t={}){var 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),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(s=>s.forEach(o=>i(o,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Yn(t.parent)||document,this.viewState=new Gs(t.state||Lt.create(t)),t.scrollTo&&t.scrollTo.is(ne)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Nt).map(s=>new qe(s));for(let s of this.plugins)s.update(this);this.observer=new sr(this),this.inputState=new To(this),th Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,ri),kr={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 li=null;function Ar(){var n;if(li==null&&typeof document<"u"&&document.body){let t=document.body.style;li=((n=t.tabSize)!==null&&n!==void 0?n:t.MozTabSize)!=null}return li||!1}const ye=k.define({combine(n){let t=De(n,{render:null,specialChars:Mr,addSpecialChars:null});return(t.replaceTabs=!Ar())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,ri)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,ri)),t}});function Dr(n={}){return[ye.of(n),Or()]}let pn=null;function Or(){return pn||(pn=P.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ye)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new be({regexp:n.specialChars,decoration:(t,e,i)=>{let{doc:s}=e.state,o=Si(t[0],0);if(o==9){let r=s.lineAt(i),l=e.state.tabSize,h=Mi(r.text,l,i-r.from);return R.replace({widget:new Lr((l-h%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=R.replace({widget:new Er(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let t=n.state.facet(ye);n.startState.facet(ye)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Tr="\u2022";function Rr(n){return n>=32?Tr:n==10?"\u2424":String.fromCharCode(9216+n)}class Er extends gt{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=Rr(this.code),i=t.state.phrase("Control character")+" "+(kr[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let o=document.createElement("span");return o.textContent=e,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Lr extends gt{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const mn=P.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(n){let{view:t}=n,e=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;e>=0&&e!=this.height&&(this.height=e,this.attrs={style:`padding-bottom: ${e}px`})}});function Br(){return[mn,oe.of(n=>{var t;return((t=n.plugin(mn))===null||t===void 0?void 0:t.attrs)||null})]}function Pr(){return Nr}const Hr=R.line({class:"cm-activeLine"}),Nr=P.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let t=-1,e=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>t&&(e.push(Hr.range(s.from)),t=s.from)}return R.set(e)}},{decorations:n=>n.decorations});class Vr extends gt{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let e=t.firstChild?St(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),s=Ht(e[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return s.bottom-s.top>o*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+o}:s}ignoreEvent(){return!1}}function Fr(n){return P.fromClass(class{constructor(t){this.view=t,this.placeholder=n?R.set([R.widget({widget:new Vr(n),side:1}).range(0)]):R.none}get decorations(){return this.view.state.doc.length?R.none:this.placeholder}},{decorations:t=>t.decorations})}const hi=2e3;function Wr(n,t,e){let i=Math.min(t.line,e.line),s=Math.max(t.line,e.line),o=[];if(t.off>hi||e.off>hi||t.col<0||e.col<0){let r=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let h=i;h<=s;h++){let c=n.doc.line(h);c.length<=l&&o.push(M.range(c.from+r,c.to+l))}}else{let r=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let h=i;h<=s;h++){let c=n.doc.line(h),a=ke(c.text,r,n.tabSize,!0);if(a<0)o.push(M.cursor(c.to));else{let f=ke(c.text,l,n.tabSize);o.push(M.range(c.from+a,c.from+f))} Line truncated