Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/media/vendor/codemirror/js/codemirror-commands.min.js
Назад
import{Annotation as Le,Facet as Me,EditorSelection as a,Text as Ee,findClusterBreak as T,countColumn as X,combineConfig as Ht,StateField as qt,Transaction as Y,ChangeSet as $t,ChangeDesc as Kt,StateEffect as _t,CharCategory as L}from"@codemirror/state";import{EditorView as M,Direction as Qt}from"@codemirror/view";import{IndentContext as be,getIndentation as Oe,indentString as U,matchBrackets as E,syntaxTree as Z,getIndentUnit as j,indentUnit as Xt}from"@codemirror/language";import{NodeProp as ee}from"@lezer/common";const Te=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=te(e.state,r.from);return n.line?Ie(e):n.block?Re(e):!1};function x(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 Ie=x(ne,0),Yt=x(ne,1),Zt=x(ne,2),ve=x(N,0),jt=x(N,1),en=x(N,2),Re=x((e,t)=>N(e,t,nn(t)),0);function te(e,t){let r=e.languageDataAt("commentTokens",t);return r.length?r[0]:{}}const I=50;function tn(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,h;l-n<=2*I?u=h=e.sliceDoc(n,l):(u=e.sliceDoc(n,n+I),h=e.sliceDoc(l-I,l));let d=/^\s*/.exec(u)[0].length,B=/\s*$/.exec(h)[0].length,g=h.length-B-r.length;return u.slice(d,d+t.length)==t&&h.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(h.charAt(g-1))?1:0}}:null}function nn(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)=>tn(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 h=t.doc.lineAt(u);if(h.from>l&&(o==c||c>h.from)){l=h.from;let d=/^\s*/.exec(h.text)[0].length,B=d==h.length,g=h.text.slice(d,d+f.length)==f?d:-1;d<h.text.length&&d<i&&(i=d),n.push({line:h,comment:g,token:f,indent:d,empty:B,single:!1})}u=h.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:h}of n)(h||!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=Le.define(),Ue=Le.define(),Ne=Me.define(),Ve=Me.define({combine(e){return Ht(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=qt.define({create(){return C.empty},update(e,t){let r=t.state.facet(Ve),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=w(u,u.length,r.minDepth,i):u=Fe(u,t.startState.selection),new C(f==0?n.rest:u,f==0?u:n.rest)}let l=t.annotation(Ue);if((l=="full"||l=="before")&&(e=e.isolate()),t.annotation(Y.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=p.fromTransaction(t),c=t.annotation(Y.time),s=t.annotation(Y.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 rn(e={}){return[V,Ve.of(e),M.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?oe:t.inputType=="historyRedo"?P:null;return n?(t.preventDefault(),n(r)):!1}})]}const on=V;function G(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=G(0,!1),P=G(1,!1),Ge=G(0,!0),Pe=G(1,!0);function we(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 ln=we(0),cn=we(1);class p{constructor(t,r,n,l,o){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=l,this.selectionsAfter=o}setSelAfter(t){return new p(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(l=>l.toJSON())}}static fromJSON(t){return new p(t.changes&&$t.fromJSON(t.changes),[],t.mapped&&Kt.fromJSON(t.mapped),t.startSelection&&a.fromJSON(t.startSelection),t.selectionsAfter.map(a.fromJSON))}static fromTransaction(t,r){let n=k;for(let l of t.startState.facet(Ne)){let o=l(t);o.length&&(n=n.concat(o))}return!n.length&&t.changes.empty?null:new p(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,k)}static selection(t){return new p(void 0,k,void 0,void 0,t)}}function w(e,t,r,n){let l=t+1>r+20?t-r-1:0,o=e.slice(l,t);return o.push(n),o}function sn(e,t){let r=[],n=!1;return e.iterChangedRanges((l,o)=>r.push(l,o)),t.iterChangedRanges((l,o,c,s)=>{for(let i=0;i<r.length;){let f=r[i++],u=r[i++];s>=f&&c<=u&&(n=!0)}}),n}function un(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function Je(e,t){return e.length?t.length?e.concat(t):e:t}const k=[],fn=200;function Fe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-fn));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),w(e,e.length-1,1e9,r.setSelAfter(n)))}else return[p.selection([t])]}function an(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function le(e,t){if(!e.length)return e;let r=e.length,n=k;for(;r;){let l=hn(e[r-1],t,n);if(l.changes&&!l.changes.empty||l.effects.length){let o=e.slice(0,r);return o[r-1]=l,o}else t=l.mapped,r--,n=l.selectionsAfter}return n.length?[p.selection(n)]:k}function hn(e,t,r){let n=Je(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):k,r);if(!e.changes)return p.selection(n);let l=e.changes.map(t),o=t.mapDesc(e.changes,!0),c=e.mapped?e.mapped.composeDesc(o):o;return new p(l,_t.mapEffects(e.effects,t),c,e.startSelection.map(o),n)}const dn=/^(input\.type|delete)($|\.)/;class C{constructor(t,r,n=0,l=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=l}isolate(){return this.prevTime?new C(this.done,this.undone):this}addChanges(t,r,n,l,o){let c=this.done,s=c[c.length-1];return s&&s.changes&&!s.changes.empty&&t.changes&&(!n||dn.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime<l.newGroupDelay&&l.joinToEvent(o,sn(s.changes,t.changes))||n=="input.type.compose")?c=w(c,c.length-1,l.minDepth,new p(t.changes.compose(s.changes),Je(t.effects,s.effects),s.mapped,s.startSelection,k)):c=w(c,c.length,l.minDepth,t),new C(c,k,r,n)}addSelection(t,r,n,l){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:k;return o.length>0&&r-this.prevTime<l&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&un(o[o.length-1],t)?this:new C(Fe(this.done,t),this.undone,r,n)}addMapping(t){return new C(le(this.done,t),le(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let l=t==0?this.done:this.undone;if(l.length==0)return null;let o=l[l.length-1],c=o.selectionsAfter[0]||r.selection;if(n&&o.selectionsAfter.length)return r.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:re.of({side:t,rest:an(l),selection:c}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let s=l.length==1?k:l.slice(0,l.length-1);return o.mapped&&(s=le(s,o.mapped)),r.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:re.of({side:t,rest:s,selection:c}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}C.empty=new C(k,k);const mn=[{key:"Mod-z",run:oe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:P,preventDefault:!0},{linux:"Ctrl-Shift-z",run:P,preventDefault:!0},{key:"Mod-u",run:Ge,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Pe,preventDefault:!0}];function b(e,t){return a.create(e.ranges.map(t),e.mainIndex)}function S(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function A({state:e,dispatch:t},r){let n=b(e.selection,r);return n.eq(e.selection,!0)?!1:(t(S(e,n)),!0)}function v(e,t){return a.cursor(t?e.to:e.from)}function J(e,t){return A(e,r=>r.empty?e.moveByChar(r,t):v(r,t))}function m(e){return e.textDirectionAt(e.state.selection.main.head)==Qt.LTR}const ce=e=>J(e,!m(e)),se=e=>J(e,m(e)),pn=e=>J(e,!0),gn=e=>J(e,!1);function F(e,t){return A(e,r=>r.empty?e.moveByGroup(r,t):v(r,t))}const ze=e=>F(e,!m(e)),We=e=>F(e,m(e)),yn=e=>F(e,!0),kn=e=>F(e,!1),He=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function qe(e,t,r){let n=e.state.charCategorizer(t.from),l=L.Space,o=t.from,c=0,s=!1,i=!1,f=!1,u=d=>{if(s)return!1;o+=r?d.length:-d.length;let B=n(d),g;if(B==L.Word&&d.charCodeAt(0)<128&&/[\W_]/.test(d)&&(B=-1),l==L.Space&&(l=B),l!=B)return!1;if(l==L.Word)if(d.toLowerCase()==d){if(!r&&i)return!1;f=!0}else if(f){if(r)return!1;s=!0}else{if(i&&r&&n(g=e.state.sliceDoc(o,o+1))==L.Word&&g.toLowerCase()==g)return!1;i=!0}return c++,!0},h=e.moveByChar(t,r,d=>(u(d),u));if(He&&l==L.Word&&h.from==t.from+c*(r?1:-1)){let d=Math.min(t.head,h.head),B=Math.max(t.head,h.head),g=e.state.sliceDoc(d,B);if(g.length>1&&/[\u4E00-\uffff]/.test(g)){let R=Array.from(He.segment(g));if(R.length>1)return r?a.cursor(t.head+R[1].index,-1):a.cursor(h.head+R[R.length-1].index,1)}}return h}function $e(e,t){return A(e,r=>r.empty?qe(e,r,t):v(r,t))}const An=e=>$e(e,!0),Bn=e=>$e(e,!1);function Sn(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function z(e,t,r){let n=Z(e).resolveInner(t.head),l=r?ee.closedBy:ee.openedBy;for(let i=t.head;;){let f=r?n.childAfter(i):n.childBefore(i);if(!f)break;Sn(e,f,l)?n=f:i=r?f.to:f.from}let o=n.type.prop(l),c,s;return o&&(c=r?E(e,n.from,1):E(e,n.to,-1))&&c.matched?s=r?c.end.to:c.end.from:s=r?n.to:n.from,a.cursor(s,r?-1:1)}const Ke=e=>A(e,t=>z(e.state,t,!m(e))),_e=e=>A(e,t=>z(e.state,t,m(e)));function Qe(e,t){return A(e,r=>{if(!r.empty)return v(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const ie=e=>Qe(e,!1),ue=e=>Qe(e,!0);function Xe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,l;if(t){for(let o of e.state.facet(M.scrollMargins)){let c=o(e);c?.top&&(r=Math.max(c?.top,r)),c?.bottom&&(n=Math.max(c?.bottom,n))}l=e.scrollDOM.clientHeight-r-n}else l=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,l-5)}}function Ye(e,t){let r=Xe(e),{state:n}=e,l=b(n.selection,c=>c.empty?e.moveVertically(c,t,r.height):v(c,t));if(l.eq(n.selection))return!1;let o;if(r.selfScroll){let c=e.coordsAtPos(n.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),i=s.top+r.marginTop,f=s.bottom-r.marginBottom;c&&c.top>i&&c.bottom<f&&(o=M.scrollIntoView(l.main.head,{y:"start",yMargin:c.top-i}))}return e.dispatch(S(n,l),{effects:o}),!0}const fe=e=>Ye(e,!1),W=e=>Ye(e,!0);function D(e,t,r){let n=e.lineBlockAt(t.head),l=e.moveToLineBoundary(t,r);if(l.head==t.head&&l.head!=(r?n.to:n.from)&&(l=e.moveToLineBoundary(t,r,!1)),!r&&l.head==n.from&&n.length){let o=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;o&&t.head!=n.from+o&&(l=a.cursor(n.from+o))}return l}const Ze=e=>A(e,t=>D(e,t,!0)),je=e=>A(e,t=>D(e,t,!1)),et=e=>A(e,t=>D(e,t,!m(e))),tt=e=>A(e,t=>D(e,t,m(e))),nt=e=>A(e,t=>a.cursor(e.lineBlockAt(t.head).from,1)),rt=e=>A(e,t=>a.cursor(e.lineBlockAt(t.head).to,-1));function ot(e,t,r){let n=!1,l=b(e.selection,o=>{let c=E(e,o.head,-1)||E(e,o.head,1)||o.head>0&&E(e,o.head-1,1)||o.head<e.doc.length&&E(e,o.head+1,-1);if(!c||!c.end)return o;n=!0;let s=c.start.from==o.head?c.end.to:c.end.from;return r?a.range(o.anchor,s):a.cursor(s)});return n?(t(S(e,l)),!0):!1}const lt=({state:e,dispatch:t})=>ot(e,t,!1),Cn=({state:e,dispatch:t})=>ot(e,t,!0);function y(e,t){let r=b(e.state.selection,n=>{let l=t(n);return a.range(n.anchor,l.head,l.goalColumn,l.bidiLevel||void 0)});return r.eq(e.state.selection)?!1:(e.dispatch(S(e.state,r)),!0)}function H(e,t){return y(e,r=>e.moveByChar(r,t))}const ae=e=>H(e,!m(e)),he=e=>H(e,m(e)),Dn=e=>H(e,!0),xn=e=>H(e,!1);function q(e,t){return y(e,r=>e.moveByGroup(r,t))}const ct=e=>q(e,!m(e)),st=e=>q(e,m(e)),Ln=e=>q(e,!0),Mn=e=>q(e,!1);function it(e,t){return y(e,r=>qe(e,r,t))}const En=e=>it(e,!0),bn=e=>it(e,!1),ut=e=>y(e,t=>z(e.state,t,!m(e))),ft=e=>y(e,t=>z(e.state,t,m(e)));function at(e,t){return y(e,r=>e.moveVertically(r,t))}const de=e=>at(e,!1),me=e=>at(e,!0);function ht(e,t){return y(e,r=>e.moveVertically(r,t,Xe(e).height))}const pe=e=>ht(e,!1),ge=e=>ht(e,!0),dt=e=>y(e,t=>D(e,t,!0)),mt=e=>y(e,t=>D(e,t,!1)),pt=e=>y(e,t=>D(e,t,!m(e))),gt=e=>y(e,t=>D(e,t,m(e))),yt=e=>y(e,t=>a.cursor(e.lineBlockAt(t.head).from)),kt=e=>y(e,t=>a.cursor(e.lineBlockAt(t.head).to)),ye=({state:e,dispatch:t})=>(t(S(e,{anchor:0})),!0),ke=({state:e,dispatch:t})=>(t(S(e,{anchor:e.doc.length})),!0),Ae=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:0})),!0),Be=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),At=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Bt=({state:e,dispatch:t})=>{let r=_(e).map(({from:n,to:l})=>a.range(n,Math.min(l+1,e.doc.length)));return t(e.update({selection:a.create(r),userEvent:"select"})),!0},St=({state:e,dispatch:t})=>{let r=b(e.selection,n=>{var l;let o=Z(e).resolveStack(n.from,1);for(let c=o;c;c=c.next){let{node:s}=c;if((s.from<n.from&&s.to>=n.to||s.to>n.to&&s.from<=n.from)&&(!((l=s.parent)===null||l===void 0)&&l.parent))return a.range(s.to,s.from)}return n});return t(S(e,r)),!0},Ct=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=a.create([r.main]):r.main.empty||(n=a.create([a.cursor(r.main.head)])),n?(t(S(e,n)),!0):!1};function O(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,l=n.changeByRange(o=>{let{from:c,to:s}=o;if(c==s){let i=t(o);i<c?(r="delete.backward",i=$(e,i,!1)):i>c&&(r="delete.forward",i=$(e,i,!0)),c=Math.min(c,i),s=Math.max(s,i)}else c=$(e,c,!1),s=$(e,s,!0);return c==s?{range:o}:{changes:{from:c,to:s},range:a.cursor(c,c<o.head?-1:1)}});return l.changes.empty?!1:(e.dispatch(n.update(l,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?M.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function $(e,t,r){if(e instanceof M)for(let n of e.state.facet(M.atomicRanges).map(l=>l(e)))n.between(t,t,(l,o)=>{l<t&&o>t&&(t=r?o:l)});return t}const Dt=(e,t)=>O(e,r=>{let n=r.from,{state:l}=e,o=l.doc.lineAt(n),c,s;if(!t&&n>o.from&&n<o.from+200&&!/[^ \t]/.test(c=o.text.slice(0,n-o.from))){if(c[c.length-1]==" ")return n-1;let i=X(c,l.tabSize),f=i%j(l)||j(l);for(let u=0;u<f&&c[c.length-1-u]==" ";u++)n--;s=n}else s=T(o.text,n-o.from,t,t)+o.from,s==n&&o.number!=(t?l.doc.lines:1)?s+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(s-o.from,n-o.from))&&(s=T(o.text,s-o.from,!1,!1)+o.from);return s}),K=e=>Dt(e,!1),Se=e=>Dt(e,!0),xt=(e,t)=>O(e,r=>{let n=r.head,{state:l}=e,o=l.doc.lineAt(n),c=l.charCategorizer(n);for(let s=null;;){if(n==(t?o.to:o.from)){n==r.head&&o.number!=(t?l.doc.lines:1)&&(n+=t?1:-1);break}let i=T(o.text,n-o.from,t)+o.from,f=o.text.slice(Math.min(n,i)-o.from,Math.max(n,i)-o.from),u=c(f);if(s!=null&&u!=s)break;(f!=" "||n!=r.head)&&(s=u),n=i}return n}),Ce=e=>xt(e,!1),Lt=e=>xt(e,!0),Mt=e=>O(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),On=e=>O(e,t=>{let r=e.lineBlockAt(t.head).from;return t.head>r?r:Math.max(0,t.head-1)}),Et=e=>O(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),bt=e=>O(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),Tn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=[];for(let n=0,l="",o=e.doc.iter();;){if(o.next(),o.lineBreak||o.done){let c=l.search(/\s+$/);if(c>-1&&r.push({from:n-(l.length-c),to:n}),o.done)break;l=""}else l=o.value;n+=o.value.length}return r.length?(t(e.update({changes:r,userEvent:"delete"})),!0):!1},Ot=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Ee.of(["",""])},range:a.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Tt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let l=n.from,o=e.doc.lineAt(l),c=l==o.from?l-1:T(o.text,l-o.from,!1)+o.from,s=l==o.to?l+1:T(o.text,l-o.from,!0)+o.from;return{changes:{from:c,to:s,insert:e.doc.slice(l,s).append(e.doc.slice(c,l))},range:a.cursor(s)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function _(e){let t=[],r=-1;for(let n of e.selection.ranges){let l=e.doc.lineAt(n.from),o=e.doc.lineAt(n.to);if(!n.empty&&n.to==o.from&&(o=e.doc.lineAt(n.to-1)),r>=l.number){let c=t[t.length-1];c.to=o.to,c.ranges.push(n)}else t.push({from:l.from,to:o.to,ranges:[n]});r=o.number+1}return t}function It(e,t,r){if(e.readOnly)return!1;let n=[],l=[];for(let o of _(e)){if(r?o.to==e.doc.length:o.from==0)continue;let c=e.doc.lineAt(r?o.to+1:o.from-1),s=c.length+1;if(r){n.push({from:o.to,to:c.to},{from:o.from,insert:c.text+e.lineBreak});for(let i of o.ranges)l.push(a.range(Math.min(e.doc.length,i.anchor+s),Math.min(e.doc.length,i.head+s)))}else{n.push({from:c.from,to:o.from},{from:o.to,insert:e.lineBreak+c.text});for(let i of o.ranges)l.push(a.range(i.anchor-s,i.head-s))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:a.create(l,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const vt=({state:e,dispatch:t})=>It(e,t,!1),Rt=({state:e,dispatch:t})=>It(e,t,!0);function Ut(e,t,r){if(e.readOnly)return!1;let n=[];for(let l of _(e))r?n.push({from:l.from,insert:e.doc.slice(l.from,l.to)+e.lineBreak}):n.push({from:l.to,insert:e.lineBreak+e.doc.slice(l.from,l.to)});return t(e.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Nt=({state:e,dispatch:t})=>Ut(e,t,!1),Vt=({state:e,dispatch:t})=>Ut(e,t,!0),Gt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(_(t).map(({from:l,to:o})=>(l>0?l--:o<t.doc.length&&o++,{from:l,to:o}))),n=b(t.selection,l=>e.moveVertically(l,!0)).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0},In=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0);function vn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Z(e).resolveInner(t),n=r.childBefore(t),l=r.childAfter(t),o;return n&&l&&n.to<=t&&l.from>=t&&(o=n.type.prop(ee.closedBy))&&o.indexOf(l.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(l.from).from&&!/\S/.test(e.sliceDoc(n.to,l.from))?{from:n.to,to:l.from}:null}const Pt=Jt(!1),wt=Jt(!0);function Jt(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(l=>{let{from:o,to:c}=l,s=t.doc.lineAt(o),i=!e&&o==c&&vn(t,o);e&&(o=c=(c<=s.to?s:t.doc.lineAt(c)).to);let f=new be(t,{simulateBreak:o,simulateDoubleBreak:!!i}),u=Oe(f,o);for(u==null&&(u=X(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));c<s.to&&/\s/.test(s.text[c-s.from]);)c++;i?{from:o,to:c}=i:o>s.from&&o<s.from+100&&!/\S/.test(s.text.slice(0,o))&&(o=s.from);let h=["",U(t,u)];return i&&h.push(U(t,f.lineIndent(s.from,-1))),{changes:{from:o,to:c,insert:Ee.of(h)},range:a.cursor(o+1+h[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function De(e,t){let r=-1;return e.changeByRange(n=>{let l=[];for(let c=n.from;c<=n.to;){let s=e.doc.lineAt(c);s.number>r&&(n.empty||n.to>s.from)&&(t(s,l,n),r=s.number),c=s.to+1}let o=e.changes(l);return{changes:l,range:a.range(o.mapPos(n.anchor,1),o.mapPos(n.head,1))}})}const Ft=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new be(e,{overrideIndentation:o=>{let c=r[o];return c??-1}}),l=De(e,(o,c,s)=>{let i=Oe(n,o.from);if(i==null)return;/\S/.test(o.text)||(i=0);let f=/^\s*/.exec(o.text)[0],u=U(e,i);(f!=u||s.from<o.from+f.length)&&(r[o.from]=i,c.push({from:o.from,to:o.from+f.length,insert:u}))});return l.changes.empty||t(e.update(l,{userEvent:"indent"})),!0},Q=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(De(e,(r,n)=>{n.push({from:r.from,insert:e.facet(Xt)})}),{userEvent:"input.indent"})),!0),xe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(De(e,(r,n)=>{let l=/^\s*/.exec(r.text)[0];if(!l)return;let o=X(l,e.tabSize),c=0,s=U(e,Math.max(0,o-j(e)));for(;c<l.length&&c<s.length&&l.charCodeAt(c)==s.charCodeAt(c);)c++;n.push({from:r.from+c,to:r.from+l.length,insert:s.slice(c)})}),{userEvent:"delete.dedent"})),!0),Rn=({state:e,dispatch:t})=>e.selection.ranges.some(r=>!r.empty)?Q({state:e,dispatch:t}):(t(e.update(e.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),zt=[{key:"Ctrl-b",run:ce,shift:ae,preventDefault:!0},{key:"Ctrl-f",run:se,shift:he},{key:"Ctrl-p",run:ie,shift:de},{key:"Ctrl-n",run:ue,shift:me},{key:"Ctrl-a",run:nt,shift:yt},{key:"Ctrl-e",run:rt,shift:kt},{key:"Ctrl-d",run:Se},{key:"Ctrl-h",run:K},{key:"Ctrl-k",run:Mt},{key:"Ctrl-Alt-h",run:Ce},{key:"Ctrl-o",run:Ot},{key:"Ctrl-t",run:Tt},{key:"Ctrl-v",run:W}],Wt=[{key:"ArrowLeft",run:ce,shift:ae,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ze,shift:ct,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:et,shift:pt,preventDefault:!0},{key:"ArrowRight",run:se,shift:he,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:We,shift:st,preventDefault:!0},{mac:"Cmd-ArrowRight",run:tt,shift:gt,preventDefault:!0},{key:"ArrowUp",run:ie,shift:de,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ye,shift:Ae},{mac:"Ctrl-ArrowUp",run:fe,shift:pe},{key:"ArrowDown",run:ue,shift:me,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ke,shift:Be},{mac:"Ctrl-ArrowDown",run:W,shift:ge},{key:"PageUp",run:fe,shift:pe},{key:"PageDown",run:W,shift:ge},{key:"Home",run:je,shift:mt,preventDefault:!0},{key:"Mod-Home",run:ye,shift:Ae},{key:"End",run:Ze,shift:dt,preventDefault:!0},{key:"Mod-End",run:ke,shift:Be},{key:"Enter",run:Pt},{key:"Mod-a",run:At},{key:"Backspace",run:K,shift:K},{key:"Delete",run:Se},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ce},{key:"Mod-Delete",mac:"Alt-Delete",run:Lt},{mac:"Mod-Backspace",run:Et},{mac:"Mod-Delete",run:bt}].concat(zt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Un=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Ke,shift:ut},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:_e,shift:ft},{key:"Alt-ArrowUp",run:vt},{key:"Shift-Alt-ArrowUp",run:Nt},{key:"Alt-ArrowDown",run:Rt},{key:"Shift-Alt-ArrowDown",run:Vt},{key:"Escape",run:Ct},{key:"Mod-Enter",run:wt},{key:"Alt-l",mac:"Ctrl-l",run:Bt},{key:"Mod-i",run:St,preventDefault:!0},{key:"Mod-[",run:xe},{key:"Mod-]",run:Q},{key:"Mod-Alt-\\",run:Ft},{key:"Shift-Mod-k",run:Gt},{key:"Shift-Mod-\\",run:lt},{key:"Mod-/",run:Te},{key:"Alt-A",run:ve}].concat(Wt),Nn={key:"Tab",run:Q,shift:xe};export{jt as blockComment,en as blockUncomment,Vt as copyLineDown,Nt as copyLineUp,gn as cursorCharBackward,pn as cursorCharForward,ce as cursorCharLeft,se as cursorCharRight,ke as cursorDocEnd,ye as cursorDocStart,kn as cursorGroupBackward,yn as cursorGroupForward,ze as cursorGroupLeft,We as cursorGroupRight,je as cursorLineBoundaryBackward,Ze as cursorLineBoundaryForward,et as cursorLineBoundaryLeft,tt as cursorLineBoundaryRight,ue as cursorLineDown,rt as cursorLineEnd,nt as cursorLineStart,ie as cursorLineUp,lt as cursorMatchingBracket,W as cursorPageDown,fe as cursorPageUp,Bn as cursorSubwordBackward,An as cursorSubwordForward,Ke as cursorSyntaxLeft,_e as cursorSyntaxRight,Un as defaultKeymap,K as deleteCharBackward,Se as deleteCharForward,Ce as deleteGroupBackward,Lt as deleteGroupForward,Gt as deleteLine,Et as deleteLineBoundaryBackward,bt as deleteLineBoundaryForward,Mt as deleteToLineEnd,On as deleteToLineStart,Tn as deleteTrailingWhitespace,zt as emacsStyleKeymap,rn as history,on as historyField,mn as historyKeymap,xe as indentLess,Q as indentMore,Ft as indentSelection,Nn as indentWithTab,wt as insertBlankLine,In as insertNewline,Pt as insertNewlineAndIndent,Rn as insertTab,Ne as invertedEffects,Ue as isolateHistory,Yt as lineComment,Zt as lineUncomment,Rt as moveLineDown,vt as moveLineUp,P as redo,cn as redoDepth,Pe as redoSelection,At as selectAll,xn as selectCharBackward,Dn as selectCharForward,ae as selectCharLeft,he as selectCharRight,Be as selectDocEnd,Ae as selectDocStart,Mn as selectGroupBackward,Ln as selectGroupForward,ct as selectGroupLeft,st as selectGroupRight,Bt as selectLine,mt as selectLineBoundaryBackward,dt as selectLineBoundaryForward,pt as selectLineBoundaryLeft,gt as selectLineBoundaryRight,me as selectLineDown,kt as selectLineEnd,yt as selectLineStart,de as selectLineUp,Cn as selectMatchingBracket,ge as selectPageDown,pe as selectPageUp,St as selectParentSyntax,bn as selectSubwordBackward,En as selectSubwordForward,ut as selectSyntaxLeft,ft as selectSyntaxRight,Ct as simplifySelection,Ot as splitLine,Wt as standardKeymap,ve as toggleBlockComment,Re as toggleBlockCommentByLine,Te as toggleComment,Ie as toggleLineComment,Tt as transposeChars,oe as undo,ln as undoDepth,Ge as undoSelection};
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка