@uiw/react-codemirror 4.4.3 → 4.5.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.
@@ -1,2 +0,0 @@
1
- /*! For license information please see codemirror.min.js.LICENSE.txt */
2
- !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react"),require("@codemirror/basic-setup"),require("@codemirror/state"),require("@codemirror/theme-one-dark"),require("@codemirror/view")):"function"===typeof define&&define.amd?define(["react",,,,],t):"object"===typeof exports?exports.codemirror=t(require("react"),require("@codemirror/basic-setup"),require("@codemirror/state"),require("@codemirror/theme-one-dark"),require("@codemirror/view")):e.codemirror=t(e.React,e.CM["@codemirror/basic-setup"],e.CM["@codemirror/state"],e.CM["@codemirror/theme-one-dark"],e.CM["@codemirror/view"])}(self,(function(e,t,n,r,i){return function(){"use strict";var o={927:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,u=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(a){u=!0,i=a}finally{try{s||null==n.return||n.return()}finally{if(u)throw i}}return o}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(t,{U:function(){return We}});var s=n(787),u=n(573),a=n(242);function h(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,s=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw s}}}}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function l(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}function c(){return c="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=l(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},c.apply(this,arguments)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function v(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e,t){if(t&&("object"===p(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t&&k(e.prototype,t),n&&k(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}for(var x="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((function(e){return e?parseInt(e,36):1})),w=1;w<x.length;w++)x[w]+=x[w-1];function S(e){for(var t=1;t<x.length;t+=2)if(x[t]>e)return x[t-1]<=e;return!1}function C(e){return e>=127462&&e<=127487}function _(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(n?O:A)(e,t,r)}function O(e,t,n){if(t==e.length)return t;t&&j(e.charCodeAt(t))&&P(e.charCodeAt(t-1))&&t--;var r=E(e,t);for(t+=B(r);t<e.length;){var i=E(e,t);if(8205==r||8205==i||n&&S(i))t+=B(i),r=i;else{if(!C(i))break;for(var o=0,s=t-2;s>=0&&C(E(e,s));)o++,s-=2;if(o%2==0)break;t+=2}}return t}function A(e,t,n){for(;t>0;){var r=O(e,t-2,n);if(r<t)return r;t--}return 0}function j(e){return e>=56320&&e<57344}function P(e){return e>=55296&&e<56320}function E(e,t){var n=e.charCodeAt(t);if(!P(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return j(r)?r-56320+(n-55296<<10)+65536:n}function B(e){return e<65536?1:2}function N(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i<n;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=_(e,i));return r}var T=function(){function e(){m(this,e)}return b(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),M.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n,0),M.from(n,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new q(this),i=new q(e),o=t,s=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(s+=r.value.length,r.done||s>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new q(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new L(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new U(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new I(t):M.from(I.split(t,[])):e.empty}}]),e}(),I=function(e){v(n,e);var t=y(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R(e);return m(this,n),(r=t.call(this)).text=e,r.length=i,r}return b(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new D(r,s,n,o);r=s+1,n++}}},{key:"decompose",value:function(e,t,r,i){var o=e<=0&&t>=this.length?this:new n(z(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var s=r.pop(),u=W(o.text,s.text.slice(),0,o.length);if(u.length<=32)r.push(new n(u,s.length+o.length));else{var a=u.length>>1;r.push(new n(u.slice(0,a)),new n(u.slice(a)))}}else r.push(o)}},{key:"replace",value:function(e,t,r){if(!(r instanceof n))return c(f(n.prototype),"replace",this).call(this,e,t,r);var i=W(this.text,W(r.text,z(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new n(i,o):M.from(n.split(i,[]),o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=t&&o<this.text.length;o++){var s=this.text[o],u=i+s.length;i>e&&o&&(r+=n),e<u&&t>i&&(r+=s.slice(Math.max(0,e-i),t-i)),i=u+1}return r}},{key:"flatten",value:function(e){var t,n=h(this.text);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(i){n.e(i)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,t){var r,i=[],o=-1,s=h(e);try{for(s.s();!(r=s.n()).done;){var u=r.value;i.push(u),o+=u.length+1,32==i.length&&(t.push(new n(i,o)),i=[],o=-1)}}catch(a){s.e(a)}finally{s.f()}return o>-1&&t.push(new n(i,o)),t}}]),n}(T),M=function(e){v(n,e);var t=y(n);function n(e,r){var i;m(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=0;var o,s=h(e);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.lines+=u.lines}}catch(a){s.e(a)}finally{s.f()}return i}return b(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],s=r+o.length,u=n+o.lines-1;if((t?u:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=u+1}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i<this.children.length;i++){var s=this.children[i],u=o+s.length;if(e<=u&&t>=o){var a=r&((o<=e?1:0)|(u>=t?2:0));o>=e&&u<=t&&!a?n.push(s):s.decompose(e-o,t-o,n,a)}o=u+1}}},{key:"replace",value:function(e,t,r){if(r.lines<this.lines)for(var i=0,o=0;i<this.children.length;i++){var s=this.children[i],u=o+s.length;if(e>=o&&t<=u){var a=s.replace(e-o,t-o,r),h=this.lines-s.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){var l=this.children.slice();return l[i]=a,new n(l,this.length-(t-e)+r.length)}return c(f(n.prototype),"replace",this).call(this,o,u,a)}o=u+1}return c(f(n.prototype),"replace",this).call(this,e,t,r)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<this.children.length&&o<=t;i++){var s=this.children[i],u=o+s.length;o>e&&i&&(r+=n),e<u&&t>o&&(r+=s.sliceString(e-o,t-o,n)),o=u+1}return r}},{key:"flatten",value:function(e){var t,n=h(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"scanIdentical",value:function(e,t){if(!(e instanceof n))return 0;for(var r=0,i=o(t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],4),s=i[0],u=i[1],a=i[2],h=i[3];;s+=t,u+=t){if(s==a||u==h)return r;var f=this.children[s],l=e.children[u];if(f!=l)return r+f.scanIdentical(l,t);r+=f.length+1}}}],[{key:"from",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),i=0,o=h(e);try{for(o.s();!(t=o.n()).done;){var s=t.value;i+=s.lines}}catch(C){o.e(C)}finally{o.f()}if(i<32){var u,a=[],f=h(e);try{for(f.s();!(u=f.n()).done;){var l=u.value;l.flatten(a)}}catch(C){f.e(C)}finally{f.f()}return new I(a,r)}var c=Math.max(32,i>>5),d=c<<1,v=c>>1,p=[],g=0,y=-1,m=[];function k(e){var t;if(e.lines>d&&e instanceof n){var r,i=h(e.children);try{for(i.s();!(r=i.n()).done;){k(r.value)}}catch(C){i.e(C)}finally{i.f()}}else e.lines>v&&(g>v||!g)?(b(),p.push(e)):e instanceof I&&g&&(t=m[m.length-1])instanceof I&&e.lines+t.lines<=32?(g+=e.lines,y+=e.length+1,m[m.length-1]=new I(t.text.concat(e.text),t.length+1+e.length)):(g+e.lines>c&&b(),g+=e.lines,y+=e.length+1,m.push(e))}function b(){0!=g&&(p.push(1==m.length?m[0]:n.from(m,y)),y=-1,g=m.length=0)}var x,w=h(e);try{for(w.s();!(x=w.n()).done;){var S=x.value;k(S)}}catch(C){w.e(C)}finally{w.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(T);function R(e){var t,n=-1,r=h(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function W(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,s=!0;o<e.length&&i<=r;o++){var u=e[o],a=i+u.length;a>=n&&(a>r&&(u=u.slice(0,r-i)),i<n&&(u=u.slice(n-i)),s?(t[t.length-1]+=u,s=!1):t.push(u)),i=a+1}return t}function z(e,t,n){return W(e,[""],t,n)}T.empty=new I([""],0);var q=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;m(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof I?t.text.length:t.children.length)<<1]}return b(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,s=r instanceof I?r.text.length:r.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof I){var u=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,u.length>Math.max(0,e))return this.value=0==e?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{var a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof I?a.text.length:a.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),L=function(){function e(t,n,r){m(this,e),this.value="",this.done=!1,this.cursor=new q(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return b(e,[{key:"nextInner",value:function(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),U=function(){function e(t){m(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return b(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(T.prototype[Symbol.iterator]=function(){return this.iter()},q.prototype[Symbol.iterator]=L.prototype[Symbol.iterator]=U.prototype[Symbol.iterator]=function(){return this});var D=function(){function e(t,n,r,i){m(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return b(e,[{key:"length",get:function(){return this.to-this.from}}]),e}(),H=n(105),V=0,F=b((function e(t,n){m(this,e),this.from=t,this.to=n})),J=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.id=V++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return b(e,[{key:"add",value:function(e){var t=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=$.match(e)),function(n){var r=e(n);return void 0===r?null:[t,r]}}}]),e}();J.closedBy=new J({deserialize:function(e){return e.split(" ")}}),J.openedBy=new J({deserialize:function(e){return e.split(" ")}}),J.group=new J({deserialize:function(e){return e.split(" ")}}),J.contextHash=new J({perNode:!0}),J.lookAhead=new J({perNode:!0}),J.mounted=new J({perNode:!0});var Z=Object.create(null),$=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;m(this,e),this.name=t,this.props=n,this.id=r,this.flags=i}return b(e,[{key:"prop",value:function(e){return this.props[e.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(e){if("string"==typeof e){if(this.name==e)return!0;var t=this.prop(J.group);return!!t&&t.indexOf(e)>-1}return this.id==e}}],[{key:"define",value:function(t){var n=t.props&&t.props.length?Object.create(null):Z,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new e(t.name||"",n,t.id,r);if(t.props){var o,s=h(t.props);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(Array.isArray(u)||(u=u(i)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[u[0].id]=u[1]}}}catch(a){s.e(a)}finally{s.f()}}return i}},{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=h(n.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(s){i.e(s)}finally{i.f()}}return function(e){for(var n=e.prop(J.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}}]),e}();$.none=new $("",Object.create(null),0,8);var Y=new WeakMap,G=new WeakMap,K=function(){function e(t,n,r,i,s){if(m(this,e),this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);var u,a=h(s);try{for(a.s();!(u=a.n()).done;){var f=o(u.value,2),l=f[0],c=f[1];this.props["number"==typeof l?l:l.id]=c}}catch(d){a.e(d)}finally{a.f()}}}return b(e,[{key:"toString",value:function(){var e=this.prop(J.mounted);if(e&&!e.overlay)return e.tree.toString();var t,n="",r=h(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value.toString();i&&(n&&(n+=","),n+=i)}}catch(o){r.e(o)}finally{r.f()}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}},{key:"cursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null!=e&&Y.get(this)||this.topNode,r=new ue(n);return null!=e&&(r.moveTo(e,t),Y.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new ue(this.topNode,1)}},{key:"topNode",get:function(){return new re(this,0,0,null)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=ne(Y.get(this)||this.topNode,e,t,!1);return Y.set(this,n),n}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=ne(G.get(this)||this.topNode,e,t,!0);return G.set(this,n),n}},{key:"iterate",value:function(e){for(var t=e.enter,n=e.leave,r=e.from,i=void 0===r?0:r,o=e.to,s=void 0===o?this.length:o,u=this.cursor(),a=function(){return u.node};;){var h=!1;if(u.from<=s&&u.to>=i&&(u.type.isAnonymous||!1!==t(u.type,u.from,u.to,a))){if(u.firstChild())continue;u.type.isAnonymous||(h=!0)}for(;h&&n&&n(u.type,u.from,u.to,a),h=u.type.isAnonymous,!u.nextSibling();){if(!u.parent())return;h=!0}}}},{key:"prop",value:function(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}},{key:"propValues",get:function(){var e=[];if(this.props)for(var t in this.props)e.push([+t,this.props[t]]);return e}},{key:"balance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:ce($.none,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new e(t.type,n,r,i,t.propValues)}),n.makeTree||function(t,n,r){return new e($.none,t,n,r)})}}],[{key:"build",value:function(e){return he(e)}}]),e}();K.empty=new K($.none,[],[],0);var Q=function(){function e(t,n){m(this,e),this.buffer=t,this.index=n}return b(e,[{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}}]),e}(),X=function(){function e(t,n,r){m(this,e),this.buffer=t,this.length=n,this.set=r}return b(e,[{key:"type",get:function(){return $.none}},{key:"toString",value:function(){for(var e=[],t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}},{key:"childString",value:function(e){var t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;for(var o=[];e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}},{key:"findChild",value:function(e,t,n,r,i){for(var o=this.buffer,s=-1,u=e;u!=t&&!(ee(i,r,o[u+1],o[u+2])&&(s=u,n>0));u=o[u+3]);return s}},{key:"slice",value:function(t,n,r,i){for(var o=this.buffer,s=new Uint16Array(n-t),u=t,a=0;u<n;)s[a++]=o[u++],s[a++]=o[u++]-r,s[a++]=o[u++]-r,s[a++]=o[u++]-t;return new e(s,i-r,this.set)}}]),e}();function ee(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function te(e,t){for(var n=e.childBefore(t);n;){var r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(e=n,n=r.prevSibling):n=r}return e}function ne(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){var o=!r&&e instanceof re&&e.index<0?null:e.parent;if(!o)return e;e=o}if(r)for(var s=e,u=s.parent;u;u=(s=u).parent)s instanceof re&&s.index<0&&(null===(i=u.enter(t,n,!0))||void 0===i?void 0:i.from)!=s.from&&(e=u);for(;;){var a=e.enter(t,n,r);if(!a)return e;e=a}}var re=function(){function e(t,n,r,i){m(this,e),this.node=t,this._from=n,this.index=r,this._parent=i}return b(e,[{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._from+this.node.length}},{key:"nextChild",value:function(t,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=this;;){for(var u=s.node,a=u.children,h=u.positions,f=n>0?a.length:-1;t!=f;t+=n){var l=a[t],c=h[t]+s._from;if(ee(i,r,c,c+l.length))if(l instanceof X){if(2&o)continue;var d=l.findChild(0,l.buffer.length,n,r-c,i);if(d>-1)return new se(new oe(s,l,t,c),null,d)}else if(1&o||!l.type.isAnonymous||ae(l)){var v=void 0;if(!(1&o)&&l.props&&(v=l.prop(J.mounted))&&!v.overlay)return new e(v.tree,c,t,s);var p=new e(l,c,t,s);return 1&o||!p.type.isAnonymous?p:p.nextChild(n<0?l.children.length-1:0,n,r,i)}}if(1&o||!s.type.isAnonymous)return null;if(t=s.index>=0?s.index+n:n<0?-1:s._parent.node.children.length,!(s=s._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,0,4)}},{key:"childAfter",value:function(e){return this.nextChild(0,1,e,2)}},{key:"childBefore",value:function(e){return this.nextChild(this.node.children.length-1,-1,e,-2)}},{key:"enter",value:function(t,n){var r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(i&&(r=this.node.prop(J.mounted))&&r.overlay){var s,u=t-this.from,a=h(r.overlay);try{for(a.s();!(s=a.n()).done;){var f=s.value,l=f.from,c=f.to;if((n>0?l<=u:l<u)&&(n<0?c>=u:c>u))return new e(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(d){a.e(d)}finally{a.f()}}return this.nextChild(0,1,t,n,o?0:2)}},{key:"nextSignificantParent",value:function(){for(var e=this;e.type.isAnonymous&&e._parent;)e=e._parent;return e}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"cursor",get:function(){return new ue(this)}},{key:"tree",get:function(){return this.node}},{key:"toTree",value:function(){return this.node}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ne(this,e,t,!1)}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ne(this,e,t,!0)}},{key:"enterUnfinishedNodesBefore",value:function(e){return te(this,e)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ie(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return ie(this,e,t,n)}},{key:"toString",value:function(){return this.node.toString()}}]),e}();function ie(e,t,n,r){var i=e.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var oe=b((function e(t,n,r,i){m(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i})),se=function(){function e(t,n,r){m(this,e),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}return b(e,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(t,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new e(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(e){return this.child(1,e,2)}},{key:"childBefore",value:function(e){return this.child(-1,e,-2)}},{key:"enter",value:function(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!i)return null;var o=this.context.buffer,s=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new e(this.context,this,s)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}},{key:"nextSibling",get:function(){var t=this.context.buffer,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var t=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}},{key:"cursor",get:function(){return new ue(this)}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var e=[],t=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1],s=n.buffer[this.index+2];e.push(n.slice(r,i,o,s)),t.push(0)}return new K(this.type,e,t,this.to-this.from)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ne(this,e,t,!1)}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ne(this,e,t,!0)}},{key:"enterUnfinishedNodesBefore",value:function(e){return te(this,e)}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ie(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return ie(this,e,t,n)}}]),e}(),ue=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(m(this,e),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof re)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}return b(e,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}},{key:"yieldBuf",value:function(e,t){this.index=e;var n=this.buffer,r=n.start,i=n.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}},{key:"yield",value:function(e){return!!e&&(e instanceof re?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree.node.children.length-1:0,e,t,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(e){return this.enterChild(1,e,2)}},{key:"childBefore",value:function(e){return this.enterChild(-1,e,-2)}},{key:"enter",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.buffer?!!r&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n&&!(1&this.mode),r))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(1&this.mode?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var e=1&this.mode?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}},{key:"sibling",value:function(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));var t=this.buffer.buffer,n=this.stack.length-1;if(e<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{var i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(e){var t,n,r=this.buffer;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(var i=0;i<this.index;i++)if(r.buffer.buffer[i+3]<this.index)return!1;t=r.index,n=r.parent}else{var o=this._tree;t=o.index,n=o._parent}for(;n;t=(s=n).index,n=s._parent,s){var s;if(t>-1)for(var u=t+e,a=e<0?-1:n.node.children.length;u!=a;u+=e){var h=n.node.children[u];if(1&this.mode||h instanceof X||!h.type.isAnonymous||ae(h))return!1}}return!0}},{key:"move",value:function(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}},{key:"next",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,e)}},{key:"prev",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,e)}},{key:"moveTo",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}},{key:"node",get:function(){if(!this.buffer)return this._tree;var e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(var r=this.index,i=this.stack.length;i>=0;){for(var o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(var s=n;s<this.stack.length;s++)t=new se(this.buffer,t,this.stack[s]);return this.bufferNode=new se(this.buffer,t,this.index)}},{key:"tree",get:function(){return this.buffer?null:this._tree.node}}]),e}();function ae(e){return e.children.some((function(e){return e instanceof X||!e.type.isAnonymous||ae(e)}))}function he(e){var t,n=e.buffer,r=e.nodeSet,i=e.maxBufferLength,o=void 0===i?1024:i,s=e.reused,u=void 0===s?[]:s,a=e.minRepeatType,h=void 0===a?r.types.length:a,f=Array.isArray(n)?new Q(n,n.length):n,l=r.types,c=0,d=0;function v(e,t,n,i,s){for(var a=f.id,m=f.start,k=f.end,b=f.size,x=d;b<0;){if(f.next(),-1==b){var w=u[a];return n.push(w),void i.push(m-e)}if(-3==b)return void(c=a);if(-4==b)return void(d=a);throw new RangeError("Unrecognized record size: ".concat(b))}var S,C,_=l[a],O=m-e;if(k-m<=o&&(C=function(e,t){var n=f.fork(),r=0,i=0,s=0,u=n.end-o,a={size:0,start:0,skip:0};e:for(var l=n.pos-e;n.pos>l;){var c=n.size;if(n.id==t&&c>=0)a.size=r,a.start=i,a.skip=s,s+=4,r+=4,n.next();else{var d=n.pos-c;if(c<0||d<l||n.start<u)break;var v=n.id>=h?4:0,p=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3!=n.size)break e;v+=4}else n.id>=h&&(v+=4);n.next()}i=p,r+=c,s+=v}}(t<0||r==e)&&(a.size=r,a.start=i,a.skip=s);return a.size>4?a:void 0}(f.pos-t,s))){for(var A=new Uint16Array(C.size-C.skip),j=f.pos-C.size,P=A.length;f.pos>j;)P=y(C.start,A,P);S=new X(A,k-C.start,r),O=C.start-e}else{var E=f.pos-b;f.next();for(var B=[],N=[],T=a>=h?a:-1,I=0,M=k;f.pos>E;)T>=0&&f.id==T&&f.size>=0?(f.end<=M-o&&(p(B,N,m,I,f.end,M,T,x),I=B.length,M=f.end),f.next()):v(m,E,B,N,T);if(T>=0&&I>0&&I<B.length&&p(B,N,m,I,m,M,T,x),B.reverse(),N.reverse(),T>-1&&I>0){var R=function(e){return function(t,n,r){var i,o,s=0,u=t.length-1;if(u>=0&&(i=t[u])instanceof K){if(!u&&i.type==e&&i.length==r)return i;(o=i.prop(J.lookAhead))&&(s=n[u]+i.length+o)}return g(e,t,n,r,s)}}(_);S=ce(_,B,N,0,B.length,0,k-m,R,R)}else S=g(_,B,N,k-m,x-k)}n.push(S),i.push(O)}function p(e,t,n,i,o,s,u,a){for(var h=[],f=[];e.length>i;)h.push(e.pop()),f.push(t.pop()+n-o);e.push(g(r.types[u],h,f,s-o,a-s)),t.push(o-n)}function g(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;if(c){var s=[J.contextHash,c];o=o?[s].concat(o):[s]}if(i>25){var u=[J.lookAhead,i];o=o?[u].concat(o):[u]}return new K(e,t,n,r,o)}function y(e,t,n){var r=f.id,i=f.start,o=f.end,s=f.size;if(f.next(),s>=0&&r<h){var u=n;if(s>4)for(var a=f.pos-(s-4);f.pos>a;)n=y(e,t,n);t[--n]=u,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==s?c=r:-4==s&&(d=r);return n}for(var m=[],k=[];f.pos>0;)v(e.start||0,e.bufferStart||0,m,k,-1);var b=null!==(t=e.length)&&void 0!==t?t:m.length?k[0]+m[0].length:0;return new K(l[e.topID],m.reverse(),k.reverse(),b)}var fe=new WeakMap;function le(e,t){if(!e.isAnonymous||t instanceof X||t.type!=e)return 1;var n=fe.get(t);if(null==n){n=1;var r,i=h(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.type!=e||!(o instanceof K)){n=1;break}n+=le(e,o)}}catch(s){i.e(s)}finally{i.f()}fe.set(t,n)}return n}function ce(e,t,n,r,i,o,s,u,a){for(var h=0,f=r;f<i;f++)h+=le(e,t[f]);var l=Math.ceil(1.5*h/8),c=[],d=[];return function t(n,r,i,s,u){for(var h=i;h<s;){var f=h,v=r[h],p=le(e,n[h]);for(h++;h<s;h++){var g=le(e,n[h]);if(p+g>=l)break;p+=g}if(h==f+1){if(p>l){var y=n[f];t(y.children,y.positions,0,y.children.length,r[f]+u);continue}c.push(n[f])}else{var m=r[h-1]+n[h-1].length-v;c.push(ce(e,n,r,f,h,v,m,null,a))}d.push(v+u-o)}}(t,n,r,i,0),(u||a)(c,d,s)}var de=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];m(this,e),this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}return b(e,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=[new e(0,t.length,t,0,!1,i)],s=h(r);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.to>t.length&&o.push(u)}}catch(a){s.e(a)}finally{s.f()}return o}},{key:"applyChanges",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return t;for(var i=[],o=1,s=t.length?t[0]:null,u=0,a=0,h=0;;u++){var f=u<n.length?n[u]:null,l=f?f.fromA:1e9;if(l-a>=r)for(;s&&s.from<l;){var c=s;if(a>=c.from||l<=c.to||h){var d=Math.max(c.from,a)-h,v=Math.min(c.to,l)-h;c=d>=v?null:new e(d,v,c.tree,c.offset+h,u>0,!!f)}if(c&&i.push(c),s.to>l)break;s=o<t.length?t[o++]:null}if(!f)break;a=f.toA,h=f.toA-f.toB}return i}}]),e}(),ve=function(){function e(){m(this,e)}return b(e,[{key:"startParse",value:function(e,t,n){return"string"==typeof e&&(e=new pe(e)),n=n?n.length?n.map((function(e){return new F(e.from,e.to)})):[new F(0,0)]:[new F(0,e.length)],this.createParse(e,t||[],n)}},{key:"parse",value:function(e,t,n){for(var r=this.startParse(e,t,n);;){var i=r.advance();if(i)return i}}}]),e}(),pe=function(){function e(t){m(this,e),this.string=t}return b(e,[{key:"length",get:function(){return this.string.length}},{key:"chunk",value:function(e){return this.string.slice(e)}},{key:"lineChunks",get:function(){return!1}},{key:"read",value:function(e,t){return this.string.slice(e,t)}}]),e}();new J({perNode:!0});var ge=new J;var ye=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];m(this,e),this.data=t,this.topNode=r,a.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(a.EditorState.prototype,"tree",{get:function(){return ke(this)}}),this.parser=n,this.extension=[Ae.of(this),a.EditorState.languageData.of((function(e,t,n){return e.facet(me(e,t,n))}))].concat(i)}return b(e,[{key:"isActiveAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return me(e,t,n)==this.data}},{key:"findRegions",value:function(e){var t=this,n=e.facet(Ae);if((null===n||void 0===n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return function e(n,i){if(n.prop(ge)!=t.data){var o=n.prop(J.mounted);if(o){if(o.tree.prop(ge)==t.data){if(o.overlay){var s,u=h(o.overlay);try{for(u.s();!(s=u.n()).done;){var a=s.value;r.push({from:a.from+i,to:a.to+i})}}catch(d){u.e(d)}finally{u.f()}}else r.push({from:i,to:i+n.length});return}if(o.overlay){var f=r.length;if(e(o.tree,o.overlay[0].from+i),r.length>f)return}}for(var l=0;l<n.children.length;l++){var c=n.children[l];c instanceof K&&e(c,n.positions[l]+i)}}else r.push({from:i,to:i+n.length})}(ke(e),0),r}},{key:"allowsNesting",get:function(){return!0}}]),e}();function me(e,t,n){var r=e.facet(Ae);if(!r)return null;var i=r.data;if(r.allowsNesting)for(var o=ke(e).topNode;o;o=o.enter(t,n,!0,!1))i=o.type.prop(ge)||i;return i}ye.setState=a.StateEffect.define();function ke(e){var t=e.field(ye.state,!1);return t?t.tree:K.empty}var be=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;m(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return b(e,[{key:"syncTo",value:function(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(e){return this.syncTo(e),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(e,t){var n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}]),e}(),xe=null,we=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,u=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;m(this,e),this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=u,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}return b(e,[{key:"startParse",value:function(){return this.parser.startParse(new be(this.state.doc),this.fragments)}},{key:"work",value:function(e,t){var n=this;return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=K.empty&&this.isDone(null!==t&&void 0!==t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((function(){var r,i=Date.now()+e;for(n.parse||(n.parse=n.startParse()),null!=t&&(null==n.parse.stoppedAt||n.parse.stoppedAt>t)&&t<n.state.doc.length&&n.parse.stopAt(t);;){var o=n.parse.advance();if(o){if(n.fragments=n.withoutTempSkipped(de.addTree(o,n.fragments,null!=n.parse.stoppedAt)),n.treeLen=null!==(r=n.parse.stoppedAt)&&void 0!==r?r:n.state.doc.length,n.tree=o,n.parse=null,!(n.treeLen<(null!==t&&void 0!==t?t:n.state.doc.length)))return!0;n.parse=n.startParse()}if(Date.now()>i)return!1}}))}},{key:"takeTree",value:function(){var e,t,n=this;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((function(){for(;!(t=n.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(de.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=xe;xe=this;try{return e()}finally{xe=t}}},{key:"withoutTempSkipped",value:function(e){for(var t;t=this.tempSkipped.pop();)e=Se(e,t.from,t.to);return e}},{key:"changes",value:function(t,n){var r=this.fragments,i=this.tree,o=this.treeLen,s=this.viewport,u=this.skipped;if(this.takeTree(),!t.empty){var a=[];if(t.iterChangedRanges((function(e,t,n,r){return a.push({fromA:e,toA:t,fromB:n,toB:r})})),r=de.applyChanges(r,a),i=K.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){u=[];var f,l=h(this.skipped);try{for(l.s();!(f=l.n()).done;){var c=f.value,d=t.mapPos(c.from,1),v=t.mapPos(c.to,-1);d<v&&u.push({from:d,to:v})}}catch(p){l.e(p)}finally{l.f()}}}return new e(this.parser,n,r,i,o,s,u,this.scheduleOn)}},{key:"updateViewport",value:function(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;for(var t=this.skipped.length,n=0;n<this.skipped.length;n++){var r=this.skipped[n],i=r.from,o=r.to;i<e.to&&o>e.from&&(this.fragments=Se(this.fragments,i,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(e,t){this.skipped.push({from:e,to:t})}},{key:"isDone",value:function(e){e=Math.min(e,this.state.doc.length);var t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}}],[{key:"getSkippingParser",value:function(e){return new(function(t){v(r,t);var n=y(r);function r(){return m(this,r),n.apply(this,arguments)}return b(r,[{key:"createParse",value:function(t,n,r){var i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance:function(){var t=xe;if(t){var n,s=h(r);try{for(s.s();!(n=s.n()).done;){var u=n.value;t.tempSkipped.push(u)}}catch(a){s.e(a)}finally{s.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new K($.none,[],[],o-i)},stoppedAt:null,stopAt:function(){}}}}]),r}(ve))}},{key:"get",value:function(){return xe}}]),e}();function Se(e,t,n){return de.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var Ce=function(){function e(t){m(this,e),this.context=t,this.tree=t.tree}return b(e,[{key:"apply",value:function(t){if(!t.docChanged)return this;var n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}}],[{key:"init",value:function(t){var n=Math.min(3e3,t.doc.length),r=new we(t.facet(Ae).parser,t,[],K.empty,0,{from:0,to:n},[],null);return r.work(20,n)||r.takeTree(),new e(r)}}]),e}();ye.state=a.StateField.define({create:Ce.init,update:function(e,t){var n,r=h(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(ye.setState))return i.value}}catch(o){r.e(o)}finally{r.f()}return t.startState.facet(Ae)!=t.state.facet(Ae)?Ce.init(t.state):e.apply(t)}});var _e=function(e){var t=setTimeout((function(){return e()}),500);return function(){return clearTimeout(t)}};"undefined"!=typeof requestIdleCallback&&(_e=function(e){var t=-1,n=setTimeout((function(){t=requestIdleCallback(e,{timeout:400})}),100);return function(){return t<0?clearTimeout(n):cancelIdleCallback(t)}});var Oe=H.ViewPlugin.fromClass(function(){function e(t){m(this,e),this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return b(e,[{key:"update",value:function(e){var t=this.view.state.field(ye.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}},{key:"scheduleWork",value:function(){if(!this.working){var e=this.view.state,t=e.field(ye.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=_e(this.work))}}},{key:"work",value:function(e){this.working=null;var t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),!(this.chunkBudget<=0)){var n=this.view,r=n.state,i=n.viewport.to,o=r.field(ye.state);if(o.tree!=o.context.tree||!o.context.isDone(i+1e5)){var s=Math.min(this.chunkBudget,100,e?Math.max(25,e.timeRemaining()-5):1e9),u=o.context.treeLen<i&&r.doc.length>i+1e3,a=o.context.work(s,i+(u?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:ye.setState.of(new Ce(o.context))})),this.chunkBudget>0&&(!a||u)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(e){var t=this;e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((function(){return t.scheduleWork()})).catch((function(e){return(0,H.logException)(t.view.state,e)})).then((function(){return t.workScheduled--})),e.scheduleOn=null)}},{key:"destroy",value:function(){this.working&&this.working()}},{key:"isWorking",value:function(){return this.working||this.workScheduled>0}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),Ae=a.Facet.define({combine:function(e){return e.length?e[0]:null},enables:[ye.state,Oe]}),je=a.Facet.define({combine:function(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function Pe(e){var t=e.facet(je);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Ee(e,t){var n="",r=e.tabSize;if(9==e.facet(je).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(var i=0;i<t;i++)n+=" ";return n}function Be(e,t){var n=-1;return e.changeByRange((function(r){for(var i=[],o=r.from;o<=r.to;){var s=e.doc.lineAt(o);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),o=s.to+1}var u=e.changes(i);return{changes:i,range:a.EditorSelection.range(u.mapPos(r.anchor,1),u.mapPos(r.head,1))}}))}var Ne=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(Be(t,(function(e,n){n.push({from:e.from,insert:t.facet(je)})})),{userEvent:"input.indent"})),!0)},Te=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(Be(t,(function(e,n){var r=/^\s*/.exec(e.text)[0];if(r){for(var i=N(r,t.tabSize),o=0,s=Ee(t,Math.max(0,i-Pe(t)));o<r.length&&o<s.length&&r.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:e.from+o,to:e.from+r.length,insert:s.slice(o)})}})),{userEvent:"delete.dedent"})),!0)},Ie={key:"Tab",run:Ne,shift:Te},Me=n(362),Re=H.EditorView.theme({"&":{backgroundColor:"#fff"}},{dark:!1});function We(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onUpdate,h=e.extensions,f=void 0===h?[]:h,l=e.autoFocus,c=e.theme,d=void 0===c?"light":c,v=e.height,p=void 0===v?"":v,g=e.minHeight,y=void 0===g?"":g,m=e.maxHeight,k=void 0===m?"":m,b=e.placeholder,x=void 0===b?"":b,w=e.width,S=void 0===w?"":w,C=e.minWidth,_=void 0===C?"":C,O=e.maxWidth,A=void 0===O?"":O,j=e.editable,P=void 0===j||j,E=e.indentWithTab,B=void 0===E||E,N=e.basicSetup,T=void 0===N||N,I=e.root,M=o((0,s.useState)(e.container),2),R=M[0],W=M[1],z=o((0,s.useState)(),2),q=z[0],L=z[1],U=o((0,s.useState)(),2),D=U[0],V=U[1],F=H.EditorView.theme({"&":{height:p,minHeight:y,maxHeight:k,width:S,minWidth:_,maxWidth:A}}),J=[H.EditorView.updateListener.of((function(e){if(e.docChanged&&"function"===typeof r){var t=e.state.doc.toString();r(t,e)}})),F];switch(B&&J.unshift(H.keymap.of([Ie])),T&&J.unshift(u.basicSetup),x&&J.unshift((0,H.placeholder)(x)),d){case"light":J.push(Re);break;case"dark":J.push(Me.oneDark);break;default:J.push(d)}return!1===P&&J.push(H.EditorView.editable.of(!1)),i&&"function"===typeof i&&J.push(H.EditorView.updateListener.of(i)),J=J.concat(f),(0,s.useEffect)((function(){if(R&&!D){var e=a.EditorState.create({doc:t,selection:n,extensions:J});if(V(e),!q){var r=new H.EditorView({state:e,parent:R,root:I});L(r)}}}),[R,D]),(0,s.useEffect)((function(){return function(){q&&(q.destroy(),L(void 0))}}),[q]),(0,s.useEffect)((function(){l&&q&&q.focus()}),[l,q]),(0,s.useEffect)((function(){var e=q?q.state.doc.toString():"";q&&t!==e&&q.dispatch({changes:{from:0,to:e.length,insert:t||""}})}),[t,q]),(0,s.useEffect)((function(){q&&q.dispatch({effects:a.StateEffect.reconfigure.of(J)})}),[d,f,p,y,k,S,x,_,A,P,B,T]),{state:D,setState:V,view:q,setView:L,container:R,setContainer:W}}},13:function(e){var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var s,u,a=i(e),h=1;h<arguments.length;h++){for(var f in s=Object(arguments[h]))n.call(s,f)&&(a[f]=s[f]);if(t){u=t(s);for(var l=0;l<u.length;l++)r.call(s,u[l])&&(a[u[l]]=s[u[l]])}}return a}},829:function(e,t,n){n(13);var r=n(787),i=60103;if(60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),o("react.fragment")}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function h(e,t,n){var r,o={},h=null,f=null;for(r in void 0!==n&&(h=""+n),void 0!==t.key&&(h=""+t.key),void 0!==t.ref&&(f=t.ref),t)u.call(t,r)&&!a.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:h,ref:f,props:o,_owner:s.current}}t.jsx=h},364:function(e,t,n){e.exports=n(829)},787:function(t){t.exports=e},573:function(e){e.exports=t},242:function(e){e.exports=n},362:function(e){e.exports=r},105:function(e){e.exports=i},462:function(e,t,n){function r(){return r=Object.assign||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},r.apply(this,arguments)}n.d(t,{Z:function(){return r}})},366:function(e,t,n){function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,{Z:function(){return r}})}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return o[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){u.r(a),u.d(a,{useCodeMirror:function(){return i.U}});var e=u(462),t=u(366),n=u(787),r=u.n(n),i=u(927),o=u(364),s=u(105),h={};for(var f in s)"default"!==f&&(h[f]=function(e){return s[e]}.bind(0,f));u.d(a,h);var l=u(573);h={};for(var f in l)"default"!==f&&(h[f]=function(e){return l[e]}.bind(0,f));u.d(a,h);var c=u(242);h={};for(var f in c)"default"!==f&&(h[f]=function(e){return c[e]}.bind(0,f));u.d(a,h);var d=["className","value","selection","extensions","onChange","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","root"],v=r().forwardRef((function(r,s){var u=r.className,a=r.value,h=void 0===a?"":a,f=r.selection,l=r.extensions,c=void 0===l?[]:l,v=r.onChange,p=r.onUpdate,g=r.autoFocus,y=r.theme,m=void 0===y?"light":y,k=r.height,b=r.minHeight,x=r.maxHeight,w=r.width,S=r.minWidth,C=r.maxWidth,_=r.basicSetup,O=r.placeholder,A=r.indentWithTab,j=r.editable,P=r.root,E=(0,t.Z)(r,d),B=(0,n.useRef)(null),N=(0,i.U)({container:B.current,root:P,value:h,autoFocus:g,theme:m,height:k,minHeight:b,maxHeight:x,width:w,minWidth:S,maxWidth:C,basicSetup:_,placeholder:O,indentWithTab:A,editable:j,selection:f,onChange:v,onUpdate:p,extensions:c}),T=N.state,I=N.view,M=N.container,R=N.setContainer;if((0,n.useImperativeHandle)(s,(function(){return{editor:M,state:T,view:I}}),[M,T,I]),(0,n.useEffect)((function(){R(B.current)}),[]),"string"!==typeof h)throw new Error("value must be typeof string but got "+typeof h);var W="string"===typeof m?"cm-theme-"+m:"cm-theme";return(0,o.jsx)("div",(0,e.Z)({ref:B,className:W+(u?" "+u:"")},E))}));v.displayName="CodeMirror",a.default=v}(),a}()}));