From 17c35b5ab97a53d2f8ecab28714492adfa8122fa Mon Sep 17 00:00:00 2001 From: thisisnithin Date: Tue, 11 Feb 2025 19:49:38 +0530 Subject: [PATCH 1/2] fix: websocket url in router playground --- playground/src/components/playground/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/src/components/playground/index.tsx b/playground/src/components/playground/index.tsx index 9aac206344..8e9f3aa755 100644 --- a/playground/src/components/playground/index.tsx +++ b/playground/src/components/playground/index.tsx @@ -614,7 +614,7 @@ export const Playground = (input: { return createGraphiQLFetcher({ url: url, - subscriptionUrl: window.location.protocol.replace('http', 'ws') + '//' + window.location.host + url, + subscriptionUrl: url.replace('http', 'ws'), fetch: (...args) => graphiQLFetch(schema, clientValidationEnabled, input.scripts, onFetch, args[0] as URL, args[1] as RequestInit), }); From 1ab50617466e91287989edc88b2081bff39aee95 Mon Sep 17 00:00:00 2001 From: thisisnithin Date: Tue, 11 Feb 2025 19:51:33 +0530 Subject: [PATCH 2/2] build --- router/internal/graphiql/graphiql.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/internal/graphiql/graphiql.html b/router/internal/graphiql/graphiql.html index e75282bdee..d36d68b922 100644 --- a/router/internal/graphiql/graphiql.html +++ b/router/internal/graphiql/graphiql.html @@ -103,7 +103,7 @@ * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */!function(e,t){(function(){var n,i="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,u=64,c=128,p=256,d=1/0,f=9007199254740991,h=NaN,m=4294967295,g=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",u],["rearg",p]],y="[object Arguments]",v="[object Array]",b="[object Boolean]",x="[object Date]",E="[object Error]",D="[object Function]",w="[object GeneratorFunction]",C="[object Map]",S="[object Number]",T="[object Object]",k="[object Promise]",A="[object RegExp]",N="[object Set]",_="[object String]",F="[object Symbol]",I="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",z="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(G.source),X=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(re.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ee=/($^)/,De=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Ne="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_e="['’]",Fe="["+we+"]",Ie="["+Ne+"]",Pe="["+Ce+"]",Oe="\\d+",Le="["+Se+"]",Me="["+Te+"]",Re="[^"+we+Ne+Oe+Se+Te+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+ke+"]",Ue="\\u200d",He="(?:"+Me+"|"+Re+")",qe="(?:"+$e+"|"+Re+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Pe+"|"+Be+")"+"?",Ye="["+Ae+"]?",Xe=Ye+Ke+("(?:"+Ue+"(?:"+[je,Ve,ze].join("|")+")"+Ye+Ke+")*"),Je="(?:"+[Le,Ve,ze].join("|")+")"+Xe,Qe="(?:"+[je+Pe+"?",Pe,Ve,ze,Fe].join("|")+")",Ze=RegExp(_e,"g"),et=RegExp(Pe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([$e+"?"+Me+"+"+We+"(?="+[Ie,$e,"$"].join("|")+")",qe+"+"+Ge+"(?="+[Ie,$e+He,"$"].join("|")+")",$e+"?"+He+"+"+We,$e+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Je].join("|"),"g"),rt=RegExp("["+Ue+we+Ce+Ae+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[L]=st[M]=st[R]=st[B]=st[j]=st[V]=st[z]=st[$]=st[U]=!0,st[y]=st[v]=st[P]=st[b]=st[O]=st[x]=st[E]=st[D]=st[C]=st[S]=st[T]=st[A]=st[N]=st[_]=st[I]=!1;var lt={};lt[y]=lt[v]=lt[P]=lt[O]=lt[b]=lt[x]=lt[L]=lt[M]=lt[R]=lt[B]=lt[j]=lt[C]=lt[S]=lt[T]=lt[A]=lt[N]=lt[_]=lt[F]=lt[V]=lt[z]=lt[$]=lt[U]=!0,lt[E]=lt[D]=lt[I]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,pt=parseInt,dt="object"==typeof r&&r&&r.Object===Object&&r,ft="object"==typeof self&&self&&self.Object===Object&&self,ht=dt||ft||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,vt=yt&&dt.process,bt=function(){try{var e=gt&>.require&>.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(rK){}}(),xt=bt&&bt.isArrayBuffer,Et=bt&&bt.isDate,Dt=bt&&bt.isMap,wt=bt&&bt.isRegExp,Ct=bt&&bt.isSet,St=bt&&bt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Pt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&$t(t,e[n],0)>-1;);return n}var rn=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ut[e]}function sn(e){return rt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var gn=function e(t){var r,ae=(t=null==t?ht:gn.defaults(ht.Object(),t,gn.pick(ht,ot))).Array,we=t.Date,Ce=t.Error,Se=t.Function,Te=t.Math,ke=t.Object,Ae=t.RegExp,Ne=t.String,_e=t.TypeError,Fe=ae.prototype,Ie=Se.prototype,Pe=ke.prototype,Oe=t["__core-js_shared__"],Le=Ie.toString,Me=Pe.hasOwnProperty,Re=0,Be=(r=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=Pe.toString,Ve=Le.call(ke),ze=ht._,$e=Ae("^"+Le.call(Me).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=yt?t.Buffer:n,He=t.Symbol,qe=t.Uint8Array,We=Ue?Ue.allocUnsafe:n,Ge=un(ke.getPrototypeOf,ke),Ke=ke.create,Ye=Pe.propertyIsEnumerable,Xe=Fe.splice,Je=He?He.isConcatSpreadable:n,Qe=He?He.iterator:n,tt=He?He.toStringTag:n,rt=function(){try{var e=po(ke,"defineProperty");return e({},"",{}),e}catch(rK){}}(),ut=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ht.Date.now&&we.now,ft=t.setTimeout!==ht.setTimeout&&t.setTimeout,mt=Te.ceil,gt=Te.floor,vt=ke.getOwnPropertySymbols,bt=Ue?Ue.isBuffer:n,jt=t.isFinite,Gt=Fe.join,yn=un(ke.keys,ke),vn=Te.max,bn=Te.min,xn=we.now,En=t.parseInt,Dn=Te.random,wn=Fe.reverse,Cn=po(t,"DataView"),Sn=po(t,"Map"),Tn=po(t,"Promise"),kn=po(t,"Set"),An=po(t,"WeakMap"),Nn=po(ke,"create"),_n=An&&new An,Fn={},In=zo(Cn),Pn=zo(Sn),On=zo(Tn),Ln=zo(kn),Mn=zo(An),Rn=He?He.prototype:n,Bn=Rn?Rn.valueOf:n,jn=Rn?Rn.toString:n;function Vn(e){if(is(e)&&!Ga(e)&&!(e instanceof Hn)){if(e instanceof Un)return e;if(Me.call(e,"__wrapped__"))return $o(e)}return new Un(e)}var zn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ke)return Ke(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function lr(e,t,r,i,o,a){var s,l=1&t,u=2&t,c=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!rs(e))return e;var p=Ga(e);if(p){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ni(e,s)}else{var d=mo(e),f=d==D||d==w;if(Ja(e))return wi(e,l);if(d==T||d==y||f&&!o){if(s=u||f?{}:yo(e),!l)return u?function(e,t){return _i(e,ho(e),t)}(e,function(e,t){return e&&_i(t,Ls(t),e)}(s,e)):function(e,t){return _i(e,fo(e),t)}(e,ir(s,e))}else{if(!lt[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Ci(e);case b:case x:return new r(+e);case O:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case R:case B:case j:case V:case z:case $:case U:return Si(e,n);case C:return new r;case S:case _:return new r(e);case A:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case N:return new r;case F:return i=e,Bn?ke(Bn.call(i)):{}}var i}(e,d,l)}}a||(a=new Yn);var h=a.get(e);if(h)return h;a.set(e,s),us(e)?e.forEach((function(n){s.add(lr(n,t,r,n,e,a))})):os(e)&&e.forEach((function(n,i){s.set(i,lr(n,t,r,i,e,a))}));var m=p?n:(c?u?io:ro:u?Ls:Os)(e);return At(m||e,(function(n,i){m&&(n=e[i=n]),tr(s,i,lr(n,t,r,i,e,a))})),s}function ur(e,t,r){var i=r.length;if(null==e)return!i;for(e=ke(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function cr(e,t,r){if("function"!=typeof e)throw new _e(i);return Fo((function(){e.apply(n,r)}),t)}function pr(e,t,n,r){var i=-1,o=It,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Ot(t,Qt(n))),r?(o=Pt,a=!1):t.length>=200&&(o=en,a=!1,t=new Kn(t));e:for(;++i-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Sn||Wn),string:new qn}},Gn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return uo(this,e).get(e)},Gn.prototype.has=function(e){return uo(this,e).has(e)},Gn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,o),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var dr=Pi(xr),fr=Pi(Er,!0);function hr(e,t){var n=!0;return dr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,r){for(var i=-1,o=e.length;++i0&&n(s)?t>1?yr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var vr=Oi(),br=Oi(!0);function xr(e,t){return e&&vr(e,t,Os)}function Er(e,t){return e&&br(e,t,Os)}function Dr(e,t){return Ft(t,(function(t){return es(e[t])}))}function wr(e,t){for(var r=0,i=(t=bi(t,e)).length;null!=e&&rt}function kr(e,t){return null!=e&&Me.call(e,t)}function Ar(e,t){return null!=e&&t in ke(e)}function Nr(e,t,r){for(var i=r?Pt:It,o=e[0].length,a=e.length,s=a,l=ae(a),u=1/0,c=[];s--;){var p=e[s];s&&t&&(p=Ot(p,Qt(t))),u=bn(p.length,u),l[s]=!r&&(t||o>=120&&p.length>=120)?new Kn(s&&p):n}p=e[0];var d=-1,f=l[0];e:for(;++d=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Xe.call(e,i,1):pi(e,i)}}return e}function Kr(e,t){return e+gt(Dn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Io(ko(e,t,al),e+"")}function Jr(e){return Jn(Us(e))}function Qr(e,t){var n=Us(e);return Lo(n,sr(t,0,n.length))}function Zr(e,t,r,i){if(!rs(e))return e;for(var o=-1,a=(t=bi(t,e)).length,s=a-1,l=e;null!=l&&++oi?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=ae(i);++r>>1,a=e[o];null!==a&&!ps(a)&&(n?a<=t:a=200){var u=t?null:Yi(e);if(u)return pn(u);a=!1,i=en,l=new Kn}else l=t?[]:s;e:for(;++r=i?e:ri(e,t,r)}var Di=ut||function(e){return ht.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Si(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=ps(e),s=t!==n,l=null===t,u=t==t,c=ps(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!o)return 1;if(!i&&!a&&!c&&e1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&xo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:n}}function ji(e){return no((function(t){var r=t.length,o=r,a=Un.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new _e(i);if(a&&!l&&"wrapper"==ao(s))var l=new Un([],!0)}for(o=l?o:r;++o1&&b.reverse(),d&&ul))return!1;var c=a.get(e),p=a.get(t);if(c&&p)return c==t&&p==e;var d=-1,f=!0,h=2&r?new Kn:n;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(g,(function(n){var r="_."+n[0];t&n[1]&&!It(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ue):[]}(r),n)))}function Oo(e){var t=0,r=0;return function(){var i=xn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Lo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ma(e){var t=Vn(e);return t.__chain__=!0,t}function ga(e,t){return t(e)}var ya=no((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&bo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ga,args:[o],thisArg:n}),new Un(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(o)}));var va=Fi((function(e,t,n){Me.call(e,n)?++e[n]:or(e,n,1)}));var ba=Bi(Wo),xa=Bi(Go);function Ea(e,t){return(Ga(e)?At:dr)(e,lo(t,3))}function Da(e,t){return(Ga(e)?Nt:fr)(e,lo(t,3))}var wa=Fi((function(e,t,n){Me.call(e,n)?e[n].push(t):or(e,n,[t])}));var Ca=Xr((function(e,t,n){var r=-1,i="function"==typeof t,o=Ya(e)?ae(e.length):[];return dr(e,(function(e){o[++r]=i?Tt(t,e,n):_r(e,t,n)})),o})),Sa=Fi((function(e,t,n){or(e,n,t)}));function Ta(e,t){return(Ga(e)?Ot:jr)(e,lo(t,3))}var ka=Fi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Aa=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xo(e,t[0],t[1])?t=[]:n>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,yr(t,1),[])})),Na=dt||function(){return ht.Date.now()};function _a(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ji(e,c,n,n,n,n,t)}function Fa(e,t){var r;if("function"!=typeof t)throw new _e(i);return e=ys(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var Ia=Xr((function(e,t,n){var r=1;if(n.length){var i=cn(n,so(Ia));r|=l}return Ji(e,r,t,n,i)})),Pa=Xr((function(e,t,n){var r=3;if(n.length){var i=cn(n,so(Pa));r|=l}return Ji(t,r,e,n,i)}));function Oa(e,t,r){var o,a,s,l,u,c,p=0,d=!1,f=!1,h=!0;if("function"!=typeof e)throw new _e(i);function m(t){var r=o,i=a;return o=a=n,p=t,l=e.apply(i,r)}function g(e){var r=e-c;return c===n||r>=t||r<0||f&&e-p>=s}function y(){var e=Na();if(g(e))return v(e);u=Fo(y,function(e){var n=t-(e-c);return f?bn(n,s-(e-p)):n}(e))}function v(e){return u=n,h&&o?m(e):(o=a=n,l)}function b(){var e=Na(),r=g(e);if(o=arguments,a=this,c=e,r){if(u===n)return function(e){return p=e,u=Fo(y,t),d?m(e):l}(c);if(f)return Di(u),u=Fo(y,t),m(c)}return u===n&&(u=Fo(y,t)),l}return t=bs(t)||0,rs(r)&&(d=!!r.leading,s=(f="maxWait"in r)?vn(bs(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h),b.cancel=function(){u!==n&&Di(u),p=0,o=c=a=u=n},b.flush=function(){return u===n?l:v(Na())},b}var La=Xr((function(e,t){return cr(e,1,t)})),Ma=Xr((function(e,t,n){return cr(e,bs(t)||0,n)}));function Ra(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Gn),n}function Ba(e){if("function"!=typeof e)throw new _e(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ra.Cache=Gn;var ja=xi((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Ot(t[0],Qt(lo())):Ot(yr(t,1),Qt(lo()))).length;return Xr((function(r){for(var i=-1,o=bn(r.length,n);++i=t})),Wa=Fr(function(){return arguments}())?Fr:function(e){return is(e)&&Me.call(e,"callee")&&!Ye.call(e,"callee")},Ga=ae.isArray,Ka=xt?Qt(xt):function(e){return is(e)&&Sr(e)==P};function Ya(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return is(e)&&Ya(e)}var Ja=bt||bl,Qa=Et?Qt(Et):function(e){return is(e)&&Sr(e)==x};function Za(e){if(!is(e))return!1;var t=Sr(e);return t==E||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Sr(e);return t==D||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==ys(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=Dt?Qt(Dt):function(e){return is(e)&&mo(e)==C};function as(e){return"number"==typeof e||is(e)&&Sr(e)==S}function ss(e){if(!is(e)||Sr(e)!=T)return!1;var t=Ge(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Le.call(n)==Ve}var ls=wt?Qt(wt):function(e){return is(e)&&Sr(e)==A};var us=Ct?Qt(Ct):function(e){return is(e)&&mo(e)==N};function cs(e){return"string"==typeof e||!Ga(e)&&is(e)&&Sr(e)==_}function ps(e){return"symbol"==typeof e||is(e)&&Sr(e)==F}var ds=St?Qt(St):function(e){return is(e)&&ns(e.length)&&!!st[Sr(e)]};var fs=Wi(Br),hs=Wi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Ya(e))return cs(e)?fn(e):Ni(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=mo(e);return(t==C?ln:t==N?pn:Us)(e)}function gs(e){return e?(e=bs(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ys(e){var t=gs(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?sr(ys(e),0,m):0}function bs(e){if("number"==typeof e)return e;if(ps(e))return h;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ge.test(e);return n||ve.test(e)?pt(e.slice(2),n?2:8):me.test(e)?h:+e}function xs(e){return _i(e,Ls(e))}function Es(e){return null==e?"":ui(e)}var Ds=Ii((function(e,t){if(Co(t)||Ya(t))_i(t,Os(t),e);else for(var n in t)Me.call(t,n)&&tr(e,n,t[n])})),ws=Ii((function(e,t){_i(t,Ls(t),e)})),Cs=Ii((function(e,t,n,r){_i(t,Ls(t),e,r)})),Ss=Ii((function(e,t,n,r){_i(t,Os(t),e,r)})),Ts=no(ar);var ks=Xr((function(e,t){e=ke(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&xo(t[0],t[1],o)&&(i=1);++r1),t})),_i(e,io(e),n),r&&(n=lr(n,7,eo));for(var i=t.length;i--;)pi(n,t[i]);return n}));var js=no((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return _s(e,n)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var n=Ot(io(e),(function(e){return[e]}));return t=lo(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var zs=Xi(Os),$s=Xi(Ls);function Us(e){return null==e?[]:Zt(e,Os(e))}var Hs=Mi((function(e,t,n){return t=t.toLowerCase(),e+(n?qs(t):t)}));function qs(e){return Zs(Es(e).toLowerCase())}function Ws(e){return(e=Es(e))&&e.replace(xe,rn).replace(et,"")}var Gs=Mi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ks=Mi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ys=Li("toLowerCase");var Xs=Mi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Js=Mi((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Qs=Mi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=Li("toUpperCase");function el(e,t,r){return e=Es(e),(t=r?n:t)===n?function(e){return it.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var tl=Xr((function(e,t){try{return Tt(e,n,t)}catch(rK){return Za(rK)?rK:new Ce(rK)}})),nl=no((function(e,t){return At(t,(function(t){t=Vo(t),or(e,t,Ia(e[t],e))})),e}));function rl(e){return function(){return e}}var il=ji(),ol=ji(!0);function al(e){return e}function sl(e){return Lr("function"==typeof e?e:lr(e,1))}var ll=Xr((function(e,t){return function(n){return _r(n,e,t)}})),ul=Xr((function(e,t){return function(n){return _r(e,n,t)}}));function cl(e,t,n){var r=Os(t),i=Dr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Dr(t,Os(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return At(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ni(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})})),e}function pl(){}var dl=Ui(Ot),fl=Ui(_t),hl=Ui(Bt);function ml(e){return Eo(e)?Wt(Vo(e)):function(e){return function(t){return wr(t,e)}}(e)}var gl=qi(),yl=qi(!0);function vl(){return[]}function bl(){return!1}var xl=$i((function(e,t){return e+t}),0),El=Ki("ceil"),Dl=$i((function(e,t){return e/t}),1),wl=Ki("floor");var Cl,Sl=$i((function(e,t){return e*t}),1),Tl=Ki("round"),kl=$i((function(e,t){return e-t}),0);return Vn.after=function(e,t){if("function"!=typeof t)throw new _e(i);return e=ys(e),function(){if(--e<1)return t.apply(this,arguments)}},Vn.ary=_a,Vn.assign=Ds,Vn.assignIn=ws,Vn.assignInWith=Cs,Vn.assignWith=Ss,Vn.at=Ts,Vn.before=Fa,Vn.bind=Ia,Vn.bindAll=nl,Vn.bindKey=Pa,Vn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},Vn.chain=ma,Vn.chunk=function(e,t,r){t=(r?xo(e,t,r):t===n)?1:vn(ys(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+r),(i=i===n||i>o?o:ys(i))<0&&(i+=o),i=r>i?0:vs(i);r>>0)?(e=Es(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?Ei(fn(e),0,r):e.split(t,r):[]},Vn.spread=function(e,t){if("function"!=typeof e)throw new _e(i);return t=null==t?0:vn(ys(t),0),Xr((function(n){var r=n[t],i=Ei(n,0,t);return r&&Lt(i,r),Tt(e,this,i)}))},Vn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Vn.take=function(e,t,r){return e&&e.length?ri(e,0,(t=r||t===n?1:ys(t))<0?0:t):[]},Vn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=r||t===n?1:ys(t)))<0?0:t,i):[]},Vn.takeRightWhile=function(e,t){return e&&e.length?fi(e,lo(t,3),!1,!0):[]},Vn.takeWhile=function(e,t){return e&&e.length?fi(e,lo(t,3)):[]},Vn.tap=function(e,t){return t(e),e},Vn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new _e(i);return rs(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Oa(e,t,{leading:r,maxWait:t,trailing:o})},Vn.thru=ga,Vn.toArray=ms,Vn.toPairs=zs,Vn.toPairsIn=$s,Vn.toPath=function(e){return Ga(e)?Ot(e,Vo):ps(e)?[e]:Ni(jo(Es(e)))},Vn.toPlainObject=xs,Vn.transform=function(e,t,n){var r=Ga(e),i=r||Ja(e)||ds(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?zn(Ge(e)):{}}return(i?At:xr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Vn.unary=function(e){return _a(e,1)},Vn.union=ia,Vn.unionBy=oa,Vn.unionWith=aa,Vn.uniq=function(e){return e&&e.length?ci(e):[]},Vn.uniqBy=function(e,t){return e&&e.length?ci(e,lo(t,2)):[]},Vn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Vn.unset=function(e,t){return null==e||pi(e,t)},Vn.unzip=sa,Vn.unzipWith=la,Vn.update=function(e,t,n){return null==e?e:di(e,t,vi(n))},Vn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:di(e,t,vi(r),i)},Vn.values=Us,Vn.valuesIn=function(e){return null==e?[]:Zt(e,Ls(e))},Vn.without=ua,Vn.words=el,Vn.wrap=function(e,t){return Va(vi(t),e)},Vn.xor=ca,Vn.xorBy=pa,Vn.xorWith=da,Vn.zip=fa,Vn.zipObject=function(e,t){return gi(e||[],t||[],tr)},Vn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Zr)},Vn.zipWith=ha,Vn.entries=zs,Vn.entriesIn=$s,Vn.extend=ws,Vn.extendWith=Cs,cl(Vn,Vn),Vn.add=xl,Vn.attempt=tl,Vn.camelCase=Hs,Vn.capitalize=qs,Vn.ceil=El,Vn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),sr(bs(e),t,r)},Vn.clone=function(e){return lr(e,4)},Vn.cloneDeep=function(e){return lr(e,5)},Vn.cloneDeepWith=function(e,t){return lr(e,5,t="function"==typeof t?t:n)},Vn.cloneWith=function(e,t){return lr(e,4,t="function"==typeof t?t:n)},Vn.conformsTo=function(e,t){return null==t||ur(e,t,Os(t))},Vn.deburr=Ws,Vn.defaultTo=function(e,t){return null==e||e!=e?t:e},Vn.divide=Dl,Vn.endsWith=function(e,t,r){e=Es(e),t=ui(t);var i=e.length,o=r=r===n?i:sr(ys(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},Vn.eq=Ua,Vn.escape=function(e){return(e=Es(e))&&X.test(e)?e.replace(K,on):e},Vn.escapeRegExp=function(e){return(e=Es(e))&&ie.test(e)?e.replace(re,"\\$&"):e},Vn.every=function(e,t,r){var i=Ga(e)?_t:hr;return r&&xo(e,t,r)&&(t=n),i(e,lo(t,3))},Vn.find=ba,Vn.findIndex=Wo,Vn.findKey=function(e,t){return Vt(e,lo(t,3),xr)},Vn.findLast=xa,Vn.findLastIndex=Go,Vn.findLastKey=function(e,t){return Vt(e,lo(t,3),Er)},Vn.floor=wl,Vn.forEach=Ea,Vn.forEachRight=Da,Vn.forIn=function(e,t){return null==e?e:vr(e,lo(t,3),Ls)},Vn.forInRight=function(e,t){return null==e?e:br(e,lo(t,3),Ls)},Vn.forOwn=function(e,t){return e&&xr(e,lo(t,3))},Vn.forOwnRight=function(e,t){return e&&Er(e,lo(t,3))},Vn.get=Ns,Vn.gt=Ha,Vn.gte=qa,Vn.has=function(e,t){return null!=e&&go(e,t,kr)},Vn.hasIn=_s,Vn.head=Yo,Vn.identity=al,Vn.includes=function(e,t,n,r){e=Ya(e)?e:Us(e),n=n&&!r?ys(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),cs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&$t(e,t,n)>-1},Vn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=vn(r+i,0)),$t(e,t,i)},Vn.inRange=function(e,t,r){return t=gs(t),r===n?(r=t,t=0):r=gs(r),function(e,t,n){return e>=bn(t,n)&&e=-9007199254740991&&e<=f},Vn.isSet=us,Vn.isString=cs,Vn.isSymbol=ps,Vn.isTypedArray=ds,Vn.isUndefined=function(e){return e===n},Vn.isWeakMap=function(e){return is(e)&&mo(e)==I},Vn.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==Sr(e)},Vn.join=function(e,t){return null==e?"":Gt.call(e,t)},Vn.kebabCase=Gs,Vn.last=Zo,Vn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ys(r))<0?vn(i+o,0):bn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,Ht,o,!0)},Vn.lowerCase=Ks,Vn.lowerFirst=Ys,Vn.lt=fs,Vn.lte=hs,Vn.max=function(e){return e&&e.length?mr(e,al,Tr):n},Vn.maxBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Tr):n},Vn.mean=function(e){return qt(e,al)},Vn.meanBy=function(e,t){return qt(e,lo(t,2))},Vn.min=function(e){return e&&e.length?mr(e,al,Br):n},Vn.minBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Br):n},Vn.stubArray=vl,Vn.stubFalse=bl,Vn.stubObject=function(){return{}},Vn.stubString=function(){return""},Vn.stubTrue=function(){return!0},Vn.multiply=Sl,Vn.nth=function(e,t){return e&&e.length?Ur(e,ys(t)):n},Vn.noConflict=function(){return ht._===this&&(ht._=ze),this},Vn.noop=pl,Vn.now=Na,Vn.pad=function(e,t,n){e=Es(e);var r=(t=ys(t))?dn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(gt(i),n)+e+Hi(mt(i),n)},Vn.padEnd=function(e,t,n){e=Es(e);var r=(t=ys(t))?dn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var o=Dn();return bn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Vn.reduce=function(e,t,n){var r=Ga(e)?Mt:Kt,i=arguments.length<3;return r(e,lo(t,4),n,i,dr)},Vn.reduceRight=function(e,t,n){var r=Ga(e)?Rt:Kt,i=arguments.length<3;return r(e,lo(t,4),n,i,fr)},Vn.repeat=function(e,t,r){return t=(r?xo(e,t,r):t===n)?1:ys(t),Yr(Es(e),t)},Vn.replace=function(){var e=arguments,t=Es(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vn.result=function(e,t,r){var i=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=n);++if)return[];var n=m,r=bn(e,m);t=lo(t),e-=m;for(var i=Xt(r,t);++n=a)return e;var l=r-dn(i);if(l<1)return i;var u=s?Ei(s,0,l).join(""):e.slice(0,l);if(o===n)return u+i;if(s&&(l+=u.length-l),ls(o)){if(e.slice(l).search(o)){var c,p=u;for(o.global||(o=Ae(o.source,Es(he.exec(o))+"g")),o.lastIndex=0;c=o.exec(p);)var d=c.index;u=u.slice(0,d===n?l:d)}}else if(e.indexOf(ui(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},Vn.unescape=function(e){return(e=Es(e))&&Y.test(e)?e.replace(G,mn):e},Vn.uniqueId=function(e){var t=++Re;return Es(e)+t},Vn.upperCase=Qs,Vn.upperFirst=Zs,Vn.each=Ea,Vn.eachRight=Da,Vn.first=Yo,cl(Vn,(Cl={},xr(Vn,(function(e,t){Me.call(Vn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Vn.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vn[e].placeholder=Vn})),At(["drop","take"],(function(e,t){Hn.prototype[e]=function(r){r=r===n?1:vn(ys(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,m),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),At(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),At(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}})),At(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(al)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Hn(this):this.map((function(n){return _r(n,e,t)}))})),Hn.prototype.reject=function(e){return this.filter(Ba(lo(e)))},Hn.prototype.slice=function(e,t){e=ys(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ys(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(m)},xr(Hn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Vn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Vn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Hn,u=s[0],c=l||Ga(t),p=function(e){var t=o.apply(Vn,Lt([e],s));return i&&d?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,h=a&&!d,m=l&&!f;if(!a&&c){t=m?t:new Hn(this);var g=e.apply(t,s);return g.__actions__.push({func:ga,args:[p],thisArg:n}),new Un(g,d)}return h&&m?e.apply(this,s):(g=this.thru(p),h?i?g.value()[0]:g.value():g)})})),At(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Fe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Vn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),xr(Hn.prototype,(function(e,t){var n=Vn[t];if(n){var r=n.name+"";Me.call(Fn,r)||(Fn[r]=[]),Fn[r].push({name:t,func:n})}})),Fn[Vi(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Vn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var i=$o(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Vn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:ga,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Vn.prototype.toJSON=Vn.prototype.valueOf=Vn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Vn.prototype.first=Vn.prototype.head,Qe&&(Vn.prototype[Qe]=function(){return this}),Vn}();gt?((gt.exports=gn)._=gn,mt._=gn):ht._=gn}).call(r)}(FIe,FIe.exports);const IIe=i(FIe.exports),PIe="Checkbox",[OIe,LIe]=TA(PIe),[MIe,RIe]=OIe(PIe),BIe=H.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:u,...c}=e,[p,d]=H.useState(null),f=cA(t,(e=>d(e))),h=H.useRef(!1),m=!p||Boolean(p.closest("form")),[g=!1,y]=RA({prop:i,defaultProp:o,onChange:u}),v=H.useRef(g);return H.useEffect((()=>{const e=null==p?void 0:p.form;if(e){const t=()=>y(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,y]),H.createElement(MIe,{scope:n,state:g,disabled:s},H.createElement(OA.button,lA({type:"button",role:"checkbox","aria-checked":VIe(g)?"mixed":g,"aria-required":a,"data-state":zIe(g),"data-disabled":s?"":void 0,disabled:s,value:l},c,{ref:f,onKeyDown:SA(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:SA(e.onClick,(e=>{y((e=>!!VIe(e)||!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&H.createElement(jIe,{control:p,bubbles:!h.current,name:r,value:l,checked:g,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))})),jIe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=H.useRef(null),a=MTe(n),s=hle(t);return H.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,"checked").set;if(a!==n&&i){const t=new Event("click",{bubbles:r});e.indeterminate=VIe(n),i.call(e,!VIe(n)&&n),e.dispatchEvent(t)}}),[a,n,r]),H.createElement("input",lA({type:"checkbox","aria-hidden":!0,defaultChecked:!VIe(n)&&n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function VIe(e){return"indeterminate"===e}function zIe(e){return VIe(e)?"indeterminate":e?"checked":"unchecked"}const $Ie=BIe,UIe=H.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=RIe("CheckboxIndicator",n);return H.createElement(rN,{present:r||VIe(o.state)||!0===o.state},H.createElement(OA.span,lA({"data-state":zIe(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))})),HIe=H.forwardRef((({className:e,...t},n)=>ee.jsx($Ie,{ref:n,className:ed("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:ee.jsx(UIe,{className:ed("flex items-center justify-center text-current"),children:ee.jsx(Fk,{className:"h-4 w-4"})})})));HIe.displayName=$Ie.displayName;const qIe="playground:env",WIe=(e,t,n)=>{window.playground=((e,t,n)=>({env:{set:(t,n)=>{const r=localStorage.getItem(qIe)||"{}",i=JSON.parse(r);i[e]||(i[e]={}),i[e][t]=n,localStorage.setItem(qIe,JSON.stringify(i)),window.dispatchEvent(new StorageEvent("local-storage",{key:qIe}))},get:t=>{var n;const r=localStorage.getItem(qIe)||"{}";return null==(n=JSON.parse(r)[e])?void 0:n[t]}},request:{body:t||null},response:{body:n||null},CryptoJS:_Ie}))(e,t,n)},GIe=()=>{delete window.playground},KIe=({script:e,close:t})=>{const n=CNe(),r=yNe(),i=H.useRef(null),o=H.useRef(null),a=H.useContext(kNe),{tabsState:{activeTabIndex:s,tabs:l}}=a,u=l[s].id;H.useEffect((()=>{r&&("dark"===n?r.editor.setTheme("wg-dark"):r.editor.setTheme("light"))}),[n,r]);const[c,p]=H.useState([]),d=H.useRef(null);H.useEffect((()=>{d.current&&d.current.scrollIntoView()}),[c]);const[f,h]=MNe(qIe,{}),[m,g]=H.useState(),y=ANe((e=>{g(e)}),500);H.useEffect((()=>{g(void 0)}),[f,y]);const[v,b]=MNe(`playground:${e.type}:selected`,{}),[x,E]=MNe("playground:script:tabState",{}),D=H.useCallback((({upsert:t,updatedTitle:n})=>{const r={...x};l.forEach((o=>{var a,u,c,p,d;const f=o.id;r[f]&&(null==(a=r[f][e.type])?void 0:a.id)===e.id?r[f][e.type]={...r[f][e.type],id:e.id,enabled:(null==(u=r[f][e.type])?void 0:u.enabled)||!1,content:null==(c=i.current)?void 0:c.getValue()}:t&&f===l[s].id&&(r[f]||(r[f]={}),r[f][e.type]={id:e.id,title:n||e.title,enabled:(null==(p=r[f][e.type])?void 0:p.enabled)||!1,content:null==(d=i.current)?void 0:d.getValue()})})),E(r)}),[l,s,e,x,E]);return n?ee.jsxs("div",{className:"flex flex-col",children:[ee.jsxs(V_e,{direction:"vertical",children:[ee.jsx(z_e,{defaultSize:70,minSize:20,children:ee.jsx(ENe,{theme:"dark"===n?"wg-dark":"light",className:"scrollbar-custom h-full text-xs",language:"javascript",defaultValue:e.content,loading:null,options:{automaticLayout:!0,language:"javascript",minimap:{enabled:!1},hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},suggest:{showWords:!1}},onMount:(e,t)=>{i.current=e,t.editor.defineTheme("wg-dark",DNe),"dark"===n&&t.editor.setTheme("wg-dark"),fetch("https://unpkg.com/@types/crypto-js@4.2.0/index.d.ts").then((e=>e.text())).then((e=>{t.languages.typescript.javascriptDefaults.addExtraLib(e,"crypto-js.d.ts"),t.languages.typescript.javascriptDefaults.addExtraLib("\n declare module 'crypto-js' {\n export = CryptoJS;\n }\n ","crypto-js-module.d.ts")})).catch((e=>console.error(e))),t.languages.typescript.javascriptDefaults.addExtraLib('\n interface JSONObject {\n [key: string]: JSONValue;\n }\n type JSONArray = JSONValue[];\n type JSONValue = string | number | boolean | JSONObject | JSONArray | null;\n\n interface Playground {\n /**\n * The env property contains methods to interact with local environment variables.\n */\n env: {\n /**\n * Sets a key-value pair for local environment variables.\n * @param name The key name.\n * @param value The value to store.\n */\n set(name: string, value: any): void;\n\n /**\n * Gets a value from local environment variables by key.\n * @param name The key name.\n * @returns The value associated with the key.\n */\n get(name: string): JSONValue;\n };\n\n /**\n * Represents the GraphQL request body.\n */\n request: {\n body: {\n /**\n * The GraphQL query string.\n */\n query: string;\n\n /**\n * The variables object associated with the GraphQL query.\n */\n variables?: { [key: string]?: JSONValue };\n\n /**\n * The name of the GraphQL operation (if specified).\n */\n operationName?: string;\n };\n };\n\n /**\n * Represents the GraphQL response body.\n */\n response: {\n body?: {\n /**\n * The data resulting from the GraphQL operation.\n */\n data?: T;\n };\n };\n\n /**\n * Exposes the crypto-js library for cryptographic operations.\n */\n CryptoJS: typeof import("crypto-js");\n }\n\n\n declare const playground: Playground;\n',"playground.d.ts")}},e.id)}),ee.jsx($_e,{}),ee.jsx(z_e,{minSize:10,defaultSize:30,children:ee.jsxs(V_e,{direction:"horizontal",children:[ee.jsx(z_e,{defaultSize:60,minSize:40,children:ee.jsxs("div",{className:"relative flex h-full flex-col py-4 pr-4 text-sm",children:[ee.jsx("p",{className:"pb-4",children:"Console Output"}),ee.jsxs("div",{className:"absolute right-3 top-3 flex gap-x-2",children:[ee.jsx(DA,{size:"icon-sm",variant:"outline",onClick:()=>{p([])},children:ee.jsx(Rk,{})}),ee.jsx(DA,{size:"icon-sm",variant:"outline",onClick:()=>{var e;const t=null==(e=i.current)?void 0:e.getValue();t&&(async e=>{const t=console.log;console.log=(...e)=>{const n=e.map((e=>null===e?"null":void 0===e?"undefined":"object"==typeof e?JSON.stringify(e,null,2):String(e))).join(" ");p((e=>[...e,n])),t(...e)};try{WIe(a.graphId);const t=new Function(`\n return (async () => {\n ${e}\n })();\n `);await t()}catch(n){p((e=>[...e,`Error: ${n.message}`]))}finally{GIe()}console.log=t})(t)},children:ee.jsx(Zk,{})})]}),ee.jsxs("div",{className:"scrollbar-custom h-full flex-1 overflow-auto",children:[c.map(((e,t)=>ee.jsx("div",{className:"border-b border-dotted py-1.5 after:content-['\\200b'] last:border-none ",children:e},t))),ee.jsx("div",{ref:d})]})]})}),ee.jsx($_e,{}),ee.jsx(z_e,{defaultSize:40,minSize:40,children:ee.jsxs("div",{className:"flex h-full flex-col",children:[ee.jsxs("div",{className:"flex items-center justify-between py-4 pl-4 text-sm",children:[ee.jsx("span",{children:"Environment Variables"}),ee.jsxs(Lne,{children:[ee.jsx(Mne,{children:m?ee.jsx(Rk,{className:"text-destructive"}):ee.jsx(Fk,{className:"text-success"})}),ee.jsx(Rne,{align:"end",children:m||"Valid"})]})]}),ee.jsx(ENe,{onChange:e=>{try{const t=JSON.parse(e||"{}");h({...f,[a.graphId]:t}),y(void 0)}catch(rK){y(rK.message)}},theme:"dark"===n?"wg-dark":"light",language:"json",value:JSON.stringify(f[a.graphId],null,2),loading:null,options:{automaticLayout:!0,language:"json",minimap:{enabled:!1},hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},lineNumbers:"off",folding:!1},onMount:(e,t)=>{o.current=e,t.editor.defineTheme("wg-dark",DNe),"dark"===n&&t.editor.setTheme("wg-dark")}},"env-editor")]})})]})})]}),ee.jsx(B9,{orientation:"horizontal"}),ee.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[ee.jsx(DA,{variant:"secondary",onClick:()=>{t()},children:"Cancel"}),ee.jsx(DA,{onClick:()=>{var n;b({...e,content:null==(n=i.current)?void 0:n.getValue(),updatedByTabId:u}),"pre-flight"!==e.type&&D({upsert:!0}),t()},children:"Save"})]})]}):null},YIe=({type:e})=>{const[t,n]=H.useState(!1),[r,i]=H.useState(),{tabsState:{activeTabIndex:o,tabs:a}}=H.useContext(kNe);return H.useEffect((()=>{var n,r;if(!t)return;const s={id:Date.now().toString(),content:"",title:"",type:e};if("pre-flight"===e){const e=localStorage.getItem("playground:pre-flight:selected"),t=JSON.parse(e&&"undefined"!==e?e:"{}");i((null==t?void 0:t.id)?t:s)}else{const t=JSON.parse(localStorage.getItem("playground:script:tabState")||"{}"),l=null==(n=a[o])?void 0:n.id;if(!l)return;const u=null==(r=t[l])?void 0:r[e];i((null==u?void 0:u.id)?u:s)}}),[t,o,a]),ee.jsxs(bF,{open:t,onOpenChange:e=>{e||i(void 0),n(e)},children:[ee.jsx(xF,{asChild:!0,children:ee.jsx(DA,{size:"icon-sm",variant:"secondary",children:ee.jsx(Jk,{})})}),ee.jsxs(wF,{className:"flex h-[90vh] max-w-[90vw] flex-col overflow-hidden",onInteractOutside:e=>e.preventDefault(),children:[ee.jsx(CF,{children:ee.jsxs(SF,{className:"capitalize",children:[e," Script"]})}),ee.jsx("div",{className:"grid h-full min-h-0 grid-cols-1 gap-4 divide-x",children:r&&ee.jsx(KIe,{script:r,close:()=>{n(!1)}})})]})]})},XIe=({type:e})=>{const[t]=MNe(`playground:${e}:selected`,null),[n,r]=MNe("playground:pre-flight:enabled",!0),[i,o]=MNe("playground:script:tabState",{}),{tabsState:{activeTabIndex:a,tabs:s}}=H.useContext(kNe),l=H.useMemo((()=>{var t,n,r;const o=null==(t=s[a])?void 0:t.id;if(o)return(null==(r=null==(n=i[o])?void 0:n[e])?void 0:r.enabled)||!1}),[a,s,i,e]),u=H.useCallback((t=>{const n=s[a].id,r={...i};r[n]||(r[n]={}),r[n][e]={...r[n][e],enabled:t},o(r)}),[s,a,i,e,o]);return ee.jsxs("div",{className:"flex items-center gap-4",children:[ee.jsx(HIe,{checked:"pre-flight"===e?n:l,onCheckedChange:t=>{"pre-flight"===e?r(!!t):u(!!t)}}),ee.jsx("div",{className:"w-28 flex-shrink-0 capitalize",children:e}),":",ee.jsxs("div",{className:"flex w-full items-center justify-between gap-4 rounded-lg border pl-2",children:[ee.jsx("div",{className:"select-none text-sm italic",children:t&&t.id?t.title||"untitled script":"None Selected"}),ee.jsx(YIe,{type:e})]})]})},JIe=()=>{const{tabsState:{activeTabIndex:e,tabs:t}}=H.useContext(kNe),[n,r]=MNe("playground:script:tabState",{});H.useEffect((()=>{r((e=>{if(0===t.length)return e;const n=Object.keys(e),r=t.map((e=>e.id));return n.forEach((t=>{r.includes(t)||delete e[t]})),e}))}),[t,r]);const[i,o]=MNe("playground:pre-operation:selected",null),[a,s]=MNe("playground:post-operation:selected",null);return H.useEffect((()=>{var r;const l=null==(r=t[e])?void 0:r.id;if(!l)return;const u=n[l];IIe.isEqual(i,null==u?void 0:u["pre-operation"])||(null==i?void 0:i.updatedByTabId)&&(null==i?void 0:i.updatedByTabId)!==l&&o(null==u?void 0:u["pre-operation"]),IIe.isEqual(a,null==u?void 0:u["post-operation"])||(null==a?void 0:a.updatedByTabId)&&(null==a?void 0:a.updatedByTabId)!==l&&s(null==u?void 0:u["post-operation"])}),[t,e,n,i,a,o,s]),ee.jsxs("div",{className:"flex h-full flex-1 flex-col gap-2 pl-1.5",children:[ee.jsx(XIe,{type:"pre-operation"}),ee.jsx(XIe,{type:"post-operation"})]})},QIe=()=>ee.jsx("div",{className:"border-t py-4 pl-6 pr-4",children:ee.jsx(XIe,{type:"pre-flight"})}),ZIe=e=>{for(const t in e)if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t))throw new TypeError(`Header name must be a valid HTTP token [${t}]`)},ePe=(e,t)=>{const n=JSON.parse(localStorage.getItem("playground:env")||"{}")[t];if(!n)return e;const r={};Object.entries(n).forEach((([e,t])=>{"true"===t||"false"===t?r[e]="true"===t:isNaN(t)||""===t?r[e]=t:r[e]=Number(t)}));for(const i in e){let t=e[i];const n=/{\s*{\s*(\w+)\s*}\s*}/g;"string"==typeof t&&(t=t.replace(n,((e,t)=>void 0!==r[t]?r[t]:(console.warn(`No value found for placeholder: ${t}`),e))),e[i]=t)}return e},tPe=async(e,t)=>{if(e)try{const t=new Function(`\n return (async () => {\n ${e}\n })();\n `);await t()}catch(n){console.error(n)}},nPe=e=>{const t=localStorage.getItem(e);return JSON.parse(t&&"undefined"!==t?t:"{}")},rPe=async(e,t,n,r,i,o)=>{var a;try{const s=o.headers;let l=(null==n?void 0:n.transformHeaders)?n.transformHeaders(s):{...s};if(l=ePe(l,"0"),ZIe(l),e&&t){const t=ky(e,hf(null==(a=JSON.parse(o.body))?void 0:a.query));if(t.length>0){const e={message:"Client-side validation failed. The request was not sent to the Router.",errors:t.map((e=>({message:e.message,path:e.path,locations:e.locations})))},n=new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json"}});return r(await n.clone().json()),n}}const u=JSON.parse(o.body);await(async(e,t)=>{WIe(e,t);const n=nPe("playground:pre-flight:selected"),r=localStorage.getItem("playground:pre-flight:enabled"),i=nPe("playground:pre-operation:selected");r&&"true"!==r||await tPe(n.content),i.enabled&&await tPe(i.content),GIe()})("0",u);const c=await fetch(i,{...o,headers:l}),p=await c.clone().json();return await(async(e,t,n)=>{const r=localStorage.getItem("playground:post-operation:selected"),i=JSON.parse(r&&"undefined"!==r?r:"{}");i.enabled&&(WIe(e,t,n),await tPe(i.content),GIe())})("0",u,p),r(await c.clone().json(),c.status,c.statusText),c}catch(rK){const t="Failed to fetch from router due to network errors. Please check network activity in browser dev tools for more details.",n=new Response(JSON.stringify(rK.message?"Failed to fetch"==rK.message?t:rK.message:t),{headers:{"Content-Type":"application/json"}});return r(await n.clone().json(),void 0,"Network Error"),n}},iPe=()=>{const{view:e,setView:t}=H.useContext(kNe),n=e=>"response"===e?ee.jsx(PTe,{className:"h-4 w-4 flex-shrink-0"}):"request-trace"===e?ee.jsx(ITe,{className:"h-4 w-4 flex-shrink-0"}):ee.jsx(Jv,{className:"h-4 w-4 flex-shrink-0"}),{status:r,statusText:i}=H.useContext(kNe),o=!!r&&r>=200&&r<300;return ee.jsxs("div",{className:"flex items-center gap-x-2",children:[(r||i)&&ee.jsxs(I9,{className:"h-8",variant:o?"success":"destructive",children:[!o&&ee.jsx(Gk,{className:"mr-1 h-4 w-4"}),r||i]}),ee.jsxs(vAe,{onValueChange:e=>{const n=document.getElementsByClassName("graphiql-response")[0],r=document.getElementById("art-visualization"),i=document.getElementById("planner-visualization");n&&r&&i&&("request-trace"===e?(n.classList.add("invisible"),n.classList.add("-z-50"),i.classList.add("invisible"),i.classList.add("-z-50"),r.classList.remove("invisible"),r.classList.remove("-z-50")):"query-plan"===e?(n.classList.add("invisible"),n.classList.add("-z-50"),r.classList.add("invisible"),r.classList.add("-z-50"),i.classList.remove("invisible"),i.classList.remove("-z-50")):(n.classList.remove("invisible"),n.classList.remove("-z-50"),r.classList.add("invisible"),r.classList.add("-z-50"),i.classList.add("invisible"),i.classList.add("-z-50")),t(e))},children:[ee.jsx(xAe,{className:"w-[180px]",children:ee.jsx(bAe,{children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n(e),OF(e)]})})}),ee.jsxs(EAe,{children:[ee.jsx(DAe,{value:"response",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("response"),"Response"]})}),ee.jsx(DAe,{value:"request-trace",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("request-trace"),"Request Trace"]})}),ee.jsx(DAe,{value:"query-plan",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("query-plan"),"Query Plan"]})})]})]})]})},oPe=()=>{const{clientValidationEnabled:e,setClientValidationEnabled:t}=H.useContext(Zne);return ee.jsxs(Lne,{delayDuration:100,children:[ee.jsx(Mne,{asChild:!0,children:ee.jsx(DA,{onClick:()=>t(!e),variant:"ghost",size:"icon",className:"graphiql-toolbar-button",children:ee.jsx(OTe,{className:ed("graphiql-toolbar-icon",{"text-success":e})})})}),ee.jsx(Rne,{className:"rounded-md border bg-background px-2 py-1 !text-foreground text-base",children:e?"Client-side validation enabled":"Client-side validation disabled"})]})},aPe=()=>{const e=document.getElementById("response-toolbar"),t=document.getElementById("art-visualization"),n=document.getElementById("planner-visualization"),r=document.getElementById("toggle-client-validation"),i=document.getElementById("graphiql-wg-logo"),o=document.getElementById("scripts-section"),a=document.getElementById("pre-flight-script-section");return e&&t&&n&&r&&i&&o&&a?ee.jsxs(ee.Fragment,{children:[lp.createPortal(ee.jsx(iPe,{}),e),lp.createPortal(ee.jsx(TNe,{}),n),lp.createPortal(ee.jsx(tre,{}),t),lp.createPortal(ee.jsx(oPe,{}),r),lp.createPortal(ee.jsx(JIe,{}),o),lp.createPortal(ee.jsx(QIe,{}),a),lp.createPortal(ee.jsx("a",{href:"https://wundergraph.com",children:ee.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1080 1080",className:"mt-3 mx-auto",width:"35",height:"35",fill:"none",children:ee.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M447.099 231.913C405.967 244.337 367.742 264.878 334.682 292.323C320.832 268.71 298.796 251.002 272.754 242.557C313.865 205.575 362.202 177.525 414.709 160.178C467.216 142.832 522.751 136.567 577.803 141.781C632.855 146.994 686.227 163.571 734.544 190.465C746.769 197.27 758.603 204.698 770.004 212.711C770.394 212.542 770.785 212.376 771.179 212.213C785.976 206.085 802.259 204.482 817.967 207.607C833.676 210.733 848.105 218.446 859.429 229.771C870.754 241.096 878.465 255.525 881.589 271.233C884.712 286.941 883.107 303.223 876.976 318.018C870.845 332.814 860.464 345.459 847.146 354.355C833.828 363.252 818.171 367.999 802.154 367.997C791.52 367.997 780.991 365.902 771.167 361.833C761.343 357.763 752.417 351.799 744.898 344.28C737.379 336.76 731.415 327.834 727.347 318.01C723.279 308.186 721.186 297.657 721.187 287.024C721.187 282.871 721.506 278.742 722.135 274.672C713.657 268.849 704.889 263.426 695.859 258.426C658.269 237.612 616.889 224.541 574.163 219.988C531.437 215.434 488.232 219.489 447.099 231.913ZM319.489 348.564C319.489 363.809 315.185 378.728 307.094 391.613L323.693 420.326C307.59 439.476 285.501 452.638 260.995 457.683L244.582 429.298C237.31 429.844 229.959 429.408 222.73 427.971C207.024 424.848 192.597 417.138 181.273 405.816C169.949 394.495 162.237 380.069 159.112 364.365C155.986 348.661 157.588 332.382 163.715 317.588C169.841 302.794 180.217 290.149 193.531 281.251C206.845 272.354 222.498 267.604 238.511 267.601C249.145 267.6 259.674 269.693 269.499 273.761C279.324 277.829 288.251 283.793 295.77 291.311C303.29 298.829 309.255 307.755 313.325 317.578C317.394 327.402 319.489 337.931 319.489 348.564ZM260.998 457.685L400.599 699.132L442.692 772.036L484.794 699.132L537.279 608.237L589.621 698.805L631.691 771.687L673.783 698.794L744.391 576.462H859.708C861.079 564.36 861.767 552.19 861.769 540.01C861.771 527.83 861.08 515.66 859.697 503.558H702.288L694.971 516.229L631.67 625.857L579.327 535.278L537.235 462.374L495.208 535.289L442.692 626.184L323.7 420.328C307.596 439.478 285.506 452.64 260.998 457.685ZM861.77 540.003C861.768 552.183 861.08 564.353 859.709 576.455H937.128V503.551H859.709C861.088 515.653 861.776 527.823 861.77 540.003ZM937.154 503.558H938.332C939.411 515.563 940 527.721 940 540.01C940 760.902 760.967 940 540.027 940C319.088 940 140 760.924 140 540.031C139.942 500.879 145.66 461.933 156.968 424.449C175.493 444.394 200.696 456.845 227.794 459.44C221.851 485.163 218.231 515.061 218.231 540.01C218.231 717.668 362.259 861.764 540.038 861.764C705.462 861.764 841.629 736.99 859.731 576.462H937.154V503.558Z",className:"fill-foreground"})})}),i)]}):null};const sPe=e=>{const t=e.routingUrl||function(e,t,n){let r=e;return r.endsWith(n)?r=r.slice(0,-n.length):r.endsWith(n+"/")&&(r=r.slice(0,-n.length-1)),r=r.replace(/\/+$/,""),r+(t.startsWith("/")?t:`/${t}`)}(window.location.href,"{{graphqlURL}}","{{playgroundPath}}"),[n,r]=H.useState(!1),[i,o]=H.useState("response"),[a,s]=H.useState(null),[l,u]=H.useState(void 0),[c,p]=MNe("graphiql:headers","",{deserializer:e=>e,serializer:e=>e}),[d,f]=H.useState();H.useEffect((()=>{c&&!d&&f(c)}),[c,d]),H.useEffect((()=>{d&&p(d)}),[d]);const[h,m]=H.useState('{\n "X-WG-TRACE" : "true"\n}'),[g,y]=H.useState(""),[v,b]=H.useState(void 0),[x,E]=H.useState(""),[D,w]=H.useState(!0);H.useEffect((()=>{if(document.getElementById("response-toolbar")&&n)return;const t=document.getElementsByClassName("graphiql-sidebar-section")[0];if(t&&!e.hideLogo){const e=document.createElement("div");e.id="graphiql-wg-logo",t.prepend(e)}const i=document.getElementsByClassName("graphiql-session-header-right")[0];if(i){const e=document.getElementsByClassName("graphiql-logo")[0];if(e){e.classList.add("hidden");const t=document.createElement("div");t.id="response-toolbar",t.className="flex items-center justify-center mx-2",i.append(t)}}const o=document.getElementsByClassName("graphiql-editor-tools")[0],a=document.getElementsByClassName("graphiql-editor-tool")[0];if(o&&a&&!document.getElementById("scripts-tab")){const e=[o.childNodes[0],o.childNodes[1]],t=Array.from(a.childNodes),n=document.createElement("button");n.id="scripts-tab",n.className="graphiql-un-styled",n.textContent="Operation Scripts";const r=document.createElement("div");r.id="scripts-section",r.className="graphiql-editor hidden",e.forEach(((e,n)=>e.addEventListener("click",(()=>{e.className="graphiql-un-styled active",t[n].className="graphiql-editor",r.className="graphiql-editor hidden"})))),n.onclick=i=>{e[0].className="graphiql-un-styled",e[1].className="graphiql-un-styled",t[0].className="graphiql-editor hidden",t[1].className="graphiql-editor hidden",r.className="graphiql-editor",n.className="graphiql-un-styled active"},o.addEventListener("click",(e=>{var t;(null==(t=e.target)?void 0:t.closest(`#${n.id}`))||(n.className="graphiql-un-styled")})),o.insertBefore(n,o.childNodes[2]),a.appendChild(r)}const s=document.getElementsByClassName("graphiql-editors")[0];if(s){const e=document.createElement("div");e.id="pre-flight-script-section",s.appendChild(e)}const l=document.getElementsByClassName("graphiql-response")[0];if(l){const e=l.parentElement;if(e){e.id="response-parent",e.classList.add("relative");const t=document.createElement("div");t.id="art-visualization",t.className="flex flex-1 h-full w-full absolute invisible -z-50";const n=document.createElement("div");n.id="planner-visualization",n.className="flex flex-1 h-full w-full absolute invisible -z-50",e.append(t),e.append(n)}}const u=document.getElementsByClassName("graphiql-toolbar")[0];if(u){const e=document.createElement("div");e.id="toggle-client-validation",u.append(e)}r(!0)}));H.useEffect((()=>{(async()=>{const n=e.fetch?e.fetch:fetch,r=await n(t,{body:JSON.stringify({operationName:"IntrospectionQuery",query:ev()}),method:"POST",headers:JSON.parse(h)});s(nv((await r.json()).data))})()}),[h]);const[C,S]=H.useState(),[T,k]=H.useState(),A=H.useMemo((()=>{const n=(e,t,n)=>{y(JSON.stringify(e)),S(t),k(n)};return Xre({url:t,subscriptionUrl:window.location.protocol.replace("http","ws")+"//"+window.location.host+t,fetch:(...t)=>rPe(a,D,e.scripts,n,t[0],t[1])})}),[a,D]),[N]=FNe(l,300),[_]=FNe(h,300);H.useEffect((()=>{(async()=>{var e;if(a&&N&&t&&"query-plan"===i)try{const n=hf(N);if(ky(a,n).length>0)return void E("Invalid query");const r=JSON.parse(_||"{}");delete r["X-WG-TRACE"];let i={...r,"X-WG-Include-Query-Plan":"true","X-WG-Skip-Loader":"true","X-WG-DISABLE-TRACING":"true"};i=ePe(i,"0"),ZIe(i);const o=await fetch(t,{method:"POST",headers:i,body:JSON.stringify({query:N})}),s=await o.json();if(!(null==(e=null==s?void 0:s.extensions)?void 0:e.queryPlan))throw new Error("No query plan found");E(""),b(s.extensions.queryPlan)}catch(n){b(void 0),E(n.message||"Network error")}})()}),[N,_,t,a,i]);const[F,I]=H.useState({activeTabIndex:0,tabs:[]});return ee.jsx(One,{children:ee.jsx(kNe.Provider,{value:{graphId:"0",tabsState:F,status:C,statusText:T,view:i,setView:o},children:ee.jsxs(Zne.Provider,{value:{query:l,headers:h,response:g,subgraphs:[],plan:v,planError:x,clientValidationEnabled:D,setClientValidationEnabled:w,forcedTheme:e.theme},children:[ee.jsx(DTe,{shouldPersistHeaders:!0,showPersistHeadersSettings:!1,fetcher:A,onEditQuery:u,defaultHeaders:'{\n "X-WG-TRACE" : "true"\n}',onEditHeaders:m,onTabChange:I,plugins:[bTe({showAttribution:!1})],forcedTheme:e.theme}),n&&ee.jsx(aPe,{})]})})})};function lPe(){return ee.jsx(sPe,{})}te.createRoot(document.getElementById("root")).render(ee.jsx(q.StrictMode,{children:ee.jsx(lPe,{})}));var uPe=Object.defineProperty,cPe=(e,t)=>uPe(e,"name",{value:t,configurable:!0});typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"&&self;function pPe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}cPe(pPe,"getDefaultExportFromCjs");var dPe,fPe={exports:{}};function hPe(){return dPe||(dPe=1,fPe.exports=function(){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),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),p=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),y=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),v=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),E=p&&e.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(p=!1,l=!0);var D=v&&(u||p&&(null==E||E<12.11)),w=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}cPe(C,"classTest");var S,T=cPe((function(e,t){var n=e.className,r=C(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:"")}}),"rmClass");function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return k(e).appendChild(t)}function N(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?L=cPe((function(e){e.selectionStart=0,e.selectionEnd=e.value.length}),"selectInput"):a&&(L=cPe((function(e){try{e.select()}catch{}}),"selectInput")),cPe(M,"bind"),cPe(R,"copyObj"),cPe(B,"countColumn");var j=cPe((function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)}),"Delayed");function V(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}cPe(W,"findColumn");var G=[""];function K(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}cPe(te,"isWordCharBasic"),cPe(ne,"isWordChar"),cPe(re,"isEmpty");var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}cPe(oe,"isExtendingChar"),cPe(ae,"skipExtendingChars"),cPe(se,"findFirst"),cPe(le,"iterateBidiSections");var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return r??ue}cPe(ce,"getBidiPartAt");var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(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":8204==n?"b":"L"}cPe(n,"charType");var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return cPe(l,"BidiSpan"),function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,p=[],d=0;d-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ee(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function De(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){De(e),we(e)}function Te(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),v&&e.ctrlKey&&1==t&&(t=3),t}cPe(me,"getHandlers"),cPe(ge,"off"),cPe(ye,"signal"),cPe(ve,"signalDOMEvent"),cPe(be,"signalCursorActivity"),cPe(xe,"hasHandler"),cPe(Ee,"eventMixin"),cPe(De,"e_preventDefault"),cPe(we,"e_stopPropagation"),cPe(Ce,"e_defaultPrevented"),cPe(Se,"e_stop"),cPe(Te,"e_target"),cPe(ke,"e_button");var Ae,Ne,_e=function(){if(a&&s<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Fe(e){if(null==Ae){var t=N("span","​");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ae?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ie(e){if(null!=Ne)return Ne;var t=A(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return k(e),!(!n||n.left==n.right)&&(Ne=r.right-n.right<3)}cPe(Fe,"zeroWidthElement"),cPe(Ie,"hasBadBidiRects");var Pe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=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)&&0!=t.compareEndPoints("StartToEnd",t)},Le=function(){var e=N("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Me=null;function Re(e){if(null!=Me)return Me;var t=A(e,N("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return Me=Math.abs(n.left-r.left)>1}cPe(Re,"hasBadZoomedRects");var Be={},je={};function Ve(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function ze(e,t){je[e]=t}function $e(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=$e(t);var n=Be[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(He.hasOwnProperty(t.name)){var i=He[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}cPe(Ve,"defineMode"),cPe(ze,"defineMIME"),cPe($e,"resolveMode"),cPe(Ue,"getMode");var He={};function qe(e,t){R(t,He.hasOwnProperty(e)?He[e]:He[e]={})}function We(e,t){if(!0===t)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 Ge(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}cPe(qe,"extendMode"),cPe(We,"copyState"),cPe(Ge,"innerMode"),cPe(Ke,"startState");var Ye=cPe((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");function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new 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],o=i.chunkSize();if(t=e.first&&tn?it(n,Xe(e,n).text.length):dt(t,Xe(e,t.line).text.length)}function dt(e,t){var n=e.ch;return null==n||n>t?it(e.line,t):n<0?it(e.line,0):e}function ft(e,t){for(var n=[],r=0;r=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=cPe((function(e){return n?e.toLowerCase():e}),"cased");if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},cPe(Xe,"getLine"),cPe(Je,"getBetween"),cPe(Qe,"getLines"),cPe(Ze,"updateLineHeight"),cPe(et,"lineNo"),cPe(tt,"lineAtHeight"),cPe(nt,"isLine"),cPe(rt,"lineNumberFor"),cPe(it,"Pos"),cPe(ot,"cmp"),cPe(at,"equalCursorPos"),cPe(st,"copyPos"),cPe(lt,"maxPos"),cPe(ut,"minPos"),cPe(ct,"clipLine"),cPe(pt,"clipPos"),cPe(dt,"clipToLen"),cPe(ft,"clipPosArray");var ht=cPe((function(e,t){this.state=e,this.lookAhead=t}),"SavedContext"),mt=cPe((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");function gt(e,t,n,r){var i=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=cPe((function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,St(e,t.text,s.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&We(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Tt(e,t,n),a=o>r.first&&Xe(r,o-1).stateAfter,s=a?mt.fromSaved(r,a,o):new mt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){bt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.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}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof ht?new mt(e,We(e.mode,t.state),n,t.lookAhead):new mt(e,We(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ht(t,this.maxLookAhead):t},cPe(gt,"highlightLine"),cPe(yt,"getLineStyles"),cPe(vt,"getContextBefore"),cPe(bt,"processLine"),cPe(xt,"callBlankLine"),cPe(Et,"readToken");var Dt=cPe((function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n}),"Token");function wt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Xe(a,(t=pt(a,t)).line),u=vt(e,t.line,n),c=new Ye(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&bt(e,t,r,p.pos),p.pos=t.length,l=null):l=Ct(Et(n,p,r.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Xe(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ht?u.lookAhead:0)<=o.modeFrontier))return s;var c=B(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function kt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Xe(e,r).stateAfter;if(i&&(!(i instanceof ht)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new It(a,o.from,s?null:o.to))}}return r}function Rt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var c=[l,1],p=ot(u.from,s.from),d=ot(u.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&c.push({from:u.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function zt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,r,i){var o=Xe(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ot(u.to,n)>=0:ot(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ot(u.from,r)<=0:ot(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Gt(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Zt(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function en(e,t){var n=Xe(e,t),r=Jt(n);return n==r?t:et(r)}function tn(e,t){if(t>e.lastLine())return t;var n,r=Xe(e,t);if(!nn(e,r))return t;for(;n=Kt(r);)r=n.find(1,!0).line;return et(r)+1}function nn(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}cPe(_t,"seeReadOnlySpans"),cPe(Ft,"seeCollapsedSpans"),cPe(It,"MarkedSpan"),cPe(Pt,"getMarkedSpanFor"),cPe(Ot,"removeMarkedSpan"),cPe(Lt,"addMarkedSpan"),cPe(Mt,"markedSpansBefore"),cPe(Rt,"markedSpansAfter"),cPe(Bt,"stretchSpansOverChange"),cPe(jt,"clearEmptySpans"),cPe(Vt,"removeReadOnlyRanges"),cPe(zt,"detachMarkedSpans"),cPe($t,"attachMarkedSpans"),cPe(Ut,"extraLeft"),cPe(Ht,"extraRight"),cPe(qt,"compareCollapsedMarkers"),cPe(Wt,"collapsedSpanAtSide"),cPe(Gt,"collapsedSpanAtStart"),cPe(Kt,"collapsedSpanAtEnd"),cPe(Yt,"collapsedSpanAround"),cPe(Xt,"conflictingCollapsedRange"),cPe(Jt,"visualLine"),cPe(Qt,"visualLineEnd"),cPe(Zt,"visualLineContinued"),cPe(en,"visualLineNo"),cPe(tn,"visualLineEndNo"),cPe(nn,"lineIsHidden"),cPe(rn,"lineIsHiddenInner"),cPe(on,"heightAtLine"),cPe(an,"lineLength"),cPe(sn,"findMaxLine");var ln=cPe((function(e,t,n){this.text=e,$t(this,t),this.height=n?n(this):1}),"Line");function un(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),zt(e),$t(e,n);var i=r?r(e):1;i!=e.height&&Ze(e,i)}function cn(e){e.parent=null,zt(e)}ln.prototype.lineNo=function(){return et(this)},Ee(ln),cPe(un,"updateLine"),cPe(cn,"cleanUpLine");var pn={},dn={};function fn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?dn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function hn(e,t){var n=_("span",null,null,l?"padding-right: .1px":null),r={pre:_("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 o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=gn,Ie(e.display.measure)&&(a=de(o,e.doc.direction))&&(r.addToken=vn(r.addToken,a)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&et(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=O(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=O(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Fe(e.display.measure))),0==i?(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(l){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 ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=O(r.pre.className,r.textClass||"")),r}function mn(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,p=e.cm.state.specialChars,d=!1;if(p.test(t)){u=document.createDocumentFragment();for(var f=0;;){p.lastIndex=f;var h=p.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));a&&s<9?u.appendChild(N("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var y=void 0;if("\t"==h[0]){var v=e.cm.options.tabSize,b=v-e.col%v;(y=u.appendChild(N("span",K(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((y=u.appendChild(N("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((y=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?u.appendChild(N("span",[y])):u.appendChild(y),e.col+=1);e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||d||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var E=N("span",[u],x,o);if(l)for(var D in l)l.hasOwnProperty(D)&&"style"!=D&&"class"!=D&&E.setAttribute(D,l[D]);return e.content.appendChild(E)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&p.from<=u);d++);if(p.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,p.to-u),i,o,null,s,l),o=null,r=r.slice(p.to-u),u=p.to}}}function bn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,p,d,f=i.length,h=0,m=1,g="",y=0;;){if(y==h){l=u=c=s="",d=null,p=null,y=1/0;for(var v=[],b=void 0,x=0;xh||D.collapsed&&E.to==h&&E.from==h)){if(null!=E.to&&E.to!=h&&y>E.to&&(y=E.to,u=""),D.className&&(l+=" "+D.className),D.css&&(s=(s?s+";":"")+D.css),D.startStyle&&E.from==h&&(c+=" "+D.startStyle),D.endStyle&&E.to==y&&(b||(b=[])).push(D.endStyle,E.to),D.title&&((d||(d={})).title=D.title),D.attributes)for(var w in D.attributes)(d||(d={}))[w]=D.attributes[w];D.collapsed&&(!p||qt(p.marker,D)<0)&&(p=E)}else E.from>h&&y>E.from&&(y=E.from)}if(b)for(var C=0;C=f)break;for(var T=Math.min(f,y);;){if(g){var k=h+g.length;if(!p){var A=k>T?g.slice(0,T-h):g;t.addToken(t,A,a?a+l:l,c,h+A.length==y?u:"",s,d)}if(k>=T){g=g.slice(T-h),h=T;break}h=k,c=""}g=i.slice(o,o=n[m++]),a=fn(n[m++],t.cm.options)}}else for(var N=1;N2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Qn(e,t){var n=et(t=Jt(t)),r=e.display.externalMeasured=new En(e.doc,t,n);r.lineN=n;var i=r.built=hn(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}function Zn(e,t,n,r){return nr(e,tr(e,t),n,r)}function er(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function sr(e,t,n,r){var i,o=or(t.map,n,r),l=o.node,u=o.start,c=o.end,p=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(p=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Nr(e.display),top:h.top,bottom:h.bottom}:ir}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,y=(m+g)/2,v=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}cPe(c,"getBidi");var p=ce(s,l,u),d=ue,f=c(l,p,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function br(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Xe(e.doc,t.line),i=on(r)+Hn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=it(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Er(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=tt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Xe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(r,i);;){var s=Sr(e,a,i,t,n),l=Yt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Xe(r,i=u.line)}}function Dr(e,t,n,r){r-=hr(t);var i=t.text.length,o=se((function(t){return nr(e,n,t-1).bottom<=r}),i,0);return i=se((function(t){return nr(e,n,t).top>r}),o,i),{begin:o,end:i}}function wr(e,t,n,r){return n||(n=tr(e,t)),Dr(e,t,n,mr(e,t,nr(e,n,r),"line").top)}function Cr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Sr(e,t,n,r,i){i-=on(t);var o=tr(e,t),a=hr(t),s=0,l=t.text.length,u=!0,c=de(t,e.doc.direction);if(c){var p=(e.options.lineWrapping?kr:Tr)(e,t,n,o,c,r,i);s=(u=1!=p.level)?p.from:p.to-1,l=u?p.to:p.from-1}var d,f,h=null,m=null,g=se((function(t){var n=nr(e,o,t);return n.top+=a,n.bottom+=a,!!Cr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),y=!1;if(m){var v=r-m.left=x.bottom?1:0}return xr(n,g=ae(t.text,g,1),f,y,r-d)}function Tr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],u=1!=l.level;return Cr(vr(e,it(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=vr(e,it(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Cr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function kr(e,t,n,r,i,o,a){var s=Dr(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,p=null,d=0;d=u||f.to<=l)){var h=nr(e,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=hm)&&(c=f,p=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Ar(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rr){rr=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(N("br"));rr.appendChild(document.createTextNode("x"))}A(e.measure,rr);var n=rr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),k(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function _r(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Fr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ir(e){var t=Ar(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(nn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xe(e.doc,u.line).text).length==u.ch){var c=B(l,l.length,e.options.tabSize)-l.length;u=it(u.line,Math.max(0,Math.round((o-Wn(e.display).left)/Nr(e.display))-c))}return u}function Lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&en(e.doc,t)i.viewFrom?Br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Br(e);else if(t<=i.viewFrom){var o=jr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Br(e)}else if(n>=i.viewTo){var a=jr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Br(e)}else{var s=jr(e,t,t,-1),l=jr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Dn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Br(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==V(a,n)&&a.push(n)}}}function Br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jr(e,t,n,r){var i,o=Lr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;en(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Vr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Dn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Dn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Lr(e,n)))),r.viewTo=n}function zr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Wr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Wn(e.display),s=a.left,l=Math.max(r.sizerWidth,Kn(e)-r.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(n??l-e)+"px;\n height: "+(r-t)+"px"))}function p(t,n,r){var o,a,p=Xe(i,t),d=p.text.length;function f(n,r){return yr(e,it(t,n),"div",p,r)}function h(t,n,r){var i=wr(e,p,null,t),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}cPe(f,"coords"),cPe(h,"wrapX");var m=de(p,i.direction);return le(m,n||0,r??d,(function(e,t,i,p){var g="ltr"==i,y=f(e,g?"left":"right"),v=f(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==d,E=0==p,D=!m||p==m.length-1;if(v.top-y.top<=3){var w=(u?x:b)&&D,C=(u?b:x)&&E?s:(g?y:v).left,S=w?l:(g?v:y).right;c(C,y.top,S-C,y.bottom)}else{var T,k,A,N;g?(T=u&&b&&E?s:y.left,k=u?l:h(e,i,"before"),A=u?s:h(t,i,"after"),N=u&&x&&D?l:v.right):(T=u?h(e,i,"before"):s,k=!u&&b&&E?l:y.right,A=!u&&x&&D?s:v.left,N=u?h(t,i,"after"):l),c(T,y.top,k-T,y.bottom),y.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xr(e))}function Yr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Gr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||m<-.005)&&(ie.display.sizerWidth){var y=Math.ceil(d/Nr(e.display));y>e.display.maxLineLength&&(e.display.maxLineLength=y,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Zr(e){if(e.widgets)for(var t=0;t=a&&(o=tt(t,on(Xe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ti(e,t){if(!ve(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=N("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Hn(e.display))+"px;\n height: "+(t.bottom-t.top+Gn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ni(e,t,n,r){var i;null==r&&(r=0),!e.options.lineWrapping&&t==n&&(n="before"==t.sticky?it(t.line,t.ch+1,"before"):t,t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=vr(e,t),l=n&&n!=t?vr(e,n):s,u=ii(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=u.scrollTop&&(pi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(fi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function ri(e,t){var n=ii(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&fi(e,n.scrollLeft)}function ii(e,t){var n=e.display,r=Ar(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Yn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,f=Kn(e)-n.gutters.offsetWidth,h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function oi(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ai(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,n){(null!=t||null!=n)&&ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function li(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,ci(e,br(e,t.from),br(e,t.to),t.margin))}function ci(e,t,n,r){var i=ii(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});si(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||$i(e,{top:t}),di(e,t,!0),n&&$i(e),Oi(e,100))}function di(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(!(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||r)&&(e.doc.scrollLeft=t,Wi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function hi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}cPe(or,"nodeAndOffsetInLineMap"),cPe(ar,"getUsefulRect"),cPe(sr,"measureCharInner"),cPe(lr,"maybeUpdateRectForZooming"),cPe(ur,"clearLineMeasurementCacheFor"),cPe(cr,"clearLineMeasurementCache"),cPe(pr,"clearCaches"),cPe(dr,"pageScrollX"),cPe(fr,"pageScrollY"),cPe(hr,"widgetTopHeight"),cPe(mr,"intoCoordSystem"),cPe(gr,"fromCoordSystem"),cPe(yr,"charCoords"),cPe(vr,"cursorCoords"),cPe(br,"estimateCoords"),cPe(xr,"PosWithInfo"),cPe(Er,"coordsChar"),cPe(Dr,"wrappedLineExtent"),cPe(wr,"wrappedLineExtentChar"),cPe(Cr,"boxIsAfter"),cPe(Sr,"coordsCharInner"),cPe(Tr,"coordsBidiPart"),cPe(kr,"coordsBidiPartWrapped"),cPe(Ar,"textHeight"),cPe(Nr,"charWidth"),cPe(_r,"getDimensions"),cPe(Fr,"compensateForHScroll"),cPe(Ir,"estimateHeight"),cPe(Pr,"estimateLineHeights"),cPe(Or,"posFromMouse"),cPe(Lr,"findViewIndex"),cPe(Mr,"regChange"),cPe(Rr,"regLineChange"),cPe(Br,"resetView"),cPe(jr,"viewCuttingPoint"),cPe(Vr,"adjustView"),cPe(zr,"countDirtyView"),cPe($r,"updateSelection"),cPe(Ur,"prepareSelection"),cPe(Hr,"drawSelectionCursor"),cPe(qr,"cmpCoords"),cPe(Wr,"drawSelectionRange"),cPe(Gr,"restartBlink"),cPe(Kr,"ensureFocus"),cPe(Yr,"delayBlurEvent"),cPe(Xr,"onFocus"),cPe(Jr,"onBlur"),cPe(Qr,"updateHeightsInViewport"),cPe(Zr,"updateWidgetHeight"),cPe(ei,"visibleLines"),cPe(ti,"maybeScrollWindow"),cPe(ni,"scrollPosIntoView"),cPe(ri,"scrollIntoView"),cPe(ii,"calculateScrollPos"),cPe(oi,"addToScrollTop"),cPe(ai,"ensureCursorVisible"),cPe(si,"scrollToCoords"),cPe(li,"scrollToRange"),cPe(ui,"resolveScrollToPos"),cPe(ci,"scrollToCoordsRange"),cPe(pi,"updateScrollTop"),cPe(di,"setScrollTop"),cPe(fi,"setScrollLeft"),cPe(hi,"measureForScrollbars");var mi=cPe((function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}),"NativeScrollbars");mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=v&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",cPe(r,"maybeDisable"),t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=cPe((function(){}),"NullScrollbars");function yi(e,t){t||(t=hi(e));var n=e.display.barWidth,r=e.display.barHeight;vi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),vi(e,hi(e)),n=e.display.barWidth,r=e.display.barHeight}function vi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){},cPe(yi,"updateScrollbars"),cPe(vi,"updateScrollbarsInner");var bi={native:mi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new bi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?fi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}cPe(xi,"initScrollbars");var Ei=0;function Di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ei,markArrays:null},Cn(e.curOp)}function wi(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Mi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&Vi(e.cm,e.update)}function ki(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=hi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Kn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ai(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=vt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?We(t.mode,r.state):null,l=gt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!p&&dn)return Oi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&_i(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zr(e))return!1;Gi(e)&&(Br(e),t.dims=_r(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=en(e.doc,o),a=tn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vr(e,o,a),n.viewOffset=on(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=zr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Bi(e);return l>4&&(n.lineDiv.style.display="none"),Ui(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ji(u),k(n.cursorDiv),k(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Oi(e,400)),n.updateLineNumbers=null,!0}function zi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Kn(e))r&&(t.visible=ei(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Yn(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Vi(e,t))break;Qr(e);var i=hi(e);$r(e),yi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function $i(e,t){var n=new Mi(e,t);if(Vi(e,n)){Qr(e),zi(e,n);var r=hi(e);$r(e),yi(e,r),qi(e,r),n.finish()}}function Ui(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&v&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}cPe(s,"rm");for(var u=r.view,c=r.viewFrom,p=0;p-1&&(f=!1),_n(e,d,c,n)),f&&(k(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(rt(e.options,c)))),a=d.node.nextSibling}else{var h=Bn(e,d,c,n);o.insertBefore(h,a)}c+=d.size}for(;a;)a=s(a)}function Hi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",An(e,"gutterChanged",e)}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gn(e)+"px"}function Wi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Fr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;au.clientWidth,d=u.scrollHeight>u.clientHeight;if(i&&c||o&&d){if(o&&v&&l)e:for(var f=t.target,h=s.view;f!=u;f=f.parentNode)for(var m=0;m=0&&ot(e,r.to())<=0)return n}return-1};var io=cPe((function(e,t){this.anchor=e,this.head=t}),"Range");function oo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ot(e.from(),t.from())})),n=V(t,i);for(var o=1;o0:l>=0){var u=ut(s.from(),a.from()),c=lt(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new io(p?c:u,p?u:c))}}return new ro(t,n)}function ao(e,t){return new ro([new io(e,t||e)],0)}function so(e){return e.text?it(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function lo(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=so(t).ch-t.to.ch),it(n,r)}function uo(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}An(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function So(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Co(i,i.lastOp==r)))a=Y(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=so(t):o.changes.push(Do(e,t));else{var l=Y(i.done);for((!l||!l.ranges)&&Ao(e.sel,i.done),o={changes:[Do(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ko(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Ao(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&wo(i.undone)}function Ao(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function _o(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[p]=u[p],delete u[p])}}}return r}function Oo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ot(t,i)<0;o!=ot(n,i)<0?(i=t,t=n):o!=ot(t,n)<0&&(t=n)}return new io(i,t)}return new io(n||t,t)}function Lo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),zo(e,new ro([Oo(e.sel.primary(),t,n,i)],0),r)}function Mo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(r<0?1:-1),d=void 0;if((r<0?c:u)&&(p=Ko(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(d=ot(p,n))&&(r<0?d<0:d>0))return Wo(e,p,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=Ko(e,f,r,f.line==t.line?o:null)),f?Wo(e,f,t,r,i):null}}return t}function Go(e,t,n,r,i){var o=r||1;return Wo(e,t,n,o,i)||!i&&Wo(e,t,n,o,!0)||Wo(e,t,n,-o,i)||!i&&Wo(e,t,n,-o,!0)||(e.cantEdit=!0,it(e.first,0))}function Ko(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,it(t.line-1)):null:n>0&&t.ch==(r||Xe(e,t.line)).text.length?t.line=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var n=uo(e,t);So(e,t,n,e.cm?e.cm.curOp.id:NaN),ta(e,t,n,Bt(e,t));var r=[];yo(e,(function(e,n){!n&&-1==V(r,e.history)&&(aa(e.history,t),r.push(e.history)),ta(e,t,null,Bt(e,t))}))}}function Zo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--f){var h=d(f);if(h)return h.v}}}}function ea(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(X(e.sel.ranges,(function(e){return new io(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:it(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=uo(e,t)),e.cm?na(e.cm,t,r):go(e,t,r),$o(e,n,U),e.cantEdit&&Go(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function na(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=et(Jt(Xe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Ir(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=an(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),kt(r,o.line),Oi(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Mr(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?Mr(e,o.line,a.line+1,u):Rr(e,o.line,"text");var c=xe(e,"changes"),p=xe(e,"change");if(p||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&An(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function ra(e,t,n,r,i){var o;r||(r=n),ot(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function ia(e,t,n,r){n1||!(this.children[0]instanceof la))){var s=[];this.collapse(s),this.children=[new la(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ft()}o.addToHistory&&So(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Jt(r)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ze(r,0),Lt(r,new It(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){nn(e,t)&&Ze(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(_t(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Mr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Rr(u,c,"text");o.atomic&&Ho(u.doc),An(u,"markerAdded",u,o)}return o}ha.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),xe(this,"clear")){var n=this.find();n&&An(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Mr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ho(e.doc)),e&&An(e,"markerCleared",e,this,r,i),t&&wi(e),this.parent&&this.parent.clear()}},ha.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i=0;l--)Jo(this,r[l]);s?Vo(this,s):this.cm&&ai(this.cm)})),undo:Pi((function(){Zo(this,"undo")})),redo:Pi((function(){Zo(this,"redo")})),undoSelection:Pi((function(){Zo(this,"undo",!0)})),redoSelection:Pi((function(){Zo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch)&&(!n||n(l.marker))&&r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,it(n,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),$o(t.doc,ao(n,n)),d)for(var f=0;f=0;t--)ra(e.doc,"",r[t].from,r[t].to,"+delete");ai(e)}))}function Wa(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ga(e,t,n){var r=Wa(e,t.ch,n);return null==r?null:new it(t.line,r,n<0?"after":"before")}function Ka(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=de(n,t.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=tr(t,n);a=i<0?n.text.length-1:0;var c=nr(t,u,a).top;a=se((function(e){return nr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Wa(n,a,1))}else a=i<0?s.to:s.from;return new it(r,a,l)}}return new it(r,i<0?n.text.length:0,i<0?"before":"after")}function Ya(e,t,n,r){var i=de(t,e.doc.direction);if(!i)return Ga(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&d>=c.begin)){var f=p?"before":"after";return new it(n.line,d,f)}}var h=cPe((function(e,t,r){for(var o=cPe((function(e,t){return t?new it(n.line,l(e,1),"before"):new it(n.line,e,"after")}),"getRes");e>=0&&e0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,u(g)))?null:m}Ra.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ra.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ra.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ra.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ra.default=v?Ra.macDefault:Ra.pcDefault,cPe(Ba,"normalizeKeyName"),cPe(ja,"normalizeKeyMap"),cPe(Va,"lookupKey"),cPe(za,"isModifierKey"),cPe($a,"addModifierNames"),cPe(Ua,"keyName"),cPe(Ha,"getKeyMap"),cPe(qa,"deleteNearSelection"),cPe(Wa,"moveCharLogically"),cPe(Ga,"moveLogically"),cPe(Ka,"endOfLine"),cPe(Ya,"moveVisually");var Xa={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),it(i.line-1,a.length-1),i,"+transpose"))}n.push(new io(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return _i(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ot((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?Es(e,r,t,o):ws(e,r,t,o)}function Es(e,t,n,r){var i=e.display,o=!1,u=Fi(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yr(e)),ge(i.wrapper.ownerDocument,"mouseup",u),ge(i.wrapper.ownerDocument,"mousemove",c),ge(i.scroller,"dragstart",p),ge(i.scroller,"drop",u),o||(De(t),r.addNew||Lo(e.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=cPe((function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10}),"mouseMove"),p=cPe((function(){return o=!0}),"dragStart");l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",p),he(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ds(e,t,n){if("char"==n)return new io(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new io(it(t.line,0),pt(e.doc,it(t.line+1,0)));var r=n(e,t);return new io(r.from,r.to)}function ws(e,t,n,r){a&&Yr(e);var i=e.display,o=e.doc;De(t);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new io(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new io(n,n)),n=Or(e,t,!0,!0),l=-1;else{var p=Ds(e,n,r.unit);s=r.extend?Oo(s,p.anchor,p.head,r.extend):p}r.addNew?-1==l?(l=c.length,zo(o,oo(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(zo(o,oo(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Ro(o,l,s,H):(l=0,zo(o,new ro([s],0),H),u=o.sel);var d=n;function f(t){if(0!=ot(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=B(Xe(o,n.line).text,n.ch,a),p=B(Xe(o,t.line).text,t.ch,a),f=Math.min(c,p),h=Math.max(c,p),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var y=Xe(o,m).text,v=W(y,f,a);f==h?i.push(new io(it(m,v),it(m,v))):y.length>v&&i.push(new io(it(m,v),it(m,W(y,h,a))))}i.length||i.push(new io(n,n)),zo(o,oo(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,E=Ds(e,t,r.unit),D=x.anchor;ot(E.anchor,D)>0?(b=E.head,D=ut(x.from(),E.anchor)):(b=E.anchor,D=lt(x.to(),E.head));var w=u.ranges.slice(0);w[l]=Cs(e,new io(pt(o,D),b)),zo(o,oo(e,w,l),H)}}cPe(f,"extendTo");var h=i.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,a=Or(e,t,!0,"rectangle"==r.unit);if(a)if(0!=ot(a,d)){e.curOp.focus=I(),f(a);var s=ei(i,o);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(Fi(e,(function(){m==n&&(i.scroller.scrollTop+=l,g(t))})),50)}}function y(t){e.state.selectingText=!1,m=1/0,t&&(De(t),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",v),ge(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}cPe(g,"extend"),cPe(y,"done");var v=Fi(e,(function(e){0!==e.buttons&&ke(e)?g(e):y(e)})),b=Fi(e,y);e.state.selectingText=b,he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",b)}function Cs(e,t){var n=t.anchor,r=t.head,i=Xe(e.doc,n.line);if(0==ot(n,r)&&n.sticky==r.sticky)return t;var o=de(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),p=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?p<0:p>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,m=f?"after":"before";return n.ch==h&&n.sticky==m?t:new io(new it(n.line,h,m),r)}function Ss(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&De(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xe(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ye(e,n,e,tt(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function Ts(e,t){return Ss(e,t,"gutterClick",!0)}function ks(e,t){Un(e.display,t)||As(e,t)||ve(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function As(e,t){return!!xe(e,"gutterContextMenu")&&Ss(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}ms.prototype.compare=function(e,t,n){return this.time+hs>e&&0==ot(t,this.pos)&&n==this.button},cPe(gs,"clickRepeat"),cPe(ys,"onMouseDown"),cPe(vs,"handleMappedButton"),cPe(bs,"configureMouse"),cPe(xs,"leftButtonDown"),cPe(Es,"leftButtonStartDrag"),cPe(Ds,"rangeForUnit"),cPe(ws,"leftButtonSelect"),cPe(Cs,"bidiSimplify"),cPe(Ss,"gutterEvent"),cPe(Ts,"clickInGutter"),cPe(ks,"onContextMenu"),cPe(As,"contextMenuInGutter"),cPe(Ns,"themeChanged");var _s={toString:function(){return"CodeMirror.Init"}},Fs={},Is={};function Ps(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=_s&&i(e,t,n)}:i)}cPe(n,"option"),e.defineOption=n,e.Init=_s,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){ho(e),pr(e),Mr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(it(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ra(e.doc,t,n[i],it(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=_s&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Xi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ha(t),i=n!=_s&&Ha(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ls,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Ki(t,e.options.lineNumbers),Xi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Fr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Ki(e.options.gutters,t),Xi(e)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(e){return e}),Xi,!0),n("showCursorWhenSelecting",!1,$r,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Os),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,$r,!0),n("singleCursorHeightPerLine",!0,$r,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ho,!0),n("addModeClass",!1,ho,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,ho,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Os(e,t,n){if(!t!=!(n&&n!=_s)){var r=e.display.dragFunctions,i=t?he:ge;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ls(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Pr(e),Mr(e),pr(e),setTimeout((function(){return yi(e)}),100)}function Ms(e,t){var n=this;if(!(this instanceof Ms))return new Ms(e,t);this.options=t=t?R(t):{},R(Fs,t,!1);var r=t.value;"string"==typeof r?r=new Da(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ms.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Rs(this),_a(),Di(this),this.curOp.forceUpdate=!0,vo(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Is)Is.hasOwnProperty(u)&&Is[u](this,t[u],_s);Gi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}cPe(i,"finishTouch"),cPe(o,"isMouseLikeTouchEvent"),cPe(l,"farAway"),he(t.scroller,"touchstart",(function(i){if(!ve(e,i)&&!o(i)&&!Ts(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new io(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new io(it(a.line,0),pt(e.doc,it(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),De(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),fi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return no(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||Se(t)},over:function(t){ve(e,t)||(Ta(e,t),Se(t))},start:function(t){return Sa(e,t)},drop:Fi(e,Ca),leave:function(t){ve(e,t)||ka(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return cs.call(e,t)})),he(u,"keydown",Fi(e,ls)),he(u,"keypress",Fi(e,ps)),he(u,"focus",(function(t){return Xr(e,t)})),he(u,"blur",(function(t){return Jr(e,t)}))}cPe(Ps,"defineOptions"),cPe(Os,"dragDropChanged"),cPe(Ls,"wrappingChanged"),cPe(Ms,"CodeMirror"),Ms.defaults=Fs,Ms.optionHandlers=Is,cPe(Rs,"registerEventHandlers");var Bs=[];function js(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=vt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),l=B(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==$||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?B(Xe(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var p="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)d+=a,p+="\t";if(da,l=Pe(t),u=null;if(s&&r.ranges.length>1)if(Vs&&Vs.text.join("\n")==t){if(r.ranges.length%Vs.text.length==0){u=[];for(var c=0;c=0;d--){var f=r.ranges[d],h=f.from(),m=f.to();f.empty()&&(n&&n>0?h=it(h.line,h.ch-n):e.state.overwrite&&!s?m=it(m.line,Math.min(Xe(o,m.line).text.length,m.ch+Y(l).length)):s&&Vs&&Vs.lineWise&&Vs.text.join("\n")==l.join("\n")&&(h=m=it(h.line,0)));var g={from:h,to:m,text:u?u[d%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,g),An(e,"inputRead",e,g)}t&&!s&&Hs(e,t),ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Us(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&_i(t,(function(){return $s(t,n,0,null,"paste")})),!0}function Hs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=js(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=js(e,i.head.line,"smart"));a&&An(e,"electricInput",e,i.head.line)}}}function qs(e){for(var t=[],n=[],r=0;rn&&(js(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ai(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Ro(this.doc,r,new io(o,u[r].to()),U)}}})),getTokenAt:function(e,t){return wt(this,e,t)},getLineTokens:function(e,t){return wt(this,it(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Xe(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-on(r):0)},defaultTextHeight:function(){return Ar(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=vr(this,pt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ri(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ii(ls),triggerOnKeyPress:Ii(ps),triggerOnKeyUp:cs,triggerOnMouseDown:Ii(ys),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Ii((function(e){Hs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Pr(this),ye(this,"refresh",this)})),swapDoc:Ii((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),vo(this,e),pr(this),this.display.input.reset(),si(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,An(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ys(e,t,n,r,i){var o=t,a=n,s=Xe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new it(n,t.ch,t.sticky),s=Xe(e,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var p=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new it(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(p?2:1))),-n)}}else a=i?Ya(e.cm,s,t,n):Ga(s,t,n);if(null==a){if(o||!u())return!1;t=Ka(i,e.cm,s,t.line,l)}else t=a;return!0}if(cPe(u,"findNextLine"),cPe(c,"moveOnce"),"char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var p=null,d="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",g=ne(m,f)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(d&&!h&&!g&&(g="s"),p&&p!=g){n<0&&(n=1,c(),t.sticky="after");break}if(g&&(p=g),n>0&&!c(!h))break}var y=Go(e,t,o,a,!0);return at(o,y)&&(y.hitSide=!0),y}function Xs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Ar(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Er(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}cPe(zs,"setLastCopied"),cPe($s,"applyTextInput"),cPe(Us,"handlePaste"),cPe(Hs,"triggerElectric"),cPe(qs,"copyableRanges"),cPe(Ws,"disableBrowserMagic"),cPe(Gs,"hiddenTextarea"),cPe(Ks,"addEditorMethods"),cPe(Ys,"findPosH"),cPe(Xs,"findPosV");var Js=cPe((function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}),"ContentEditableInput");function Qs(e,t){var n=er(e,t.line);if(!n||n.hidden)return null;var r=Xe(e.doc,t.line),i=Jn(n,r,t.line),o=de(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=or(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Zs(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function el(e,t){return t&&(e.bad=!0),e}function tl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function p(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void p(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(it(r,0),it(i+1,0),u(+f));return void(h.length&&(o=h[0].find(0))&&p(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=it(a.line-1,Xe(r.doc,a.line-1).length)),s.ch==Xe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Lr(r,a.line))?(t=et(i.view[0].line),n=i.view[0].node):(t=et(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Lr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=et(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(tl(r,n,u,t,l)),d=Je(r.doc,it(t,0),it(l,Xe(r.doc,l).text.length));p.length>1&&d.length>1;)if(Y(p)==Y(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),t++}for(var f=0,h=0,m=p[0],g=d[0],y=Math.min(m.length,g.length);fa.ch&&v.charCodeAt(v.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=v.slice(0,v.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var E=it(t,f),D=it(l,d.length?Y(d).length-h:0);return p.length>1||p[0]||ot(E,D)?(ra(r.doc,p,E,D,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&_i(this.cm,(function(){return Mr(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Fi(this.cm,$s)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0,cPe(Qs,"posToDOM"),cPe(Zs,"isInGutter"),cPe(el,"badPos"),cPe(tl,"domTextBetween"),cPe(nl,"domToPos"),cPe(rl,"locateNodeInLineView");var il=cPe((function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null}),"TextareaInput");function ol(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(cPe(r,"save"),e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone&&"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Ms((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function al(e){e.off=ge,e.on=he,e.wheelEventPixels=to,e.Doc=Da,e.splitLines=Pe,e.countColumn=B,e.findColumn=W,e.isWordChar=te,e.Pass=$,e.signal=ye,e.Line=ln,e.changeEnd=so,e.scrollbarModel=bi,e.Pos=it,e.cmpPos=ot,e.modes=Be,e.mimeModes=je,e.resolveMode=$e,e.getMode=Ue,e.modeExtensions=He,e.extendMode=qe,e.copyState=We,e.startState=Ke,e.innerMode=Ge,e.commands=Xa,e.keyMap=Ra,e.keyName=Ua,e.isModifierKey=za,e.lookupKey=Va,e.normalizeKeyMap=ja,e.StringStream=Ye,e.SharedTextMarker=ga,e.TextMarker=ha,e.LineWidget=ca,e.e_preventDefault=De,e.e_stopPropagation=we,e.e_stop=Se,e.addClass=P,e.contains=F,e.rmClass=T,e.keyNames=Pa}il.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ve(r,e)){if(r.somethingSelected())zs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);zs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),L(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){ve(r,e)||Us(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),cPe(o,"prepareCopyCut"),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!Un(e,t)&&!ve(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){Un(e,t)||De(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},il.prototype.createField=function(e){this.wrapper=Gs(),this.textarea=this.wrapper.firstChild},il.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},il.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ur(e);if(e.options.moveInputWithCursor){var i=vr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},il.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},il.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&L(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},il.prototype.getField=function(){return this.textarea},il.prototype.supportsTouch=function(){return!1},il.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||I()!=this.textarea))try{this.textarea.focus()}catch{}},il.prototype.blur=function(){this.textarea.blur()},il.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},il.prototype.receivedFocus=function(){this.slowPoll()},il.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},il.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,cPe(n,"p"),t.polling.set(20,n)},il.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||v&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203==o&&!r&&(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},il.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},il.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},il.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Or(n,e),u=r.scroller.scrollTop;if(o&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Fi(n,zo)(n.doc,ao(o),U);var c,d=i.style.cssText,f=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),cPe(g,"prepareSelectAllHack"),cPe(y,"rehide"),a&&s>=9&&g(),w){Se(e);var m=cPe((function(){ge(window,"mouseup",m),setTimeout(y,20)}),"mouseup");he(window,"mouseup",m)}else setTimeout(y,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=cPe((function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Fi(n,Yo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())}),"poll");r.detectingSelectAll=setTimeout(o,200)}}},il.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},il.prototype.setUneditable=function(){},il.prototype.needsContentAttribute=!1,cPe(ol,"fromTextArea"),cPe(al,"addLegacyProps"),Ps(Ms),Ks(Ms);var sl="iter insert remove copy getEditor constructor".split(" ");for(var ll in Da.prototype)Da.prototype.hasOwnProperty(ll)&&V(sl,ll)<0&&(Ms.prototype[ll]=function(e){return function(){return e.apply(this.doc,arguments)}}(Da.prototype[ll]));return Ee(Da),Ms.inputStyles={textarea:il,contenteditable:Js},Ms.defineMode=function(e){!Ms.defaults.mode&&"null"!=e&&(Ms.defaults.mode=e),Ve.apply(this,arguments)},Ms.defineMIME=ze,Ms.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ms.defineMIME("text/plain","null"),Ms.defineExtension=function(e,t){Ms.prototype[e]=t},Ms.defineDocExtension=function(e,t){Da.prototype[e]=t},Ms.fromTextArea=ol,al(Ms),Ms.version="5.65.3",Ms}()),fPe.exports}cPe(hPe,"requireCodemirror");var mPe=Object.defineProperty;function gPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{mPe(e,"name",{value:t,configurable:!0})})(gPe,"_mergeNamespaces");var yPe=hPe();const vPe=pPe(yPe),bPe=gPe({__proto__:null,default:vPe},[yPe]),xPe=Object.freeze(Object.defineProperty({__proto__:null,C:vPe,c:bPe},Symbol.toStringTag,{value:"Module"}));var EPe=Object.defineProperty,DPe=(e,t)=>EPe(e,"name",{value:t,configurable:!0});function wPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}DPe(wPe,"_mergeNamespaces");!function(e){var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=a(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;id.clientHeight+1;if(setTimeout((function(){F=a.getScrollInfo()})),I.bottom-_>0){var O=I.bottom-I.top;if(x.top-(x.bottom-I.top)-O>0)d.style.top=(D=x.top-O-S)+"px",w=!1;else if(O>_){d.style.height=_-5+"px",d.style.top=(D=x.bottom-I.top-S)+"px";var L=a.getCursor();i.from.ch!=L.ch&&(x=a.cursorCoords(L),d.style.left=(E=x.left-C)+"px",I=d.getBoundingClientRect())}}var M,R=I.right-N;if(P&&(R+=a.display.nativeBarWidth),R>0&&(I.right-I.left>N&&(d.style.width=N-5+"px",R-=I.right-I.left-N),d.style.left=(E=x.left-R-C)+"px"),P)for(var B=d.firstChild;B;B=B.nextSibling)B.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=l(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){M=setTimeout((function(){r.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(M)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();F||(F=a.getScrollInfo());var n=D+F.top-e.top,i=n-(p.pageYOffset||(c.documentElement||c.body).scrollTop);if(w||(i+=d.offsetHeight),i<=t.top||i>=t.bottom)return r.close();d.style.top=n+"px",d.style.left=E+F.left-e.left+"px"}),e.on(d,"dblclick",(function(e){var t=u(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(d,"click",(function(e){var t=u(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())})),e.on(d,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var j=this.getSelectedHintRange();return(0!==j.from||0!==j.to)&&this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],d.childNodes[this.selectedHint]),!0}function p(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):o(i+1)}))}DPe(o,"run"),o(0)}),"resolved");return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}r.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],i=this;this.cm.operation((function(){r.hint?r.hint(i.cm,t,r):i.cm.replaceRange(s(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},DPe(p,"applicableHelpers"),DPe(d,"fetchHints"),DPe(f,"resolveAutoHints"),e.registerHelper("hint","auto",{resolve:f}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(hPe());var CPe={};const SPe=wPe({__proto__:null,default:pPe(CPe)},[CPe]),TPe=Object.freeze(Object.defineProperty({__proto__:null,s:SPe},Symbol.toStringTag,{value:"Module"}));var kPe,APe=Object.defineProperty,NPe=(e,t)=>APe(e,"name",{value:t,configurable:!0}),_Pe={exports:{}};function FPe(){return kPe||(kPe=1,function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),l=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=i(o),p=!u&&l>=0&&c.test(s.text.charAt(l))&&r[s.text.charAt(l)]||c.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!p)return null;var d=">"==p.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(n(t.line,l+1)),h=a(e,n(t.line,l+(d>0?1:0)),d,f,o);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==p.charAt(0),forward:d>0}}function a(e,t,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,c=[],p=i(s),d=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),f=t.line;f!=d;f+=o){var h=e.getLine(f);if(h){var m=o>0?0:h.length-1,g=o>0?h.length:-1;if(!(h.length>l))for(f==t.line&&(m=t.ch-(o<0?1:0));m!=g;m+=o){var y=h.charAt(m);if(p.test(y)&&(void 0===a||(e.getTokenTypeAt(n(f,m+1))||"")==(a||""))){var v=r[y];if(v&&">"==v.charAt(1)==o>0)c.push(y);else{if(!c.length)return{pos:n(f,m),ch:y};c.pop()}}}}}return f-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,l=[],u=e.listSelections(),c=0;cr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{IPe(e,"name",{value:t,configurable:!0})})(PPe,"_mergeNamespaces");var OPe=FPe();const LPe=PPe({__proto__:null,default:pPe(OPe)},[OPe]),MPe=Object.freeze(Object.defineProperty({__proto__:null,m:LPe},Symbol.toStringTag,{value:"Module"}));var RPe=Object.defineProperty,BPe=(e,t)=>RPe(e,"name",{value:t,configurable:!0});function jPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}BPe(jPe,"_mergeNamespaces");!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))})),BPe(r,"getOption");var i={Backspace:l,Enter:u};function o(e){for(var t=0;t=0;l--){var c=a[l].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function u(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function p(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function d(t,i){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),l=a.indexOf(i);if(-1==l)return e.Pass;for(var u,d=r(o,"closeBefore"),f=r(o,"triples"),m=a.charAt(l+1)==i,g=t.listSelections(),y=l%2==0,v=0;v1&&f.indexOf(i)>=0&&t.getRange(n(E.line,E.ch-2),E)==i+i){if(E.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(E.line,E.ch-2))))return e.Pass;b="addFour"}else if(m){var w=0==E.ch?" ":t.getRange(n(E.line,E.ch-1),E);if(e.isWordChar(D)||w==i||e.isWordChar(w))return e.Pass;b="both"}else{if(!y||!(0===D.length||/\s/.test(D)||d.indexOf(D)>-1))return e.Pass;b="both"}else b=m&&h(t,E)?"both":f.indexOf(i)>=0&&t.getRange(E,n(E.line,E.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=b)return e.Pass}else u=b}var C=l%2?a.charAt(l-1):i,S=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==u)c(t,1);else if("skipThree"==u)c(t,3);else if("surround"==u){for(var e=t.getSelections(),n=0;nUPe(e,"name",{value:t,configurable:!0});function qPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}HPe(qPe,"_mergeNamespaces");!function(e){function t(t){return function(n,r){var i=r.line,o=n.getLine(i);function a(t){for(var a,s=r.ch,l=0;;){var u=s<=0?-1:o.lastIndexOf(t[0],s-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}HPe(r,"hasImport");var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}HPe(r,"hasInclude");var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(hPe());var WPe={};const GPe=qPe({__proto__:null,default:pPe(WPe)},[WPe]),KPe=Object.freeze(Object.defineProperty({__proto__:null,b:GPe},Symbol.toStringTag,{value:"Module"}));var YPe=Object.defineProperty,XPe=(e,t)=>YPe(e,"name",{value:t,configurable:!0});function JPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}XPe(JPe,"_mergeNamespaces");var QPe,ZPe={exports:{}};function eOe(){return QPe||(QPe=1,function(e){function t(t,r,o,a){if(o&&o.call){var s=o;o=null}else s=i(t,o,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var l=i(t,o,"minFoldSize");function u(e){var n=s(t,r);if(!n||n.to.line-n.from.linet.firstLine();)r=e.Pos(r.line-1,0),c=u(!1);if(c&&!c.cleared&&"unfold"!==a){var p=n(t,o,c);e.on(p,"mousedown",(function(t){d.clear(),e.e_preventDefault(t)}));var d=t.markText(c.from,c.to,{replacedWith:p,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});d.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,c.from,c.to)}}function n(e,t,n){var r=i(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);(r=document.createElement("span")).appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}XPe(t,"doFold"),XPe(n,"makeWidget"),e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=u){if(d&&s&&d.test(s.className))return;r=o(a.indicatorOpen)}}!r&&!s||e.setGutterMarker(n,a.gutter,r)}))}function s(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function l(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){a(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function u(e,n,r){var o=e.state.foldGutter;if(o){var a=o.options;if(r==a.gutter){var s=i(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){l(e)}),n.foldOnChangeTimeSpan||600)}}function p(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?l(e):e.operation((function(){n.fromt.to&&(a(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function d(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&riOe(e,"name",{value:t,configurable:!0});function aOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}oOe(aOe,"_mergeNamespaces");!function(e){var t="CodeMirror-lint-markers",n="CodeMirror-lint-line-";function r(t,n,r){var i=document.createElement("div");function o(t){if(!i.parentNode)return e.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),oOe(o,"position"),e.on(document,"mousemove",o),o(n),null!=i.style.opacity&&(i.style.opacity=1),i}function i(e){e.parentNode&&e.parentNode.removeChild(e)}function o(e){e.parentNode&&(null==e.style.opacity&&i(e),e.style.opacity=0,setTimeout((function(){i(e)}),600))}function a(t,n,i,a){var s=r(t,n,i);function l(){e.off(a,"mouseout",l),s&&(o(s),s=null)}oOe(l,"hide");var u=setInterval((function(){if(s)for(var e=a;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){l();break}}if(!s)return clearInterval(u)}),400);e.on(a,"mouseout",l)}function s(e,t,n){for(var r in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),(!t||!0===t)&&(t={}),this.options={},this.linterOptions=t.options||{},l)this.options[r]=l[r];for(var r in t)l.hasOwnProperty(r)?null!=t[r]&&(this.options[r]=t[r]):t.options||(this.linterOptions[r]=t[r]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){x(e,t)},this.waitingFor=0}oOe(r,"showTooltip"),oOe(i,"rm"),oOe(o,"hideTooltip"),oOe(a,"showTooltipFor"),oOe(s,"LintState");var l={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function u(e){var n=e.state.lint;n.hasGutter&&e.clearGutter(t),n.options.highlightLines&&c(e);for(var r=0;r-1)&&c.push(e.message)}));for(var m=null,g=i.hasGutter&&document.createDocumentFragment(),y=0;y1,o.tooltips)),o.highlightLines&&e.addLineClass(s,"wrap",n+m)}}o.onUpdateLinting&&o.onUpdateLinting(r,a,e)}}function v(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){g(e)}),t.options.delay))}function b(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;opOe(e,"name",{value:t,configurable:!0}),fOe={exports:{}};function hOe(){return cOe||(cOe=1,function(e){var t,n,r=e.Pos;function i(e){return e.flags??(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function o(e,t){for(var n=i(e),r=n,o=0;oc);p++){var d=e.getLine(u++);i=null==i?d:i+"\n"+d}l*=2,t.lastIndex=n.ch;var f=t.exec(i);if(f){var h=i.slice(0,f.index).split("\n"),m=f[0].split("\n"),g=n.line+h.length-1,y=h[h.length-1].length;return{from:r(g,y),to:r(g+m.length-1,1==m.length?y+m[0].length:m[m.length-1].length),match:f}}}}function u(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function c(e,t,n){t=o(t,"g");for(var i=n.line,a=n.ch,s=e.firstLine();i>=s;i--,a=-1){var l=e.getLine(i),c=u(l,t,a<0?0:l.length-a);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}function p(e,t,n){if(!a(t))return c(e,t,n);t=o(t,"gm");for(var i,s=1,l=e.getLine(n.line).length-n.ch,p=n.line,d=e.firstLine();p>=d;){for(var f=0;f=d;f++){var h=e.getLine(p--);i=null==i?h:h+"\n"+i}s*=2;var m=u(i,t,l);if(m){var g=i.slice(0,m.index).split("\n"),y=m[0].split("\n"),v=p+g.length,b=g[g.length-1].length;return{from:r(v,b),to:r(v+y.length-1,1==y.length?b+y[0].length:y[y.length-1].length),match:m}}}}function d(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function f(e,i,o,a){if(!i.length)return null;var s=a?t:n,l=s(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,p=e.lastLine()+1-l.length;u<=p;u++,c=0){var f=e.getLine(u).slice(c),h=s(f);if(1==l.length){var m=h.indexOf(l[0]);if(-1==m)continue e;return o=d(f,h,m,s)+c,{from:r(u,d(f,h,m,s)+c),to:r(u,d(f,h,m+l[0].length,s)+c)}}var g=h.length-l[0].length;if(h.slice(g)==l[0]){for(var y=1;y=p;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var h=s(f);if(1==l.length){var m=h.lastIndexOf(l[0]);if(-1==m)continue e;return{from:r(u,d(f,h,m,s)),to:r(u,d(f,h,m+l[0].length,s))}}var g=l[l.length-1];if(h.slice(0,g.length)==g){var y=1;for(o=u-l.length+1;y(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(t,n);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new m(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new m(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(hPe())),fOe.exports}dOe(hOe,"requireSearchcursor");var mOe=Object.defineProperty;function gOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{mOe(e,"name",{value:t,configurable:!0})})(gOe,"_mergeNamespaces");var yOe=hOe();const vOe=gOe({__proto__:null,default:pPe(yOe)},[yOe]),bOe=Object.freeze(Object.defineProperty({__proto__:null,s:vOe},Symbol.toStringTag,{value:"Module"}));var xOe=Object.defineProperty,EOe=(e,t)=>xOe(e,"name",{value:t,configurable:!0});function DOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}EOe(DOe,"_mergeNamespaces");!function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}EOe(t,"dialogDiv"),EOe(n,"closeNotification"),e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,l=this;function u(t){if("string"==typeof t)p.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),o.onClose&&o.onClose(a)}}EOe(u,"close");var c,p=a.getElementsByTagName("input")[0];return p?(p.focus(),o.value&&(p.value=o.value,!1!==o.selectValueOnOpen&&p.select()),o.onInput&&e.on(p,"input",(function(e){o.onInput(e,p.value,u)})),o.onKeyUp&&e.on(p,"keyup",(function(e){o.onKeyUp(e,p.value,u)})),e.on(p,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,p.value,u)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(p.blur(),e.e_stop(t),u()),13==t.keyCode&&i(p.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&u()}))):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){u(),l.focus()})),!1!==o.closeOnBlur&&e.on(c,"blur",u),c.focus()),u})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),l=!1,u=this,c=1;function p(){l||(l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),u.focus())}EOe(p,"close"),s[0].focus();for(var d=0;dTOe(e,"name",{value:t,configurable:!0});function AOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}kOe(AOe,"_mergeNamespaces");!function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase("Jump to line:")+' '+e.phrase("(Use line:column or scroll% syntax)")+""}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.defineOption("search",{bottom:!1}),kOe(t,"dialog"),kOe(n,"getJumpDialog"),kOe(r,"interpretLine"),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var n;if(t)if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(hPe());var NOe={};const _Oe=AOe({__proto__:null,default:pPe(NOe)},[NOe]),FOe=Object.freeze(Object.defineProperty({__proto__:null,j:_Oe},Symbol.toStringTag,{value:"Module"}));var IOe=Object.defineProperty,POe=(e,t)=>IOe(e,"name",{value:t,configurable:!0});function OOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}POe(OOe,"_mergeNamespaces");!function(e){var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,u=l,c=i<0?0:o.length,p=0;u!=c;u+=i,p++){var d=o.charAt(i<0?u-1:u),f="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==f&&d.toUpperCase()==d&&(f="W"),"start"==s)"o"!=f?(s="in",a=f):l=u+i;else if("in"==s&&a!=f){if("w"==a&&"W"==f&&i<0&&u--,"W"==a&&"w"==f&&i>0){if(u==l+1){a="w";continue}u--}break}}return n(r.line,u)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;s--){var u=r[i[s]];if(!(l&&e.cmpPos(u.head,l)>0)){var c=a(t,u.head);l=c.from,t.replaceRange(n(c.word),c.from,c.to)}}}))}function h(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=a(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function m(e,t){var r=h(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}POe(c,"selectBetweenBrackets"),t.selectScope=function(e){c(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!c(t))return e.Pass},POe(p,"puncType"),t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,p(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,p(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(u,c):i.length&&(i[i.length-1]=c),o=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,u=s.from().line;0==s.to().ch&&!s.empty()&&l--,l=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),u=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var c=new n(a.line,e.findColumn(s,l-i,i));c.ch!=a.ch&&(u=c)}t.replaceRange("",u,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){f(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){f(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},POe(h,"getTarget"),POe(m,"findAndGoTo"),t.findUnder=function(e){m(e,!0)},t.findUnderPrevious=function(e){m(e,!1)},t.findAllUnder=function(e){var t=h(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var g=e.keyMap;g.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(g.macSublime),g.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(g.pcSublime);var y=g.default==g.macDefault;g.sublime=y?g.macSublime:g.pcSublime}(hPe(),hOe(),FPe());var LOe={};const MOe=OOe({__proto__:null,default:pPe(LOe)},[LOe]),ROe=Object.freeze(Object.defineProperty({__proto__:null,s:MOe},Symbol.toStringTag,{value:"Module"}));var BOe=Object.defineProperty,jOe=(e,t)=>BOe(e,"name",{value:t,configurable:!0});function VOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}jOe(VOe,"_mergeNamespaces");var zOe;(zOe=hPe()).defineMode("javascript",(function(e,t){var n,r,i=e.indentUnit,o=t.statementIndent,a=t.jsonld,s=t.json||a,l=!1!==t.trackScope,u=t.typescript,c=t.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}jOe(e,"kw");var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function m(e,t,i){return n=e,r=i,t}function g(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=y(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):rt(e,t,1)?(h(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=b,b(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==n&&e.eatWhile(c))return m("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(d.test(n))return(">"!=n||!t.lexical||">"!=t.lexical.type)&&(e.eat("=")?("!"==n||"="==n)&&e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?m("."):m("operator","operator",e.current());if(c.test(n)){e.eatWhile(c);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return m(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",r)}return m("variable","variable",r)}}function y(e){return function(t,n){var r,i=!1;if(a&&"@"==t.peek()&&t.match(f))return n.tokenize=g,m("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=g),m("string","string")}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=g;break}r="*"==n}return m("comment","comment")}function b(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=g;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}jOe(h,"readRegexp"),jOe(m,"ret"),jOe(g,"tokenBase"),jOe(y,"tokenString"),jOe(v,"tokenComment"),jOe(b,"tokenQuasi");var x="([{}])";function E(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=x.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(c.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}jOe(E,"findFatArrow");var D={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(e,t){if(!l)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function S(e,t,n,r,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?H:$)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==n&&C(e,r)?"variable-2":t}}jOe(w,"JSLexical"),jOe(C,"inScope"),jOe(S,"parseJS");var T={state:null,column:null,marked:null,cc:null};function k(){for(var e=arguments.length-1;e>=0;e--)T.cc.push(arguments[e])}function A(){return k.apply(null,arguments),!0}function N(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function _(e){var n=T.state;if(T.marked="def",l){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=F(e,n.context);if(null!=r)return void(n.context=r)}else if(!N(e,n.localVars))return void(n.localVars=new O(e,n.localVars));t.globalVars&&!N(e,n.globalVars)&&(n.globalVars=new O(e,n.globalVars))}}function F(e,t){if(t){if(t.block){var n=F(e,t.prev);return n?n==t.prev?t:new P(n,t.vars,!0):null}return N(e,t.vars)?t:new P(t.prev,new O(e,t.vars),!1)}return null}function I(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function P(e,t,n){this.prev=e,this.vars=t,this.block=n}function O(e,t){this.name=e,this.next=t}jOe(k,"pass"),jOe(A,"cont"),jOe(N,"inList"),jOe(_,"register"),jOe(F,"registerVarScoped"),jOe(I,"isModifier"),jOe(P,"Context"),jOe(O,"Var");var L=new O("this",new O("arguments",null));function M(){T.state.context=new P(T.state.context,T.state.localVars,!1),T.state.localVars=L}function R(){T.state.context=new P(T.state.context,T.state.localVars,!0),T.state.localVars=null}function B(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function j(e,t){var n=jOe((function(){var n=T.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,T.stream.column(),e,null,n.lexical,t)}),"result");return n.lex=!0,n}function V(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function z(e){function t(n){return n==e?A():";"==e||"}"==n||")"==n||"]"==n?k():A(t)}return jOe(t,"exp"),t}function $(e,t){return"var"==e?A(j("vardef",t),ke,z(";"),V):"keyword a"==e?A(j("form"),W,$,V):"keyword b"==e?A(j("form"),$,V):"keyword d"==e?T.stream.match(/^\s*$/,!1)?A():A(j("stat"),K,z(";"),V):"debugger"==e?A(z(";")):"{"==e?A(j("}"),R,pe,V,B):";"==e?A():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==V&&T.state.cc.pop()(),A(j("form"),W,$,V,Pe)):"function"==e?A(Re):"for"==e?A(j("form"),R,Oe,$,B,V):"class"==e||u&&"interface"==t?(T.marked="keyword",A(j("form","class"==e?e:t),$e,V)):"variable"==e?u&&"declare"==t?(T.marked="keyword",A($)):u&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?A(et):"type"==t?A(je,z("operator"),ge,z(";")):A(j("form"),Ae,z("{"),j("}"),pe,V,V)):u&&"namespace"==t?(T.marked="keyword",A(j("form"),H,$,V)):u&&"abstract"==t?(T.marked="keyword",A($)):A(j("stat"),ie):"switch"==e?A(j("form"),W,z("{"),j("}","switch"),R,pe,V,V,B):"case"==e?A(H,z(":")):"default"==e?A(z(":")):"catch"==e?A(j("form"),M,U,$,V,B):"export"==e?A(j("stat"),We,V):"import"==e?A(j("stat"),Ke,V):"async"==e?A($):"@"==t?A(H,$):k(j("stat"),H,z(";"),V)}function U(e){if("("==e)return A(Ve,z(")"))}function H(e,t){return G(e,t,!1)}function q(e,t){return G(e,t,!0)}function W(e){return"("!=e?k():A(j(")"),K,z(")"),V)}function G(e,t,n){if(T.state.fatArrowAt==T.stream.start){var r=n?ee:Z;if("("==e)return A(M,j(")"),ue(Ve,")"),V,z("=>"),r,B);if("variable"==e)return k(M,Ae,z("=>"),r,B)}var i=n?X:Y;return D.hasOwnProperty(e)?A(i):"function"==e?A(Re,i):"class"==e||u&&"interface"==t?(T.marked="keyword",A(j("form"),ze,V)):"keyword c"==e||"async"==e?A(n?q:H):"("==e?A(j(")"),K,z(")"),V,i):"operator"==e||"spread"==e?A(n?q:H):"["==e?A(j("]"),Ze,V,i):"{"==e?ce(ae,"}",null,i):"quasi"==e?k(J,i):"new"==e?A(te(n)):A()}function K(e){return e.match(/[;\}\)\],]/)?k():k(H)}function Y(e,t){return","==e?A(K):X(e,t,!1)}function X(e,t,n){var r=0==n?Y:X,i=0==n?H:q;if("=>"==e)return A(M,n?ee:Z,B);if("operator"==e)return/\+\+|--/.test(t)||u&&"!"==t?A(r):u&&"<"==t&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?A(j(">"),ue(ge,">"),V,r):"?"==t?A(H,z(":"),i):A(i);if("quasi"==e)return k(J,r);if(";"!=e){if("("==e)return ce(q,")","call",r);if("."==e)return A(oe,r);if("["==e)return A(j("]"),K,z("]"),V,r);if(u&&"as"==t)return T.marked="keyword",A(ge,r);if("regexp"==e)return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),A(i)}}function J(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?A(J):A(K,Q)}function Q(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,A(J)}function Z(e){return E(T.stream,T.state),k("{"==e?$:H)}function ee(e){return E(T.stream,T.state),k("{"==e?$:q)}function te(e){return function(t){return"."==t?A(e?re:ne):"variable"==t&&u?A(Ce,e?X:Y):k(e?q:H)}}function ne(e,t){if("target"==t)return T.marked="keyword",A(Y)}function re(e,t){if("target"==t)return T.marked="keyword",A(X)}function ie(e){return":"==e?A(V,$):k(Y,z(";"),V)}function oe(e){if("variable"==e)return T.marked="property",A()}function ae(e,t){return"async"==e?(T.marked="property",A(ae)):"variable"==e||"keyword"==T.style?(T.marked="property","get"==t||"set"==t?A(se):(u&&T.state.fatArrowAt==T.stream.start&&(n=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+n[0].length),A(le))):"number"==e||"string"==e?(T.marked=a?"property":T.style+" property",A(le)):"jsonld-keyword"==e?A(le):u&&I(t)?(T.marked="keyword",A(ae)):"["==e?A(H,de,z("]"),le):"spread"==e?A(q,le):"*"==t?(T.marked="keyword",A(ae)):":"==e?k(le):void 0;var n}function se(e){return"variable"!=e?k(le):(T.marked="property",A(Re))}function le(e){return":"==e?A(q):"("==e?k(Re):void 0}function ue(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=T.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),A((function(n,r){return n==t||r==t?k():k(e)}),r)}return i==t||o==t?A():n&&n.indexOf(";")>-1?k(e):A(z(t))}return jOe(r,"proceed"),function(n,i){return n==t||i==t?A():k(e,r)}}function ce(e,t,n){for(var r=3;r"),ge):"quasi"==e?k(xe,we):void 0}function ye(e){if("=>"==e)return A(ge)}function ve(e){return e.match(/[\}\)\]]/)?A():","==e||";"==e?A(ve):k(be,ve)}function be(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",A(be)):"?"==t||"number"==e||"string"==e?A(be):":"==e?A(ge):"["==e?A(z("variable"),fe,z("]"),be):"("==e?k(Be,be):e.match(/[;\}\)\],]/)?void 0:A()}function xe(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?A(xe):A(ge,Ee)}function Ee(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,A(xe)}function De(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?A(De):":"==e?A(ge):"spread"==e?A(De):k(ge)}function we(e,t){return"<"==t?A(j(">"),ue(ge,">"),V,we):"|"==t||"."==e||"&"==t?A(ge):"["==e?A(ge,z("]"),we):"extends"==t||"implements"==t?(T.marked="keyword",A(ge)):"?"==t?A(ge,z(":"),ge):void 0}function Ce(e,t){if("<"==t)return A(j(">"),ue(ge,">"),V,we)}function Se(){return k(ge,Te)}function Te(e,t){if("="==t)return A(ge)}function ke(e,t){return"enum"==t?(T.marked="keyword",A(et)):k(Ae,de,Fe,Ie)}function Ae(e,t){return u&&I(t)?(T.marked="keyword",A(Ae)):"variable"==e?(_(t),A()):"spread"==e?A(Ae):"["==e?ce(_e,"]"):"{"==e?ce(Ne,"}"):void 0}function Ne(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?A(Ae):"}"==e?k():"["==e?A(H,z("]"),z(":"),Ne):A(z(":"),Ae,Fe)):(_(t),A(Fe))}function _e(){return k(Ae,Fe)}function Fe(e,t){if("="==t)return A(q)}function Ie(e){if(","==e)return A(ke)}function Pe(e,t){if("keyword b"==e&&"else"==t)return A(j("form","else"),$,V)}function Oe(e,t){return"await"==t?A(Oe):"("==e?A(j(")"),Le,V):void 0}function Le(e){return"var"==e?A(ke,Me):"variable"==e?A(Me):k(Me)}function Me(e,t){return")"==e?A():";"==e?A(Me):"in"==t||"of"==t?(T.marked="keyword",A(H,Me)):k(H,Me)}function Re(e,t){return"*"==t?(T.marked="keyword",A(Re)):"variable"==e?(_(t),A(Re)):"("==e?A(M,j(")"),ue(Ve,")"),V,he,$,B):u&&"<"==t?A(j(">"),ue(Se,">"),V,Re):void 0}function Be(e,t){return"*"==t?(T.marked="keyword",A(Be)):"variable"==e?(_(t),A(Be)):"("==e?A(M,j(")"),ue(Ve,")"),V,he,B):u&&"<"==t?A(j(">"),ue(Se,">"),V,Be):void 0}function je(e,t){return"keyword"==e||"variable"==e?(T.marked="type",A(je)):"<"==t?A(j(">"),ue(Se,">"),V):void 0}function Ve(e,t){return"@"==t&&A(H,Ve),"spread"==e?A(Ve):u&&I(t)?(T.marked="keyword",A(Ve)):u&&"this"==e?A(de,Fe):k(Ae,de,Fe)}function ze(e,t){return"variable"==e?$e(e,t):Ue(e,t)}function $e(e,t){if("variable"==e)return _(t),A(Ue)}function Ue(e,t){return"<"==t?A(j(">"),ue(Se,">"),V,Ue):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(T.marked="keyword"),A(u?ge:H,Ue)):"{"==e?A(j("}"),He,V):void 0}function He(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&I(t))&&T.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",A(He)):"variable"==e||"keyword"==T.style?(T.marked="property",A(qe,He)):"number"==e||"string"==e?A(qe,He):"["==e?A(H,de,z("]"),qe,He):"*"==t?(T.marked="keyword",A(He)):u&&"("==e?k(Be,He):";"==e||","==e?A(He):"}"==e?A():"@"==t?A(H,He):void 0}function qe(e,t){if("!"==t||"?"==t)return A(qe);if(":"==e)return A(ge,Fe);if("="==t)return A(q);var n=T.state.lexical.prev;return k(n&&"interface"==n.info?Be:Re)}function We(e,t){return"*"==t?(T.marked="keyword",A(Qe,z(";"))):"default"==t?(T.marked="keyword",A(H,z(";"))):"{"==e?A(ue(Ge,"}"),Qe,z(";")):k($)}function Ge(e,t){return"as"==t?(T.marked="keyword",A(z("variable"))):"variable"==e?k(q,Ge):void 0}function Ke(e){return"string"==e?A():"("==e?k(H):"."==e?k(Y):k(Ye,Xe,Qe)}function Ye(e,t){return"{"==e?ce(Ye,"}"):("variable"==e&&_(t),"*"==t&&(T.marked="keyword"),A(Je))}function Xe(e){if(","==e)return A(Ye,Xe)}function Je(e,t){if("as"==t)return T.marked="keyword",A(Ye)}function Qe(e,t){if("from"==t)return T.marked="keyword",A(H)}function Ze(e){return"]"==e?A():k(ue(q,"]"))}function et(){return k(j("form"),Ae,z("{"),j("}"),ue(tt,"}"),V,V)}function tt(){return k(Ae,Fe)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function rt(e,t,n){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return jOe(M,"pushcontext"),jOe(R,"pushblockcontext"),M.lex=R.lex=!0,jOe(B,"popcontext"),B.lex=!0,jOe(j,"pushlex"),jOe(V,"poplex"),V.lex=!0,jOe(z,"expect"),jOe($,"statement"),jOe(U,"maybeCatchBinding"),jOe(H,"expression"),jOe(q,"expressionNoComma"),jOe(W,"parenExpr"),jOe(G,"expressionInner"),jOe(K,"maybeexpression"),jOe(Y,"maybeoperatorComma"),jOe(X,"maybeoperatorNoComma"),jOe(J,"quasi"),jOe(Q,"continueQuasi"),jOe(Z,"arrowBody"),jOe(ee,"arrowBodyNoComma"),jOe(te,"maybeTarget"),jOe(ne,"target"),jOe(re,"targetNoComma"),jOe(ie,"maybelabel"),jOe(oe,"property"),jOe(ae,"objprop"),jOe(se,"getterSetter"),jOe(le,"afterprop"),jOe(ue,"commasep"),jOe(ce,"contCommasep"),jOe(pe,"block"),jOe(de,"maybetype"),jOe(fe,"maybetypeOrIn"),jOe(he,"mayberettype"),jOe(me,"isKW"),jOe(ge,"typeexpr"),jOe(ye,"maybeReturnType"),jOe(ve,"typeprops"),jOe(be,"typeprop"),jOe(xe,"quasiType"),jOe(Ee,"continueQuasiType"),jOe(De,"typearg"),jOe(we,"afterType"),jOe(Ce,"maybeTypeArgs"),jOe(Se,"typeparam"),jOe(Te,"maybeTypeDefault"),jOe(ke,"vardef"),jOe(Ae,"pattern"),jOe(Ne,"proppattern"),jOe(_e,"eltpattern"),jOe(Fe,"maybeAssign"),jOe(Ie,"vardefCont"),jOe(Pe,"maybeelse"),jOe(Oe,"forspec"),jOe(Le,"forspec1"),jOe(Me,"forspec2"),jOe(Re,"functiondef"),jOe(Be,"functiondecl"),jOe(je,"typename"),jOe(Ve,"funarg"),jOe(ze,"classExpression"),jOe($e,"className"),jOe(Ue,"classNameAfter"),jOe(He,"classBody"),jOe(qe,"classfield"),jOe(We,"afterExport"),jOe(Ge,"exportField"),jOe(Ke,"afterImport"),jOe(Ye,"importSpec"),jOe(Xe,"maybeMoreImports"),jOe(Je,"maybeAs"),jOe(Qe,"maybeFrom"),jOe(Ze,"arrayLiteral"),jOe(et,"enumdef"),jOe(tt,"enummember"),jOe(nt,"isContinuedStatement"),jOe(rt,"expressionAllowed"),{startState:function(e){var n={tokenize:g,lastType:"sof",cc:[],lexical:new w((e||0)-i,0,"block",!1),localVars:t.localVars,context:t.localVars&&new P(null,null,!1),indented:e||0};return t.globalVars&&"object"==typeof t.globalVars&&(n.globalVars=t.globalVars),n},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),E(e,t)),t.tokenize!=v&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==n?i:(t.lastType="operator"!=n||"++"!=r&&"--"!=r?n:"incdec",S(t,i,n,r,e))},indent:function(e,n){if(e.tokenize==v||e.tokenize==b)return zOe.Pass;if(e.tokenize!=g)return 0;var r,a=n&&n.charAt(0),s=e.lexical;if(!/^\s*else\b/.test(n))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==V)s=s.prev;else if(u!=Pe&&u!=B)break}for(;("stat"==s.type||"form"==s.type)&&("}"==a||(r=e.cc[e.cc.length-1])&&(r==Y||r==X)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;o&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var c=s.type,p=a==c;return"vardef"==c?s.indented+("operator"==e.lastType||","==e.lastType?s.info.length+1:0):"form"==c&&"{"==a?s.indented:"form"==c?s.indented+i:"stat"==c?s.indented+(nt(e,n)?o||i:0):"switch"!=s.info||p||0==t.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:i):s.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:a,jsonMode:s,expressionAllowed:rt,skipExpression:function(e){S(e,"atom","atom","true",new zOe.StringStream("",2,null))}}})),zOe.registerHelper("wordChars","javascript",/[\w$]/),zOe.defineMIME("text/javascript","javascript"),zOe.defineMIME("text/ecmascript","javascript"),zOe.defineMIME("application/javascript","javascript"),zOe.defineMIME("application/x-javascript","javascript"),zOe.defineMIME("application/ecmascript","javascript"),zOe.defineMIME("application/json",{name:"javascript",json:!0}),zOe.defineMIME("application/x-json",{name:"javascript",json:!0}),zOe.defineMIME("application/manifest+json",{name:"javascript",json:!0}),zOe.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),zOe.defineMIME("text/typescript",{name:"javascript",typescript:!0}),zOe.defineMIME("application/typescript",{name:"javascript",typescript:!0});var $Oe={};const UOe=VOe({__proto__:null,default:pPe($Oe)},[$Oe]),HOe=Object.freeze(Object.defineProperty({__proto__:null,j:UOe},Symbol.toStringTag,{value:"Module"}));var qOe=Object.defineProperty,WOe=(e,t)=>qOe(e,"name",{value:t,configurable:!0});function GOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}WOe(GOe,"_mergeNamespaces");!function(e){var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function a(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"\`]/.test(n)}function s(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}WOe(o,"firstNonWS"),e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),u=o[s].to();l.line>=i||(u.line>=i&&(u=r(i,0)),i=l.line,null==a?n.uncomment(l,u,e)?a="un":(n.lineComment(l,u,e),a="line"):"un"==a?n.uncomment(l,u,e):n.lineComment(l,u,e))}})),WOe(a,"probablyInsideString"),WOe(s,"getMode"),e.defineExtension("lineComment",(function(e,i,l){l||(l=t);var u=this,c=s(u,e),p=u.getLine(e.line);if(null!=p&&!a(u,e,p)){var d=l.lineComment||c.lineComment;if(!d)return void((l.blockCommentStart||c.blockCommentStart)&&(l.fullLines=!0,u.blockComment(e,i,l)));var f=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,u.lastLine()+1),h=null==l.padding?" ":l.padding,m=l.commentBlankLines||e.line==i.line;u.operation((function(){if(l.indent){for(var t=null,i=e.line;ia.length)&&(t=a)}for(i=e.line;id||l.operation((function(){if(0!=a.fullLines){var t=n.test(l.getLine(d));l.replaceRange(f+p,r(d)),l.replaceRange(c+f,r(e.line,0));var s=a.blockCommentLead||u.blockCommentLead;if(null!=s)for(var h=e.line+1;h<=d;++h)(h!=d||t)&&l.replaceRange(s+f,r(h,0))}else{var m=0==i(l.getCursor("to"),o),g=!l.somethingSelected();l.replaceRange(p,o),m&&l.setSelection(g?o:l.getCursor("from"),o),l.replaceRange(c,e)}}))}}else(a.lineComment||u.lineComment)&&0!=a.fullLines&&l.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var a,l=this,u=s(l,e),c=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,l.lastLine()),p=Math.min(e.line,c),d=o.lineComment||u.lineComment,f=[],h=null==o.padding?" ":o.padding;e:if(d){for(var m=p;m<=c;++m){var g=l.getLine(m),y=g.indexOf(d);if(y>-1&&!/comment/.test(l.getTokenTypeAt(r(m,y+1)))&&(y=-1),-1==y&&n.test(g)||y>-1&&n.test(g.slice(0,y)))break e;f.push(g)}if(l.operation((function(){for(var e=p;e<=c;++e){var t=f[e-p],n=t.indexOf(d),i=n+d.length;n<0||(t.slice(i,i+h.length)==h&&(i+=h.length),a=!0,l.replaceRange("",r(e,n),r(e,i)))}})),a)return!0}var v=o.blockCommentStart||u.blockCommentStart,b=o.blockCommentEnd||u.blockCommentEnd;if(!v||!b)return!1;var x=o.blockCommentLead||u.blockCommentLead,E=l.getLine(p),D=E.indexOf(v);if(-1==D)return!1;var w=c==p?E:l.getLine(c),C=w.indexOf(b,c==p?D+v.length:0),S=r(p,D+1),T=r(c,C+1);if(-1==C||!/comment/.test(l.getTokenTypeAt(S))||!/comment/.test(l.getTokenTypeAt(T))||l.getRange(S,T,"\n").indexOf(b)>-1)return!1;var k=E.lastIndexOf(v,e.ch),A=-1==k?-1:E.slice(0,e.ch).indexOf(b,k+v.length);if(-1!=k&&-1!=A&&A+b.length!=e.ch)return!1;A=w.indexOf(b,i.ch);var N=w.slice(i.ch).lastIndexOf(v,A-i.ch);return k=-1==A||-1==N?-1:i.ch+N,(-1==A||-1==k||k==i.ch)&&(l.operation((function(){l.replaceRange("",r(c,C-(h&&w.slice(C-h.length,C)==h?h.length:0)),r(c,C+b.length));var e=D+v.length;if(h&&E.slice(e,e+h.length)==h&&(e+=h.length),l.replaceRange("",r(p,D),r(p,e)),x)for(var t=p+1;t<=c;++t){var i=l.getLine(t),o=i.indexOf(x);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+x.length;h&&i.slice(a,a+h.length)==h&&(a+=h.length),l.replaceRange("",r(t,o),r(t,a))}}})),!0)}))}(hPe());var KOe={};const YOe=GOe({__proto__:null,default:pPe(KOe)},[KOe]),XOe=Object.freeze(Object.defineProperty({__proto__:null,c:YOe},Symbol.toStringTag,{value:"Module"}));var JOe=Object.defineProperty,QOe=(e,t)=>JOe(e,"name",{value:t,configurable:!0});function ZOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}QOe(ZOe,"_mergeNamespaces");!function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,{caseFold:i(t),multiline:!0})}function a(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i,bottom:e.options.search.bottom})}function s(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function u(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function c(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch{}else e=u(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function p(e,n,r){n.queryText=r,n.query=c(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function d(t,n,i,o){var l=r(t);if(l.query)return f(t,n);var u=t.getSelection()||l.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),i&&t.openDialog){var c=null,d=QOe((function(n,r){e.e_stop(r),n&&(n!=l.queryText&&(p(t,l,n),l.posFrom=l.posTo=t.getCursor()),c&&(c.style.opacity=1),f(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((c=r).style.opacity=.4)})))}),"searchNext");a(t,g(t),u,d,(function(n,i){var o=e.keyName(n),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(n),p(t,r(t),i),t.execCommand(s)):("find"==s||"findPersistent"==s)&&(e.e_stop(n),d(i,n))})),o&&u&&(p(t,l,u),f(t,n))}else s(t,g(t),"Search for:",u,(function(e){e&&!l.query&&t.operation((function(){p(t,l,e),l.posFrom=l.posTo=t.getCursor(),f(t,n)}))}))}function f(t,n,i){t.operation((function(){var a=r(t),s=o(t,a.query,n?a.posFrom:a.posTo);!s.find(n)&&!(s=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n)||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function h(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;i{const{schema:n,externalFragments:r,autocompleteOptions:i}=t;if(!n)return;const o=e.getCursor(),a=e.getTokenAt(o),s=null!==a.type&&/"|\w/.test(a.string[0])?a.start:a.end,l=new kse(o.line,s),u={list:yse(n,e.getValue(),l,a,r,i).map((e=>{var t;return{text:null!==(t=null==e?void 0:e.rawInsert)&&void 0!==t?t:e.label,type:e.type,description:e.documentation,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason}})),from:{line:o.line,ch:s},to:{line:o.line,ch:a.end}};return null!=u&&u.list&&u.list.length>0&&(u.from=vPe.Pos(u.from.line,u.from.ch),u.to=vPe.Pos(u.to.line,u.to.ch),vPe.signal(e,"hasCompletion",e,u,a)),u}));const rLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),iLe=["error","warning","information","hint"],oLe={"GraphQL: Validation":"validation","GraphQL: Deprecation":"deprecation","GraphQL: Syntax":"syntax"};vPe.registerHelper("lint","graphql",((e,t)=>{const{schema:n,validationRules:r,externalFragments:i}=t;return Lse(e,n,r,0,i).map((e=>({message:e.message,severity:e.severity?iLe[e.severity-1]:iLe[0],type:e.source?oLe[e.source]:void 0,from:vPe.Pos(e.range.start.line,e.range.start.character),to:vPe.Pos(e.range.end.line,e.range.end.character)})))}));const aLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sLe=Object.defineProperty;function lLe(e,t){const n=[];let r=e;for(;null!=r&&r.kind;)n.push(r),r=r.prevState;for(let i=n.length-1;i>=0;i--)t(n[i])}((e,t)=>{sLe(e,"name",{value:t,configurable:!0})})(lLe,"forEachState");var uLe=Object.defineProperty,cLe=(e,t)=>uLe(e,"name",{value:t,configurable:!0});function pLe(e,t){const n={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return lLe(t,(t=>{var r,i;switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":case"AliasedField":n.fieldDef=n.type&&t.name?dLe(e,n.parentType,t.name):null,n.type=null===(r=n.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":n.parentType=n.type?bh(n.type):null;break;case"Directive":n.directiveDef=t.name?e.getDirective(t.name):null;break;case"Arguments":const o=t.prevState?"Field"===t.prevState.kind?n.fieldDef:"Directive"===t.prevState.kind?n.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&dLe(e,n.parentType,t.prevState.name):null:null;n.argDefs=o?o.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(let e=0;ee.value===t.name)):null;break;case"ListValue":const s=n.inputType?yh(n.inputType):null;n.inputType=s instanceof dh?s.ofType:null;break;case"ObjectValue":const l=n.inputType?bh(n.inputType):null;n.objectFieldDefs=l instanceof Rh?l.getFields():null;break;case"ObjectField":const u=t.name&&n.objectFieldDefs?n.objectFieldDefs[t.name]:null;n.inputType=null==u?void 0:u.type,n.fieldDef=u;break;case"NamedType":n.type=t.name?e.getType(t.name):null}})),n}function dLe(e,t,n){return n===Dm.name&&e.getQueryType()===t?Dm:n===wm.name&&e.getQueryType()===t?wm:n===Cm.name&&uh(t)?Cm:t&&t.getFields?t.getFields()[n]:void 0}function fLe(e,t){for(let n=0;nxLe(e,"name",{value:t,configurable:!0});function DLe(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}function wLe(e){const{options:t}=e.state.info;return(null==t?void 0:t.hoverTime)||500}function CLe(e,t){const n=e.state.info,r=t.target||t.srcElement;if(!(r instanceof HTMLElement)||"SPAN"!==r.nodeName||void 0!==n.hoverTimeout)return;const i=r.getBoundingClientRect(),o=ELe((function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(s,l)}),"onMouseMove"),a=ELe((function(){vPe.off(document,"mousemove",o),vPe.off(e.getWrapperElement(),"mouseout",a),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0}),"onMouseOut"),s=ELe((function(){vPe.off(document,"mousemove",o),vPe.off(e.getWrapperElement(),"mouseout",a),n.hoverTimeout=void 0,SLe(e,i)}),"onHover"),l=wLe(e);n.hoverTimeout=setTimeout(s,l),vPe.on(document,"mousemove",o),vPe.on(e.getWrapperElement(),"mouseout",a)}function SLe(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2},"window"),r=e.state.info,{options:i}=r,o=i.render||e.getHelper(n,"info");if(o){const r=e.getTokenAt(n,!0);if(r){const a=o(r,i,e,n);a&&TLe(e,t,a)}}}function TLe(e,t,n){const r=document.createElement("div");r.className="CodeMirror-info",r.append(n),document.body.append(r);const i=r.getBoundingClientRect(),o=window.getComputedStyle(r),a=i.right-i.left+parseFloat(o.marginLeft)+parseFloat(o.marginRight),s=i.bottom-i.top+parseFloat(o.marginTop)+parseFloat(o.marginBottom);let l=t.bottom;s>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(l=t.top-s),l<0&&(l=t.bottom);let u,c=Math.max(0,window.innerWidth-a-15);c>t.left&&(c=t.left),r.style.opacity="1",r.style.top=l+"px",r.style.left=c+"px";const p=ELe((function(){clearTimeout(u)}),"onMouseOverPopup"),d=ELe((function(){clearTimeout(u),u=setTimeout(f,200)}),"onMouseOut"),f=ELe((function(){vPe.off(r,"mouseover",p),vPe.off(r,"mouseout",d),vPe.off(e.getWrapperElement(),"mouseout",d),r.style.opacity?(r.style.opacity="0",setTimeout((()=>{r.parentNode&&r.remove()}),600)):r.parentNode&&r.remove()}),"hidePopup");vPe.on(r,"mouseover",p),vPe.on(r,"mouseout",d),vPe.on(e.getWrapperElement(),"mouseout",d)}vPe.defineOption("info",!1,((e,t,n)=>{if(n&&n!==vPe.Init){const t=e.state.info.onMouseOver;vPe.off(e.getWrapperElement(),"mouseover",t),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const n=e.state.info=DLe(t);n.onMouseOver=CLe.bind(null,e),vPe.on(e.getWrapperElement(),"mouseover",n.onMouseOver)}})),ELe(DLe,"createState"),ELe(wLe,"getHoverTime"),ELe(CLe,"onMouseOver"),ELe(SLe,"onMouseHover"),ELe(TLe,"showPopup");const kLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ALe=Object.defineProperty,NLe=(e,t)=>ALe(e,"name",{value:t,configurable:!0});function _Le(e,t,n){FLe(e,t,n),LLe(e,t,n,t.type)}function FLe(e,t,n){var r;jLe(e,(null===(r=t.fieldDef)||void 0===r?void 0:r.name)||"","field-name",n,hLe(t))}function ILe(e,t,n){var r;jLe(e,"@"+((null===(r=t.directiveDef)||void 0===r?void 0:r.name)||""),"directive-name",n,mLe(t))}function PLe(e,t,n){var r;jLe(e,(null===(r=t.argDef)||void 0===r?void 0:r.name)||"","arg-name",n,gLe(t)),LLe(e,t,n,t.inputType)}function OLe(e,t,n){var r;const i=(null===(r=t.enumValue)||void 0===r?void 0:r.name)||"";MLe(e,t,n,t.inputType),jLe(e,"."),jLe(e,i,"enum-value",n,yLe(t))}function LLe(e,t,n,r){const i=document.createElement("span");i.className="type-name-pill",r instanceof fh?(MLe(i,t,n,r.ofType),jLe(i,"!")):r instanceof dh?(jLe(i,"["),MLe(i,t,n,r.ofType),jLe(i,"]")):jLe(i,(null==r?void 0:r.name)||"","type-name",n,vLe(t,r)),e.append(i)}function MLe(e,t,n,r){r instanceof fh?(MLe(e,t,n,r.ofType),jLe(e,"!")):r instanceof dh?(jLe(e,"["),MLe(e,t,n,r.ofType),jLe(e,"]")):jLe(e,(null==r?void 0:r.name)||"","type-name",n,vLe(t,r))}function RLe(e,t,n){const{description:r}=n;if(r){const n=document.createElement("div");n.className="info-description",t.renderDescription?n.innerHTML=t.renderDescription(r):n.append(document.createTextNode(r)),e.append(n)}BLe(e,t,n)}function BLe(e,t,n){const r=n.deprecationReason;if(r){const n=document.createElement("div");n.className="info-deprecation",e.append(n);const i=document.createElement("span");i.className="info-deprecation-label",i.append(document.createTextNode("Deprecated")),n.append(i);const o=document.createElement("div");o.className="info-deprecation-reason",t.renderDescription?o.innerHTML=t.renderDescription(r):o.append(document.createTextNode(r)),n.append(o)}}function jLe(e,t,n="",r={onClick:null},i=null){if(n){const{onClick:o}=r;let a;o?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",(e=>{e.preventDefault(),o(i,e)}))):a=document.createElement("span"),a.className=n,a.append(document.createTextNode(t)),e.append(a)}else e.append(document.createTextNode(t))}vPe.registerHelper("info","graphql",((e,t)=>{if(!t.schema||!e.state)return;const{kind:n,step:r}=e.state,i=pLe(t.schema,e.state);if("Field"===n&&0===r&&i.fieldDef||"AliasedField"===n&&2===r&&i.fieldDef||"ObjectField"===n&&0===r&&i.fieldDef){const e=document.createElement("div");e.className="CodeMirror-info-header",_Le(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.fieldDef),n}if("Directive"===n&&1===r&&i.directiveDef){const e=document.createElement("div");e.className="CodeMirror-info-header",ILe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.directiveDef),n}if("Argument"===n&&0===r&&i.argDef){const e=document.createElement("div");e.className="CodeMirror-info-header",PLe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.argDef),n}if("EnumValue"===n&&i.enumValue&&i.enumValue.description){const e=document.createElement("div");e.className="CodeMirror-info-header",OLe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.enumValue),n}if("NamedType"===n&&i.type&&i.type.description){const e=document.createElement("div");e.className="CodeMirror-info-header",MLe(e,i,t,i.type);const n=document.createElement("div");return n.append(e),RLe(n,t,i.type),n}})),NLe(_Le,"renderField"),NLe(FLe,"renderQualifiedField"),NLe(ILe,"renderDirective"),NLe(PLe,"renderArg"),NLe(OLe,"renderEnumValue"),NLe(LLe,"renderTypeAnnotation"),NLe(MLe,"renderType"),NLe(RLe,"renderDescription"),NLe(BLe,"renderDeprecation"),NLe(jLe,"text");const VLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var zLe=Object.defineProperty,$Le=(e,t)=>zLe(e,"name",{value:t,configurable:!0});function ULe(e,t){const n=t.target||t.srcElement;if(!(n instanceof HTMLElement)||"SPAN"!==(null==n?void 0:n.nodeName))return;const r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&KLe(e)}function HLe(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&YLe(e):e.state.jump.cursor=null}function qLe(e,t){if(e.state.jump.isHoldingModifier||!GLe(t.key))return;e.state.jump.isHoldingModifier=!0,e.state.jump.cursor&&KLe(e);const n=$Le((o=>{o.code===t.code&&(e.state.jump.isHoldingModifier=!1,e.state.jump.marker&&YLe(e),vPe.off(document,"keyup",n),vPe.off(document,"click",r),e.off("mousedown",i))}),"onKeyUp"),r=$Le((t=>{const{destination:n,options:r}=e.state.jump;n&&r.onClick(n,t)}),"onClick"),i=$Le(((t,n)=>{e.state.jump.destination&&(n.codemirrorIgnore=!0)}),"onMouseDown");vPe.on(document,"keyup",n),vPe.on(document,"click",r),e.on("mousedown",i)}vPe.defineOption("jump",!1,((e,t,n)=>{if(n&&n!==vPe.Init){const t=e.state.jump.onMouseOver;vPe.off(e.getWrapperElement(),"mouseover",t);const n=e.state.jump.onMouseOut;vPe.off(e.getWrapperElement(),"mouseout",n),vPe.off(document,"keydown",e.state.jump.onKeyDown),delete e.state.jump}if(t){const n=e.state.jump={options:t,onMouseOver:ULe.bind(null,e),onMouseOut:HLe.bind(null,e),onKeyDown:qLe.bind(null,e)};vPe.on(e.getWrapperElement(),"mouseover",n.onMouseOver),vPe.on(e.getWrapperElement(),"mouseout",n.onMouseOut),vPe.on(document,"keydown",n.onKeyDown)}})),$Le(ULe,"onMouseOver"),$Le(HLe,"onMouseOut"),$Le(qLe,"onKeyDown");const WLe=typeof navigator<"u"&&navigator&&navigator.appVersion.includes("Mac");function GLe(e){return e===(WLe?"Meta":"Control")}function KLe(e){if(e.state.jump.marker)return;const{cursor:t,options:n}=e.state.jump,r=e.coordsChar(t),i=e.getTokenAt(r,!0),o=n.getDestination||e.getHelper(r,"jump");if(o){const t=o(i,n,e);if(t){const n=e.markText({line:r.line,ch:i.start},{line:r.line,ch:i.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=n,e.state.jump.destination=t}}}function YLe(e){const{marker:t}=e.state.jump;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}$Le(GLe,"isJumpModifier"),$Le(KLe,"enableJumpMode"),$Le(YLe,"disableJumpMode"),vPe.registerHelper("jump","graphql",((e,t)=>{if(!t.schema||!t.onClick||!e.state)return;const{state:n}=e,{kind:r,step:i}=n,o=pLe(t.schema,n);return"Field"===r&&0===i&&o.fieldDef||"AliasedField"===r&&2===i&&o.fieldDef?hLe(o):"Directive"===r&&1===i&&o.directiveDef?mLe(o):"Argument"===r&&0===i&&o.argDef?gLe(o):"EnumValue"===r&&o.enumValue?yLe(o):"NamedType"===r&&o.type?vLe(o):void 0}));const XLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var JLe=Object.defineProperty;function QLe(e,t){var n,r;const{levels:i,indentLevel:o}=e;return((i&&0!==i.length?i.at(-1)-(null!==(n=this.electricInput)&&void 0!==n&&n.test(t)?1:0):o)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}((e,t)=>{JLe(e,"name",{value:t,configurable:!0})})(QLe,"indent");var ZLe=Object.defineProperty,eMe=(e,t)=>ZLe(e,"name",{value:t,configurable:!0});const tMe=eMe((e=>{const t=Qae({eatWhitespace:e=>e.eatWhile(Wae),lexRules:Gae,parseRules:Kae,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}),"graphqlModeFactory");vPe.defineMode("graphql",tMe);const nMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var rMe=Object.defineProperty,iMe=(e,t)=>rMe(e,"name",{value:t,configurable:!0});function oMe(e,t,n){const r=aMe(n,lMe(t.string));if(!r)return;const i=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:r,from:{line:e.line,ch:i},to:{line:e.line,ch:t.end}}}function aMe(e,t){if(!t)return sMe(e,(e=>!e.isDeprecated));return sMe(sMe(e.map((e=>({proximity:uMe(lMe(e.text),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length)).map((e=>e.entry))}function sMe(e,t){const n=e.filter(t);return 0===n.length?e:n}function lMe(e){return e.toLowerCase().replaceAll(/\W/g,"")}function uMe(e,t){let n=cMe(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function cMe(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}function pMe(e,t,n){const r="Invalid"===t.state.kind?t.state.prevState:t.state,{kind:i,step:o}=r;if("Document"===i&&0===o)return oMe(e,t,[{text:"{"}]);const{variableToType:a}=n;if(!a)return;const s=dMe(a,t.state);if("Document"===i||"Variable"===i&&0===o){return oMe(e,t,Object.keys(a).map((e=>({text:`"${e}": `,type:a[e]}))))}if(("ObjectValue"===i||"ObjectField"===i&&0===o)&&s.fields){const n=Object.keys(s.fields).map((e=>s.fields[e]));return oMe(e,t,n.map((e=>({text:`"${e.name}": `,type:e.type,description:e.description}))))}if("StringValue"===i||"NumberValue"===i||"BooleanValue"===i||"NullValue"===i||"ListValue"===i&&1===o||"ObjectField"===i&&2===o||"Variable"===i&&2===o){const n=s.type?bh(s.type):void 0;if(n instanceof Rh)return oMe(e,t,[{text:"{"}]);if(n instanceof Oh){return oMe(e,t,n.getValues().map((e=>({text:`"${e.name}"`,type:n,description:e.description}))))}if(n===Kh)return oMe(e,t,[{text:"true",type:Kh,description:"Not false."},{text:"false",type:Kh,description:"Not true."}])}}function dMe(e,t){const n={type:null,fields:null};return lLe(t,(t=>{switch(t.kind){case"Variable":n.type=e[t.name];break;case"ListValue":{const e=n.type?yh(n.type):void 0;n.type=e instanceof dh?e.ofType:null;break}case"ObjectValue":{const e=n.type?bh(n.type):void 0;n.fields=e instanceof Rh?e.getFields():null;break}case"ObjectField":{const e=t.name&&n.fields?n.fields[t.name]:null;n.type=null==e?void 0:e.type;break}}})),n}iMe(oMe,"hintList"),iMe(aMe,"filterAndSortList"),iMe(sMe,"filterNonEmpty"),iMe(lMe,"normalizeText"),iMe(uMe,"getProximity"),iMe(cMe,"lexicalDistance"),vPe.registerHelper("hint","graphql-variables",((e,t)=>{const n=e.getCursor(),r=e.getTokenAt(n),i=pMe(n,r,t);return null!=i&&i.list&&i.list.length>0&&(i.from=vPe.Pos(i.from.line,i.from.ch),i.to=vPe.Pos(i.to.line,i.to.ch),vPe.signal(e,"hasCompletion",e,i,r)),i})),iMe(pMe,"getVariablesHint"),iMe(dMe,"getTypeInfo");const fMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hMe=Object.defineProperty,mMe=(e,t)=>hMe(e,"name",{value:t,configurable:!0});function gMe(e){yMe=e,vMe=e.length,bMe=xMe=EMe=-1,PMe(),OMe();const t=CMe();return NMe("EOF"),t}let yMe,vMe,bMe,xMe,EMe,DMe,wMe;function CMe(){const e=bMe,t=[];if(NMe("{"),!IMe("}")){do{t.push(SMe())}while(IMe(","));NMe("}")}return{kind:"Object",start:e,end:EMe,members:t}}function SMe(){const e=bMe,t="String"===wMe?AMe():null;NMe("String"),NMe(":");const n=kMe();return{kind:"Member",start:e,end:EMe,key:t,value:n}}function TMe(){const e=bMe,t=[];if(NMe("["),!IMe("]")){do{t.push(kMe())}while(IMe(","));NMe("]")}return{kind:"Array",start:e,end:EMe,values:t}}function kMe(){switch(wMe){case"[":return TMe();case"{":return CMe();case"String":case"Number":case"Boolean":case"Null":const e=AMe();return OMe(),e}NMe("Value")}function AMe(){return{kind:wMe,start:bMe,end:xMe,value:JSON.parse(yMe.slice(bMe,xMe))}}function NMe(e){if(wMe===e)return void OMe();let t;if("EOF"===wMe)t="[end of file]";else if(xMe-bMe>1)t="`"+yMe.slice(bMe,xMe)+"`";else{const e=yMe.slice(bMe).match(/^.+?\b/);t="`"+(e?e[0]:yMe[bMe])+"`"}throw FMe(`Expected ${e} but found ${t}.`)}mMe(gMe,"jsonParse"),mMe(CMe,"parseObj"),mMe(SMe,"parseMember"),mMe(TMe,"parseArr"),mMe(kMe,"parseVal"),mMe(AMe,"curToken"),mMe(NMe,"expect");class _Me extends Error{constructor(e,t){super(e),this.position=t}}function FMe(e){return new _Me(e,{start:bMe,end:xMe})}function IMe(e){if(wMe===e)return OMe(),!0}function PMe(){return xMe31;)if(92===DMe)switch(DMe=PMe(),DMe){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:PMe();break;case 117:PMe(),MMe(),MMe(),MMe(),MMe();break;default:throw FMe("Bad character escape sequence.")}else{if(xMe===vMe)throw FMe("Unterminated string.");PMe()}if(34!==DMe)throw FMe("Unterminated string.");PMe()}function MMe(){if(DMe>=48&&DMe<=57||DMe>=65&&DMe<=70||DMe>=97&&DMe<=102)return PMe();throw FMe("Expected hexadecimal digit.")}function RMe(){45===DMe&&PMe(),48===DMe?PMe():BMe(),46===DMe&&(PMe(),BMe()),(69===DMe||101===DMe)&&(DMe=PMe(),(43===DMe||45===DMe)&&PMe(),BMe())}function BMe(){if(DMe<48||DMe>57)throw FMe("Expected decimal digit.");do{PMe()}while(DMe>=48&&DMe<=57)}function jMe(e,t,n){var r;const i=[];for(const o of n.members)if(o){const n=null===(r=o.key)||void 0===r?void 0:r.value,a=t[n];if(a)for(const[t,r]of VMe(a,o.value))i.push(zMe(e,t,r));else i.push(zMe(e,o.key,`Variable "$${n}" does not appear in any GraphQL query.`))}return i}function VMe(e,t){if(!e||!t)return[];if(e instanceof fh)return"Null"===t.kind?[[t,`Type "${e}" is non-nullable and cannot be null.`]]:VMe(e.ofType,t);if("Null"===t.kind)return[];if(e instanceof dh){const n=e.ofType;if("Array"===t.kind){return UMe(t.values||[],(e=>VMe(n,e)))}return VMe(n,t)}if(e instanceof Rh){if("Object"!==t.kind)return[[t,`Type "${e}" must be an Object.`]];const n=Object.create(null),r=UMe(t.members,(t=>{var r;const i=null===(r=null==t?void 0:t.key)||void 0===r?void 0:r.value;n[i]=!0;const o=e.getFields()[i];if(!o)return[[t.key,`Type "${e}" does not have a field "${i}".`]];return VMe(o?o.type:void 0,t.value)}));for(const i of Object.keys(e.getFields())){const o=e.getFields()[i];!n[i]&&o.type instanceof fh&&!o.defaultValue&&r.push([t,`Object of type "${e}" is missing required field "${i}".`])}return r}return"Boolean"===e.name&&"Boolean"!==t.kind||"String"===e.name&&"String"!==t.kind||"ID"===e.name&&"Number"!==t.kind&&"String"!==t.kind||"Float"===e.name&&"Number"!==t.kind||"Int"===e.name&&("Number"!==t.kind||(0|t.value)!==t.value)||(e instanceof Oh||e instanceof Dh)&&("String"!==t.kind&&"Number"!==t.kind&&"Boolean"!==t.kind&&"Null"!==t.kind||$Me(e.parseValue(t.value)))?[[t,`Expected value of type "${e}".`]]:[]}function zMe(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function $Me(e){return null==e||e!=e}function UMe(e,t){return Array.prototype.concat.apply([],e.map(t))}mMe(_Me,"JSONSyntaxError"),mMe(FMe,"syntaxError"),mMe(IMe,"skip"),mMe(PMe,"ch"),mMe(OMe,"lex"),mMe(LMe,"readString"),mMe(MMe,"readHex"),mMe(RMe,"readNumber"),mMe(BMe,"readDigits"),vPe.registerHelper("lint","graphql-variables",((e,t,n)=>{if(!e)return[];let r;try{r=gMe(e)}catch(o){if(o instanceof _Me)return[zMe(n,o.position,o.message)];throw o}const{variableToType:i}=t;return i?jMe(n,i,r):[]})),mMe(jMe,"validateVariables"),mMe(VMe,"validateValue"),mMe(zMe,"lintError"),mMe($Me,"isNullish"),mMe(UMe,"mapCat");const HMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qMe=Object.defineProperty;vPe.defineMode("graphql-variables",(e=>{const t=Qae({eatWhitespace:e=>e.eatSpace(),lexRules:WMe,parseRules:GMe,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const WMe={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},GMe={Document:[qae("{"),Uae("Variable",$ae(qae(","))),qae("}")],Variable:[KMe("variable"),qae(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[Hae("Number","number")],StringValue:[Hae("String","string")],BooleanValue:[Hae("Keyword","builtin")],NullValue:[Hae("Keyword","keyword")],ListValue:[qae("["),Uae("Value",$ae(qae(","))),qae("]")],ObjectValue:[qae("{"),Uae("ObjectField",$ae(qae(","))),qae("}")],ObjectField:[KMe("attribute"),qae(":"),"Value"]};function KMe(e){return{style:e,match:e=>"String"===e.kind,update(e,t){e.name=t.value.slice(1,-1)}}}((e,t)=>{qMe(e,"name",{value:t,configurable:!0})})(KMe,"namedKey");const YMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));vPe.defineMode("graphql-results",(e=>{const t=Qae({eatWhitespace:e=>e.eatSpace(),lexRules:XMe,parseRules:JMe,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const XMe={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},JMe={Document:[qae("{"),Uae("Entry",qae(",")),qae("}")],Entry:[Hae("String","def"),qae(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[Hae("Number","number")],StringValue:[Hae("String","string")],BooleanValue:[Hae("Keyword","builtin")],NullValue:[Hae("Keyword","keyword")],ListValue:[qae("["),Uae("Value",qae(",")),qae("]")],ObjectValue:[qae("{"),Uae("ObjectField",qae(",")),qae("}")],ObjectField:[Hae("String","property"),qae(":"),"Value"]},QMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})); + */!function(e,t){(function(){var n,i="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,u=64,c=128,p=256,d=1/0,f=9007199254740991,h=NaN,m=4294967295,g=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",u],["rearg",p]],y="[object Arguments]",v="[object Array]",b="[object Boolean]",x="[object Date]",E="[object Error]",D="[object Function]",w="[object GeneratorFunction]",C="[object Map]",S="[object Number]",T="[object Object]",k="[object Promise]",A="[object RegExp]",N="[object Set]",_="[object String]",F="[object Symbol]",I="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",z="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(G.source),X=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(re.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ee=/($^)/,De=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Ne="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_e="['’]",Fe="["+we+"]",Ie="["+Ne+"]",Pe="["+Ce+"]",Oe="\\d+",Le="["+Se+"]",Me="["+Te+"]",Re="[^"+we+Ne+Oe+Se+Te+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+ke+"]",Ue="\\u200d",He="(?:"+Me+"|"+Re+")",qe="(?:"+$e+"|"+Re+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Pe+"|"+Be+")"+"?",Ye="["+Ae+"]?",Xe=Ye+Ke+("(?:"+Ue+"(?:"+[je,Ve,ze].join("|")+")"+Ye+Ke+")*"),Je="(?:"+[Le,Ve,ze].join("|")+")"+Xe,Qe="(?:"+[je+Pe+"?",Pe,Ve,ze,Fe].join("|")+")",Ze=RegExp(_e,"g"),et=RegExp(Pe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([$e+"?"+Me+"+"+We+"(?="+[Ie,$e,"$"].join("|")+")",qe+"+"+Ge+"(?="+[Ie,$e+He,"$"].join("|")+")",$e+"?"+He+"+"+We,$e+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Je].join("|"),"g"),rt=RegExp("["+Ue+we+Ce+Ae+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[L]=st[M]=st[R]=st[B]=st[j]=st[V]=st[z]=st[$]=st[U]=!0,st[y]=st[v]=st[P]=st[b]=st[O]=st[x]=st[E]=st[D]=st[C]=st[S]=st[T]=st[A]=st[N]=st[_]=st[I]=!1;var lt={};lt[y]=lt[v]=lt[P]=lt[O]=lt[b]=lt[x]=lt[L]=lt[M]=lt[R]=lt[B]=lt[j]=lt[C]=lt[S]=lt[T]=lt[A]=lt[N]=lt[_]=lt[F]=lt[V]=lt[z]=lt[$]=lt[U]=!0,lt[E]=lt[D]=lt[I]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,pt=parseInt,dt="object"==typeof r&&r&&r.Object===Object&&r,ft="object"==typeof self&&self&&self.Object===Object&&self,ht=dt||ft||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,vt=yt&&dt.process,bt=function(){try{var e=gt&>.require&>.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(rK){}}(),xt=bt&&bt.isArrayBuffer,Et=bt&&bt.isDate,Dt=bt&&bt.isMap,wt=bt&&bt.isRegExp,Ct=bt&&bt.isSet,St=bt&&bt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function kt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Pt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&$t(t,e[n],0)>-1;);return n}var rn=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ut[e]}function sn(e){return rt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var gn=function e(t){var r,ae=(t=null==t?ht:gn.defaults(ht.Object(),t,gn.pick(ht,ot))).Array,we=t.Date,Ce=t.Error,Se=t.Function,Te=t.Math,ke=t.Object,Ae=t.RegExp,Ne=t.String,_e=t.TypeError,Fe=ae.prototype,Ie=Se.prototype,Pe=ke.prototype,Oe=t["__core-js_shared__"],Le=Ie.toString,Me=Pe.hasOwnProperty,Re=0,Be=(r=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=Pe.toString,Ve=Le.call(ke),ze=ht._,$e=Ae("^"+Le.call(Me).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=yt?t.Buffer:n,He=t.Symbol,qe=t.Uint8Array,We=Ue?Ue.allocUnsafe:n,Ge=un(ke.getPrototypeOf,ke),Ke=ke.create,Ye=Pe.propertyIsEnumerable,Xe=Fe.splice,Je=He?He.isConcatSpreadable:n,Qe=He?He.iterator:n,tt=He?He.toStringTag:n,rt=function(){try{var e=po(ke,"defineProperty");return e({},"",{}),e}catch(rK){}}(),ut=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ht.Date.now&&we.now,ft=t.setTimeout!==ht.setTimeout&&t.setTimeout,mt=Te.ceil,gt=Te.floor,vt=ke.getOwnPropertySymbols,bt=Ue?Ue.isBuffer:n,jt=t.isFinite,Gt=Fe.join,yn=un(ke.keys,ke),vn=Te.max,bn=Te.min,xn=we.now,En=t.parseInt,Dn=Te.random,wn=Fe.reverse,Cn=po(t,"DataView"),Sn=po(t,"Map"),Tn=po(t,"Promise"),kn=po(t,"Set"),An=po(t,"WeakMap"),Nn=po(ke,"create"),_n=An&&new An,Fn={},In=zo(Cn),Pn=zo(Sn),On=zo(Tn),Ln=zo(kn),Mn=zo(An),Rn=He?He.prototype:n,Bn=Rn?Rn.valueOf:n,jn=Rn?Rn.toString:n;function Vn(e){if(is(e)&&!Ga(e)&&!(e instanceof Hn)){if(e instanceof Un)return e;if(Me.call(e,"__wrapped__"))return $o(e)}return new Un(e)}var zn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ke)return Ke(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function lr(e,t,r,i,o,a){var s,l=1&t,u=2&t,c=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!rs(e))return e;var p=Ga(e);if(p){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ni(e,s)}else{var d=mo(e),f=d==D||d==w;if(Ja(e))return wi(e,l);if(d==T||d==y||f&&!o){if(s=u||f?{}:yo(e),!l)return u?function(e,t){return _i(e,ho(e),t)}(e,function(e,t){return e&&_i(t,Ls(t),e)}(s,e)):function(e,t){return _i(e,fo(e),t)}(e,ir(s,e))}else{if(!lt[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Ci(e);case b:case x:return new r(+e);case O:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case R:case B:case j:case V:case z:case $:case U:return Si(e,n);case C:return new r;case S:case _:return new r(e);case A:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case N:return new r;case F:return i=e,Bn?ke(Bn.call(i)):{}}var i}(e,d,l)}}a||(a=new Yn);var h=a.get(e);if(h)return h;a.set(e,s),us(e)?e.forEach((function(n){s.add(lr(n,t,r,n,e,a))})):os(e)&&e.forEach((function(n,i){s.set(i,lr(n,t,r,i,e,a))}));var m=p?n:(c?u?io:ro:u?Ls:Os)(e);return At(m||e,(function(n,i){m&&(n=e[i=n]),tr(s,i,lr(n,t,r,i,e,a))})),s}function ur(e,t,r){var i=r.length;if(null==e)return!i;for(e=ke(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function cr(e,t,r){if("function"!=typeof e)throw new _e(i);return Fo((function(){e.apply(n,r)}),t)}function pr(e,t,n,r){var i=-1,o=It,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Ot(t,Qt(n))),r?(o=Pt,a=!1):t.length>=200&&(o=en,a=!1,t=new Kn(t));e:for(;++i-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Sn||Wn),string:new qn}},Gn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return uo(this,e).get(e)},Gn.prototype.has=function(e){return uo(this,e).has(e)},Gn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,o),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var dr=Pi(xr),fr=Pi(Er,!0);function hr(e,t){var n=!0;return dr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,r){for(var i=-1,o=e.length;++i0&&n(s)?t>1?yr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var vr=Oi(),br=Oi(!0);function xr(e,t){return e&&vr(e,t,Os)}function Er(e,t){return e&&br(e,t,Os)}function Dr(e,t){return Ft(t,(function(t){return es(e[t])}))}function wr(e,t){for(var r=0,i=(t=bi(t,e)).length;null!=e&&rt}function kr(e,t){return null!=e&&Me.call(e,t)}function Ar(e,t){return null!=e&&t in ke(e)}function Nr(e,t,r){for(var i=r?Pt:It,o=e[0].length,a=e.length,s=a,l=ae(a),u=1/0,c=[];s--;){var p=e[s];s&&t&&(p=Ot(p,Qt(t))),u=bn(p.length,u),l[s]=!r&&(t||o>=120&&p.length>=120)?new Kn(s&&p):n}p=e[0];var d=-1,f=l[0];e:for(;++d=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Xe.call(e,i,1):pi(e,i)}}return e}function Kr(e,t){return e+gt(Dn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Io(ko(e,t,al),e+"")}function Jr(e){return Jn(Us(e))}function Qr(e,t){var n=Us(e);return Lo(n,sr(t,0,n.length))}function Zr(e,t,r,i){if(!rs(e))return e;for(var o=-1,a=(t=bi(t,e)).length,s=a-1,l=e;null!=l&&++oi?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=ae(i);++r>>1,a=e[o];null!==a&&!ps(a)&&(n?a<=t:a=200){var u=t?null:Yi(e);if(u)return pn(u);a=!1,i=en,l=new Kn}else l=t?[]:s;e:for(;++r=i?e:ri(e,t,r)}var Di=ut||function(e){return ht.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Si(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=ps(e),s=t!==n,l=null===t,u=t==t,c=ps(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!o)return 1;if(!i&&!a&&!c&&e1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&xo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:n}}function ji(e){return no((function(t){var r=t.length,o=r,a=Un.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new _e(i);if(a&&!l&&"wrapper"==ao(s))var l=new Un([],!0)}for(o=l?o:r;++o1&&b.reverse(),d&&ul))return!1;var c=a.get(e),p=a.get(t);if(c&&p)return c==t&&p==e;var d=-1,f=!0,h=2&r?new Kn:n;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(g,(function(n){var r="_."+n[0];t&n[1]&&!It(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ue):[]}(r),n)))}function Oo(e){var t=0,r=0;return function(){var i=xn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Lo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ma(e){var t=Vn(e);return t.__chain__=!0,t}function ga(e,t){return t(e)}var ya=no((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&bo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ga,args:[o],thisArg:n}),new Un(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(o)}));var va=Fi((function(e,t,n){Me.call(e,n)?++e[n]:or(e,n,1)}));var ba=Bi(Wo),xa=Bi(Go);function Ea(e,t){return(Ga(e)?At:dr)(e,lo(t,3))}function Da(e,t){return(Ga(e)?Nt:fr)(e,lo(t,3))}var wa=Fi((function(e,t,n){Me.call(e,n)?e[n].push(t):or(e,n,[t])}));var Ca=Xr((function(e,t,n){var r=-1,i="function"==typeof t,o=Ya(e)?ae(e.length):[];return dr(e,(function(e){o[++r]=i?Tt(t,e,n):_r(e,t,n)})),o})),Sa=Fi((function(e,t,n){or(e,n,t)}));function Ta(e,t){return(Ga(e)?Ot:jr)(e,lo(t,3))}var ka=Fi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Aa=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xo(e,t[0],t[1])?t=[]:n>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,yr(t,1),[])})),Na=dt||function(){return ht.Date.now()};function _a(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ji(e,c,n,n,n,n,t)}function Fa(e,t){var r;if("function"!=typeof t)throw new _e(i);return e=ys(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var Ia=Xr((function(e,t,n){var r=1;if(n.length){var i=cn(n,so(Ia));r|=l}return Ji(e,r,t,n,i)})),Pa=Xr((function(e,t,n){var r=3;if(n.length){var i=cn(n,so(Pa));r|=l}return Ji(t,r,e,n,i)}));function Oa(e,t,r){var o,a,s,l,u,c,p=0,d=!1,f=!1,h=!0;if("function"!=typeof e)throw new _e(i);function m(t){var r=o,i=a;return o=a=n,p=t,l=e.apply(i,r)}function g(e){var r=e-c;return c===n||r>=t||r<0||f&&e-p>=s}function y(){var e=Na();if(g(e))return v(e);u=Fo(y,function(e){var n=t-(e-c);return f?bn(n,s-(e-p)):n}(e))}function v(e){return u=n,h&&o?m(e):(o=a=n,l)}function b(){var e=Na(),r=g(e);if(o=arguments,a=this,c=e,r){if(u===n)return function(e){return p=e,u=Fo(y,t),d?m(e):l}(c);if(f)return Di(u),u=Fo(y,t),m(c)}return u===n&&(u=Fo(y,t)),l}return t=bs(t)||0,rs(r)&&(d=!!r.leading,s=(f="maxWait"in r)?vn(bs(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h),b.cancel=function(){u!==n&&Di(u),p=0,o=c=a=u=n},b.flush=function(){return u===n?l:v(Na())},b}var La=Xr((function(e,t){return cr(e,1,t)})),Ma=Xr((function(e,t,n){return cr(e,bs(t)||0,n)}));function Ra(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Gn),n}function Ba(e){if("function"!=typeof e)throw new _e(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ra.Cache=Gn;var ja=xi((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Ot(t[0],Qt(lo())):Ot(yr(t,1),Qt(lo()))).length;return Xr((function(r){for(var i=-1,o=bn(r.length,n);++i=t})),Wa=Fr(function(){return arguments}())?Fr:function(e){return is(e)&&Me.call(e,"callee")&&!Ye.call(e,"callee")},Ga=ae.isArray,Ka=xt?Qt(xt):function(e){return is(e)&&Sr(e)==P};function Ya(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return is(e)&&Ya(e)}var Ja=bt||bl,Qa=Et?Qt(Et):function(e){return is(e)&&Sr(e)==x};function Za(e){if(!is(e))return!1;var t=Sr(e);return t==E||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Sr(e);return t==D||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==ys(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=Dt?Qt(Dt):function(e){return is(e)&&mo(e)==C};function as(e){return"number"==typeof e||is(e)&&Sr(e)==S}function ss(e){if(!is(e)||Sr(e)!=T)return!1;var t=Ge(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Le.call(n)==Ve}var ls=wt?Qt(wt):function(e){return is(e)&&Sr(e)==A};var us=Ct?Qt(Ct):function(e){return is(e)&&mo(e)==N};function cs(e){return"string"==typeof e||!Ga(e)&&is(e)&&Sr(e)==_}function ps(e){return"symbol"==typeof e||is(e)&&Sr(e)==F}var ds=St?Qt(St):function(e){return is(e)&&ns(e.length)&&!!st[Sr(e)]};var fs=Wi(Br),hs=Wi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Ya(e))return cs(e)?fn(e):Ni(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=mo(e);return(t==C?ln:t==N?pn:Us)(e)}function gs(e){return e?(e=bs(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ys(e){var t=gs(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?sr(ys(e),0,m):0}function bs(e){if("number"==typeof e)return e;if(ps(e))return h;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ge.test(e);return n||ve.test(e)?pt(e.slice(2),n?2:8):me.test(e)?h:+e}function xs(e){return _i(e,Ls(e))}function Es(e){return null==e?"":ui(e)}var Ds=Ii((function(e,t){if(Co(t)||Ya(t))_i(t,Os(t),e);else for(var n in t)Me.call(t,n)&&tr(e,n,t[n])})),ws=Ii((function(e,t){_i(t,Ls(t),e)})),Cs=Ii((function(e,t,n,r){_i(t,Ls(t),e,r)})),Ss=Ii((function(e,t,n,r){_i(t,Os(t),e,r)})),Ts=no(ar);var ks=Xr((function(e,t){e=ke(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&xo(t[0],t[1],o)&&(i=1);++r1),t})),_i(e,io(e),n),r&&(n=lr(n,7,eo));for(var i=t.length;i--;)pi(n,t[i]);return n}));var js=no((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return _s(e,n)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var n=Ot(io(e),(function(e){return[e]}));return t=lo(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var zs=Xi(Os),$s=Xi(Ls);function Us(e){return null==e?[]:Zt(e,Os(e))}var Hs=Mi((function(e,t,n){return t=t.toLowerCase(),e+(n?qs(t):t)}));function qs(e){return Zs(Es(e).toLowerCase())}function Ws(e){return(e=Es(e))&&e.replace(xe,rn).replace(et,"")}var Gs=Mi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ks=Mi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ys=Li("toLowerCase");var Xs=Mi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Js=Mi((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Qs=Mi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=Li("toUpperCase");function el(e,t,r){return e=Es(e),(t=r?n:t)===n?function(e){return it.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var tl=Xr((function(e,t){try{return Tt(e,n,t)}catch(rK){return Za(rK)?rK:new Ce(rK)}})),nl=no((function(e,t){return At(t,(function(t){t=Vo(t),or(e,t,Ia(e[t],e))})),e}));function rl(e){return function(){return e}}var il=ji(),ol=ji(!0);function al(e){return e}function sl(e){return Lr("function"==typeof e?e:lr(e,1))}var ll=Xr((function(e,t){return function(n){return _r(n,e,t)}})),ul=Xr((function(e,t){return function(n){return _r(e,n,t)}}));function cl(e,t,n){var r=Os(t),i=Dr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Dr(t,Os(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return At(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ni(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})})),e}function pl(){}var dl=Ui(Ot),fl=Ui(_t),hl=Ui(Bt);function ml(e){return Eo(e)?Wt(Vo(e)):function(e){return function(t){return wr(t,e)}}(e)}var gl=qi(),yl=qi(!0);function vl(){return[]}function bl(){return!1}var xl=$i((function(e,t){return e+t}),0),El=Ki("ceil"),Dl=$i((function(e,t){return e/t}),1),wl=Ki("floor");var Cl,Sl=$i((function(e,t){return e*t}),1),Tl=Ki("round"),kl=$i((function(e,t){return e-t}),0);return Vn.after=function(e,t){if("function"!=typeof t)throw new _e(i);return e=ys(e),function(){if(--e<1)return t.apply(this,arguments)}},Vn.ary=_a,Vn.assign=Ds,Vn.assignIn=ws,Vn.assignInWith=Cs,Vn.assignWith=Ss,Vn.at=Ts,Vn.before=Fa,Vn.bind=Ia,Vn.bindAll=nl,Vn.bindKey=Pa,Vn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},Vn.chain=ma,Vn.chunk=function(e,t,r){t=(r?xo(e,t,r):t===n)?1:vn(ys(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+r),(i=i===n||i>o?o:ys(i))<0&&(i+=o),i=r>i?0:vs(i);r>>0)?(e=Es(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?Ei(fn(e),0,r):e.split(t,r):[]},Vn.spread=function(e,t){if("function"!=typeof e)throw new _e(i);return t=null==t?0:vn(ys(t),0),Xr((function(n){var r=n[t],i=Ei(n,0,t);return r&&Lt(i,r),Tt(e,this,i)}))},Vn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Vn.take=function(e,t,r){return e&&e.length?ri(e,0,(t=r||t===n?1:ys(t))<0?0:t):[]},Vn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=r||t===n?1:ys(t)))<0?0:t,i):[]},Vn.takeRightWhile=function(e,t){return e&&e.length?fi(e,lo(t,3),!1,!0):[]},Vn.takeWhile=function(e,t){return e&&e.length?fi(e,lo(t,3)):[]},Vn.tap=function(e,t){return t(e),e},Vn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new _e(i);return rs(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Oa(e,t,{leading:r,maxWait:t,trailing:o})},Vn.thru=ga,Vn.toArray=ms,Vn.toPairs=zs,Vn.toPairsIn=$s,Vn.toPath=function(e){return Ga(e)?Ot(e,Vo):ps(e)?[e]:Ni(jo(Es(e)))},Vn.toPlainObject=xs,Vn.transform=function(e,t,n){var r=Ga(e),i=r||Ja(e)||ds(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?zn(Ge(e)):{}}return(i?At:xr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Vn.unary=function(e){return _a(e,1)},Vn.union=ia,Vn.unionBy=oa,Vn.unionWith=aa,Vn.uniq=function(e){return e&&e.length?ci(e):[]},Vn.uniqBy=function(e,t){return e&&e.length?ci(e,lo(t,2)):[]},Vn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Vn.unset=function(e,t){return null==e||pi(e,t)},Vn.unzip=sa,Vn.unzipWith=la,Vn.update=function(e,t,n){return null==e?e:di(e,t,vi(n))},Vn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:di(e,t,vi(r),i)},Vn.values=Us,Vn.valuesIn=function(e){return null==e?[]:Zt(e,Ls(e))},Vn.without=ua,Vn.words=el,Vn.wrap=function(e,t){return Va(vi(t),e)},Vn.xor=ca,Vn.xorBy=pa,Vn.xorWith=da,Vn.zip=fa,Vn.zipObject=function(e,t){return gi(e||[],t||[],tr)},Vn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Zr)},Vn.zipWith=ha,Vn.entries=zs,Vn.entriesIn=$s,Vn.extend=ws,Vn.extendWith=Cs,cl(Vn,Vn),Vn.add=xl,Vn.attempt=tl,Vn.camelCase=Hs,Vn.capitalize=qs,Vn.ceil=El,Vn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),sr(bs(e),t,r)},Vn.clone=function(e){return lr(e,4)},Vn.cloneDeep=function(e){return lr(e,5)},Vn.cloneDeepWith=function(e,t){return lr(e,5,t="function"==typeof t?t:n)},Vn.cloneWith=function(e,t){return lr(e,4,t="function"==typeof t?t:n)},Vn.conformsTo=function(e,t){return null==t||ur(e,t,Os(t))},Vn.deburr=Ws,Vn.defaultTo=function(e,t){return null==e||e!=e?t:e},Vn.divide=Dl,Vn.endsWith=function(e,t,r){e=Es(e),t=ui(t);var i=e.length,o=r=r===n?i:sr(ys(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},Vn.eq=Ua,Vn.escape=function(e){return(e=Es(e))&&X.test(e)?e.replace(K,on):e},Vn.escapeRegExp=function(e){return(e=Es(e))&&ie.test(e)?e.replace(re,"\\$&"):e},Vn.every=function(e,t,r){var i=Ga(e)?_t:hr;return r&&xo(e,t,r)&&(t=n),i(e,lo(t,3))},Vn.find=ba,Vn.findIndex=Wo,Vn.findKey=function(e,t){return Vt(e,lo(t,3),xr)},Vn.findLast=xa,Vn.findLastIndex=Go,Vn.findLastKey=function(e,t){return Vt(e,lo(t,3),Er)},Vn.floor=wl,Vn.forEach=Ea,Vn.forEachRight=Da,Vn.forIn=function(e,t){return null==e?e:vr(e,lo(t,3),Ls)},Vn.forInRight=function(e,t){return null==e?e:br(e,lo(t,3),Ls)},Vn.forOwn=function(e,t){return e&&xr(e,lo(t,3))},Vn.forOwnRight=function(e,t){return e&&Er(e,lo(t,3))},Vn.get=Ns,Vn.gt=Ha,Vn.gte=qa,Vn.has=function(e,t){return null!=e&&go(e,t,kr)},Vn.hasIn=_s,Vn.head=Yo,Vn.identity=al,Vn.includes=function(e,t,n,r){e=Ya(e)?e:Us(e),n=n&&!r?ys(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),cs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&$t(e,t,n)>-1},Vn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=vn(r+i,0)),$t(e,t,i)},Vn.inRange=function(e,t,r){return t=gs(t),r===n?(r=t,t=0):r=gs(r),function(e,t,n){return e>=bn(t,n)&&e=-9007199254740991&&e<=f},Vn.isSet=us,Vn.isString=cs,Vn.isSymbol=ps,Vn.isTypedArray=ds,Vn.isUndefined=function(e){return e===n},Vn.isWeakMap=function(e){return is(e)&&mo(e)==I},Vn.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==Sr(e)},Vn.join=function(e,t){return null==e?"":Gt.call(e,t)},Vn.kebabCase=Gs,Vn.last=Zo,Vn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ys(r))<0?vn(i+o,0):bn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,Ht,o,!0)},Vn.lowerCase=Ks,Vn.lowerFirst=Ys,Vn.lt=fs,Vn.lte=hs,Vn.max=function(e){return e&&e.length?mr(e,al,Tr):n},Vn.maxBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Tr):n},Vn.mean=function(e){return qt(e,al)},Vn.meanBy=function(e,t){return qt(e,lo(t,2))},Vn.min=function(e){return e&&e.length?mr(e,al,Br):n},Vn.minBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Br):n},Vn.stubArray=vl,Vn.stubFalse=bl,Vn.stubObject=function(){return{}},Vn.stubString=function(){return""},Vn.stubTrue=function(){return!0},Vn.multiply=Sl,Vn.nth=function(e,t){return e&&e.length?Ur(e,ys(t)):n},Vn.noConflict=function(){return ht._===this&&(ht._=ze),this},Vn.noop=pl,Vn.now=Na,Vn.pad=function(e,t,n){e=Es(e);var r=(t=ys(t))?dn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(gt(i),n)+e+Hi(mt(i),n)},Vn.padEnd=function(e,t,n){e=Es(e);var r=(t=ys(t))?dn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var o=Dn();return bn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Vn.reduce=function(e,t,n){var r=Ga(e)?Mt:Kt,i=arguments.length<3;return r(e,lo(t,4),n,i,dr)},Vn.reduceRight=function(e,t,n){var r=Ga(e)?Rt:Kt,i=arguments.length<3;return r(e,lo(t,4),n,i,fr)},Vn.repeat=function(e,t,r){return t=(r?xo(e,t,r):t===n)?1:ys(t),Yr(Es(e),t)},Vn.replace=function(){var e=arguments,t=Es(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vn.result=function(e,t,r){var i=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=n);++if)return[];var n=m,r=bn(e,m);t=lo(t),e-=m;for(var i=Xt(r,t);++n=a)return e;var l=r-dn(i);if(l<1)return i;var u=s?Ei(s,0,l).join(""):e.slice(0,l);if(o===n)return u+i;if(s&&(l+=u.length-l),ls(o)){if(e.slice(l).search(o)){var c,p=u;for(o.global||(o=Ae(o.source,Es(he.exec(o))+"g")),o.lastIndex=0;c=o.exec(p);)var d=c.index;u=u.slice(0,d===n?l:d)}}else if(e.indexOf(ui(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},Vn.unescape=function(e){return(e=Es(e))&&Y.test(e)?e.replace(G,mn):e},Vn.uniqueId=function(e){var t=++Re;return Es(e)+t},Vn.upperCase=Qs,Vn.upperFirst=Zs,Vn.each=Ea,Vn.eachRight=Da,Vn.first=Yo,cl(Vn,(Cl={},xr(Vn,(function(e,t){Me.call(Vn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Vn.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vn[e].placeholder=Vn})),At(["drop","take"],(function(e,t){Hn.prototype[e]=function(r){r=r===n?1:vn(ys(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,m),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),At(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),At(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}})),At(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(al)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Hn(this):this.map((function(n){return _r(n,e,t)}))})),Hn.prototype.reject=function(e){return this.filter(Ba(lo(e)))},Hn.prototype.slice=function(e,t){e=ys(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ys(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(m)},xr(Hn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Vn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Vn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Hn,u=s[0],c=l||Ga(t),p=function(e){var t=o.apply(Vn,Lt([e],s));return i&&d?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,h=a&&!d,m=l&&!f;if(!a&&c){t=m?t:new Hn(this);var g=e.apply(t,s);return g.__actions__.push({func:ga,args:[p],thisArg:n}),new Un(g,d)}return h&&m?e.apply(this,s):(g=this.thru(p),h?i?g.value()[0]:g.value():g)})})),At(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Fe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Vn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),xr(Hn.prototype,(function(e,t){var n=Vn[t];if(n){var r=n.name+"";Me.call(Fn,r)||(Fn[r]=[]),Fn[r].push({name:t,func:n})}})),Fn[Vi(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Vn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var i=$o(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Vn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:ga,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Vn.prototype.toJSON=Vn.prototype.valueOf=Vn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Vn.prototype.first=Vn.prototype.head,Qe&&(Vn.prototype[Qe]=function(){return this}),Vn}();gt?((gt.exports=gn)._=gn,mt._=gn):ht._=gn}).call(r)}(FIe,FIe.exports);const IIe=i(FIe.exports),PIe="Checkbox",[OIe,LIe]=TA(PIe),[MIe,RIe]=OIe(PIe),BIe=H.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:u,...c}=e,[p,d]=H.useState(null),f=cA(t,(e=>d(e))),h=H.useRef(!1),m=!p||Boolean(p.closest("form")),[g=!1,y]=RA({prop:i,defaultProp:o,onChange:u}),v=H.useRef(g);return H.useEffect((()=>{const e=null==p?void 0:p.form;if(e){const t=()=>y(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,y]),H.createElement(MIe,{scope:n,state:g,disabled:s},H.createElement(OA.button,lA({type:"button",role:"checkbox","aria-checked":VIe(g)?"mixed":g,"aria-required":a,"data-state":zIe(g),"data-disabled":s?"":void 0,disabled:s,value:l},c,{ref:f,onKeyDown:SA(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:SA(e.onClick,(e=>{y((e=>!!VIe(e)||!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&H.createElement(jIe,{control:p,bubbles:!h.current,name:r,value:l,checked:g,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))})),jIe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=H.useRef(null),a=MTe(n),s=hle(t);return H.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,"checked").set;if(a!==n&&i){const t=new Event("click",{bubbles:r});e.indeterminate=VIe(n),i.call(e,!VIe(n)&&n),e.dispatchEvent(t)}}),[a,n,r]),H.createElement("input",lA({type:"checkbox","aria-hidden":!0,defaultChecked:!VIe(n)&&n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function VIe(e){return"indeterminate"===e}function zIe(e){return VIe(e)?"indeterminate":e?"checked":"unchecked"}const $Ie=BIe,UIe=H.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=RIe("CheckboxIndicator",n);return H.createElement(rN,{present:r||VIe(o.state)||!0===o.state},H.createElement(OA.span,lA({"data-state":zIe(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))})),HIe=H.forwardRef((({className:e,...t},n)=>ee.jsx($Ie,{ref:n,className:ed("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:ee.jsx(UIe,{className:ed("flex items-center justify-center text-current"),children:ee.jsx(Fk,{className:"h-4 w-4"})})})));HIe.displayName=$Ie.displayName;const qIe="playground:env",WIe=(e,t,n)=>{window.playground=((e,t,n)=>({env:{set:(t,n)=>{const r=localStorage.getItem(qIe)||"{}",i=JSON.parse(r);i[e]||(i[e]={}),i[e][t]=n,localStorage.setItem(qIe,JSON.stringify(i)),window.dispatchEvent(new StorageEvent("local-storage",{key:qIe}))},get:t=>{var n;const r=localStorage.getItem(qIe)||"{}";return null==(n=JSON.parse(r)[e])?void 0:n[t]}},request:{body:t||null},response:{body:n||null},CryptoJS:_Ie}))(e,t,n)},GIe=()=>{delete window.playground},KIe=({script:e,close:t})=>{const n=CNe(),r=yNe(),i=H.useRef(null),o=H.useRef(null),a=H.useContext(kNe),{tabsState:{activeTabIndex:s,tabs:l}}=a,u=l[s].id;H.useEffect((()=>{r&&("dark"===n?r.editor.setTheme("wg-dark"):r.editor.setTheme("light"))}),[n,r]);const[c,p]=H.useState([]),d=H.useRef(null);H.useEffect((()=>{d.current&&d.current.scrollIntoView()}),[c]);const[f,h]=MNe(qIe,{}),[m,g]=H.useState(),y=ANe((e=>{g(e)}),500);H.useEffect((()=>{g(void 0)}),[f,y]);const[v,b]=MNe(`playground:${e.type}:selected`,{}),[x,E]=MNe("playground:script:tabState",{}),D=H.useCallback((({upsert:t,updatedTitle:n})=>{const r={...x};l.forEach((o=>{var a,u,c,p,d;const f=o.id;r[f]&&(null==(a=r[f][e.type])?void 0:a.id)===e.id?r[f][e.type]={...r[f][e.type],id:e.id,enabled:(null==(u=r[f][e.type])?void 0:u.enabled)||!1,content:null==(c=i.current)?void 0:c.getValue()}:t&&f===l[s].id&&(r[f]||(r[f]={}),r[f][e.type]={id:e.id,title:n||e.title,enabled:(null==(p=r[f][e.type])?void 0:p.enabled)||!1,content:null==(d=i.current)?void 0:d.getValue()})})),E(r)}),[l,s,e,x,E]);return n?ee.jsxs("div",{className:"flex flex-col",children:[ee.jsxs(V_e,{direction:"vertical",children:[ee.jsx(z_e,{defaultSize:70,minSize:20,children:ee.jsx(ENe,{theme:"dark"===n?"wg-dark":"light",className:"scrollbar-custom h-full text-xs",language:"javascript",defaultValue:e.content,loading:null,options:{automaticLayout:!0,language:"javascript",minimap:{enabled:!1},hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},suggest:{showWords:!1}},onMount:(e,t)=>{i.current=e,t.editor.defineTheme("wg-dark",DNe),"dark"===n&&t.editor.setTheme("wg-dark"),fetch("https://unpkg.com/@types/crypto-js@4.2.0/index.d.ts").then((e=>e.text())).then((e=>{t.languages.typescript.javascriptDefaults.addExtraLib(e,"crypto-js.d.ts"),t.languages.typescript.javascriptDefaults.addExtraLib("\n declare module 'crypto-js' {\n export = CryptoJS;\n }\n ","crypto-js-module.d.ts")})).catch((e=>console.error(e))),t.languages.typescript.javascriptDefaults.addExtraLib('\n interface JSONObject {\n [key: string]: JSONValue;\n }\n type JSONArray = JSONValue[];\n type JSONValue = string | number | boolean | JSONObject | JSONArray | null;\n\n interface Playground {\n /**\n * The env property contains methods to interact with local environment variables.\n */\n env: {\n /**\n * Sets a key-value pair for local environment variables.\n * @param name The key name.\n * @param value The value to store.\n */\n set(name: string, value: any): void;\n\n /**\n * Gets a value from local environment variables by key.\n * @param name The key name.\n * @returns The value associated with the key.\n */\n get(name: string): JSONValue;\n };\n\n /**\n * Represents the GraphQL request body.\n */\n request: {\n body: {\n /**\n * The GraphQL query string.\n */\n query: string;\n\n /**\n * The variables object associated with the GraphQL query.\n */\n variables?: { [key: string]?: JSONValue };\n\n /**\n * The name of the GraphQL operation (if specified).\n */\n operationName?: string;\n };\n };\n\n /**\n * Represents the GraphQL response body.\n */\n response: {\n body?: {\n /**\n * The data resulting from the GraphQL operation.\n */\n data?: T;\n };\n };\n\n /**\n * Exposes the crypto-js library for cryptographic operations.\n */\n CryptoJS: typeof import("crypto-js");\n }\n\n\n declare const playground: Playground;\n',"playground.d.ts")}},e.id)}),ee.jsx($_e,{}),ee.jsx(z_e,{minSize:10,defaultSize:30,children:ee.jsxs(V_e,{direction:"horizontal",children:[ee.jsx(z_e,{defaultSize:60,minSize:40,children:ee.jsxs("div",{className:"relative flex h-full flex-col py-4 pr-4 text-sm",children:[ee.jsx("p",{className:"pb-4",children:"Console Output"}),ee.jsxs("div",{className:"absolute right-3 top-3 flex gap-x-2",children:[ee.jsx(DA,{size:"icon-sm",variant:"outline",onClick:()=>{p([])},children:ee.jsx(Rk,{})}),ee.jsx(DA,{size:"icon-sm",variant:"outline",onClick:()=>{var e;const t=null==(e=i.current)?void 0:e.getValue();t&&(async e=>{const t=console.log;console.log=(...e)=>{const n=e.map((e=>null===e?"null":void 0===e?"undefined":"object"==typeof e?JSON.stringify(e,null,2):String(e))).join(" ");p((e=>[...e,n])),t(...e)};try{WIe(a.graphId);const t=new Function(`\n return (async () => {\n ${e}\n })();\n `);await t()}catch(n){p((e=>[...e,`Error: ${n.message}`]))}finally{GIe()}console.log=t})(t)},children:ee.jsx(Zk,{})})]}),ee.jsxs("div",{className:"scrollbar-custom h-full flex-1 overflow-auto",children:[c.map(((e,t)=>ee.jsx("div",{className:"border-b border-dotted py-1.5 after:content-['\\200b'] last:border-none ",children:e},t))),ee.jsx("div",{ref:d})]})]})}),ee.jsx($_e,{}),ee.jsx(z_e,{defaultSize:40,minSize:40,children:ee.jsxs("div",{className:"flex h-full flex-col",children:[ee.jsxs("div",{className:"flex items-center justify-between py-4 pl-4 text-sm",children:[ee.jsx("span",{children:"Environment Variables"}),ee.jsxs(Lne,{children:[ee.jsx(Mne,{children:m?ee.jsx(Rk,{className:"text-destructive"}):ee.jsx(Fk,{className:"text-success"})}),ee.jsx(Rne,{align:"end",children:m||"Valid"})]})]}),ee.jsx(ENe,{onChange:e=>{try{const t=JSON.parse(e||"{}");h({...f,[a.graphId]:t}),y(void 0)}catch(rK){y(rK.message)}},theme:"dark"===n?"wg-dark":"light",language:"json",value:JSON.stringify(f[a.graphId],null,2),loading:null,options:{automaticLayout:!0,language:"json",minimap:{enabled:!1},hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},lineNumbers:"off",folding:!1},onMount:(e,t)=>{o.current=e,t.editor.defineTheme("wg-dark",DNe),"dark"===n&&t.editor.setTheme("wg-dark")}},"env-editor")]})})]})})]}),ee.jsx(B9,{orientation:"horizontal"}),ee.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[ee.jsx(DA,{variant:"secondary",onClick:()=>{t()},children:"Cancel"}),ee.jsx(DA,{onClick:()=>{var n;b({...e,content:null==(n=i.current)?void 0:n.getValue(),updatedByTabId:u}),"pre-flight"!==e.type&&D({upsert:!0}),t()},children:"Save"})]})]}):null},YIe=({type:e})=>{const[t,n]=H.useState(!1),[r,i]=H.useState(),{tabsState:{activeTabIndex:o,tabs:a}}=H.useContext(kNe);return H.useEffect((()=>{var n,r;if(!t)return;const s={id:Date.now().toString(),content:"",title:"",type:e};if("pre-flight"===e){const e=localStorage.getItem("playground:pre-flight:selected"),t=JSON.parse(e&&"undefined"!==e?e:"{}");i((null==t?void 0:t.id)?t:s)}else{const t=JSON.parse(localStorage.getItem("playground:script:tabState")||"{}"),l=null==(n=a[o])?void 0:n.id;if(!l)return;const u=null==(r=t[l])?void 0:r[e];i((null==u?void 0:u.id)?u:s)}}),[t,o,a]),ee.jsxs(bF,{open:t,onOpenChange:e=>{e||i(void 0),n(e)},children:[ee.jsx(xF,{asChild:!0,children:ee.jsx(DA,{size:"icon-sm",variant:"secondary",children:ee.jsx(Jk,{})})}),ee.jsxs(wF,{className:"flex h-[90vh] max-w-[90vw] flex-col overflow-hidden",onInteractOutside:e=>e.preventDefault(),children:[ee.jsx(CF,{children:ee.jsxs(SF,{className:"capitalize",children:[e," Script"]})}),ee.jsx("div",{className:"grid h-full min-h-0 grid-cols-1 gap-4 divide-x",children:r&&ee.jsx(KIe,{script:r,close:()=>{n(!1)}})})]})]})},XIe=({type:e})=>{const[t]=MNe(`playground:${e}:selected`,null),[n,r]=MNe("playground:pre-flight:enabled",!0),[i,o]=MNe("playground:script:tabState",{}),{tabsState:{activeTabIndex:a,tabs:s}}=H.useContext(kNe),l=H.useMemo((()=>{var t,n,r;const o=null==(t=s[a])?void 0:t.id;if(o)return(null==(r=null==(n=i[o])?void 0:n[e])?void 0:r.enabled)||!1}),[a,s,i,e]),u=H.useCallback((t=>{const n=s[a].id,r={...i};r[n]||(r[n]={}),r[n][e]={...r[n][e],enabled:t},o(r)}),[s,a,i,e,o]);return ee.jsxs("div",{className:"flex items-center gap-4",children:[ee.jsx(HIe,{checked:"pre-flight"===e?n:l,onCheckedChange:t=>{"pre-flight"===e?r(!!t):u(!!t)}}),ee.jsx("div",{className:"w-28 flex-shrink-0 capitalize",children:e}),":",ee.jsxs("div",{className:"flex w-full items-center justify-between gap-4 rounded-lg border pl-2",children:[ee.jsx("div",{className:"select-none text-sm italic",children:t&&t.id?t.title||"untitled script":"None Selected"}),ee.jsx(YIe,{type:e})]})]})},JIe=()=>{const{tabsState:{activeTabIndex:e,tabs:t}}=H.useContext(kNe),[n,r]=MNe("playground:script:tabState",{});H.useEffect((()=>{r((e=>{if(0===t.length)return e;const n=Object.keys(e),r=t.map((e=>e.id));return n.forEach((t=>{r.includes(t)||delete e[t]})),e}))}),[t,r]);const[i,o]=MNe("playground:pre-operation:selected",null),[a,s]=MNe("playground:post-operation:selected",null);return H.useEffect((()=>{var r;const l=null==(r=t[e])?void 0:r.id;if(!l)return;const u=n[l];IIe.isEqual(i,null==u?void 0:u["pre-operation"])||(null==i?void 0:i.updatedByTabId)&&(null==i?void 0:i.updatedByTabId)!==l&&o(null==u?void 0:u["pre-operation"]),IIe.isEqual(a,null==u?void 0:u["post-operation"])||(null==a?void 0:a.updatedByTabId)&&(null==a?void 0:a.updatedByTabId)!==l&&s(null==u?void 0:u["post-operation"])}),[t,e,n,i,a,o,s]),ee.jsxs("div",{className:"flex h-full flex-1 flex-col gap-2 pl-1.5",children:[ee.jsx(XIe,{type:"pre-operation"}),ee.jsx(XIe,{type:"post-operation"})]})},QIe=()=>ee.jsx("div",{className:"border-t py-4 pl-6 pr-4",children:ee.jsx(XIe,{type:"pre-flight"})}),ZIe=e=>{for(const t in e)if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t))throw new TypeError(`Header name must be a valid HTTP token [${t}]`)},ePe=(e,t)=>{const n=JSON.parse(localStorage.getItem("playground:env")||"{}")[t];if(!n)return e;const r={};Object.entries(n).forEach((([e,t])=>{"true"===t||"false"===t?r[e]="true"===t:isNaN(t)||""===t?r[e]=t:r[e]=Number(t)}));for(const i in e){let t=e[i];const n=/{\s*{\s*(\w+)\s*}\s*}/g;"string"==typeof t&&(t=t.replace(n,((e,t)=>void 0!==r[t]?r[t]:(console.warn(`No value found for placeholder: ${t}`),e))),e[i]=t)}return e},tPe=async(e,t)=>{if(e)try{const t=new Function(`\n return (async () => {\n ${e}\n })();\n `);await t()}catch(n){console.error(n)}},nPe=e=>{const t=localStorage.getItem(e);return JSON.parse(t&&"undefined"!==t?t:"{}")},rPe=async(e,t,n,r,i,o)=>{var a;try{const s=o.headers;let l=(null==n?void 0:n.transformHeaders)?n.transformHeaders(s):{...s};if(l=ePe(l,"0"),ZIe(l),e&&t){const t=ky(e,hf(null==(a=JSON.parse(o.body))?void 0:a.query));if(t.length>0){const e={message:"Client-side validation failed. The request was not sent to the Router.",errors:t.map((e=>({message:e.message,path:e.path,locations:e.locations})))},n=new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json"}});return r(await n.clone().json()),n}}const u=JSON.parse(o.body);await(async(e,t)=>{WIe(e,t);const n=nPe("playground:pre-flight:selected"),r=localStorage.getItem("playground:pre-flight:enabled"),i=nPe("playground:pre-operation:selected");r&&"true"!==r||await tPe(n.content),i.enabled&&await tPe(i.content),GIe()})("0",u);const c=await fetch(i,{...o,headers:l}),p=await c.clone().json();return await(async(e,t,n)=>{const r=localStorage.getItem("playground:post-operation:selected"),i=JSON.parse(r&&"undefined"!==r?r:"{}");i.enabled&&(WIe(e,t,n),await tPe(i.content),GIe())})("0",u,p),r(await c.clone().json(),c.status,c.statusText),c}catch(rK){const t="Failed to fetch from router due to network errors. Please check network activity in browser dev tools for more details.",n=new Response(JSON.stringify(rK.message?"Failed to fetch"==rK.message?t:rK.message:t),{headers:{"Content-Type":"application/json"}});return r(await n.clone().json(),void 0,"Network Error"),n}},iPe=()=>{const{view:e,setView:t}=H.useContext(kNe),n=e=>"response"===e?ee.jsx(PTe,{className:"h-4 w-4 flex-shrink-0"}):"request-trace"===e?ee.jsx(ITe,{className:"h-4 w-4 flex-shrink-0"}):ee.jsx(Jv,{className:"h-4 w-4 flex-shrink-0"}),{status:r,statusText:i}=H.useContext(kNe),o=!!r&&r>=200&&r<300;return ee.jsxs("div",{className:"flex items-center gap-x-2",children:[(r||i)&&ee.jsxs(I9,{className:"h-8",variant:o?"success":"destructive",children:[!o&&ee.jsx(Gk,{className:"mr-1 h-4 w-4"}),r||i]}),ee.jsxs(vAe,{onValueChange:e=>{const n=document.getElementsByClassName("graphiql-response")[0],r=document.getElementById("art-visualization"),i=document.getElementById("planner-visualization");n&&r&&i&&("request-trace"===e?(n.classList.add("invisible"),n.classList.add("-z-50"),i.classList.add("invisible"),i.classList.add("-z-50"),r.classList.remove("invisible"),r.classList.remove("-z-50")):"query-plan"===e?(n.classList.add("invisible"),n.classList.add("-z-50"),r.classList.add("invisible"),r.classList.add("-z-50"),i.classList.remove("invisible"),i.classList.remove("-z-50")):(n.classList.remove("invisible"),n.classList.remove("-z-50"),r.classList.add("invisible"),r.classList.add("-z-50"),i.classList.add("invisible"),i.classList.add("-z-50")),t(e))},children:[ee.jsx(xAe,{className:"w-[180px]",children:ee.jsx(bAe,{children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n(e),OF(e)]})})}),ee.jsxs(EAe,{children:[ee.jsx(DAe,{value:"response",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("response"),"Response"]})}),ee.jsx(DAe,{value:"request-trace",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("request-trace"),"Request Trace"]})}),ee.jsx(DAe,{value:"query-plan",children:ee.jsxs("div",{className:"flex items-center gap-x-2",children:[n("query-plan"),"Query Plan"]})})]})]})]})},oPe=()=>{const{clientValidationEnabled:e,setClientValidationEnabled:t}=H.useContext(Zne);return ee.jsxs(Lne,{delayDuration:100,children:[ee.jsx(Mne,{asChild:!0,children:ee.jsx(DA,{onClick:()=>t(!e),variant:"ghost",size:"icon",className:"graphiql-toolbar-button",children:ee.jsx(OTe,{className:ed("graphiql-toolbar-icon",{"text-success":e})})})}),ee.jsx(Rne,{className:"rounded-md border bg-background px-2 py-1 !text-foreground text-base",children:e?"Client-side validation enabled":"Client-side validation disabled"})]})},aPe=()=>{const e=document.getElementById("response-toolbar"),t=document.getElementById("art-visualization"),n=document.getElementById("planner-visualization"),r=document.getElementById("toggle-client-validation"),i=document.getElementById("graphiql-wg-logo"),o=document.getElementById("scripts-section"),a=document.getElementById("pre-flight-script-section");return e&&t&&n&&r&&i&&o&&a?ee.jsxs(ee.Fragment,{children:[lp.createPortal(ee.jsx(iPe,{}),e),lp.createPortal(ee.jsx(TNe,{}),n),lp.createPortal(ee.jsx(tre,{}),t),lp.createPortal(ee.jsx(oPe,{}),r),lp.createPortal(ee.jsx(JIe,{}),o),lp.createPortal(ee.jsx(QIe,{}),a),lp.createPortal(ee.jsx("a",{href:"https://wundergraph.com",children:ee.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1080 1080",className:"mt-3 mx-auto",width:"35",height:"35",fill:"none",children:ee.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M447.099 231.913C405.967 244.337 367.742 264.878 334.682 292.323C320.832 268.71 298.796 251.002 272.754 242.557C313.865 205.575 362.202 177.525 414.709 160.178C467.216 142.832 522.751 136.567 577.803 141.781C632.855 146.994 686.227 163.571 734.544 190.465C746.769 197.27 758.603 204.698 770.004 212.711C770.394 212.542 770.785 212.376 771.179 212.213C785.976 206.085 802.259 204.482 817.967 207.607C833.676 210.733 848.105 218.446 859.429 229.771C870.754 241.096 878.465 255.525 881.589 271.233C884.712 286.941 883.107 303.223 876.976 318.018C870.845 332.814 860.464 345.459 847.146 354.355C833.828 363.252 818.171 367.999 802.154 367.997C791.52 367.997 780.991 365.902 771.167 361.833C761.343 357.763 752.417 351.799 744.898 344.28C737.379 336.76 731.415 327.834 727.347 318.01C723.279 308.186 721.186 297.657 721.187 287.024C721.187 282.871 721.506 278.742 722.135 274.672C713.657 268.849 704.889 263.426 695.859 258.426C658.269 237.612 616.889 224.541 574.163 219.988C531.437 215.434 488.232 219.489 447.099 231.913ZM319.489 348.564C319.489 363.809 315.185 378.728 307.094 391.613L323.693 420.326C307.59 439.476 285.501 452.638 260.995 457.683L244.582 429.298C237.31 429.844 229.959 429.408 222.73 427.971C207.024 424.848 192.597 417.138 181.273 405.816C169.949 394.495 162.237 380.069 159.112 364.365C155.986 348.661 157.588 332.382 163.715 317.588C169.841 302.794 180.217 290.149 193.531 281.251C206.845 272.354 222.498 267.604 238.511 267.601C249.145 267.6 259.674 269.693 269.499 273.761C279.324 277.829 288.251 283.793 295.77 291.311C303.29 298.829 309.255 307.755 313.325 317.578C317.394 327.402 319.489 337.931 319.489 348.564ZM260.998 457.685L400.599 699.132L442.692 772.036L484.794 699.132L537.279 608.237L589.621 698.805L631.691 771.687L673.783 698.794L744.391 576.462H859.708C861.079 564.36 861.767 552.19 861.769 540.01C861.771 527.83 861.08 515.66 859.697 503.558H702.288L694.971 516.229L631.67 625.857L579.327 535.278L537.235 462.374L495.208 535.289L442.692 626.184L323.7 420.328C307.596 439.478 285.506 452.64 260.998 457.685ZM861.77 540.003C861.768 552.183 861.08 564.353 859.709 576.455H937.128V503.551H859.709C861.088 515.653 861.776 527.823 861.77 540.003ZM937.154 503.558H938.332C939.411 515.563 940 527.721 940 540.01C940 760.902 760.967 940 540.027 940C319.088 940 140 760.924 140 540.031C139.942 500.879 145.66 461.933 156.968 424.449C175.493 444.394 200.696 456.845 227.794 459.44C221.851 485.163 218.231 515.061 218.231 540.01C218.231 717.668 362.259 861.764 540.038 861.764C705.462 861.764 841.629 736.99 859.731 576.462H937.154V503.558Z",className:"fill-foreground"})})}),i)]}):null};const sPe=e=>{const t=e.routingUrl||function(e,t,n){let r=e;return r.endsWith(n)?r=r.slice(0,-n.length):r.endsWith(n+"/")&&(r=r.slice(0,-n.length-1)),r=r.replace(/\/+$/,""),r+(t.startsWith("/")?t:`/${t}`)}(window.location.href,"{{graphqlURL}}","{{playgroundPath}}"),[n,r]=H.useState(!1),[i,o]=H.useState("response"),[a,s]=H.useState(null),[l,u]=H.useState(void 0),[c,p]=MNe("graphiql:headers","",{deserializer:e=>e,serializer:e=>e}),[d,f]=H.useState();H.useEffect((()=>{c&&!d&&f(c)}),[c,d]),H.useEffect((()=>{d&&p(d)}),[d]);const[h,m]=H.useState('{\n "X-WG-TRACE" : "true"\n}'),[g,y]=H.useState(""),[v,b]=H.useState(void 0),[x,E]=H.useState(""),[D,w]=H.useState(!0);H.useEffect((()=>{if(document.getElementById("response-toolbar")&&n)return;const t=document.getElementsByClassName("graphiql-sidebar-section")[0];if(t&&!e.hideLogo){const e=document.createElement("div");e.id="graphiql-wg-logo",t.prepend(e)}const i=document.getElementsByClassName("graphiql-session-header-right")[0];if(i){const e=document.getElementsByClassName("graphiql-logo")[0];if(e){e.classList.add("hidden");const t=document.createElement("div");t.id="response-toolbar",t.className="flex items-center justify-center mx-2",i.append(t)}}const o=document.getElementsByClassName("graphiql-editor-tools")[0],a=document.getElementsByClassName("graphiql-editor-tool")[0];if(o&&a&&!document.getElementById("scripts-tab")){const e=[o.childNodes[0],o.childNodes[1]],t=Array.from(a.childNodes),n=document.createElement("button");n.id="scripts-tab",n.className="graphiql-un-styled",n.textContent="Operation Scripts";const r=document.createElement("div");r.id="scripts-section",r.className="graphiql-editor hidden",e.forEach(((e,n)=>e.addEventListener("click",(()=>{e.className="graphiql-un-styled active",t[n].className="graphiql-editor",r.className="graphiql-editor hidden"})))),n.onclick=i=>{e[0].className="graphiql-un-styled",e[1].className="graphiql-un-styled",t[0].className="graphiql-editor hidden",t[1].className="graphiql-editor hidden",r.className="graphiql-editor",n.className="graphiql-un-styled active"},o.addEventListener("click",(e=>{var t;(null==(t=e.target)?void 0:t.closest(`#${n.id}`))||(n.className="graphiql-un-styled")})),o.insertBefore(n,o.childNodes[2]),a.appendChild(r)}const s=document.getElementsByClassName("graphiql-editors")[0];if(s){const e=document.createElement("div");e.id="pre-flight-script-section",s.appendChild(e)}const l=document.getElementsByClassName("graphiql-response")[0];if(l){const e=l.parentElement;if(e){e.id="response-parent",e.classList.add("relative");const t=document.createElement("div");t.id="art-visualization",t.className="flex flex-1 h-full w-full absolute invisible -z-50";const n=document.createElement("div");n.id="planner-visualization",n.className="flex flex-1 h-full w-full absolute invisible -z-50",e.append(t),e.append(n)}}const u=document.getElementsByClassName("graphiql-toolbar")[0];if(u){const e=document.createElement("div");e.id="toggle-client-validation",u.append(e)}r(!0)}));H.useEffect((()=>{(async()=>{const n=e.fetch?e.fetch:fetch,r=await n(t,{body:JSON.stringify({operationName:"IntrospectionQuery",query:ev()}),method:"POST",headers:JSON.parse(h)});s(nv((await r.json()).data))})()}),[h]);const[C,S]=H.useState(),[T,k]=H.useState(),A=H.useMemo((()=>{const n=(e,t,n)=>{y(JSON.stringify(e)),S(t),k(n)};return Xre({url:t,subscriptionUrl:t.replace("http","ws"),fetch:(...t)=>rPe(a,D,e.scripts,n,t[0],t[1])})}),[a,D]),[N]=FNe(l,300),[_]=FNe(h,300);H.useEffect((()=>{(async()=>{var e;if(a&&N&&t&&"query-plan"===i)try{const n=hf(N);if(ky(a,n).length>0)return void E("Invalid query");const r=JSON.parse(_||"{}");delete r["X-WG-TRACE"];let i={...r,"X-WG-Include-Query-Plan":"true","X-WG-Skip-Loader":"true","X-WG-DISABLE-TRACING":"true"};i=ePe(i,"0"),ZIe(i);const o=await fetch(t,{method:"POST",headers:i,body:JSON.stringify({query:N})}),s=await o.json();if(!(null==(e=null==s?void 0:s.extensions)?void 0:e.queryPlan))throw new Error("No query plan found");E(""),b(s.extensions.queryPlan)}catch(n){b(void 0),E(n.message||"Network error")}})()}),[N,_,t,a,i]);const[F,I]=H.useState({activeTabIndex:0,tabs:[]});return ee.jsx(One,{children:ee.jsx(kNe.Provider,{value:{graphId:"0",tabsState:F,status:C,statusText:T,view:i,setView:o},children:ee.jsxs(Zne.Provider,{value:{query:l,headers:h,response:g,subgraphs:[],plan:v,planError:x,clientValidationEnabled:D,setClientValidationEnabled:w,forcedTheme:e.theme},children:[ee.jsx(DTe,{shouldPersistHeaders:!0,showPersistHeadersSettings:!1,fetcher:A,onEditQuery:u,defaultHeaders:'{\n "X-WG-TRACE" : "true"\n}',onEditHeaders:m,onTabChange:I,plugins:[bTe({showAttribution:!1})],forcedTheme:e.theme}),n&&ee.jsx(aPe,{})]})})})};function lPe(){return ee.jsx(sPe,{})}te.createRoot(document.getElementById("root")).render(ee.jsx(q.StrictMode,{children:ee.jsx(lPe,{})}));var uPe=Object.defineProperty,cPe=(e,t)=>uPe(e,"name",{value:t,configurable:!0});typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"&&self;function pPe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}cPe(pPe,"getDefaultExportFromCjs");var dPe,fPe={exports:{}};function hPe(){return dPe||(dPe=1,fPe.exports=function(){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),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),p=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),y=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),v=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),E=p&&e.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(p=!1,l=!0);var D=v&&(u||p&&(null==E||E<12.11)),w=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}cPe(C,"classTest");var S,T=cPe((function(e,t){var n=e.className,r=C(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:"")}}),"rmClass");function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return k(e).appendChild(t)}function N(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?L=cPe((function(e){e.selectionStart=0,e.selectionEnd=e.value.length}),"selectInput"):a&&(L=cPe((function(e){try{e.select()}catch{}}),"selectInput")),cPe(M,"bind"),cPe(R,"copyObj"),cPe(B,"countColumn");var j=cPe((function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)}),"Delayed");function V(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}cPe(W,"findColumn");var G=[""];function K(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}cPe(te,"isWordCharBasic"),cPe(ne,"isWordChar"),cPe(re,"isEmpty");var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}cPe(oe,"isExtendingChar"),cPe(ae,"skipExtendingChars"),cPe(se,"findFirst"),cPe(le,"iterateBidiSections");var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return r??ue}cPe(ce,"getBidiPartAt");var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(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":8204==n?"b":"L"}cPe(n,"charType");var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return cPe(l,"BidiSpan"),function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,p=[],d=0;d-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ee(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function De(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){De(e),we(e)}function Te(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),v&&e.ctrlKey&&1==t&&(t=3),t}cPe(me,"getHandlers"),cPe(ge,"off"),cPe(ye,"signal"),cPe(ve,"signalDOMEvent"),cPe(be,"signalCursorActivity"),cPe(xe,"hasHandler"),cPe(Ee,"eventMixin"),cPe(De,"e_preventDefault"),cPe(we,"e_stopPropagation"),cPe(Ce,"e_defaultPrevented"),cPe(Se,"e_stop"),cPe(Te,"e_target"),cPe(ke,"e_button");var Ae,Ne,_e=function(){if(a&&s<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Fe(e){if(null==Ae){var t=N("span","​");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ae?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ie(e){if(null!=Ne)return Ne;var t=A(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return k(e),!(!n||n.left==n.right)&&(Ne=r.right-n.right<3)}cPe(Fe,"zeroWidthElement"),cPe(Ie,"hasBadBidiRects");var Pe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=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)&&0!=t.compareEndPoints("StartToEnd",t)},Le=function(){var e=N("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Me=null;function Re(e){if(null!=Me)return Me;var t=A(e,N("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return Me=Math.abs(n.left-r.left)>1}cPe(Re,"hasBadZoomedRects");var Be={},je={};function Ve(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function ze(e,t){je[e]=t}function $e(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=$e(t);var n=Be[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(He.hasOwnProperty(t.name)){var i=He[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}cPe(Ve,"defineMode"),cPe(ze,"defineMIME"),cPe($e,"resolveMode"),cPe(Ue,"getMode");var He={};function qe(e,t){R(t,He.hasOwnProperty(e)?He[e]:He[e]={})}function We(e,t){if(!0===t)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 Ge(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}cPe(qe,"extendMode"),cPe(We,"copyState"),cPe(Ge,"innerMode"),cPe(Ke,"startState");var Ye=cPe((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");function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new 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],o=i.chunkSize();if(t=e.first&&tn?it(n,Xe(e,n).text.length):dt(t,Xe(e,t.line).text.length)}function dt(e,t){var n=e.ch;return null==n||n>t?it(e.line,t):n<0?it(e.line,0):e}function ft(e,t){for(var n=[],r=0;r=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=cPe((function(e){return n?e.toLowerCase():e}),"cased");if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},cPe(Xe,"getLine"),cPe(Je,"getBetween"),cPe(Qe,"getLines"),cPe(Ze,"updateLineHeight"),cPe(et,"lineNo"),cPe(tt,"lineAtHeight"),cPe(nt,"isLine"),cPe(rt,"lineNumberFor"),cPe(it,"Pos"),cPe(ot,"cmp"),cPe(at,"equalCursorPos"),cPe(st,"copyPos"),cPe(lt,"maxPos"),cPe(ut,"minPos"),cPe(ct,"clipLine"),cPe(pt,"clipPos"),cPe(dt,"clipToLen"),cPe(ft,"clipPosArray");var ht=cPe((function(e,t){this.state=e,this.lookAhead=t}),"SavedContext"),mt=cPe((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");function gt(e,t,n,r){var i=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=cPe((function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,St(e,t.text,s.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&We(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Tt(e,t,n),a=o>r.first&&Xe(r,o-1).stateAfter,s=a?mt.fromSaved(r,a,o):new mt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){bt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.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}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof ht?new mt(e,We(e.mode,t.state),n,t.lookAhead):new mt(e,We(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ht(t,this.maxLookAhead):t},cPe(gt,"highlightLine"),cPe(yt,"getLineStyles"),cPe(vt,"getContextBefore"),cPe(bt,"processLine"),cPe(xt,"callBlankLine"),cPe(Et,"readToken");var Dt=cPe((function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n}),"Token");function wt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Xe(a,(t=pt(a,t)).line),u=vt(e,t.line,n),c=new Ye(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&bt(e,t,r,p.pos),p.pos=t.length,l=null):l=Ct(Et(n,p,r.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Xe(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ht?u.lookAhead:0)<=o.modeFrontier))return s;var c=B(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function kt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Xe(e,r).stateAfter;if(i&&(!(i instanceof ht)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new It(a,o.from,s?null:o.to))}}return r}function Rt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var c=[l,1],p=ot(u.from,s.from),d=ot(u.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&c.push({from:u.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function zt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,r,i){var o=Xe(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ot(u.to,n)>=0:ot(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ot(u.from,r)<=0:ot(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Gt(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Zt(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function en(e,t){var n=Xe(e,t),r=Jt(n);return n==r?t:et(r)}function tn(e,t){if(t>e.lastLine())return t;var n,r=Xe(e,t);if(!nn(e,r))return t;for(;n=Kt(r);)r=n.find(1,!0).line;return et(r)+1}function nn(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}cPe(_t,"seeReadOnlySpans"),cPe(Ft,"seeCollapsedSpans"),cPe(It,"MarkedSpan"),cPe(Pt,"getMarkedSpanFor"),cPe(Ot,"removeMarkedSpan"),cPe(Lt,"addMarkedSpan"),cPe(Mt,"markedSpansBefore"),cPe(Rt,"markedSpansAfter"),cPe(Bt,"stretchSpansOverChange"),cPe(jt,"clearEmptySpans"),cPe(Vt,"removeReadOnlyRanges"),cPe(zt,"detachMarkedSpans"),cPe($t,"attachMarkedSpans"),cPe(Ut,"extraLeft"),cPe(Ht,"extraRight"),cPe(qt,"compareCollapsedMarkers"),cPe(Wt,"collapsedSpanAtSide"),cPe(Gt,"collapsedSpanAtStart"),cPe(Kt,"collapsedSpanAtEnd"),cPe(Yt,"collapsedSpanAround"),cPe(Xt,"conflictingCollapsedRange"),cPe(Jt,"visualLine"),cPe(Qt,"visualLineEnd"),cPe(Zt,"visualLineContinued"),cPe(en,"visualLineNo"),cPe(tn,"visualLineEndNo"),cPe(nn,"lineIsHidden"),cPe(rn,"lineIsHiddenInner"),cPe(on,"heightAtLine"),cPe(an,"lineLength"),cPe(sn,"findMaxLine");var ln=cPe((function(e,t,n){this.text=e,$t(this,t),this.height=n?n(this):1}),"Line");function un(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),zt(e),$t(e,n);var i=r?r(e):1;i!=e.height&&Ze(e,i)}function cn(e){e.parent=null,zt(e)}ln.prototype.lineNo=function(){return et(this)},Ee(ln),cPe(un,"updateLine"),cPe(cn,"cleanUpLine");var pn={},dn={};function fn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?dn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function hn(e,t){var n=_("span",null,null,l?"padding-right: .1px":null),r={pre:_("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 o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=gn,Ie(e.display.measure)&&(a=de(o,e.doc.direction))&&(r.addToken=vn(r.addToken,a)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&et(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=O(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=O(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Fe(e.display.measure))),0==i?(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(l){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 ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=O(r.pre.className,r.textClass||"")),r}function mn(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,p=e.cm.state.specialChars,d=!1;if(p.test(t)){u=document.createDocumentFragment();for(var f=0;;){p.lastIndex=f;var h=p.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));a&&s<9?u.appendChild(N("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var y=void 0;if("\t"==h[0]){var v=e.cm.options.tabSize,b=v-e.col%v;(y=u.appendChild(N("span",K(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((y=u.appendChild(N("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((y=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?u.appendChild(N("span",[y])):u.appendChild(y),e.col+=1);e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||d||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var E=N("span",[u],x,o);if(l)for(var D in l)l.hasOwnProperty(D)&&"style"!=D&&"class"!=D&&E.setAttribute(D,l[D]);return e.content.appendChild(E)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&p.from<=u);d++);if(p.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,p.to-u),i,o,null,s,l),o=null,r=r.slice(p.to-u),u=p.to}}}function bn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,p,d,f=i.length,h=0,m=1,g="",y=0;;){if(y==h){l=u=c=s="",d=null,p=null,y=1/0;for(var v=[],b=void 0,x=0;xh||D.collapsed&&E.to==h&&E.from==h)){if(null!=E.to&&E.to!=h&&y>E.to&&(y=E.to,u=""),D.className&&(l+=" "+D.className),D.css&&(s=(s?s+";":"")+D.css),D.startStyle&&E.from==h&&(c+=" "+D.startStyle),D.endStyle&&E.to==y&&(b||(b=[])).push(D.endStyle,E.to),D.title&&((d||(d={})).title=D.title),D.attributes)for(var w in D.attributes)(d||(d={}))[w]=D.attributes[w];D.collapsed&&(!p||qt(p.marker,D)<0)&&(p=E)}else E.from>h&&y>E.from&&(y=E.from)}if(b)for(var C=0;C=f)break;for(var T=Math.min(f,y);;){if(g){var k=h+g.length;if(!p){var A=k>T?g.slice(0,T-h):g;t.addToken(t,A,a?a+l:l,c,h+A.length==y?u:"",s,d)}if(k>=T){g=g.slice(T-h),h=T;break}h=k,c=""}g=i.slice(o,o=n[m++]),a=fn(n[m++],t.cm.options)}}else for(var N=1;N2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Qn(e,t){var n=et(t=Jt(t)),r=e.display.externalMeasured=new En(e.doc,t,n);r.lineN=n;var i=r.built=hn(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}function Zn(e,t,n,r){return nr(e,tr(e,t),n,r)}function er(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function sr(e,t,n,r){var i,o=or(t.map,n,r),l=o.node,u=o.start,c=o.end,p=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(p=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Nr(e.display),top:h.top,bottom:h.bottom}:ir}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,y=(m+g)/2,v=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}cPe(c,"getBidi");var p=ce(s,l,u),d=ue,f=c(l,p,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function br(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Xe(e.doc,t.line),i=on(r)+Hn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=it(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Er(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=tt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Xe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(r,i);;){var s=Sr(e,a,i,t,n),l=Yt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Xe(r,i=u.line)}}function Dr(e,t,n,r){r-=hr(t);var i=t.text.length,o=se((function(t){return nr(e,n,t-1).bottom<=r}),i,0);return i=se((function(t){return nr(e,n,t).top>r}),o,i),{begin:o,end:i}}function wr(e,t,n,r){return n||(n=tr(e,t)),Dr(e,t,n,mr(e,t,nr(e,n,r),"line").top)}function Cr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Sr(e,t,n,r,i){i-=on(t);var o=tr(e,t),a=hr(t),s=0,l=t.text.length,u=!0,c=de(t,e.doc.direction);if(c){var p=(e.options.lineWrapping?kr:Tr)(e,t,n,o,c,r,i);s=(u=1!=p.level)?p.from:p.to-1,l=u?p.to:p.from-1}var d,f,h=null,m=null,g=se((function(t){var n=nr(e,o,t);return n.top+=a,n.bottom+=a,!!Cr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),y=!1;if(m){var v=r-m.left=x.bottom?1:0}return xr(n,g=ae(t.text,g,1),f,y,r-d)}function Tr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],u=1!=l.level;return Cr(vr(e,it(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=vr(e,it(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Cr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function kr(e,t,n,r,i,o,a){var s=Dr(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,p=null,d=0;d=u||f.to<=l)){var h=nr(e,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=hm)&&(c=f,p=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Ar(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rr){rr=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(N("br"));rr.appendChild(document.createTextNode("x"))}A(e.measure,rr);var n=rr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),k(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function _r(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Fr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ir(e){var t=Ar(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(nn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xe(e.doc,u.line).text).length==u.ch){var c=B(l,l.length,e.options.tabSize)-l.length;u=it(u.line,Math.max(0,Math.round((o-Wn(e.display).left)/Nr(e.display))-c))}return u}function Lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&en(e.doc,t)i.viewFrom?Br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Br(e);else if(t<=i.viewFrom){var o=jr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Br(e)}else if(n>=i.viewTo){var a=jr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Br(e)}else{var s=jr(e,t,t,-1),l=jr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Dn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Br(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==V(a,n)&&a.push(n)}}}function Br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jr(e,t,n,r){var i,o=Lr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;en(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Vr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Dn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Dn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Lr(e,n)))),r.viewTo=n}function zr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Wr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Wn(e.display),s=a.left,l=Math.max(r.sizerWidth,Kn(e)-r.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(n??l-e)+"px;\n height: "+(r-t)+"px"))}function p(t,n,r){var o,a,p=Xe(i,t),d=p.text.length;function f(n,r){return yr(e,it(t,n),"div",p,r)}function h(t,n,r){var i=wr(e,p,null,t),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}cPe(f,"coords"),cPe(h,"wrapX");var m=de(p,i.direction);return le(m,n||0,r??d,(function(e,t,i,p){var g="ltr"==i,y=f(e,g?"left":"right"),v=f(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==d,E=0==p,D=!m||p==m.length-1;if(v.top-y.top<=3){var w=(u?x:b)&&D,C=(u?b:x)&&E?s:(g?y:v).left,S=w?l:(g?v:y).right;c(C,y.top,S-C,y.bottom)}else{var T,k,A,N;g?(T=u&&b&&E?s:y.left,k=u?l:h(e,i,"before"),A=u?s:h(t,i,"after"),N=u&&x&&D?l:v.right):(T=u?h(e,i,"before"):s,k=!u&&b&&E?l:y.right,A=!u&&x&&D?s:v.left,N=u?h(t,i,"after"):l),c(T,y.top,k-T,y.bottom),y.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xr(e))}function Yr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Gr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||m<-.005)&&(ie.display.sizerWidth){var y=Math.ceil(d/Nr(e.display));y>e.display.maxLineLength&&(e.display.maxLineLength=y,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Zr(e){if(e.widgets)for(var t=0;t=a&&(o=tt(t,on(Xe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ti(e,t){if(!ve(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=N("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Hn(e.display))+"px;\n height: "+(t.bottom-t.top+Gn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ni(e,t,n,r){var i;null==r&&(r=0),!e.options.lineWrapping&&t==n&&(n="before"==t.sticky?it(t.line,t.ch+1,"before"):t,t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=vr(e,t),l=n&&n!=t?vr(e,n):s,u=ii(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=u.scrollTop&&(pi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(fi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function ri(e,t){var n=ii(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&fi(e,n.scrollLeft)}function ii(e,t){var n=e.display,r=Ar(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Yn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,f=Kn(e)-n.gutters.offsetWidth,h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function oi(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ai(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,n){(null!=t||null!=n)&&ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function li(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,ci(e,br(e,t.from),br(e,t.to),t.margin))}function ci(e,t,n,r){var i=ii(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});si(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||$i(e,{top:t}),di(e,t,!0),n&&$i(e),Oi(e,100))}function di(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(!(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||r)&&(e.doc.scrollLeft=t,Wi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function hi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}cPe(or,"nodeAndOffsetInLineMap"),cPe(ar,"getUsefulRect"),cPe(sr,"measureCharInner"),cPe(lr,"maybeUpdateRectForZooming"),cPe(ur,"clearLineMeasurementCacheFor"),cPe(cr,"clearLineMeasurementCache"),cPe(pr,"clearCaches"),cPe(dr,"pageScrollX"),cPe(fr,"pageScrollY"),cPe(hr,"widgetTopHeight"),cPe(mr,"intoCoordSystem"),cPe(gr,"fromCoordSystem"),cPe(yr,"charCoords"),cPe(vr,"cursorCoords"),cPe(br,"estimateCoords"),cPe(xr,"PosWithInfo"),cPe(Er,"coordsChar"),cPe(Dr,"wrappedLineExtent"),cPe(wr,"wrappedLineExtentChar"),cPe(Cr,"boxIsAfter"),cPe(Sr,"coordsCharInner"),cPe(Tr,"coordsBidiPart"),cPe(kr,"coordsBidiPartWrapped"),cPe(Ar,"textHeight"),cPe(Nr,"charWidth"),cPe(_r,"getDimensions"),cPe(Fr,"compensateForHScroll"),cPe(Ir,"estimateHeight"),cPe(Pr,"estimateLineHeights"),cPe(Or,"posFromMouse"),cPe(Lr,"findViewIndex"),cPe(Mr,"regChange"),cPe(Rr,"regLineChange"),cPe(Br,"resetView"),cPe(jr,"viewCuttingPoint"),cPe(Vr,"adjustView"),cPe(zr,"countDirtyView"),cPe($r,"updateSelection"),cPe(Ur,"prepareSelection"),cPe(Hr,"drawSelectionCursor"),cPe(qr,"cmpCoords"),cPe(Wr,"drawSelectionRange"),cPe(Gr,"restartBlink"),cPe(Kr,"ensureFocus"),cPe(Yr,"delayBlurEvent"),cPe(Xr,"onFocus"),cPe(Jr,"onBlur"),cPe(Qr,"updateHeightsInViewport"),cPe(Zr,"updateWidgetHeight"),cPe(ei,"visibleLines"),cPe(ti,"maybeScrollWindow"),cPe(ni,"scrollPosIntoView"),cPe(ri,"scrollIntoView"),cPe(ii,"calculateScrollPos"),cPe(oi,"addToScrollTop"),cPe(ai,"ensureCursorVisible"),cPe(si,"scrollToCoords"),cPe(li,"scrollToRange"),cPe(ui,"resolveScrollToPos"),cPe(ci,"scrollToCoordsRange"),cPe(pi,"updateScrollTop"),cPe(di,"setScrollTop"),cPe(fi,"setScrollLeft"),cPe(hi,"measureForScrollbars");var mi=cPe((function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}),"NativeScrollbars");mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=v&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",cPe(r,"maybeDisable"),t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=cPe((function(){}),"NullScrollbars");function yi(e,t){t||(t=hi(e));var n=e.display.barWidth,r=e.display.barHeight;vi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),vi(e,hi(e)),n=e.display.barWidth,r=e.display.barHeight}function vi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){},cPe(yi,"updateScrollbars"),cPe(vi,"updateScrollbarsInner");var bi={native:mi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new bi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?fi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}cPe(xi,"initScrollbars");var Ei=0;function Di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ei,markArrays:null},Cn(e.curOp)}function wi(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Mi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&Vi(e.cm,e.update)}function ki(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=hi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Kn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ai(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=vt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?We(t.mode,r.state):null,l=gt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!p&&dn)return Oi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&_i(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zr(e))return!1;Gi(e)&&(Br(e),t.dims=_r(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=en(e.doc,o),a=tn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vr(e,o,a),n.viewOffset=on(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=zr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Bi(e);return l>4&&(n.lineDiv.style.display="none"),Ui(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ji(u),k(n.cursorDiv),k(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Oi(e,400)),n.updateLineNumbers=null,!0}function zi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Kn(e))r&&(t.visible=ei(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Yn(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Vi(e,t))break;Qr(e);var i=hi(e);$r(e),yi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function $i(e,t){var n=new Mi(e,t);if(Vi(e,n)){Qr(e),zi(e,n);var r=hi(e);$r(e),yi(e,r),qi(e,r),n.finish()}}function Ui(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&v&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}cPe(s,"rm");for(var u=r.view,c=r.viewFrom,p=0;p-1&&(f=!1),_n(e,d,c,n)),f&&(k(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(rt(e.options,c)))),a=d.node.nextSibling}else{var h=Bn(e,d,c,n);o.insertBefore(h,a)}c+=d.size}for(;a;)a=s(a)}function Hi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",An(e,"gutterChanged",e)}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gn(e)+"px"}function Wi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Fr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;au.clientWidth,d=u.scrollHeight>u.clientHeight;if(i&&c||o&&d){if(o&&v&&l)e:for(var f=t.target,h=s.view;f!=u;f=f.parentNode)for(var m=0;m=0&&ot(e,r.to())<=0)return n}return-1};var io=cPe((function(e,t){this.anchor=e,this.head=t}),"Range");function oo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ot(e.from(),t.from())})),n=V(t,i);for(var o=1;o0:l>=0){var u=ut(s.from(),a.from()),c=lt(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new io(p?c:u,p?u:c))}}return new ro(t,n)}function ao(e,t){return new ro([new io(e,t||e)],0)}function so(e){return e.text?it(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function lo(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=so(t).ch-t.to.ch),it(n,r)}function uo(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}An(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function So(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Co(i,i.lastOp==r)))a=Y(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=so(t):o.changes.push(Do(e,t));else{var l=Y(i.done);for((!l||!l.ranges)&&Ao(e.sel,i.done),o={changes:[Do(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ko(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Ao(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&wo(i.undone)}function Ao(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function _o(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[p]=u[p],delete u[p])}}}return r}function Oo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ot(t,i)<0;o!=ot(n,i)<0?(i=t,t=n):o!=ot(t,n)<0&&(t=n)}return new io(i,t)}return new io(n||t,t)}function Lo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),zo(e,new ro([Oo(e.sel.primary(),t,n,i)],0),r)}function Mo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(r<0?1:-1),d=void 0;if((r<0?c:u)&&(p=Ko(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(d=ot(p,n))&&(r<0?d<0:d>0))return Wo(e,p,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=Ko(e,f,r,f.line==t.line?o:null)),f?Wo(e,f,t,r,i):null}}return t}function Go(e,t,n,r,i){var o=r||1;return Wo(e,t,n,o,i)||!i&&Wo(e,t,n,o,!0)||Wo(e,t,n,-o,i)||!i&&Wo(e,t,n,-o,!0)||(e.cantEdit=!0,it(e.first,0))}function Ko(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,it(t.line-1)):null:n>0&&t.ch==(r||Xe(e,t.line)).text.length?t.line=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var n=uo(e,t);So(e,t,n,e.cm?e.cm.curOp.id:NaN),ta(e,t,n,Bt(e,t));var r=[];yo(e,(function(e,n){!n&&-1==V(r,e.history)&&(aa(e.history,t),r.push(e.history)),ta(e,t,null,Bt(e,t))}))}}function Zo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--f){var h=d(f);if(h)return h.v}}}}function ea(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(X(e.sel.ranges,(function(e){return new io(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:it(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=uo(e,t)),e.cm?na(e.cm,t,r):go(e,t,r),$o(e,n,U),e.cantEdit&&Go(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function na(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=et(Jt(Xe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Ir(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=an(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),kt(r,o.line),Oi(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Mr(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?Mr(e,o.line,a.line+1,u):Rr(e,o.line,"text");var c=xe(e,"changes"),p=xe(e,"change");if(p||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&An(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function ra(e,t,n,r,i){var o;r||(r=n),ot(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function ia(e,t,n,r){n1||!(this.children[0]instanceof la))){var s=[];this.collapse(s),this.children=[new la(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ft()}o.addToHistory&&So(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Jt(r)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ze(r,0),Lt(r,new It(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){nn(e,t)&&Ze(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(_t(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Mr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Rr(u,c,"text");o.atomic&&Ho(u.doc),An(u,"markerAdded",u,o)}return o}ha.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),xe(this,"clear")){var n=this.find();n&&An(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Mr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ho(e.doc)),e&&An(e,"markerCleared",e,this,r,i),t&&wi(e),this.parent&&this.parent.clear()}},ha.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i=0;l--)Jo(this,r[l]);s?Vo(this,s):this.cm&&ai(this.cm)})),undo:Pi((function(){Zo(this,"undo")})),redo:Pi((function(){Zo(this,"redo")})),undoSelection:Pi((function(){Zo(this,"undo",!0)})),redoSelection:Pi((function(){Zo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch)&&(!n||n(l.marker))&&r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,it(n,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),$o(t.doc,ao(n,n)),d)for(var f=0;f=0;t--)ra(e.doc,"",r[t].from,r[t].to,"+delete");ai(e)}))}function Wa(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ga(e,t,n){var r=Wa(e,t.ch,n);return null==r?null:new it(t.line,r,n<0?"after":"before")}function Ka(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=de(n,t.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=tr(t,n);a=i<0?n.text.length-1:0;var c=nr(t,u,a).top;a=se((function(e){return nr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Wa(n,a,1))}else a=i<0?s.to:s.from;return new it(r,a,l)}}return new it(r,i<0?n.text.length:0,i<0?"before":"after")}function Ya(e,t,n,r){var i=de(t,e.doc.direction);if(!i)return Ga(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&d>=c.begin)){var f=p?"before":"after";return new it(n.line,d,f)}}var h=cPe((function(e,t,r){for(var o=cPe((function(e,t){return t?new it(n.line,l(e,1),"before"):new it(n.line,e,"after")}),"getRes");e>=0&&e0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,u(g)))?null:m}Ra.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ra.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ra.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ra.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ra.default=v?Ra.macDefault:Ra.pcDefault,cPe(Ba,"normalizeKeyName"),cPe(ja,"normalizeKeyMap"),cPe(Va,"lookupKey"),cPe(za,"isModifierKey"),cPe($a,"addModifierNames"),cPe(Ua,"keyName"),cPe(Ha,"getKeyMap"),cPe(qa,"deleteNearSelection"),cPe(Wa,"moveCharLogically"),cPe(Ga,"moveLogically"),cPe(Ka,"endOfLine"),cPe(Ya,"moveVisually");var Xa={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),it(i.line-1,a.length-1),i,"+transpose"))}n.push(new io(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return _i(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ot((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?Es(e,r,t,o):ws(e,r,t,o)}function Es(e,t,n,r){var i=e.display,o=!1,u=Fi(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yr(e)),ge(i.wrapper.ownerDocument,"mouseup",u),ge(i.wrapper.ownerDocument,"mousemove",c),ge(i.scroller,"dragstart",p),ge(i.scroller,"drop",u),o||(De(t),r.addNew||Lo(e.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=cPe((function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10}),"mouseMove"),p=cPe((function(){return o=!0}),"dragStart");l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",p),he(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ds(e,t,n){if("char"==n)return new io(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new io(it(t.line,0),pt(e.doc,it(t.line+1,0)));var r=n(e,t);return new io(r.from,r.to)}function ws(e,t,n,r){a&&Yr(e);var i=e.display,o=e.doc;De(t);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new io(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new io(n,n)),n=Or(e,t,!0,!0),l=-1;else{var p=Ds(e,n,r.unit);s=r.extend?Oo(s,p.anchor,p.head,r.extend):p}r.addNew?-1==l?(l=c.length,zo(o,oo(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(zo(o,oo(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Ro(o,l,s,H):(l=0,zo(o,new ro([s],0),H),u=o.sel);var d=n;function f(t){if(0!=ot(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=B(Xe(o,n.line).text,n.ch,a),p=B(Xe(o,t.line).text,t.ch,a),f=Math.min(c,p),h=Math.max(c,p),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var y=Xe(o,m).text,v=W(y,f,a);f==h?i.push(new io(it(m,v),it(m,v))):y.length>v&&i.push(new io(it(m,v),it(m,W(y,h,a))))}i.length||i.push(new io(n,n)),zo(o,oo(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,E=Ds(e,t,r.unit),D=x.anchor;ot(E.anchor,D)>0?(b=E.head,D=ut(x.from(),E.anchor)):(b=E.anchor,D=lt(x.to(),E.head));var w=u.ranges.slice(0);w[l]=Cs(e,new io(pt(o,D),b)),zo(o,oo(e,w,l),H)}}cPe(f,"extendTo");var h=i.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,a=Or(e,t,!0,"rectangle"==r.unit);if(a)if(0!=ot(a,d)){e.curOp.focus=I(),f(a);var s=ei(i,o);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(Fi(e,(function(){m==n&&(i.scroller.scrollTop+=l,g(t))})),50)}}function y(t){e.state.selectingText=!1,m=1/0,t&&(De(t),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",v),ge(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}cPe(g,"extend"),cPe(y,"done");var v=Fi(e,(function(e){0!==e.buttons&&ke(e)?g(e):y(e)})),b=Fi(e,y);e.state.selectingText=b,he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",b)}function Cs(e,t){var n=t.anchor,r=t.head,i=Xe(e.doc,n.line);if(0==ot(n,r)&&n.sticky==r.sticky)return t;var o=de(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),p=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?p<0:p>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,m=f?"after":"before";return n.ch==h&&n.sticky==m?t:new io(new it(n.line,h,m),r)}function Ss(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&De(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xe(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ye(e,n,e,tt(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function Ts(e,t){return Ss(e,t,"gutterClick",!0)}function ks(e,t){Un(e.display,t)||As(e,t)||ve(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function As(e,t){return!!xe(e,"gutterContextMenu")&&Ss(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}ms.prototype.compare=function(e,t,n){return this.time+hs>e&&0==ot(t,this.pos)&&n==this.button},cPe(gs,"clickRepeat"),cPe(ys,"onMouseDown"),cPe(vs,"handleMappedButton"),cPe(bs,"configureMouse"),cPe(xs,"leftButtonDown"),cPe(Es,"leftButtonStartDrag"),cPe(Ds,"rangeForUnit"),cPe(ws,"leftButtonSelect"),cPe(Cs,"bidiSimplify"),cPe(Ss,"gutterEvent"),cPe(Ts,"clickInGutter"),cPe(ks,"onContextMenu"),cPe(As,"contextMenuInGutter"),cPe(Ns,"themeChanged");var _s={toString:function(){return"CodeMirror.Init"}},Fs={},Is={};function Ps(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=_s&&i(e,t,n)}:i)}cPe(n,"option"),e.defineOption=n,e.Init=_s,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){ho(e),pr(e),Mr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(it(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ra(e.doc,t,n[i],it(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=_s&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Xi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ha(t),i=n!=_s&&Ha(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ls,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Ki(t,e.options.lineNumbers),Xi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Fr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Ki(e.options.gutters,t),Xi(e)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(e){return e}),Xi,!0),n("showCursorWhenSelecting",!1,$r,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Os),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,$r,!0),n("singleCursorHeightPerLine",!0,$r,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ho,!0),n("addModeClass",!1,ho,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,ho,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Os(e,t,n){if(!t!=!(n&&n!=_s)){var r=e.display.dragFunctions,i=t?he:ge;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ls(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Pr(e),Mr(e),pr(e),setTimeout((function(){return yi(e)}),100)}function Ms(e,t){var n=this;if(!(this instanceof Ms))return new Ms(e,t);this.options=t=t?R(t):{},R(Fs,t,!1);var r=t.value;"string"==typeof r?r=new Da(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ms.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Rs(this),_a(),Di(this),this.curOp.forceUpdate=!0,vo(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Is)Is.hasOwnProperty(u)&&Is[u](this,t[u],_s);Gi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}cPe(i,"finishTouch"),cPe(o,"isMouseLikeTouchEvent"),cPe(l,"farAway"),he(t.scroller,"touchstart",(function(i){if(!ve(e,i)&&!o(i)&&!Ts(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new io(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new io(it(a.line,0),pt(e.doc,it(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),De(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),fi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return no(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||Se(t)},over:function(t){ve(e,t)||(Ta(e,t),Se(t))},start:function(t){return Sa(e,t)},drop:Fi(e,Ca),leave:function(t){ve(e,t)||ka(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return cs.call(e,t)})),he(u,"keydown",Fi(e,ls)),he(u,"keypress",Fi(e,ps)),he(u,"focus",(function(t){return Xr(e,t)})),he(u,"blur",(function(t){return Jr(e,t)}))}cPe(Ps,"defineOptions"),cPe(Os,"dragDropChanged"),cPe(Ls,"wrappingChanged"),cPe(Ms,"CodeMirror"),Ms.defaults=Fs,Ms.optionHandlers=Is,cPe(Rs,"registerEventHandlers");var Bs=[];function js(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=vt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),l=B(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==$||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?B(Xe(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var p="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)d+=a,p+="\t";if(da,l=Pe(t),u=null;if(s&&r.ranges.length>1)if(Vs&&Vs.text.join("\n")==t){if(r.ranges.length%Vs.text.length==0){u=[];for(var c=0;c=0;d--){var f=r.ranges[d],h=f.from(),m=f.to();f.empty()&&(n&&n>0?h=it(h.line,h.ch-n):e.state.overwrite&&!s?m=it(m.line,Math.min(Xe(o,m.line).text.length,m.ch+Y(l).length)):s&&Vs&&Vs.lineWise&&Vs.text.join("\n")==l.join("\n")&&(h=m=it(h.line,0)));var g={from:h,to:m,text:u?u[d%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,g),An(e,"inputRead",e,g)}t&&!s&&Hs(e,t),ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Us(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&_i(t,(function(){return $s(t,n,0,null,"paste")})),!0}function Hs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=js(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=js(e,i.head.line,"smart"));a&&An(e,"electricInput",e,i.head.line)}}}function qs(e){for(var t=[],n=[],r=0;rn&&(js(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ai(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Ro(this.doc,r,new io(o,u[r].to()),U)}}})),getTokenAt:function(e,t){return wt(this,e,t)},getLineTokens:function(e,t){return wt(this,it(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Xe(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-on(r):0)},defaultTextHeight:function(){return Ar(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=vr(this,pt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ri(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ii(ls),triggerOnKeyPress:Ii(ps),triggerOnKeyUp:cs,triggerOnMouseDown:Ii(ys),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Ii((function(e){Hs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Pr(this),ye(this,"refresh",this)})),swapDoc:Ii((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),vo(this,e),pr(this),this.display.input.reset(),si(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,An(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ys(e,t,n,r,i){var o=t,a=n,s=Xe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new it(n,t.ch,t.sticky),s=Xe(e,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var p=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new it(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(p?2:1))),-n)}}else a=i?Ya(e.cm,s,t,n):Ga(s,t,n);if(null==a){if(o||!u())return!1;t=Ka(i,e.cm,s,t.line,l)}else t=a;return!0}if(cPe(u,"findNextLine"),cPe(c,"moveOnce"),"char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var p=null,d="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",g=ne(m,f)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(d&&!h&&!g&&(g="s"),p&&p!=g){n<0&&(n=1,c(),t.sticky="after");break}if(g&&(p=g),n>0&&!c(!h))break}var y=Go(e,t,o,a,!0);return at(o,y)&&(y.hitSide=!0),y}function Xs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Ar(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Er(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}cPe(zs,"setLastCopied"),cPe($s,"applyTextInput"),cPe(Us,"handlePaste"),cPe(Hs,"triggerElectric"),cPe(qs,"copyableRanges"),cPe(Ws,"disableBrowserMagic"),cPe(Gs,"hiddenTextarea"),cPe(Ks,"addEditorMethods"),cPe(Ys,"findPosH"),cPe(Xs,"findPosV");var Js=cPe((function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}),"ContentEditableInput");function Qs(e,t){var n=er(e,t.line);if(!n||n.hidden)return null;var r=Xe(e.doc,t.line),i=Jn(n,r,t.line),o=de(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=or(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Zs(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function el(e,t){return t&&(e.bad=!0),e}function tl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function p(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void p(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(it(r,0),it(i+1,0),u(+f));return void(h.length&&(o=h[0].find(0))&&p(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=it(a.line-1,Xe(r.doc,a.line-1).length)),s.ch==Xe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Lr(r,a.line))?(t=et(i.view[0].line),n=i.view[0].node):(t=et(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Lr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=et(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(tl(r,n,u,t,l)),d=Je(r.doc,it(t,0),it(l,Xe(r.doc,l).text.length));p.length>1&&d.length>1;)if(Y(p)==Y(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),t++}for(var f=0,h=0,m=p[0],g=d[0],y=Math.min(m.length,g.length);fa.ch&&v.charCodeAt(v.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=v.slice(0,v.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var E=it(t,f),D=it(l,d.length?Y(d).length-h:0);return p.length>1||p[0]||ot(E,D)?(ra(r.doc,p,E,D,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&_i(this.cm,(function(){return Mr(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Fi(this.cm,$s)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0,cPe(Qs,"posToDOM"),cPe(Zs,"isInGutter"),cPe(el,"badPos"),cPe(tl,"domTextBetween"),cPe(nl,"domToPos"),cPe(rl,"locateNodeInLineView");var il=cPe((function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null}),"TextareaInput");function ol(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(cPe(r,"save"),e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone&&"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Ms((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function al(e){e.off=ge,e.on=he,e.wheelEventPixels=to,e.Doc=Da,e.splitLines=Pe,e.countColumn=B,e.findColumn=W,e.isWordChar=te,e.Pass=$,e.signal=ye,e.Line=ln,e.changeEnd=so,e.scrollbarModel=bi,e.Pos=it,e.cmpPos=ot,e.modes=Be,e.mimeModes=je,e.resolveMode=$e,e.getMode=Ue,e.modeExtensions=He,e.extendMode=qe,e.copyState=We,e.startState=Ke,e.innerMode=Ge,e.commands=Xa,e.keyMap=Ra,e.keyName=Ua,e.isModifierKey=za,e.lookupKey=Va,e.normalizeKeyMap=ja,e.StringStream=Ye,e.SharedTextMarker=ga,e.TextMarker=ha,e.LineWidget=ca,e.e_preventDefault=De,e.e_stopPropagation=we,e.e_stop=Se,e.addClass=P,e.contains=F,e.rmClass=T,e.keyNames=Pa}il.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ve(r,e)){if(r.somethingSelected())zs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);zs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),L(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){ve(r,e)||Us(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),cPe(o,"prepareCopyCut"),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!Un(e,t)&&!ve(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){Un(e,t)||De(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},il.prototype.createField=function(e){this.wrapper=Gs(),this.textarea=this.wrapper.firstChild},il.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},il.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ur(e);if(e.options.moveInputWithCursor){var i=vr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},il.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},il.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&L(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},il.prototype.getField=function(){return this.textarea},il.prototype.supportsTouch=function(){return!1},il.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||I()!=this.textarea))try{this.textarea.focus()}catch{}},il.prototype.blur=function(){this.textarea.blur()},il.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},il.prototype.receivedFocus=function(){this.slowPoll()},il.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},il.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,cPe(n,"p"),t.polling.set(20,n)},il.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||v&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203==o&&!r&&(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},il.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},il.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},il.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Or(n,e),u=r.scroller.scrollTop;if(o&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Fi(n,zo)(n.doc,ao(o),U);var c,d=i.style.cssText,f=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),cPe(g,"prepareSelectAllHack"),cPe(y,"rehide"),a&&s>=9&&g(),w){Se(e);var m=cPe((function(){ge(window,"mouseup",m),setTimeout(y,20)}),"mouseup");he(window,"mouseup",m)}else setTimeout(y,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=cPe((function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Fi(n,Yo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())}),"poll");r.detectingSelectAll=setTimeout(o,200)}}},il.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},il.prototype.setUneditable=function(){},il.prototype.needsContentAttribute=!1,cPe(ol,"fromTextArea"),cPe(al,"addLegacyProps"),Ps(Ms),Ks(Ms);var sl="iter insert remove copy getEditor constructor".split(" ");for(var ll in Da.prototype)Da.prototype.hasOwnProperty(ll)&&V(sl,ll)<0&&(Ms.prototype[ll]=function(e){return function(){return e.apply(this.doc,arguments)}}(Da.prototype[ll]));return Ee(Da),Ms.inputStyles={textarea:il,contenteditable:Js},Ms.defineMode=function(e){!Ms.defaults.mode&&"null"!=e&&(Ms.defaults.mode=e),Ve.apply(this,arguments)},Ms.defineMIME=ze,Ms.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ms.defineMIME("text/plain","null"),Ms.defineExtension=function(e,t){Ms.prototype[e]=t},Ms.defineDocExtension=function(e,t){Da.prototype[e]=t},Ms.fromTextArea=ol,al(Ms),Ms.version="5.65.3",Ms}()),fPe.exports}cPe(hPe,"requireCodemirror");var mPe=Object.defineProperty;function gPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{mPe(e,"name",{value:t,configurable:!0})})(gPe,"_mergeNamespaces");var yPe=hPe();const vPe=pPe(yPe),bPe=gPe({__proto__:null,default:vPe},[yPe]),xPe=Object.freeze(Object.defineProperty({__proto__:null,C:vPe,c:bPe},Symbol.toStringTag,{value:"Module"}));var EPe=Object.defineProperty,DPe=(e,t)=>EPe(e,"name",{value:t,configurable:!0});function wPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}DPe(wPe,"_mergeNamespaces");!function(e){var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=a(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;id.clientHeight+1;if(setTimeout((function(){F=a.getScrollInfo()})),I.bottom-_>0){var O=I.bottom-I.top;if(x.top-(x.bottom-I.top)-O>0)d.style.top=(D=x.top-O-S)+"px",w=!1;else if(O>_){d.style.height=_-5+"px",d.style.top=(D=x.bottom-I.top-S)+"px";var L=a.getCursor();i.from.ch!=L.ch&&(x=a.cursorCoords(L),d.style.left=(E=x.left-C)+"px",I=d.getBoundingClientRect())}}var M,R=I.right-N;if(P&&(R+=a.display.nativeBarWidth),R>0&&(I.right-I.left>N&&(d.style.width=N-5+"px",R-=I.right-I.left-N),d.style.left=(E=x.left-R-C)+"px"),P)for(var B=d.firstChild;B;B=B.nextSibling)B.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=l(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){M=setTimeout((function(){r.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(M)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();F||(F=a.getScrollInfo());var n=D+F.top-e.top,i=n-(p.pageYOffset||(c.documentElement||c.body).scrollTop);if(w||(i+=d.offsetHeight),i<=t.top||i>=t.bottom)return r.close();d.style.top=n+"px",d.style.left=E+F.left-e.left+"px"}),e.on(d,"dblclick",(function(e){var t=u(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(d,"click",(function(e){var t=u(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())})),e.on(d,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var j=this.getSelectedHintRange();return(0!==j.from||0!==j.to)&&this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],d.childNodes[this.selectedHint]),!0}function p(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):o(i+1)}))}DPe(o,"run"),o(0)}),"resolved");return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}r.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],i=this;this.cm.operation((function(){r.hint?r.hint(i.cm,t,r):i.cm.replaceRange(s(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},DPe(p,"applicableHelpers"),DPe(d,"fetchHints"),DPe(f,"resolveAutoHints"),e.registerHelper("hint","auto",{resolve:f}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(hPe());var CPe={};const SPe=wPe({__proto__:null,default:pPe(CPe)},[CPe]),TPe=Object.freeze(Object.defineProperty({__proto__:null,s:SPe},Symbol.toStringTag,{value:"Module"}));var kPe,APe=Object.defineProperty,NPe=(e,t)=>APe(e,"name",{value:t,configurable:!0}),_Pe={exports:{}};function FPe(){return kPe||(kPe=1,function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),l=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=i(o),p=!u&&l>=0&&c.test(s.text.charAt(l))&&r[s.text.charAt(l)]||c.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!p)return null;var d=">"==p.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(n(t.line,l+1)),h=a(e,n(t.line,l+(d>0?1:0)),d,f,o);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==p.charAt(0),forward:d>0}}function a(e,t,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,c=[],p=i(s),d=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),f=t.line;f!=d;f+=o){var h=e.getLine(f);if(h){var m=o>0?0:h.length-1,g=o>0?h.length:-1;if(!(h.length>l))for(f==t.line&&(m=t.ch-(o<0?1:0));m!=g;m+=o){var y=h.charAt(m);if(p.test(y)&&(void 0===a||(e.getTokenTypeAt(n(f,m+1))||"")==(a||""))){var v=r[y];if(v&&">"==v.charAt(1)==o>0)c.push(y);else{if(!c.length)return{pos:n(f,m),ch:y};c.pop()}}}}}return f-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,l=[],u=e.listSelections(),c=0;cr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{IPe(e,"name",{value:t,configurable:!0})})(PPe,"_mergeNamespaces");var OPe=FPe();const LPe=PPe({__proto__:null,default:pPe(OPe)},[OPe]),MPe=Object.freeze(Object.defineProperty({__proto__:null,m:LPe},Symbol.toStringTag,{value:"Module"}));var RPe=Object.defineProperty,BPe=(e,t)=>RPe(e,"name",{value:t,configurable:!0});function jPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}BPe(jPe,"_mergeNamespaces");!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))})),BPe(r,"getOption");var i={Backspace:l,Enter:u};function o(e){for(var t=0;t=0;l--){var c=a[l].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function u(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function p(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function d(t,i){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),l=a.indexOf(i);if(-1==l)return e.Pass;for(var u,d=r(o,"closeBefore"),f=r(o,"triples"),m=a.charAt(l+1)==i,g=t.listSelections(),y=l%2==0,v=0;v1&&f.indexOf(i)>=0&&t.getRange(n(E.line,E.ch-2),E)==i+i){if(E.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(E.line,E.ch-2))))return e.Pass;b="addFour"}else if(m){var w=0==E.ch?" ":t.getRange(n(E.line,E.ch-1),E);if(e.isWordChar(D)||w==i||e.isWordChar(w))return e.Pass;b="both"}else{if(!y||!(0===D.length||/\s/.test(D)||d.indexOf(D)>-1))return e.Pass;b="both"}else b=m&&h(t,E)?"both":f.indexOf(i)>=0&&t.getRange(E,n(E.line,E.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=b)return e.Pass}else u=b}var C=l%2?a.charAt(l-1):i,S=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==u)c(t,1);else if("skipThree"==u)c(t,3);else if("surround"==u){for(var e=t.getSelections(),n=0;nUPe(e,"name",{value:t,configurable:!0});function qPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}HPe(qPe,"_mergeNamespaces");!function(e){function t(t){return function(n,r){var i=r.line,o=n.getLine(i);function a(t){for(var a,s=r.ch,l=0;;){var u=s<=0?-1:o.lastIndexOf(t[0],s-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}HPe(r,"hasImport");var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}HPe(r,"hasInclude");var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(hPe());var WPe={};const GPe=qPe({__proto__:null,default:pPe(WPe)},[WPe]),KPe=Object.freeze(Object.defineProperty({__proto__:null,b:GPe},Symbol.toStringTag,{value:"Module"}));var YPe=Object.defineProperty,XPe=(e,t)=>YPe(e,"name",{value:t,configurable:!0});function JPe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}XPe(JPe,"_mergeNamespaces");var QPe,ZPe={exports:{}};function eOe(){return QPe||(QPe=1,function(e){function t(t,r,o,a){if(o&&o.call){var s=o;o=null}else s=i(t,o,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var l=i(t,o,"minFoldSize");function u(e){var n=s(t,r);if(!n||n.to.line-n.from.linet.firstLine();)r=e.Pos(r.line-1,0),c=u(!1);if(c&&!c.cleared&&"unfold"!==a){var p=n(t,o,c);e.on(p,"mousedown",(function(t){d.clear(),e.e_preventDefault(t)}));var d=t.markText(c.from,c.to,{replacedWith:p,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});d.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,c.from,c.to)}}function n(e,t,n){var r=i(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);(r=document.createElement("span")).appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}XPe(t,"doFold"),XPe(n,"makeWidget"),e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=u){if(d&&s&&d.test(s.className))return;r=o(a.indicatorOpen)}}!r&&!s||e.setGutterMarker(n,a.gutter,r)}))}function s(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function l(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){a(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function u(e,n,r){var o=e.state.foldGutter;if(o){var a=o.options;if(r==a.gutter){var s=i(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){l(e)}),n.foldOnChangeTimeSpan||600)}}function p(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?l(e):e.operation((function(){n.fromt.to&&(a(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function d(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&riOe(e,"name",{value:t,configurable:!0});function aOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}oOe(aOe,"_mergeNamespaces");!function(e){var t="CodeMirror-lint-markers",n="CodeMirror-lint-line-";function r(t,n,r){var i=document.createElement("div");function o(t){if(!i.parentNode)return e.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),oOe(o,"position"),e.on(document,"mousemove",o),o(n),null!=i.style.opacity&&(i.style.opacity=1),i}function i(e){e.parentNode&&e.parentNode.removeChild(e)}function o(e){e.parentNode&&(null==e.style.opacity&&i(e),e.style.opacity=0,setTimeout((function(){i(e)}),600))}function a(t,n,i,a){var s=r(t,n,i);function l(){e.off(a,"mouseout",l),s&&(o(s),s=null)}oOe(l,"hide");var u=setInterval((function(){if(s)for(var e=a;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){l();break}}if(!s)return clearInterval(u)}),400);e.on(a,"mouseout",l)}function s(e,t,n){for(var r in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),(!t||!0===t)&&(t={}),this.options={},this.linterOptions=t.options||{},l)this.options[r]=l[r];for(var r in t)l.hasOwnProperty(r)?null!=t[r]&&(this.options[r]=t[r]):t.options||(this.linterOptions[r]=t[r]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){x(e,t)},this.waitingFor=0}oOe(r,"showTooltip"),oOe(i,"rm"),oOe(o,"hideTooltip"),oOe(a,"showTooltipFor"),oOe(s,"LintState");var l={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function u(e){var n=e.state.lint;n.hasGutter&&e.clearGutter(t),n.options.highlightLines&&c(e);for(var r=0;r-1)&&c.push(e.message)}));for(var m=null,g=i.hasGutter&&document.createDocumentFragment(),y=0;y1,o.tooltips)),o.highlightLines&&e.addLineClass(s,"wrap",n+m)}}o.onUpdateLinting&&o.onUpdateLinting(r,a,e)}}function v(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){g(e)}),t.options.delay))}function b(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;opOe(e,"name",{value:t,configurable:!0}),fOe={exports:{}};function hOe(){return cOe||(cOe=1,function(e){var t,n,r=e.Pos;function i(e){return e.flags??(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function o(e,t){for(var n=i(e),r=n,o=0;oc);p++){var d=e.getLine(u++);i=null==i?d:i+"\n"+d}l*=2,t.lastIndex=n.ch;var f=t.exec(i);if(f){var h=i.slice(0,f.index).split("\n"),m=f[0].split("\n"),g=n.line+h.length-1,y=h[h.length-1].length;return{from:r(g,y),to:r(g+m.length-1,1==m.length?y+m[0].length:m[m.length-1].length),match:f}}}}function u(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function c(e,t,n){t=o(t,"g");for(var i=n.line,a=n.ch,s=e.firstLine();i>=s;i--,a=-1){var l=e.getLine(i),c=u(l,t,a<0?0:l.length-a);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}function p(e,t,n){if(!a(t))return c(e,t,n);t=o(t,"gm");for(var i,s=1,l=e.getLine(n.line).length-n.ch,p=n.line,d=e.firstLine();p>=d;){for(var f=0;f=d;f++){var h=e.getLine(p--);i=null==i?h:h+"\n"+i}s*=2;var m=u(i,t,l);if(m){var g=i.slice(0,m.index).split("\n"),y=m[0].split("\n"),v=p+g.length,b=g[g.length-1].length;return{from:r(v,b),to:r(v+y.length-1,1==y.length?b+y[0].length:y[y.length-1].length),match:m}}}}function d(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function f(e,i,o,a){if(!i.length)return null;var s=a?t:n,l=s(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,p=e.lastLine()+1-l.length;u<=p;u++,c=0){var f=e.getLine(u).slice(c),h=s(f);if(1==l.length){var m=h.indexOf(l[0]);if(-1==m)continue e;return o=d(f,h,m,s)+c,{from:r(u,d(f,h,m,s)+c),to:r(u,d(f,h,m+l[0].length,s)+c)}}var g=h.length-l[0].length;if(h.slice(g)==l[0]){for(var y=1;y=p;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var h=s(f);if(1==l.length){var m=h.lastIndexOf(l[0]);if(-1==m)continue e;return{from:r(u,d(f,h,m,s)),to:r(u,d(f,h,m+l[0].length,s))}}var g=l[l.length-1];if(h.slice(0,g.length)==g){var y=1;for(o=u-l.length+1;y(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(t,n);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new m(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new m(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(hPe())),fOe.exports}dOe(hOe,"requireSearchcursor");var mOe=Object.defineProperty;function gOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}((e,t)=>{mOe(e,"name",{value:t,configurable:!0})})(gOe,"_mergeNamespaces");var yOe=hOe();const vOe=gOe({__proto__:null,default:pPe(yOe)},[yOe]),bOe=Object.freeze(Object.defineProperty({__proto__:null,s:vOe},Symbol.toStringTag,{value:"Module"}));var xOe=Object.defineProperty,EOe=(e,t)=>xOe(e,"name",{value:t,configurable:!0});function DOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}EOe(DOe,"_mergeNamespaces");!function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}EOe(t,"dialogDiv"),EOe(n,"closeNotification"),e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,l=this;function u(t){if("string"==typeof t)p.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),o.onClose&&o.onClose(a)}}EOe(u,"close");var c,p=a.getElementsByTagName("input")[0];return p?(p.focus(),o.value&&(p.value=o.value,!1!==o.selectValueOnOpen&&p.select()),o.onInput&&e.on(p,"input",(function(e){o.onInput(e,p.value,u)})),o.onKeyUp&&e.on(p,"keyup",(function(e){o.onKeyUp(e,p.value,u)})),e.on(p,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,p.value,u)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(p.blur(),e.e_stop(t),u()),13==t.keyCode&&i(p.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&u()}))):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){u(),l.focus()})),!1!==o.closeOnBlur&&e.on(c,"blur",u),c.focus()),u})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),l=!1,u=this,c=1;function p(){l||(l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),u.focus())}EOe(p,"close"),s[0].focus();for(var d=0;dTOe(e,"name",{value:t,configurable:!0});function AOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}kOe(AOe,"_mergeNamespaces");!function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase("Jump to line:")+' '+e.phrase("(Use line:column or scroll% syntax)")+""}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.defineOption("search",{bottom:!1}),kOe(t,"dialog"),kOe(n,"getJumpDialog"),kOe(r,"interpretLine"),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var n;if(t)if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(hPe());var NOe={};const _Oe=AOe({__proto__:null,default:pPe(NOe)},[NOe]),FOe=Object.freeze(Object.defineProperty({__proto__:null,j:_Oe},Symbol.toStringTag,{value:"Module"}));var IOe=Object.defineProperty,POe=(e,t)=>IOe(e,"name",{value:t,configurable:!0});function OOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}POe(OOe,"_mergeNamespaces");!function(e){var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,u=l,c=i<0?0:o.length,p=0;u!=c;u+=i,p++){var d=o.charAt(i<0?u-1:u),f="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==f&&d.toUpperCase()==d&&(f="W"),"start"==s)"o"!=f?(s="in",a=f):l=u+i;else if("in"==s&&a!=f){if("w"==a&&"W"==f&&i<0&&u--,"W"==a&&"w"==f&&i>0){if(u==l+1){a="w";continue}u--}break}}return n(r.line,u)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;s--){var u=r[i[s]];if(!(l&&e.cmpPos(u.head,l)>0)){var c=a(t,u.head);l=c.from,t.replaceRange(n(c.word),c.from,c.to)}}}))}function h(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=a(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function m(e,t){var r=h(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}POe(c,"selectBetweenBrackets"),t.selectScope=function(e){c(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!c(t))return e.Pass},POe(p,"puncType"),t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,p(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,p(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(u,c):i.length&&(i[i.length-1]=c),o=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,u=s.from().line;0==s.to().ch&&!s.empty()&&l--,l=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),u=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var c=new n(a.line,e.findColumn(s,l-i,i));c.ch!=a.ch&&(u=c)}t.replaceRange("",u,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){f(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){f(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},POe(h,"getTarget"),POe(m,"findAndGoTo"),t.findUnder=function(e){m(e,!0)},t.findUnderPrevious=function(e){m(e,!1)},t.findAllUnder=function(e){var t=h(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var g=e.keyMap;g.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(g.macSublime),g.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(g.pcSublime);var y=g.default==g.macDefault;g.sublime=y?g.macSublime:g.pcSublime}(hPe(),hOe(),FPe());var LOe={};const MOe=OOe({__proto__:null,default:pPe(LOe)},[LOe]),ROe=Object.freeze(Object.defineProperty({__proto__:null,s:MOe},Symbol.toStringTag,{value:"Module"}));var BOe=Object.defineProperty,jOe=(e,t)=>BOe(e,"name",{value:t,configurable:!0});function VOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}jOe(VOe,"_mergeNamespaces");var zOe;(zOe=hPe()).defineMode("javascript",(function(e,t){var n,r,i=e.indentUnit,o=t.statementIndent,a=t.jsonld,s=t.json||a,l=!1!==t.trackScope,u=t.typescript,c=t.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}jOe(e,"kw");var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function m(e,t,i){return n=e,r=i,t}function g(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=y(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):rt(e,t,1)?(h(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=b,b(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==n&&e.eatWhile(c))return m("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(d.test(n))return(">"!=n||!t.lexical||">"!=t.lexical.type)&&(e.eat("=")?("!"==n||"="==n)&&e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?m("."):m("operator","operator",e.current());if(c.test(n)){e.eatWhile(c);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return m(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",r)}return m("variable","variable",r)}}function y(e){return function(t,n){var r,i=!1;if(a&&"@"==t.peek()&&t.match(f))return n.tokenize=g,m("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=g),m("string","string")}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=g;break}r="*"==n}return m("comment","comment")}function b(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=g;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}jOe(h,"readRegexp"),jOe(m,"ret"),jOe(g,"tokenBase"),jOe(y,"tokenString"),jOe(v,"tokenComment"),jOe(b,"tokenQuasi");var x="([{}])";function E(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=x.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(c.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}jOe(E,"findFatArrow");var D={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(e,t){if(!l)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function S(e,t,n,r,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?H:$)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==n&&C(e,r)?"variable-2":t}}jOe(w,"JSLexical"),jOe(C,"inScope"),jOe(S,"parseJS");var T={state:null,column:null,marked:null,cc:null};function k(){for(var e=arguments.length-1;e>=0;e--)T.cc.push(arguments[e])}function A(){return k.apply(null,arguments),!0}function N(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function _(e){var n=T.state;if(T.marked="def",l){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=F(e,n.context);if(null!=r)return void(n.context=r)}else if(!N(e,n.localVars))return void(n.localVars=new O(e,n.localVars));t.globalVars&&!N(e,n.globalVars)&&(n.globalVars=new O(e,n.globalVars))}}function F(e,t){if(t){if(t.block){var n=F(e,t.prev);return n?n==t.prev?t:new P(n,t.vars,!0):null}return N(e,t.vars)?t:new P(t.prev,new O(e,t.vars),!1)}return null}function I(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function P(e,t,n){this.prev=e,this.vars=t,this.block=n}function O(e,t){this.name=e,this.next=t}jOe(k,"pass"),jOe(A,"cont"),jOe(N,"inList"),jOe(_,"register"),jOe(F,"registerVarScoped"),jOe(I,"isModifier"),jOe(P,"Context"),jOe(O,"Var");var L=new O("this",new O("arguments",null));function M(){T.state.context=new P(T.state.context,T.state.localVars,!1),T.state.localVars=L}function R(){T.state.context=new P(T.state.context,T.state.localVars,!0),T.state.localVars=null}function B(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function j(e,t){var n=jOe((function(){var n=T.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,T.stream.column(),e,null,n.lexical,t)}),"result");return n.lex=!0,n}function V(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function z(e){function t(n){return n==e?A():";"==e||"}"==n||")"==n||"]"==n?k():A(t)}return jOe(t,"exp"),t}function $(e,t){return"var"==e?A(j("vardef",t),ke,z(";"),V):"keyword a"==e?A(j("form"),W,$,V):"keyword b"==e?A(j("form"),$,V):"keyword d"==e?T.stream.match(/^\s*$/,!1)?A():A(j("stat"),K,z(";"),V):"debugger"==e?A(z(";")):"{"==e?A(j("}"),R,pe,V,B):";"==e?A():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==V&&T.state.cc.pop()(),A(j("form"),W,$,V,Pe)):"function"==e?A(Re):"for"==e?A(j("form"),R,Oe,$,B,V):"class"==e||u&&"interface"==t?(T.marked="keyword",A(j("form","class"==e?e:t),$e,V)):"variable"==e?u&&"declare"==t?(T.marked="keyword",A($)):u&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?A(et):"type"==t?A(je,z("operator"),ge,z(";")):A(j("form"),Ae,z("{"),j("}"),pe,V,V)):u&&"namespace"==t?(T.marked="keyword",A(j("form"),H,$,V)):u&&"abstract"==t?(T.marked="keyword",A($)):A(j("stat"),ie):"switch"==e?A(j("form"),W,z("{"),j("}","switch"),R,pe,V,V,B):"case"==e?A(H,z(":")):"default"==e?A(z(":")):"catch"==e?A(j("form"),M,U,$,V,B):"export"==e?A(j("stat"),We,V):"import"==e?A(j("stat"),Ke,V):"async"==e?A($):"@"==t?A(H,$):k(j("stat"),H,z(";"),V)}function U(e){if("("==e)return A(Ve,z(")"))}function H(e,t){return G(e,t,!1)}function q(e,t){return G(e,t,!0)}function W(e){return"("!=e?k():A(j(")"),K,z(")"),V)}function G(e,t,n){if(T.state.fatArrowAt==T.stream.start){var r=n?ee:Z;if("("==e)return A(M,j(")"),ue(Ve,")"),V,z("=>"),r,B);if("variable"==e)return k(M,Ae,z("=>"),r,B)}var i=n?X:Y;return D.hasOwnProperty(e)?A(i):"function"==e?A(Re,i):"class"==e||u&&"interface"==t?(T.marked="keyword",A(j("form"),ze,V)):"keyword c"==e||"async"==e?A(n?q:H):"("==e?A(j(")"),K,z(")"),V,i):"operator"==e||"spread"==e?A(n?q:H):"["==e?A(j("]"),Ze,V,i):"{"==e?ce(ae,"}",null,i):"quasi"==e?k(J,i):"new"==e?A(te(n)):A()}function K(e){return e.match(/[;\}\)\],]/)?k():k(H)}function Y(e,t){return","==e?A(K):X(e,t,!1)}function X(e,t,n){var r=0==n?Y:X,i=0==n?H:q;if("=>"==e)return A(M,n?ee:Z,B);if("operator"==e)return/\+\+|--/.test(t)||u&&"!"==t?A(r):u&&"<"==t&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?A(j(">"),ue(ge,">"),V,r):"?"==t?A(H,z(":"),i):A(i);if("quasi"==e)return k(J,r);if(";"!=e){if("("==e)return ce(q,")","call",r);if("."==e)return A(oe,r);if("["==e)return A(j("]"),K,z("]"),V,r);if(u&&"as"==t)return T.marked="keyword",A(ge,r);if("regexp"==e)return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),A(i)}}function J(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?A(J):A(K,Q)}function Q(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,A(J)}function Z(e){return E(T.stream,T.state),k("{"==e?$:H)}function ee(e){return E(T.stream,T.state),k("{"==e?$:q)}function te(e){return function(t){return"."==t?A(e?re:ne):"variable"==t&&u?A(Ce,e?X:Y):k(e?q:H)}}function ne(e,t){if("target"==t)return T.marked="keyword",A(Y)}function re(e,t){if("target"==t)return T.marked="keyword",A(X)}function ie(e){return":"==e?A(V,$):k(Y,z(";"),V)}function oe(e){if("variable"==e)return T.marked="property",A()}function ae(e,t){return"async"==e?(T.marked="property",A(ae)):"variable"==e||"keyword"==T.style?(T.marked="property","get"==t||"set"==t?A(se):(u&&T.state.fatArrowAt==T.stream.start&&(n=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+n[0].length),A(le))):"number"==e||"string"==e?(T.marked=a?"property":T.style+" property",A(le)):"jsonld-keyword"==e?A(le):u&&I(t)?(T.marked="keyword",A(ae)):"["==e?A(H,de,z("]"),le):"spread"==e?A(q,le):"*"==t?(T.marked="keyword",A(ae)):":"==e?k(le):void 0;var n}function se(e){return"variable"!=e?k(le):(T.marked="property",A(Re))}function le(e){return":"==e?A(q):"("==e?k(Re):void 0}function ue(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=T.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),A((function(n,r){return n==t||r==t?k():k(e)}),r)}return i==t||o==t?A():n&&n.indexOf(";")>-1?k(e):A(z(t))}return jOe(r,"proceed"),function(n,i){return n==t||i==t?A():k(e,r)}}function ce(e,t,n){for(var r=3;r"),ge):"quasi"==e?k(xe,we):void 0}function ye(e){if("=>"==e)return A(ge)}function ve(e){return e.match(/[\}\)\]]/)?A():","==e||";"==e?A(ve):k(be,ve)}function be(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",A(be)):"?"==t||"number"==e||"string"==e?A(be):":"==e?A(ge):"["==e?A(z("variable"),fe,z("]"),be):"("==e?k(Be,be):e.match(/[;\}\)\],]/)?void 0:A()}function xe(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?A(xe):A(ge,Ee)}function Ee(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,A(xe)}function De(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?A(De):":"==e?A(ge):"spread"==e?A(De):k(ge)}function we(e,t){return"<"==t?A(j(">"),ue(ge,">"),V,we):"|"==t||"."==e||"&"==t?A(ge):"["==e?A(ge,z("]"),we):"extends"==t||"implements"==t?(T.marked="keyword",A(ge)):"?"==t?A(ge,z(":"),ge):void 0}function Ce(e,t){if("<"==t)return A(j(">"),ue(ge,">"),V,we)}function Se(){return k(ge,Te)}function Te(e,t){if("="==t)return A(ge)}function ke(e,t){return"enum"==t?(T.marked="keyword",A(et)):k(Ae,de,Fe,Ie)}function Ae(e,t){return u&&I(t)?(T.marked="keyword",A(Ae)):"variable"==e?(_(t),A()):"spread"==e?A(Ae):"["==e?ce(_e,"]"):"{"==e?ce(Ne,"}"):void 0}function Ne(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?A(Ae):"}"==e?k():"["==e?A(H,z("]"),z(":"),Ne):A(z(":"),Ae,Fe)):(_(t),A(Fe))}function _e(){return k(Ae,Fe)}function Fe(e,t){if("="==t)return A(q)}function Ie(e){if(","==e)return A(ke)}function Pe(e,t){if("keyword b"==e&&"else"==t)return A(j("form","else"),$,V)}function Oe(e,t){return"await"==t?A(Oe):"("==e?A(j(")"),Le,V):void 0}function Le(e){return"var"==e?A(ke,Me):"variable"==e?A(Me):k(Me)}function Me(e,t){return")"==e?A():";"==e?A(Me):"in"==t||"of"==t?(T.marked="keyword",A(H,Me)):k(H,Me)}function Re(e,t){return"*"==t?(T.marked="keyword",A(Re)):"variable"==e?(_(t),A(Re)):"("==e?A(M,j(")"),ue(Ve,")"),V,he,$,B):u&&"<"==t?A(j(">"),ue(Se,">"),V,Re):void 0}function Be(e,t){return"*"==t?(T.marked="keyword",A(Be)):"variable"==e?(_(t),A(Be)):"("==e?A(M,j(")"),ue(Ve,")"),V,he,B):u&&"<"==t?A(j(">"),ue(Se,">"),V,Be):void 0}function je(e,t){return"keyword"==e||"variable"==e?(T.marked="type",A(je)):"<"==t?A(j(">"),ue(Se,">"),V):void 0}function Ve(e,t){return"@"==t&&A(H,Ve),"spread"==e?A(Ve):u&&I(t)?(T.marked="keyword",A(Ve)):u&&"this"==e?A(de,Fe):k(Ae,de,Fe)}function ze(e,t){return"variable"==e?$e(e,t):Ue(e,t)}function $e(e,t){if("variable"==e)return _(t),A(Ue)}function Ue(e,t){return"<"==t?A(j(">"),ue(Se,">"),V,Ue):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(T.marked="keyword"),A(u?ge:H,Ue)):"{"==e?A(j("}"),He,V):void 0}function He(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&I(t))&&T.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",A(He)):"variable"==e||"keyword"==T.style?(T.marked="property",A(qe,He)):"number"==e||"string"==e?A(qe,He):"["==e?A(H,de,z("]"),qe,He):"*"==t?(T.marked="keyword",A(He)):u&&"("==e?k(Be,He):";"==e||","==e?A(He):"}"==e?A():"@"==t?A(H,He):void 0}function qe(e,t){if("!"==t||"?"==t)return A(qe);if(":"==e)return A(ge,Fe);if("="==t)return A(q);var n=T.state.lexical.prev;return k(n&&"interface"==n.info?Be:Re)}function We(e,t){return"*"==t?(T.marked="keyword",A(Qe,z(";"))):"default"==t?(T.marked="keyword",A(H,z(";"))):"{"==e?A(ue(Ge,"}"),Qe,z(";")):k($)}function Ge(e,t){return"as"==t?(T.marked="keyword",A(z("variable"))):"variable"==e?k(q,Ge):void 0}function Ke(e){return"string"==e?A():"("==e?k(H):"."==e?k(Y):k(Ye,Xe,Qe)}function Ye(e,t){return"{"==e?ce(Ye,"}"):("variable"==e&&_(t),"*"==t&&(T.marked="keyword"),A(Je))}function Xe(e){if(","==e)return A(Ye,Xe)}function Je(e,t){if("as"==t)return T.marked="keyword",A(Ye)}function Qe(e,t){if("from"==t)return T.marked="keyword",A(H)}function Ze(e){return"]"==e?A():k(ue(q,"]"))}function et(){return k(j("form"),Ae,z("{"),j("}"),ue(tt,"}"),V,V)}function tt(){return k(Ae,Fe)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function rt(e,t,n){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return jOe(M,"pushcontext"),jOe(R,"pushblockcontext"),M.lex=R.lex=!0,jOe(B,"popcontext"),B.lex=!0,jOe(j,"pushlex"),jOe(V,"poplex"),V.lex=!0,jOe(z,"expect"),jOe($,"statement"),jOe(U,"maybeCatchBinding"),jOe(H,"expression"),jOe(q,"expressionNoComma"),jOe(W,"parenExpr"),jOe(G,"expressionInner"),jOe(K,"maybeexpression"),jOe(Y,"maybeoperatorComma"),jOe(X,"maybeoperatorNoComma"),jOe(J,"quasi"),jOe(Q,"continueQuasi"),jOe(Z,"arrowBody"),jOe(ee,"arrowBodyNoComma"),jOe(te,"maybeTarget"),jOe(ne,"target"),jOe(re,"targetNoComma"),jOe(ie,"maybelabel"),jOe(oe,"property"),jOe(ae,"objprop"),jOe(se,"getterSetter"),jOe(le,"afterprop"),jOe(ue,"commasep"),jOe(ce,"contCommasep"),jOe(pe,"block"),jOe(de,"maybetype"),jOe(fe,"maybetypeOrIn"),jOe(he,"mayberettype"),jOe(me,"isKW"),jOe(ge,"typeexpr"),jOe(ye,"maybeReturnType"),jOe(ve,"typeprops"),jOe(be,"typeprop"),jOe(xe,"quasiType"),jOe(Ee,"continueQuasiType"),jOe(De,"typearg"),jOe(we,"afterType"),jOe(Ce,"maybeTypeArgs"),jOe(Se,"typeparam"),jOe(Te,"maybeTypeDefault"),jOe(ke,"vardef"),jOe(Ae,"pattern"),jOe(Ne,"proppattern"),jOe(_e,"eltpattern"),jOe(Fe,"maybeAssign"),jOe(Ie,"vardefCont"),jOe(Pe,"maybeelse"),jOe(Oe,"forspec"),jOe(Le,"forspec1"),jOe(Me,"forspec2"),jOe(Re,"functiondef"),jOe(Be,"functiondecl"),jOe(je,"typename"),jOe(Ve,"funarg"),jOe(ze,"classExpression"),jOe($e,"className"),jOe(Ue,"classNameAfter"),jOe(He,"classBody"),jOe(qe,"classfield"),jOe(We,"afterExport"),jOe(Ge,"exportField"),jOe(Ke,"afterImport"),jOe(Ye,"importSpec"),jOe(Xe,"maybeMoreImports"),jOe(Je,"maybeAs"),jOe(Qe,"maybeFrom"),jOe(Ze,"arrayLiteral"),jOe(et,"enumdef"),jOe(tt,"enummember"),jOe(nt,"isContinuedStatement"),jOe(rt,"expressionAllowed"),{startState:function(e){var n={tokenize:g,lastType:"sof",cc:[],lexical:new w((e||0)-i,0,"block",!1),localVars:t.localVars,context:t.localVars&&new P(null,null,!1),indented:e||0};return t.globalVars&&"object"==typeof t.globalVars&&(n.globalVars=t.globalVars),n},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),E(e,t)),t.tokenize!=v&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==n?i:(t.lastType="operator"!=n||"++"!=r&&"--"!=r?n:"incdec",S(t,i,n,r,e))},indent:function(e,n){if(e.tokenize==v||e.tokenize==b)return zOe.Pass;if(e.tokenize!=g)return 0;var r,a=n&&n.charAt(0),s=e.lexical;if(!/^\s*else\b/.test(n))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==V)s=s.prev;else if(u!=Pe&&u!=B)break}for(;("stat"==s.type||"form"==s.type)&&("}"==a||(r=e.cc[e.cc.length-1])&&(r==Y||r==X)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;o&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var c=s.type,p=a==c;return"vardef"==c?s.indented+("operator"==e.lastType||","==e.lastType?s.info.length+1:0):"form"==c&&"{"==a?s.indented:"form"==c?s.indented+i:"stat"==c?s.indented+(nt(e,n)?o||i:0):"switch"!=s.info||p||0==t.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:i):s.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:a,jsonMode:s,expressionAllowed:rt,skipExpression:function(e){S(e,"atom","atom","true",new zOe.StringStream("",2,null))}}})),zOe.registerHelper("wordChars","javascript",/[\w$]/),zOe.defineMIME("text/javascript","javascript"),zOe.defineMIME("text/ecmascript","javascript"),zOe.defineMIME("application/javascript","javascript"),zOe.defineMIME("application/x-javascript","javascript"),zOe.defineMIME("application/ecmascript","javascript"),zOe.defineMIME("application/json",{name:"javascript",json:!0}),zOe.defineMIME("application/x-json",{name:"javascript",json:!0}),zOe.defineMIME("application/manifest+json",{name:"javascript",json:!0}),zOe.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),zOe.defineMIME("text/typescript",{name:"javascript",typescript:!0}),zOe.defineMIME("application/typescript",{name:"javascript",typescript:!0});var $Oe={};const UOe=VOe({__proto__:null,default:pPe($Oe)},[$Oe]),HOe=Object.freeze(Object.defineProperty({__proto__:null,j:UOe},Symbol.toStringTag,{value:"Module"}));var qOe=Object.defineProperty,WOe=(e,t)=>qOe(e,"name",{value:t,configurable:!0});function GOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}WOe(GOe,"_mergeNamespaces");!function(e){var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function a(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"\`]/.test(n)}function s(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}WOe(o,"firstNonWS"),e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),u=o[s].to();l.line>=i||(u.line>=i&&(u=r(i,0)),i=l.line,null==a?n.uncomment(l,u,e)?a="un":(n.lineComment(l,u,e),a="line"):"un"==a?n.uncomment(l,u,e):n.lineComment(l,u,e))}})),WOe(a,"probablyInsideString"),WOe(s,"getMode"),e.defineExtension("lineComment",(function(e,i,l){l||(l=t);var u=this,c=s(u,e),p=u.getLine(e.line);if(null!=p&&!a(u,e,p)){var d=l.lineComment||c.lineComment;if(!d)return void((l.blockCommentStart||c.blockCommentStart)&&(l.fullLines=!0,u.blockComment(e,i,l)));var f=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,u.lastLine()+1),h=null==l.padding?" ":l.padding,m=l.commentBlankLines||e.line==i.line;u.operation((function(){if(l.indent){for(var t=null,i=e.line;ia.length)&&(t=a)}for(i=e.line;id||l.operation((function(){if(0!=a.fullLines){var t=n.test(l.getLine(d));l.replaceRange(f+p,r(d)),l.replaceRange(c+f,r(e.line,0));var s=a.blockCommentLead||u.blockCommentLead;if(null!=s)for(var h=e.line+1;h<=d;++h)(h!=d||t)&&l.replaceRange(s+f,r(h,0))}else{var m=0==i(l.getCursor("to"),o),g=!l.somethingSelected();l.replaceRange(p,o),m&&l.setSelection(g?o:l.getCursor("from"),o),l.replaceRange(c,e)}}))}}else(a.lineComment||u.lineComment)&&0!=a.fullLines&&l.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var a,l=this,u=s(l,e),c=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,l.lastLine()),p=Math.min(e.line,c),d=o.lineComment||u.lineComment,f=[],h=null==o.padding?" ":o.padding;e:if(d){for(var m=p;m<=c;++m){var g=l.getLine(m),y=g.indexOf(d);if(y>-1&&!/comment/.test(l.getTokenTypeAt(r(m,y+1)))&&(y=-1),-1==y&&n.test(g)||y>-1&&n.test(g.slice(0,y)))break e;f.push(g)}if(l.operation((function(){for(var e=p;e<=c;++e){var t=f[e-p],n=t.indexOf(d),i=n+d.length;n<0||(t.slice(i,i+h.length)==h&&(i+=h.length),a=!0,l.replaceRange("",r(e,n),r(e,i)))}})),a)return!0}var v=o.blockCommentStart||u.blockCommentStart,b=o.blockCommentEnd||u.blockCommentEnd;if(!v||!b)return!1;var x=o.blockCommentLead||u.blockCommentLead,E=l.getLine(p),D=E.indexOf(v);if(-1==D)return!1;var w=c==p?E:l.getLine(c),C=w.indexOf(b,c==p?D+v.length:0),S=r(p,D+1),T=r(c,C+1);if(-1==C||!/comment/.test(l.getTokenTypeAt(S))||!/comment/.test(l.getTokenTypeAt(T))||l.getRange(S,T,"\n").indexOf(b)>-1)return!1;var k=E.lastIndexOf(v,e.ch),A=-1==k?-1:E.slice(0,e.ch).indexOf(b,k+v.length);if(-1!=k&&-1!=A&&A+b.length!=e.ch)return!1;A=w.indexOf(b,i.ch);var N=w.slice(i.ch).lastIndexOf(v,A-i.ch);return k=-1==A||-1==N?-1:i.ch+N,(-1==A||-1==k||k==i.ch)&&(l.operation((function(){l.replaceRange("",r(c,C-(h&&w.slice(C-h.length,C)==h?h.length:0)),r(c,C+b.length));var e=D+v.length;if(h&&E.slice(e,e+h.length)==h&&(e+=h.length),l.replaceRange("",r(p,D),r(p,e)),x)for(var t=p+1;t<=c;++t){var i=l.getLine(t),o=i.indexOf(x);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+x.length;h&&i.slice(a,a+h.length)==h&&(a+=h.length),l.replaceRange("",r(t,o),r(t,a))}}})),!0)}))}(hPe());var KOe={};const YOe=GOe({__proto__:null,default:pPe(KOe)},[KOe]),XOe=Object.freeze(Object.defineProperty({__proto__:null,c:YOe},Symbol.toStringTag,{value:"Module"}));var JOe=Object.defineProperty,QOe=(e,t)=>JOe(e,"name",{value:t,configurable:!0});function ZOe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}QOe(ZOe,"_mergeNamespaces");!function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,{caseFold:i(t),multiline:!0})}function a(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i,bottom:e.options.search.bottom})}function s(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function u(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function c(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch{}else e=u(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function p(e,n,r){n.queryText=r,n.query=c(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function d(t,n,i,o){var l=r(t);if(l.query)return f(t,n);var u=t.getSelection()||l.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),i&&t.openDialog){var c=null,d=QOe((function(n,r){e.e_stop(r),n&&(n!=l.queryText&&(p(t,l,n),l.posFrom=l.posTo=t.getCursor()),c&&(c.style.opacity=1),f(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((c=r).style.opacity=.4)})))}),"searchNext");a(t,g(t),u,d,(function(n,i){var o=e.keyName(n),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(n),p(t,r(t),i),t.execCommand(s)):("find"==s||"findPersistent"==s)&&(e.e_stop(n),d(i,n))})),o&&u&&(p(t,l,u),f(t,n))}else s(t,g(t),"Search for:",u,(function(e){e&&!l.query&&t.operation((function(){p(t,l,e),l.posFrom=l.posTo=t.getCursor(),f(t,n)}))}))}function f(t,n,i){t.operation((function(){var a=r(t),s=o(t,a.query,n?a.posFrom:a.posTo);!s.find(n)&&!(s=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n)||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function h(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;i{const{schema:n,externalFragments:r,autocompleteOptions:i}=t;if(!n)return;const o=e.getCursor(),a=e.getTokenAt(o),s=null!==a.type&&/"|\w/.test(a.string[0])?a.start:a.end,l=new kse(o.line,s),u={list:yse(n,e.getValue(),l,a,r,i).map((e=>{var t;return{text:null!==(t=null==e?void 0:e.rawInsert)&&void 0!==t?t:e.label,type:e.type,description:e.documentation,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason}})),from:{line:o.line,ch:s},to:{line:o.line,ch:a.end}};return null!=u&&u.list&&u.list.length>0&&(u.from=vPe.Pos(u.from.line,u.from.ch),u.to=vPe.Pos(u.to.line,u.to.ch),vPe.signal(e,"hasCompletion",e,u,a)),u}));const rLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),iLe=["error","warning","information","hint"],oLe={"GraphQL: Validation":"validation","GraphQL: Deprecation":"deprecation","GraphQL: Syntax":"syntax"};vPe.registerHelper("lint","graphql",((e,t)=>{const{schema:n,validationRules:r,externalFragments:i}=t;return Lse(e,n,r,0,i).map((e=>({message:e.message,severity:e.severity?iLe[e.severity-1]:iLe[0],type:e.source?oLe[e.source]:void 0,from:vPe.Pos(e.range.start.line,e.range.start.character),to:vPe.Pos(e.range.end.line,e.range.end.character)})))}));const aLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sLe=Object.defineProperty;function lLe(e,t){const n=[];let r=e;for(;null!=r&&r.kind;)n.push(r),r=r.prevState;for(let i=n.length-1;i>=0;i--)t(n[i])}((e,t)=>{sLe(e,"name",{value:t,configurable:!0})})(lLe,"forEachState");var uLe=Object.defineProperty,cLe=(e,t)=>uLe(e,"name",{value:t,configurable:!0});function pLe(e,t){const n={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return lLe(t,(t=>{var r,i;switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":case"AliasedField":n.fieldDef=n.type&&t.name?dLe(e,n.parentType,t.name):null,n.type=null===(r=n.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":n.parentType=n.type?bh(n.type):null;break;case"Directive":n.directiveDef=t.name?e.getDirective(t.name):null;break;case"Arguments":const o=t.prevState?"Field"===t.prevState.kind?n.fieldDef:"Directive"===t.prevState.kind?n.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&dLe(e,n.parentType,t.prevState.name):null:null;n.argDefs=o?o.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(let e=0;ee.value===t.name)):null;break;case"ListValue":const s=n.inputType?yh(n.inputType):null;n.inputType=s instanceof dh?s.ofType:null;break;case"ObjectValue":const l=n.inputType?bh(n.inputType):null;n.objectFieldDefs=l instanceof Rh?l.getFields():null;break;case"ObjectField":const u=t.name&&n.objectFieldDefs?n.objectFieldDefs[t.name]:null;n.inputType=null==u?void 0:u.type,n.fieldDef=u;break;case"NamedType":n.type=t.name?e.getType(t.name):null}})),n}function dLe(e,t,n){return n===Dm.name&&e.getQueryType()===t?Dm:n===wm.name&&e.getQueryType()===t?wm:n===Cm.name&&uh(t)?Cm:t&&t.getFields?t.getFields()[n]:void 0}function fLe(e,t){for(let n=0;nxLe(e,"name",{value:t,configurable:!0});function DLe(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}function wLe(e){const{options:t}=e.state.info;return(null==t?void 0:t.hoverTime)||500}function CLe(e,t){const n=e.state.info,r=t.target||t.srcElement;if(!(r instanceof HTMLElement)||"SPAN"!==r.nodeName||void 0!==n.hoverTimeout)return;const i=r.getBoundingClientRect(),o=ELe((function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(s,l)}),"onMouseMove"),a=ELe((function(){vPe.off(document,"mousemove",o),vPe.off(e.getWrapperElement(),"mouseout",a),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0}),"onMouseOut"),s=ELe((function(){vPe.off(document,"mousemove",o),vPe.off(e.getWrapperElement(),"mouseout",a),n.hoverTimeout=void 0,SLe(e,i)}),"onHover"),l=wLe(e);n.hoverTimeout=setTimeout(s,l),vPe.on(document,"mousemove",o),vPe.on(e.getWrapperElement(),"mouseout",a)}function SLe(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2},"window"),r=e.state.info,{options:i}=r,o=i.render||e.getHelper(n,"info");if(o){const r=e.getTokenAt(n,!0);if(r){const a=o(r,i,e,n);a&&TLe(e,t,a)}}}function TLe(e,t,n){const r=document.createElement("div");r.className="CodeMirror-info",r.append(n),document.body.append(r);const i=r.getBoundingClientRect(),o=window.getComputedStyle(r),a=i.right-i.left+parseFloat(o.marginLeft)+parseFloat(o.marginRight),s=i.bottom-i.top+parseFloat(o.marginTop)+parseFloat(o.marginBottom);let l=t.bottom;s>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(l=t.top-s),l<0&&(l=t.bottom);let u,c=Math.max(0,window.innerWidth-a-15);c>t.left&&(c=t.left),r.style.opacity="1",r.style.top=l+"px",r.style.left=c+"px";const p=ELe((function(){clearTimeout(u)}),"onMouseOverPopup"),d=ELe((function(){clearTimeout(u),u=setTimeout(f,200)}),"onMouseOut"),f=ELe((function(){vPe.off(r,"mouseover",p),vPe.off(r,"mouseout",d),vPe.off(e.getWrapperElement(),"mouseout",d),r.style.opacity?(r.style.opacity="0",setTimeout((()=>{r.parentNode&&r.remove()}),600)):r.parentNode&&r.remove()}),"hidePopup");vPe.on(r,"mouseover",p),vPe.on(r,"mouseout",d),vPe.on(e.getWrapperElement(),"mouseout",d)}vPe.defineOption("info",!1,((e,t,n)=>{if(n&&n!==vPe.Init){const t=e.state.info.onMouseOver;vPe.off(e.getWrapperElement(),"mouseover",t),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const n=e.state.info=DLe(t);n.onMouseOver=CLe.bind(null,e),vPe.on(e.getWrapperElement(),"mouseover",n.onMouseOver)}})),ELe(DLe,"createState"),ELe(wLe,"getHoverTime"),ELe(CLe,"onMouseOver"),ELe(SLe,"onMouseHover"),ELe(TLe,"showPopup");const kLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ALe=Object.defineProperty,NLe=(e,t)=>ALe(e,"name",{value:t,configurable:!0});function _Le(e,t,n){FLe(e,t,n),LLe(e,t,n,t.type)}function FLe(e,t,n){var r;jLe(e,(null===(r=t.fieldDef)||void 0===r?void 0:r.name)||"","field-name",n,hLe(t))}function ILe(e,t,n){var r;jLe(e,"@"+((null===(r=t.directiveDef)||void 0===r?void 0:r.name)||""),"directive-name",n,mLe(t))}function PLe(e,t,n){var r;jLe(e,(null===(r=t.argDef)||void 0===r?void 0:r.name)||"","arg-name",n,gLe(t)),LLe(e,t,n,t.inputType)}function OLe(e,t,n){var r;const i=(null===(r=t.enumValue)||void 0===r?void 0:r.name)||"";MLe(e,t,n,t.inputType),jLe(e,"."),jLe(e,i,"enum-value",n,yLe(t))}function LLe(e,t,n,r){const i=document.createElement("span");i.className="type-name-pill",r instanceof fh?(MLe(i,t,n,r.ofType),jLe(i,"!")):r instanceof dh?(jLe(i,"["),MLe(i,t,n,r.ofType),jLe(i,"]")):jLe(i,(null==r?void 0:r.name)||"","type-name",n,vLe(t,r)),e.append(i)}function MLe(e,t,n,r){r instanceof fh?(MLe(e,t,n,r.ofType),jLe(e,"!")):r instanceof dh?(jLe(e,"["),MLe(e,t,n,r.ofType),jLe(e,"]")):jLe(e,(null==r?void 0:r.name)||"","type-name",n,vLe(t,r))}function RLe(e,t,n){const{description:r}=n;if(r){const n=document.createElement("div");n.className="info-description",t.renderDescription?n.innerHTML=t.renderDescription(r):n.append(document.createTextNode(r)),e.append(n)}BLe(e,t,n)}function BLe(e,t,n){const r=n.deprecationReason;if(r){const n=document.createElement("div");n.className="info-deprecation",e.append(n);const i=document.createElement("span");i.className="info-deprecation-label",i.append(document.createTextNode("Deprecated")),n.append(i);const o=document.createElement("div");o.className="info-deprecation-reason",t.renderDescription?o.innerHTML=t.renderDescription(r):o.append(document.createTextNode(r)),n.append(o)}}function jLe(e,t,n="",r={onClick:null},i=null){if(n){const{onClick:o}=r;let a;o?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",(e=>{e.preventDefault(),o(i,e)}))):a=document.createElement("span"),a.className=n,a.append(document.createTextNode(t)),e.append(a)}else e.append(document.createTextNode(t))}vPe.registerHelper("info","graphql",((e,t)=>{if(!t.schema||!e.state)return;const{kind:n,step:r}=e.state,i=pLe(t.schema,e.state);if("Field"===n&&0===r&&i.fieldDef||"AliasedField"===n&&2===r&&i.fieldDef||"ObjectField"===n&&0===r&&i.fieldDef){const e=document.createElement("div");e.className="CodeMirror-info-header",_Le(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.fieldDef),n}if("Directive"===n&&1===r&&i.directiveDef){const e=document.createElement("div");e.className="CodeMirror-info-header",ILe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.directiveDef),n}if("Argument"===n&&0===r&&i.argDef){const e=document.createElement("div");e.className="CodeMirror-info-header",PLe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.argDef),n}if("EnumValue"===n&&i.enumValue&&i.enumValue.description){const e=document.createElement("div");e.className="CodeMirror-info-header",OLe(e,i,t);const n=document.createElement("div");return n.append(e),RLe(n,t,i.enumValue),n}if("NamedType"===n&&i.type&&i.type.description){const e=document.createElement("div");e.className="CodeMirror-info-header",MLe(e,i,t,i.type);const n=document.createElement("div");return n.append(e),RLe(n,t,i.type),n}})),NLe(_Le,"renderField"),NLe(FLe,"renderQualifiedField"),NLe(ILe,"renderDirective"),NLe(PLe,"renderArg"),NLe(OLe,"renderEnumValue"),NLe(LLe,"renderTypeAnnotation"),NLe(MLe,"renderType"),NLe(RLe,"renderDescription"),NLe(BLe,"renderDeprecation"),NLe(jLe,"text");const VLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var zLe=Object.defineProperty,$Le=(e,t)=>zLe(e,"name",{value:t,configurable:!0});function ULe(e,t){const n=t.target||t.srcElement;if(!(n instanceof HTMLElement)||"SPAN"!==(null==n?void 0:n.nodeName))return;const r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&KLe(e)}function HLe(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&YLe(e):e.state.jump.cursor=null}function qLe(e,t){if(e.state.jump.isHoldingModifier||!GLe(t.key))return;e.state.jump.isHoldingModifier=!0,e.state.jump.cursor&&KLe(e);const n=$Le((o=>{o.code===t.code&&(e.state.jump.isHoldingModifier=!1,e.state.jump.marker&&YLe(e),vPe.off(document,"keyup",n),vPe.off(document,"click",r),e.off("mousedown",i))}),"onKeyUp"),r=$Le((t=>{const{destination:n,options:r}=e.state.jump;n&&r.onClick(n,t)}),"onClick"),i=$Le(((t,n)=>{e.state.jump.destination&&(n.codemirrorIgnore=!0)}),"onMouseDown");vPe.on(document,"keyup",n),vPe.on(document,"click",r),e.on("mousedown",i)}vPe.defineOption("jump",!1,((e,t,n)=>{if(n&&n!==vPe.Init){const t=e.state.jump.onMouseOver;vPe.off(e.getWrapperElement(),"mouseover",t);const n=e.state.jump.onMouseOut;vPe.off(e.getWrapperElement(),"mouseout",n),vPe.off(document,"keydown",e.state.jump.onKeyDown),delete e.state.jump}if(t){const n=e.state.jump={options:t,onMouseOver:ULe.bind(null,e),onMouseOut:HLe.bind(null,e),onKeyDown:qLe.bind(null,e)};vPe.on(e.getWrapperElement(),"mouseover",n.onMouseOver),vPe.on(e.getWrapperElement(),"mouseout",n.onMouseOut),vPe.on(document,"keydown",n.onKeyDown)}})),$Le(ULe,"onMouseOver"),$Le(HLe,"onMouseOut"),$Le(qLe,"onKeyDown");const WLe=typeof navigator<"u"&&navigator&&navigator.appVersion.includes("Mac");function GLe(e){return e===(WLe?"Meta":"Control")}function KLe(e){if(e.state.jump.marker)return;const{cursor:t,options:n}=e.state.jump,r=e.coordsChar(t),i=e.getTokenAt(r,!0),o=n.getDestination||e.getHelper(r,"jump");if(o){const t=o(i,n,e);if(t){const n=e.markText({line:r.line,ch:i.start},{line:r.line,ch:i.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=n,e.state.jump.destination=t}}}function YLe(e){const{marker:t}=e.state.jump;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}$Le(GLe,"isJumpModifier"),$Le(KLe,"enableJumpMode"),$Le(YLe,"disableJumpMode"),vPe.registerHelper("jump","graphql",((e,t)=>{if(!t.schema||!t.onClick||!e.state)return;const{state:n}=e,{kind:r,step:i}=n,o=pLe(t.schema,n);return"Field"===r&&0===i&&o.fieldDef||"AliasedField"===r&&2===i&&o.fieldDef?hLe(o):"Directive"===r&&1===i&&o.directiveDef?mLe(o):"Argument"===r&&0===i&&o.argDef?gLe(o):"EnumValue"===r&&o.enumValue?yLe(o):"NamedType"===r&&o.type?vLe(o):void 0}));const XLe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var JLe=Object.defineProperty;function QLe(e,t){var n,r;const{levels:i,indentLevel:o}=e;return((i&&0!==i.length?i.at(-1)-(null!==(n=this.electricInput)&&void 0!==n&&n.test(t)?1:0):o)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}((e,t)=>{JLe(e,"name",{value:t,configurable:!0})})(QLe,"indent");var ZLe=Object.defineProperty,eMe=(e,t)=>ZLe(e,"name",{value:t,configurable:!0});const tMe=eMe((e=>{const t=Qae({eatWhitespace:e=>e.eatWhile(Wae),lexRules:Gae,parseRules:Kae,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}),"graphqlModeFactory");vPe.defineMode("graphql",tMe);const nMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var rMe=Object.defineProperty,iMe=(e,t)=>rMe(e,"name",{value:t,configurable:!0});function oMe(e,t,n){const r=aMe(n,lMe(t.string));if(!r)return;const i=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:r,from:{line:e.line,ch:i},to:{line:e.line,ch:t.end}}}function aMe(e,t){if(!t)return sMe(e,(e=>!e.isDeprecated));return sMe(sMe(e.map((e=>({proximity:uMe(lMe(e.text),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length)).map((e=>e.entry))}function sMe(e,t){const n=e.filter(t);return 0===n.length?e:n}function lMe(e){return e.toLowerCase().replaceAll(/\W/g,"")}function uMe(e,t){let n=cMe(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function cMe(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}function pMe(e,t,n){const r="Invalid"===t.state.kind?t.state.prevState:t.state,{kind:i,step:o}=r;if("Document"===i&&0===o)return oMe(e,t,[{text:"{"}]);const{variableToType:a}=n;if(!a)return;const s=dMe(a,t.state);if("Document"===i||"Variable"===i&&0===o){return oMe(e,t,Object.keys(a).map((e=>({text:`"${e}": `,type:a[e]}))))}if(("ObjectValue"===i||"ObjectField"===i&&0===o)&&s.fields){const n=Object.keys(s.fields).map((e=>s.fields[e]));return oMe(e,t,n.map((e=>({text:`"${e.name}": `,type:e.type,description:e.description}))))}if("StringValue"===i||"NumberValue"===i||"BooleanValue"===i||"NullValue"===i||"ListValue"===i&&1===o||"ObjectField"===i&&2===o||"Variable"===i&&2===o){const n=s.type?bh(s.type):void 0;if(n instanceof Rh)return oMe(e,t,[{text:"{"}]);if(n instanceof Oh){return oMe(e,t,n.getValues().map((e=>({text:`"${e.name}"`,type:n,description:e.description}))))}if(n===Kh)return oMe(e,t,[{text:"true",type:Kh,description:"Not false."},{text:"false",type:Kh,description:"Not true."}])}}function dMe(e,t){const n={type:null,fields:null};return lLe(t,(t=>{switch(t.kind){case"Variable":n.type=e[t.name];break;case"ListValue":{const e=n.type?yh(n.type):void 0;n.type=e instanceof dh?e.ofType:null;break}case"ObjectValue":{const e=n.type?bh(n.type):void 0;n.fields=e instanceof Rh?e.getFields():null;break}case"ObjectField":{const e=t.name&&n.fields?n.fields[t.name]:null;n.type=null==e?void 0:e.type;break}}})),n}iMe(oMe,"hintList"),iMe(aMe,"filterAndSortList"),iMe(sMe,"filterNonEmpty"),iMe(lMe,"normalizeText"),iMe(uMe,"getProximity"),iMe(cMe,"lexicalDistance"),vPe.registerHelper("hint","graphql-variables",((e,t)=>{const n=e.getCursor(),r=e.getTokenAt(n),i=pMe(n,r,t);return null!=i&&i.list&&i.list.length>0&&(i.from=vPe.Pos(i.from.line,i.from.ch),i.to=vPe.Pos(i.to.line,i.to.ch),vPe.signal(e,"hasCompletion",e,i,r)),i})),iMe(pMe,"getVariablesHint"),iMe(dMe,"getTypeInfo");const fMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hMe=Object.defineProperty,mMe=(e,t)=>hMe(e,"name",{value:t,configurable:!0});function gMe(e){yMe=e,vMe=e.length,bMe=xMe=EMe=-1,PMe(),OMe();const t=CMe();return NMe("EOF"),t}let yMe,vMe,bMe,xMe,EMe,DMe,wMe;function CMe(){const e=bMe,t=[];if(NMe("{"),!IMe("}")){do{t.push(SMe())}while(IMe(","));NMe("}")}return{kind:"Object",start:e,end:EMe,members:t}}function SMe(){const e=bMe,t="String"===wMe?AMe():null;NMe("String"),NMe(":");const n=kMe();return{kind:"Member",start:e,end:EMe,key:t,value:n}}function TMe(){const e=bMe,t=[];if(NMe("["),!IMe("]")){do{t.push(kMe())}while(IMe(","));NMe("]")}return{kind:"Array",start:e,end:EMe,values:t}}function kMe(){switch(wMe){case"[":return TMe();case"{":return CMe();case"String":case"Number":case"Boolean":case"Null":const e=AMe();return OMe(),e}NMe("Value")}function AMe(){return{kind:wMe,start:bMe,end:xMe,value:JSON.parse(yMe.slice(bMe,xMe))}}function NMe(e){if(wMe===e)return void OMe();let t;if("EOF"===wMe)t="[end of file]";else if(xMe-bMe>1)t="`"+yMe.slice(bMe,xMe)+"`";else{const e=yMe.slice(bMe).match(/^.+?\b/);t="`"+(e?e[0]:yMe[bMe])+"`"}throw FMe(`Expected ${e} but found ${t}.`)}mMe(gMe,"jsonParse"),mMe(CMe,"parseObj"),mMe(SMe,"parseMember"),mMe(TMe,"parseArr"),mMe(kMe,"parseVal"),mMe(AMe,"curToken"),mMe(NMe,"expect");class _Me extends Error{constructor(e,t){super(e),this.position=t}}function FMe(e){return new _Me(e,{start:bMe,end:xMe})}function IMe(e){if(wMe===e)return OMe(),!0}function PMe(){return xMe31;)if(92===DMe)switch(DMe=PMe(),DMe){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:PMe();break;case 117:PMe(),MMe(),MMe(),MMe(),MMe();break;default:throw FMe("Bad character escape sequence.")}else{if(xMe===vMe)throw FMe("Unterminated string.");PMe()}if(34!==DMe)throw FMe("Unterminated string.");PMe()}function MMe(){if(DMe>=48&&DMe<=57||DMe>=65&&DMe<=70||DMe>=97&&DMe<=102)return PMe();throw FMe("Expected hexadecimal digit.")}function RMe(){45===DMe&&PMe(),48===DMe?PMe():BMe(),46===DMe&&(PMe(),BMe()),(69===DMe||101===DMe)&&(DMe=PMe(),(43===DMe||45===DMe)&&PMe(),BMe())}function BMe(){if(DMe<48||DMe>57)throw FMe("Expected decimal digit.");do{PMe()}while(DMe>=48&&DMe<=57)}function jMe(e,t,n){var r;const i=[];for(const o of n.members)if(o){const n=null===(r=o.key)||void 0===r?void 0:r.value,a=t[n];if(a)for(const[t,r]of VMe(a,o.value))i.push(zMe(e,t,r));else i.push(zMe(e,o.key,`Variable "$${n}" does not appear in any GraphQL query.`))}return i}function VMe(e,t){if(!e||!t)return[];if(e instanceof fh)return"Null"===t.kind?[[t,`Type "${e}" is non-nullable and cannot be null.`]]:VMe(e.ofType,t);if("Null"===t.kind)return[];if(e instanceof dh){const n=e.ofType;if("Array"===t.kind){return UMe(t.values||[],(e=>VMe(n,e)))}return VMe(n,t)}if(e instanceof Rh){if("Object"!==t.kind)return[[t,`Type "${e}" must be an Object.`]];const n=Object.create(null),r=UMe(t.members,(t=>{var r;const i=null===(r=null==t?void 0:t.key)||void 0===r?void 0:r.value;n[i]=!0;const o=e.getFields()[i];if(!o)return[[t.key,`Type "${e}" does not have a field "${i}".`]];return VMe(o?o.type:void 0,t.value)}));for(const i of Object.keys(e.getFields())){const o=e.getFields()[i];!n[i]&&o.type instanceof fh&&!o.defaultValue&&r.push([t,`Object of type "${e}" is missing required field "${i}".`])}return r}return"Boolean"===e.name&&"Boolean"!==t.kind||"String"===e.name&&"String"!==t.kind||"ID"===e.name&&"Number"!==t.kind&&"String"!==t.kind||"Float"===e.name&&"Number"!==t.kind||"Int"===e.name&&("Number"!==t.kind||(0|t.value)!==t.value)||(e instanceof Oh||e instanceof Dh)&&("String"!==t.kind&&"Number"!==t.kind&&"Boolean"!==t.kind&&"Null"!==t.kind||$Me(e.parseValue(t.value)))?[[t,`Expected value of type "${e}".`]]:[]}function zMe(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function $Me(e){return null==e||e!=e}function UMe(e,t){return Array.prototype.concat.apply([],e.map(t))}mMe(_Me,"JSONSyntaxError"),mMe(FMe,"syntaxError"),mMe(IMe,"skip"),mMe(PMe,"ch"),mMe(OMe,"lex"),mMe(LMe,"readString"),mMe(MMe,"readHex"),mMe(RMe,"readNumber"),mMe(BMe,"readDigits"),vPe.registerHelper("lint","graphql-variables",((e,t,n)=>{if(!e)return[];let r;try{r=gMe(e)}catch(o){if(o instanceof _Me)return[zMe(n,o.position,o.message)];throw o}const{variableToType:i}=t;return i?jMe(n,i,r):[]})),mMe(jMe,"validateVariables"),mMe(VMe,"validateValue"),mMe(zMe,"lintError"),mMe($Me,"isNullish"),mMe(UMe,"mapCat");const HMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qMe=Object.defineProperty;vPe.defineMode("graphql-variables",(e=>{const t=Qae({eatWhitespace:e=>e.eatSpace(),lexRules:WMe,parseRules:GMe,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const WMe={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},GMe={Document:[qae("{"),Uae("Variable",$ae(qae(","))),qae("}")],Variable:[KMe("variable"),qae(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[Hae("Number","number")],StringValue:[Hae("String","string")],BooleanValue:[Hae("Keyword","builtin")],NullValue:[Hae("Keyword","keyword")],ListValue:[qae("["),Uae("Value",$ae(qae(","))),qae("]")],ObjectValue:[qae("{"),Uae("ObjectField",$ae(qae(","))),qae("}")],ObjectField:[KMe("attribute"),qae(":"),"Value"]};function KMe(e){return{style:e,match:e=>"String"===e.kind,update(e,t){e.name=t.value.slice(1,-1)}}}((e,t)=>{qMe(e,"name",{value:t,configurable:!0})})(KMe,"namedKey");const YMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));vPe.defineMode("graphql-results",(e=>{const t=Qae({eatWhitespace:e=>e.eatSpace(),lexRules:XMe,parseRules:JMe,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:QLe,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const XMe={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},JMe={Document:[qae("{"),Uae("Entry",qae(",")),qae("}")],Entry:[Hae("String","def"),qae(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[Hae("Number","number")],StringValue:[Hae("String","string")],BooleanValue:[Hae("Keyword","builtin")],NullValue:[Hae("Keyword","keyword")],ListValue:[qae("["),Uae("Value",qae(",")),qae("]")],ObjectValue:[qae("{"),Uae("ObjectField",qae(",")),qae("}")],ObjectField:[Hae("String","property"),qae(":"),"Value"]},QMe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));