1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3421],{23421:function(e,t,n){function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.r(t),n.d(t,{basicSetup:function(){return t_},color:function(){return ni},default:function(){return nv},defaultLightThemeOption:function(){return nc},getDefaultExtensions:function(){return nh},getStatistics:function(){return nu},minimalSetup:function(){return tY},oneDark:function(){return na},oneDarkHighlightStyle:function(){return nl},oneDarkTheme:function(){return ns},useCodeMirror:function(){return nd}});var o=n(2784),i=n(1727),s=n(95885),l=n(77120),a=n(21649);function c(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(r(n.update(o)),!0)}}let h=c(function(e,t,n=t.selection.ranges){let r=[],o=-1;for(let{from:e,to:i}of n){let n=r.length,s=1e9,l=d(t,e).line;if(l){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+l.length)==l?e:-1;e<a.text.length&&e<s&&(s=e),r.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(s<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=s);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:s}of r)(s||!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},0),u=c(m,0),f=c((e,t)=>m(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 d(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function m(e,t,n=t.selection.ranges){let r=n.map(e=>d(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,s,l=e.sliceDoc(r-50,r),a=e.sliceDoc(o,o+50),c=/\s*$/.exec(l)[0].length,h=/^\s*/.exec(a)[0].length,u=l.length-c;if(l.slice(u-t.length,u)==t&&a.slice(h,h+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:o+h,margin:h&&1}};o-r<=100?i=s=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+50),s=e.sliceDoc(o-50,o));let f=/^\s*/.exec(i)[0].length,d=/\s*$/.exec(s)[0].length,m=s.length-d-n.length;return i.slice(f,f+t.length)==t&&s.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(i.charAt(f+t.length))?1:0},close:{pos:o-d-n.length,margin:/\s/.test(s.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=0,n;t<o.length;t++)if(n=o[t]){let o=r[t],{open:i,close:s}=n;e.push({from:i.pos-o.open.length,to:i.pos+i.margin},{from:s.pos-s.margin,to:s.pos+o.close.length})}return{changes:e}}return null}let p=i.q6.define(),g=i.q6.define(),v=i.r$.define(),y=i.r$.define({combine:e=>(0,i.BO)(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)})}),b=i.QQ.define({create:()=>E.empty,update(e,t){let n=t.state.facet(y),r=t.annotation(p);if(r){var o;let s;let l=t.docChanged?i.jT.single((o=t.changes,s=0,o.iterChangedRanges((e,t)=>s=t),s)):void 0,a=M.fromTransaction(t,l),c=r.side,h=0==c?e.undone:e.done;return h=a?D(h,h.length,n.minDepth,a):O(h,t.startState.selection),new E(0==c?r.rest:h,0==c?h:r.rest)}let s=t.annotation(g);if(("full"==s||"before"==s)&&(e=e.isolate()),!1===t.annotation(i.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let l=M.fromTransaction(t),a=t.annotation(i.YW.time),c=t.annotation(i.YW.userEvent);return l?e=e.addChanges(l,a,c,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,c,n.newGroupDelay)),("full"==s||"after"==s)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new E(e.done.map(M.fromJSON),e.undone.map(M.fromJSON))});function k(e={}){return[b,y.of(e),s.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?w:"historyRedo"==e.inputType?S:null;return!!n&&(e.preventDefault(),n(t))}})]}function x(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(b,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}let w=x(0,!1),S=x(1,!1),A=x(0,!0),C=x(1,!0);class M{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 M(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 M(e.changes&&i.as.fromJSON(e.changes),[],e.mapped&&i.n0.fromJSON(e.mapped),e.startSelection&&i.jT.fromJSON(e.startSelection),e.selectionsAfter.map(i.jT.fromJSON))}static fromTransaction(e,t){let n=J;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 M(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,J)}static selection(e){return new M(void 0,J,void 0,void 0,e)}}function D(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 T(e,t){return e.length?t.length?e.concat(t):e:t}let J=[];function O(e,t){if(!e.length)return[M.selection([t])];{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),D(e,e.length-1,1e9,n.setSelAfter(r)))}}function L(e,t){if(!e.length)return e;let n=e.length,r=J;for(;n;){let o=function(e,t,n){let r=T(e.selectionsAfter.length?e.selectionsAfter.map(e=>
1e.map(t)):J,n);if(!e.changes)return M.selection(r);let o=e.changes.map(t),s=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(s):s;return new M(o,i.Py.mapEffects(e.effects,t),l,e.startSelection.map(s),r)}(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?[M.selection(r)]:J}let B=/^(input\.type|delete)($|\.)/;class E{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new E(this.done,this.undone):this}addChanges(e,t,n,r,o){var i,s;let l,a,c=this.done,h=c[c.length-1];return c=h&&h.changes&&!h.changes.empty&&e.changes&&(!n||B.test(n))&&(!h.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,(i=h.changes,s=e.changes,l=[],a=!1,i.iterChangedRanges((e,t)=>l.push(e,t)),s.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<l.length;){let t=l[e++],o=l[e++];r>=t&&n<=o&&(a=!0)}}),a))||"input.type.compose"==n)?D(c,c.length-1,r.minDepth,new M(e.changes.compose(h.changes),T(e.effects,h.effects),h.mapped,h.startSelection,J)):D(c,c.length,r.minDepth,e),new E(c,J,t,n)}addSelection(e,t,n,r){var o;let i=this.done.length?this.done[this.done.length-1].selectionsAfter:J;return i.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(o=i[i.length-1]).ranges.length==e.ranges.length&&0===o.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length?this:new E(O(this.done,e),this.undone,t,n)}addMapping(e){return new E(L(this.done,e),L(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){let n,i;return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:p.of({side:e,rest:(n=r[r.length-1],(i=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),i)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}if(!o.changes)return null;{let n=1==r.length?J:r.slice(0,r.length-1);return o.mapped&&(n=L(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:p.of({side:e,rest:n}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}E.empty=new E(J,J);let R=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:S,preventDefault:!0},{key:"Mod-u",run:A,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:C,preventDefault:!0}];function j(e,t){return i.jT.create(e.ranges.map(t),e.mainIndex)}function I(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function q({state:e,dispatch:t},n){let r=j(e.selection,n);return!r.eq(e.selection)&&(t(I(e,r)),!0)}function W(e,t){return i.jT.cursor(t?e.to:e.from)}function P(e,t){return q(e,n=>n.empty?e.moveByChar(n,t):W(n,t))}function F(e){return e.textDirectionAt(e.state.selection.main.head)==s.Nm.LTR}let N=e=>P(e,!F(e)),$=e=>P(e,F(e));function z(e,t){return q(e,n=>n.empty?e.moveByGroup(n,t):W(n,t))}function H(e,t,n){let r,o,s=(0,l.qz)(e).resolveInner(t.head),c=n?a.md.closedBy:a.md.openedBy;for(let r=t.head;;){let t=n?s.childAfter(r):s.childBefore(r);if(!t)break;!function(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}(e,t,c)?r=n?t.to:t.from:s=t}return o=s.type.prop(c)&&(r=n?(0,l.Um)(e,s.from,1):(0,l.Um)(e,s.to,-1))&&r.matched?n?r.end.to:r.end.from:n?s.to:s.from,i.jT.cursor(o,n?-1:1)}function U(e,t){return q(e,n=>{if(!n.empty)return W(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}let V=e=>U(e,!1),K=e=>U(e,!0);function G(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,o;if(t){for(let t of e.state.facet(s.tk.scrollMargins)){let o=t(e);(null==o?void 0:o.top)&&(n=Math.max(null==o?void 0:o.top,n)),(null==o?void 0:o.bottom)&&(r=Math.max(null==o?void 0:o.bottom,r))}o=e.scrollDOM.clientHeight-n-r}else o=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,o-5)}}function Q(e,t){let n,r=G(e),{state:o}=e,i=j(o.selection,n=>n.empty?e.moveVertically(n,t,r.height):W(n,t));if(i.eq(o.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(o.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+r.marginTop,c=l.bottom-r.marginBottom;t&&t.top>a&&t.bottom<c&&(n=s.tk.scrollIntoView(i.main.head,{y:"start",yMargin:t.to
1p-a}))}return e.dispatch(I(o,i),{effects:n}),!0}let _=e=>Q(e,!1),Y=e=>Q(e,!0);function Z(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(o=i.jT.cursor(r.from+n))}return o}function X(e,t){let n=j(e.state.selection,e=>{let n=t(e);return i.jT.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(I(e.state,n)),!0)}function ee(e,t){return X(e,n=>e.moveByChar(n,t))}let et=e=>ee(e,!F(e)),en=e=>ee(e,F(e));function er(e,t){return X(e,n=>e.moveByGroup(n,t))}function eo(e,t){return X(e,n=>e.moveVertically(n,t))}let ei=e=>eo(e,!1),es=e=>eo(e,!0);function el(e,t){return X(e,n=>e.moveVertically(n,t,G(e).height))}let ea=e=>el(e,!1),ec=e=>el(e,!0),eh=({state:e,dispatch:t})=>(t(I(e,{anchor:0})),!0),eu=({state:e,dispatch:t})=>(t(I(e,{anchor:e.doc.length})),!0),ef=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:0})),!0),ed=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function em(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange(r=>{let{from:o,to:s}=r;if(o==s){let r=t(o);r<o?(n="delete.backward",r=ep(e,r,!1)):r>o&&(n="delete.forward",r=ep(e,r,!0)),o=Math.min(o,r),s=Math.max(s,r)}else o=ep(e,o,!1),s=ep(e,s,!0);return o==s?{range:r}:{changes:{from:o,to:s},range:i.jT.cursor(o)}});return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?s.tk.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ep(e,t,n){if(e instanceof s.tk)for(let r of e.state.facet(s.tk.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let eg=(e,t)=>em(e,n=>{let{state:r}=e,o=r.doc.lineAt(n),s,a;if(!t&&n>o.from&&n<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,n-o.from))){if(" "==s[s.length-1])return n-1;let e=(0,i.IS)(s,r.tabSize)%(0,l.y1)(r)||(0,l.y1)(r);for(let t=0;t<e&&" "==s[s.length-1-t];t++)n--;a=n}else(a=(0,i.cp)(o.text,n-o.from,t,t)+o.from)==n&&o.number!=(t?r.doc.lines:1)&&(a+=t?1:-1);return a}),ev=e=>eg(e,!1),ey=e=>eg(e,!0),eb=(e,t)=>em(e,n=>{let r=n,{state:o}=e,s=o.doc.lineAt(r),l=o.charCategorizer(r);for(let e=null;;){if(r==(t?s.to:s.from)){r==n&&s.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let a=(0,i.cp)(s.text,r-s.from,t)+s.from,c=s.text.slice(Math.min(r,a)-s.from,Math.max(r,a)-s.from),h=l(c);if(null!=e&&h!=e)break;(" "!=c||r!=n)&&(e=h),r=a}return r}),ek=e=>eb(e,!1),ex=e=>em(e,t=>{let n=e.lineBlockAt(t).to;return t<n?n:Math.min(e.state.doc.length,t+1)});function ew(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 eS(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let t of ew(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),l=s.length+1;if(n)for(let n of(r.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))o.push(i.jT.range(Math.min(e.doc.length,n.anchor+l),Math.min(e.doc.length,n.head+l)));else for(let n of(r.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))o.push(i.jT.range(n.anchor-l,n.head-l))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:i.jT.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function eA(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of ew(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}let eC=eD(!1),eM=eD(!0);function eD(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:o}=n,s=t.doc.lineAt(r),c=!e&&r==o&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,l.qz)(e).resolveInner(t),r=n.childBefore(t),o=n.childAfter(t),i;return r&&o&&r.to<=t&&o.from>=t&&(i=r.type.prop(a.md.closedBy))&&i.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from?{from:r.to,to:o.from}:null}(t,r);e&&(r=o=(o<=s.to?s:t.doc.lineAt(o)).to);let h=new l.Gn(t,{simulateBreak:r,simulateDoubleBreak:!!c}),u=(0,l.K0)(h,r);for(null==u&&(u=/^\s*/.exec(t.doc.lineAt(r).text)[0].length);o<s.to&&/\s/.test(s.text[o-s.from]);)o++;c?{from:r,to:o}=c:r>s.from&&r<s.from+100&&!/\S/.test(s.text.slice(0,r))&&(r=s.from);let f=["",(0,l.SS)(t,u)];return c&&f.push((0,l.SS)(t,h.lineIndent(s.from,-1))),{changes:{from:r,to:o,insert:i.xv.of(f)},range:i.jT.cursor(r+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function eT(e,t){let n=-1;return e.changeByRange(r=>{let o=[];for(let i=r.from;i<=r.to;){let s=e.doc.lineAt(i);s.number>n&&(r.empty||r.to>s.from)&&(t(s,o,r),n=s.number),i=s.to+1}let s=e.changes(o);return{changes:o,range:i.jT.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}let eJ=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eT(e,(t,n)=>{n.push({from:t.from,insert:e.facet(l.c)})}),{userEvent:"input.indent"}
1)),!0),eO=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eT(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=(0,i.IS)(r,e.tabSize),s=0,a=(0,l.SS)(e,Math.max(0,o-(0,l.y1)(e)));for(;s<r.length&&s<a.length&&r.charCodeAt(s)==a.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+r.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),eL=[{key:"Ctrl-b",run:N,shift:et,preventDefault:!0},{key:"Ctrl-f",run:$,shift:en},{key:"Ctrl-p",run:V,shift:ei},{key:"Ctrl-n",run:K,shift:es},{key:"Ctrl-a",run:e=>q(e,t=>i.jT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>X(e,t=>i.jT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>q(e,t=>i.jT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>X(e,t=>i.jT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:ey},{key:"Ctrl-h",run:ev},{key:"Ctrl-k",run:ex},{key:"Ctrl-Alt-h",run:ek},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:i.xv.of(["",""])},range:i.jT.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({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,r=e.doc.lineAt(n),o=n==r.from?n-1:(0,i.cp)(r.text,n-r.from,!1)+r.from,s=n==r.to?n+1:(0,i.cp)(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(o,n))},range:i.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Y}],eB=[{key:"ArrowLeft",run:N,shift:et,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>z(e,!F(e)),shift:e=>er(e,!F(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>q(e,t=>Z(e,t,!F(e))),shift:e=>X(e,t=>Z(e,t,!F(e))),preventDefault:!0},{key:"ArrowRight",run:$,shift:en,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>z(e,F(e)),shift:e=>er(e,F(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>q(e,t=>Z(e,t,F(e))),shift:e=>X(e,t=>Z(e,t,F(e))),preventDefault:!0},{key:"ArrowUp",run:V,shift:ei,preventDefault:!0},{mac:"Cmd-ArrowUp",run:eh,shift:ef},{mac:"Ctrl-ArrowUp",run:_,shift:ea},{key:"ArrowDown",run:K,shift:es,preventDefault:!0},{mac:"Cmd-ArrowDown",run:eu,shift:ed},{mac:"Ctrl-ArrowDown",run:Y,shift:ec},{key:"PageUp",run:_,shift:ea},{key:"PageDown",run:Y,shift:ec},{key:"Home",run:e=>q(e,t=>Z(e,t,!1)),shift:e=>X(e,t=>Z(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:eh,shift:ef},{key:"End",run:e=>q(e,t=>Z(e,t,!0)),shift:e=>X(e,t=>Z(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:eu,shift:ed},{key:"Enter",run:eC},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ev,shift:ev},{key:"Delete",run:ey},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ek},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>eb(e,!0)},{mac:"Mod-Backspace",run:e=>em(e,t=>{let n=e.lineBlockAt(t).from;return t>n?n:Math.max(0,t-1)})},{mac:"Mod-Delete",run:ex}].concat(eL.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),eE=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>q(e,t=>H(e.state,t,!F(e))),shift:e=>X(e,t=>H(e.state,t,!F(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>q(e,t=>H(e.state,t,F(e))),shift:e=>X(e,t=>H(e.state,t,F(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>eS(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>eA(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>eS(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>eA(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=i.jT.create([n.main]):n.main.empty||(r=i.jT.create([i.jT.cursor(n.main.head)])),!!r&&(t(I(e,r)),!0)}},{key:"Mod-Enter",run:eM},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=ew(e).map(({from:t,to:n})=>i.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:i.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=j(e.selection,t=>{var n;let r=(0,l.qz)(e).resolveInner(t.head,1);for(;!(r.from<t.from&&r.to>=t.to||r.to>t.to&&r.from<=t.from||!(null===(n=r.parent)||void 0===n?void 0:n.parent));)r=r.parent;return i.jT.range(r.to,r.from)});return t(I(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:eO},{key:"Mod-]",run:eJ},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new l.Gn(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=eT(e,(t,o,i)=>{let s=(0,l.K0)(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],c=(0,l.SS)(e,s);(a!=c||i.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}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ew(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=j(t.selection,t=>e.moveVertically(t,!0)).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=j(e.selection,t=>{let r=(0,l.Um)(e,t.head,-1)||(0,l.Um)(e,t.head,1)||t.head>0&&(0,l.Um)(e,t.head-1,1)||t.head<e.doc.length&&(0,l.Um)(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let o=r.start.from==t.head?r.end.to:r.end.from;return i.jT.cursor(o)}),!!n&&(t(I(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=d(e.state,n.from);return r.line?h(e):!!r.block&&f(e)}},{key:"Alt-A",run:u}].concat(eB),eR={key:"Tab",run:eJ,shift:eO};function ej(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];
vendor: 4,649 bytes, line 1
1"string"==typeof o?e.setAttribute(r,o):null!=o&&(e[r]=o)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let eI="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class eq{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(eI(e)):eI,this.query=this.normalize(t)}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(0,i.gm)(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 t=(0,i.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,i.nZ)(e);let r=this.normalize(t);for(let e=0,o=n;;e++){let i=r.charCodeAt(e),s=this.match(i,o);if(s)return this.value=s,this;if(e==r.length-1)break;o==n&&e<t.length&&t.charCodeAt(e)==i&&o++}}}match(e,t){let n=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],i=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?n={from:this.matches[r+1],to:t+1}:(this.matches[r]++,i=!0)),i||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?n={from:t,to:t+1}:this.matches.push(1,t)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferPos)&&(n=null),n}}"undefined"!=typeof Symbol&&(eq.prototype[Symbol.iterator]=function(){return this});let eW={from:-1,to:-1,match:/.*/.exec("")},eP="gm"+(null==/x/.unicode?"":"u");class eF{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=eW,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new ez(e,t,n,r,o);this.re=new RegExp(t,eP+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=eH(e,r),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 t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=eH(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let eN=new WeakMap;class e${constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=eN.get(e);if(!r||r.from>=n||r.to<=t){let r=new e$(t,e.sliceString(t,n));return eN.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),eN.set(e,new e$(i,o)),new e$(t,o.slice(t-i,n-i))}}class ez{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=eW,this.matchPos=eH(e,r),this.re=new RegExp(t,eP+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=e$.get(e,r,this.chunkEnd(r+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,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=eH(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=e$.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function eH(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function eU(e){let t=ej("input",{class:"cm-textfield",name:"line"});
1function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,o=r.doc.lineAt(r.selection.main.head),[,s,l,a,c]=n,h=a?+a.slice(1):0,u=l?+l:o.number;if(l&&c){let e=u/100;s&&(e=e*("-"==s?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else l&&s&&(u=u*("-"==s?-1:1)+o.number);let f=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));e.dispatch({effects:eV.of(!1),selection:i.jT.cursor(f.from+Math.max(0,Math.min(h,f.length))),scrollIntoView:!0}),e.focus()}return{dom:ej("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:eV.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},ej("label",e.state.phrase("Go to line"),": ",t)," ",ej("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(eF.prototype[Symbol.iterator]=ez.prototype[Symbol.iterator]=function(){return this});let eV=i.Py.define(),eK=i.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(eV)&&(e=n.value);return e},provide:e=>s.mH.from(e,e=>e?eU:null)}),eG=s.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),eQ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},e_=i.r$.define({combine:e=>(0,i.BO)(e,eQ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),eY=s.p.mark({class:"cm-selectionMatch"}),eZ=s.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function eX(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=i.D0.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=i.D0.Word)}let e0=s.lg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(e_),{state:n}=e,r=n.selection;if(r.ranges.length>1)return s.p.none;let o=r.main,l,a=null;if(o.empty){if(!t.highlightWordAroundCursor)return s.p.none;let e=n.wordAt(o.head);if(!e)return s.p.none;a=n.charCategorizer(o.head),l=n.sliceDoc(e.from,e.to)}else{let e=o.to-o.from;if(e<t.minSelectionLength||e>200)return s.p.none;if(t.wholeWords){var c,h,u;if(l=n.sliceDoc(o.from,o.to),!(eX(a=n.charCategorizer(o.head),n,o.from,o.to)&&(c=a,h=o.from,u=o.to,c(n.sliceDoc(h,h+1))==i.D0.Word&&c(n.sliceDoc(u-1,u))==i.D0.Word)))return s.p.none}else if(!(l=n.sliceDoc(o.from,o.to).trim()))return s.p.none}let f=[];for(let r of e.visibleRanges){let e=new eq(n.doc,l,r.from,r.to);for(;!e.next().done;){let{from:r,to:i}=e.value;if((!a||eX(a,n,r,i))&&(o.empty&&r<=o.from&&i>=o.to?f.push(eZ.range(r,i)):(r>=o.to||i<=o.from)&&f.push(eY.range(r,i)),f.length>t.maxMatches))return s.p.none}}return s.p.set(f)}},{decorations:e=>e.decorations}),e1=s.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),e2=({state:e,dispatch:t})=>{let{selection:n}=e,r=i.jT.create(n.ranges.map(t=>e.wordAt(t.head)||i.jT.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)},e3=i.r$.define({combine:e=>(0,i.BO)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tw(e),scrollToMatch:e=>s.tk.scrollIntoView(e)})});class e5{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,eP),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==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 tt(this):new e6(this)}getCursor(e,t=0,n){let r=e.doc?e:i.yy.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?e7(this,r,t,n):e4(this,r,t,n)}}class e9{constructor(e){this.spec=e}}function e4(e,t,n,r){var o,s;return new eq(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(o=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=o.sliceString(r,Math.min(o.length,t+2))),(s(e8(n,e-r))!=i.D0.Word||s(te(n,e-r))!=i.D0.Word)&&(s(te(n,t-r))!=i.D0.Word||s(e8(n,t-r))!=i.D0.Word))):void 0)}class e6 extends e9{constructor(e){super(e)}
1nextMatch(e,t,n){let r=e4(this.spec,e,n,e.doc.length).nextOverlapping();return r.done&&(r=e4(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=e4(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=e4(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=e4(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function e7(e,t,n,r){var o;return new eF(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(o(e8(n.input,n.index))!=i.D0.Word||o(te(n.input,n.index))!=i.D0.Word)&&(o(te(n.input,n.index+n[0].length))!=i.D0.Word||o(e8(n.input,n.index+n[0].length))!=i.D0.Word)):void 0},n,r)}function e8(e,t){return e.slice((0,i.cp)(e,t,!1),t)}function te(e,t){return e.slice(t,(0,i.cp)(e,t))}class tt extends e9{nextMatch(e,t,n){let r=e7(this.spec,e,n,e.doc.length).next();return r.done&&(r=e7(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=e7(this.spec,e,o,n),s=null;for(;!i.next().done;)s=i.value;if(s&&(o==t||s.from>o+10))return s;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n<e.match.length?e.match[n]:t))}matchAll(e,t){let n=e7(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=e7(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}let tn=i.Py.define(),tr=i.Py.define(),to=i.QQ.define({create:e=>new ti(tg(e).create(),null),update(e,t){for(let n of t.effects)n.is(tn)?e=new ti(n.value.create(),e.panel):n.is(tr)&&(e=new ti(e.query,n.value?tp:null));return e},provide:e=>s.mH.from(e,e=>e.panel)});class ti{constructor(e,t){this.query=e,this.panel=t}}let ts=s.p.mark({class:"cm-searchMatch"}),tl=s.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ta=s.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(to))}update(e){let t=e.state.field(to);(t!=e.startState.field(to)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return s.p.none;let{view:n}=this,r=new i.f_;for(let t=0,o=n.visibleRanges,i=o.length;t<i;t++){let{from:s,to:l}=o[t];for(;t<i-1&&l>o[t+1].from-500;)l=o[++t].to;e.highlight(n.state,s,l,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?tl:ts)})}return r.finish()}},{decorations:e=>e.decorations});function tc(e){return t=>{let n=t.state.field(to,!1);return n&&n.query.spec.valid?e(t,n):tb(t)}}let th=tc((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=i.jT.single(r.from,r.to),s=e.state.facet(e3);return e.dispatch({selection:o,effects:[tC(e,r),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),ty(e),!0}),tu=tc((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let s=i.jT.single(o.from,o.to),l=e.state.facet(e3);return e.dispatch({selection:s,effects:[tC(e,o),l.scrollToMatch(s.main,e)],userEvent:"select.search"}),ty(e),!0}),tf=tc((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:i.jT.create(n.map(e=>i.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),td=tc((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let l=t.nextMatch(n,r,r);if(!l)return!1;let a=[],c,h,u=[];
1if(l.from==r&&l.to==o&&(h=n.toText(t.getReplacement(l)),a.push({from:l.from,to:l.to,insert:h}),l=t.nextMatch(n,l.from,l.to),u.push(s.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),l){let t=0==a.length||a[0].from>=l.to?0:l.to-l.from-h.length;c=i.jT.single(l.from-t,l.to-t),u.push(tC(e,l)),u.push(n.facet(e3).scrollToMatch(c.main,e))}return e.dispatch({changes:a,selection:c,effects:u,userEvent:"input.replace"}),!0}),tm=tc((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:s.tk.announce.of(r),userEvent:"input.replace.all"}),!0});function tp(e){return e.state.facet(e3).createPanel(e)}function tg(e,t){var n,r,o,i,s;let l=e.selection.main,a=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=e.facet(e3);return new e5({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function tv(e){let t=(0,s.Sd)(e,tp);return t&&t.dom.querySelector("[main-field]")}function ty(e){let t=tv(e);t&&t==e.root.activeElement&&t.select()}let tb=e=>{let t=e.state.field(to,!1);if(t&&t.panel){let n=tv(e);if(n&&n!=e.root.activeElement){let r=tg(e.state,t.query.spec);r.valid&&e.dispatch({effects:tn.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[tr.of(!0),t?tn.of(tg(e.state,t.query.spec)):i.Py.appendConfig.of(tD)]});return!0},tk=e=>{let t=e.state.field(to,!1);if(!t||!t.panel)return!1;let n=(0,s.Sd)(e,tp);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:tr.of(!1)}),!0},tx=[{key:"Mod-f",run:tb,scope:"editor search-panel"},{key:"F3",run:th,shift:tu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:th,shift:tu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tk,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,s=[],l=0;for(let t=new eq(e.doc,e.sliceDoc(r,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==r&&(l=s.length),s.push(i.jT.range(t.value.from,t.value.to))}return t(e.update({selection:i.jT.create(s,l),userEvent:"select.search.matches"})),!0}},{key:"Alt-g",run:e=>{let t=(0,s.Sd)(e,eU);if(!t){let n=[eV.of(!0)];null==e.state.field(eK,!1)&&n.push(i.Py.appendConfig.of([eK,eG])),e.dispatch({effects:n}),t=(0,s.Sd)(e,eU)}return t&&t.dom.querySelector("input").focus(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return e2({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let n=!1,o=new eq(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(n)return null;o=new eq(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==o.value.from))continue;if(i){let t=e.wordAt(o.value.from);if(!t||t.from!=o.value.from||t.to!=o.value.to)continue}return o.value}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(i.jT.range(o.from,o.to),!1),effects:s.tk.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class tw{constructor(e){this.view=e;let t=this.query=e.state.field(to).query.spec;function n(e,t,n){return ej("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=ej("input",{value:t.search,placeholder:tS(e,"Find"),"aria-label":tS(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ej("input",{value:t.replace,placeholder:tS(e,"Replace"),"aria-label":tS(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ej("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ej("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ej("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=ej("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>th(e),[tS(e,"next")]),n("prev",()=>tu(e),[tS(e,"previous")]),n("select",()=>
1tf(e),[tS(e,"all")]),ej("label",null,[this.caseField,tS(e,"match case")]),ej("label",null,[this.reField,tS(e,"regexp")]),ej("label",null,[this.wordField,tS(e,"by word")]),...e.state.readOnly?[]:[ej("br"),this.replaceField,n("replace",()=>td(e),[tS(e,"replace")]),n("replaceAll",()=>tm(e),[tS(e,"replace all")])],ej("button",{name:"close",onclick:()=>tk(e),"aria-label":tS(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new e5({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:tn.of(e)}))}keydown(e){(0,s.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?tu:th)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),td(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(tn)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(e3).top}}function tS(e,t){return e.state.phrase(t)}let tA=/[\s\.,:;?!]/;function tC(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-30),l=Math.min(o,n+30),a=e.state.sliceDoc(i,l);if(i!=r.from){for(let e=0;e<30;e++)if(!tA.test(a[e+1])&&tA.test(a[e])){a=a.slice(e);break}}if(l!=o){for(let e=a.length-1;e>a.length-30;e--)if(!tA.test(a[e-1])&&tA.test(a[e])){a=a.slice(0,e);break}}return s.tk.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}let tM=s.tk.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),tD=[to,i.Wl.lowest(ta),tM];var tT=n(64100);class tJ{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class tO{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,o=n.facet(tF).markerFilter;o&&(r=o(r));let i=s.p.set(r.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?s.p.widget({widget:new tz(e),diagnostic:e}).range(e.from):s.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)),!0);return new tO(i,t,tL(i))}}function tL(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!t||o.diagnostic==t)return r=new tJ(e,n,o.diagnostic),!1}),r}function tB(e,t){let n=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(tE))||e.changes.touchesRange(n.from,n.to))}let tE=i.Py.define(),tR=i.Py.define(),tj=i.Py.define(),tI=i.QQ.define({create:()=>new tO(s.p.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),r=null;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=tL(n,e.selected.diagnostic,o)||tL(n,null,o)}e=new tO(n,e.panel,r)}for(let n of t.effects)n.is(tE)?e=tO.init(n.value,e.panel,t.state):n.is(tR)?e=new tO(e.diagnostics,n.value?tU.open:null,e.selected):n.is(tj)&&(e=new tO(e.diagnostics,e.panel,n.value));return e},provide:e=>[s.mH.from(e,e=>e.panel),s.tk.decorations.from(e,e=>e.diagnostics)]}),tq=s.p.mark({class:"cm-lintRange cm-lintRange-active"}),tW=e=>{let t=e.state.field(tI,!1);return!!t&&!!t.panel&&(e.dispatch({effects:tR.of(!1)}),!0)},tP=[{key:"Mod-Shift-m",run:e=>{var t,n;let r=e.state.field(tI,!1);r&&r.panel||e.dispatch({effects:(t=e.state,n=[tR.of(!0)],t.field(tI,!1)?n:n.concat(i.Py.appendConfig.of(tQ)))});let o=(0,s.Sd)(e,tU.open);return o&&o.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(tI,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return(!!r.value||!!(r=t.diagnostics.iter(0)).value&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],tF=i.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source)},(0,i.BO)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function tN(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function t$(e,t,n){var r;let o=n?tN(t.actions):[];return ej("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},ej("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,s=r=>{if(r.preventDefault(),i)return;i=!0;let o=tL(e.state.field(tI).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:l}=n,a=o[r]?l.indexOf(o[r]):-1,c=a<0?l:[l.slice(0,a),ej("u",l.slice(a,a+1)),l.slice(a+1)];return ej("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${l}${a<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&ej("div",{class:"cm-diagnosticSource"},t.source))}class tz extends s.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return ej("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class tH{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=t$(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class tU{constructor(e){this.view=e,this.items=[],this.list=ej("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)tW(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=tN(n.actions);for(let o=0;o<r.length;
1o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=tL(this.view.state.field(tI).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=ej("div",{class:"cm-panel-lint"},this.list,ej("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>tW(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(tI).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(tI),n=0,r=!1,o=null;for(e.between(0,this.view.state.doc.length,(e,i,{spec:s})=>{let l=-1,a;for(let e=n;e<this.items.length;e++)if(this.items[e].diagnostic==s.diagnostic){l=e;break}l<0?(a=new tH(this.view,s.diagnostic),this.items.splice(n,0,a),r=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),o=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new tH(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{e.top<t.top?this.list.scrollTop-=t.top-e.top:e.bottom>t.bottom&&(this.list.scrollTop+=e.bottom-t.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=tL(this.view.state.field(tI).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:tj.of(t)})}static open(e){return new tU(e)}}function tV(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let tK=s.tk.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:tV("#d11")},".cm-lintRange-warning":{backgroundImage:tV("orange")},".cm-lintRange-info":{backgroundImage:tV("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});s.SJ;let tG=i.Py.define(),tQ=[tI,s.tk.decorations.compute([tI],e=>{let{selected:t,panel:n}=e.field(tI);return t&&n&&t.from!=t.to?s.p.set([tq.range(t.from,t.to)]):s.p.none}),(0,s.bF)(function(e,t,n){let{diagnostics:r}=e.state.field(tI),o=[],i=2e8,s=0;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:l})=>{t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0))&&(o.push(l.diagnostic),i=Math.min(e,i),s=Math.max(r,s))});let l=e.state.facet(tF).tooltipFilter;return(l&&(o=l(o)),o.length)?{pos:i,end:s,above:e.state.doc.lineAt(i).to<s,create:()=>{var t;return{dom:(t=e,ej("ul",{class:"cm-tooltip-lint"},o.map(e=>t$(t,e,!1))))}}}:null},{hideOn:tB}),tK];var t_=function(e){void 0===e&&(e={});var t,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(tT.GA)),!1!==e.defaultKeymap&&(n=n.concat(eE)),!1!==e.searchKeymap&&(n=n.concat(tx)),!1!==e.historyKeymap&&(n=n.concat(R)),!1!==e.foldKeymap&&(n=n.concat(l.e7)),!1!==e.completionKeymap&&(n=n.concat(tT.B1)),!1!==e.lintKeymap&&(n=n.concat(tP));var r=[];if(!1!==e.lineNumbers&&r.push((0,s.Eu)()),!1!==e.highlightActiveLineGutter&&r.push((0,s.HQ)()),!1!==e.highlightSpecialChars&&r.push((0,s.AE)()),!1!==e.history&&r.push(k()),!1!==e.foldGutter&&r.push((0,l.mi)()),!1!==e.drawSelection&&r.push((0,s.Uw)()),!1!==e.dropCursor&&r.push((0,s.qr)()),!1!==e.allowMultipleSelections&&r.push(i.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push((0,l.nY)()),!1!==e.syntaxHighlighting&&r.push((0,l.nF)(l.R_,{fallback:!0})),!1!==e.bracketMatching&&r.push((0,l.n$)()),!1!==e.closeBrackets&&r.push((0,tT.vQ)()),!1!==e.autocompletion&&r.push((0,tT.ys)()),!1!==e.rectangularSelection&&r.push((0,s.Zs)()),!1!==e.crosshairCursor&&r.push((0,s.S2)()),!1!==e.highlightActiveLine&&r.push((0,s.ZO)()),!1!==e.highlightSelectionMatches){let e;r.push((e=[e1,e0],t&&e.push(e_.of(t)),e))}return e.tabSize&&"number"==typeof e.tabSize&&r.push(l.c.of(" ".repeat(e.tabSize))),r.concat([s.$f.of(n.flat())]).filter(
1Boolean)},tY=function(e){void 0===e&&(e={});var t=[];!1!==e.defaultKeymap&&(t=t.concat(eE)),!1!==e.historyKeymap&&(t=t.concat(R));var n=[];return!1!==e.highlightSpecialChars&&n.push((0,s.AE)()),!1!==e.history&&n.push(k()),!1!==e.drawSelection&&n.push((0,s.Uw)()),!1!==e.syntaxHighlighting&&n.push((0,l.nF)(l.R_,{fallback:!0})),n.concat([s.$f.of(t.flat())]).filter(Boolean)},tZ=n(86253);let tX="#e5c07b",t0="#e06c75",t1="#56b6c2",t2="#ffffff",t3="#abb2bf",t5="#7d8799",t9="#61afef",t4="#98c379",t6="#d19a66",t7="#c678dd",t8="#21252b",ne="#2c313a",nt="#282c34",nn="#353a42",nr="#3E4451",no="#528bff",ni={chalky:tX,coral:t0,cyan:t1,invalid:t2,ivory:t3,stone:t5,malibu:t9,sage:t4,whiskey:t6,violet:t7,darkBackground:t8,highlightBackground:ne,background:nt,tooltipBackground:nn,selection:nr,cursor:no},ns=s.tk.theme({"&":{color:t3,backgroundColor:nt},".cm-content":{caretColor:no},".cm-cursor, .cm-dropCursor":{borderLeftColor:no},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:nr},".cm-panels":{backgroundColor:t8,color:t3},".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:nt,color:t5,border:"none"},".cm-activeLineGutter":{backgroundColor:ne},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:nn},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nn,borderBottomColor:nn},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ne,color:t3}}},{dark:!0}),nl=l.Qf.define([{tag:tZ.pJ.keyword,color:t7},{tag:[tZ.pJ.name,tZ.pJ.deleted,tZ.pJ.character,tZ.pJ.propertyName,tZ.pJ.macroName],color:t0},{tag:[tZ.pJ.function(tZ.pJ.variableName),tZ.pJ.labelName],color:t9},{tag:[tZ.pJ.color,tZ.pJ.constant(tZ.pJ.name),tZ.pJ.standard(tZ.pJ.name)],color:t6},{tag:[tZ.pJ.definition(tZ.pJ.name),tZ.pJ.separator],color:t3},{tag:[tZ.pJ.typeName,tZ.pJ.className,tZ.pJ.number,tZ.pJ.changed,tZ.pJ.annotation,tZ.pJ.modifier,tZ.pJ.self,tZ.pJ.namespace],color:tX},{tag:[tZ.pJ.operator,tZ.pJ.operatorKeyword,tZ.pJ.url,tZ.pJ.escape,tZ.pJ.regexp,tZ.pJ.link,tZ.pJ.special(tZ.pJ.string)],color:t1},{tag:[tZ.pJ.meta,tZ.pJ.comment],color:t5},{tag:tZ.pJ.strong,fontWeight:"bold"},{tag:tZ.pJ.emphasis,fontStyle:"italic"},{tag:tZ.pJ.strikethrough,textDecoration:"line-through"},{tag:tZ.pJ.link,color:t5,textDecoration:"underline"},{tag:tZ.pJ.heading,fontWeight:"bold",color:t0},{tag:[tZ.pJ.atom,tZ.pJ.bool,tZ.pJ.special(tZ.pJ.variableName)],color:t6},{tag:[tZ.pJ.processingInstruction,tZ.pJ.string,tZ.pJ.inserted],color:t4},{tag:tZ.pJ.invalid,color:t2}]),na=[ns,(0,l.nF)(nl)];var nc=s.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),nh=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:o="light",placeholder:l="",basicSetup:a=!0}=e,c=[];switch(t&&c.unshift(s.$f.of([eR])),a&&("boolean"==typeof a?c.unshift(t_()):c.unshift(t_(a))),l&&c.unshift((0,s.W$)(l)),o){case"light":c.push(nc);break;case"dark":c.push(na);break;case"none":break;default:c.push(o)}return!1===n&&c.push(s.tk.editable.of(!1)),r&&c.push(i.yy.readOnly.of(!0)),[...c]},nu=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),nf=i.q6.define();
1function nd(e){var{value:t,selection:n,onChange:r,onStatistics:l,onCreateEditor:a,onUpdate:c,extensions:h=[],autoFocus:u,theme:f="light",height:d="",minHeight:m="",maxHeight:p="",placeholder:g="",width:v="",minWidth:y="",maxWidth:b="",editable:k=!0,readOnly:x=!1,indentWithTab:w=!0,basicSetup:S=!0,root:A,initialState:C}=e,[M,D]=(0,o.useState)(),[T,J]=(0,o.useState)(),[O,L]=(0,o.useState)(),B=s.tk.theme({"&":{height:d,minHeight:m,maxHeight:p,width:v,minWidth:y,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),E=[s.tk.updateListener.of(e=>{e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(nf))&&r(e.state.doc.toString(),e),l&&l(nu(e))}),B,...nh({theme:f,editable:k,readOnly:x,placeholder:g,indentWithTab:w,basicSetup:S})];return c&&"function"==typeof c&&E.push(s.tk.updateListener.of(c)),E=E.concat(h),(0,o.useEffect)(()=>{if(M&&!O){var e={doc:t,selection:n,extensions:E},r=C?i.yy.fromJSON(C.json,e,C.fields):i.yy.create(e);if(L(r),!T){var o=new s.tk({state:r,parent:M,root:A});J(o),a&&a(o,r)}}return()=>{T&&(L(void 0),J(void 0))}},[M,O]),(0,o.useEffect)(()=>D(e.container),[e.container]),(0,o.useEffect)(()=>()=>{T&&(T.destroy(),J(void 0))},[T]),(0,o.useEffect)(()=>{u&&T&&T.focus()},[u,T]),(0,o.useEffect)(()=>{T&&T.dispatch({effects:i.Py.reconfigure.of(E)})},[f,h,d,m,p,v,y,b,g,k,x,w,S,r,c]),(0,o.useEffect)(()=>{if(void 0!==t){var e=T?T.state.doc.toString():"";T&&t!==e&&T.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[nf.of(!0)]})}},[t,T]),{state:O,setState:L,view:T,setView:J,container:M,setContainer:D}}var nm=n(52322),np=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ng=(0,o.forwardRef)((e,t)=>{var{className:n,value:i="",selection:s,extensions:l=[],onChange:a,onStatistics:c,onCreateEditor:h,onUpdate:u,autoFocus:f,theme:d="light",height:m,minHeight:p,maxHeight:g,width:v,minWidth:y,maxWidth:b,basicSetup:k,placeholder:x,indentWithTab:w,editable:S,readOnly:A,root:C,initialState:M}=e,D=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,np),T=(0,o.useRef)(null),{state:J,view:O,container:L}=nd({container:T.current,root:C,value:i,autoFocus:f,theme:d,height:m,minHeight:p,maxHeight:g,width:v,minWidth:y,maxWidth:b,basicSetup:k,placeholder:x,indentWithTab:w,editable:S,readOnly:A,selection:s,onChange:a,onStatistics:c,onCreateEditor:h,onUpdate:u,extensions:l,initialState:M});if((0,o.useImperativeHandle)(t,()=>({editor:T.current,state:J,view:O}),[T,L,J,O]),"string"!=typeof i)throw Error("value must be typeof string but got "+typeof i);var B="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,nm.jsx)("div",r({ref:T,className:""+B+(n?" "+n:"")},D))});ng.displayName="CodeMirror";var nv=ng}}]); 2//# sourceMappingURL=3421.859f923be1afd0bb.js.map
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.