PageSourceSearch

https://www.debugbear.com/cdn/chunk-5230.9feb1266d7dbf5b874b9.js

js debugbear.com collected 2026-09-24 08:55:57 UTC 26,372 bytes, 1 lines download raw bytes

1"use strict";(("undefined"==typeof window?self:window).webpackChunkdebugbear_gae=("undefined"==typeof window?self:window).webpackChunkdebugbear_gae||[]).push([[5230],{45230(e,t,n){n.r(t),n.d(t,{history:()=>B});var r=n(6585),o=n(36898),i=n(15874),l=n(90365);const s=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=g(e.state,n.from);return r.line?c(e):!!r.block&&p(e)};function a(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(r(n.update(o)),!0)}}const c=a(k,0),u=a(k,1),f=a(k,2),d=a(y,0),h=a(y,1),m=a(y,2),p=a((e,t)=>y(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>r.from?t[i].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}(t)),0);function g(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function y(e,t,n=t.selection.ranges){let r=n.map(e=>g(t,e.from).block);if(!r.every(e=>e))return null;let o=n.map((e,n)=>function(e,{open:t,close:n},r,o){let i,l,s=e.sliceDoc(r-50,r),a=e.sliceDoc(o,o+50),c=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,f=s.length-c;if(s.slice(f-t.length,f)==t&&a.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:o+u,margin:u&&1}};o-r<=100?i=l=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+50),l=e.sliceDoc(o-50,o));let d=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,m=l.length-h-n.length;return i.slice(d,d+t.length)==t&&l.slice(m,m+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(i.charAt(d+t.length))?1:0},close:{pos:o-h-n.length,margin:/\s/.test(l.charAt(m-1))?1:0}}:null}(t,r[n],e.from,e.to));if(2!=e&&!o.every(e=>e))return{changes:t.changes(n.map((e,t)=>o[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&o.some(e=>e)){let e=[];for(let t,n=0;n<o.length;n++)if(t=o[n]){let o=r[n],{open:i,close:l}=t;e.push({from:i.pos-o.open.length,to:i.pos+i.margin},{from:l.pos-l.margin,to:l.pos+o.close.length})}return{changes:e}}return null}function k(e,t,n=t.selection.ranges){let r=[],o=-1;for(let{from:e,to:i}of n){let n=r.length,l=1e9,s=g(t,e).line;if(s){for(let n=e;n<=i;){let a=t.doc.lineAt(n);if(a.from>o&&(e==i||i>a.from)){o=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+s.length)==s?e:-1;e<a.text.length&&e<l&&(l=e),r.push({line:a,comment:n,token:s,indent:e,empty:t,single:!1})}n=a.to+1}if(l<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=l);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:o,empty:i,single:l}of r)!l&&i||e.push({from:t.from+o,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:o}of r)if(n>=0){let r=t.from+n,i=r+o.length;" "==t.text[i-t.from]&&i++,e.push({from:r,to:i})}return{changes:e}}return null}const w=r.Annotation.define(),S=r.Annotation.define(),v=r.Facet.define(),A=r.Facet.define({combine:e=>(0,r.combineConfig)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),C=r.StateField.define({create:()=>z.empty,update(e,t){let n=t.state.facet(A),o=t.annotation(w);if(o){let i=t.docChanged?r.EditorSelection.single(function(e){let t=0;return e.iterChangedRanges((e,n)=>t=n),t}(t.changes)):void 0,l=R.fromTransaction(t,i),s=o.side,a=0==s?e.undone:e.done;return a=l?V(a,a.length,n.minDepth,l):G(a,t.startState.selection),new z(0==s?o.rest:a,0==s?a:o.rest)}let i=t.annotation(S);if("full"!=i&&"before"!=i||(e=e.isolate()),!1===t.annotation(r.Transaction.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let l=R.fromTransaction(t),s=t.annotation(r.Transaction.time),a=t.annotation(r.Transaction.userEvent);return l?e=e.addChanges(l,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),"full"!=i&&"after"!=i||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new z(e.done.map(R.fromJSON),e.undone.map(R.fromJSON))});function B(e={}){return[C,A.of(e),o.EditorView.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?x:"historyRedo"==e.inputType?L:null;return!!n&&(e.preventDefault(),n(t))}})]}const E=C;function D(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(C,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}const x=D(0,!1),L=D(1,!1),M=D(0,!0),b=D(1,!0);function O(e){return function(t){let n=t.field(C,!1);if(!n)return 0;let r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const T=O(0),I=O(1);class R{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new R(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new R(e.changes&&r.ChangeSet.fromJSON(e.changes),[],e.mapped&&r.ChangeDesc.fromJSON(e.mapped),e.startSelection&&r.EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(r.EditorSelection.fromJSON))}static fromTransaction(e,t){let n=N;for(let t of e.startState.facet(v)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new R(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,N)}static selection(e){return new R(void 0,N,void 0,void 0,e)}}function V(e,t,n,r){let o=t+1>n+20?t-n-1:0,i=e.slice(o,t);return i.push(r),i}function U(e,t){return e.length?t.length?e.concat(t):e:t}const N=[];function G(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),V(e,e.length-1,1e9,n.setSelAfter(r)))}return[R.selection([t])]}function J(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function F(e,t){if(!e.length)return e;let n=e.length,r=N;for(;n;){let o=H(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let t=e.slice(0,n);return t[n-1]=o,t}t=o.mapped,n--,r=o.selectionsAfter}return r.length?[R.selection(r)]:N}function H(e,t,n){let o=U(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):N,n);if(!e.changes)return R.selection(o);let i=e.changes.map(t),l=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(l):l;
1return new R(i,r.StateEffect.mapEffects(e.effects,t),s,e.startSelection.map(l),o)}const P=/^(input\.type|delete)($|\.)/;class z{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new z(this.done,this.undone):this}addChanges(e,t,n,r,o){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||P.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,function(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,o,i)=>{for(let e=0;e<n.length;){let t=n[e++],l=n[e++];i>=t&&o<=l&&(r=!0)}}),r}(l.changes,e.changes))||"input.type.compose"==n)?V(i,i.length-1,r.minDepth,new R(e.changes.compose(l.changes),U(e.effects,l.effects),l.mapped,l.startSelection,N)):V(i,i.length,r.minDepth,e),new z(i,N,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:N;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],l=e,i.ranges.length==l.ranges.length&&0===i.ranges.filter((e,t)=>e.empty!=l.ranges[t].empty).length)?this:new z(G(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new z(F(this.done,e),F(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let o=r[r.length-1];if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:w.of({side:e,rest:J(r)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let n=1==r.length?N:r.slice(0,r.length-1);return o.mapped&&(n=F(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:w.of({side:e,rest:n}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}z.empty=new z(N,N);const W=[{key:"Mod-z",run:x,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:L,preventDefault:!0},{linux:"Ctrl-Shift-z",run:L,preventDefault:!0},{key:"Mod-u",run:M,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:b,preventDefault:!0}];function $(e,t){return r.EditorSelection.create(e.ranges.map(t),e.mainIndex)}function j(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function q({state:e,dispatch:t},n){let r=$(e.selection,n);return!r.eq(e.selection)&&(t(j(e,r)),!0)}function K(e,t){return r.EditorSelection.cursor(t?e.to:e.from)}function Y(e,t){return q(e,n=>n.empty?e.moveByChar(n,t):K(n,t))}function _(e){return e.textDirectionAt(e.state.selection.main.head)==o.Direction.LTR}const Q=e=>Y(e,!_(e)),X=e=>Y(e,_(e));function Z(e,t){return q(e,n=>n.empty?e.moveByGroup(n,t):K(n,t))}const ee=e=>Z(e,!_(e)),te=e=>Z(e,_(e));function ne(e,t,n){let o=e.state.charCategorizer(t.from);return e.moveByChar(t,n,i=>{let l=r.CharCategory.Space,s=t.from,a=!1,c=!1,u=!1,f=t=>{if(a)return!1;s+=n?t.length:-t.length;let i,f=o(t);if(f==r.CharCategory.Word&&t.charCodeAt(0)<128&&/[\W_]/.test(t)&&(f=-1),l==r.CharCategory.Space&&(l=f),l!=f)return!1;if(l==r.CharCategory.Word)if(t.toLowerCase()==t){if(!n&&c)return!1;u=!0}else if(u){if(n)return!1;a=!0}else{if(c&&n&&o(i=e.state.sliceDoc(s,s+1))==r.CharCategory.Word&&i.toLowerCase()==i)return!1;c=!0}return!0};return f(i),f})}function re(e,t){return q(e,n=>n.empty?ne(e,n,t):K(n,t))}function oe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ie(e,t,n){let o,s,a=(0,i.syntaxTree)(e).resolveInner(t.head),c=n?l.uY.closedBy:l.uY.openedBy;for(let r=t.head;;){let t=n?a.childAfter(r):a.childBefore(r);if(!t)break;oe(e,t,c)?a=t:r=n?t.to:t.from}return s=a.type.prop(c)&&(o=n?(0,i.matchBrackets)(e,a.from,1):(0,i.matchBrackets)(e,a.to,-1))&&o.matched?n?o.end.to:o.end.from:n?a.to:a.from,r.EditorSelection.cursor(s,n?-1:1)}const le=e=>q(e,t=>ie(e.state,t,!_(e))),se=e=>q(e,t=>ie(e.state,t,_(e)));function ae(e,t){return q(e,n=>{if(!n.empty)return K(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const ce=e=>ae(e,!1),ue=e=>ae(e,!0);function fe(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,i=0;if(n){for(let t of e.state.facet(o.EditorView.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(r=Math.max(null==n?void 0:n.top,r)),(null==n?void 0:n.bottom)&&(i=Math.max(null==n?void 0:n.bottom,i))}t=e.scrollDOM.clientHeight-r-i}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:i,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function de(e,t){let n,r=fe(e),{state:i}=e,l=$(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):K(n,t));if(l.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+r.marginTop,c=s.bottom-r.marginBottom;t&&t.top>a&&t.bottom<c&&(n=o.EditorView.scrollIntoView(l.main.head,{y:"start",yMargin:t.to
1p-a}))}return e.dispatch(j(i,l),{effects:n}),!0}const he=e=>de(e,!1),me=e=>de(e,!0);function pe(e,t,n){let o=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?o.to:o.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(i=r.EditorSelection.cursor(o.from+n))}return i}const ge=e=>q(e,t=>pe(e,t,!0)),ye=e=>q(e,t=>pe(e,t,!1)),ke=e=>q(e,t=>pe(e,t,!_(e))),we=e=>q(e,t=>pe(e,t,_(e))),Se=e=>q(e,t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from,1)),ve=e=>q(e,t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to,-1));function Ae(e,t,n){let o=!1,l=$(e.selection,t=>{let l=(0,i.matchBrackets)(e,t.head,-1)||(0,i.matchBrackets)(e,t.head,1)||t.head>0&&(0,i.matchBrackets)(e,t.head-1,1)||t.head<e.doc.length&&(0,i.matchBrackets)(e,t.head+1,-1);if(!l||!l.end)return t;o=!0;let s=l.start.from==t.head?l.end.to:l.end.from;return n?r.EditorSelection.range(t.anchor,s):r.EditorSelection.cursor(s)});return!!o&&(t(j(e,l)),!0)}const Ce=({state:e,dispatch:t})=>Ae(e,t,!1);function Be(e,t){let n=$(e.state.selection,e=>{let n=t(e);return r.EditorSelection.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(j(e.state,n)),!0)}function Ee(e,t){return Be(e,n=>e.moveByChar(n,t))}const De=e=>Ee(e,!_(e)),xe=e=>Ee(e,_(e));function Le(e,t){return Be(e,n=>e.moveByGroup(n,t))}const Me=e=>Le(e,!_(e)),be=e=>Le(e,_(e));function Oe(e,t){return Be(e,n=>ne(e,n,t))}const Te=e=>Be(e,t=>ie(e.state,t,!_(e))),Ie=e=>Be(e,t=>ie(e.state,t,_(e)));function Re(e,t){return Be(e,n=>e.moveVertically(n,t))}const Ve=e=>Re(e,!1),Ue=e=>Re(e,!0);function Ne(e,t){return Be(e,n=>e.moveVertically(n,t,fe(e).height))}const Ge=e=>Ne(e,!1),Je=e=>Ne(e,!0),Fe=e=>Be(e,t=>pe(e,t,!0)),He=e=>Be(e,t=>pe(e,t,!1)),Pe=e=>Be(e,t=>pe(e,t,!_(e))),ze=e=>Be(e,t=>pe(e,t,_(e))),We=e=>Be(e,t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from)),$e=e=>Be(e,t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to)),je=({state:e,dispatch:t})=>(t(j(e,{anchor:0})),!0),qe=({state:e,dispatch:t})=>(t(j(e,{anchor:e.doc.length})),!0),Ke=({state:e,dispatch:t})=>(t(j(e,{anchor:e.selection.main.anchor,head:0})),!0),Ye=({state:e,dispatch:t})=>(t(j(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),_e=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Qe=({state:e,dispatch:t})=>{let n=dt(e).map(({from:t,to:n})=>r.EditorSelection.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:r.EditorSelection.create(n),userEvent:"select"})),!0},Xe=({state:e,dispatch:t})=>{let n=$(e.selection,t=>{var n;let o=(0,i.syntaxTree)(e).resolveInner(t.head,1);for(;!(o.from<t.from&&o.to>=t.to||o.to>t.to&&o.from<=t.from)&&(null===(n=o.parent)||void 0===n?void 0:n.parent);)o=o.parent;return r.EditorSelection.range(o.to,o.from)});return t(j(e,n)),!0},Ze=({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=r.EditorSelection.create([n.main]):n.main.empty||(o=r.EditorSelection.create([r.EditorSelection.cursor(n.main.head)])),!!o&&(t(j(e,o)),!0)};function et(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,l=i.changeByRange(o=>{let{from:i,to:l}=o;if(i==l){let r=t(i);r<i?(n="delete.backward",r=tt(e,r,!1)):r>i&&(n="delete.forward",r=tt(e,r,!0)),i=Math.min(i,r),l=Math.max(l,r)}else i=tt(e,i,!1),l=tt(e,l,!0);return i==l?{range:o}:{changes:{from:i,to:l},range:r.EditorSelection.cursor(i)}});return!l.changes.empty&&(e.dispatch(i.update(l,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?o.EditorView.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function tt(e,t,n){if(e instanceof o.EditorView)for(let r of e.state.facet(o.EditorView.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}const nt=(e,t)=>et(e,n=>{let o,l,{state:s}=e,a=s.doc.lineAt(n);if(!t&&n>a.from&&n<a.from+200&&!/[^ \t]/.test(o=a.text.slice(0,n-a.from))){if("\t"==o[o.length-1])return n-1;let e=(0,r.countColumn)(o,s.tabSize)%(0,i.getIndentUnit)(s)||(0,i.getIndentUnit)(s);for(let t=0;t<e&&" "==o[o.length-1-t];t++)n--;l=n}else l=(0,r.findClusterBreak)(a.text,n-a.from,t,t)+a.from,l==n&&a.number!=(t?s.doc.lines:1)&&(l+=t?1:-1);return l}),rt=e=>nt(e,!1),ot=e=>nt(e,!0),it=(e,t)=>
1et(e,n=>{let o=n,{state:i}=e,l=i.doc.lineAt(o),s=i.charCategorizer(o);for(let e=null;;){if(o==(t?l.to:l.from)){o==n&&l.number!=(t?i.doc.lines:1)&&(o+=t?1:-1);break}let a=(0,r.findClusterBreak)(l.text,o-l.from,t)+l.from,c=l.text.slice(Math.min(o,a)-l.from,Math.max(o,a)-l.from),u=s(c);if(null!=e&&u!=e)break;" "==c&&o==n||(e=u),o=a}return o}),lt=e=>it(e,!1),st=e=>it(e,!0),at=e=>et(e,t=>{let n=e.lineBlockAt(t).to;return t<n?n:Math.min(e.state.doc.length,t+1)}),ct=e=>et(e,t=>{let n=e.lineBlockAt(t).from;return t>n?n:Math.max(0,t-1)}),ut=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:r.Text.of(["",""])},range:r.EditorSelection.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ft=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),i=n==o.from?n-1:(0,r.findClusterBreak)(o.text,n-o.from,!1)+o.from,l=n==o.to?n+1:(0,r.findClusterBreak)(o.text,n-o.from,!0)+o.from;return{changes:{from:i,to:l,insert:e.doc.slice(n,l).append(e.doc.slice(i,n))},range:r.EditorSelection.cursor(l)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dt(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),i=e.doc.lineAt(r.to);if(r.empty||r.to!=i.from||(i=e.doc.lineAt(r.to-1)),n>=o.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(r)}else t.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return t}function ht(e,t,n){if(e.readOnly)return!1;let o=[],i=[];for(let t of dt(e)){if(n?t.to==e.doc.length:0==t.from)continue;let l=e.doc.lineAt(n?t.to+1:t.from-1),s=l.length+1;if(n){o.push({from:t.to,to:l.to},{from:t.from,insert:l.text+e.lineBreak});for(let n of t.ranges)i.push(r.EditorSelection.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)))}else{o.push({from:l.from,to:t.from},{from:t.to,insert:e.lineBreak+l.text});for(let e of t.ranges)i.push(r.EditorSelection.range(e.anchor-s,e.head-s))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:r.EditorSelection.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}const mt=({state:e,dispatch:t})=>ht(e,t,!1),pt=({state:e,dispatch:t})=>ht(e,t,!0);function gt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of dt(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const yt=({state:e,dispatch:t})=>gt(e,t,!1),kt=({state:e,dispatch:t})=>gt(e,t,!0),wt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dt(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=$(t.selection,t=>e.moveVertically(t,!0)).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},St=At(!1),vt=At(!0);function At(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange(n=>{let{from:o,to:s}=n,a=t.doc.lineAt(o),c=!e&&o==s&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=(0,i.syntaxTree)(e).resolveInner(t),o=r.childBefore(t),s=r.childAfter(t);return o&&s&&o.to<=t&&s.from>=t&&(n=o.type.prop(l.uY.closedBy))&&n.indexOf(s.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(s.from).from?{from:o.to,to:s.from}:null}(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let u=new i.IndentContext(t,{simulateBreak:o,simulateDoubleBreak:!!c}),f=(0,i.getIndentation)(u,o);for(null==f&&(f=/^\s*/.exec(t.doc.lineAt(o).text)[0].length);s<a.to&&/\s/.test(a.text[s-a.from]);)s++;c?({from:o,to:s}=c):o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let d=["",(0,i.indentString)(t,f)];return c&&d.push((0,i.indentString)(t,u.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:r.Text.of(d)},range:r.EditorSelection.cursor(o+1+d[1].length)}});return n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ct(e,t){let n=-1;return e.changeByRange(o=>{let i=[];for(let r=o.from;r<=o.to;){let l=e.doc.lineAt(r);l.number>n&&(o.empty||o.to>l.from)&&(t(l,i,o),n=l.number),r=l.to+1}let l=e.changes(i);return{changes:i,range:r.EditorSelection.range(l.mapPos(o.anchor,1),l.mapPos(o.head,1))}})}const Bt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new i.IndentContext(e,{overrideIndentation:e=>n[e]??-1}),o=Ct(e,(t,o,l)=>{let s=(0,i.getIndentation)(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);
1let a=/^\s*/.exec(t.text)[0],c=(0,i.indentString)(e,s);(a!=c||l.from<t.from+a.length)&&(n[t.from]=s,o.push({from:t.from,to:t.from+a.length,insert:c}))});return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0},Et=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ct(e,(t,n)=>{n.push({from:t.from,insert:e.facet(i.indentUnit)})}),{userEvent:"input.indent"})),!0),Dt=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ct(e,(t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let l=(0,r.countColumn)(o,e.tabSize),s=0,a=(0,i.indentString)(e,Math.max(0,l-(0,i.getIndentUnit)(e)));for(;s<o.length&&s<a.length&&o.charCodeAt(s)==a.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+o.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),xt=[{key:"Ctrl-b",run:Q,shift:De,preventDefault:!0},{key:"Ctrl-f",run:X,shift:xe},{key:"Ctrl-p",run:ce,shift:Ve},{key:"Ctrl-n",run:ue,shift:Ue},{key:"Ctrl-a",run:Se,shift:We},{key:"Ctrl-e",run:ve,shift:$e},{key:"Ctrl-d",run:ot},{key:"Ctrl-h",run:rt},{key:"Ctrl-k",run:at},{key:"Ctrl-Alt-h",run:lt},{key:"Ctrl-o",run:ut},{key:"Ctrl-t",run:ft},{key:"Ctrl-v",run:me}],Lt=[{key:"ArrowLeft",run:Q,shift:De,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ee,shift:Me,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ke,shift:Pe,preventDefault:!0},{key:"ArrowRight",run:X,shift:xe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:te,shift:be,preventDefault:!0},{mac:"Cmd-ArrowRight",run:we,shift:ze,preventDefault:!0},{key:"ArrowUp",run:ce,shift:Ve,preventDefault:!0},{mac:"Cmd-ArrowUp",run:je,shift:Ke},{mac:"Ctrl-ArrowUp",run:he,shift:Ge},{key:"ArrowDown",run:ue,shift:Ue,preventDefault:!0},{mac:"Cmd-ArrowDown",run:qe,shift:Ye},{mac:"Ctrl-ArrowDown",run:me,shift:Je},{key:"PageUp",run:he,shift:Ge},{key:"PageDown",run:me,shift:Je},{key:"Home",run:ye,shift:He,preventDefault:!0},{key:"Mod-Home",run:je,shift:Ke},{key:"End",run:ge,shift:Fe,preventDefault:!0},{key:"Mod-End",run:qe,shift:Ye},{key:"Enter",run:St},{key:"Mod-a",run:_e},{key:"Backspace",run:rt,shift:rt},{key:"Delete",run:ot},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lt},{key:"Mod-Delete",mac:"Alt-Delete",run:st},{mac:"Mod-Backspace",run:ct},{mac:"Mod-Delete",run:at}].concat(xt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Mt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:le,shift:Te},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:se,shift:Ie},{key:"Alt-ArrowUp",run:mt},{key:"Shift-Alt-ArrowUp",run:yt},{key:"Alt-ArrowDown",run:pt},{key:"Shift-Alt-ArrowDown",run:kt},{key:"Escape",run:Ze},{key:"Mod-Enter",run:vt},{key:"Alt-l",mac:"Ctrl-l",run:Qe},{key:"Mod-i",run:Xe,preventDefault:!0},{key:"Mod-[",run:Dt},{key:"Mod-]",run:Et},{key:"Mod-Alt-\\",run:Bt},{key:"Shift-Mod-k",run:wt},{key:"Shift-Mod-\\",run:Ce},{key:"Mod-/",run:s},{key:"Alt-A",run:d}].concat(Lt),bt={key:"Tab",run:Et,shift:Dt};n.d(t,["blockComment",0,h,"blockUncomment",0,m,"copyLineDown",0,kt,"copyLineUp",0,yt,"cursorCharBackward",0,e=>Y(e,!1),"cursorCharForward",0,e=>Y(e,!0),"cursorCharLeft",0,Q,"cursorCharRight",0,X,"cursorDocEnd",0,qe,"cursorDocStart",0,je,"cursorGroupBackward",0,e=>Z(e,!1),"cursorGroupForward",0,e=>Z(e,!0),"cursorGroupLeft",0,ee,"cursorGroupRight",0,te,"cursorLineBoundaryBackward",0,ye,"cursorLineBoundaryForward",0,ge,"cursorLineBoundaryLeft",0,ke,"cursorLineBoundaryRight",0,we,"cursorLineDown",0,ue,"cursorLineEnd",0,ve,"cursorLineStart",0,Se,"cursorLineUp",0,ce,"cursorMatchingBracket",0,Ce,"cursorPageDown",0,me,"cursorPageUp",0,he,"cursorSubwordBackward",0,e=>re(e,!1),"cursorSubwordForward",0,e=>re(e,!0),"cursorSyntaxLeft",0,le,"cursorSyntaxRight",0,se,"defaultKeymap",0,Mt,"deleteCharBackward",0,rt,"deleteCharForward",0,ot,"deleteGroupBackward",0,lt,"deleteGroupForward",0,st,"deleteLine",0,wt,"deleteToLineEnd",0,at,"deleteToLineStart",0,ct,"deleteTrailingWhitespace",0,({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let t=0,r="",o=e.doc.iter();;){if(o.next(),o.lineBreak||o.done){let e=r.search(/\s+$/);if(e>-1&&n.push({from:t-(r.length-e),to:t}),o.done)break;r=""}else r=o.value;t+=o.value.length}return!!n.length&&(t(e.update({changes:n,userEvent:"delete"})),!0)},"emacsStyleKeymap",0,xt,"historyField",0,E,"historyKeymap",0,W,"indentLess",0,Dt,"indentMore",0,Et,"indentSelection",0,Bt,"indentWithTab",0,bt,"insertBlankLine",0,vt,"insertNewline",0,({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),"insertNewlineAndIndent",0,St,"insertTab",0,({state:e,dispatch:t})=>e.selection.ranges.some(e=>!e.empty)?Et({state:e,dispatch:t}):(t(e.update(e.replaceSelection("\t"),{scrollIntoView:!0,userEvent:"input"})),!0),"invertedEffects",0,v,"isolateHistory",0,S,"lineComment",0,u,"lineUncomment",0,f,"moveLineDown",0,pt,"moveLineUp",0,mt,"redo",0,L,"redoDepth",0,I,"redoSelection",0,b,"selectAll",0,_e,"selectCharBackward",0,e=>Ee(e,!1),"selectCharForward",0,e=>Ee(e,!0),"selectCharLeft",0,De,"selectCharRight",0,xe,"selectDocEnd",0,Ye,"selectDocStart",0,Ke,"selectGroupBackward",0,e=>Le(e,!1),"selectGroupForward",0,e=>Le(e,!0),"selectGroupLeft",0,Me,"selectGroupRight",0,be,"selectLine",0,Qe,"selectLineBoundaryBackward",0,He,"selectLineBoundaryForward",0,Fe,"selectLineBoundaryLeft",0,Pe,"selectLineBoundaryRight",0,ze,"selectLineDown",0,Ue,"selectLineEnd",0,$e,"selectLineStart",0,We,"selectLineUp",0,Ve,"selectMatchingBracket",0,({state:e,dispatch:t})=>Ae(e,t,!0),"selectPageDown",0,Je,"selectPageUp",0,Ge,"selectParentSyntax",0,Xe,"selectSubwordBackward",0,e=>Oe(e,!1),"selectSubwordForward",0,e=>Oe(e,!0),"selectSyntaxLeft",0,Te,"selectSyntaxRight",0,Ie,"simplifySelection",0,Ze,"splitLine",0,ut,"standardKeymap",0,Lt,"toggleBlockComment",0,d,"toggleBlockCommentByLine",0,p,"toggleComment",0,s,"toggleLineComment",0,c,"transposeChars",0,ft,"undo",0,x,"undoDepth",0,T,"undoSelection",0,M])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.