@hpcc-js/codemirror 3.7.9 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var n = Object.create, r = Object.defineProperty, i = Object.getOwnPropertyDescr
9
9
  }, __toESM = (e, t, i) => (i = e == null ? {} : n(o(e)), __copyProps(t || !e || !e.__esModule ? r(i, "default", {
10
10
  value: e,
11
11
  enumerable: !0
12
- }) : i, e)), c = "@hpcc-js/codemirror", l = "3.7.9", u = "3.25.1", d = /* @__PURE__ */ __commonJSMin(((e, t) => {
12
+ }) : i, e)), c = "@hpcc-js/codemirror", l = "3.8.0", u = "3.26.0", d = /* @__PURE__ */ __commonJSMin(((e, t) => {
13
13
  (function(n, r) {
14
14
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n ||= self, n.CodeMirror = r());
15
15
  })(e, (function() {
@@ -1,4 +1,4 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/codemirror`]={},e[`@hpcc-js/common`]))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},__toESM=(e,t,i)=>(i=e==null?{}:n(o(e)),__copyProps(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),c=`@hpcc-js/codemirror`,l=`3.7.9`,u=`3.25.1`,d=__commonJSMin(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),m=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),_=m&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=_||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=_||/Mac/.test(t),x=/\bCrOS\b/.test(e),S=/win/i.test(t),C=f&&e.match(/Version\/(\d*\.\d*)/);C&&=Number(C[1]),C&&C>=15&&(f=!1,c=!0);var w=b&&(l||f&&(C==null||C<12.11)),T=n||o&&s>=9;function classTest(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var rmClass=function(e,t){var n=e.className,r=classTest(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function removeChildren(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(e,t){return removeChildren(e).appendChild(t)}function elt(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function eltP(e,t,n,r){var i=elt(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var E=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function contains(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function activeElt(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function addClass(e,t){var n=e.className;classTest(t).test(n)||(e.className+=(n?` `:``)+t)}function joinClasses(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!classTest(n[r]).test(t)&&(t+=` `+n[r]);return t}var selectInput=function(e){e.select()};_?selectInput=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(selectInput=function(e){try{e.select()}catch{}});function doc(e){return e.display.wrapper.ownerDocument}function root(e){return rootNode(e.display.wrapper)}function rootNode(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function win(e){return doc(e).defaultView}function bind(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function copyObj(e,t,n){for(var r in t||={},e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function countColumn(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var Delayed=function(){this.id=null,this.f=null,this.time=0,this.handler=bind(this.onTimeout,this)};Delayed.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Delayed.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function indexOf(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var D=50,O={toString:function(){return`CodeMirror.Pass`}},k={scroll:!1},A={origin:`*mouse`},j={origin:`+move`};function findColumn(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var M=[``];function spaceStr(e){for(;M.length<=e;)M.push(lst(M)+` `);return M[e]}function lst(e){return e[e.length-1]}function map(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function insertSorted(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function nothing(){}function createObj(e,t){var n;return Object.create?n=Object.create(e):(nothing.prototype=e,n=new nothing),t&&copyObj(t,n),n}var N=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function isWordCharBasic(e){return/\w/.test(e)||e>`€`&&(e.toUpperCase()!=e.toLowerCase()||N.test(e))}function isWordChar(e,t){return t?t.source.indexOf(`\\w`)>-1&&isWordCharBasic(e)?!0:t.test(e):isWordCharBasic(e)}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var P=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function isExtendingChar(e){return e.charCodeAt(0)>=768&&P.test(e)}function skipExtendingChars(e,t,n){for(;(n<0?t>0:t<e.length)&&isExtendingChar(e.charAt(t));)t+=n;return t}function findFirst(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function iterateBidiSections(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var F=null;function getBidiPartAt(e,t,n){var r;F=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:F=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:F=i)}return r??F}var I=(function(){var e=`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`,t=`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`;function charType(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?`R`:1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?`r`:8192<=n&&n<=8203?`w`:n==8204?`b`:`L`}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,a=/[Lb1n]/,o=/[1n]/;function BidiSpan(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var s=t==`ltr`?`L`:`R`;if(e.length==0||t==`ltr`&&!n.test(e))return!1;for(var c=e.length,l=[],u=0;u<c;++u)l.push(charType(e.charCodeAt(u)));for(var d=0,f=s;d<c;++d){var m=l[d];m==`m`?l[d]=f:f=m}for(var h=0,g=s;h<c;++h){var _=l[h];_==`1`&&g==`r`?l[h]=`n`:i.test(_)&&(g=_,_==`r`&&(l[h]=`R`))}for(var v=1,y=l[0];v<c-1;++v){var b=l[v];b==`+`&&y==`1`&&l[v+1]==`1`?l[v]=`1`:b==`,`&&y==l[v+1]&&(y==`1`||y==`n`)&&(l[v]=y),y=b}for(var x=0;x<c;++x){var S=l[x];if(S==`,`)l[x]=`N`;else if(S==`%`){var C=void 0;for(C=x+1;C<c&&l[C]==`%`;++C);for(var w=x&&l[x-1]==`!`||C<c&&l[C]==`1`?`1`:`N`,T=x;T<C;++T)l[T]=w;x=C-1}}for(var E=0,D=s;E<c;++E){var O=l[E];D==`L`&&O==`1`?l[E]=`L`:i.test(O)&&(D=O)}for(var k=0;k<c;++k)if(r.test(l[k])){var A=void 0;for(A=k+1;A<c&&r.test(l[A]);++A);for(var j=(k?l[k-1]:s)==`L`,M=j==((A<c?l[A]:s)==`L`)?j?`L`:`R`:s,N=k;N<A;++N)l[N]=M;k=A-1}for(var P=[],F,I=0;I<c;)if(a.test(l[I])){var ee=I;for(++I;I<c&&a.test(l[I]);++I);P.push(new BidiSpan(0,ee,I))}else{var L=I,R=P.length,z=+(t==`rtl`);for(++I;I<c&&l[I]!=`L`;++I);for(var B=L;B<I;)if(o.test(l[B])){L<B&&(P.splice(R,0,new BidiSpan(1,L,B)),R+=z);var te=B;for(++B;B<I&&o.test(l[B]);++B);P.splice(R,0,new BidiSpan(2,te,B)),R+=z,L=B}else ++B;L<I&&P.splice(R,0,new BidiSpan(1,L,I))}return t==`ltr`&&(P[0].level==1&&(F=e.match(/^\s+/))&&(P[0].from=F[0].length,P.unshift(new BidiSpan(0,0,F[0].length))),lst(P).level==1&&(F=e.match(/\s+$/))&&(lst(P).to-=F[0].length,P.push(new BidiSpan(0,c-F[0].length,c)))),t==`rtl`?P.reverse():P}})();function getOrder(e,t){var n=e.order;return n??=e.order=I(e.text,t),n}var ee=[],on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||ee).concat(n)}};function getHandlers(e,t){return e._handlers&&e._handlers[t]||ee}function off(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=indexOf(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function signal(e,t){var n=getHandlers(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function signalDOMEvent(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),signal(e,n||t.type,e,t),e_defaultPrevented(t)||t.codemirrorIgnore}function signalCursorActivity(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)indexOf(n,t[r])==-1&&n.push(t[r])}function hasHandler(e,t){return getHandlers(e,t).length>0}function eventMixin(e){e.prototype.on=function(e,t){on(this,e,t)},e.prototype.off=function(e,t){off(this,e,t)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),b&&e.ctrlKey&&t==1&&(t=3),t}var L=function(){if(o&&s<9)return!1;var e=elt(`div`);return`draggable`in e||`dragDrop`in e}(),R;function zeroWidthElement(e){if(R==null){var t=elt(`span`,`​`);removeChildrenAndAdd(e,elt(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(R=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=R?elt(`span`,`​`):elt(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var z;function hasBadBidiRects(e){if(z!=null)return z;var t=removeChildrenAndAdd(e,document.createTextNode(`AخA`)),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return removeChildren(e),!n||n.left==n.right?!1:z=r.right-n.right<3}var B=`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/codemirror`]={},e[`@hpcc-js/common`]))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},__toESM=(e,t,i)=>(i=e==null?{}:n(o(e)),__copyProps(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),c=`@hpcc-js/codemirror`,l=`3.8.0`,u=`3.26.0`,d=__commonJSMin(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),m=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),_=m&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=_||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=_||/Mac/.test(t),x=/\bCrOS\b/.test(e),S=/win/i.test(t),C=f&&e.match(/Version\/(\d*\.\d*)/);C&&=Number(C[1]),C&&C>=15&&(f=!1,c=!0);var w=b&&(l||f&&(C==null||C<12.11)),T=n||o&&s>=9;function classTest(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var rmClass=function(e,t){var n=e.className,r=classTest(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function removeChildren(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(e,t){return removeChildren(e).appendChild(t)}function elt(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function eltP(e,t,n,r){var i=elt(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var E=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function contains(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function activeElt(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function addClass(e,t){var n=e.className;classTest(t).test(n)||(e.className+=(n?` `:``)+t)}function joinClasses(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!classTest(n[r]).test(t)&&(t+=` `+n[r]);return t}var selectInput=function(e){e.select()};_?selectInput=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(selectInput=function(e){try{e.select()}catch{}});function doc(e){return e.display.wrapper.ownerDocument}function root(e){return rootNode(e.display.wrapper)}function rootNode(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function win(e){return doc(e).defaultView}function bind(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function copyObj(e,t,n){for(var r in t||={},e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function countColumn(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var Delayed=function(){this.id=null,this.f=null,this.time=0,this.handler=bind(this.onTimeout,this)};Delayed.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Delayed.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function indexOf(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var D=50,O={toString:function(){return`CodeMirror.Pass`}},k={scroll:!1},A={origin:`*mouse`},j={origin:`+move`};function findColumn(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var M=[``];function spaceStr(e){for(;M.length<=e;)M.push(lst(M)+` `);return M[e]}function lst(e){return e[e.length-1]}function map(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function insertSorted(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function nothing(){}function createObj(e,t){var n;return Object.create?n=Object.create(e):(nothing.prototype=e,n=new nothing),t&&copyObj(t,n),n}var N=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function isWordCharBasic(e){return/\w/.test(e)||e>`€`&&(e.toUpperCase()!=e.toLowerCase()||N.test(e))}function isWordChar(e,t){return t?t.source.indexOf(`\\w`)>-1&&isWordCharBasic(e)?!0:t.test(e):isWordCharBasic(e)}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var P=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function isExtendingChar(e){return e.charCodeAt(0)>=768&&P.test(e)}function skipExtendingChars(e,t,n){for(;(n<0?t>0:t<e.length)&&isExtendingChar(e.charAt(t));)t+=n;return t}function findFirst(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function iterateBidiSections(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var F=null;function getBidiPartAt(e,t,n){var r;F=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:F=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:F=i)}return r??F}var I=(function(){var e=`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`,t=`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`;function charType(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?`R`:1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?`r`:8192<=n&&n<=8203?`w`:n==8204?`b`:`L`}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,a=/[Lb1n]/,o=/[1n]/;function BidiSpan(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var s=t==`ltr`?`L`:`R`;if(e.length==0||t==`ltr`&&!n.test(e))return!1;for(var c=e.length,l=[],u=0;u<c;++u)l.push(charType(e.charCodeAt(u)));for(var d=0,f=s;d<c;++d){var m=l[d];m==`m`?l[d]=f:f=m}for(var h=0,g=s;h<c;++h){var _=l[h];_==`1`&&g==`r`?l[h]=`n`:i.test(_)&&(g=_,_==`r`&&(l[h]=`R`))}for(var v=1,y=l[0];v<c-1;++v){var b=l[v];b==`+`&&y==`1`&&l[v+1]==`1`?l[v]=`1`:b==`,`&&y==l[v+1]&&(y==`1`||y==`n`)&&(l[v]=y),y=b}for(var x=0;x<c;++x){var S=l[x];if(S==`,`)l[x]=`N`;else if(S==`%`){var C=void 0;for(C=x+1;C<c&&l[C]==`%`;++C);for(var w=x&&l[x-1]==`!`||C<c&&l[C]==`1`?`1`:`N`,T=x;T<C;++T)l[T]=w;x=C-1}}for(var E=0,D=s;E<c;++E){var O=l[E];D==`L`&&O==`1`?l[E]=`L`:i.test(O)&&(D=O)}for(var k=0;k<c;++k)if(r.test(l[k])){var A=void 0;for(A=k+1;A<c&&r.test(l[A]);++A);for(var j=(k?l[k-1]:s)==`L`,M=j==((A<c?l[A]:s)==`L`)?j?`L`:`R`:s,N=k;N<A;++N)l[N]=M;k=A-1}for(var P=[],F,I=0;I<c;)if(a.test(l[I])){var ee=I;for(++I;I<c&&a.test(l[I]);++I);P.push(new BidiSpan(0,ee,I))}else{var L=I,R=P.length,z=+(t==`rtl`);for(++I;I<c&&l[I]!=`L`;++I);for(var B=L;B<I;)if(o.test(l[B])){L<B&&(P.splice(R,0,new BidiSpan(1,L,B)),R+=z);var te=B;for(++B;B<I&&o.test(l[B]);++B);P.splice(R,0,new BidiSpan(2,te,B)),R+=z,L=B}else ++B;L<I&&P.splice(R,0,new BidiSpan(1,L,I))}return t==`ltr`&&(P[0].level==1&&(F=e.match(/^\s+/))&&(P[0].from=F[0].length,P.unshift(new BidiSpan(0,0,F[0].length))),lst(P).level==1&&(F=e.match(/\s+$/))&&(lst(P).to-=F[0].length,P.push(new BidiSpan(0,c-F[0].length,c)))),t==`rtl`?P.reverse():P}})();function getOrder(e,t){var n=e.order;return n??=e.order=I(e.text,t),n}var ee=[],on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||ee).concat(n)}};function getHandlers(e,t){return e._handlers&&e._handlers[t]||ee}function off(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=indexOf(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function signal(e,t){var n=getHandlers(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function signalDOMEvent(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),signal(e,n||t.type,e,t),e_defaultPrevented(t)||t.codemirrorIgnore}function signalCursorActivity(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)indexOf(n,t[r])==-1&&n.push(t[r])}function hasHandler(e,t){return getHandlers(e,t).length>0}function eventMixin(e){e.prototype.on=function(e,t){on(this,e,t)},e.prototype.off=function(e,t){off(this,e,t)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),b&&e.ctrlKey&&t==1&&(t=3),t}var L=function(){if(o&&s<9)return!1;var e=elt(`div`);return`draggable`in e||`dragDrop`in e}(),R;function zeroWidthElement(e){if(R==null){var t=elt(`span`,`​`);removeChildrenAndAdd(e,elt(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(R=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=R?elt(`span`,`​`):elt(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var z;function hasBadBidiRects(e){if(z!=null)return z;var t=removeChildrenAndAdd(e,document.createTextNode(`AخA`)),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return removeChildren(e),!n||n.left==n.right?!1:z=r.right-n.right<3}var B=`
2
2
 
3
3
  b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
4
4
  `,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==`\r`?i-1:i),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},te=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints(`StartToEnd`,t)!=0},ne=(function(){var e=elt(`div`);return`oncopy`in e?!0:(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),re=null;function hasBadZoomedRects(e){if(re!=null)return re;var t=removeChildrenAndAdd(e,elt(`span`,`x`)),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return re=Math.abs(n.left-r.left)>1}var ie={},V={};function defineMode(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ie[e]=t}function defineMIME(e,t){V[e]=t}function resolveMode(e){if(typeof e==`string`&&V.hasOwnProperty(e))e=V[e];else if(e&&typeof e.name==`string`&&V.hasOwnProperty(e.name)){var t=V[e.name];typeof t==`string`&&(t={name:t}),e=createObj(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return resolveMode(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return resolveMode(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function getMode(e,t){t=resolveMode(t);var n=ie[t.name];if(!n)return getMode(e,`text/plain`);var r=n(e,t);if(H.hasOwnProperty(t.name)){var i=H[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r[`_`+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var H={};function extendMode(e,t){copyObj(t,H.hasOwnProperty(e)?H[e]:H[e]={})}function copyState(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function innerMode(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function startState(e,t,n){return e.startState?e.startState(t,n):!0}var StringStream=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(e){var t=this.string.charAt(this.pos);if(typeof e==`string`?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},StringStream.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},StringStream.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},StringStream.prototype.backUp=function(e){this.pos-=e},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(e,t,n){if(typeof e==`string`){var cased=function(e){return n?e.toLowerCase():e};if(cased(this.string.substr(this.pos,e.length))==cased(e))return t!==!1&&(this.pos+=e.length),!0}else{var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},StringStream.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},StringStream.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function getLine(e,t){if(t-=e.first,t<0||t>=e.size)throw Error(`There is no line `+(t+e.first)+` in the document.`);for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function getBetween(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function getLines(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function updateLineHeight(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function lineNo(e){if(e.parent==null)return null;for(var t=e.parent,n=indexOf(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function lineAtHeight(e,t){var n=e.first;outer:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue outer}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function isLine(e,t){return t>=e.first&&t<e.first+e.size}function lineNumberFor(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Pos(e,t,n){if(n===void 0&&(n=null),!(this instanceof Pos))return new Pos(e,t,n);this.line=e,this.ch=t,this.sticky=n}function cmp(e,t){return e.line-t.line||e.ch-t.ch}function equalCursorPos(e,t){return e.sticky==t.sticky&&cmp(e,t)==0}function copyPos(e){return Pos(e.line,e.ch)}function maxPos(e,t){return cmp(e,t)<0?t:e}function minPos(e,t){return cmp(e,t)<0?e:t}function clipLine(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function clipPos(e,t){if(t.line<e.first)return Pos(e.first,0);var n=e.first+e.size-1;return t.line>n?Pos(n,getLine(e,n).text.length):clipToLen(t,getLine(e,t.line).text.length)}function clipToLen(e,t){var n=e.ch;return n==null||n>t?Pos(e.line,t):n<0?Pos(e.line,0):e}function clipPosArray(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=clipPos(e,t[r]);return n}var SavedContext=function(e,t){this.state=e,this.lookAhead=t},Context=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Context.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Context.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,``),size:this.baseTokens[this.baseTokenPos]-e}},Context.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Context.fromSaved=function(e,t,n){return t instanceof SavedContext?new Context(e,copyState(e.mode,t.state),n,t.lookAhead):new Context(e,copyState(e.mode,t),n)},Context.prototype.save=function(e){var t=e===!1?this.state:copyState(this.doc.mode,this.state);return this.maxLookAhead>0?new SavedContext(t,this.maxLookAhead):t};function highlightLine(e,t,n,r){var i=[e.state.modeGen],a={};runMode(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,loop=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,runMode(e,t.text,s.mode,n,function(e,t){for(var n=c;l<e;){var r=i[c];r>e&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;n<c;n+=2){var a=i[n+1];i[n+1]=(a?a+` `:``)+`overlay `+t}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)loop(s);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function getLineStyles(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=getContextBefore(e,lineNo(t)),i=t.text.length>e.options.maxHighlightLength&&copyState(e.doc.mode,r.state),a=highlightLine(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function getContextBefore(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Context(r,!0,t);var a=findStartLine(e,t,n),o=a>r.first&&getLine(r,a-1).stateAfter,s=o?Context.fromSaved(r,o,a):new Context(r,startState(r.mode),a);return r.iter(a,t,function(n){processLine(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function processLine(e,t,n,r){var i=e.doc.mode,a=new StringStream(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==``&&callBlankLine(i,n.state);!a.eol();)readToken(i,a,n.state),a.start=a.pos}function callBlankLine(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=innerMode(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function readToken(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=innerMode(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var Token=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function takeToken(e,t,n,r){var i=e.doc,a=i.mode,o;t=clipPos(i,t);var s=getLine(i,t.line),c=getContextBefore(e,t.line,n),l=new StringStream(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,o=readToken(a,l,c.state),r&&u.push(new Token(l,o,copyState(i.mode,c.state)));return r?u:new Token(l,o,c.state)}function extractLineClasses(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?`bgClass`:`textClass`;t[r]==null?t[r]=n[2]:RegExp(`(?:^|\\s)`+n[2]+`(?:$|\\s)`).test(t[r])||(t[r]+=` `+n[2])}return e}function runMode(e,t,n,r,i,a,o){var s=n.flattenSpans;s??=e.options.flattenSpans;var c=0,l=null,u=new StringStream(t,e.options.tabSize,r),d,f=e.options.addModeClass&&[null];for(t==``&&extractLineClasses(callBlankLine(n,r.state),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&processLine(e,t,r,u.pos),u.pos=t.length,d=null):d=extractLineClasses(readToken(n,u,r.state,f),a),f){var m=f[0].name;m&&(d=`m-`+(d?m+` `+d:m))}if(!s||l!=d){for(;c<u.start;)c=Math.min(u.start,c+5e3),i(c,l);l=d}u.start=u.pos}for(;c<u.pos;){var h=Math.min(u.pos,c+5e3);i(h,l),c=h}}function findStartLine(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var c=getLine(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof SavedContext?l.lookAhead:0)<=a.modeFrontier))return s;var u=countColumn(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function retreatFrontier(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=getLine(e,r).stateAfter;if(i&&(!(i instanceof SavedContext)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var ae=!1,U=!1;function seeReadOnlySpans(){ae=!0}function seeCollapsedSpans(){U=!0}function MarkedSpan(e,t,n){this.marker=e,this.from=t,this.to=n}function getMarkedSpanFor(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function removeMarkedSpan(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||=[]).push(e[r]);return n}function addMarkedSpan(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||=new WeakSet);r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function markedSpansBefore(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&o.type==`bookmark`&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||=[]).push(new MarkedSpan(o,a.from,s?null:a.to))}}return r}function markedSpansAfter(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.to==null||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||=[]).push(new MarkedSpan(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function stretchSpansOverChange(e,t){if(t.full)return null;var n=isLine(e,t.from.line)&&getLine(e,t.from.line).markedSpans,r=isLine(e,t.to.line)&&getLine(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=cmp(t.from,t.to)==0,s=markedSpansBefore(n,i,o),c=markedSpansAfter(r,a,o),l=t.text.length==1,u=lst(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(f.to==null){var m=getMarkedSpanFor(c,f.marker);m?l&&(f.to=m.to==null?null:m.to+u):f.to=i}}if(c)for(var h=0;h<c.length;++h){var g=c[h];g.to!=null&&(g.to+=u),g.from==null?getMarkedSpanFor(s,g.marker)||(g.from=u,l&&(s||=[]).push(g)):(g.from+=u,l&&(s||=[]).push(g))}s&&=clearEmptySpans(s),c&&c!=s&&(c=clearEmptySpans(c));var _=[s];if(!l){var v=t.text.length-2,y;if(v>0&&s)for(var b=0;b<s.length;++b)s[b].to??(y||=[]).push(new MarkedSpan(s[b].marker,null,null));for(var x=0;x<v;++x)_.push(y);_.push(c)}return _}function clearEmptySpans(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function removeReadOnlyRanges(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||indexOf(r,n)==-1)&&(r||=[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),c=0;c<i.length;++c){var l=i[c];if(!(cmp(l.to,s.from)<0||cmp(l.from,s.to)>0)){var u=[c,1],d=cmp(l.from,s.from),f=cmp(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function detachMarkedSpans(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function attachMarkedSpans(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function extraLeft(e){return e.inclusiveLeft?-1:0}function extraRight(e){return+!!e.inclusiveRight}function compareCollapsedMarkers(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=cmp(r.from,i.from)||extraLeft(e)-extraLeft(t);return a?-a:cmp(r.to,i.to)||extraRight(e)-extraRight(t)||t.id-e.id}function collapsedSpanAtSide(e,t){var n=U&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||compareCollapsedMarkers(r,i.marker)<0)&&(r=i.marker);return r}function collapsedSpanAtStart(e){return collapsedSpanAtSide(e,!0)}function collapsedSpanAtEnd(e){return collapsedSpanAtSide(e,!1)}function collapsedSpanAround(e,t){var n=U&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||compareCollapsedMarkers(r,a.marker)<0)&&(r=a.marker)}return r}function conflictingCollapsedRange(e,t,n,r,i){var a=getLine(e,t),o=U&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var c=o[s];if(c.marker.collapsed){var l=c.marker.find(0),u=cmp(l.from,n)||extraLeft(c.marker)-extraLeft(i),d=cmp(l.to,r)||extraRight(c.marker)-extraRight(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?cmp(l.to,n)>=0:cmp(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?cmp(l.from,r)<=0:cmp(l.from,r)<0)))return!0}}}function visualLine(e){for(var t;t=collapsedSpanAtStart(e);)e=t.find(-1,!0).line;return e}function visualLineEnd(e){for(var t;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line;return e}function visualLineContinued(e){for(var t,n;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function visualLineNo(e,t){var n=getLine(e,t),r=visualLine(n);return n==r?t:lineNo(r)}function visualLineEndNo(e,t){if(t>e.lastLine())return t;var n=getLine(e,t),r;if(!lineIsHidden(e,n))return t;for(;r=collapsedSpanAtEnd(n);)n=r.find(1,!0).line;return lineNo(n)+1}function lineIsHidden(e,t){var n=U&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed&&(r.from==null||!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&lineIsHiddenInner(e,t,r)))return!0}}function lineIsHiddenInner(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return lineIsHiddenInner(e,r.line,getMarkedSpanFor(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&lineIsHiddenInner(e,t,i))return!0}function heightAtLine(e){e=visualLine(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function lineLength(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=collapsedSpanAtStart(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=collapsedSpanAtEnd(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function findMaxLine(e){var t=e.display,n=e.doc;t.maxLine=getLine(n,n.first),t.maxLineLength=lineLength(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=lineLength(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Line=function(e,t,n){this.text=e,attachMarkedSpans(this,t),this.height=n?n(this):1};Line.prototype.lineNo=function(){return lineNo(this)},eventMixin(Line);function updateLine(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),detachMarkedSpans(e),attachMarkedSpans(e,n);var i=r?r(e):1;i!=e.height&&updateLineHeight(e,i)}function cleanUpLine(e){e.parent=null,detachMarkedSpans(e)}var oe={},se={};function interpretTokenStyle(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?se:oe;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function buildLineContent(e,t){var n=eltP(`span`,null,null,c?`padding-right: .1px`:null),r={pre:eltP(`pre`,[n],`CodeMirror-line`),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(`lineWrapping`)};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=buildToken,hasBadBidiRects(e.display.measure)&&(o=getOrder(a,e.doc.direction))&&(r.addToken=buildTokenBadBidi(r.addToken,o)),r.map=[],insertLineContent(a,r,getLineStyles(e,a,t!=e.display.externalMeasured&&lineNo(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=joinClasses(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=joinClasses(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(zeroWidthElement(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(`.cm-tab`))&&(r.content.className=`cm-tab-wrap-hack`)}return signal(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=joinClasses(r.pre.className,r.textClass||``)),r}function defaultSpecialCharPlaceholder(e){var t=elt(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function buildToken(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?splitSpaces(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var m=0;;){u.lastIndex=m;var h=u.exec(t),g=h?h.index-m:t.length-m;if(g){var _=document.createTextNode(l.slice(m,m+g));o&&s<9?f.appendChild(elt(`span`,[_])):f.appendChild(_),e.map.push(e.pos,e.pos+g,_),e.col+=g,e.pos+=g}if(!h)break;m+=g+1;var v=void 0;if(h[0]==` `){var y=e.cm.options.tabSize,b=y-e.col%y;v=f.appendChild(elt(`span`,spaceStr(b),`cm-tab`)),v.setAttribute(`role`,`presentation`),v.setAttribute(`cm-text`,` `),e.col+=b}else h[0]==`\r`||h[0]==`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/codemirror",
3
- "version": "3.7.9",
3
+ "version": "3.8.0",
4
4
  "description": "hpcc-js - Viz Code Mirror",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -25,7 +25,7 @@
25
25
  "bundle": "vite build",
26
26
  "bundle-watch": "vite build --watch",
27
27
  "bundle-serve": "vite --port 5501",
28
- "gen-types": "tsc --project tsconfig.json",
28
+ "gen-types": "tsgo --project tsconfig.json",
29
29
  "gen-types-watch": "npm run gen-types -- --watch",
30
30
  "build": "run-p gen-types bundle",
31
31
  "watch": "run-p gen-types-watch bundle-watch",
@@ -39,10 +39,10 @@
39
39
  "update-major": "npx --yes npm-check-updates -u"
40
40
  },
41
41
  "dependencies": {
42
- "@hpcc-js/common": "^3.7.10"
42
+ "@hpcc-js/common": "^3.8.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@hpcc-js/esbuild-plugins": "^1.8.11",
45
+ "@hpcc-js/esbuild-plugins": "^1.9.0",
46
46
  "codemirror": "5.65.21"
47
47
  },
48
48
  "repository": {
@@ -56,5 +56,5 @@
56
56
  "url": "https://github.com/hpcc-systems/Visualization/issues"
57
57
  },
58
58
  "homepage": "https://github.com/hpcc-systems/Visualization",
59
- "gitHead": "1c0e8862859769465f70f384183f1399191d76e6"
59
+ "gitHead": "b762adfab7d03d06ea8cfab59059456100ea757c"
60
60
  }